node_modules/.repost/client, and @repost/client re-exports it, so application imports stay stable while the generated code stays out of your repo. This is the same pattern Prisma uses for @prisma/client.
What gets emitted
The generated code is data and types only. Serialization, retries, and transport live in the
@repost/client runtime, which the generated package imports from @repost/client/runtime.
Models become interfaces, optional fields become field?: T | null, and enums become a const object plus a type:
Regenerating
node_modules is not committed, so a fresh clone or a CI job with a restored dependency cache has no generated client yet. @repost/client’s install hook leaves a placeholder whose only job is to fail with a clear message instead of a raw module-resolution error:
postinstall script:
package.json
repost schema migrate dev also regenerates as part of recording a migration, and repost schema generate --check verifies in CI that nothing has drifted without writing.
Generation only ever overwrites directories it recognizes as its own output (by the repost-client- package-name prefix or the generation marker), so a mistyped path cannot destroy your code.
Custom output for monorepos
Setoutput to write the identical package to a path instead, and import it directly:
repost/schema.repost
@repost/client for its runtime. This is the pattern for workspaces where several apps consume one generated client, and for Yarn PnP layouts that have no node_modules to generate into. A schema can carry several TypeScript generators with distinct outputs; see polyglot monorepos.
The version handshake
The generated package declares descriptor format 2, checked whencreateRepostClient builds the method tree:
- Generated code older than the runtime: the error tells you to re-run
repost schema generatewith the current CLI. - Generated code newer than the runtime: the error tells you to upgrade
@repost/client. - Generated code that predates versioning: accepted with a one-time console warning asking you to regenerate.
Continue
Configuration
Client options, transport tuning, and injectable generators.
Polyglot monorepos
Generate this client alongside other languages from one schema.
Schema workflow
The commands behind init, generate, and migrate.