You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f12916a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(codegen-ts): routesFile({ registerAll: true }) registers every entity's routes in one call
An adopter estate found that no port generates an aggregate route registration, so
every new entity meant a hand edit to the host file in each port. For TypeScript the
two route generators can now emit it: `registerAll: true` adds `routes.index.ts`
(`routes.index.hono.ts` for Hono) at the target root, exporting `registerAllRoutes(...)`
that calls each generated entity's register function. Its doc comment carries the same
unauthenticated-by-default note as the per-entity files.
Off by default, so a project that does not ask gets no new file and `verify --codegen`
reports nothing new after an upgrade. The rendering is one engine function
(`renderRoutesIndex`, exported) that all four generators call, with handler names taken
from the same derivations the per-entity renderers use. Other ports: their route
templates are frozen for features; eject is the way to add one.
Tests: every import in the index resolves to a routes file the same run emitted and
names a function that file exports (Fastify and Hono, flat and package layout); TPH
subtypes and value objects are left out; a filter narrows it; nothing is emitted when
the option is off. ci-local --quick green.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1mRRB1K2WdYy82kntMQdx
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-runtime-ui/references/typescript.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,6 +176,12 @@ import { registerAuthorRoutes } from "./generated/Author.routes";
176
176
registerAuthorRoutes(app, { db }); // GET/POST/PATCH/PUT/DELETE under apiPrefix
177
177
```
178
178
179
+
To register every entity at once, pass `registerAll: true` to the generator
180
+
(`routesFile({ registerAll: true })` / `routesFileHono({ registerAll: true })`). It also
181
+
emits `routes.index.ts` (`routes.index.hono.ts` for Hono) at the target root with one
182
+
`registerAllRoutes(...)`, so a new entity needs no edit to the host file. It is off by
183
+
default.
184
+
179
185
The routes call `parseFilterParams` (from `@metaobjectsdev/runtime-ts/drizzle-fastify`)
180
186
to validate `?filter[..][..]=..&sort=..&limit=&offset=` against the generated
181
187
`<Entity>FilterAllowlist` / `<Entity>SortAllowlist`, returning HTTP 400 on an
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/ts-requirements/expected/.claude/skills/metaobjects-runtime-ui/references/typescript.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,6 +176,12 @@ import { registerAuthorRoutes } from "./generated/Author.routes";
176
176
registerAuthorRoutes(app, { db }); // GET/POST/PATCH/PUT/DELETE under apiPrefix
177
177
```
178
178
179
+
To register every entity at once, pass `registerAll: true` to the generator
180
+
(`routesFile({ registerAll: true })` / `routesFileHono({ registerAll: true })`). It also
181
+
emits `routes.index.ts` (`routes.index.hono.ts` for Hono) at the target root with one
182
+
`registerAllRoutes(...)`, so a new entity needs no edit to the host file. It is off by
183
+
default.
184
+
179
185
The routes call `parseFilterParams` (from `@metaobjectsdev/runtime-ts/drizzle-fastify`)
180
186
to validate `?filter[..][..]=..&sort=..&limit=&offset=` against the generated
181
187
`<Entity>FilterAllowlist` / `<Entity>SortAllowlist`, returning HTTP 400 on an
0 commit comments