@amazing-router/react 1.1.0 → 1.2.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Adel Chafic Gannem
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adel Chafic Gannem
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.mts CHANGED
@@ -3,6 +3,7 @@ import { ReactNode } from 'react';
3
3
  import { RouteNode } from '@amazing-router/core';
4
4
  import { RouteObject } from 'react-router';
5
5
  export * from 'react-router';
6
+ export { Outlet } from 'react-router';
6
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
8
 
8
9
  /**
@@ -88,19 +89,13 @@ interface AmazingRouteObject extends Omit<RouteObject, "children"> {
88
89
  }
89
90
 
90
91
  /**
91
- * Recursively transforms a tree of RouteNodes into React Router compatible objects.
92
- *
93
- * Key behaviors:
94
- * - Top-level routes use absolute paths ("/about")
95
- * - Nested routes use relative paths ("about") as required by React Router
96
- * - Pathless group layout wrappers have NO path property (not even undefined)
97
- * - Middleware wraps the page element when present
98
- *
99
- * @param nodes - Array of nodes from routes.json
100
- * @param isNested - Whether these nodes are children of another route
101
- * @returns Array of AmazingRouteObject
92
+ * Recursively transforms a tree of RouteNodes into React Router route objects.
93
+ * Fixes:
94
+ * 1. Path relativity for nested children.
95
+ * 2. Layout nesting even without Middleware.
96
+ * 3. Group Route isolation.
102
97
  */
103
- declare function transformRoutes(nodes: RouteNode[], routeFiles: Record<string, () => Promise<any>>, isNested?: boolean): AmazingRouteObject[];
98
+ declare function transformRoutes(nodes: RouteNode[], routeFiles: Record<string, () => Promise<any>>, parentAbsPath?: string): AmazingRouteObject[];
104
99
 
105
100
  /**
106
101
  * Props for the {@link AmazingProvider} component.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { ReactNode } from 'react';
3
3
  import { RouteNode } from '@amazing-router/core';
4
4
  import { RouteObject } from 'react-router';
5
5
  export * from 'react-router';
6
+ export { Outlet } from 'react-router';
6
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
8
 
8
9
  /**
@@ -88,19 +89,13 @@ interface AmazingRouteObject extends Omit<RouteObject, "children"> {
88
89
  }
89
90
 
90
91
  /**
91
- * Recursively transforms a tree of RouteNodes into React Router compatible objects.
92
- *
93
- * Key behaviors:
94
- * - Top-level routes use absolute paths ("/about")
95
- * - Nested routes use relative paths ("about") as required by React Router
96
- * - Pathless group layout wrappers have NO path property (not even undefined)
97
- * - Middleware wraps the page element when present
98
- *
99
- * @param nodes - Array of nodes from routes.json
100
- * @param isNested - Whether these nodes are children of another route
101
- * @returns Array of AmazingRouteObject
92
+ * Recursively transforms a tree of RouteNodes into React Router route objects.
93
+ * Fixes:
94
+ * 1. Path relativity for nested children.
95
+ * 2. Layout nesting even without Middleware.
96
+ * 3. Group Route isolation.
102
97
  */
103
- declare function transformRoutes(nodes: RouteNode[], routeFiles: Record<string, () => Promise<any>>, isNested?: boolean): AmazingRouteObject[];
98
+ declare function transformRoutes(nodes: RouteNode[], routeFiles: Record<string, () => Promise<any>>, parentAbsPath?: string): AmazingRouteObject[];
104
99
 
105
100
  /**
106
101
  * Props for the {@link AmazingProvider} component.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var r in t)R(e,r,{get:t[r],enumerable:!0})},g=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of N(t))!O.call(e,o)&&o!==r&&R(e,o,{get:()=>t[o],enumerable:!(n=M(t,o))||n.enumerable});return e},u=(e,t,r)=>(g(e,t,"default"),r&&g(r,t,"default"));var v=e=>g(R({},"__esModule",{value:!0}),e);var i={};j(i,{AmazingProvider:()=>S,transformRoutes:()=>d,useAmazingMeta:()=>F,useAmazingRouter:()=>k});module.exports=v(i);var p=require("react-router"),k=()=>{let e=(0,p.useNavigate)();return{pathname:(0,p.useLocation)().pathname,push:r=>e(r),replace:r=>e(r,{replace:!0}),back:()=>e(-1)}};var P=require("react-router"),F=()=>{let e=(0,P.useMatches)(),r=e[e.length-1]?.handle;return{title:r?.meta?.title||"React - Amazing Router",description:r?.meta?.description||"",...r?.meta}};var c=require("react"),z=require("react-router"),m=require("react/jsx-runtime");function L(e,t){let r=e.replace(/\\/g,"/"),n=t[r];return n?(0,c.lazy)(n):(console.warn(`[Amazing Router] Missing route file for: ${r}`),null)}function $(e,t){let r=e.replace(/\\/g,"/"),n=t[r];return n?(0,c.lazy)(()=>n().then(o=>({default:o.middleware}))):(console.warn(`[Amazing Router] Missing middleware file for: ${r}`),null)}function y(e,t,r=!1){let n=r?e.pagePath:e.layoutPath||e.pagePath;if(!n)return(0,m.jsx)(z.Outlet,{});let o=L(n,t);if(!o)return(0,m.jsx)(z.Outlet,{});let s=(0,m.jsx)(c.Suspense,{fallback:null,children:(0,m.jsx)(o,{})});if(e.middlewarePath){let a=$(e.middlewarePath,t);if(a)return(0,m.jsx)(c.Suspense,{fallback:null,children:(0,m.jsx)(a,{})})}return s}function d(e,t,r=!1){let n=[];for(let o of e){let s=r&&o.path?o.path.replace(/^\//,""):o.path,a={id:o.id,element:y(o,t),handle:{meta:o.meta},children:[],...s!==void 0?{path:s}:{}};o.layoutPath&&o.pagePath&&a.children.push({id:`${o.id}-index`,index:!0,element:y({...o,layoutPath:void 0},t),handle:{meta:o.meta}}),o.children&&o.children.length>0&&a.children.push(...d(o.children,t,!0)),a.children&&a.children.length===0&&delete a.children,n.push(a)}return n}var l=require("react"),f=require("react-router");var x=require("react/jsx-runtime"),S=({loadingElement:e=null})=>{let[t,r]=(0,l.useState)([]),[n,o]=(0,l.useState)({});(0,l.useEffect)(()=>{let a=Date.now(),A=`/.amazing-router/routes.json?t=${a}`,b=`/.amazing-router/routeFiles.ts?t=${a}`;Promise.all([import(A),import(b)]).then(([h,w])=>{r(h.default||[]),o(w.routeFiles||{})}).catch(h=>{console.warn("[Amazing Router] Could not find the generated route files. Did you run the core build or forgot to configure the Vite/Webpack plugin?",h)})},[]);let s=(0,l.useMemo)(()=>{if(!t||t.length===0||Object.keys(n).length===0)return null;let a=d(t,n);return(0,f.createBrowserRouter)(a)},[t,n]);return s?(0,x.jsx)(f.RouterProvider,{router:s}):e};u(i,require("react-router"),module.exports);0&&(module.exports={AmazingProvider,transformRoutes,useAmazingMeta,useAmazingRouter,...require("react-router")});
1
+ "use strict";var L=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var o in e)L(t,o,{get:e[o],enumerable:!0})},w=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of K(e))!Q.call(t,r)&&r!==o&&L(t,r,{get:()=>e[r],enumerable:!(n=J(e,r))||n.enumerable});return t},m=(t,e,o)=>(w(t,e,"default"),o&&w(o,e,"default"));var U=t=>w(L({},"__esModule",{value:!0}),t);var a={};T(a,{AmazingProvider:()=>Z,Outlet:()=>H.Outlet,transformRoutes:()=>z,useAmazingMeta:()=>Y,useAmazingRouter:()=>X});module.exports=U(a);var y=require("react-router"),X=()=>{let t=(0,y.useNavigate)();return{pathname:(0,y.useLocation)().pathname,push:o=>t(o),replace:o=>t(o,{replace:!0}),back:()=>t(-1)}};var j=require("react-router"),Y=()=>{let t=(0,j.useMatches)(),o=t[t.length-1]?.handle;return{title:o?.meta?.title||"React - Amazing Router",description:o?.meta?.description||"",...o?.meta}};var $=require("react-router");function k(t,e){if(e===void 0)return t;if(!e||e==="/")return t.replace(/^\//,"");let o=e+"/";return t.startsWith(o)?t.slice(o.length):t.replace(/^\//,"")}var S=require("react"),D=require("@amazing-router/core");function R(t,e){let o=t.replace(/\\/g,"/"),n=e[o];return n?(0,S.lazy)(n):(D.logger.warn(`Missing route file for: ${o}`),null)}var F=require("react"),B=require("@amazing-router/core");function G(t,e){let o=t.replace(/\\/g,"/"),n=e[o];return n?(0,F.lazy)(()=>n().then(r=>({default:r.middleware}))):(B.logger.warn(`Missing middleware file for: ${o}`),null)}var M=require("react-router");var V=require("react"),O=require("react/jsx-runtime");function f(t){return(0,O.jsx)(V.Suspense,{fallback:null,children:(0,O.jsx)(t,{})})}var C=require("react/jsx-runtime");function N(t,e){if(!t.pagePath)return(0,C.jsx)(M.Outlet,{});let o=R(t.pagePath,e);return o?f(o):(0,C.jsx)(M.Outlet,{})}var A=require("react-router"),v=require("react/jsx-runtime");function E(t,e){if(!t.layoutPath)return(0,v.jsx)(A.Outlet,{});let o=R(t.layoutPath,e);return o?f(o):(0,v.jsx)(A.Outlet,{})}var b=require("react/jsx-runtime");function z(t,e,o){let n=[];for(let r of t){let c=r.id.startsWith("(")&&r.id.endsWith(")"),s=r.path!==void 0?k(r.path,c?void 0:o):void 0,i={id:r.id,handle:{meta:r.meta},children:[],...s!==void 0?{path:s}:{}},d=!!r.middlewarePath,u=!!r.layoutPath,g=!!r.pagePath,P=r.children&&r.children.length>0;if(d){let l=G(r.middlewarePath,e);i.element=l?f(l):(0,b.jsx)($.Outlet,{})}else u?i.element=E(r,e):g&&!P?i.element=N(r,e):i.element=(0,b.jsx)($.Outlet,{});let h=i.children;if(d&&u){let l={id:`${r.id}-layout`,element:E(r,e),children:[]};h.push(l),h=l.children}if(g&&(d||u||P)&&h.push({id:`${r.id}-index`,index:!0,element:N(r,e),handle:{meta:r.meta}}),P){let l=c?o:r.path,I=z(r.children,e,l);h.push(...I)}i.children&&i.children.length===0&&delete i.children,n.push(i)}return n}var p=require("react"),x=require("react-router");var W=require("@amazing-router/core"),q=require("react/jsx-runtime"),Z=({loadingElement:t=null})=>{let[e,o]=(0,p.useState)([]),[n,r]=(0,p.useState)({});(0,p.useEffect)(()=>{let s=Date.now(),i=`/.amazing-router/routes.json?t=${s}`,d=`/.amazing-router/routeFiles.ts?t=${s}`;Promise.all([import(i),import(d)]).then(([u,g])=>{o(u.default||[]),r(g.routeFiles||{})}).catch(u=>{W.logger.warn("Could not find the generated route files. Did you run the core build or forgot to configure the Vite/Webpack plugin?"),W.logger.error(u)})},[]);let c=(0,p.useMemo)(()=>{if(!e||e.length===0||Object.keys(n).length===0)return null;let s=z(e,n);return(0,x.createBrowserRouter)(s)},[e,n]);return c?(0,q.jsx)(x.RouterProvider,{router:c}):t};var H=require("react-router");m(a,require("react-router"),module.exports);0&&(module.exports={AmazingProvider,Outlet,transformRoutes,useAmazingMeta,useAmazingRouter,...require("react-router")});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{useNavigate as z,useLocation as P}from"react-router";var v=()=>{let t=z();return{pathname:P().pathname,push:r=>t(r),replace:r=>t(r,{replace:!0}),back:()=>t(-1)}};import{useMatches as y}from"react-router";var L=()=>{let t=y(),r=t[t.length-1]?.handle;return{title:r?.meta?.title||"React - Amazing Router",description:r?.meta?.description||"",...r?.meta}};import{lazy as d,Suspense as l}from"react";import{Outlet as c}from"react-router";import{jsx as s}from"react/jsx-runtime";function x(t,o){let r=t.replace(/\\/g,"/"),n=o[r];return n?d(n):(console.warn(`[Amazing Router] Missing route file for: ${r}`),null)}function A(t,o){let r=t.replace(/\\/g,"/"),n=o[r];return n?d(()=>n().then(e=>({default:e.middleware}))):(console.warn(`[Amazing Router] Missing middleware file for: ${r}`),null)}function p(t,o,r=!1){let n=r?t.pagePath:t.layoutPath||t.pagePath;if(!n)return s(c,{});let e=x(n,o);if(!e)return s(c,{});let i=s(l,{fallback:null,children:s(e,{})});if(t.middlewarePath){let a=A(t.middlewarePath,o);if(a)return s(l,{fallback:null,children:s(a,{})})}return i}function m(t,o,r=!1){let n=[];for(let e of t){let i=r&&e.path?e.path.replace(/^\//,""):e.path,a={id:e.id,element:p(e,o),handle:{meta:e.meta},children:[],...i!==void 0?{path:i}:{}};e.layoutPath&&e.pagePath&&a.children.push({id:`${e.id}-index`,index:!0,element:p({...e,layoutPath:void 0},o),handle:{meta:e.meta}}),e.children&&e.children.length>0&&a.children.push(...m(e.children,o,!0)),a.children&&a.children.length===0&&delete a.children,n.push(a)}return n}import{useState as f,useEffect as b,useMemo as w}from"react";import{createBrowserRouter as M,RouterProvider as N}from"react-router";import{jsx as O}from"react/jsx-runtime";var U=({loadingElement:t=null})=>{let[o,r]=f([]),[n,e]=f({});b(()=>{let a=Date.now(),h=`/.amazing-router/routes.json?t=${a}`,g=`/.amazing-router/routeFiles.ts?t=${a}`;Promise.all([import(h),import(g)]).then(([u,R])=>{r(u.default||[]),e(R.routeFiles||{})}).catch(u=>{console.warn("[Amazing Router] Could not find the generated route files. Did you run the core build or forgot to configure the Vite/Webpack plugin?",u)})},[]);let i=w(()=>{if(!o||o.length===0||Object.keys(n).length===0)return null;let a=m(o,n);return M(a)},[o,n]);return i?O(N,{router:i}):t};export*from"react-router";export{U as AmazingProvider,m as transformRoutes,L as useAmazingMeta,v as useAmazingRouter};
1
+ import{useNavigate as $,useLocation as b}from"react-router";var J=()=>{let e=$();return{pathname:b().pathname,push:t=>e(t),replace:t=>e(t,{replace:!0}),back:()=>e(-1)}};import{useMatches as W}from"react-router";var T=()=>{let e=W(),t=e[e.length-1]?.handle;return{title:t?.meta?.title||"React - Amazing Router",description:t?.meta?.description||"",...t?.meta}};import{Outlet as C}from"react-router";function z(e,o){if(o===void 0)return e;if(!o||o==="/")return e.replace(/^\//,"");let t=o+"/";return e.startsWith(t)?e.slice(t.length):e.replace(/^\//,"")}import{lazy as j}from"react";import{logger as k}from"@amazing-router/core";function d(e,o){let t=e.replace(/\\/g,"/"),n=o[t];return n?j(n):(k.warn(`Missing route file for: ${t}`),null)}import{lazy as S}from"react";import{logger as D}from"@amazing-router/core";function x(e,o){let t=e.replace(/\\/g,"/"),n=o[t];return n?S(()=>n().then(r=>({default:r.middleware}))):(D.warn(`Missing middleware file for: ${t}`),null)}import{Outlet as w}from"react-router";import{Suspense as F}from"react";import{jsx as P}from"react/jsx-runtime";function u(e){return P(F,{fallback:null,children:P(e,{})})}import{jsx as L}from"react/jsx-runtime";function h(e,o){if(!e.pagePath)return L(w,{});let t=d(e.pagePath,o);return t?u(t):L(w,{})}import{Outlet as O}from"react-router";import{jsx as M}from"react/jsx-runtime";function y(e,o){if(!e.layoutPath)return M(O,{});let t=d(e.layoutPath,o);return t?u(t):M(O,{})}import{jsx as N}from"react/jsx-runtime";function R(e,o,t){let n=[];for(let r of e){let l=r.id.startsWith("(")&&r.id.endsWith(")"),a=r.path!==void 0?z(r.path,l?void 0:t):void 0,i={id:r.id,handle:{meta:r.meta},children:[],...a!==void 0?{path:a}:{}},p=!!r.middlewarePath,m=!!r.layoutPath,f=!!r.pagePath,g=r.children&&r.children.length>0;if(p){let s=x(r.middlewarePath,o);i.element=s?u(s):N(C,{})}else m?i.element=y(r,o):f&&!g?i.element=h(r,o):i.element=N(C,{});let c=i.children;if(p&&m){let s={id:`${r.id}-layout`,element:y(r,o),children:[]};c.push(s),c=s.children}if(f&&(p||m||g)&&c.push({id:`${r.id}-index`,index:!0,element:h(r,o),handle:{meta:r.meta}}),g){let s=l?t:r.path,E=R(r.children,o,s);c.push(...E)}i.children&&i.children.length===0&&delete i.children,n.push(i)}return n}import{useState as A,useEffect as B,useMemo as G}from"react";import{createBrowserRouter as V,RouterProvider as q}from"react-router";import{logger as v}from"@amazing-router/core";import{jsx as H}from"react/jsx-runtime";var Ge=({loadingElement:e=null})=>{let[o,t]=A([]),[n,r]=A({});B(()=>{let a=Date.now(),i=`/.amazing-router/routes.json?t=${a}`,p=`/.amazing-router/routeFiles.ts?t=${a}`;Promise.all([import(i),import(p)]).then(([m,f])=>{t(m.default||[]),r(f.routeFiles||{})}).catch(m=>{v.warn("Could not find the generated route files. Did you run the core build or forgot to configure the Vite/Webpack plugin?"),v.error(m)})},[]);let l=G(()=>{if(!o||o.length===0||Object.keys(n).length===0)return null;let a=R(o,n);return V(a)},[o,n]);return l?H(q,{router:l}):e};import{Outlet as Ue}from"react-router";export*from"react-router";export{Ge as AmazingProvider,Ue as Outlet,R as transformRoutes,T as useAmazingMeta,J as useAmazingRouter};
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
- {
2
- "name": "@amazing-router/react",
3
- "version": "1.1.0",
4
- "description": "React adapter for Amazing Router Core using React Router under the hood",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
13
- }
14
- },
15
- "scripts": {
16
- "build": "tsup src/index.ts --format cjs,esm --dts --clean --external react",
17
- "dev": "tsup src/index.ts --format cjs,esm --watch --dts --external react",
18
- "lint": "eslint src",
19
- "test": "vitest run",
20
- "test:ui": "vitest"
21
- },
22
- "peerDependencies": {
23
- "react": "^19.0.0",
24
- "react-dom": "^19.0.0",
25
- "react-router": "^7.0.0"
26
- },
27
- "dependencies": {
28
- "@amazing-router/core": "^1.5.4"
29
- },
30
- "devDependencies": {
31
- "@testing-library/jest-dom": "^6.9.1",
32
- "@testing-library/react": "^16.3.2",
33
- "@types/react": "^19.0.0",
34
- "@types/react-dom": "^19.0.0",
35
- "@vitejs/plugin-react": "^6.0.1",
36
- "jsdom": "^29.0.1",
37
- "react": "^19.0.0",
38
- "react-dom": "^19.0.0",
39
- "react-router": "^7.0.0",
40
- "tsup": "^8.3.5",
41
- "typescript": "^5.7.3",
42
- "vitest": "^4.1.2"
43
- },
44
- "files": [
45
- "dist"
46
- ],
47
- "keywords": [
48
- "react",
49
- "router",
50
- "amazing-router",
51
- "file-system-routing"
52
- ],
53
- "author": "AdelGann",
54
- "license": "MIT"
55
- }
1
+ {
2
+ "name": "@amazing-router/react",
3
+ "version": "1.2.0",
4
+ "description": "React adapter for Amazing Router Core using React Router under the hood",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "scripts": {
16
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean --external react",
17
+ "dev": "tsup src/index.ts --format cjs,esm --watch --dts --external react",
18
+ "lint": "eslint src",
19
+ "test": "vitest run",
20
+ "test:ui": "vitest"
21
+ },
22
+ "peerDependencies": {
23
+ "react": "^19.0.0",
24
+ "react-dom": "^19.0.0",
25
+ "react-router": "^7.0.0"
26
+ },
27
+ "dependencies": {
28
+ "@amazing-router/core": "^1.5.4"
29
+ },
30
+ "devDependencies": {
31
+ "@testing-library/jest-dom": "^6.9.1",
32
+ "@testing-library/react": "^16.3.2",
33
+ "@types/react": "^19.0.0",
34
+ "@types/react-dom": "^19.0.0",
35
+ "@vitejs/plugin-react": "^6.0.1",
36
+ "jsdom": "^29.0.1",
37
+ "react": "^19.0.0",
38
+ "react-dom": "^19.0.0",
39
+ "react-router": "^7.0.0",
40
+ "tsup": "^8.3.5",
41
+ "typescript": "^5.7.3",
42
+ "vitest": "^4.1.2"
43
+ },
44
+ "files": [
45
+ "dist"
46
+ ],
47
+ "keywords": [
48
+ "react",
49
+ "router",
50
+ "amazing-router",
51
+ "file-system-routing"
52
+ ],
53
+ "author": "AdelGann",
54
+ "license": "MIT"
55
+ }