feat: update zod to 3.25 and explicitly import zod/v3 #1010
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