refactor: upgrade Zod to v4#264
Conversation
Signed-off-by: Akihiro Nagai <77012577+314systems@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
📜 Recent review details🧰 Additional context used🧠 Learnings (1)📚 Learning: 2026-05-11T12:04:07.383ZApplied to files:
🔇 Additional comments (4)
📝 WalkthroughWalkthroughThis PR upgrades the Zod validation library from v3 to v4 and refactors ChangesZod v4 Upgrade and Code Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review Summary by QodoUpgrade Zod to v4 with validation refactoring
WalkthroughsDescription• Upgraded Zod dependency from v3 to v4 for improved validation APIs • Refactored validation logic to use safeParse() instead of try/catch • Fixed validation error formatting using Zod v4's prettifyError() function • Removed unused ZodError import and RunInstallInput type definition Diagramflowchart LR
A["Zod v3.24.1"] -- "upgrade" --> B["Zod v4.4.3"]
C["try/catch + parse()"] -- "refactor" --> D["safeParse()"]
E["Error formatting bug"] -- "fix" --> F["prettifyError()"]
G["Unused imports/types"] -- "cleanup" --> H["Removed"]
File Changes1. package.json
|
Overview
Upgraded Zod from v3 to v4 and refactored
run-install.tsto utilize the new APIs for cleaner flow and better error formatting.Changes
zodto^4.4.3.try/catchblock containing.parse()with.safeParse()inparseRunInstallfor more idiomatic TypeScript validation.[object Object]in the logs by adopting Zod v4's newz.prettifyError()function.ZodErrorand the internalRunInstallInputtype.Verification
tsc --noEmit) passes successfully.pnpm run buildto ensure the bundle builds without issues.Summary by CodeRabbit
Dependencies
zodto version 4.4.3.Improvements