feat: update zod to 3.25 and explicitly import zod/v3#1010
Open
apaleslimghost wants to merge 2 commits intomainfrom
Open
feat: update zod to 3.25 and explicitly import zod/v3#1010apaleslimghost wants to merge 2 commits intomainfrom
apaleslimghost wants to merge 2 commits intomainfrom
Conversation
76a41c8 to
db68e88
Compare
ivomurrell
reviewed
Jul 9, 2025
Contributor
ivomurrell
left a comment
There was a problem hiding this comment.
issue: i don't think zod needs to be a peer dependency of each plugin – what's the benefit of moving it from a dependency?
suggestion: I also don't think it needs to be a peer dependency of core/cli either; the same rationale I gave here should still apply.
question: has the new zod version been tested to be compatible? i know it initially included some changes that were not semver-compatible (like dropping CJS support) due to the infrastructure overhaul and not sure what the current state is.
Member
Author
|
discussed with @ivomurrell offline:
|
162e075 to
2123df6
Compare
Member
Author
2123df6 to
9121267
Compare
9121267 to
e07b905
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
in #998 i'm going need to update to Zod v4, because how Zod v3 handles defaults doesn't let me detect if the default is being used so i can print a deprecation warning.
starting with Zod v3.25, Zod v3 and v4 are exported as subpaths. this means we can update to Zod v4 without a breaking change by doing the following:
zod/v3👈🏻 you are herezod/v4, and make any changes to the schemas necessary withv4core/clidoesn't rely on plugins using any particular version of Zod; it's just doingsafeParse, which is compatible between v3 and v4. this PR also updates tozod-validation-errorv3.5 which is also compatible with both versions of Zod.this PR also adds regression tests for (almost all) schemas (didn't bother doing them for deprecated plugins like
herokuandnodemon. we're not testing every possible combination of invalid inputs etc, just higher-level behaviour like defaults and object passthrough that may behave differently in Zod v4.edit: a Zod 4.x package hasn't been published yet; the update route for Zod v4 is to update to 3.25 and import
zod/v4edit 2: Zod 4.x has now been published; updating dependencies to that can be done as a followup step