Skip to content

Commit f956b28

Browse files
committed
chore: upgrade to zod v4
1 parent 9ae9c1a commit f956b28

109 files changed

Lines changed: 288 additions & 259 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/zod-4-support.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@trigger.dev/core": minor
3+
"@trigger.dev/sdk": minor
4+
"trigger.dev": minor
5+
"@trigger.dev/redis-worker": minor
6+
"@trigger.dev/schema-to-json": minor
7+
---
8+
9+
Add zod v4 compatibility. The `zod` peer dependency is widened to `^3.25.0 || ^4.0.0`, so projects can use zod 3.25+ or zod 4. Internal code was updated for zod v4 API changes (`ZodError.errors` → `.issues`, single-arg `z.record` → keyed, unified `error` option, `z.ZodSchema`/`z.AnyZodObject` → `z.ZodType`/`z.ZodObject`, `z.any()` object fields made `.optional()` to preserve v3 inference). No runtime behavior change for existing zod 3 users.

‎apps/supervisor/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"prom-client": "^15.1.0",
2424
"socket.io": "4.8.3",
2525
"std-env": "^3.8.0",
26-
"zod": "3.25.76"
26+
"zod": "4.4.3"
2727
},
2828
"devDependencies": {
2929
"@internal/testcontainers": "workspace:*",

‎apps/webapp/app/components/errors/ConfigureErrorAlerts.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getFormProps, getInputProps, useForm } from "@conform-to/react";
22
import { GlobeLinesIcon } from "~/assets/icons/GlobeLinesIcon";
3-
import { parseWithZod } from "@conform-to/zod";
3+
import { parseWithZod } from "@conform-to/zod/v4";
44
import { EnvelopeIcon, HashtagIcon, LockClosedIcon, XMarkIcon } from "@heroicons/react/20/solid";
55
import { BellAlertIcon } from "@heroicons/react/24/solid";
66
import { useFetcher, useNavigate } from "@remix-run/react";

‎apps/webapp/app/components/metrics/QueryWidget.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const chartConfigOptions = {
5555
sortByColumn: z.string().nullable(),
5656
sortDirection: SortDirection,
5757
aggregation: AggregationType,
58-
seriesColors: z.record(z.string()).optional(),
58+
seriesColors: z.record(z.string(), z.string()).optional(),
5959
};
6060

6161
const ChartConfiguration = z.object({ ...chartConfigOptions });

‎apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getFormProps, getInputProps, getSelectProps, useForm } from "@conform-to/react";
2-
import { parseWithZod } from "@conform-to/zod";
2+
import { parseWithZod } from "@conform-to/zod/v4";
33
import { RectangleStackIcon } from "@heroicons/react/20/solid";
44
import { DialogClose } from "@radix-ui/react-dialog";
55
import { Form, useActionData, useNavigation, useParams, useSubmit } from "@remix-run/react";

‎apps/webapp/app/components/schedules/PurchaseSchedulesModal.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getFormProps, useForm } from "@conform-to/react";
2-
import { parseWithZod } from "@conform-to/zod";
2+
import { parseWithZod } from "@conform-to/zod/v4";
33
import { EnvelopeIcon } from "@heroicons/react/20/solid";
44
import { DialogClose } from "@radix-ui/react-dialog";
55
import { useFetcher } from "@remix-run/react";

‎apps/webapp/app/models/orgIntegration.server.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const SlackSecretSchema = z.object({
2727
refreshToken: z.string().optional(),
2828
botScopes: z.array(z.string()).optional(),
2929
userScopes: z.array(z.string()).optional(),
30-
raw: z.record(z.any()).optional(),
30+
raw: z.record(z.string(), z.any()).optional(),
3131
});
3232

3333
type SlackSecret = z.infer<typeof SlackSecretSchema>;

‎apps/webapp/app/models/vercelIntegration.server.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const VercelSecretSchema = z.object({
194194
teamId: z.string().nullable().optional(),
195195
userId: z.string().optional(),
196196
installationId: z.string().optional(),
197-
raw: z.record(z.any()).optional(),
197+
raw: z.record(z.string(), z.any()).optional(),
198198
});
199199

200200
type VercelSecret = z.infer<typeof VercelSecretSchema>;

‎apps/webapp/app/models/vercelSdkRecovery.server.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ export const VercelSchemas = {
145145
.union([
146146
z
147147
.object({
148-
envs: z.array(z.record(z.unknown())),
148+
envs: z.array(z.record(z.string(), z.unknown())),
149149
pagination: z.unknown().optional(),
150150
hiddenProductionEnvCount: z.number().optional(),
151151
})
152152
.passthrough(),
153-
z.array(z.record(z.unknown())),
153+
z.array(z.record(z.string(), z.unknown())),
154154
])
155155
.transform((val) => (Array.isArray(val) ? { envs: val } : val)),
156156

‎apps/webapp/app/presenters/v3/MetricDashboardPresenter.server.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const DashboardLayout = z.discriminatedUnion("version", [
3232
z.object({
3333
version: z.literal("1"),
3434
layout: z.array(LayoutItem),
35-
widgets: z.record(Widget),
35+
widgets: z.record(z.string(), Widget),
3636
}),
3737
]);
3838

0 commit comments

Comments
 (0)