schema-codegen-bridge
v0.2.0
Published
Run ZenStack generation for the schema-codegen-bridge suite with schema discovery and actionable plugin validation.
Maintainers
Readme
schema-codegen-bridge
A focused wrapper around zen generate for the Prisma Schema Codegen Bridge
suite. It finds the same schema locations as ZenStack, verifies that all three
generator blocks are configured, then runs the installed ZenStack CLI directly.
Install
npm install --save-dev schema-codegen-bridge \
@mdht/plugin-jazz-schema \
@mdht/plugin-ts-rest-contract \
@mdht/plugin-betterauth-claims@zenstackhq/cli is included, so a separate CLI install is not required.
Configure
Add all three blocks to your .zmodel file:
plugin jazz {
provider = '@mdht/plugin-jazz-schema'
output = '../generated/jazz-schema.ts'
}
plugin tsRestContract {
provider = '@mdht/plugin-ts-rest-contract'
output = '../generated/ts-rest-contract.ts'
}
plugin betterauthClaims {
provider = '@mdht/plugin-betterauth-claims'
output = '../generated/betterauth-claims.ts'
}Run
npx schema-codegen-bridge generateSchema discovery follows this order:
zenstack.schemain the nearestpackage.jsonschema.zmodelzenstack/schema.zmodel
Override it or forward additional ZenStack flags when needed:
npx schema-codegen-bridge generate --schema ./db/app.zmodel
npx schema-codegen-bridge generate -- --silentThe wrapper never downloads a second CLI through npx; it executes its declared
@zenstackhq/cli dependency. Missing blocks produce copy-pasteable configuration
instead of a later unresolved attribute or missing output.
Requirements
- Node.js 22.6 or newer
- The runtime dependencies required by each generated artifact
For package-specific setup and a complete example, see the project documentation.
License
MIT
