@modern-js/utils 2.69.5 → 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 +27 -27
- package/rslib.config.mts +140 -0
- package/dist/cjs/cli/action.js +0 -55
- package/dist/cjs/universal/formatWebpack.js +0 -127
- 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/monorepo.js
CHANGED
|
@@ -1,106 +1,110 @@
|
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
isPnpmWorkspaces: ()=>isPnpmWorkspaces,
|
|
37
|
+
findMonorepoRoot: ()=>findMonorepoRoot,
|
|
38
|
+
getMonorepoPackages: ()=>getMonorepoPackages,
|
|
39
|
+
isMonorepo: ()=>isMonorepo,
|
|
40
|
+
isYarnWorkspaces: ()=>isYarnWorkspaces,
|
|
41
|
+
isLerna: ()=>isLerna
|
|
37
42
|
});
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
var
|
|
43
|
+
const external_fs_namespaceObject = require("fs");
|
|
44
|
+
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
45
|
+
const external_path_namespaceObject = require("path");
|
|
46
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
47
|
+
const external_compiled_js_namespaceObject = require("../compiled.js");
|
|
42
48
|
const PACKAGE_MAX_DEPTH = 5;
|
|
43
49
|
const WORKSPACE_FILES = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
YARN: 'package.json',
|
|
51
|
+
PNPM: 'pnpm-workspace.yaml',
|
|
52
|
+
LERNA: 'lerna.json'
|
|
47
53
|
};
|
|
48
|
-
const isLerna = (root)
|
|
49
|
-
const isYarnWorkspaces = (root)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
const json = JSON.parse(import_fs.default.readFileSync(pkg, "utf8"));
|
|
56
|
-
return Boolean((_json_workspaces = json.workspaces) === null || _json_workspaces === void 0 ? void 0 : _json_workspaces.packages);
|
|
54
|
+
const isLerna = (root)=>external_fs_default().existsSync(external_path_default().join(root, WORKSPACE_FILES.LERNA));
|
|
55
|
+
const isYarnWorkspaces = (root)=>{
|
|
56
|
+
const pkg = external_path_default().join(root, WORKSPACE_FILES.YARN);
|
|
57
|
+
if (!external_fs_default().existsSync(pkg)) return false;
|
|
58
|
+
const json = JSON.parse(external_fs_default().readFileSync(pkg, 'utf8'));
|
|
59
|
+
return Boolean(json.workspaces?.packages);
|
|
57
60
|
};
|
|
58
|
-
const isPnpmWorkspaces = (root)
|
|
59
|
-
const isMonorepo = (root)
|
|
60
|
-
const findMonorepoRoot = (appDirectory, maxDepth = PACKAGE_MAX_DEPTH)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
const isPnpmWorkspaces = (root)=>external_fs_default().existsSync(external_path_default().join(root, WORKSPACE_FILES.PNPM));
|
|
62
|
+
const isMonorepo = (root)=>isLerna(root) || isYarnWorkspaces(root) || isPnpmWorkspaces(root);
|
|
63
|
+
const findMonorepoRoot = (appDirectory, maxDepth = PACKAGE_MAX_DEPTH)=>{
|
|
64
|
+
let inMonorepo = false;
|
|
65
|
+
let monorepoRoot = appDirectory;
|
|
66
|
+
for(let depth = 0; depth < maxDepth; depth++){
|
|
67
|
+
if (isMonorepo(appDirectory)) {
|
|
68
|
+
inMonorepo = true;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
monorepoRoot = external_path_default().dirname(appDirectory);
|
|
67
72
|
}
|
|
68
|
-
monorepoRoot
|
|
69
|
-
}
|
|
70
|
-
return inMonorepo ? monorepoRoot : void 0;
|
|
73
|
+
return inMonorepo ? monorepoRoot : void 0;
|
|
71
74
|
};
|
|
72
|
-
const getMonorepoPackages = (root)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})
|
|
91
|
-
)).reduce((acc, val) => acc.concat(val), []).filter((filepath) => import_fs.default.existsSync(import_path.default.resolve(filepath, "package.json"))).map((filepath) => ({
|
|
92
|
-
path: filepath,
|
|
93
|
-
name: JSON.parse(import_fs.default.readFileSync(import_path.default.resolve(filepath, "package.json"), "utf8")).name
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
return [];
|
|
75
|
+
const getMonorepoPackages = (root)=>{
|
|
76
|
+
let packages = [];
|
|
77
|
+
if (isYarnWorkspaces(root)) {
|
|
78
|
+
const json = JSON.parse(external_fs_default().readFileSync(external_path_default().join(root, 'package.json'), 'utf8'));
|
|
79
|
+
({ packages } = json.workspaces);
|
|
80
|
+
} else if (isLerna(root)) {
|
|
81
|
+
const json = JSON.parse(external_fs_default().readFileSync(external_path_default().resolve(root, 'lerna.json'), 'utf8'));
|
|
82
|
+
({ packages } = json);
|
|
83
|
+
} else ({ packages } = external_compiled_js_namespaceObject.yaml.load(external_fs_default().readFileSync(external_path_default().join(root, WORKSPACE_FILES.PNPM), 'utf8')));
|
|
84
|
+
if (packages) return packages.map((name)=>external_compiled_js_namespaceObject.glob.sync(external_path_default().join(root, `${name}/`), {
|
|
85
|
+
ignore: [
|
|
86
|
+
'**/node_modules/**'
|
|
87
|
+
]
|
|
88
|
+
})).reduce((acc, val)=>acc.concat(val), []).filter((filepath)=>external_fs_default().existsSync(external_path_default().resolve(filepath, 'package.json'))).map((filepath)=>({
|
|
89
|
+
path: filepath,
|
|
90
|
+
name: JSON.parse(external_fs_default().readFileSync(external_path_default().resolve(filepath, 'package.json'), 'utf8')).name
|
|
91
|
+
}));
|
|
92
|
+
return [];
|
|
97
93
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
exports.findMonorepoRoot = __webpack_exports__.findMonorepoRoot;
|
|
95
|
+
exports.getMonorepoPackages = __webpack_exports__.getMonorepoPackages;
|
|
96
|
+
exports.isLerna = __webpack_exports__.isLerna;
|
|
97
|
+
exports.isMonorepo = __webpack_exports__.isMonorepo;
|
|
98
|
+
exports.isPnpmWorkspaces = __webpack_exports__.isPnpmWorkspaces;
|
|
99
|
+
exports.isYarnWorkspaces = __webpack_exports__.isYarnWorkspaces;
|
|
100
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
101
|
+
"findMonorepoRoot",
|
|
102
|
+
"getMonorepoPackages",
|
|
103
|
+
"isLerna",
|
|
104
|
+
"isMonorepo",
|
|
105
|
+
"isPnpmWorkspaces",
|
|
106
|
+
"isYarnWorkspaces"
|
|
107
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
108
|
+
Object.defineProperty(exports, '__esModule', {
|
|
109
|
+
value: true
|
|
106
110
|
});
|
package/dist/cjs/cli/package.js
CHANGED
|
@@ -1,94 +1,97 @@
|
|
|
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
|
-
|
|
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
|
+
canUsePnpm: ()=>canUsePnpm,
|
|
28
|
+
removeModuleSyncFromExports: ()=>removeModuleSyncFromExports,
|
|
29
|
+
canUseNpm: ()=>canUseNpm,
|
|
30
|
+
getPnpmVersion: ()=>getPnpmVersion,
|
|
31
|
+
canUseYarn: ()=>canUseYarn
|
|
26
32
|
});
|
|
27
|
-
|
|
28
|
-
var import_compiled = require("../compiled");
|
|
33
|
+
const external_compiled_js_namespaceObject = require("../compiled.js");
|
|
29
34
|
async function getPnpmVersion() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
const { stdout } = await (0, external_compiled_js_namespaceObject.execa)('pnpm', [
|
|
36
|
+
'--version'
|
|
37
|
+
]);
|
|
38
|
+
return stdout;
|
|
34
39
|
}
|
|
35
40
|
async function canUseNpm() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
try {
|
|
42
|
+
await (0, external_compiled_js_namespaceObject.execa)('npm', [
|
|
43
|
+
'--version'
|
|
44
|
+
], {
|
|
45
|
+
env: process.env
|
|
46
|
+
});
|
|
47
|
+
return true;
|
|
48
|
+
} catch (e) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
async function canUseYarn() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
try {
|
|
54
|
+
await (0, external_compiled_js_namespaceObject.execa)('yarn', [
|
|
55
|
+
'--version'
|
|
56
|
+
], {
|
|
57
|
+
env: process.env
|
|
58
|
+
});
|
|
59
|
+
return true;
|
|
60
|
+
} catch (e) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
58
63
|
}
|
|
59
64
|
async function canUsePnpm() {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function removeModuleSyncFromExports(exports) {
|
|
72
|
-
if (typeof exports !== "object" || exports === null) {
|
|
73
|
-
return exports;
|
|
74
|
-
}
|
|
75
|
-
if (Array.isArray(exports)) {
|
|
76
|
-
return exports.map(removeModuleSyncFromExports);
|
|
77
|
-
}
|
|
78
|
-
const result = {};
|
|
79
|
-
for (const [key, value] of Object.entries(exports)) {
|
|
80
|
-
if (key === "module-sync") {
|
|
81
|
-
continue;
|
|
65
|
+
try {
|
|
66
|
+
await (0, external_compiled_js_namespaceObject.execa)('pnpm', [
|
|
67
|
+
'--version'
|
|
68
|
+
], {
|
|
69
|
+
env: process.env
|
|
70
|
+
});
|
|
71
|
+
return true;
|
|
72
|
+
} catch (e) {
|
|
73
|
+
return false;
|
|
82
74
|
}
|
|
83
|
-
result[key] = removeModuleSyncFromExports(value);
|
|
84
|
-
}
|
|
85
|
-
return result;
|
|
86
75
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
76
|
+
function removeModuleSyncFromExports(exports1) {
|
|
77
|
+
if ('object' != typeof exports1 || null === exports1) return exports1;
|
|
78
|
+
if (Array.isArray(exports1)) return exports1.map(removeModuleSyncFromExports);
|
|
79
|
+
const result = {};
|
|
80
|
+
for (const [key, value] of Object.entries(exports1))if ('module-sync' !== key) result[key] = removeModuleSyncFromExports(value);
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
exports.canUseNpm = __webpack_exports__.canUseNpm;
|
|
84
|
+
exports.canUsePnpm = __webpack_exports__.canUsePnpm;
|
|
85
|
+
exports.canUseYarn = __webpack_exports__.canUseYarn;
|
|
86
|
+
exports.getPnpmVersion = __webpack_exports__.getPnpmVersion;
|
|
87
|
+
exports.removeModuleSyncFromExports = __webpack_exports__.removeModuleSyncFromExports;
|
|
88
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
89
|
+
"canUseNpm",
|
|
90
|
+
"canUsePnpm",
|
|
91
|
+
"canUseYarn",
|
|
92
|
+
"getPnpmVersion",
|
|
93
|
+
"removeModuleSyncFromExports"
|
|
94
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
95
|
+
Object.defineProperty(exports, '__esModule', {
|
|
96
|
+
value: true
|
|
94
97
|
});
|
package/dist/cjs/cli/path.js
CHANGED
|
@@ -1,92 +1,111 @@
|
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
getRealTemporaryDirectory: ()=>getRealTemporaryDirectory,
|
|
37
|
+
removeLeadingSlash: ()=>removeLeadingSlash,
|
|
38
|
+
removeTailSlash: ()=>removeTailSlash,
|
|
39
|
+
normalizeToPosixPath: ()=>normalizeToPosixPath,
|
|
40
|
+
isRelativePath: ()=>isRelativePath,
|
|
41
|
+
getTemplatePath: ()=>getTemplatePath,
|
|
42
|
+
removeSlash: ()=>removeSlash,
|
|
43
|
+
splitPathString: ()=>splitPathString,
|
|
44
|
+
isPathString: ()=>isPathString,
|
|
45
|
+
normalizeOutputPath: ()=>normalizeOutputPath,
|
|
46
|
+
formatImportPath: ()=>formatImportPath
|
|
42
47
|
});
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
tmpRoot
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
const external_fs_namespaceObject = require("fs");
|
|
49
|
+
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
50
|
+
const external_os_namespaceObject = require("os");
|
|
51
|
+
var external_os_default = /*#__PURE__*/ __webpack_require__.n(external_os_namespaceObject);
|
|
52
|
+
const external_path_namespaceObject = require("path");
|
|
53
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
54
|
+
const external_compiled_js_namespaceObject = require("../compiled.js");
|
|
55
|
+
const isPathString = (test)=>external_path_default().posix.basename(test) !== test || external_path_default().win32.basename(test) !== test;
|
|
56
|
+
const isRelativePath = (test)=>/^\.\.?($|[\\/])/.test(test);
|
|
57
|
+
const normalizeOutputPath = (s)=>s.replace(/\\/g, '\\\\');
|
|
58
|
+
const normalizeToPosixPath = (p)=>external_compiled_js_namespaceObject.upath.normalizeSafe(external_path_default().normalize(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`);
|
|
59
|
+
const getTemplatePath = (prefix)=>{
|
|
60
|
+
const tmpRoot = external_fs_default().realpathSync(external_os_default().tmpdir());
|
|
61
|
+
const parts = [
|
|
62
|
+
tmpRoot
|
|
63
|
+
];
|
|
64
|
+
prefix && parts.push(prefix);
|
|
65
|
+
parts.push((0, external_compiled_js_namespaceObject.nanoid)());
|
|
66
|
+
return external_path_default().resolve(...parts);
|
|
60
67
|
};
|
|
61
68
|
function getRealTemporaryDirectory() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return ret;
|
|
69
|
+
let ret = null;
|
|
70
|
+
try {
|
|
71
|
+
ret = external_os_default().tmpdir();
|
|
72
|
+
ret = external_fs_default().realpathSync(ret);
|
|
73
|
+
} catch {}
|
|
74
|
+
return ret;
|
|
69
75
|
}
|
|
70
76
|
function splitPathString(str) {
|
|
71
|
-
|
|
77
|
+
return str.split(/[\\/]/);
|
|
72
78
|
}
|
|
73
|
-
const removeLeadingSlash = (s)
|
|
74
|
-
const removeTailSlash = (s)
|
|
75
|
-
const removeSlash = (s)
|
|
79
|
+
const removeLeadingSlash = (s)=>s.replace(/^\/+/, '');
|
|
80
|
+
const removeTailSlash = (s)=>s.replace(/\/+$/, '');
|
|
81
|
+
const removeSlash = (s)=>removeLeadingSlash(removeTailSlash(s));
|
|
76
82
|
function formatImportPath(str) {
|
|
77
|
-
|
|
83
|
+
return str.replace(/\\/g, '/');
|
|
78
84
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
exports.formatImportPath = __webpack_exports__.formatImportPath;
|
|
86
|
+
exports.getRealTemporaryDirectory = __webpack_exports__.getRealTemporaryDirectory;
|
|
87
|
+
exports.getTemplatePath = __webpack_exports__.getTemplatePath;
|
|
88
|
+
exports.isPathString = __webpack_exports__.isPathString;
|
|
89
|
+
exports.isRelativePath = __webpack_exports__.isRelativePath;
|
|
90
|
+
exports.normalizeOutputPath = __webpack_exports__.normalizeOutputPath;
|
|
91
|
+
exports.normalizeToPosixPath = __webpack_exports__.normalizeToPosixPath;
|
|
92
|
+
exports.removeLeadingSlash = __webpack_exports__.removeLeadingSlash;
|
|
93
|
+
exports.removeSlash = __webpack_exports__.removeSlash;
|
|
94
|
+
exports.removeTailSlash = __webpack_exports__.removeTailSlash;
|
|
95
|
+
exports.splitPathString = __webpack_exports__.splitPathString;
|
|
96
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
97
|
+
"formatImportPath",
|
|
98
|
+
"getRealTemporaryDirectory",
|
|
99
|
+
"getTemplatePath",
|
|
100
|
+
"isPathString",
|
|
101
|
+
"isRelativePath",
|
|
102
|
+
"normalizeOutputPath",
|
|
103
|
+
"normalizeToPosixPath",
|
|
104
|
+
"removeLeadingSlash",
|
|
105
|
+
"removeSlash",
|
|
106
|
+
"removeTailSlash",
|
|
107
|
+
"splitPathString"
|
|
108
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
109
|
+
Object.defineProperty(exports, '__esModule', {
|
|
110
|
+
value: true
|
|
92
111
|
});
|