chore: upgrade to latest zod v3 (#12938)

* chore: upgrade to latest zod v3

* chore: set explicit versions

* chore: remove v3 scope

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Riqwan Thamir
2025-07-14 14:23:47 +02:00
committed by GitHub
co-authored by Oli Juhl
parent 1503ba999f
commit d5a2cfbc5a
12 changed files with 39 additions and 37 deletions
+2 -2
View File
@@ -97,8 +97,8 @@
"morgan": "^1.9.1",
"path-to-regexp": "^0.1.10",
"tsconfig-paths": "^4.2.0",
"zod": "3.22.4",
"zod-validation-error": "^3.4.1"
"zod": "3.25.76",
"zod-validation-error": "3.5.1"
},
"peerDependencies": {
"@aws-sdk/client-dynamodb": "^3.218.0",
@@ -1,13 +1,13 @@
import { raw } from "express"
import { MedusaRequest, MedusaResponse, MedusaNextFunction } from "../../types"
import { z } from "zod"
import { MedusaNextFunction, MedusaRequest, MedusaResponse } from "../../types"
import { defineMiddlewares } from "../../utils/define-middlewares"
import {
customersCreateMiddlewareMock,
customersGlobalMiddlewareMock,
customersCreateMiddlewareValidatorMock,
customersGlobalMiddlewareMock,
storeGlobalMiddlewareMock,
} from "../mocks"
import z from "zod"
import { defineMiddlewares } from "../../utils/define-middlewares"
const customersGlobalMiddleware = (
req: MedusaRequest,
@@ -1,7 +1,7 @@
import zod from "zod"
import { MedusaError } from "@medusajs/utils"
import { validateAndTransformBody } from "../utils/validate-body"
import zod, { ZodNullable, ZodObject, ZodOptional } from "zod"
import { MedusaRequest, MedusaResponse } from "../types"
import { validateAndTransformBody } from "../utils/validate-body"
const createLinkBody = () => {
return zod.object({
@@ -33,7 +33,7 @@ describe("validateAndTransformBody", () => {
.nullish()
const validatorFactory = (
schema?: Zod.ZodOptional<Zod.ZodNullable<Zod.ZodObject<any, any>>>
schema?: ZodOptional<ZodNullable<ZodObject<any, any>>>
) => {
return schema
? createLinkBody().extend({
@@ -69,7 +69,7 @@ describe("validateAndTransformBody", () => {
.nullish()
const validatorFactory = (
schema?: Zod.ZodOptional<Zod.ZodNullable<Zod.ZodObject<any, any>>>
schema?: ZodOptional<ZodNullable<ZodObject<any, any>>>
) => {
return schema
? createLinkBody().extend({
@@ -102,7 +102,7 @@ describe("validateAndTransformBody", () => {
.nullish()
const validatorFactory = (
schema?: Zod.ZodOptional<Zod.ZodNullable<Zod.ZodObject<any, any>>>
schema?: ZodOptional<ZodNullable<ZodObject<any, any>>>
) => {
return schema
? createLinkBody().extend({
+1 -1
View File
@@ -57,7 +57,7 @@
"pg-connection-string": "^2.7.0",
"pluralize": "^8.0.0",
"ulid": "^2.3.0",
"zod": "3.22.4"
"zod": "3.25.76"
},
"peerDependencies": {
"@mikro-orm/core": "6.4.3",
+2 -2
View File
@@ -39,7 +39,7 @@
"pg": "^8.13.0",
"rimraf": "^5.0.1",
"typescript": "^5.6.2",
"zod": "3.22.4"
"zod": "3.25.76"
},
"dependencies": {
"@medusajs/modules-sdk": "2.8.7",
@@ -56,7 +56,7 @@
"awilix": "^8.0.1",
"express": "^4.21.0",
"pg": "^8.13.0",
"zod": "3.22.4"
"zod": "3.25.76"
},
"scripts": {
"build": "rimraf dist && tsc --build",