You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The starter doesn't declare zod, so void gen model reports no validation library #505
The starter's pages/index.server.ts uses createInsertSchema from void/drizzle-zod (cli/template.ts:237), but the generated package.json has no zod. The starter works because pnpm fills drizzle-zod's zod peer with the copy other dependencies install (better-auth, @cloudflare/config). The app itself never declares zod.
void gen model detects the validation library from package.json only (cli/gen.ts:168-180), so even right after create it asks "No validation library detected". Choosing Zod doesn't add it to package.json; it only prints Remember to install zod (:206). The generated code imports zod directly, so type checking fails as is:
pnpm create void my-app # React / D1cd my-app
pnpm exec void gen model todos title:string done:boolean # choose Zod
pnpm exec tsc --noEmit
Proposal: let void init ask for the validation library (Zod / Valibot / ArkType), add it to package.json, and write the starter's index.server.ts with the matching void/drizzle-*. The starter and gen then assume the same library from the start. With Zod as the default, pressing Enter keeps today's flow. Like #495, it would also get a --validator flag.
If this direction works for you, I'll open a PR on top of #495.
The smallest fix would be adding zod to the starter's package.json, which also fixes the detection and the type error.
Activity
Declare Zod in database starters, closes voidzero-dev#505.