npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@schemashift/zod-v3-v4

v0.14.0

Published

Zod v3 to v4 upgrade transformer for SchemaShift — handles 17+ breaking changes with auto-transforms and runtime warnings

Readme

@schemashift/zod-v3-v4

Zod v3 → v4 upgrade transformer for SchemaShift. Handles 20+ breaking changes between Zod v3 and v4 with auto-transforms and runtime behavior warnings.

npm version npm downloads CI License: MIT

Tier: Individual

Installation

npm install @schemashift/zod-v3-v4

Usage

import { createZodV3ToV4Handler } from '@schemashift/zod-v3-v4';
import { TransformEngine } from '@schemashift/core';

const engine = new TransformEngine();
engine.registerHandler('zod-v3', 'v4', createZodV3ToV4Handler());

Breaking Changes Handled

Auto-Transforms

These changes are automatically applied to your code:

| v3 Pattern | v4 Pattern | Notes | |-----------|-----------|-------| | z.record(valueSchema) | z.record(z.string(), valueSchema) | Explicit key type required | | schemaA.merge(schemaB) | schemaA.extend(schemaB.shape) | .merge() deprecated | | z.nativeEnum(MyEnum) | z.enum(MyEnum) | nativeEnum renamed | | .superRefine(fn) | .check(fn) | Callback signature identical | | error.errors | error.issues | Property renamed | | { invalid_type_error: 'msg' } | { error: 'msg' } | Unified error param | | { required_error: 'msg' } | { error: 'msg' } | Unified error param | | Both error params | { error: (issue) => ... } | Function-based error |

Deprecation Warnings

These methods still work but are deprecated in v4:

| Method | Replacement | Warning | |--------|-------------|---------| | .superRefine() | .check() | Auto-renamed, warning emitted | | .strict() | z.strictObject() | Structural change, review needed | | .passthrough() | z.looseObject() | Structural change, review needed |

Runtime Behavior Warnings

These changes do not cause compile-time errors but silently change runtime behavior:

| Pattern | Issue | |---------|-------| | instanceof Error on ZodError | ZodError no longer extends Error in v4 | | .refine() followed by .transform() | .transform() now runs even when .refine() fails | | .default() + .optional() | .default() always provides a value, making .optional() a no-op | | .pipe() | Stricter type checking, may need explicit type annotations |

Other Detected Changes

| Pattern | Warning | |---------|---------| | .flatten() | Removed in v4, use .format() instead | | z.function() | Input/output parameter changes | | .uuid() | Stricter RFC 4122 validation | | z.discriminatedUnion() | Stricter discriminator requirements |

Mappings Reference

Behavior Changes Set

Methods with changed behavior in v4: default, uuid, record, discriminatedUnion, function, pipe.

Deprecated Methods Set

Methods deprecated in v4: merge, superRefine, strict, passthrough.

Auto-Transformable Methods

Methods that are automatically renamed: superRefine.check().

Error Property Renames

| v3 | v4 | |----|----| | .errors | .issues | | .formErrors | .formErrors (unchanged) | | .fieldErrors | .fieldErrors (unchanged) |

Error Parameter Changes

v3 accepted invalid_type_error and required_error as separate properties. v4 unifies these under a single error property (string or function).

Related Packages

License

MIT