@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/auto-rooting.jsx +27 -31
- package/auto-rooting.tsx +55 -0
- package/config.d.ts +8 -0
- package/config.js +8 -0
- package/config.min.js +2 -0
- package/minimal-config.d.ts +25 -2
- package/minimal-config.js +60 -38
- package/minimal-config.min.js +1 -1
- package/package.json +1 -1
- package/rooting.hooks.jsx +268 -194
- package/rooting.hooks.tsx +400 -0
- package/routes-utils.d.ts +12 -2
- package/routes-utils.js +179 -89
- package/routes-utils.min.js +1 -1
- package/utils.d.ts +4 -0
- package/utils.js +16 -0
- package/utils.min.js +2 -0
- package/auto-rooting.d.ts +0 -10
- package/auto-rooting.min.jsx +0 -1
- package/auto-rooting.min.jsx.map +0 -1
- package/rooting.hooks.d.ts +0 -87
- package/rooting.hooks.min.jsx +0 -1
- package/rooting.hooks.min.jsx.map +0 -1
package/routes-utils.js
CHANGED
|
@@ -1,4 +1,90 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
63
|
-
|
|
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
|
|
69
|
-
arrayPartRoute
|
|
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
|
|
173
|
+
return possibleLayouts === null || possibleLayouts === void 0 ? void 0 : possibleLayouts[0];
|
|
83
174
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
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
|
|
package/routes-utils.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
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
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
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 };
|
package/auto-rooting.min.jsx
DELETED
|
@@ -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};
|
package/auto-rooting.min.jsx.map
DELETED
|
@@ -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"}
|
package/rooting.hooks.d.ts
DELETED
|
@@ -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 };
|
package/rooting.hooks.min.jsx
DELETED
|
@@ -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,MAAzBR,GAAQK,SAASG,OAC5CA,EAAOjB,QAAQS,GAAQK,SAASG,MAAQf,UAAU,EAAEiB,IAAI,MAAM,GAAK,IAAI,GAE3EV,EAAOK,QAAU,CACb,GAAGL,EAAOK,QACVG,KAAAA,CACJ,EACUlB,YAAYqB,aAAaL,EAAMJ,CAAM,GAI/C,OAFIO,EAD8B,EAA9BG,OAAOC,KAAKR,CAAO,EAAES,OACZL,EAAH,IAAUnB,YAAYyB,mBAAmBV,CAAO,EAEnDI,CAOX,CALA,MAAOO,GAIH,OAHIC,QAAQC,KAAKC,SAGVlB,CACX,CACJ,CACA,IAAMmB,kBAAoB,KAEtB,IAAMC,EADW/B,YAAYgC,YAAY,EACfD,SAC1B,IAAMnB,EAASZ,YAAYiC,UAAU,EACrC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