From 8236c5e349372307f074d31d05fcfe9844e9c63f Mon Sep 17 00:00:00 2001 From: dev_agent Date: Fri, 2 Oct 2026 22:40:46 -0400 Subject: [PATCH] Add make build to embed the built PWA in the server binary Fixes review finding F1: nothing copied web/dist into internal/frontend/dist, so the server always embedded the placeholder. make build now builds the web app, replaces internal/frontend/dist with web/dist, and builds bin/mealquest. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 1 + Makefile | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 56e6e30..60709ee 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ deploy/secrets/ # Build artifacts and dependencies node_modules dist +bin/ # Placeholder so the Go embed compiles on a fresh clone; built assets stay ignored. !internal/frontend/dist/ internal/frontend/dist/* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6280f28 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +# Build entry point: build the PWA, embed it, then build the server binary. + +FRONTEND_DIST := internal/frontend/dist + +.PHONY: build web embed + +build: embed + go build -o bin/mealquest ./cmd/server + +web: + cd web && npm ci && npm run build + +# Replace the committed placeholder with the built PWA so go:embed picks it up. +embed: web + rm -rf $(FRONTEND_DIST)/* + cp -R web/dist/. $(FRONTEND_DIST)/