Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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)
  58. # ── M13b smoke (W4: integration smoke across W1+W2+W3) ────────────
  59. # Composed of scripts/m13b_smoke.sh:
  60. # 1. health, 2. login, 3. create tenant, 4. bootstrap tenant_admin,
  61. # 5. tenant_admin login, 6. create source, 7. ingest (CONDITIONAL,
  62. # skipped if ingestd not running), 8. list sources, 9. suspend,
  63. # 10. ingest rejected on suspended (CONDITIONAL), 11-13. cross-tenant
  64. # 403 (tenant, source list, source POST), 14. tenant_admin own
  65. # tenant OK, 15. create telegram bot (bot_token NOT in response),
  66. # 16. invite → magic_link_token, 17. cleanup.
  67. # Exits 0 if all runnable steps pass.
  68. M13B_SMOKE = bash scripts/m13b_smoke.sh
  69. m13b-smoke:
  70. $(M13B_SMOKE)
  71. # ── Per-workstream smokes (already on master) ──────────────────────
  72. # make w1-smoke → companies CRUD (15 steps)
  73. # make w2-smoke → sources CRUD (19 steps)
  74. # make w3-smoke → telegram bots CRUD (32 steps)
  75. W1_SMOKE = bash scripts/m13b_w1_smoke.sh
  76. W2_SMOKE = bash scripts/m13b_w2_smoke.sh
  77. W3_SMOKE = bash scripts/m13b_w3_smoke.sh
  78. w1-smoke:
  79. $(W1_SMOKE)
  80. w2-smoke:
  81. $(W2_SMOKE)
  82. w3-smoke:
  83. $(W3_SMOKE)
  84. # ── M13b full suite: all per-W smokes + the integration smoke ──────
  85. # Use this to gate a release. Each smoke must exit 0.
  86. .PHONY: m13b-full
  87. m13b-full: w1-smoke w2-smoke w3-smoke m13b-smoke
  88. @echo "m13b full suite: PASS"