@arc-js/core 0.0.11 → 0.0.13

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/routes-utils.js CHANGED
@@ -1,4 +1,90 @@
1
- import { getAllConfig, findConfigModuleRoute } from './minimal-config.js';
1
+
2
+
3
+
4
+
5
+ function __awaiter(thisArg, _arguments, P, generator) {
6
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
+ return new (P || (P = Promise))(function (resolve, reject) {
8
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12
+ });
13
+ }
14
+
15
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
16
+ var e = new Error(message);
17
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
18
+ };
19
+
20
+ const configModules = import.meta.glob([
21
+ '/src/config.json',
22
+ '/src/modules/**/config.json'
23
+ ]);
24
+ function cleanPathConfig(filePath) {
25
+ return filePath
26
+ .replace(/^\/src/, '')
27
+ .replace(/^\/src\/modules\//, '')
28
+ .replace(/^\/modules\//, '')
29
+ .replace(/config\.json$/, '');
30
+ }
31
+ function filePathToConfigPath(filePath, isParent = false) {
32
+ isParent = (typeof isParent === 'boolean') ? isParent : false;
33
+ let configPath = !!isParent ? filePath.replace(/config\.json$/, '') : cleanPathConfig(filePath);
34
+ configPath = configPath.split('/').filter((subPath) => (typeof subPath === 'string' &&
35
+ subPath.length > 0)).join('/');
36
+ return configPath.startsWith('/') ? configPath : `/${configPath}`.split('//').join('/');
37
+ }
38
+ function getAllConfig() {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ let configs = yield Promise.all(Object.entries(configModules).map((_a) => __awaiter(this, [_a], void 0, function* ([filePath, module]) {
41
+ const parentTruePath = filePathToConfigPath(filePath, true).split('/').join('/');
42
+ const configPath = filePathToConfigPath(filePath);
43
+ let nameConfig = configPath.split('/').filter((subPath, indexSubPath, pathArr) => (indexSubPath > 0)).join('/');
44
+ nameConfig = (typeof nameConfig === 'string' &&
45
+ nameConfig.length > 0) ? nameConfig : undefined;
46
+ let config = (yield module()).default;
47
+ config = (typeof config === 'object' &&
48
+ !Array.isArray(config) &&
49
+ Object.keys(config).length > 0) ? {
50
+ path: ((typeof (config === null || config === void 0 ? void 0 : config.path) === 'string' &&
51
+ (config === null || config === void 0 ? void 0 : config.path.length) > 0) ? config === null || config === void 0 ? void 0 : config.path : configPath),
52
+ name: ((typeof (config === null || config === void 0 ? void 0 : config.name) === 'string' &&
53
+ (config === null || config === void 0 ? void 0 : config.name.length) > 0) ? config === null || config === void 0 ? void 0 : config.name : nameConfig),
54
+ description: ((typeof (config === null || config === void 0 ? void 0 : config.description) === 'string' &&
55
+ (config === null || config === void 0 ? void 0 : config.description.length) > 0) ? config === null || config === void 0 ? void 0 : config.description : undefined),
56
+ author: ((typeof (config === null || config === void 0 ? void 0 : config.author) === 'string' &&
57
+ (config === null || config === void 0 ? void 0 : config.author.length) > 0) ? config === null || config === void 0 ? void 0 : config.author : undefined),
58
+ isEnabled: ((typeof (config === null || config === void 0 ? void 0 : config.isEnabled) === 'boolean') ? config === null || config === void 0 ? void 0 : config.isEnabled : true),
59
+ } : {
60
+ path: configPath,
61
+ name: nameConfig,
62
+ author: undefined,
63
+ isEnabled: true,
64
+ };
65
+ return {
66
+ parentTruePath,
67
+ truePath: filePath,
68
+ path: configPath,
69
+ name: nameConfig,
70
+ description: undefined,
71
+ config,
72
+ };
73
+ })));
74
+ return configs;
75
+ });
76
+ }
77
+ function findConfigModuleRoute(route, configDatas) {
78
+ var _a;
79
+ const res = (_a = configDatas.sort((a, b) => {
80
+ if (a.truePath.split('/').length > b.truePath.split('/').length)
81
+ return -1;
82
+ if (a.truePath.split('/').length < b.truePath.split('/').length)
83
+ return 1;
84
+ return 0;
85
+ }).find((config) => (route.truePath.indexOf(config.parentTruePath) === 0))) === null || _a === void 0 ? void 0 : _a.config;
86
+ return res;
87
+ }
2
88
 
3
89
  const errorPageName = '_error';
4
90
  const defaultErrorPath = '/src/pages/_error';
@@ -35,40 +121,45 @@ function filePathToRoutePath(filePath) {
35
121
  }
36
122
  return routePath.startsWith(indexPagePath) ? routePath : `/${routePath}`;
37
123
  }
38
- async function findLayoutForPage(filePath) {
39
- const layoutPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${layoutName}.tsx`);
40
- const layoutModules = import.meta.glob('/src/modules/**/_layout.tsx', { eager: true });
41
- const defaultLayoutModules = import.meta.glob('/src/pages/_layout.tsx', { eager: true });
42
- return layoutModules[layoutPath]?.default || defaultLayoutModules[`${defaultLayoutPath}.tsx`]?.default;
124
+ function findLayoutForPage(filePath) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ var _a, _b;
127
+ const layoutPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${layoutName}.tsx`);
128
+ const layoutModules = import.meta.glob('/src/modules/**/_layout.tsx', { eager: true });
129
+ const defaultLayoutModules = import.meta.glob('/src/pages/_layout.tsx', { eager: true });
130
+ return ((_a = layoutModules[layoutPath]) === null || _a === void 0 ? void 0 : _a.default) || ((_b = defaultLayoutModules[`${defaultLayoutPath}.tsx`]) === null || _b === void 0 ? void 0 : _b.default);
131
+ });
43
132
  }
44
- async function findErrorForPage(filePath) {
45
- const errorPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${errorPageName}.tsx`);
46
- const errorModules = import.meta.glob("/src/modules/**/_error.tsx", { eager: true });
47
- const defaultErrorModules = import.meta.glob("/src/pages/_error.tsx", { eager: true });
48
- if (process.env?.NODE_ENV === 'debug') {
49
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] findErrorForPage | datas:: `, JSON.stringify({
50
- filePath,
51
- errorPath,
52
- }));
53
- }
54
- return errorModules[errorPath]?.default || defaultErrorModules[`${defaultErrorPath}.tsx`]?.default;
133
+ function findErrorForPage(filePath) {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ var _a, _b, _c;
136
+ const errorPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${errorPageName}.tsx`);
137
+ const errorModules = import.meta.glob("/src/modules/**/_error.tsx", { eager: true });
138
+ const defaultErrorModules = import.meta.glob("/src/pages/_error.tsx", { eager: true });
139
+ if (((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'debug') {
140
+ console.log(`[src -> @arc -> core -> rooter -> routes-utils] findErrorForPage | datas:: `, JSON.stringify({
141
+ filePath,
142
+ errorPath,
143
+ }));
144
+ }
145
+ return ((_b = errorModules[errorPath]) === null || _b === void 0 ? void 0 : _b.default) || ((_c = defaultErrorModules[`${defaultErrorPath}.tsx`]) === null || _c === void 0 ? void 0 : _c.default);
146
+ });
55
147
  }
56
- async function findErrorForPageLink(filePath) {
57
- const errorPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${errorPageName}.tsx`);
58
- return cleanPathPage(errorPath).split('/src').join('');
148
+ function findErrorForPageLink(filePath) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ const errorPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${errorPageName}.tsx`);
151
+ return cleanPathPage(errorPath).split('/src').join('');
152
+ });
59
153
  }
60
154
  function nearestRoute(targetRoute, routes) {
61
- const possibleLayouts = routes.map((route) => ({
62
- ...route,
63
- path: (route.path || '').split('/').filter((partRoute, indexPartRoute, arrayPartRoute) => ((arrayPartRoute.length >= 2 &&
64
- typeof arrayPartRoute?.[arrayPartRoute.length - 2] === 'string' &&
65
- arrayPartRoute?.[arrayPartRoute.length - 2].length <= 0 &&
155
+ const possibleLayouts = routes.map((route) => (Object.assign(Object.assign({}, route), { path: (route.path || '').split('/').filter((partRoute, indexPartRoute, arrayPartRoute) => ((arrayPartRoute.length >= 2 &&
156
+ typeof (arrayPartRoute === null || arrayPartRoute === void 0 ? void 0 : arrayPartRoute[arrayPartRoute.length - 2]) === 'string' &&
157
+ (arrayPartRoute === null || arrayPartRoute === void 0 ? void 0 : arrayPartRoute[arrayPartRoute.length - 2].length) <= 0 &&
66
158
  indexPartRoute < (arrayPartRoute.length - 2)) ||
67
159
  (!(arrayPartRoute.length >= 2 &&
68
- typeof arrayPartRoute?.[arrayPartRoute.length - 2] === 'string' &&
69
- arrayPartRoute?.[arrayPartRoute.length - 2].length <= 0) &&
70
- indexPartRoute < (arrayPartRoute.length - 1)))).join('/'),
71
- })).filter((route) => targetRoute.path.indexOf(route.path) === 0).sort((a, b) => {
160
+ typeof (arrayPartRoute === null || arrayPartRoute === void 0 ? void 0 : arrayPartRoute[arrayPartRoute.length - 2]) === 'string' &&
161
+ (arrayPartRoute === null || arrayPartRoute === void 0 ? void 0 : arrayPartRoute[arrayPartRoute.length - 2].length) <= 0) &&
162
+ indexPartRoute < (arrayPartRoute.length - 1)))).join('/') }))).filter((route) => targetRoute.path.indexOf(route.path) === 0).sort((a, b) => {
72
163
  if (a.path.indexOf(targetRoute.path) > b.path.indexOf(targetRoute.path))
73
164
  return -1;
74
165
  if (a.path.indexOf(targetRoute.path) < b.path.indexOf(targetRoute.path))
@@ -79,69 +170,68 @@ function nearestRoute(targetRoute, routes) {
79
170
  return 1;
80
171
  return 0;
81
172
  });
82
- return possibleLayouts?.[0];
173
+ return possibleLayouts === null || possibleLayouts === void 0 ? void 0 : possibleLayouts[0];
83
174
  }
84
- async function getRoutes() {
85
- const configs = await getAllConfig();
86
- if (process.env?.NODE_ENV === 'development') {
87
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | configs:: `, configs);
88
- }
89
- let routes = await Promise.all(Object.entries(pageModules).map(async ([filePath, module]) => {
90
- let layout = (!([
91
- notFoundPageName
92
- ].map((path) => (cleanPathPage(path))).includes(cleanPathPage(filePath)))) ? await findLayoutForPage(filePath) : undefined;
93
- let erroPage = await findErrorForPage(filePath);
94
- await findErrorForPageLink(filePath);
95
- const routePath = filePathToRoutePath(filePath);
96
- const component = (await module()).default;
97
- const routePathParent = routePath.split('/').filter((val, index, arr) => (typeof val === 'string' &&
98
- val.length > 0 &&
99
- index < (arr.length - 1))).join('/');
100
- return {
101
- truePath: filePath,
102
- path: routePath,
103
- component,
104
- layout,
105
- error: erroPage,
106
- pathParent: routePathParent,
107
- };
108
- }));
109
- const notFoundRoutes = routes.filter((route) => (!!route.truePath &&
110
- route.truePath.split('/').filter((partRoute) => partRoute.indexOf('_404.tsx') !== -1).length > 0)).map((route) => ({
111
- ...route,
112
- path: route.path.split('/').map((partRoute) => partRoute.split('_404').join(notFoundPagePath)).join('/'),
113
- }));
114
- routes = [
115
- ...routes.filter((route) => !(!!route.truePath &&
116
- route.truePath.split('/').filter((partRoute) => partRoute.indexOf('_404.tsx') !== -1).length > 0)),
117
- ...notFoundRoutes,
118
- ];
119
- const layoutRoutes = routes.filter((route) => (!!route.path && (route.path.indexOf('/_layout') !== -1)));
120
- const errorRoutes = routes.filter((route) => (!!route.path && (route.path.indexOf('/_error') !== -1)));
121
- if (process.env?.NODE_ENV === 'development') {
122
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | notFoundRoutes:: `, notFoundRoutes);
123
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | routes:: `, routes);
124
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | layoutRoutes:: `, layoutRoutes);
125
- }
126
- routes = routes.map((route) => ({
127
- ...route,
128
- layout: nearestRoute(route, layoutRoutes)?.component || route.layout,
129
- error: nearestRoute(route, errorRoutes)?.component || route.error,
130
- }));
131
- const routesF = routes.map((route, indexRoute) => {
132
- const routeConfig = findConfigModuleRoute(route, configs);
133
- if (typeof routeConfig?.path === 'string' &&
134
- routeConfig?.path.length > 0 &&
135
- routeConfig?.path != '/') {
136
- route.path = route.path.split('/').filter((subPath, indexSubPath, path) => (indexSubPath > 1)).join('/');
137
- route.path = `${routeConfig?.path}/${route.path}`.split('//').join('/');
175
+ function getRoutes() {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ var _a, _b, _c;
178
+ const configs = yield getAllConfig();
179
+ if (((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'development') {
180
+ console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | configs:: `, configs);
181
+ }
182
+ let routes = yield Promise.all(Object.entries(pageModules).map((_a) => __awaiter(this, [_a], void 0, function* ([filePath, module]) {
183
+ let layout = (!([
184
+ notFoundPageName
185
+ ].map((path) => (cleanPathPage(path))).includes(cleanPathPage(filePath)))) ? yield findLayoutForPage(filePath) : undefined;
186
+ let erroPage = yield findErrorForPage(filePath);
187
+ yield findErrorForPageLink(filePath);
188
+ const routePath = filePathToRoutePath(filePath);
189
+ const component = (yield module()).default;
190
+ const routePathParent = routePath.split('/').filter((val, index, arr) => (typeof val === 'string' &&
191
+ val.length > 0 &&
192
+ index < (arr.length - 1))).join('/');
193
+ return {
194
+ truePath: filePath,
195
+ path: routePath,
196
+ component,
197
+ layout,
198
+ error: erroPage,
199
+ pathParent: routePathParent,
200
+ };
201
+ })));
202
+ const notFoundRoutes = routes.filter((route) => (!!route.truePath &&
203
+ route.truePath.split('/').filter((partRoute) => partRoute.indexOf('_404.tsx') !== -1).length > 0)).map((route) => (Object.assign(Object.assign({}, route), { path: route.path.split('/').map((partRoute) => partRoute.split('_404').join(notFoundPagePath)).join('/') })));
204
+ routes = [
205
+ ...routes.filter((route) => !(!!route.truePath &&
206
+ route.truePath.split('/').filter((partRoute) => partRoute.indexOf('_404.tsx') !== -1).length > 0)),
207
+ ...notFoundRoutes,
208
+ ];
209
+ const layoutRoutes = routes.filter((route) => (!!route.path && (route.path.indexOf('/_layout') !== -1)));
210
+ const errorRoutes = routes.filter((route) => (!!route.path && (route.path.indexOf('/_error') !== -1)));
211
+ if (((_b = process.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'development') {
212
+ console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | notFoundRoutes:: `, notFoundRoutes);
213
+ console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | routes:: `, routes);
214
+ console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | layoutRoutes:: `, layoutRoutes);
138
215
  }
139
- return route;
216
+ routes = routes.map((route) => {
217
+ var _a, _b;
218
+ return (Object.assign(Object.assign({}, route), { layout: ((_a = nearestRoute(route, layoutRoutes)) === null || _a === void 0 ? void 0 : _a.component) || route.layout, error: ((_b = nearestRoute(route, errorRoutes)) === null || _b === void 0 ? void 0 : _b.component) || route.error }));
219
+ });
220
+ const routesF = routes.map((route, indexRoute) => {
221
+ const routeConfig = findConfigModuleRoute(route, configs);
222
+ if (typeof (routeConfig === null || routeConfig === void 0 ? void 0 : routeConfig.path) === 'string' &&
223
+ (routeConfig === null || routeConfig === void 0 ? void 0 : routeConfig.path.length) > 0 &&
224
+ (routeConfig === null || routeConfig === void 0 ? void 0 : routeConfig.path) != '/') {
225
+ route.path = route.path.split('/').filter((subPath, indexSubPath, path) => (indexSubPath > 1)).join('/');
226
+ route.path = `${routeConfig === null || routeConfig === void 0 ? void 0 : routeConfig.path}/${route.path}`.split('//').join('/');
227
+ }
228
+ return route;
229
+ });
230
+ if (((_c = process.env) === null || _c === void 0 ? void 0 : _c.NODE_ENV) === 'development') {
231
+ console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | routesF:: `, routesF);
232
+ }
233
+ return routesF;
140
234
  });
141
- if (process.env?.NODE_ENV === 'development') {
142
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | routesF:: `, routesF);
143
- }
144
- return routesF;
145
235
  }
146
236
  const routes = await getRoutes();
147
237
 
@@ -1,2 +1,2 @@
1
- import{getAllConfig,findConfigModuleRoute}from"./minimal-config.js";let errorPageName="_error",defaultErrorPath="/src/pages/_error",notFoundPageName="_404",notFoundPagePath="*",defaultLayoutPath="/src/pages/_layout",layoutName="_layout",indexPageName="index",indexPageRule=/\/index$/,indexPagePath="/",pageModules=import.meta.glob(["/src/pages/**/*.tsx","/src/modules/**/pages/**/*.tsx"]);function cleanPathPage(e){return e.replace(/^\/src\/pages\//,"").replace(/^\/src\/modules\//,"").replace(/\/pages\//,"/").replace(/\.tsx$/,"").replace(/\{([^\]]+)\}/g,":$1")}function filePathToRoutePath(e){let t=cleanPathPage(e);if(t.endsWith("/"+indexPageName))t=t.replace(indexPageRule,"")||indexPagePath;else if(t===""+indexPageName)t=indexPagePath;else if(t===notFoundPageName)return t=notFoundPagePath;return t.startsWith(indexPagePath)?t:"/"+t}async function findLayoutForPage(e){var e=e.replace(/\/pages\/.*\.tsx$/,`/pages/${layoutName}.tsx`),t=import.meta.glob("/src/modules/**/_layout.tsx",{eager:!0}),a=import.meta.glob("/src/pages/_layout.tsx",{eager:!0});return t[e]?.default||a[defaultLayoutPath+".tsx"]?.default}async function findErrorForPage(e){var e=e.replace(/\/pages\/.*\.tsx$/,`/pages/${errorPageName}.tsx`),t=import.meta.glob("/src/modules/**/_error.tsx",{eager:!0}),a=import.meta.glob("/src/pages/_error.tsx",{eager:!0});return process.env?.NODE_ENV,t[e]?.default||a[defaultErrorPath+".tsx"]?.default}async function findErrorForPageLink(e){return cleanPathPage(e.replace(/\/pages\/.*\.tsx$/,`/pages/${errorPageName}.tsx`)).split("/src").join("")}function nearestRoute(a,e){return e.map(e=>({...e,path:(e.path||"").split("/").filter((e,t,a)=>2<=a.length&&"string"==typeof a?.[a.length-2]&&a?.[a.length-2].length<=0&&t<a.length-2||!(2<=a.length&&"string"==typeof a?.[a.length-2]&&a?.[a.length-2].length<=0)&&t<a.length-1).join("/")})).filter(e=>0===a.path.indexOf(e.path)).sort((e,t)=>e.path.indexOf(a.path)>t.path.indexOf(a.path)?-1:e.path.indexOf(a.path)<t.path.indexOf(a.path)?1:e.path.split("/").length>t.path.split("/").length?-1:e.path.split("/").length<t.path.split("/").length?1:0)?.[0]}async function getRoutes(){let r=await getAllConfig(),e=(process.env?.NODE_ENV,await Promise.all(Object.entries(pageModules).map(async([e,t])=>{var a=[notFoundPageName].map(e=>cleanPathPage(e)).includes(cleanPathPage(e))?void 0:await findLayoutForPage(e),r=await findErrorForPage(e),n=(await findErrorForPageLink(e),filePathToRoutePath(e)),t=(await t()).default,o=n.split("/").filter((e,t,a)=>"string"==typeof e&&0<e.length&&t<a.length-1).join("/");return{truePath:e,path:n,component:t,layout:a,error:r,pathParent:o}})));var t=e.filter(e=>!!e.truePath&&0<e.truePath.split("/").filter(e=>-1!==e.indexOf("_404.tsx")).length).map(e=>({...e,path:e.path.split("/").map(e=>e.split("_404").join(notFoundPagePath)).join("/")}));let a=(e=[...e.filter(e=>!(e.truePath&&0<e.truePath.split("/").filter(e=>-1!==e.indexOf("_404.tsx")).length)),...t]).filter(e=>!!e.path&&-1!==e.path.indexOf("/_layout")),n=e.filter(e=>!!e.path&&-1!==e.path.indexOf("/_error"));process.env?.NODE_ENV;t=(e=e.map(e=>({...e,layout:nearestRoute(e,a)?.component||e.layout,error:nearestRoute(e,n)?.component||e.error}))).map((e,t)=>{var a=findConfigModuleRoute(e,r);return"string"==typeof a?.path&&0<a?.path.length&&"/"!=a?.path&&(e.path=e.path.split("/").filter((e,t,a)=>1<t).join("/"),e.path=(a?.path+"/"+e.path).split("//").join("/")),e});return process.env?.NODE_ENV,t}let routes=await getRoutes();export{getRoutes,routes};
1
+ function __awaiter(t,l,r,u){return new(r=r||Promise)(function(n,e){function a(t){try{o(u.next(t))}catch(t){e(t)}}function i(t){try{o(u.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(a,i)}o((u=u.apply(t,l||[])).next())})}let configModules=import.meta.glob(["/src/config.json","/src/modules/**/config.json"]);function cleanPathConfig(t){return t.replace(/^\/src/,"").replace(/^\/src\/modules\//,"").replace(/^\/modules\//,"").replace(/config\.json$/,"")}function filePathToConfigPath(t,e=!1){let n=(e="boolean"==typeof e&&e)?t.replace(/config\.json$/,""):cleanPathConfig(t);return(n=n.split("/").filter(t=>"string"==typeof t&&0<t.length).join("/")).startsWith("/")?n:("/"+n).split("//").join("/")}function getAllConfig(){return __awaiter(this,void 0,void 0,function*(){return yield Promise.all(Object.entries(configModules).map(t=>__awaiter(this,[t],void 0,function*([t,e]){var n=filePathToConfigPath(t,!0).split("/").join("/"),a=filePathToConfigPath(t),i="string"==typeof(i=a.split("/").filter((t,e,n)=>0<e).join("/"))&&0<i.length?i:void 0,e=(yield e()).default;return{parentTruePath:n,truePath:t,path:a,name:i,description:void 0,config:"object"==typeof e&&!Array.isArray(e)&&0<Object.keys(e).length?{path:"string"==typeof(null==e?void 0:e.path)&&0<(null==e?void 0:e.path.length)?null==e?void 0:e.path:a,name:"string"==typeof(null==e?void 0:e.name)&&0<(null==e?void 0:e.name.length)?null==e?void 0:e.name:i,description:!("string"==typeof(null==e?void 0:e.description)&&0<(null==e?void 0:e.description.length))||null==e?void 0:e.description,author:!("string"==typeof(null==e?void 0:e.author)&&0<(null==e?void 0:e.author.length))||null==e?void 0:e.author,isEnabled:"boolean"!=typeof(null==e?void 0:e.isEnabled)||(null==e?void 0:e.isEnabled)}:{path:a,name:i,author:void 0,isEnabled:!0}}})))})}function findConfigModuleRoute(e,t){return null==(t=t.sort((t,e)=>t.truePath.split("/").length>e.truePath.split("/").length?-1:t.truePath.split("/").length<e.truePath.split("/").length?1:0).find(t=>0===e.truePath.indexOf(t.parentTruePath)))?void 0:t.config}let errorPageName="_error",defaultErrorPath="/src/pages/_error",notFoundPageName="_404",notFoundPagePath="*",defaultLayoutPath="/src/pages/_layout",layoutName="_layout",indexPageName="index",indexPageRule=/\/index$/,indexPagePath="/",pageModules=import.meta.glob(["/src/pages/**/*.tsx","/src/modules/**/pages/**/*.tsx"]);function cleanPathPage(t){return t.replace(/^\/src\/pages\//,"").replace(/^\/src\/modules\//,"").replace(/\/pages\//,"/").replace(/\.tsx$/,"").replace(/\{([^\]]+)\}/g,":$1")}function filePathToRoutePath(t){let e=cleanPathPage(t);if(e.endsWith("/"+indexPageName))e=e.replace(indexPageRule,"")||indexPagePath;else if(e===""+indexPageName)e=indexPagePath;else if(e===notFoundPageName)return e=notFoundPagePath;return e.startsWith(indexPagePath)?e:"/"+e}function findLayoutForPage(a){return __awaiter(this,void 0,void 0,function*(){var t=a.replace(/\/pages\/.*\.tsx$/,`/pages/${layoutName}.tsx`),e=import.meta.glob("/src/modules/**/_layout.tsx",{eager:!0}),n=import.meta.glob("/src/pages/_layout.tsx",{eager:!0});return(null==(e=e[t])?void 0:e.default)||(null==(t=n[defaultLayoutPath+".tsx"])?void 0:t.default)})}function findErrorForPage(i){return __awaiter(this,void 0,void 0,function*(){var t,e=i.replace(/\/pages\/.*\.tsx$/,`/pages/${errorPageName}.tsx`),n=import.meta.glob("/src/modules/**/_error.tsx",{eager:!0}),a=import.meta.glob("/src/pages/_error.tsx",{eager:!0});return null!=(t=process.env)&&t.NODE_ENV,(null==(t=n[e])?void 0:t.default)||(null==(n=a[defaultErrorPath+".tsx"])?void 0:n.default)})}function findErrorForPageLink(t){return __awaiter(this,void 0,void 0,function*(){return cleanPathPage(t.replace(/\/pages\/.*\.tsx$/,`/pages/${errorPageName}.tsx`)).split("/src").join("")})}function nearestRoute(n,t){t=t.map(t=>Object.assign(Object.assign({},t),{path:(t.path||"").split("/").filter((t,e,n)=>2<=n.length&&"string"==typeof(null==n?void 0:n[n.length-2])&&(null==n?void 0:n[n.length-2].length)<=0&&e<n.length-2||!(2<=n.length&&"string"==typeof(null==n?void 0:n[n.length-2])&&(null==n?void 0:n[n.length-2].length)<=0)&&e<n.length-1).join("/")})).filter(t=>0===n.path.indexOf(t.path)).sort((t,e)=>t.path.indexOf(n.path)>e.path.indexOf(n.path)?-1:t.path.indexOf(n.path)<e.path.indexOf(n.path)?1:t.path.split("/").length>e.path.split("/").length?-1:t.path.split("/").length<e.path.split("/").length?1:0);return null==t?void 0:t[0]}function getRoutes(){return __awaiter(this,void 0,void 0,function*(){let t,e,n,a=yield getAllConfig(),i=(null==(t=process.env)||t.NODE_ENV,yield Promise.all(Object.entries(pageModules).map(t=>__awaiter(this,[t],void 0,function*([t,e]){var n=[notFoundPageName].map(t=>cleanPathPage(t)).includes(cleanPathPage(t))?void 0:yield findLayoutForPage(t),a=yield findErrorForPage(t),i=(yield findErrorForPageLink(t),filePathToRoutePath(t)),e=(yield e()).default,o=i.split("/").filter((t,e,n)=>"string"==typeof t&&0<t.length&&e<n.length-1).join("/");return{truePath:t,path:i,component:e,layout:n,error:a,pathParent:o}}))));var o=i.filter(t=>!!t.truePath&&0<t.truePath.split("/").filter(t=>-1!==t.indexOf("_404.tsx")).length).map(t=>Object.assign(Object.assign({},t),{path:t.path.split("/").map(t=>t.split("_404").join(notFoundPagePath)).join("/")}));let l=(i=[...i.filter(t=>!(t.truePath&&0<t.truePath.split("/").filter(t=>-1!==t.indexOf("_404.tsx")).length)),...o]).filter(t=>!!t.path&&-1!==t.path.indexOf("/_layout")),r=i.filter(t=>!!t.path&&-1!==t.path.indexOf("/_error"));null!=(e=process.env)&&e.NODE_ENV;o=(i=i.map(t=>{var e;return Object.assign(Object.assign({},t),{layout:(null==(e=nearestRoute(t,l))?void 0:e.component)||t.layout,error:(null==(e=nearestRoute(t,r))?void 0:e.component)||t.error})})).map((t,e)=>{var n=findConfigModuleRoute(t,a);return"string"==typeof(null==n?void 0:n.path)&&0<(null==n?void 0:n.path.length)&&"/"!=(null==n?void 0:n.path)&&(t.path=t.path.split("/").filter((t,e,n)=>1<e).join("/"),t.path=(`${null==n?void 0:n.path}/`+t.path).split("//").join("/")),t});return null!=(n=process.env)&&n.NODE_ENV,o})}let routes=await getRoutes();export{getRoutes,routes};
2
2
  //# sourceMappingURL=routes-utils.min.js.map
package/utils.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare function getLang(lang: string): string;
2
+ declare function getLangCode(lang: string): string;
3
+
4
+ export { getLang, getLangCode };
package/utils.js ADDED
@@ -0,0 +1,16 @@
1
+ const langs = ['en', 'fr'];
2
+ const langCodes = {
3
+ 'fr': 'fr_FR',
4
+ 'en': 'en_US',
5
+ };
6
+
7
+ function getLang(lang) {
8
+ let result = lang;
9
+ result = langs.includes(result) ? result : 'fr';
10
+ return result;
11
+ }
12
+ function getLangCode(lang) {
13
+ return langCodes[getLang(lang)];
14
+ }
15
+
16
+ export { getLang, getLangCode };
package/utils.min.js ADDED
@@ -0,0 +1,2 @@
1
+ let langs=["en","fr"],langCodes={fr:"fr_FR",en:"en_US"};function getLang(n){return langs.includes(n)?n:"fr"}function getLangCode(n){return langCodes[getLang(n)]}export{getLang,getLangCode};
2
+ //# sourceMappingURL=utils.min.js.map
package/auto-rooting.d.ts DELETED
@@ -1,10 +0,0 @@
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 };
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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"}
@@ -1,87 +0,0 @@
1
- import { Params, NavigateFunction } from 'react-router-dom';
2
-
3
- /**
4
- * Interface du paramètre de configuration de la fonction "goAndReloadRoute" .
5
- */
6
- interface ConfigGoToSpecificUrl {
7
- path?: string;
8
- queries?: any;
9
- refreshPage?: boolean;
10
- replace?: boolean;
11
- enableLoader?: boolean;
12
- }
13
- /**
14
- * Interface du paramètre de configuration de la fonction "goAndReloadRoute" .
15
- */
16
- interface ConfigGoAndReloadRoute {
17
- path?: string;
18
- params?: any;
19
- queries?: any;
20
- enableLoader?: boolean;
21
- }
22
- /**
23
- * Interface du paramètre de configuration de la fonction "resolveRoute" .
24
- */
25
- interface ConfigResolveRoute {
26
- path?: string;
27
- params?: any;
28
- queries?: any;
29
- }
30
- /**
31
- * Interface du paramètre de configuration de la fonction "goToRoute" .
32
- */
33
- interface ConfigGoToRoute {
34
- path?: string;
35
- params?: any;
36
- queries?: any;
37
- refreshPage?: boolean;
38
- replace?: boolean;
39
- enableLoader?: boolean;
40
- }
41
- /**
42
- * Interface de retour du hooks "useRootingActions".
43
- */
44
- interface RootingActionReturns {
45
- params: Readonly<Params<string>>;
46
- queries: any;
47
- getParams: () => URLSearchParams;
48
- navigate: NavigateFunction;
49
- resolveRoute: (config: ConfigResolveRoute) => string;
50
- goToRoute: (config: ConfigGoToRoute) => void;
51
- goAndReloadRoute: (config: ConfigGoAndReloadRoute) => void;
52
- pathName: string;
53
- urlSearch: string;
54
- getUrlData: (url: string | URL) => {
55
- host: string;
56
- hostname: string;
57
- pathname: string;
58
- search: string;
59
- queries: any;
60
- } | undefined;
61
- goToUrl: (config: ConfigGoToSpecificUrl) => string;
62
- checkIfIsCurrentRoute: (path?: string, exact?: boolean, strict?: boolean) => boolean;
63
- }
64
- /**
65
- * Cette fonction permet de recuperer une route en fonction de son path, ses paramètres et ses query parameters.
66
- * @param config - la donnée de la route à ressortir
67
- * @param incorrectUrl - la route qui sera prise en compte si le path n'existe pas
68
- * @returns string
69
- */
70
- declare function nativeResolveRoute(config: ConfigResolveRoute, incorrectUrl?: string): string;
71
- /**
72
- * Ce hooks contient toutes les actions necessaires pour le routing.
73
- * - recuperer les paramètres de la route
74
- * - Recuperer les query parameters de la route
75
- * - naviguer au travers des routes
76
- * - recuperer une route en fonction de son path, ses paramètres et ses query parameters
77
- * - naviguer vers une route en fonction de son path, ses paramètres et ses query parameters
78
- * - naviguer vers une route en fonction de son path, ses paramètres et ses query parameters en rafraîchissant le navigateur
79
- * - recuperer l'url de la route courante
80
- * - recuperer la chaîne de caractères contenant les query parameters
81
- * @type {() => RootingActionReturns}
82
- * @returns {RootingActionReturns} Resultat du hooks.
83
- */
84
- declare const useRootingActions: () => RootingActionReturns;
85
-
86
- export { nativeResolveRoute, useRootingActions };
87
- export type { ConfigGoAndReloadRoute, ConfigGoToRoute, ConfigGoToSpecificUrl, ConfigResolveRoute, RootingActionReturns };
@@ -1 +0,0 @@
1
- import{r as reactExports}from"./_virtual/index";import{d as distExports}from"./_virtual/index2";import{getLang}from"./src/utils";import qust from"./node_modules/@arc-js/qust/index";function getParams(){var e=window.location.search;return new URLSearchParams(e)}function nativeResolveRoute(a,t=""){try{var s="object"==typeof a?.params&&!1===Array.isArray(a?.params)?a?.params:{},i="object"==typeof a?.queries&&!1===Array.isArray(a?.queries)?a?.queries:{},o="string"==typeof a?.path?a?.path:t;a?.queries||(a.queries={});let e=getLang(a?.queries?.lang),r=(a?.queries?.lang&&"fr"!=a?.queries?.lang&&(e=getLang(a?.queries?.lang||getParams().get("lang")||"fr")),a.queries={...a.queries,lang:e},distExports.generatePath(o,s));return r=0<Object.keys(i).length?r+"?"+distExports.createSearchParams(i):r}catch(e){return process.env?.NODE_ENV,t}}let useRootingActions=()=>{let t=distExports.useLocation().pathname;var e=distExports.useParams();let r=distExports.useLocation().pathname;var a,s=distExports.useLocation().search,i=new URLSearchParams(distExports.useLocation().search);let o={};for(a of i.keys()){var n=1===i.getAll(a).length?i.getAll(a)[0]:i.getAll(a);o={...o,[a]:n}}let l=distExports.useNavigate(),u=e=>nativeResolveRoute(e,r);return reactExports.useEffect(()=>{},[]),{params:e,queries:o,navigate:l,resolveRoute:u,goToRoute:(e,r=()=>{})=>{r=r||(()=>{}),e?.queries||(e.queries={});let a=getLang(e?.queries?.lang);e?.queries?.lang&&"fr"!=e?.queries?.lang&&(a=getLang(e?.queries?.lang||getParams().get("lang")||"fr")),e.queries={...e.queries,lang:a},e.queries=Object.fromEntries(Object.entries(e.queries||{}).filter(([,e])=>null!=e)),e.params=Object.fromEntries(Object.entries(e.params||{}).filter(([,e])=>null!=e)),void 0===!!e?.enableLoader&&"boolean"==typeof!!e?.enableLoader&&e?.enableLoader&&r();var r="boolean"==typeof e?.refreshPage&&e?.refreshPage,t=u({path:e?.path,params:e?.params,queries:e?.queries});r?window.location=t:l(t,{replace:e?.replace})},goAndReloadRoute:(e,r=()=>{})=>{r=r||(()=>{}),e?.queries||(e.queries={});let a=getLang(e?.queries?.lang);e?.queries?.lang&&"fr"!=e?.queries?.lang&&(a=getLang(e?.queries?.lang||getParams().get("lang")||"fr")),e.queries={...e.queries,lang:a},e.queries=Object.fromEntries(Object.entries(e.queries||{}).filter(([,e])=>null!=e)),e.params=Object.fromEntries(Object.entries(e.params||{}).filter(([,e])=>null!=e));var t=u(e);window.location=t,void 0===!!e?.enableLoader&&"boolean"==typeof!!e?.enableLoader&&e?.enableLoader&&r()},pathName:r,urlSearch:s,getUrlData:e=>{let r=void 0;"string"==typeof e&&0<e.length?r=new URL(e):e instanceof URL&&(r=e);var a=r?.search?new URLSearchParams(r?.search):void 0;let t=void 0;if(a){t={};for(var s of a.keys()){var i=1===a.getAll(s).length?a.getAll(s)[0]:a.getAll(s);t={...t,[s]:i}}}return r?{host:r?.host,hostname:r?.hostname,pathname:r?.pathname,search:r?.search,queries:t}:void 0},goToUrl:e=>{var r="object"==typeof e?.queries&&!1===Array.isArray(e?.queries)?e?.queries:{},a="string"==typeof e?.path?e?.path:"";e?.queries||(e.queries={});let t=getLang(e?.queries?.lang);e?.queries?.lang&&"fr"!=e?.queries?.lang&&(t=getLang(e?.queries?.lang||getParams().get("lang")||"fr")),e.queries={...e.queries,lang:t};r=qust.stringify(r),a=a+"?"+decodeURI(r);e?.refreshPage?window.location=a:window.location.assign(a)},getParams:getParams,checkIfIsCurrentRoute:(e,r=!0,a=!0)=>{e="string"==typeof e&&0<e.length?e:"";return!!distExports.matchPath({path:e,end:"boolean"!=typeof r||r,caseSensitive:"boolean"!=typeof a||a},t)}}};export{nativeResolveRoute,useRootingActions};
@@ -1 +0,0 @@
1
- {"version":3,"file":"rooting.hooks.min.jsx","sources":["rooting.hooks.jsx"],"names":["reactExports","distExports","getLang","qust","getParams","queryString","window","location","search","URLSearchParams","nativeResolveRoute","config","incorrectUrl","params","Array","isArray","queries","path","let","lang","res","get","generatePath","Object","keys","length","createSearchParams","error","process","env","NODE_ENV","useRootingActions","pathname","useLocation","useParams","pathName","key","urlSearch","paramsData","valueParamsData","getAll","navigate","useNavigate","resolveRoute","useEffect","goToRoute","loaderHandler","fromEntries","entries","filter","value","enableLoader","refreshPage","pathF","replace","goAndReloadRoute","url","getUrlData","urlF","undefined","URL","host","hostname","goToUrl","uncleanUrl","stringify","decodeURI","assign","checkIfIsCurrentRoute","exact","strict","matchPath","end","caseSensitive"],"mappings":"OAAcA,iBAAsC,KAAlB,0BACpBC,gBAAsC,KAAnB,2BACxBC,OAA4B,KAAb,qBACjBC,SAAU,oCAEjB,SAASC,YACL,IAAMC,EAAcC,OAAOC,SAASC,OAEpC,OADkB,IAAIC,gBAAgBJ,CAAW,CAErD,CACA,SAASK,mBAAmBC,EAAQC,EAAe,IAC/C,IACI,IAAMC,EAAoC,UAA1B,OAAOF,GAAQE,QACO,CAAA,IAAlCC,MAAMC,QAAQJ,GAAQE,MAAM,EAAeF,GAAQE,OAAS,GAC1DG,EAAsC,UAA3B,OAAOL,GAAQK,SACO,CAAA,IAAnCF,MAAMC,QAAQJ,GAAQK,OAAO,EAAeL,GAAQK,QAAU,GAC5DC,EAAgC,UAAxB,OAAON,GAAQM,KAAqBN,GAAQM,KAAOL,EAC5DD,GAAQK,UACTL,EAAOK,QAAU,IAErBE,IAAIC,EAAOjB,QAAQS,GAAQK,SAASG,IAAI,EAQpCC,GAPET,GAAQK,SAASG,MAAiC,MAAzB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