CLI and Code Generation
pnpm generate runs packages/cli/src/generate.ts against modules.config.ts. See Module System for the full mechanics; this page is the quick-reference version.
Inputs
modules.config.ts— the enabled module list,{ id, package }[].- Each enabled module's
src/index.ts— must exportmetadata: ModuleInfo, parsed statically (never executed).
Outputs (committed, never hand-edited)
apps/api/src/generated/modules.tsapps/api/src/generated/entities.tsapps/worker/src/generated/modules.tsapps/worker/src/generated/entities.tsapps/web/src/generated/navigation.tsapps/web/src/generated/routes.tsapps/web/src/generated/page-registry.ts
Failure modes
The generator exits non-zero — it does not warn and continue — when:
- A module's
srcdirectory does not resolve on disk. - A module has no valid
metadataexport. - A module's
requireslists a dependency that is not also enabled inmodules.config.ts.
It also warns (without failing) when a module's package.json version and its ModuleInfo.version disagree, since the two are hand-maintained independently.
CI runs pnpm generate on every pull request and fails if the result differs from what's committed, so a stale registry can't merge.
Run it
pnpm generate
Run it after any change to modules.config.ts or to a module's metadata.