refactor(gateway,ui): the page catalogue is generated from the router (#2050)
The assistant's catalogue was a 33-entry literal in Go, hand-maintained beside the dashboard's routes: eight real pages were missing from it, so page_index could not name them, and descriptions had drifted where both copies existed. The routes move to ui/src/router/routes.ts, free of component imports, and ui/scripts/pages.ts writes the catalogue from them. The nav and page_index now read the same generated file, and task pages:check fails when it is stale, the way the proto, sqlc and OpenAPI outputs do.
This commit is contained in:
7 files changed
+887
-554
No files matched your search
@@ -64,6 +64,18 @@ tasks:
|
||||
- task: db:generate
|
||||
- git diff --exit-code -- internal/infrastructure/postgres/postgresdb
|
||||
|
||||
pages:generate:
|
||||
desc: Write the dashboard's page catalogue to ui/pages/pages.json
|
||||
dir: ui
|
||||
cmds:
|
||||
- node --experimental-strip-types scripts/pages.ts
|
||||
|
||||
pages:check:
|
||||
desc: Regenerate the page catalogue and reject uncommitted differences
|
||||
cmds:
|
||||
- task: pages:generate
|
||||
- git diff --exit-code -- ui/pages/pages.json
|
||||
|
||||
openapi:generate:
|
||||
desc: Write the API's OpenAPI document to api/openapi.yaml
|
||||
cmds:
|
||||
@@ -344,6 +356,7 @@ tasks:
|
||||
# delete Go sources mid-walk. Install first, then fan out. Every Go step
|
||||
# embeds ui/dist, so the dashboard is built before any of them.
|
||||
- task: ui
|
||||
- task: pages:check
|
||||
- task: fmt
|
||||
- task: proto:check
|
||||
- task: db:check
|
||||
|
||||
Reference in new issue
Block a user