-
-
Notifications
You must be signed in to change notification settings - Fork 67
chore(deps): bump zod to 4.1 #925
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,6 @@ | |
"@orpc/standard-server-peer": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that the Example: Root {
"devDependencies": {
"zod": "^4.1.1"
}
} This package's {
"devDependencies": {
"zod": "workspace:*"
}
} |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,6 @@ | |
"devDependencies": { | ||
"arktype": "2.1.20", | ||
"valibot": "^1.1.0", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've noticed that the Example: Root {
"devDependencies": {
"zod": "^4.1.1"
}
} This package's {
"devDependencies": {
"zod": "workspace:*"
}
} |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,6 @@ | |
"@orpc/shared": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,6 @@ | |
"fastify": "^5.5.0", | ||
"rxjs": "^7.8.1", | ||
"supertest": "^7.1.4", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,6 @@ | |
"rou3": "^0.7.3" | ||
}, | ||
"devDependencies": { | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,6 @@ | |
}, | ||
"devDependencies": { | ||
"react": "^19.1.1", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,6 @@ | |
"@opentelemetry/api": "^1.9.0", | ||
"arktype": "2.1.20", | ||
"valibot": "^1.1.0", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,6 @@ | |
}, | ||
"devDependencies": { | ||
"@tanstack/solid-query": "^5.85.5", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainZod bump to ^4.1.1 looks good; run a quick workspace-wide sanity check. Change is scoped to devDependencies, which is low risk. To avoid drift and catch any packages that still import zod at runtime without declaring it as a dep/peer, run the script below. 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "1) Report any non-^4.1.1 zod versions across the repo"
fd -a -t f package.json | while read -r pkg; do
dev=$(jq -r '(.devDependencies.zod // empty)' "$pkg")
dep=$(jq -r '(.dependencies.zod // empty)' "$pkg")
peer=$(jq -r '(.peerDependencies.zod // empty)' "$pkg")
[[ -n "$dev" && "$dev" != "^4.1.1" ]] && echo "dev zod mismatch: $pkg -> $dev"
[[ -n "$dep" ]] && echo "has runtime dependency on zod: $pkg -> $dep"
[[ -n "$peer" ]] && echo "has peer dependency on zod: $pkg -> $peer"
done
echo
echo "2) Flag packages that import zod at runtime but only list it as a devDependency"
fd -t f package.json | while read -r pkg; do
dir=$(dirname "$pkg")
# true if zod is declared as dep or peer
if jq -e '(.dependencies.zod // empty) or (.peerDependencies.zod // empty)' "$pkg" >/dev/null; then
continue
fi
# find non-type-only imports from 'zod' outside tests
if rg -nP --glob '!**/test/**' --glob '!**/*.test.*' --glob '!**/__tests__/**' '^\s*import\s+(?!type\b).*from\s*[\'"]zod[\'"]' "$dir" >/dev/null 2>&1; then
echo "Potential runtime import without dep/peer: $pkg"
rg -nP --glob '!**/test/**' --glob '!**/*.test.*' --glob '!**/__tests__/**' '^\s*import\s+(?!type\b).*from\s*[\'"]zod[\'"]' "$dir" -n
fi
done
echo
echo "3) Spot old zod entries in pnpm-lock (if present)"
[[ -f pnpm-lock.yaml ]] && rg -n '^ zod@' pnpm-lock.yaml | sed -n '1,30p' || true Length of output: 17105 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "== 1) packages/zod/package.json peerDependency on zod =="
jq '.peerDependencies.zod // "none"' packages/zod/package.json || true
echo
echo "== 2) Runtime imports of zod (excluding tests) =="
rg -nP --glob '!**/test/**' --glob '!**/*.test.*' --glob '!**/__tests__/**' \
'^\s*import\s+(?!type\b).*from\s*[\'"]zod[\'"]' \
--type-add 'ts:*.ts' --type-add 'tsx:*.tsx' \
--type-add 'js:*.js' --type-add 'jsx:*.jsx' || echo "No runtime imports found"
echo
echo "== 3) Old zod entries in pnpm-lock.yaml =="
if [[ -f pnpm-lock.yaml ]]; then
rg -n '^ zod@' pnpm-lock.yaml | head -n 20 || echo "No old zod entries"
else
echo "pnpm-lock.yaml not present"
fi Length of output: 453 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "== 1) packages/zod/package.json peerDependency on zod =="
jq '.peerDependencies.zod // "none"' packages/zod/package.json || true
echo
echo "== 2) Runtime imports of zod (excluding tests) =="
rg -nP --glob '!**/test/**' --glob '!**/*.test.*' --glob '!**/__tests__/**' \
-e "^\s*import\s+(?!type\\b).*from\s*['\"]zod['\"]" -n . || echo "No runtime imports found"
echo
echo "== 3) Old zod entries in pnpm-lock.yaml =="
if [[ -f pnpm-lock.yaml ]]; then
rg -n '^ zod@' pnpm-lock.yaml | head -n 20 || echo "No old zod entries"
else
echo "pnpm-lock.yaml not present"
fi Length of output: 7976 Update
🤖 Prompt for AI Agents
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,6 @@ | |
}, | ||
"devDependencies": { | ||
"@tanstack/svelte-query": "^5.85.5", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,6 @@ | |
"@tanstack/vue-query": "^5.85.5", | ||
"svelte": "^5.38.2", | ||
"vue": "^3.5.18", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,6 @@ | |
}, | ||
"devDependencies": { | ||
"@trpc/server": "^11.4.3", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -52,6 +52,6 @@ | |||||||||||||
"wildcard-match": "^5.1.3" | ||||||||||||||
}, | ||||||||||||||
"devDependencies": { | ||||||||||||||
"zod": "^4.0.17" | ||||||||||||||
"zod": "^4.1.1" | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainConfirm peer range still supports intended majors (v3 vs v4). You bumped devDependency to ^4.1.1, while peerDependencies still allow "zod": ">=3.25.0". If @orpc/zod now targets v4 only (especially with zod4-specific code/tests), consider tightening to ">=4 <5" to prevent consumers from accidentally installing zod v3 at runtime. If v3 is still intentionally supported via a separate path, keeping the wide peer range is fine—please confirm. If v3 is no longer supported, apply: "peerDependencies": {
"@orpc/contract": "workspace:*",
"@orpc/server": "workspace:*",
- "zod": ">=3.25.0"
+ "zod": ">=4 <5"
}, Repo-wide quick check to ensure consistency of zod versions across package.json files: 🏁 Script executed: #!/bin/bash
# Lists all package.json entries that reference zod and their declared ranges
fd -t f package.json | while read -r f; do
jq -r --arg f "$f" '
[
$f,
(.dependencies.zod // empty),
(.devDependencies.zod // empty),
(.peerDependencies.zod // empty)
] | @tsv
' "$f"
done | awk -F'\t' '$2$3$4!="" { printf "%-60s dep:%-12s devDep:%-12s peer:%-12s\n", $1, $2, $3, $4 }' | sort Length of output: 13692 🏁 Script executed: #!/bin/bash
# Display the first 200 lines of the zod package manifest for inspection
sed -n '1,200p' packages/zod/package.json Length of output: 1286 🏁 Script executed: #!/bin/bash
# List all source files in the zod package to inspect structure
find packages/zod/src -type f Length of output: 1510 🏁 Script executed: #!/bin/bash
# Show the contents of the main entry point to verify v3 support
sed -n '1,200p' packages/zod/src/index.ts Length of output: 584 Confirm Zod v3 support or tighten peer range to v4-only Our tests and dev setup are using Zod 4 exclusively (devDependency is • In "peerDependencies": {
"@orpc/contract": "workspace:*",
"@orpc/server": "workspace:*",
- "zod": ">=3.25.0"
+ "zod": ">=4 <5"
}, • Run a repo-wide check to ensure no other package.json still expects Zod 3. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||
} | ||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -26,6 +26,6 @@ | |||||||||||||||||||||||||
"react": "^19.1.1", | ||||||||||||||||||||||||||
"react-dom": "^19.1.1", | ||||||||||||||||||||||||||
"typescript": "^5.9.2", | ||||||||||||||||||||||||||
"zod": "^4.0.17" | ||||||||||||||||||||||||||
"zod": "^4.1.1" | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainZod bump to ^4.1.1 looks good; verify it’s not used at runtime in this package. Since zod is listed under devDependencies, ensure no code that ships (or example build output) imports zod at runtime. If any runtime import exists, promote it to dependencies or peerDependencies accordingly. Run this repo-wide check from the root to confirm no runtime/source imports in the touched workspaces: 🏁 Script executed: #!/bin/bash
# Find zod imports across updated packages' source trees
rg -nP -C2 --type=ts --type=tsx --type=js --type=jsx \
"(from\\s+['\"]zod['\"]|require\\(['\"]zod['\"]\\))" \
playgrounds/astro packages/nest playgrounds/electron apps/content packages/svelte-query
# If any matches appear under published package src (e.g., packages/*/src),
# zod should be a dependency or peerDependency rather than only a devDependency. Length of output: 228 🏁 Script executed: #!/bin/bash
# Search for any runtime imports of zod without relying on rg --type flags
rg -n -C2 "import\s+.*from\s+['\"]zod['\"]|require\(['\"]zod['\"]\)" \
-g '*.js' -g '*.jsx' -g '*.ts' -g '*.tsx' \
playgrounds/astro packages/nest playgrounds/electron apps/content packages/svelte-query Length of output: 3505 Move Zod into runtime dependencies • Affected files:
• Required change: in playgrounds/astro/package.json, remove the Zod entry from devDependencies and add it under dependencies. For example: --- package.json
@@
- "devDependencies": {
- "zod": "^4.1.1"
- /* …other devDeps… */
- },
+ "dependencies": {
+ "zod": "^4.1.1"
+ /* …other runtime deps… */
+ },
+ "devDependencies": {
+ /* …other devDeps (without zod)… */
+ }, Please update the package.json accordingly to ensure Zod is installed at runtime. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,6 @@ | |
"react-dom": "^19.1.1", | ||
"typescript": "^5.9.2", | ||
"wxt": "^0.20.8", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,6 @@ | |
"@types/react-dom": "^19.1.7", | ||
"react": "^19.1.1", | ||
"react-dom": "^19.1.1", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,6 @@ | |
"typescript": "^5.9.2", | ||
"vite": "^6.3.5", | ||
"wrangler": "^4.31.0", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,6 @@ | |
"@types/node": "^22.15.30", | ||
"tsx": "^4.20.4", | ||
"typescript": "^5.9.2", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,6 @@ | |
"react-dom": "^19.1.1", | ||
"typescript": "^5.9.2", | ||
"vite": "^6.3.5", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,6 @@ | |
"tsconfig-paths": "^4.2.0", | ||
"typescript": "^5.9.2", | ||
"unbuild": "^3.6.1", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ | |
"react-dom": "^19.1.1", | ||
"server-only": "^0.0.1", | ||
"typescript": "^5.9.2", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainLGTM on the zod bump; verify workspace-wide consistency and lockfile. The upgrade to ^4.1.1 looks good for this playground. To avoid drift across the monorepo, please confirm all packages pin zod consistently and that the lockfile resolves to a single 4.1.x. Run the script to audit all package.json files and the lockfile: Optionally enforce a single version via a root override (pnpm): {
"name": "orpc-monorepo",
// ...
+ "pnpm": {
+ "overrides": {
+ "zod": "^4.1.1"
+ }
+ }
} 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "==> Enumerating zod versions across the repo"
fd -a package.json | while read -r f; do
for scope in dependencies devDependencies peerDependencies; do
v=$(jq -r --arg s "$scope" '.[$s].zod // empty' "$f")
if [ -n "$v" ]; then
printf "%s\t%s\t%s\n" "$f" "$scope" "$v"
fi
done
done | sort | tee /tmp/zod-versions.txt
echo
echo "==> Any non-^4.1.x constraints?"
rg -nP -v '^\S+\t\S+\t\^4\.1\.' /tmp/zod-versions.txt || echo "All zod entries are ^4.1.x"
echo
if [ -f pnpm-lock.yaml ]; then
echo "==> Lockfile zod entries (first 10 matches)"
rg -n '(^\s*name:\s*zod$|zod@)' -n pnpm-lock.yaml -C2 | head -n 100 || true
else
echo "No pnpm-lock.yaml found."
fi
echo
echo "==> Where is zod imported?"
rg -nP --glob '!**/dist/**' --glob '!**/.*/**' --type ts --type tsx --type js --type jsx '\bfrom\s+[\"\']zod[\"\']|\brequire\([\"\']zod[\"\']\)' -C2 || echo "No zod imports found." Length of output: 28168 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "==> Enumerating zod version constraints across the repo"
fd -a package.json | while IFS= read -r f; do
for scope in dependencies devDependencies peerDependencies; do
v=$(jq -r --arg s "$scope" '.[$s].zod // empty' "$f")
if [[ -n "$v" ]]; then
printf "%s\t%s\t%s\n" "$f" "$scope" "$v"
fi
done
done | sort > /tmp/zod_versions.txt
echo
echo "==> All zod version constraints:"
cat /tmp/zod_versions.txt
echo
echo "==> Non-^4.1.x constraints:"
grep -nP -v '^\S+\t\S+\t\^4\.1\.' /tmp/zod_versions.txt || echo "None"
echo
if [[ -f pnpm-lock.yaml ]]; then
echo "==> Zod entries in pnpm-lock.yaml (first 20 matches):"
grep -n 'zod@' pnpm-lock.yaml | head -n20 || true
else
echo "No pnpm-lock.yaml found."
fi
echo
echo "==> Zod import occurrences in code:"
rg -nP --glob '!**/dist/**' --glob '!**/.*/**' --type ts --type tsx --type js --type jsx '\bfrom\s+[\"\']zod[\"\']|\brequire\([\"\']zod[\"\']\)' -C2 || echo "No zod imports found." Length of output: 31663 Action Required: Align zod peerDependency & prune lockfile entries The audit shows that all consumer packages pin zod at • In "peerDependencies": {
- "zod": ">=3.25.0"
+ "zod": "^4.1.1"
} • Regenerate/clean the lockfile so only {
"name": "orpc-monorepo",
// …
+ "pnpm": {
+ "overrides": {
+ "zod": "^4.1.1"
+ }
+ }
} These changes will ensure a single zod version across the monorepo and remove outdated v3.x entries.
🤖 Prompt for AI Agents
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,6 @@ | |
"nuxt": "^3.17.7", | ||
"vue": "latest", | ||
"vue-router": "latest", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ | |
"svelte-check": "^4.3.0", | ||
"typescript": "^5.9.2", | ||
"vite": "^6.3.5", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,6 @@ | |
"react-dom": "^19.1.1", | ||
"vite": "^6.3.5", | ||
"vite-tsconfig-paths": "^5.1.4", | ||
"zod": "^4.0.17" | ||
"zod": "^4.1.1" | ||
} | ||
} |
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.
I noticed that the
zod
dependency version is explicitly defined and updated in multiplepackage.json
files across this monorepo. To improve maintainability and ensure all packages use a consistent version, you could define thezod
version in the rootpackage.json
and reference it using theworkspace:*
protocol in the individual package manifests.This approach centralizes version management, which simplifies future updates as you would only need to change the version number in one place.
For example:
Root
package.json
:This package's
package.json
: