@modern-js/utils 2.69.4 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli/alias.js +76 -70
- package/dist/cjs/cli/applyOptionsChain.js +44 -45
- package/dist/cjs/cli/babel.js +100 -119
- package/dist/cjs/cli/commands.js +61 -59
- package/dist/cjs/cli/common.js +45 -37
- package/dist/cjs/cli/config.js +36 -30
- package/dist/cjs/cli/constants.js +124 -161
- package/dist/cjs/cli/ensure.js +52 -45
- package/dist/cjs/cli/fs.js +41 -38
- package/dist/cjs/cli/get/config.js +43 -38
- package/dist/cjs/cli/get/data.js +108 -125
- package/dist/cjs/cli/get/index.js +109 -58
- package/dist/cjs/cli/index.js +202 -63
- package/dist/cjs/cli/is/config.js +75 -71
- package/dist/cjs/cli/is/env.js +49 -37
- package/dist/cjs/cli/is/index.js +76 -25
- package/dist/cjs/cli/is/project.js +139 -135
- package/dist/cjs/cli/is/type.js +65 -49
- package/dist/cjs/cli/logger.js +36 -27
- package/dist/cjs/cli/monorepo.js +100 -96
- package/dist/cjs/cli/package.js +85 -82
- package/dist/cjs/cli/path.js +101 -82
- package/dist/cjs/cli/port.js +71 -74
- package/dist/cjs/cli/prettyInstructions.js +106 -116
- package/dist/cjs/cli/require.js +116 -136
- package/dist/cjs/cli/route.js +67 -77
- package/dist/cjs/cli/runtimeExports.js +16 -70
- package/dist/cjs/cli/version.js +53 -42
- package/dist/cjs/cli/watch.js +79 -72
- package/dist/cjs/compiled.js +199 -128
- package/dist/cjs/import.js +58 -33
- package/dist/cjs/index.js +69 -23
- package/dist/cjs/universal/constants.js +77 -67
- package/dist/cjs/universal/index.js +33 -25
- package/dist/cjs/universal/path.js +33 -27
- package/dist/cjs/universal/pluginDagSort.js +69 -68
- package/dist/compiled/address/index.js +171 -1
- package/dist/compiled/browserslist/index.js +1329 -1
- package/dist/compiled/chalk/index.js +2368 -1
- package/dist/compiled/chokidar/index.js +4138 -16
- package/dist/compiled/chokidar/index.js.LICENSE.txt +41 -0
- package/dist/compiled/commander/index.js +1540 -1
- package/dist/compiled/debug/index.js +621 -1
- package/dist/compiled/dotenv/index.js +101 -1
- package/dist/compiled/dotenv-expand/index.js +54 -1
- package/dist/compiled/execa/index.js +1738 -1
- package/dist/compiled/fast-glob/index.js +4645 -17
- package/dist/compiled/fast-glob/index.js.LICENSE.txt +38 -0
- package/dist/compiled/filesize/index.js +193 -4
- package/dist/compiled/filesize/index.js.LICENSE.txt +7 -0
- package/dist/compiled/fs-extra/index.js +2222 -1
- package/dist/compiled/glob/index.js +2011 -1
- package/dist/compiled/globby/index.js +690 -1
- package/dist/compiled/gzip-size/index.js +157 -1
- package/dist/compiled/import-lazy/index.js +45 -1
- package/dist/compiled/inquirer/index.js +20162 -4
- package/dist/compiled/inquirer/index.js.LICENSE.txt +7 -0
- package/dist/compiled/js-yaml/index.js +2188 -1
- package/dist/compiled/json5/index.js +983 -1
- package/dist/compiled/lodash/index.js +0 -4
- package/dist/compiled/mime-types/index.js +108 -6
- package/dist/compiled/mime-types/index.js.LICENSE.txt +13 -0
- package/dist/compiled/minimist/index.js +202 -1
- package/dist/compiled/nanoid/index.js +83 -1
- package/dist/compiled/ora/index.js +3936 -3
- package/dist/compiled/ora/index.js.LICENSE.txt +1 -0
- package/dist/compiled/pkg-up/index.js +177 -1
- package/dist/compiled/semver/index.js +1779 -1
- package/dist/compiled/signale/index.js +1704 -1
- package/dist/compiled/slash/index.js +32 -1
- package/dist/compiled/strip-ansi/index.js +34 -1
- package/dist/compiled/tsconfig-paths/index.js +629 -1
- package/dist/compiled/upath/index.js +135 -1
- package/dist/compiled/url-join/index.js +61 -1
- package/dist/compiled/webpack-chain/index.js +1475 -1
- package/dist/esm/cli/alias.mjs +31 -0
- package/dist/esm/cli/applyOptionsChain.mjs +16 -0
- package/dist/esm/cli/babel.mjs +76 -0
- package/dist/esm/cli/commands.mjs +23 -0
- package/dist/esm/cli/common.mjs +11 -0
- package/dist/esm/cli/config.mjs +5 -0
- package/dist/esm/cli/constants.mjs +29 -0
- package/dist/esm/cli/ensure.mjs +9 -0
- package/dist/esm/cli/fs.mjs +9 -0
- package/dist/esm/cli/get/config.mjs +14 -0
- package/dist/esm/cli/get/data.mjs +57 -0
- package/dist/esm/cli/get/index.mjs +18 -0
- package/dist/{esm-node/cli/index.js → esm/cli/index.mjs} +0 -1
- package/dist/esm/cli/is/config.mjs +34 -0
- package/dist/esm/cli/is/env.mjs +6 -0
- package/dist/esm/cli/is/project.mjs +104 -0
- package/dist/esm/cli/is/type.mjs +26 -0
- package/dist/esm/cli/logger.mjs +2 -0
- package/dist/esm/cli/monorepo.mjs +50 -0
- package/dist/esm/cli/package.mjs +51 -0
- package/dist/esm/cli/path.mjs +35 -0
- package/dist/esm/cli/port.mjs +35 -0
- package/dist/esm/cli/prettyInstructions.mjs +68 -0
- package/dist/esm/cli/require.mjs +79 -0
- package/dist/esm/cli/route.mjs +36 -0
- package/dist/esm/cli/runtimeExports.mjs +0 -0
- package/dist/esm/cli/version.mjs +21 -0
- package/dist/esm/cli/watch.mjs +40 -0
- package/dist/esm/compiled.mjs +115 -0
- package/dist/esm/import.mjs +25 -0
- package/dist/esm/universal/constants.mjs +13 -0
- package/dist/{esm-node/universal/index.js → esm/universal/index.mjs} +1 -3
- package/dist/esm/universal/path.mjs +2 -0
- package/dist/esm/universal/pluginDagSort.mjs +41 -0
- package/dist/esm-node/cli/alias.mjs +31 -0
- package/dist/esm-node/cli/applyOptionsChain.mjs +16 -0
- package/dist/esm-node/cli/babel.mjs +76 -0
- package/dist/esm-node/cli/commands.mjs +23 -0
- package/dist/esm-node/cli/common.mjs +11 -0
- package/dist/esm-node/cli/config.mjs +5 -0
- package/dist/esm-node/cli/constants.mjs +29 -0
- package/dist/esm-node/cli/ensure.mjs +9 -0
- package/dist/esm-node/cli/fs.mjs +9 -0
- package/dist/esm-node/cli/get/config.mjs +14 -0
- package/dist/esm-node/cli/get/data.mjs +57 -0
- package/dist/esm-node/cli/get/index.mjs +18 -0
- package/dist/esm-node/cli/index.mjs +22 -0
- package/dist/esm-node/cli/is/config.mjs +34 -0
- package/dist/esm-node/cli/is/env.mjs +6 -0
- package/dist/esm-node/cli/is/index.mjs +4 -0
- package/dist/esm-node/cli/is/project.mjs +104 -0
- package/dist/esm-node/cli/is/type.mjs +26 -0
- package/dist/esm-node/cli/logger.mjs +2 -0
- package/dist/esm-node/cli/monorepo.mjs +50 -0
- package/dist/esm-node/cli/package.mjs +51 -0
- package/dist/esm-node/cli/path.mjs +35 -0
- package/dist/esm-node/cli/port.mjs +35 -0
- package/dist/esm-node/cli/prettyInstructions.mjs +68 -0
- package/dist/esm-node/cli/require.mjs +79 -0
- package/dist/esm-node/cli/route.mjs +36 -0
- package/dist/esm-node/cli/runtimeExports.mjs +0 -0
- package/dist/esm-node/cli/version.mjs +21 -0
- package/dist/esm-node/cli/watch.mjs +40 -0
- package/dist/esm-node/compiled.mjs +115 -0
- package/dist/esm-node/import.mjs +25 -0
- package/dist/esm-node/index.mjs +3 -0
- package/dist/esm-node/universal/constants.mjs +13 -0
- package/dist/esm-node/universal/index.mjs +2 -0
- package/dist/esm-node/universal/path.mjs +2 -0
- package/dist/esm-node/universal/pluginDagSort.mjs +41 -0
- package/dist/types/cli/constants.d.ts +2 -26
- package/dist/types/cli/get/data.d.ts +0 -1
- package/dist/types/cli/index.d.ts +0 -1
- package/dist/types/cli/is/config.d.ts +1 -1
- package/dist/types/cli/runtimeExports.d.ts +1 -4
- package/dist/types/cli/watch.d.ts +1 -1
- package/dist/types/compiled.d.ts +0 -5
- package/dist/types/universal/constants.d.ts +4 -7
- package/package.json +28 -57
- package/rslib.config.mts +140 -0
- package/dist/cjs/cli/action.js +0 -55
- package/dist/cjs/universal/formatWebpack.js +0 -127
- package/dist/compiled/react-server-dom-webpack/LICENSE +0 -21
- package/dist/compiled/react-server-dom-webpack/README.md +0 -5
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0 -2552
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +0 -1636
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0 -2708
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +0 -1799
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0 -2751
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +0 -1848
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0 -2714
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +0 -1814
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js +0 -69
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +0 -399
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0 -4015
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0 -3001
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0 -4045
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0 -3003
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0 -4116
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0 -3113
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0 -4080
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0 -3080
- package/dist/compiled/react-server-dom-webpack/client.browser.js +0 -7
- package/dist/compiled/react-server-dom-webpack/client.edge.js +0 -7
- package/dist/compiled/react-server-dom-webpack/client.js +0 -3
- package/dist/compiled/react-server-dom-webpack/client.node.js +0 -7
- package/dist/compiled/react-server-dom-webpack/client.node.unbundled.js +0 -7
- package/dist/compiled/react-server-dom-webpack/index.js +0 -12
- package/dist/compiled/react-server-dom-webpack/package.json +0 -111
- package/dist/compiled/react-server-dom-webpack/server.browser.js +0 -17
- package/dist/compiled/react-server-dom-webpack/server.edge.js +0 -17
- package/dist/compiled/react-server-dom-webpack/server.js +0 -6
- package/dist/compiled/react-server-dom-webpack/server.node.js +0 -18
- package/dist/compiled/react-server-dom-webpack/server.node.unbundled.js +0 -18
- package/dist/esm/cli/action.js +0 -68
- package/dist/esm/cli/alias.js +0 -43
- package/dist/esm/cli/applyOptionsChain.js +0 -29
- package/dist/esm/cli/babel.js +0 -122
- package/dist/esm/cli/commands.js +0 -39
- package/dist/esm/cli/common.js +0 -20
- package/dist/esm/cli/config.js +0 -11
- package/dist/esm/cli/constants.js +0 -114
- package/dist/esm/cli/ensure.js +0 -16
- package/dist/esm/cli/fs.js +0 -65
- package/dist/esm/cli/get/config.js +0 -19
- package/dist/esm/cli/get/data.js +0 -143
- package/dist/esm/cli/get/index.js +0 -38
- package/dist/esm/cli/index.js +0 -23
- package/dist/esm/cli/is/config.js +0 -70
- package/dist/esm/cli/is/env.js +0 -22
- package/dist/esm/cli/is/index.js +0 -4
- package/dist/esm/cli/is/project.js +0 -146
- package/dist/esm/cli/is/type.js +0 -39
- package/dist/esm/cli/logger.js +0 -5
- package/dist/esm/cli/monorepo.js +0 -82
- package/dist/esm/cli/package.js +0 -203
- package/dist/esm/cli/path.js +0 -66
- package/dist/esm/cli/port.js +0 -97
- package/dist/esm/cli/prettyInstructions.js +0 -102
- package/dist/esm/cli/require.js +0 -235
- package/dist/esm/cli/route.js +0 -64
- package/dist/esm/cli/runtimeExports.js +0 -44
- package/dist/esm/cli/version.js +0 -26
- package/dist/esm/cli/watch.js +0 -112
- package/dist/esm/compiled.js +0 -66
- package/dist/esm/import.js +0 -11
- package/dist/esm/index.js +0 -3
- package/dist/esm/universal/constants.js +0 -32
- package/dist/esm/universal/formatWebpack.js +0 -95
- package/dist/esm/universal/index.js +0 -4
- package/dist/esm/universal/path.js +0 -6
- package/dist/esm/universal/pluginDagSort.js +0 -73
- package/dist/esm-node/cli/action.js +0 -30
- package/dist/esm-node/cli/alias.js +0 -40
- package/dist/esm-node/cli/applyOptionsChain.js +0 -27
- package/dist/esm-node/cli/babel.js +0 -107
- package/dist/esm-node/cli/commands.js +0 -39
- package/dist/esm-node/cli/common.js +0 -15
- package/dist/esm-node/cli/config.js +0 -9
- package/dist/esm-node/cli/constants.js +0 -114
- package/dist/esm-node/cli/ensure.js +0 -14
- package/dist/esm-node/cli/fs.js +0 -18
- package/dist/esm-node/cli/get/config.js +0 -19
- package/dist/esm-node/cli/get/data.js +0 -96
- package/dist/esm-node/cli/get/index.js +0 -22
- package/dist/esm-node/cli/is/config.js +0 -50
- package/dist/esm-node/cli/is/env.js +0 -12
- package/dist/esm-node/cli/is/project.js +0 -105
- package/dist/esm-node/cli/is/type.js +0 -36
- package/dist/esm-node/cli/logger.js +0 -5
- package/dist/esm-node/cli/monorepo.js +0 -67
- package/dist/esm-node/cli/package.js +0 -66
- package/dist/esm-node/cli/path.js +0 -48
- package/dist/esm-node/cli/port.js +0 -48
- package/dist/esm-node/cli/prettyInstructions.js +0 -90
- package/dist/esm-node/cli/require.js +0 -111
- package/dist/esm-node/cli/route.js +0 -60
- package/dist/esm-node/cli/runtimeExports.js +0 -38
- package/dist/esm-node/cli/version.js +0 -26
- package/dist/esm-node/cli/watch.js +0 -45
- package/dist/esm-node/compiled.js +0 -66
- package/dist/esm-node/import.js +0 -11
- package/dist/esm-node/universal/constants.js +0 -32
- package/dist/esm-node/universal/formatWebpack.js +0 -102
- package/dist/esm-node/universal/path.js +0 -6
- package/dist/esm-node/universal/pluginDagSort.js +0 -50
- package/dist/types/cli/action.d.ts +0 -2
- package/dist/types/universal/formatWebpack.d.ts +0 -26
- /package/dist/{esm-node/cli/is/index.js → esm/cli/is/index.mjs} +0 -0
- /package/dist/{esm-node/index.js → esm/index.mjs} +0 -0
package/dist/cjs/cli/require.js
CHANGED
|
@@ -1,151 +1,131 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
dynamicImport: () => dynamicImport,
|
|
35
|
-
loadFromProject: () => loadFromProject,
|
|
36
|
-
requireExistModule: () => requireExistModule,
|
|
37
|
-
tryResolve: () => tryResolve
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
compatibleRequire: ()=>compatibleRequire,
|
|
28
|
+
dynamicImport: ()=>dynamicImport,
|
|
29
|
+
loadFromProject: ()=>loadFromProject,
|
|
30
|
+
requireExistModule: ()=>requireExistModule,
|
|
31
|
+
tryResolve: ()=>tryResolve,
|
|
32
|
+
cleanRequireCache: ()=>cleanRequireCache,
|
|
33
|
+
deleteRequireCache: ()=>deleteRequireCache
|
|
38
34
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var import_fs = require("./fs");
|
|
43
|
-
const import_meta = {};
|
|
35
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
36
|
+
const external_node_url_namespaceObject = require("node:url");
|
|
37
|
+
const external_fs_js_namespaceObject = require("./fs.js");
|
|
44
38
|
async function compatibleRequire(path, interop = true) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return interop ? requiredModule.default : requiredModule;
|
|
61
|
-
} else {
|
|
62
|
-
throw err;
|
|
39
|
+
if (path.endsWith('.json')) return require(path);
|
|
40
|
+
let requiredModule;
|
|
41
|
+
try {
|
|
42
|
+
requiredModule = require(path);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
if ('ERR_REQUIRE_ESM' === err.code) {
|
|
45
|
+
const modulePath = (0, external_node_path_namespaceObject.isAbsolute)(path) ? (0, external_node_url_namespaceObject.pathToFileURL)(path).href : path;
|
|
46
|
+
if ('development' === process.env.NODE_ENV) {
|
|
47
|
+
const timestamp = Date.now();
|
|
48
|
+
requiredModule = await import(`${modulePath}?t=${timestamp}`);
|
|
49
|
+
} else requiredModule = await import(modulePath);
|
|
50
|
+
return interop ? requiredModule.default : requiredModule;
|
|
51
|
+
}
|
|
52
|
+
throw err;
|
|
63
53
|
}
|
|
64
|
-
|
|
65
|
-
return interop && (requiredModule === null || requiredModule === void 0 ? void 0 : requiredModule.__esModule) ? requiredModule.default : requiredModule;
|
|
54
|
+
return interop && requiredModule?.__esModule ? requiredModule.default : requiredModule;
|
|
66
55
|
}
|
|
67
56
|
async function loadFromProject(moduleName, appDir) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
const moduleUrl = (0, import_node_url.pathToFileURL)(modulePath).href;
|
|
86
|
-
requiredModule = await import(moduleUrl);
|
|
87
|
-
}
|
|
88
|
-
return requiredModule.default || requiredModule;
|
|
89
|
-
} catch (error) {
|
|
90
|
-
if (error.code === "MODULE_NOT_FOUND") {
|
|
91
|
-
throw new Error(`Cannot find module ${moduleName}.`);
|
|
57
|
+
let requiredModule;
|
|
58
|
+
const paths = [
|
|
59
|
+
appDir,
|
|
60
|
+
process.cwd()
|
|
61
|
+
];
|
|
62
|
+
try {
|
|
63
|
+
{
|
|
64
|
+
const modulePath = require.resolve(moduleName, {
|
|
65
|
+
paths
|
|
66
|
+
});
|
|
67
|
+
requiredModule = require(modulePath);
|
|
68
|
+
}
|
|
69
|
+
return requiredModule.default || requiredModule;
|
|
70
|
+
} catch (error) {
|
|
71
|
+
if ('MODULE_NOT_FOUND' === error.code) throw new Error(`Cannot find module ${moduleName}.`);
|
|
72
|
+
throw error;
|
|
92
73
|
}
|
|
93
|
-
throw error;
|
|
94
|
-
}
|
|
95
74
|
}
|
|
96
|
-
const dynamicImport = new Function(
|
|
97
|
-
const requireExistModule = async (filename, opt)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return
|
|
109
|
-
}
|
|
110
|
-
return compatibleRequire(exist, final.interop);
|
|
75
|
+
const dynamicImport = new Function('modulePath', 'return import(modulePath)');
|
|
76
|
+
const requireExistModule = async (filename, opt)=>{
|
|
77
|
+
const final = {
|
|
78
|
+
extensions: [
|
|
79
|
+
'.ts',
|
|
80
|
+
'.js'
|
|
81
|
+
],
|
|
82
|
+
interop: true,
|
|
83
|
+
...opt
|
|
84
|
+
};
|
|
85
|
+
const exist = (0, external_fs_js_namespaceObject.findExists)(final.extensions.map((ext)=>`${filename}${ext}`));
|
|
86
|
+
if (!exist) return null;
|
|
87
|
+
return compatibleRequire(exist, final.interop);
|
|
111
88
|
};
|
|
112
|
-
const cleanRequireCache = (filelist)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
89
|
+
const cleanRequireCache = (filelist)=>{
|
|
90
|
+
filelist.forEach((filepath)=>{
|
|
91
|
+
if (require.cache) delete require.cache[filepath];
|
|
92
|
+
});
|
|
116
93
|
};
|
|
117
94
|
function deleteRequireCache(path) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
if (module.children) {
|
|
122
|
-
module.children = module.children.filter((item) => item.filename !== path);
|
|
123
|
-
}
|
|
95
|
+
if (require.cache[path]) delete require.cache[path];
|
|
96
|
+
if (module.children) module.children = module.children.filter((item)=>item.filename !== path);
|
|
124
97
|
}
|
|
125
|
-
const tryResolve = (name, resolvePath)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
98
|
+
const tryResolve = (name, resolvePath)=>{
|
|
99
|
+
let filePath = '';
|
|
100
|
+
try {
|
|
101
|
+
filePath = require.resolve(name, {
|
|
102
|
+
paths: [
|
|
103
|
+
resolvePath
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
delete require.cache[filePath];
|
|
107
|
+
} catch (err) {
|
|
108
|
+
if ('MODULE_NOT_FOUND' === err.code) throw new Error(`Can not find module ${name}.`);
|
|
109
|
+
throw err;
|
|
137
110
|
}
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
return filePath;
|
|
111
|
+
return filePath;
|
|
141
112
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
113
|
+
exports.cleanRequireCache = __webpack_exports__.cleanRequireCache;
|
|
114
|
+
exports.compatibleRequire = __webpack_exports__.compatibleRequire;
|
|
115
|
+
exports.deleteRequireCache = __webpack_exports__.deleteRequireCache;
|
|
116
|
+
exports.dynamicImport = __webpack_exports__.dynamicImport;
|
|
117
|
+
exports.loadFromProject = __webpack_exports__.loadFromProject;
|
|
118
|
+
exports.requireExistModule = __webpack_exports__.requireExistModule;
|
|
119
|
+
exports.tryResolve = __webpack_exports__.tryResolve;
|
|
120
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
121
|
+
"cleanRequireCache",
|
|
122
|
+
"compatibleRequire",
|
|
123
|
+
"deleteRequireCache",
|
|
124
|
+
"dynamicImport",
|
|
125
|
+
"loadFromProject",
|
|
126
|
+
"requireExistModule",
|
|
127
|
+
"tryResolve"
|
|
128
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
129
|
+
Object.defineProperty(exports, '__esModule', {
|
|
130
|
+
value: true
|
|
151
131
|
});
|
package/dist/cjs/cli/route.js
CHANGED
|
@@ -1,86 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
markRoutes: ()=>markRoutes,
|
|
28
|
+
filterRoutesForServer: ()=>filterRoutesForServer,
|
|
29
|
+
filterRoutesLoader: ()=>filterRoutesLoader
|
|
24
30
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const { cloneDeep } = import_compiled.lodash;
|
|
31
|
+
const external_compiled_js_namespaceObject = require("../compiled.js");
|
|
32
|
+
const { cloneDeep } = external_compiled_js_namespaceObject.lodash;
|
|
28
33
|
function filterRoutesForServer(routes) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (route.inValidSSRRoute) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return route;
|
|
41
|
-
}).filter((route) => route !== null);
|
|
42
|
-
return newRoutes;
|
|
34
|
+
const clonedRoutes = cloneDeep(routes);
|
|
35
|
+
const newRoutes = clonedRoutes.map((route)=>{
|
|
36
|
+
if ('nested' !== route.type) return route;
|
|
37
|
+
if (route.children && route.children.length > 0) route.children = filterRoutesForServer(route.children);
|
|
38
|
+
if (route.inValidSSRRoute) return null;
|
|
39
|
+
return route;
|
|
40
|
+
}).filter((route)=>null !== route);
|
|
41
|
+
return newRoutes;
|
|
43
42
|
}
|
|
44
43
|
function filterRoutesLoader(routes) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
return route;
|
|
59
|
-
}).filter((route) => route !== null);
|
|
60
|
-
return newRoutes;
|
|
44
|
+
const clonedRoutes = cloneDeep(routes);
|
|
45
|
+
const newRoutes = clonedRoutes.map((route)=>{
|
|
46
|
+
if ('nested' !== route.type) return route;
|
|
47
|
+
if (route.children && route.children.length > 0) route.children = filterRoutesLoader(route.children);
|
|
48
|
+
if (route.inValidSSRRoute) {
|
|
49
|
+
delete route.loader;
|
|
50
|
+
delete route.data;
|
|
51
|
+
delete route.action;
|
|
52
|
+
}
|
|
53
|
+
return route;
|
|
54
|
+
}).filter((route)=>null !== route);
|
|
55
|
+
return newRoutes;
|
|
61
56
|
}
|
|
62
57
|
function markRoutes(routes, routeIds) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
if (route.children && route.children.length > 0) {
|
|
71
|
-
route.inValidSSRRoute = route.children.every((child) => {
|
|
72
|
-
var _child_inValidSSRRoute;
|
|
73
|
-
return (_child_inValidSSRRoute = child.inValidSSRRoute) !== null && _child_inValidSSRRoute !== void 0 ? _child_inValidSSRRoute : false;
|
|
74
|
-
});
|
|
75
|
-
} else if (route.id) {
|
|
76
|
-
route.inValidSSRRoute = !routeIds.includes(route.id);
|
|
77
|
-
}
|
|
78
|
-
return route;
|
|
79
|
-
});
|
|
58
|
+
return routes.map((route)=>{
|
|
59
|
+
if ('nested' !== route.type) return route;
|
|
60
|
+
if (route.children && route.children.length > 0) route.children = markRoutes(route.children, routeIds);
|
|
61
|
+
if (route.children && route.children.length > 0) route.inValidSSRRoute = route.children.every((child)=>child.inValidSSRRoute ?? false);
|
|
62
|
+
else if (route.id) route.inValidSSRRoute = !routeIds.includes(route.id);
|
|
63
|
+
return route;
|
|
64
|
+
});
|
|
80
65
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
66
|
+
exports.filterRoutesForServer = __webpack_exports__.filterRoutesForServer;
|
|
67
|
+
exports.filterRoutesLoader = __webpack_exports__.filterRoutesLoader;
|
|
68
|
+
exports.markRoutes = __webpack_exports__.markRoutes;
|
|
69
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
70
|
+
"filterRoutesForServer",
|
|
71
|
+
"filterRoutesLoader",
|
|
72
|
+
"markRoutes"
|
|
73
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
74
|
+
Object.defineProperty(exports, '__esModule', {
|
|
75
|
+
value: true
|
|
86
76
|
});
|
|
@@ -1,72 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var runtimeExports_exports = {};
|
|
30
|
-
__export(runtimeExports_exports, {
|
|
31
|
-
createRuntimeExportsUtils: () => createRuntimeExportsUtils
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(runtimeExports_exports);
|
|
34
|
-
var import_path = __toESM(require("path"));
|
|
35
|
-
var import_compiled = require("../compiled");
|
|
36
|
-
var import_path2 = require("./path");
|
|
37
|
-
const memo = (fn) => {
|
|
38
|
-
const cache = /* @__PURE__ */ new Map();
|
|
39
|
-
return (...params) => {
|
|
40
|
-
const stringifiedParams = JSON.stringify(params);
|
|
41
|
-
const cachedResult = cache.get(stringifiedParams);
|
|
42
|
-
if (cachedResult) {
|
|
43
|
-
return cachedResult;
|
|
44
|
-
}
|
|
45
|
-
const res = fn(...params);
|
|
46
|
-
cache.set(stringifiedParams, res);
|
|
47
|
-
return res;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
const createRuntimeExportsUtils = memo((pwd = "", namespace = "index") => {
|
|
51
|
-
const entryExportFile = import_path.default.join(pwd, `.runtime-exports/${namespace}.js`);
|
|
52
|
-
const addExport = (statement) => {
|
|
53
|
-
const statementStr = (0, import_path2.normalizeOutputPath)(statement);
|
|
54
|
-
try {
|
|
55
|
-
import_compiled.fs.ensureFileSync(entryExportFile);
|
|
56
|
-
if (!import_compiled.fs.readFileSync(entryExportFile, "utf8").includes(statementStr)) {
|
|
57
|
-
import_compiled.fs.appendFileSync(entryExportFile, `${statementStr}
|
|
58
|
-
`);
|
|
59
|
-
}
|
|
60
|
-
} catch {
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const getPath = () => entryExportFile;
|
|
64
|
-
return {
|
|
65
|
-
addExport,
|
|
66
|
-
getPath
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
createRuntimeExportsUtils
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
72
18
|
});
|
package/dist/cjs/cli/version.js
CHANGED
|
@@ -1,53 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
isVersionAtLeast18: ()=>isVersionAtLeast18,
|
|
28
|
+
isVersionAtLeast1819: ()=>isVersionAtLeast1819,
|
|
29
|
+
isVersionAtLeast20: ()=>isVersionAtLeast20,
|
|
30
|
+
isVersionAtLeast22: ()=>isVersionAtLeast22
|
|
25
31
|
});
|
|
26
|
-
module.exports = __toCommonJS(version_exports);
|
|
27
32
|
function isVersionAtLeast1819() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
const nodeVersion = process.versions.node;
|
|
34
|
+
const versionArr = nodeVersion.split('.').map(Number);
|
|
35
|
+
return versionArr[0] > 18 || 18 === versionArr[0] && versionArr[1] >= 19;
|
|
31
36
|
}
|
|
32
37
|
function isVersionAtLeast18() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
const nodeVersion = process.versions.node;
|
|
39
|
+
const versionArr = nodeVersion.split('.').map(Number);
|
|
40
|
+
return versionArr[0] >= 18;
|
|
36
41
|
}
|
|
37
42
|
function isVersionAtLeast22() {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
const nodeVersion = process.versions.node;
|
|
44
|
+
const versionArr = nodeVersion.split('.').map(Number);
|
|
45
|
+
return versionArr[0] >= 22;
|
|
41
46
|
}
|
|
42
47
|
function isVersionAtLeast20() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
const nodeVersion = process.versions.node;
|
|
49
|
+
const versionArr = nodeVersion.split('.').map(Number);
|
|
50
|
+
return versionArr[0] >= 20;
|
|
46
51
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
exports.isVersionAtLeast18 = __webpack_exports__.isVersionAtLeast18;
|
|
53
|
+
exports.isVersionAtLeast1819 = __webpack_exports__.isVersionAtLeast1819;
|
|
54
|
+
exports.isVersionAtLeast20 = __webpack_exports__.isVersionAtLeast20;
|
|
55
|
+
exports.isVersionAtLeast22 = __webpack_exports__.isVersionAtLeast22;
|
|
56
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
57
|
+
"isVersionAtLeast18",
|
|
58
|
+
"isVersionAtLeast1819",
|
|
59
|
+
"isVersionAtLeast20",
|
|
60
|
+
"isVersionAtLeast22"
|
|
61
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
62
|
+
Object.defineProperty(exports, '__esModule', {
|
|
63
|
+
value: true
|
|
53
64
|
});
|