@arc-js/core 0.0.52 → 0.0.54

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 CHANGED
@@ -1,12 +1,9 @@
1
+ import * as autoRoutes from './routes-utils';
1
2
  import { useRootingActions } from './rooting.hooks';
2
- import { getSrcPath } from "./utils";
3
- import { getRoutes } from "./routes-utils";
4
3
  import React from "react";
5
4
 
6
-
7
- export default async (srcPath = getSrcPath()) => {
8
- const autoRoutes = await getRoutes(srcPath);
9
- let routes = autoRoutes.map(route => ({
5
+ export default () => {
6
+ let routes = autoRoutes.routes.map(route => ({
10
7
  path: route.path,
11
8
  element: route.layout ? React.createElement(route.layout, null, React.createElement(route.component, null)) : React.createElement(route.component, null),
12
9
  ...(!!route.error ? {
package/auto-rooting.tsx CHANGED
@@ -1,17 +1,13 @@
1
1
  import { Navigate, RouteObject } from "react-router-dom";
2
2
  import { lazy } from 'react';
3
+ import * as autoRoutes from './routes-utils';
3
4
  import { useRootingActions } from './rooting.hooks';
4
5
  import { RouteDefinition } from './types';
5
- import { getSrcPath } from "./utils";
6
- import { getRoutes } from "./routes-utils";
7
6
 
8
7
 
9
8
 
10
- export default async (
11
- srcPath = getSrcPath(),
12
- ) => {
13
- const autoRoutes: RouteDefinition[] = await getRoutes(srcPath);
14
- let routes: RouteObject[] = autoRoutes.map((route) => ({
9
+ export default () => {
10
+ let routes: RouteObject[] = autoRoutes.routes.map((route) => ({
15
11
  path: route.path,
16
12
  element: route.layout ? (
17
13
  <route.layout>
package/config.js CHANGED
@@ -8,6 +8,6 @@ const langCodes = {
8
8
  const PATH_CONFIG = {
9
9
  SRC_DIR: '/src',
10
10
  };
11
- const SRC_DIR = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.APP_SRC_DIR) || '/src';
11
+ const SRC_DIR = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.VITE_APP_SRC_DIR) || '/src';
12
12
 
13
13
  export { NODEENV, PATH_CONFIG, SRC_DIR, langCodes, langs };
package/config.min.js CHANGED
@@ -1,2 +1,2 @@
1
- var _a;let NODEENV="development",langs=["en","fr"],langCodes={fr:"fr_FR",en:"en_US"},PATH_CONFIG={SRC_DIR:"/src"},SRC_DIR=(null==(_a=null==process?void 0:process.env)?void 0:_a.APP_SRC_DIR)||"/src";export{NODEENV,PATH_CONFIG,SRC_DIR,langCodes,langs};
1
+ var _a;let NODEENV="development",langs=["en","fr"],langCodes={fr:"fr_FR",en:"en_US"},PATH_CONFIG={SRC_DIR:"/src"},SRC_DIR=(null==(_a=null==process?void 0:process.env)?void 0:_a.VITE_APP_SRC_DIR)||"/src";export{NODEENV,PATH_CONFIG,SRC_DIR,langCodes,langs};
2
2
  //# sourceMappingURL=config.min.js.map
@@ -24,11 +24,10 @@ interface ConfigDatasDefinition {
24
24
  isEnabled: boolean;
25
25
  }
26
26
 
27
- declare function normalizePath(path: string): string;
28
- declare function getConfigModules(srcPath?: string): any;
29
- declare function cleanPathConfig(filePath: string, srcPath?: string): string;
30
- declare function filePathToConfigPath(filePath: string, isParent?: boolean, srcPath?: string): string;
31
- declare function getAllConfig(srcPath?: string): Promise<ConfigDefinition[]>;
27
+ declare const configModules: Record<string, () => Promise<any>>;
28
+ declare function cleanPathConfig(filePath: string): string;
29
+ declare function filePathToConfigPath(filePath: string, isParent?: boolean): string;
30
+ declare function getAllConfig(): Promise<ConfigDefinition[]>;
32
31
  declare function findConfigModuleRoute(route: RouteDefinition, configDatas: ConfigDefinition[]): ConfigDatasDefinition | undefined;
33
32
 
34
- export { cleanPathConfig, filePathToConfigPath, findConfigModuleRoute, getAllConfig, getConfigModules, normalizePath };
33
+ export { cleanPathConfig, configModules, filePathToConfigPath, findConfigModuleRoute, getAllConfig };
package/minimal-config.js CHANGED
@@ -18,44 +18,32 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
18
18
  };
19
19
 
20
20
  var _a;
21
- const SRC_DIR = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.APP_SRC_DIR) || '/src';
21
+ const SRC_DIR = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.VITE_APP_SRC_DIR) || '/src';
22
22
 
23
- function getSrcPath() {
24
- return SRC_DIR;
25
- }
26
-
27
- function normalizePath(path) {
28
- return path.replace(/\/+/g, '/').replace(/\/$/, '');
29
- }
30
- function getConfigModules(srcPath = getSrcPath()) {
31
- const allPatterns = [
32
- `${srcPath}/config.json`,
33
- `${srcPath}/modules/**/config.json`
34
- ];
35
- return import.meta.glob(allPatterns);
36
- }
37
- function cleanPathConfig(filePath, srcPath = getSrcPath()) {
23
+ const configModules = import.meta.glob([
24
+ '@/config.json',
25
+ '@/modules/**/config.json'
26
+ ]);
27
+ function cleanPathConfig(filePath) {
28
+ const srcPath = SRC_DIR;
38
29
  return filePath
39
30
  .replace(new RegExp(`^${srcPath}`), '')
40
- .replace(new RegExp(`^${srcPath}/modules/`), '')
31
+ .replace(new RegExp(`^${srcPath}/modules`), '')
41
32
  .replace(/^\/modules\//, '')
42
33
  .replace(/config\.json$/, '');
43
34
  }
44
- function filePathToConfigPath(filePath, isParent = false, srcPath = getSrcPath()) {
35
+ function filePathToConfigPath(filePath, isParent = false) {
45
36
  isParent = (typeof isParent === 'boolean') ? isParent : false;
46
- let configPath = !!isParent ? filePath.replace(/config\.json$/, '') : cleanPathConfig(filePath, srcPath);
47
- configPath = configPath.replace(new RegExp(`^${srcPath}`), '');
37
+ let configPath = !!isParent ? filePath.replace(/config\.json$/, '') : cleanPathConfig(filePath);
48
38
  configPath = configPath.split('/').filter((subPath) => (typeof subPath === 'string' &&
49
39
  subPath.length > 0)).join('/');
50
40
  return configPath.startsWith('/') ? configPath : `/${configPath}`.split('//').join('/');
51
41
  }
52
42
  function getAllConfig() {
53
- return __awaiter(this, arguments, void 0, function* (srcPath = getSrcPath()) {
54
- const configModules = getConfigModules(srcPath);
43
+ return __awaiter(this, void 0, void 0, function* () {
55
44
  let configs = yield Promise.all(Object.entries(configModules).map((_a) => __awaiter(this, [_a], void 0, function* ([filePath, module]) {
56
- const parentTruePath = filePathToConfigPath(filePath, true, srcPath).split('/').join('/');
57
- const configPath = filePathToConfigPath(filePath, false, srcPath);
58
- filePath.replace(new RegExp(`^${srcPath}`), '');
45
+ const parentTruePath = filePathToConfigPath(filePath, true).split('/').join('/');
46
+ const configPath = filePathToConfigPath(filePath);
59
47
  let nameConfig = configPath.split('/').filter((subPath, indexSubPath, pathArr) => (indexSubPath > 0)).join('/');
60
48
  nameConfig = (typeof nameConfig === 'string' &&
61
49
  nameConfig.length > 0) ? nameConfig : undefined;
@@ -102,4 +90,4 @@ function findConfigModuleRoute(route, configDatas) {
102
90
  return res;
103
91
  }
104
92
 
105
- export { cleanPathConfig, filePathToConfigPath, findConfigModuleRoute, getAllConfig, getConfigModules, normalizePath };
93
+ export { cleanPathConfig, configModules, filePathToConfigPath, findConfigModuleRoute, getAllConfig };
@@ -1,2 +1,2 @@
1
- function __awaiter(t,a,r,u){return new(r=r||Promise)(function(n,e){function o(t){try{l(u.next(t))}catch(t){e(t)}}function i(t){try{l(u.throw(t))}catch(t){e(t)}}function l(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(o,i)}l((u=u.apply(t,a||[])).next())})}var _a;let SRC_DIR=(null==(_a=null==process?void 0:process.env)?void 0:_a.APP_SRC_DIR)||"/src";function getSrcPath(){return SRC_DIR}function normalizePath(t){return t.replace(/\/+/g,"/").replace(/\/$/,"")}function getConfigModules(t=getSrcPath()){return import.meta.glob([t+"/config.json",t+"/modules/**/config.json"])}function cleanPathConfig(t,e=getSrcPath()){return t.replace(new RegExp("^"+e),"").replace(new RegExp(`^${e}/modules/`),"").replace(/^\/modules\//,"").replace(/config\.json$/,"")}function filePathToConfigPath(t,e=!1,n=getSrcPath()){let o=(e="boolean"==typeof e&&e)?t.replace(/config\.json$/,""):cleanPathConfig(t,n);return(o=(o=o.replace(new RegExp("^"+n),"")).split("/").filter(t=>"string"==typeof t&&0<t.length).join("/")).startsWith("/")?o:("/"+o).split("//").join("/")}function getAllConfig(){return __awaiter(this,arguments,void 0,function*(l=getSrcPath()){var t=getConfigModules(l);return yield Promise.all(Object.entries(t).map(t=>__awaiter(this,[t],void 0,function*([t,e]){var n=filePathToConfigPath(t,!0,l).split("/").join("/"),o=filePathToConfigPath(t,!1,l);t.replace(new RegExp("^"+l),"");var i="string"==typeof(i=o.split("/").filter((t,e,n)=>0<e).join("/"))&&0<i.length?i:void 0,e=(yield e()).default;return{parentTruePath:n,truePath:t,path:o,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:o,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:o,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}export{cleanPathConfig,filePathToConfigPath,findConfigModuleRoute,getAllConfig,getConfigModules,normalizePath};
1
+ function __awaiter(n,a,r,u){return new(r=r||Promise)(function(e,t){function o(n){try{l(u.next(n))}catch(n){t(n)}}function i(n){try{l(u.throw(n))}catch(n){t(n)}}function l(n){var t;n.done?e(n.value):((t=n.value)instanceof r?t:new r(function(n){n(t)})).then(o,i)}l((u=u.apply(n,a||[])).next())})}var _a;let SRC_DIR=(null==(_a=null==process?void 0:process.env)?void 0:_a.VITE_APP_SRC_DIR)||"/src",configModules=import.meta.glob(["@/config.json","@/modules/**/config.json"]);function cleanPathConfig(n){var t=SRC_DIR;return n.replace(new RegExp("^"+t),"").replace(new RegExp(`^${t}/modules`),"").replace(/^\/modules\//,"").replace(/config\.json$/,"")}function filePathToConfigPath(n,t=!1){let e=(t="boolean"==typeof t&&t)?n.replace(/config\.json$/,""):cleanPathConfig(n);return(e=e.split("/").filter(n=>"string"==typeof n&&0<n.length).join("/")).startsWith("/")?e:("/"+e).split("//").join("/")}function getAllConfig(){return __awaiter(this,void 0,void 0,function*(){return yield Promise.all(Object.entries(configModules).map(n=>__awaiter(this,[n],void 0,function*([n,t]){var e=filePathToConfigPath(n,!0).split("/").join("/"),o=filePathToConfigPath(n),i="string"==typeof(i=o.split("/").filter((n,t,e)=>0<t).join("/"))&&0<i.length?i:void 0,t=(yield t()).default;return{parentTruePath:e,truePath:n,path:o,name:i,description:void 0,config:"object"==typeof t&&!Array.isArray(t)&&0<Object.keys(t).length?{path:"string"==typeof(null==t?void 0:t.path)&&0<(null==t?void 0:t.path.length)?null==t?void 0:t.path:o,name:"string"==typeof(null==t?void 0:t.name)&&0<(null==t?void 0:t.name.length)?null==t?void 0:t.name:i,description:!("string"==typeof(null==t?void 0:t.description)&&0<(null==t?void 0:t.description.length))||null==t?void 0:t.description,author:!("string"==typeof(null==t?void 0:t.author)&&0<(null==t?void 0:t.author.length))||null==t?void 0:t.author,isEnabled:"boolean"!=typeof(null==t?void 0:t.isEnabled)||(null==t?void 0:t.isEnabled)}:{path:o,name:i,author:void 0,isEnabled:!0}}})))})}function findConfigModuleRoute(t,n){return null==(n=n.sort((n,t)=>n.truePath.split("/").length>t.truePath.split("/").length?-1:n.truePath.split("/").length<t.truePath.split("/").length?1:0).find(n=>0===t.truePath.indexOf(n.parentTruePath)))?void 0:n.config}export{cleanPathConfig,configModules,filePathToConfigPath,findConfigModuleRoute,getAllConfig};
2
2
  //# sourceMappingURL=minimal-config.min.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.52",
6
+ "version": "0.0.54",
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": [],
package/rooting.hooks.jsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from 'react';
2
2
  import { useLocation, useNavigate, useParams, generatePath, createSearchParams, matchPath } from 'react-router-dom';
3
3
  import { getLang } from './utils';
4
- import { qust } from '@#{{organization}}/#{{packages.qust.name}}';
4
+ import { qust } from '@arc-js/qust';
5
5
  import React from "react"
6
6
 
7
7
 
package/rooting.hooks.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useEffect } from 'react';
2
2
  import { useLocation, useNavigate, useParams, generatePath, createSearchParams, NavigateFunction, Params, matchPath } from 'react-router-dom';
3
3
  import { getLang } from './utils';
4
- import { qust, Qust } from '@#{{organization}}/#{{packages.qust.name}}';
4
+ import { qust, Qust } from '@arc-js/qust';
5
5
 
6
6
 
7
7
 
package/routes-utils.d.ts CHANGED
@@ -11,6 +11,7 @@ interface RouteDefinition {
11
11
  error?: React.ComponentType<{}>;
12
12
  }
13
13
 
14
- declare function getRoutes(srcPath?: string): Promise<RouteDefinition[]>;
14
+ declare function getRoutes(): Promise<RouteDefinition[]>;
15
+ declare const routes: RouteDefinition[];
15
16
 
16
- export { getRoutes };
17
+ export { getRoutes, routes };
package/routes-utils.js CHANGED
@@ -18,41 +18,32 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
18
18
  };
19
19
 
20
20
  var _a;
21
- const SRC_DIR = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.APP_SRC_DIR) || '/src';
21
+ const SRC_DIR = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.VITE_APP_SRC_DIR) || '/src';
22
22
 
23
- function getSrcPath() {
24
- return SRC_DIR;
25
- }
26
-
27
- function getConfigModules(srcPath = getSrcPath()) {
28
- const allPatterns = [
29
- `${srcPath}/config.json`,
30
- `${srcPath}/modules/**/config.json`
31
- ];
32
- return import.meta.glob(allPatterns);
33
- }
34
- function cleanPathConfig(filePath, srcPath = getSrcPath()) {
23
+ const configModules = import.meta.glob([
24
+ '@/config.json',
25
+ '@/modules/**/config.json'
26
+ ]);
27
+ function cleanPathConfig(filePath) {
28
+ const srcPath = SRC_DIR;
35
29
  return filePath
36
30
  .replace(new RegExp(`^${srcPath}`), '')
37
- .replace(new RegExp(`^${srcPath}/modules/`), '')
31
+ .replace(new RegExp(`^${srcPath}/modules`), '')
38
32
  .replace(/^\/modules\//, '')
39
33
  .replace(/config\.json$/, '');
40
34
  }
41
- function filePathToConfigPath(filePath, isParent = false, srcPath = getSrcPath()) {
35
+ function filePathToConfigPath(filePath, isParent = false) {
42
36
  isParent = (typeof isParent === 'boolean') ? isParent : false;
43
- let configPath = !!isParent ? filePath.replace(/config\.json$/, '') : cleanPathConfig(filePath, srcPath);
44
- configPath = configPath.replace(new RegExp(`^${srcPath}`), '');
37
+ let configPath = !!isParent ? filePath.replace(/config\.json$/, '') : cleanPathConfig(filePath);
45
38
  configPath = configPath.split('/').filter((subPath) => (typeof subPath === 'string' &&
46
39
  subPath.length > 0)).join('/');
47
40
  return configPath.startsWith('/') ? configPath : `/${configPath}`.split('//').join('/');
48
41
  }
49
42
  function getAllConfig() {
50
- return __awaiter(this, arguments, void 0, function* (srcPath = getSrcPath()) {
51
- const configModules = getConfigModules(srcPath);
43
+ return __awaiter(this, void 0, void 0, function* () {
52
44
  let configs = yield Promise.all(Object.entries(configModules).map((_a) => __awaiter(this, [_a], void 0, function* ([filePath, module]) {
53
- const parentTruePath = filePathToConfigPath(filePath, true, srcPath).split('/').join('/');
54
- const configPath = filePathToConfigPath(filePath, false, srcPath);
55
- filePath.replace(new RegExp(`^${srcPath}`), '');
45
+ const parentTruePath = filePathToConfigPath(filePath, true).split('/').join('/');
46
+ const configPath = filePathToConfigPath(filePath);
56
47
  let nameConfig = configPath.split('/').filter((subPath, indexSubPath, pathArr) => (indexSubPath > 0)).join('/');
57
48
  nameConfig = (typeof nameConfig === 'string' &&
58
49
  nameConfig.length > 0) ? nameConfig : undefined;
@@ -99,36 +90,30 @@ function findConfigModuleRoute(route, configDatas) {
99
90
  return res;
100
91
  }
101
92
 
102
- function getDefaultErrorPath(srcPath = getSrcPath()) {
103
- return `${srcPath}/pages/_error`;
104
- }
105
- function getDefaultLayoutPath(srcPath = getSrcPath()) {
106
- return `${srcPath}/pages/_layout`;
107
- }
108
93
  const errorPageName = '_error';
94
+ const defaultErrorPath = `${SRC_DIR}/pages/_error`;
109
95
  const notFoundPageName = '_404';
110
96
  const notFoundPagePath = '*';
97
+ const defaultLayoutPath = `${SRC_DIR}/pages/_layout`;
111
98
  const layoutName = '_layout';
112
99
  const indexPageName = 'index';
113
100
  const indexPageRule = /\/index$/;
114
101
  const indexPagePath = '/';
115
- function getPageModules(srcPath = getSrcPath()) {
116
- const allPatterns = [
117
- `${srcPath}/pages/**/*.tsx`,
118
- `${srcPath}/modules/**/pages/**/*.tsx`
119
- ];
120
- return import.meta.glob(allPatterns);
121
- }
122
- function cleanPathPage(filePath, srcPath = getSrcPath()) {
102
+ const pageModules = import.meta.glob([
103
+ '@/pages/**/*.tsx',
104
+ '@/modules/**/pages/**/*.tsx'
105
+ ]);
106
+ function cleanPathPage(filePath) {
107
+ const srcPath = SRC_DIR;
123
108
  return filePath
124
- .replace(new RegExp(`^${srcPath}/pages/`), '')
125
- .replace(new RegExp(`^${srcPath}/modules/`), '')
109
+ .replace(new RegExp(`^${srcPath}/pages`), '')
110
+ .replace(new RegExp(`^${srcPath}/pages`), '')
126
111
  .replace(/\/pages\//, '/')
127
112
  .replace(/\.tsx$/, '')
128
113
  .replace(/\{([^\]]+)\}/g, ':$1');
129
114
  }
130
- function filePathToRoutePath(filePath, srcPath = getSrcPath()) {
131
- let routePath = cleanPathPage(filePath, srcPath);
115
+ function filePathToRoutePath(filePath) {
116
+ let routePath = cleanPathPage(filePath);
132
117
  if (routePath.endsWith(`/${indexPageName}`)) {
133
118
  routePath = routePath.replace(indexPageRule, '') || indexPagePath;
134
119
  }
@@ -141,38 +126,34 @@ function filePathToRoutePath(filePath, srcPath = getSrcPath()) {
141
126
  }
142
127
  return routePath.startsWith(indexPagePath) ? routePath : `/${routePath}`;
143
128
  }
144
- function findLayoutForPage(filePath_1) {
145
- return __awaiter(this, arguments, void 0, function* (filePath, srcPath = getSrcPath()) {
129
+ function findLayoutForPage(filePath) {
130
+ return __awaiter(this, void 0, void 0, function* () {
146
131
  var _a, _b;
147
- const defaultLayoutPath = getDefaultLayoutPath(srcPath);
148
132
  const layoutPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${layoutName}.tsx`);
149
- const layoutModules = import.meta.glob(`${srcPath}/modules/**/_layout.tsx`, { eager: true });
150
- const defaultLayoutModules = import.meta.glob(`${srcPath}/pages/_layout.tsx`, { eager: true });
151
- return ((_a = layoutModules[layoutPath]) === null || _a === void 0 ? void 0 : _a.default) ||
152
- ((_b = defaultLayoutModules[`${defaultLayoutPath}.tsx`]) === null || _b === void 0 ? void 0 : _b.default);
133
+ const layoutModules = import.meta.glob('@/modules/**/_layout.tsx', { eager: true });
134
+ const defaultLayoutModules = import.meta.glob('@/pages/_layout.tsx', { eager: true });
135
+ return ((_a = layoutModules[layoutPath]) === null || _a === void 0 ? void 0 : _a.default) || ((_b = defaultLayoutModules[`${defaultLayoutPath}.tsx`]) === null || _b === void 0 ? void 0 : _b.default);
153
136
  });
154
137
  }
155
- function findErrorForPage(filePath_1) {
156
- return __awaiter(this, arguments, void 0, function* (filePath, srcPath = getSrcPath()) {
138
+ function findErrorForPage(filePath) {
139
+ return __awaiter(this, void 0, void 0, function* () {
157
140
  var _a, _b, _c;
158
- const defaultErrorPath = getDefaultErrorPath(srcPath);
159
141
  const errorPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${errorPageName}.tsx`);
160
- const errorModules = import.meta.glob(`${srcPath}/modules/**/_error.tsx`, { eager: true });
161
- const defaultErrorModules = import.meta.glob(`${srcPath}/pages/_error.tsx`, { eager: true });
142
+ const errorModules = import.meta.glob('@/modules/**/_error.tsx', { eager: true });
143
+ const defaultErrorModules = import.meta.glob('@/pages/_error.tsx', { eager: true });
162
144
  if (((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'debug') {
163
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] findErrorForPage | datas:: `, JSON.stringify({
145
+ console.log(`[@arc -> core -> rooter -> routes-utils] findErrorForPage | datas:: `, JSON.stringify({
164
146
  filePath,
165
147
  errorPath,
166
148
  }));
167
149
  }
168
- return ((_b = errorModules[errorPath]) === null || _b === void 0 ? void 0 : _b.default) ||
169
- ((_c = defaultErrorModules[`${defaultErrorPath}.tsx`]) === null || _c === void 0 ? void 0 : _c.default);
150
+ return ((_b = errorModules[errorPath]) === null || _b === void 0 ? void 0 : _b.default) || ((_c = defaultErrorModules[`${defaultErrorPath}.tsx`]) === null || _c === void 0 ? void 0 : _c.default);
170
151
  });
171
152
  }
172
- function findErrorForPageLink(filePath_1) {
173
- return __awaiter(this, arguments, void 0, function* (filePath, srcPath = getSrcPath()) {
153
+ function findErrorForPageLink(filePath) {
154
+ return __awaiter(this, void 0, void 0, function* () {
174
155
  const errorPath = filePath.replace(/\/pages\/.*\.tsx$/, `/pages/${errorPageName}.tsx`);
175
- return cleanPathPage(errorPath, srcPath).split(srcPath).join('');
156
+ return cleanPathPage(errorPath).split(SRC_DIR).join('');
176
157
  });
177
158
  }
178
159
  function nearestRoute(targetRoute, routes) {
@@ -197,20 +178,19 @@ function nearestRoute(targetRoute, routes) {
197
178
  return possibleLayouts === null || possibleLayouts === void 0 ? void 0 : possibleLayouts[0];
198
179
  }
199
180
  function getRoutes() {
200
- return __awaiter(this, arguments, void 0, function* (srcPath = getSrcPath()) {
181
+ return __awaiter(this, void 0, void 0, function* () {
201
182
  var _a, _b, _c;
202
- const pageModules = getPageModules(srcPath);
203
- const configs = yield getAllConfig(srcPath);
183
+ const configs = yield getAllConfig();
204
184
  if (((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'development') {
205
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | configs:: `, configs);
185
+ console.log(`[@arc -> core -> rooter -> routes-utils] getRoutes | configs:: `, configs);
206
186
  }
207
187
  let routes = yield Promise.all(Object.entries(pageModules).map((_a) => __awaiter(this, [_a], void 0, function* ([filePath, module]) {
208
188
  let layout = (!([
209
189
  notFoundPageName
210
- ].map((path) => (cleanPathPage(path, srcPath))).includes(cleanPathPage(filePath, srcPath)))) ? yield findLayoutForPage(filePath, srcPath) : undefined;
211
- let erroPage = yield findErrorForPage(filePath, srcPath);
212
- yield findErrorForPageLink(filePath, srcPath);
213
- const routePath = filePathToRoutePath(filePath, srcPath);
190
+ ].map((path) => (cleanPathPage(path))).includes(cleanPathPage(filePath)))) ? yield findLayoutForPage(filePath) : undefined;
191
+ let erroPage = yield findErrorForPage(filePath);
192
+ yield findErrorForPageLink(filePath);
193
+ const routePath = filePathToRoutePath(filePath);
214
194
  const component = (yield module()).default;
215
195
  const routePathParent = routePath.split('/').filter((val, index, arr) => (typeof val === 'string' &&
216
196
  val.length > 0 &&
@@ -234,9 +214,9 @@ function getRoutes() {
234
214
  const layoutRoutes = routes.filter((route) => (!!route.path && (route.path.indexOf('/_layout') !== -1)));
235
215
  const errorRoutes = routes.filter((route) => (!!route.path && (route.path.indexOf('/_error') !== -1)));
236
216
  if (((_b = process.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'development') {
237
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | notFoundRoutes:: `, notFoundRoutes);
238
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | routes:: `, routes);
239
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | layoutRoutes:: `, layoutRoutes);
217
+ console.log(`[@arc -> core -> rooter -> routes-utils] getRoutes | notFoundRoutes:: `, notFoundRoutes);
218
+ console.log(`[@arc -> core -> rooter -> routes-utils] getRoutes | routes:: `, routes);
219
+ console.log(`[@arc -> core -> rooter -> routes-utils] getRoutes | layoutRoutes:: `, layoutRoutes);
240
220
  }
241
221
  routes = routes.map((route) => {
242
222
  var _a, _b;
@@ -253,10 +233,11 @@ function getRoutes() {
253
233
  return route;
254
234
  });
255
235
  if (((_c = process.env) === null || _c === void 0 ? void 0 : _c.NODE_ENV) === 'development') {
256
- console.log(`[src -> @arc -> core -> rooter -> routes-utils] getRoutes | routesF:: `, routesF);
236
+ console.log(`[@arc -> core -> rooter -> routes-utils] getRoutes | routesF:: `, routesF);
257
237
  }
258
238
  return routesF;
259
239
  });
260
240
  }
241
+ const routes = await getRoutes();
261
242
 
262
- export { getRoutes };
243
+ export { getRoutes, routes };
@@ -1,2 +1,2 @@
1
- function __awaiter(t,o,l,u){return new(l=l||Promise)(function(n,e){function a(t){try{i(u.next(t))}catch(t){e(t)}}function r(t){try{i(u.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof l?e:new l(function(t){t(e)})).then(a,r)}i((u=u.apply(t,o||[])).next())})}var _a;let SRC_DIR=(null==(_a=null==process?void 0:process.env)?void 0:_a.APP_SRC_DIR)||"/src";function getSrcPath(){return SRC_DIR}function getConfigModules(t=getSrcPath()){return import.meta.glob([t+"/config.json",t+"/modules/**/config.json"])}function cleanPathConfig(t,e=getSrcPath()){return t.replace(new RegExp("^"+e),"").replace(new RegExp(`^${e}/modules/`),"").replace(/^\/modules\//,"").replace(/config\.json$/,"")}function filePathToConfigPath(t,e=!1,n=getSrcPath()){let a=(e="boolean"==typeof e&&e)?t.replace(/config\.json$/,""):cleanPathConfig(t,n);return(a=(a=a.replace(new RegExp("^"+n),"")).split("/").filter(t=>"string"==typeof t&&0<t.length).join("/")).startsWith("/")?a:("/"+a).split("//").join("/")}function getAllConfig(){return __awaiter(this,arguments,void 0,function*(i=getSrcPath()){var t=getConfigModules(i);return yield Promise.all(Object.entries(t).map(t=>__awaiter(this,[t],void 0,function*([t,e]){var n=filePathToConfigPath(t,!0,i).split("/").join("/"),a=filePathToConfigPath(t,!1,i);t.replace(new RegExp("^"+i),"");var r="string"==typeof(r=a.split("/").filter((t,e,n)=>0<e).join("/"))&&0<r.length?r:void 0,e=(yield e()).default;return{parentTruePath:n,truePath:t,path:a,name:r,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:r,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:r,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}function getDefaultErrorPath(t=getSrcPath()){return t+"/pages/_error"}function getDefaultLayoutPath(t=getSrcPath()){return t+"/pages/_layout"}let errorPageName="_error",notFoundPageName="_404",notFoundPagePath="*",layoutName="_layout",indexPageName="index",indexPageRule=/\/index$/,indexPagePath="/";function getPageModules(t=getSrcPath()){return import.meta.glob([t+"/pages/**/*.tsx",t+"/modules/**/pages/**/*.tsx"])}function cleanPathPage(t,e=getSrcPath()){return t.replace(new RegExp(`^${e}/pages/`),"").replace(new RegExp(`^${e}/modules/`),"").replace(/\/pages\//,"/").replace(/\.tsx$/,"").replace(/\{([^\]]+)\}/g,":$1")}function filePathToRoutePath(t,e=getSrcPath()){let n=cleanPathPage(t,e);if(n.endsWith("/"+indexPageName))n=n.replace(indexPageRule,"")||indexPagePath;else if(n===""+indexPageName)n=indexPagePath;else if(n===notFoundPageName)return n=notFoundPagePath;return n.startsWith(indexPagePath)?n:"/"+n}function findLayoutForPage(t){return __awaiter(this,arguments,void 0,function*(t,e=getSrcPath()){var n=getDefaultLayoutPath(e),t=t.replace(/\/pages\/.*\.tsx$/,`/pages/${layoutName}.tsx`),a=import.meta.glob(e+"/modules/**/_layout.tsx",{eager:!0}),e=import.meta.glob(e+"/pages/_layout.tsx",{eager:!0});return(null==(a=a[t])?void 0:a.default)||(null==(t=e[n+".tsx"])?void 0:t.default)})}function findErrorForPage(t){return __awaiter(this,arguments,void 0,function*(t,e=getSrcPath()){var n,a=getDefaultErrorPath(e),t=t.replace(/\/pages\/.*\.tsx$/,`/pages/${errorPageName}.tsx`),r=import.meta.glob(e+"/modules/**/_error.tsx",{eager:!0}),e=import.meta.glob(e+"/pages/_error.tsx",{eager:!0});return null!=(n=process.env)&&n.NODE_ENV,(null==(n=r[t])?void 0:n.default)||(null==(r=e[a+".tsx"])?void 0:r.default)})}function findErrorForPageLink(t){return __awaiter(this,arguments,void 0,function*(t,e=getSrcPath()){return cleanPathPage(t.replace(/\/pages\/.*\.tsx$/,`/pages/${errorPageName}.tsx`),e).split(e).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,arguments,void 0,function*(o=getSrcPath()){var t=getPageModules(o);let a=yield getAllConfig(o),e=(null==(n=process.env)||n.NODE_ENV,yield Promise.all(Object.entries(t).map(t=>__awaiter(this,[t],void 0,function*([t,e]){var n=[notFoundPageName].map(t=>cleanPathPage(t,o)).includes(cleanPathPage(t,o))?void 0:yield findLayoutForPage(t,o),a=yield findErrorForPage(t,o),r=(yield findErrorForPageLink(t,o),filePathToRoutePath(t,o)),e=(yield e()).default,i=r.split("/").filter((t,e,n)=>"string"==typeof t&&0<t.length&&e<n.length-1).join("/");return{truePath:t,path:r,component:e,layout:n,error:a,pathParent:i}}))));var n=e.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 r=(e=[...e.filter(t=>!(t.truePath&&0<t.truePath.split("/").filter(t=>-1!==t.indexOf("_404.tsx")).length)),...n]).filter(t=>!!t.path&&-1!==t.path.indexOf("/_layout")),i=e.filter(t=>!!t.path&&-1!==t.path.indexOf("/_error"));null!=(t=process.env)&&t.NODE_ENV;n=(e=e.map(t=>{var e;return Object.assign(Object.assign({},t),{layout:(null==(e=nearestRoute(t,r))?void 0:e.component)||t.layout,error:(null==(e=nearestRoute(t,i))?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!=(t=process.env)&&t.NODE_ENV,n})}export{getRoutes};
1
+ function __awaiter(e,l,r,u){return new(r=r||Promise)(function(n,t){function a(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,i)}o((u=u.apply(e,l||[])).next())})}var _a;let SRC_DIR=(null==(_a=null==process?void 0:process.env)?void 0:_a.VITE_APP_SRC_DIR)||"/src",configModules=import.meta.glob(["@/config.json","@/modules/**/config.json"]);function cleanPathConfig(e){var t=SRC_DIR;return e.replace(new RegExp("^"+t),"").replace(new RegExp(`^${t}/modules`),"").replace(/^\/modules\//,"").replace(/config\.json$/,"")}function filePathToConfigPath(e,t=!1){let n=(t="boolean"==typeof t&&t)?e.replace(/config\.json$/,""):cleanPathConfig(e);return(n=n.split("/").filter(e=>"string"==typeof e&&0<e.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(e=>__awaiter(this,[e],void 0,function*([e,t]){var n=filePathToConfigPath(e,!0).split("/").join("/"),a=filePathToConfigPath(e),i="string"==typeof(i=a.split("/").filter((e,t,n)=>0<t).join("/"))&&0<i.length?i:void 0,t=(yield t()).default;return{parentTruePath:n,truePath:e,path:a,name:i,description:void 0,config:"object"==typeof t&&!Array.isArray(t)&&0<Object.keys(t).length?{path:"string"==typeof(null==t?void 0:t.path)&&0<(null==t?void 0:t.path.length)?null==t?void 0:t.path:a,name:"string"==typeof(null==t?void 0:t.name)&&0<(null==t?void 0:t.name.length)?null==t?void 0:t.name:i,description:!("string"==typeof(null==t?void 0:t.description)&&0<(null==t?void 0:t.description.length))||null==t?void 0:t.description,author:!("string"==typeof(null==t?void 0:t.author)&&0<(null==t?void 0:t.author.length))||null==t?void 0:t.author,isEnabled:"boolean"!=typeof(null==t?void 0:t.isEnabled)||(null==t?void 0:t.isEnabled)}:{path:a,name:i,author:void 0,isEnabled:!0}}})))})}function findConfigModuleRoute(t,e){return null==(e=e.sort((e,t)=>e.truePath.split("/").length>t.truePath.split("/").length?-1:e.truePath.split("/").length<t.truePath.split("/").length?1:0).find(e=>0===t.truePath.indexOf(e.parentTruePath)))?void 0:e.config}let errorPageName="_error",defaultErrorPath=SRC_DIR+"/pages/_error",notFoundPageName="_404",notFoundPagePath="*",defaultLayoutPath=SRC_DIR+"/pages/_layout",layoutName="_layout",indexPageName="index",indexPageRule=/\/index$/,indexPagePath="/",pageModules=import.meta.glob(["@/pages/**/*.tsx","@/modules/**/pages/**/*.tsx"]);function cleanPathPage(e){var t=SRC_DIR;return e.replace(new RegExp(`^${t}/pages`),"").replace(new RegExp(`^${t}/pages`),"").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}function findLayoutForPage(a){return __awaiter(this,void 0,void 0,function*(){var e=a.replace(/\/pages\/.*\.tsx$/,`/pages/${layoutName}.tsx`),t=import.meta.glob("@/modules/**/_layout.tsx",{eager:!0}),n=import.meta.glob("@/pages/_layout.tsx",{eager:!0});return(null==(t=t[e])?void 0:t.default)||(null==(e=n[defaultLayoutPath+".tsx"])?void 0:e.default)})}function findErrorForPage(i){return __awaiter(this,void 0,void 0,function*(){var e,t=i.replace(/\/pages\/.*\.tsx$/,`/pages/${errorPageName}.tsx`),n=import.meta.glob("@/modules/**/_error.tsx",{eager:!0}),a=import.meta.glob("@/pages/_error.tsx",{eager:!0});return null!=(e=process.env)&&e.NODE_ENV,(null==(e=n[t])?void 0:e.default)||(null==(n=a[defaultErrorPath+".tsx"])?void 0:n.default)})}function findErrorForPageLink(e){return __awaiter(this,void 0,void 0,function*(){return cleanPathPage(e.replace(/\/pages\/.*\.tsx$/,`/pages/${errorPageName}.tsx`)).split(SRC_DIR).join("")})}function nearestRoute(n,e){e=e.map(e=>Object.assign(Object.assign({},e),{path:(e.path||"").split("/").filter((e,t,n)=>2<=n.length&&"string"==typeof(null==n?void 0:n[n.length-2])&&(null==n?void 0:n[n.length-2].length)<=0&&t<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)&&t<n.length-1).join("/")})).filter(e=>0===n.path.indexOf(e.path)).sort((e,t)=>e.path.indexOf(n.path)>t.path.indexOf(n.path)?-1:e.path.indexOf(n.path)<t.path.indexOf(n.path)?1:e.path.split("/").length>t.path.split("/").length?-1:e.path.split("/").length<t.path.split("/").length?1:0);return null==e?void 0:e[0]}function getRoutes(){return __awaiter(this,void 0,void 0,function*(){let e,t,n,a=yield getAllConfig(),i=(null==(e=process.env)||e.NODE_ENV,yield Promise.all(Object.entries(pageModules).map(e=>__awaiter(this,[e],void 0,function*([e,t]){var n=[notFoundPageName].map(e=>cleanPathPage(e)).includes(cleanPathPage(e))?void 0:yield findLayoutForPage(e),a=yield findErrorForPage(e),i=(yield findErrorForPageLink(e),filePathToRoutePath(e)),t=(yield t()).default,o=i.split("/").filter((e,t,n)=>"string"==typeof e&&0<e.length&&t<n.length-1).join("/");return{truePath:e,path:i,component:t,layout:n,error:a,pathParent:o}}))));var o=i.filter(e=>!!e.truePath&&0<e.truePath.split("/").filter(e=>-1!==e.indexOf("_404.tsx")).length).map(e=>Object.assign(Object.assign({},e),{path:e.path.split("/").map(e=>e.split("_404").join(notFoundPagePath)).join("/")}));let l=(i=[...i.filter(e=>!(e.truePath&&0<e.truePath.split("/").filter(e=>-1!==e.indexOf("_404.tsx")).length)),...o]).filter(e=>!!e.path&&-1!==e.path.indexOf("/_layout")),r=i.filter(e=>!!e.path&&-1!==e.path.indexOf("/_error"));null!=(t=process.env)&&t.NODE_ENV;o=(i=i.map(e=>{var t;return Object.assign(Object.assign({},e),{layout:(null==(t=nearestRoute(e,l))?void 0:t.component)||e.layout,error:(null==(t=nearestRoute(e,r))?void 0:t.component)||e.error})})).map((e,t)=>{var n=findConfigModuleRoute(e,a);return"string"==typeof(null==n?void 0:n.path)&&0<(null==n?void 0:n.path.length)&&"/"!=(null==n?void 0:n.path)&&(e.path=e.path.split("/").filter((e,t,n)=>1<t).join("/"),e.path=(`${null==n?void 0:n.path}/`+e.path).split("//").join("/")),e});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.js CHANGED
@@ -4,7 +4,7 @@ const langCodes = {
4
4
  'fr': 'fr_FR',
5
5
  'en': 'en_US',
6
6
  };
7
- const SRC_DIR = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.APP_SRC_DIR) || '/src';
7
+ const SRC_DIR = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.VITE_APP_SRC_DIR) || '/src';
8
8
 
9
9
  function getLang(lang) {
10
10
  let result = lang;
package/utils.min.js CHANGED
@@ -1,2 +1,2 @@
1
- var _a;let langs=["en","fr"],langCodes={fr:"fr_FR",en:"en_US"},SRC_DIR=(null==(_a=null==process?void 0:process.env)?void 0:_a.APP_SRC_DIR)||"/src";function getLang(n){return langs.includes(n)?n:"fr"}function getLangCode(n){return langCodes[getLang(n)]}function getSrcPath(){return SRC_DIR}export{getLang,getLangCode,getSrcPath};
1
+ var _a;let langs=["en","fr"],langCodes={fr:"fr_FR",en:"en_US"},SRC_DIR=(null==(_a=null==process?void 0:process.env)?void 0:_a.VITE_APP_SRC_DIR)||"/src";function getLang(n){return langs.includes(n)?n:"fr"}function getLangCode(n){return langCodes[getLang(n)]}function getSrcPath(){return SRC_DIR}export{getLang,getLangCode,getSrcPath};
2
2
  //# sourceMappingURL=utils.min.js.map