chore: upgrade Zod 4, Vitest 4, and TypeScript 7
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:
1 parent
160c05a511
commit
830d252346
7 files changed
+613
-482
No files matched your search
@@ -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") {
|
||||
|
||||
Reference in new issue
Block a user