chore: upgrade Zod 4, Vitest 4, and TypeScript 7
Deploy / release (push) Skipped
Deploy / deploy (push) Failing after 52s

Bump major tooling stacks and adapt Zod error APIs (issues/flattenError) plus tsconfig paths for TS 7 baseUrl removal.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-07-21 20:34:29 +02:00
1 parent 160c05a511
commit 830d252346
7 files changed
+613 -482

No files matched your search

+9 -3
View File
@@ -1,4 +1,4 @@
import type { z } from "zod";
import { z } from "zod";
import { logAuthorizationEvent } from "@/lib/admin/authorization-events";
import { auth } from "@/lib/auth";
import { canAccess, getApiAdminContext } from "@/lib/permissions";
@@ -112,7 +112,10 @@ export function adminAction<TSchema extends z.ZodType | undefined = undefined>(
if (!parsed.success) {
return fail(
"Validation failed",
parsed.error.flatten().fieldErrors as Record<string, string[]>,
z.flattenError(parsed.error).fieldErrors as Record<
string,
string[]
>,
);
}
data = parsed.data;
@@ -188,7 +191,10 @@ export function authAction<TSchema extends z.ZodType | undefined = undefined>(
if (!parsed.success) {
return fail(
"Validation failed",
parsed.error.flatten().fieldErrors as Record<string, string[]>,
z.flattenError(parsed.error).fieldErrors as Record<
string,
string[]
>,
);
}
data = parsed.data;
+2 -2
View File
@@ -1,4 +1,4 @@
import { ZodError } from "zod";
import { ZodError, z } from "zod";
import { handleActionError as foundationHandle } from "@/lib/foundation/action";
export type ActionResult<T = Record<string, unknown>> =
@@ -27,7 +27,7 @@ export function handleActionError(error: unknown): ActionResult<never> {
return {
ok: false,
error: "Validation failed",
fieldErrors: error.flatten().fieldErrors as Record<string, string[]>,
fieldErrors: z.flattenError(error).fieldErrors as Record<string, string[]>,
};
}
if (error instanceof Error && error.name === "ActionError") {