@arc-js/core 0.0.1 → 0.0.10
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/auto-rooting.d.ts +10 -0
- package/auto-rooting.jsx +33 -0
- package/auto-rooting.min.jsx +1 -0
- package/auto-rooting.min.jsx.map +1 -0
- package/index.d.ts +5 -2
- package/index.jsx +4 -30
- package/index.min.jsx +1 -1
- package/index.min.jsx.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RouteObject } from 'react-router-dom';
|
|
2
|
+
export { useRootingActions } from './rooting.hooks.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Permet d'initialiser toutes les routes de l'application
|
|
6
|
+
* @returns RouteObject[]
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: () => RouteObject[];
|
|
9
|
+
|
|
10
|
+
export { _default as default };
|
package/auto-rooting.jsx
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from './_virtual/jsx-runtime';
|
|
2
|
+
import * as routesUtils_js from './routes-utils.js';
|
|
3
|
+
import { routes } from './routes-utils.js';
|
|
4
|
+
export { useRootingActions } from './rooting.hooks.jsx';
|
|
5
|
+
|
|
6
|
+
var autoRooting = () => {
|
|
7
|
+
let routes$1 = routes.map((route) => ({
|
|
8
|
+
path: route.path,
|
|
9
|
+
element: route.layout ? (jsxRuntimeExports.jsx(route.layout, { children: jsxRuntimeExports.jsx(route.component, {}) })) : (jsxRuntimeExports.jsx(route.component, {})),
|
|
10
|
+
...(!!route.error ? {
|
|
11
|
+
errorElement: jsxRuntimeExports.jsx(route.error, {}),
|
|
12
|
+
} : {}),
|
|
13
|
+
}));
|
|
14
|
+
let homeRoute = undefined;
|
|
15
|
+
let notFoundRoute = undefined;
|
|
16
|
+
homeRoute = routes$1.find((a) => a.path === '/');
|
|
17
|
+
notFoundRoute = routes$1.find((a) => a.path === '*');
|
|
18
|
+
routes$1 = [
|
|
19
|
+
...(!!homeRoute ? [homeRoute] : []),
|
|
20
|
+
...routes$1.filter((route) => !(!!route.path &&
|
|
21
|
+
['/', '*'].includes(route.path))),
|
|
22
|
+
...(!!notFoundRoute ? [notFoundRoute] : []),
|
|
23
|
+
].filter((route) => (!!route.path && (route.path.indexOf('/_404') === -1 &&
|
|
24
|
+
route.path.indexOf('/_layout') === -1)));
|
|
25
|
+
if (process.env?.NODE_ENV === 'development') {
|
|
26
|
+
console.log(`[router -> routes.tsx] notFoundRoute:: `, notFoundRoute);
|
|
27
|
+
console.log(`[router -> routes.tsx] autoRoutes:: `, routesUtils_js);
|
|
28
|
+
console.log(`[router -> routes.tsx] routes:: `, routes$1);
|
|
29
|
+
}
|
|
30
|
+
return routes$1;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { autoRooting as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as jsxRuntimeExports}from"./_virtual/jsx-runtime";import*as routesUtils_js from"./routes-utils.js";import{routes}from"./routes-utils.js";export{useRootingActions}from"./rooting.hooks.jsx";var autoRooting=()=>{let t=routes.map(t=>({path:t.path,element:t.layout?jsxRuntimeExports.jsx(t.layout,{children:jsxRuntimeExports.jsx(t.component,{})}):jsxRuntimeExports.jsx(t.component,{}),...t.error?{errorElement:jsxRuntimeExports.jsx(t.error,{})}:{}}));var o=t.find(t=>"/"===t.path),r=t.find(t=>"*"===t.path);return t=[...o?[o]:[],...t.filter(t=>!(t.path&&["/","*"].includes(t.path))),...r?[r]:[]].filter(t=>!!t.path&&-1===t.path.indexOf("/_404")&&-1===t.path.indexOf("/_layout")),process.env?.NODE_ENV,t};export{autoRooting as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-rooting.min.jsx","sources":["auto-rooting.jsx"],"names":["jsxRuntimeExports","routesUtils_js","routes","autoRooting","let","routes$1","map","path","route","element","layout","jsx","children","component","error","errorElement","homeRoute","find","a","notFoundRoute","filter","includes","indexOf","process","env","NODE_ENV"],"mappings":"OAAcA,sBAAiD,KAAxB,+BAC3BC,uBAAoB,2BACvBC,MAAiC,KAAnB,4CACgC,KAArB,sBAElC,IAAIC,YAAc,KACdC,IAAIC,EAAWH,OAAOI,IAAI,IAAW,CACjCC,KAAMC,EAAMD,KACZE,QAASD,EAAME,OAAUV,kBAAkBW,IAAIH,EAAME,OAAQ,CAAEE,SAAUZ,kBAAkBW,IAAIH,EAAMK,UAAW,EAAE,CAAE,CAAE,EAAKb,kBAAkBW,IAAIH,EAAMK,UAAW,EAAG,EACrK,GAAML,EAAMM,MAAQ,CAChBC,aAAcf,kBAAkBW,IAAIH,EAAMM,MAAO,EAAE,CACvD,EAAI,EACP,EAAC,EACFV,IAEAY,EAAYX,EAASY,KAAK,GAAkB,MAAXC,EAAEX,IAAY,EAC/CY,EAAgBd,EAASY,KAAK,GAAkB,MAAXC,EAAEX,IAAY,EAanD,OAZAF,EAAW,CACP,GAAMW,EAAY,CAACA,GAAa,GAChC,GAAGX,EAASe,OAAO,GAAW,EAAIZ,EAAMD,MACpC,CAAC,IAAK,KAAKc,SAASb,EAAMD,IAAI,EAAE,EACpC,GAAMY,EAAgB,CAACA,GAAiB,IAC1CC,OAAO,GAAY,CAAC,CAACZ,EAAMD,MAAyC,CAAC,IAAjCC,EAAMD,KAAKe,QAAQ,OAAO,GACzB,CAAC,IAApCd,EAAMD,KAAKe,QAAQ,UAAU,CAAU,EACvCC,QAAQC,KAAKC,SAKVpB,CACX,SAESF,sBAAwB","sourceRoot":"../core"}
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RootingActionReturns } from './rooting.hooks.js';
|
|
2
2
|
export { useRootingActions } from './rooting.hooks.js';
|
|
3
|
+
import 'react-router-dom';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Permet d'initialiser toutes les routes de l'application
|
|
6
7
|
* @returns RouteObject[]
|
|
7
8
|
*/
|
|
8
|
-
declare const _default:
|
|
9
|
+
declare const _default: {
|
|
10
|
+
useRootingActions: () => RootingActionReturns;
|
|
11
|
+
};
|
|
9
12
|
|
|
10
13
|
export { _default as default };
|
package/index.jsx
CHANGED
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as routesUtils_js from './routes-utils.js';
|
|
3
|
-
import { routes } from './routes-utils.js';
|
|
4
|
-
export { useRootingActions } from './rooting.hooks.jsx';
|
|
1
|
+
import { useRootingActions } from './rooting.hooks.jsx';
|
|
5
2
|
|
|
6
|
-
var index =
|
|
7
|
-
|
|
8
|
-
path: route.path,
|
|
9
|
-
element: route.layout ? (jsxRuntimeExports.jsx(route.layout, { children: jsxRuntimeExports.jsx(route.component, {}) })) : (jsxRuntimeExports.jsx(route.component, {})),
|
|
10
|
-
...(!!route.error ? {
|
|
11
|
-
errorElement: jsxRuntimeExports.jsx(route.error, {}),
|
|
12
|
-
} : {}),
|
|
13
|
-
}));
|
|
14
|
-
let homeRoute = undefined;
|
|
15
|
-
let notFoundRoute = undefined;
|
|
16
|
-
homeRoute = routes$1.find((a) => a.path === '/');
|
|
17
|
-
notFoundRoute = routes$1.find((a) => a.path === '*');
|
|
18
|
-
routes$1 = [
|
|
19
|
-
...(!!homeRoute ? [homeRoute] : []),
|
|
20
|
-
...routes$1.filter((route) => !(!!route.path &&
|
|
21
|
-
['/', '*'].includes(route.path))),
|
|
22
|
-
...(!!notFoundRoute ? [notFoundRoute] : []),
|
|
23
|
-
].filter((route) => (!!route.path && (route.path.indexOf('/_404') === -1 &&
|
|
24
|
-
route.path.indexOf('/_layout') === -1)));
|
|
25
|
-
if (process.env?.NODE_ENV === 'development') {
|
|
26
|
-
console.log(`[router -> routes.tsx] notFoundRoute:: `, notFoundRoute);
|
|
27
|
-
console.log(`[router -> routes.tsx] autoRoutes:: `, routesUtils_js);
|
|
28
|
-
console.log(`[router -> routes.tsx] routes:: `, routes$1);
|
|
29
|
-
}
|
|
30
|
-
return routes$1;
|
|
3
|
+
var index = {
|
|
4
|
+
useRootingActions,
|
|
31
5
|
};
|
|
32
6
|
|
|
33
|
-
export { index as default };
|
|
7
|
+
export { index as default, useRootingActions };
|
package/index.min.jsx
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useRootingActions}from"./rooting.hooks.jsx";var index={useRootingActions:useRootingActions};export{index as default,useRootingActions};
|
package/index.min.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.min.jsx","sources":["index.jsx"],"names":["
|
|
1
|
+
{"version":3,"file":"index.min.jsx","sources":["index.jsx"],"names":["useRootingActions","index"],"mappings":"OAASA,iBAA8C,KAArB,sBAElC,IAAIC,MAAQ,CACRD,kBAAAA,iBACJ,SAESC,iBAAkBD,iBAAmB","sourceRoot":"../core"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.10",
|
|
7
7
|
"description": "CORE est un module de routage intelligent et auto-configuré pour les applications React avec TypeScript/Javascript. Il fournit un système de routage basé sur la structure de fichiers, des hooks de navigation avancés et une configuration minimale pour les applications modulaires.",
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"keywords": [],
|