From d983af93b37c241ea232f61dc48a45ef5a233da0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 11:58:02 +0200 Subject: [PATCH] chore(deps): update dependency zod to v4 (v3) (#4523) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benjamin Canac --- docs/package.json | 2 +- package.json | 2 +- playground-vue/package.json | 2 +- playground/package.json | 2 +- pnpm-lock.yaml | 79 ++++++++++++++++++++---------------- test/components/Form.spec.ts | 24 +++++------ 6 files changed, 60 insertions(+), 51 deletions(-) diff --git a/docs/package.json b/docs/package.json index 8bd07f13..57ecda41 100644 --- a/docs/package.json +++ b/docs/package.json @@ -42,7 +42,7 @@ "valibot": "^1.1.0", "workers-ai-provider": "^0.7.2", "yup": "^1.6.1", - "zod": "^3.25.76" + "zod": "^4.0.5" }, "devDependencies": { "wrangler": "^4.24.3" diff --git a/package.json b/package.json index e87e9253..91815283 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ "valibot": "^1.0.0", "vue-router": "^4.5.0", "yup": "^1.6.0", - "zod": "^3.24.0" + "zod": "^3.24.0 || ^4.0.0" }, "peerDependenciesMeta": { "@inertiajs/vue3": { diff --git a/playground-vue/package.json b/playground-vue/package.json index de50f8aa..6e78373e 100644 --- a/playground-vue/package.json +++ b/playground-vue/package.json @@ -13,7 +13,7 @@ "@nuxt/ui": "workspace:*", "vue": "^3.5.17", "vue-router": "^4.5.1", - "zod": "^3.25.76" + "zod": "^4.0.5" }, "devDependencies": { "@vitejs/plugin-vue": "^5.2.4", diff --git a/playground/package.json b/playground/package.json index 1b4a66b8..2c4cb89e 100644 --- a/playground/package.json +++ b/playground/package.json @@ -15,7 +15,7 @@ "@nuxt/ui": "workspace:*", "@nuxthub/core": "^0.9.0", "nuxt": "^3.17.7", - "zod": "^3.25.76" + "zod": "^4.0.5" }, "devDependencies": { "typescript": "^5.8.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d57b61f9..c5b8d4ed 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,8 +164,8 @@ importers: specifier: ^1.6.0 version: 1.6.1 zod: - specifier: ^3.24.0 - version: 3.25.76 + specifier: ^3.24.0 || ^4.0.0 + version: 4.0.5 devDependencies: '@nuxt/eslint-config': specifier: ^1.5.2 @@ -226,7 +226,7 @@ importers: dependencies: '@ai-sdk/vue': specifier: ^1.2.12 - version: 1.2.12(vue@3.5.17(typescript@5.8.3))(zod@3.25.76) + version: 1.2.12(vue@3.5.17(typescript@5.8.3))(zod@4.0.5) '@iconify-json/logos': specifier: ^1.2.4 version: 1.2.4 @@ -250,7 +250,7 @@ importers: version: link:.. '@nuxt/ui-pro': specifier: https://pkg.pr.new/@nuxt/ui-pro@17684e4 - version: https://pkg.pr.new/@nuxt/ui-pro@17684e4(@babel/parser@7.27.7)(joi@17.13.3)(magicast@0.3.5)(react@19.1.0)(superstruct@2.0.2)(typescript@5.8.3)(valibot@1.1.0(typescript@5.8.3))(vue@3.5.17(typescript@5.8.3))(yup@1.6.1)(zod@3.25.76) + version: https://pkg.pr.new/@nuxt/ui-pro@17684e4(@babel/parser@7.27.7)(joi@17.13.3)(magicast@0.3.5)(react@19.1.0)(superstruct@2.0.2)(typescript@5.8.3)(valibot@1.1.0(typescript@5.8.3))(vue@3.5.17(typescript@5.8.3))(yup@1.6.1)(zod@4.0.5) '@nuxthub/core': specifier: ^0.9.0 version: 0.9.0(db0@0.3.2(better-sqlite3@12.2.0))(ioredis@5.6.1)(magicast@0.3.5)(vite@6.3.5(@types/node@24.0.7)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)) @@ -271,7 +271,7 @@ importers: version: 13.5.0(magicast@0.3.5)(nuxt@3.17.7(@parcel/watcher@2.5.1)(@types/node@24.0.7)(@vue/compiler-sfc@3.5.17)(better-sqlite3@12.2.0)(db0@0.3.2(better-sqlite3@12.2.0))(eslint@9.31.0(jiti@2.4.2))(ioredis@5.6.1)(lightningcss@1.30.1)(magicast@0.3.5)(meow@13.2.0)(optionator@0.9.4)(rollup@4.34.9)(terser@5.43.1)(typescript@5.8.3)(vite@6.3.5(@types/node@24.0.7)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))(vue-tsc@3.0.1(typescript@5.8.3))(yaml@2.8.0))(vue@3.5.17(typescript@5.8.3)) ai: specifier: ^4.3.17 - version: 4.3.17(react@19.1.0)(zod@3.25.76) + version: 4.3.17(react@19.1.0)(zod@4.0.5) better-sqlite3: specifier: ^12.2.0 version: 12.2.0 @@ -319,13 +319,13 @@ importers: version: 1.1.0(typescript@5.8.3) workers-ai-provider: specifier: ^0.7.2 - version: 0.7.2(zod@3.25.76) + version: 0.7.2(zod@4.0.5) yup: specifier: ^1.6.1 version: 1.6.1 zod: - specifier: ^3.25.76 - version: 3.25.76 + specifier: ^4.0.5 + version: 4.0.5 devDependencies: wrangler: specifier: ^4.24.3 @@ -352,8 +352,8 @@ importers: specifier: ^3.17.7 version: 3.17.7(@parcel/watcher@2.5.1)(@types/node@24.0.7)(@vue/compiler-sfc@3.5.17)(better-sqlite3@12.2.0)(db0@0.3.2(better-sqlite3@12.2.0))(eslint@9.31.0(jiti@2.4.2))(ioredis@5.6.1)(lightningcss@1.30.1)(magicast@0.3.5)(meow@13.2.0)(optionator@0.9.4)(rollup@4.34.9)(terser@5.43.1)(typescript@5.8.3)(vite@7.0.2(@types/node@24.0.7)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))(vue-tsc@3.0.1(typescript@5.8.3))(yaml@2.8.0) zod: - specifier: ^3.25.76 - version: 3.25.76 + specifier: ^4.0.5 + version: 4.0.5 devDependencies: typescript: specifier: ^5.8.3 @@ -374,8 +374,8 @@ importers: specifier: ^4.5.1 version: 4.5.1(vue@3.5.17(typescript@5.8.3)) zod: - specifier: ^3.25.76 - version: 3.25.76 + specifier: ^4.0.5 + version: 4.0.5 devDependencies: '@vitejs/plugin-vue': specifier: ^5.2.4 @@ -7764,43 +7764,46 @@ packages: zod@3.25.76: resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} + zod@4.0.5: + resolution: {integrity: sha512-/5UuuRPStvHXu7RS+gmvRf4NXrNxpSllGwDnCBcJZtQsKrviYXm54yDGV2KYNLT5kq0lHGcl7lqWJLgSaG+tgA==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} snapshots: - '@ai-sdk/provider-utils@2.2.8(zod@3.25.76)': + '@ai-sdk/provider-utils@2.2.8(zod@4.0.5)': dependencies: '@ai-sdk/provider': 1.1.3 nanoid: 3.3.11 secure-json-parse: 2.7.0 - zod: 3.25.76 + zod: 4.0.5 '@ai-sdk/provider@1.1.3': dependencies: json-schema: 0.4.0 - '@ai-sdk/react@1.2.12(react@19.1.0)(zod@3.25.76)': + '@ai-sdk/react@1.2.12(react@19.1.0)(zod@4.0.5)': dependencies: - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) - '@ai-sdk/ui-utils': 1.2.11(zod@3.25.76) + '@ai-sdk/provider-utils': 2.2.8(zod@4.0.5) + '@ai-sdk/ui-utils': 1.2.11(zod@4.0.5) react: 19.1.0 swr: 2.3.3(react@19.1.0) throttleit: 2.1.0 optionalDependencies: - zod: 3.25.76 + zod: 4.0.5 - '@ai-sdk/ui-utils@1.2.11(zod@3.25.76)': + '@ai-sdk/ui-utils@1.2.11(zod@4.0.5)': dependencies: '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) - zod: 3.25.76 - zod-to-json-schema: 3.24.6(zod@3.25.76) + '@ai-sdk/provider-utils': 2.2.8(zod@4.0.5) + zod: 4.0.5 + zod-to-json-schema: 3.24.6(zod@4.0.5) - '@ai-sdk/vue@1.2.12(vue@3.5.17(typescript@5.8.3))(zod@3.25.76)': + '@ai-sdk/vue@1.2.12(vue@3.5.17(typescript@5.8.3))(zod@4.0.5)': dependencies: - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) - '@ai-sdk/ui-utils': 1.2.11(zod@3.25.76) + '@ai-sdk/provider-utils': 2.2.8(zod@4.0.5) + '@ai-sdk/ui-utils': 1.2.11(zod@4.0.5) swrv: 1.1.0(vue@3.5.17(typescript@5.8.3)) optionalDependencies: vue: 3.5.17(typescript@5.8.3) @@ -9338,9 +9341,9 @@ snapshots: - magicast - typescript - '@nuxt/ui-pro@https://pkg.pr.new/@nuxt/ui-pro@17684e4(@babel/parser@7.27.7)(joi@17.13.3)(magicast@0.3.5)(react@19.1.0)(superstruct@2.0.2)(typescript@5.8.3)(valibot@1.1.0(typescript@5.8.3))(vue@3.5.17(typescript@5.8.3))(yup@1.6.1)(zod@3.25.76)': + '@nuxt/ui-pro@https://pkg.pr.new/@nuxt/ui-pro@17684e4(@babel/parser@7.27.7)(joi@17.13.3)(magicast@0.3.5)(react@19.1.0)(superstruct@2.0.2)(typescript@5.8.3)(valibot@1.1.0(typescript@5.8.3))(vue@3.5.17(typescript@5.8.3))(yup@1.6.1)(zod@4.0.5)': dependencies: - '@ai-sdk/vue': 1.2.12(vue@3.5.17(typescript@5.8.3))(zod@3.25.76) + '@ai-sdk/vue': 1.2.12(vue@3.5.17(typescript@5.8.3))(zod@4.0.5) '@nuxt/kit': 3.17.7(magicast@0.3.5) '@nuxt/schema': 3.17.7 '@nuxt/ui': 'link:' @@ -9366,7 +9369,7 @@ snapshots: superstruct: 2.0.2 valibot: 1.1.0(typescript@5.8.3) yup: 1.6.1 - zod: 3.25.76 + zod: 4.0.5 transitivePeerDependencies: - '@babel/parser' - '@emotion/is-prop-valid' @@ -10848,15 +10851,15 @@ snapshots: agent-base@7.1.3: {} - ai@4.3.17(react@19.1.0)(zod@3.25.76): + ai@4.3.17(react@19.1.0)(zod@4.0.5): dependencies: '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) - '@ai-sdk/react': 1.2.12(react@19.1.0)(zod@3.25.76) - '@ai-sdk/ui-utils': 1.2.11(zod@3.25.76) + '@ai-sdk/provider-utils': 2.2.8(zod@4.0.5) + '@ai-sdk/react': 1.2.12(react@19.1.0)(zod@4.0.5) + '@ai-sdk/ui-utils': 1.2.11(zod@4.0.5) '@opentelemetry/api': 1.9.0 jsondiffpatch: 0.6.0 - zod: 3.25.76 + zod: 4.0.5 optionalDependencies: react: 19.1.0 @@ -16440,10 +16443,10 @@ snapshots: '@cloudflare/workerd-linux-arm64': 1.20250709.0 '@cloudflare/workerd-windows-64': 1.20250709.0 - workers-ai-provider@0.7.2(zod@3.25.76): + workers-ai-provider@0.7.2(zod@4.0.5): dependencies: '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/provider-utils': 2.2.8(zod@4.0.5) transitivePeerDependencies: - zod @@ -16577,10 +16580,16 @@ snapshots: dependencies: zod: 3.25.76 + zod-to-json-schema@3.24.6(zod@4.0.5): + dependencies: + zod: 4.0.5 + zod@3.22.3: {} zod@3.23.8: {} zod@3.25.76: {} + zod@4.0.5: {} + zwitch@2.0.4: {} diff --git a/test/components/Form.spec.ts b/test/components/Form.spec.ts index e2bc3c3e..c49046b4 100644 --- a/test/components/Form.spec.ts +++ b/test/components/Form.spec.ts @@ -212,24 +212,24 @@ describe('Form', () => { await form.value.submit() expect(form.value.errors).toMatchObject([ - { id: 'emailInput', name: 'email', message: 'Required' }, - { id: 'passwordInput', name: 'password', message: 'Required' } + { id: 'emailInput', name: 'email', message: 'Invalid input: expected string, received undefined' }, + { id: 'passwordInput', name: 'password', message: 'Invalid input: expected string, received undefined' } ]) expect(wrapper.setupState.onSubmit).not.toHaveBeenCalled() expect(wrapper.setupState.onError).toHaveBeenCalledTimes(1) expect(wrapper.setupState.onError).toHaveBeenCalledWith(expect.objectContaining({ errors: [ - { id: 'emailInput', name: 'email', message: 'Required' }, - { id: 'passwordInput', name: 'password', message: 'Required' } + { id: 'emailInput', name: 'email', message: 'Invalid input: expected string, received undefined' }, + { id: 'passwordInput', name: 'password', message: 'Invalid input: expected string, received undefined' } ] })) const emailField = wrapper.find('#emailField') - expect(emailField.text()).toBe('Required') + expect(emailField.text()).toBe('Invalid input: expected string, received undefined') const passwordField = wrapper.find('#passwordField') - expect(passwordField.text()).toBe('Required') + expect(passwordField.text()).toBe('Invalid input: expected string, received undefined') }) test('validate on submit works', async () => { @@ -267,8 +267,8 @@ describe('Form', () => { const errors = form.value.getErrors() expect(errors).toMatchObject([ - { id: 'emailInput', name: 'email', message: 'Required' }, - { id: 'passwordInput', name: 'password', message: 'Required' } + { id: 'emailInput', name: 'email', message: 'Invalid input: expected string, received undefined' }, + { id: 'passwordInput', name: 'password', message: 'Invalid input: expected string, received undefined' } ]) }) @@ -424,14 +424,14 @@ describe('Form', () => { expect(wrapper.setupState.onSubmit).not.toHaveBeenCalled() expect(wrapper.setupState.onError).toHaveBeenCalledTimes(1) const onErrorCallArgs = wrapper.setupState.onError.mock.lastCall[0] - expect(onErrorCallArgs.children[0].errors).toMatchObject([{ id: 'nestedInput', name: 'field', message: 'Required' }]) + expect(onErrorCallArgs.children[0].errors).toMatchObject([{ id: 'nestedInput', name: 'field', message: 'Invalid input: expected string, received undefined' }]) expect(onErrorCallArgs.errors).toMatchObject([ - { id: 'emailInput', name: 'email', message: 'Required' }, - { id: 'passwordInput', name: 'password', message: 'Required' } + { id: 'emailInput', name: 'email', message: 'Invalid input: expected string, received undefined' }, + { id: 'passwordInput', name: 'password', message: 'Invalid input: expected string, received undefined' } ]) const nestedField = wrapper.find('#nestedField') - expect(nestedField.text()).toBe('Required') + expect(nestedField.text()).toBe('Invalid input: expected string, received undefined') }) test('submit event contains nested attributes', async () => {