zod-prisma
zod-prisma copied to clipboard
include enum-values into generated files instead of importing them
I would like to use the generated schema-files also in my frontend (and not only in the backend, where these files are generated). But there is no (easy) way to copy them to my frontend project, because enum values are imported from '@prisma/client'. If these values were not imported by prisma client, but included, these files would be "exportable" to another project without any changes.
If you also like the idea of including enum values into the generated files, I would make a pull request.
Hmmm. Fair point, I can imagine it would be fairly easy to generate another file and zod schema for the enum and then simply use that in place of the import from the Prisma client. A PR would be appreciated for sure!
I'm late to the show but this should be possible with my zod-prisma-types generator.