-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
chore(): upgrade zod to latest #14309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 140ca54 The changes in this PR will be included in the next version bump. This PR includes changesets to release 75 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 8 Skipped Deployments
|
|
@olivermrbl I ve made an attempt here, let me know what you think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
What
zod v4 comes with performance improvements, types simplification and such which would be great to get in and benefit from
ref: https://zod.dev/v4
ref2: https://zod.dev/v4#benchmarks
Note
Upgrade all packages to Zod v4 and migrate validation code, schemas, helpers, and tests (explicit record key types, metadata shapes, error handling, hook validation).
@medusajs/medusa,@medusajs/core-flows,@medusajs/framework,@medusajs/utils,@medusajs/workflows-sdk,@medusajs/admin-sdk,@medusajs/dashboard; add/updatezod-validation-error@^5.z.ZodType/ZodObject; removeZodEffectsusage; implement.superRefinewhere needed; require key type inz.record(keyType, valueType); standardize metadata toz.record(z.string(), z.unknown()).validateAndTransformBody/validateAndTransformQuerynow acceptZodType; revampedzod-helpersto handle v4 issue shape (inputvsreceived,invalid_value, union errors) and improved required-field messages.@medusajs/workflows-sdk:create-hooknow accepts any validator with.parse; tests updated for new issue shapes/messages.packages/admin/dashboard/.../forms/hooks.tsx) to dropZodEffects, use.superRefineand explicitz.record(z.string(), ...).inventory-stock,product-variants,products,price-lists,product-stock, etc.) to explicitz.record(keyType, valueType)and metadata key types.invalid_typenow usesinput, messages like “Invalid input: expected …”).Written by Cursor Bugbot for commit 140ca54. This will update automatically on new commits. Configure here.