trigger.dev
trigger.dev copied to clipboard
feat: allow alternatives to zod
Is your feature request related to a problem? Please describe.
There are a lot of great schema validators out there and each have there pros and cons. However, forcing the trigger.dev user into using only one specific package is restrictive and doesn't necessarily fit into every project's configuration. For instance, if I prefer the yup library and already have a bunch of my schemas defined with yup, then I do not want to duplicate those in zod as well.
There is also an issue with resolving peer dependencies on zod that can cause TS infinite loops due to schema parsing when zod is not the same version. To solve this, a simple "resolutions" block in package.json can be used.
Describe the solution you'd like to see
I'd like to see a solution similar to @hookform/resolvers so that more than one validator library could be used.
Describe alternate solutions
N/A
Additional information
No response