Sharing drizzle-zod schemas and types with the frontend
⚡drizzle-zod
I have a small side project with hono, drizzle, zod as the backend and vite + react as the frontend. It is a monorepo because I figured I would need shared types, and it has worked quite well having a shared package as a single source of truth for types I used in more places than one. I ran into a problem when I wanted to use a zod schema created by using drizzle-zod, which is that I would have to bundle drizzle into the frontend to be able to share this zod schema, right? Is there any way around this or a better solution than sharing types in this case. Maybe duplicating code here isn't the worst idea? I rather new to coding and have never stumbled upon this type of architectural problem before. I saw this issue on github https://github.com/drizzle-team/drizzle-orm/issues/941, so it seems drizzle does not have a way around this themselves and using yet another package for codegen seems excessive. Is this as hard as I am making it out to be?