Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Makefile for broad-announce
  2. #
  3. # Dev targets:
  4. # make proto — regenerate Go stubs from .proto files
  5. # make vet — run go vet on all packages
  6. # make build — build all Go binaries
  7. # make test — run Go unit tests
  8. # make web-install — pnpm install in web/
  9. # make web-build — build the SPA into web/dist/
  10. # make web-dev — vite dev server on :5173
  11. # make web-test — vitest run in web/
  12. # make web-typecheck — tsc --noEmit
  13. # make build — builds Go + embeds web/dist into admind
  14. .PHONY: proto vet build test web-install web-build web-dev web-test web-typecheck build-with-web
  15. PROTO_DIR := proto
  16. GEN_DIR := gen/go
  17. BUF := buf
  18. # proto regenerates the Go stubs from .proto sources.
  19. # Run this whenever you edit anything under proto/.
  20. proto:
  21. cd $(PROTO_DIR) && \
  22. $(BUF) lint --config $(PROTO_DIR)/buf.yaml . && \
  23. $(BUF) generate --template $(PROTO_DIR)/buf.gen.yaml $(PROTO_DIR)/
  24. go build ./$(GEN_DIR)/...
  25. vet:
  26. go vet ./...
  27. build:
  28. go build ./cmd/...
  29. test:
  30. go test ./...
  31. # ── Frontend (M13b W0) ─────────────────────────────────────────────
  32. # web-install runs pnpm install for the web workspace.
  33. # Idempotent; uses the local pnpm-store at .pnpm-store.
  34. web-install:
  35. pnpm install --frozen-lockfile=false
  36. # web-build produces web/dist/ that the admind binary embeds
  37. # via //go:embed web/dist/*.
  38. web-build:
  39. cd web && pnpm run build
  40. # web-dev starts the Vite dev server on :5173 with proxy
  41. # rules so /v1/* goes to the local stack. Bring up the stack
  42. # (docker compose up -d) before running this.
  43. web-dev:
  44. cd web && pnpm run dev
  45. # web-test runs the vitest unit tests.
  46. web-test:
  47. cd web && pnpm run test
  48. # web-typecheck runs tsc without emitting.
  49. web-typecheck:
  50. cd web && pnpm exec tsc --noEmit
  51. # build-with-web runs the SPA build first, then builds all
  52. # Go binaries so admind picks up the freshly built web/dist.
  53. build-with-web: web-build build
  54. # ── M13a smoke ────────────────────────────────────────────────────
  55. M13A_SMOKE = bash scripts/m13a_smoke.sh
  56. m13a-smoke:
  57. $(M13A_SMOKE)