Typegen
How to use the ProofKit typegen to generate types and Zod schemas
When your database changes, you'll need to update the types and Zod schemas used in your project. The ProofKit CLI has a built-in typegen tool to help with this.
pnpm proofkit typegen
This command is run automatically when you add a new data source or schema. Since the data returned from your data sources is validated against the Zod schemas that are generated by this tool, you might run into an error loading data if you forget to run this command after making changes to your database. Simply running this command again will re-generate the types and likely fix that error
The typegen
command may expose other errors in your codebase. For example, if you remove a field from your table or layout that was used in your web app, you'll see an error in your app after running the command.
To find all places in your codebase that need to be updated, run the TypeScript compiler manually:
pnpm tsc