zenstackhq / zenstack

Fullstack TypeScript toolkit that enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
https://zenstack.dev
MIT License
2.05k stars 87 forks source link

[Feature Request] schema.prisma output dir option for generate cli command #1546

Closed nordbobirk closed 3 months ago

nordbobirk commented 3 months ago

Is your feature request related to a problem? Please describe. I want to have my zmodel schemas in ./prisma/schema, but when this is specified as the schema location with zenstack generate --schema, the generated schema.prisma ends up in ./prisma/schema/prisma. This is not recognized by Prisma as it only look for schemas in ./prisma and ./prisma/schema, and besides this it is also an ugly path.

Describe the solution you'd like I would love a generate option to specify the output directory for the generated prisma schema.

Describe alternatives you've considered A solution is to just have a main zmodel file at your project root and have it import other schemas. Generating from this would output the prisma schema to ./prisma, but it would be much nicer to just be able to specify the output dir for generated schemas.

nordbobirk commented 3 months ago

I have just realized that this is doable by defining an output directory as an option with the @core/prisma plugin in your schema, so this feature request is not very important