| fix: upgrade to zod v4 (#4328) ## Changes - Upgrade zod to v4 It was a bit more involved; they changed the import strategy, some props, error messages, deprecated a bunch of methods - Upgrade zero yaml to v4 Since Zod is now part of our API, we need to be careful about updates like this. Thankfully, it's still mostly compatible. I wrote a little helper that syncs the package.json dependencies version so we keep people in sync whether they like it or not :D ## 🧪 Tests I tested zod v4 with `npm install -g nango@0.63.1-beta.1` and staging Locally: run the dashboard, call some endpoints, deploy your scripts, etc. <!-- Summary by @propel-code-bot --> --- This PR performs a full upgrade from Zod v3 to v4 across the Nango monorepo, affecting core CLI, backend jobs, Connect UI, examples, test suites, and related documentation. All existing imports and usages of Zod are refactored for the new namespace import pattern and breaking API changes in v4. CLI and migration tooling is enhanced to ensure that user projects remain in sync with the required Zod version via a new helper and stricter dependency enforcement during initialization, migration, and dev workflows. Type conversion utilities, test snapshots, and example scripts are adapted for Zod v4 compatibility, and accompanying documentation reflects the updated API. <details> <summary><strong>Key Changes</strong></summary> • Upgrade all Zod packages/dependencies from v3 to v4 and update all import statements to 'import * as z from "zod"'. • Adjust all usage sites for Zod breaking changes (e.g., schema/property APIs, type usage). • Introduce helper utility (checkAndSyncPackageJson) and associated workflow to strictly sync Zod version in user projects' package.json. • Update CLI tooling, migrations, zeroYaml, and example projects to enforce required Zod version. • Update Connect UI and frontend to use new Zod APIs and bump related peer dependencies (e.g., react-hook-form, Vite). • Adapt test snapshots, test fixtures, and CLI migration/unit tests for Zod v4 compatibility. • Adjust and document code samples, migration guides, and all references to Zod usage/patterns. </details> <details> <summary><strong>Affected Areas</strong></summary> • CLI core and migration code • Backend job routes and validation logic • Connect UI frontend and form handling • Package/dependency management for CLI-generated projects • Type conversion utilities between Zod and internal model fields • Test fixtures, snapshots, and unit tests • User and developer documentation, migration guides </details> *This summary was automatically generated by @propel-code-bot* | 1 年前 |