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
codegen-ts: @emitRoutes (and emitGrid/emitForm/emitTanstack) are read by codegen but not registered, so they cannot be authored #349
So the per-entity opt-out that the agent-facing docs describe —
Per-entity opt-outs exist (e.g. skipping client-side artifacts for a given entity) and are set as attributes on the entity in metadata, not in code.
— is not reachable without the consumer writing a provider to register an attribute the codegen package already defines and consumes.
Ask
Register these four attributes on object.entity in the codegen package's own provider, so the documented opt-out loads. If they are deliberately consumer-registered, the docs should say so and show the provider wiring.
Why it matters beyond ergonomics
The natural way to say "this table has no REST surface" is @emitRoutes: false on the entity. Without it, the consumer expresses the same fact in generator config instead — which works, but puts it outside the metadata that is supposed to be the single spine.
The concrete case: a project found its routes generator emitting route files for its credential tables (a pin_hash table and a token_hash session table). Nothing mounted them, so nothing leaked — but the fix wanted to be one metadata attribute on two entities, and had to become a generator-config allowlist instead.
The five @emit* attributes are retired rather than registered. The report is right that they were read and never registered — and the behaviour was worse than "cannot be authored": meta gen loads OPEN and honoured them, while meta verify loads STRICT (ADR-0023) and rejected them. So the attribute worked and the drift gate documented beside it went red. Half-working, which is worse than either half.
command
load mode
result
meta gen
open
the attribute worked — the artifact was suppressed
meta verify
strict
ERR_UNKNOWN_ATTR — the build failed
Registering them was refused deliberately: it would move metamodelVersion and oblige four other registries to publish for a TypeScript-only generator kill switch none of them will ever read. The replacement already existed — decide per generator what you consume: wire only the generators whose output you import, and narrow one with its own filter.
The five names became entries in the metadata package's RETIRED_VOCABULARY, which already feeds both the loader diagnostic and meta upgrade's rewriter — so meta upgrade --apply removes them for you, and meta gen names every object still carrying one until you do.
@emitGrid is the one exception. It was opt-IN (a TPH subtype's own per-subtype grid) and a filter is ANDed with the built-in gates, so it can only ever narrow. It is now tphSubtypeGrids?: (entity) => boolean on tanstackGrid() and tanstackGridHook(). Pass the same predicate to both, or you reproduce #287 exactly.
Breaking if you ejected a generator on 0.24.5 or earlier: CODEGEN_ATTR_EMIT_ROUTES and its three siblings were public exports imported by the shipped reference templates, so an owned codegen/generators/*.ts fails with TS2305 after upgrading. Loud rather than silent, by choice — delete the import and the clause that used it.
Activity
dmealing commentedon Aug 31, 2026
Fixed on
main, ships in the next release.The five
@emit*attributes are retired rather than registered. The report is right that they were read and never registered — and the behaviour was worse than "cannot be authored":meta genloads OPEN and honoured them, whilemeta verifyloads STRICT (ADR-0023) and rejected them. So the attribute worked and the drift gate documented beside it went red. Half-working, which is worse than either half.meta genmeta verifyERR_UNKNOWN_ATTR— the build failedRegistering them was refused deliberately: it would move
metamodelVersionand oblige four other registries to publish for a TypeScript-only generator kill switch none of them will ever read. The replacement already existed — decide per generator what you consume: wire only the generators whose output you import, and narrow one with its ownfilter.The five names became entries in the metadata package's
RETIRED_VOCABULARY, which already feeds both the loader diagnostic andmeta upgrade's rewriter — someta upgrade --applyremoves them for you, andmeta gennames every object still carrying one until you do.@emitGridis the one exception. It was opt-IN (a TPH subtype's own per-subtype grid) and afilteris ANDed with the built-in gates, so it can only ever narrow. It is nowtphSubtypeGrids?: (entity) => booleanontanstackGrid()andtanstackGridHook(). Pass the same predicate to both, or you reproduce #287 exactly.Breaking if you ejected a generator on 0.24.5 or earlier:
CODEGEN_ATTR_EMIT_ROUTESand its three siblings were public exports imported by the shipped reference templates, so an ownedcodegen/generators/*.tsfails withTS2305after upgrading. Loud rather than silent, by choice — delete the import and the clause that used it.Migration guide:
docs/features/migrations/emit-attrs-to-generator-config.md.feat(codegen-ts): a generated routes file can mount fewer than five C…