@firtoz/router-toolkit 3.0.4 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firtoz/router-toolkit",
3
- "version": "3.0.4",
3
+ "version": "4.0.0",
4
4
  "description": "Type-safe React Router 7 framework mode helpers with enhanced fetching, form submission, and state management",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
@@ -55,10 +55,10 @@
55
55
  "url": "https://github.com/firtoz/fullstack-toolkit/issues"
56
56
  },
57
57
  "peerDependencies": {
58
- "@firtoz/maybe-error": "^1.3.3",
59
- "react": "^19.2.0",
60
- "react-router": "^7.9.4",
61
- "zod": "^4.1.12"
58
+ "@firtoz/maybe-error": "^1.4.0",
59
+ "react": "catalog:",
60
+ "react-router": "catalog:",
61
+ "zod": "catalog:"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=18.0.0"
@@ -72,8 +72,8 @@
72
72
  "devDependencies": {
73
73
  "@testing-library/react": "^16.3.0",
74
74
  "@types/jsdom": "^27.0.0",
75
- "@types/react": "^19.2.2",
76
- "bun-types": "^1.3.0",
77
- "jsdom": "^27.0.0"
75
+ "@types/react": "catalog:",
76
+ "bun-types": "catalog:",
77
+ "jsdom": "^27.0.1"
78
78
  }
79
79
  }
package/src/formAction.ts CHANGED
@@ -37,7 +37,7 @@ import { zfd } from "zod-form-data";
37
37
  export type FormActionError<TError, TSchema extends z.ZodTypeAny> =
38
38
  | {
39
39
  type: "validation";
40
- error: ReturnType<typeof z.treeifyError<TSchema>>;
40
+ error: ReturnType<typeof z.treeifyError<z.infer<TSchema>>>;
41
41
  }
42
42
  | {
43
43
  type: "handler";
@@ -158,8 +158,8 @@ export const formAction = <
158
158
  if (!formData.success) {
159
159
  return fail({
160
160
  type: "validation" as const,
161
- error: z.treeifyError<TSchema>(
162
- formData.error as z.core.$ZodError<TSchema>,
161
+ error: z.treeifyError<z.infer<TSchema>>(
162
+ formData.error as z.core.$ZodError<z.infer<TSchema>>,
163
163
  ),
164
164
  });
165
165
  }