@firtoz/router-toolkit 2.0.0 → 2.1.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/README.md CHANGED
@@ -190,7 +190,7 @@ Type-safe form submission with Zod validation and enhanced submit functionality.
190
190
  ```tsx
191
191
  // app/routes/contact.tsx
192
192
  import { useDynamicSubmitter, type RoutePath } from '@firtoz/router-toolkit';
193
- import { z } from 'zod/v4';
193
+ import { z } from 'zod';
194
194
  import type { Route } from './+types/contact';
195
195
 
196
196
  // 1. Define your form schema
@@ -280,7 +280,7 @@ Track changes in fetcher state and react to them. Perfect for triggering side ef
280
280
  // app/routes/notification-form.tsx
281
281
  import { useDynamicSubmitter, useFetcherStateChanged, type RoutePath } from '@firtoz/router-toolkit';
282
282
  import { useState } from 'react';
283
- import { z } from 'zod/v4';
283
+ import { z } from 'zod';
284
284
  import type { Route } from './+types/notification-form';
285
285
 
286
286
  export const route: RoutePath<"/notification-form"> = "/notification-form";
@@ -410,7 +410,7 @@ Type-safe form action wrapper that provides Zod validation and structured error
410
410
 
411
411
  ```tsx
412
412
  // app/routes/register.tsx
413
- import { z } from "zod/v4";
413
+ import { z } from "zod";
414
414
  import { formAction, type RoutePath } from "@firtoz/router-toolkit";
415
415
  import { success, fail } from "@firtoz/maybe-error";
416
416
 
@@ -777,7 +777,7 @@ export default function LoaderTest() {
777
777
  ```tsx
778
778
  // app/routes/action-test.tsx
779
779
  import { useDynamicSubmitter, type RoutePath } from '@firtoz/router-toolkit';
780
- import { z } from 'zod/v4';
780
+ import { z } from 'zod';
781
781
  import type { Route } from './+types/action-test';
782
782
 
783
783
  interface ActionData {
@@ -896,7 +896,7 @@ import {
896
896
  type RoutePath,
897
897
  } from '@firtoz/router-toolkit';
898
898
  import { useLoaderData } from 'react-router';
899
- import { z } from 'zod/v4';
899
+ import { z } from 'zod';
900
900
  import type { Route } from './+types/combined-test';
901
901
 
902
902
  interface User {
@@ -1164,7 +1164,7 @@ export default function UserProfile() {
1164
1164
  ```tsx
1165
1165
  // app/routes/create-user.tsx
1166
1166
  import { success, fail, type MaybeError, useDynamicSubmitter, type RoutePath } from '@firtoz/router-toolkit';
1167
- import { z } from 'zod/v4';
1167
+ import { z } from 'zod';
1168
1168
  import type { Route } from './+types/create-user';
1169
1169
 
1170
1170
  export const route: RoutePath<"/create-user"> = "/create-user";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firtoz/router-toolkit",
3
- "version": "2.0.0",
3
+ "version": "2.1.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",
@@ -51,8 +51,8 @@
51
51
  "peerDependencies": {
52
52
  "@firtoz/maybe-error": "^1.2.3",
53
53
  "react": "^19.1.1",
54
- "react-router": "^7.8.0",
55
- "zod": "^4.0.15"
54
+ "react-router": "^7.9.1",
55
+ "zod": "^4.1.8"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=18.0.0"
@@ -61,6 +61,6 @@
61
61
  "access": "public"
62
62
  },
63
63
  "dependencies": {
64
- "zod-form-data": "^3.0.0"
64
+ "zod-form-data": "^3.0.1"
65
65
  }
66
66
  }
package/src/formAction.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @example
8
8
  * ```typescript
9
- * import { z } from "zod/v4";
9
+ * import { z } from "zod";
10
10
  * import { formAction } from "@firtoz/router-toolkit";
11
11
  * import { success } from "@firtoz/maybe-error";
12
12
  *
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { fail, type MaybeError } from "@firtoz/maybe-error";
30
30
  import type { ActionFunctionArgs } from "react-router";
31
- import { z } from "zod/v4";
31
+ import { z } from "zod";
32
32
  import { zfd } from "zod-form-data";
33
33
 
34
34
  /**
@@ -97,7 +97,7 @@ export interface FormActionConfig<
97
97
  *
98
98
  * @example
99
99
  * ```typescript
100
- * import { z } from "zod/v4";
100
+ * import { z } from "zod";
101
101
  * import { formAction } from "@firtoz/router-toolkit";
102
102
  * import { success, fail } from "@firtoz/maybe-error";
103
103
  *
@@ -1,4 +1,5 @@
1
- import { useCallback, useMemo } from "react";
1
+ // biome-ignore lint/style/useImportType: We need to import React here.
2
+ import React, { useCallback, useMemo } from "react";
2
3
  import {
3
4
  type FetcherFormProps,
4
5
  href,
@@ -6,7 +7,7 @@ import {
6
7
  type SubmitTarget,
7
8
  useFetcher,
8
9
  } from "react-router";
9
- import type { z } from "zod/v4";
10
+ import type { z } from "zod";
10
11
  import type { Func } from "./types/Func";
11
12
  import type { HrefArgs } from "./types/HrefArgs";
12
13
  import type { RegisterPages } from "./types/RegisterPages";