zod-prisma icon indicating copy to clipboard operation
zod-prisma copied to clipboard

include enum-values into generated files instead of importing them

Open michiim opened this issue 2 years ago • 2 comments

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.

michiim avatar Apr 21 '22 12:04 michiim

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!

CarterGrimmeisen avatar Apr 21 '22 13:04 CarterGrimmeisen

I'm late to the show but this should be possible with my zod-prisma-types generator.

chrishoermann avatar Dec 12 '22 20:12 chrishoermann