feat(contract): export wire contract from backend and generate frontend types

Adds a zero-dependency `frontend-contract` bin that serializes the real
NoticeStatus variants and FrontendEvent payloads, scripts/gen-contract.mjs
which emits the committed src/services/contract.ts, and a CI job that
regenerates it and fails on a non-empty diff. events.ts now derives its
event map from the generated contract instead of hand-typed shapes.
This commit is contained in:
Tunglies
2026-10-01 04:20:26 +08:00
parent 2282df5108
commit 208a57510e
10 changed files with 390 additions and 121 deletions
+1
View File
@@ -30,6 +30,7 @@
"i18n:check": "node scripts/cleanup-unused-i18n.mjs",
"i18n:format": "node scripts/cleanup-unused-i18n.mjs --align --apply",
"i18n:types": "node scripts/generate-i18n-keys.mjs",
"gen:contract": "node scripts/gen-contract.mjs",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest",