From 274035ed6df98a42624d71174f797a7a55e9b512 Mon Sep 17 00:00:00 2001 From: Stephan D Date: Wed, 11 Feb 2026 10:40:12 +0100 Subject: [PATCH] added proto generation commands --- Makefile | 20 ++++++++++++++++++-- README.md | 7 +++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index fae8663b..6ec216d7 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Sendico Development Environment - Makefile # Docker Compose + Makefile build system -.PHONY: help init build up down restart logs rebuild clean vault-init proto update update-api update-frontend test test-api test-frontend +.PHONY: help init build up down restart logs rebuild clean vault-init proto generate generate-api generate-frontend update update-api update-frontend test test-api test-frontend COMPOSE := docker compose -f docker-compose.dev.yml --env-file .env.dev SERVICE ?= @@ -43,6 +43,9 @@ help: @echo "" @echo "$(YELLOW)Development:$(NC)" @echo " make proto Generate protobuf code" + @echo " make generate Generate all code (protobuf + Flutter)" + @echo " make generate-api Generate protobuf code only" + @echo " make generate-frontend Generate Flutter code only" @echo " make update Update all dependencies (Go + Flutter)" @echo " make update-api Update Go dependencies only" @echo " make update-frontend Update Flutter dependencies only" @@ -142,12 +145,25 @@ endif @echo "$(GREEN)✅ $(SERVICE) rebuilt$(NC)" @echo "View logs: make logs SERVICE=$(SERVICE)" +# Generate protobuf code (alias) +proto: generate-api + +# Generate all code +generate: generate-api generate-frontend + # Generate protobuf code -proto: +generate-api: @echo "$(GREEN)Generating protobuf code...$(NC)" @./generate_protos.sh @echo "$(GREEN)✅ Protobuf generation complete$(NC)" +# Generate Flutter code (json_serializable, etc.) +generate-frontend: + @echo "$(GREEN)Generating Flutter code...$(NC)" + @cd frontend/pshared && flutter pub run build_runner build --delete-conflicting-outputs + @cd frontend/pweb && flutter pub run build_runner build --delete-conflicting-outputs + @echo "$(GREEN)✅ Flutter code generation complete$(NC)" + # Clean everything clean: @echo "$(YELLOW)WARNING: This will remove all containers and volumes!$(NC)" diff --git a/README.md b/README.md index b38c6fd8..6b2175fc 100644 --- a/README.md +++ b/README.md @@ -73,10 +73,13 @@ make build-api # notification, bff make build-frontend # Flutter web UI ``` -### Protobuf Generation +### Code Generation ```bash -make proto +make generate # Generate all code (protobuf + Flutter) +make generate-api # Generate protobuf code only +make generate-frontend # Generate Flutter code only (build_runner) +make proto # Alias for generate-api ``` ### Testing -- 2.49.1