@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
|
@@ -1,148 +1,152 @@
|
|
|
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
|
-
|
|
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
|
+
isVersionBeyond17: ()=>isVersionBeyond17,
|
|
37
|
+
isReact18: ()=>isReact18,
|
|
38
|
+
isWebOnly: ()=>isWebOnly,
|
|
39
|
+
getReactVersion: ()=>getReactVersion,
|
|
40
|
+
isApiOnly: ()=>isApiOnly,
|
|
41
|
+
isBeyondReact17: ()=>isBeyondReact17,
|
|
42
|
+
isDepExists: ()=>isDepExists,
|
|
43
|
+
isTypescript: ()=>isTypescript,
|
|
44
|
+
isSupportAutomaticJsx: ()=>isSupportAutomaticJsx,
|
|
45
|
+
isPackageInstalled: ()=>isPackageInstalled
|
|
41
46
|
});
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const isPackageInstalled = (name, resolvePaths) => {
|
|
61
|
-
try {
|
|
62
|
-
require.resolve(name, {
|
|
63
|
-
paths: (0, import_ensure.ensureArray)(resolvePaths)
|
|
64
|
-
});
|
|
65
|
-
return true;
|
|
66
|
-
} catch (err) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
47
|
+
const external_path_namespaceObject = require("path");
|
|
48
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
49
|
+
const pkg_up_namespaceObject = require("../../../compiled/pkg-up");
|
|
50
|
+
var pkg_up_default = /*#__PURE__*/ __webpack_require__.n(pkg_up_namespaceObject);
|
|
51
|
+
const external_compiled_js_namespaceObject = require("../../compiled.js");
|
|
52
|
+
const external_commands_js_namespaceObject = require("../commands.js");
|
|
53
|
+
const external_common_js_namespaceObject = require("../common.js");
|
|
54
|
+
const external_ensure_js_namespaceObject = require("../ensure.js");
|
|
55
|
+
const debug = (0, external_common_js_namespaceObject.createDebugger)('judge-depExists');
|
|
56
|
+
const isDepExists = (appDirectory, name)=>{
|
|
57
|
+
const pkgPath = external_path_default().resolve(appDirectory, './package.json');
|
|
58
|
+
if (!external_compiled_js_namespaceObject.fs.existsSync(pkgPath)) {
|
|
59
|
+
debug("can't find package.json under: %s", appDirectory);
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const json = require(pkgPath);
|
|
63
|
+
const { dependencies = {}, devDependencies = {} } = json;
|
|
64
|
+
return dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name);
|
|
69
65
|
};
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
const isPackageInstalled = (name, resolvePaths)=>{
|
|
67
|
+
try {
|
|
68
|
+
require.resolve(name, {
|
|
69
|
+
paths: (0, external_ensure_js_namespaceObject.ensureArray)(resolvePaths)
|
|
70
|
+
});
|
|
71
|
+
return true;
|
|
72
|
+
} catch (err) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
78
75
|
};
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
const isApiOnly = async (appDirectory, entryDir, apiDir)=>{
|
|
77
|
+
const existApi = await external_compiled_js_namespaceObject.fs.pathExists(apiDir ?? external_path_default().join(appDirectory, 'api'));
|
|
78
|
+
const existSrc = await external_compiled_js_namespaceObject.fs.pathExists(external_path_default().join(appDirectory, entryDir ?? 'src'));
|
|
79
|
+
const options = (0, external_compiled_js_namespaceObject.minimist)((0, external_commands_js_namespaceObject.getArgv)());
|
|
80
|
+
if (options['api-only']) return true;
|
|
81
|
+
return existApi && !existSrc;
|
|
82
82
|
};
|
|
83
|
-
const
|
|
84
|
-
|
|
83
|
+
const isWebOnly = async ()=>{
|
|
84
|
+
const options = (0, external_compiled_js_namespaceObject.minimist)((0, external_commands_js_namespaceObject.getArgv)());
|
|
85
|
+
return Boolean(options['web-only']);
|
|
85
86
|
};
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
if (!pkgPath) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
const pkgInfo = JSON.parse(import_compiled.fs.readFileSync(pkgPath, "utf8"));
|
|
94
|
-
const deps = {
|
|
95
|
-
...pkgInfo.devDependencies,
|
|
96
|
-
...pkgInfo.dependencies
|
|
97
|
-
};
|
|
98
|
-
if (typeof deps.react !== "string") {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
const reactPath = require.resolve("react/package.json", {
|
|
103
|
-
paths: [
|
|
87
|
+
const isVersionBeyond17 = (version)=>external_compiled_js_namespaceObject.semver.gte(external_compiled_js_namespaceObject.semver.minVersion(version), '17.0.0');
|
|
88
|
+
const getReactVersion = (cwd)=>{
|
|
89
|
+
const pkgPath = pkg_up_default().sync({
|
|
104
90
|
cwd
|
|
105
|
-
]
|
|
106
91
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
92
|
+
if (!pkgPath) return false;
|
|
93
|
+
const pkgInfo = JSON.parse(external_compiled_js_namespaceObject.fs.readFileSync(pkgPath, 'utf8'));
|
|
94
|
+
const deps = {
|
|
95
|
+
...pkgInfo.devDependencies,
|
|
96
|
+
...pkgInfo.dependencies
|
|
97
|
+
};
|
|
98
|
+
if ('string' != typeof deps.react) return false;
|
|
99
|
+
try {
|
|
100
|
+
const reactPath = require.resolve('react/package.json', {
|
|
101
|
+
paths: [
|
|
102
|
+
cwd
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
const reactVersion = JSON.parse(external_compiled_js_namespaceObject.fs.readFileSync(reactPath, 'utf8')).version;
|
|
106
|
+
return reactVersion;
|
|
107
|
+
} catch (error) {
|
|
108
|
+
console.error('Failed to resolve React version:', error);
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
113
111
|
};
|
|
114
|
-
const isBeyondReact17 = (cwd)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
return isVersionBeyond17(reactVersion);
|
|
112
|
+
const isBeyondReact17 = (cwd)=>{
|
|
113
|
+
const reactVersion = getReactVersion(cwd);
|
|
114
|
+
if (!reactVersion) return false;
|
|
115
|
+
return isVersionBeyond17(reactVersion);
|
|
120
116
|
};
|
|
121
|
-
const isSupportAutomaticJsx = (cwd)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return
|
|
125
|
-
}
|
|
126
|
-
return import_compiled.semver.satisfies(import_compiled.semver.minVersion(reactVersion), ">=16.14.0");
|
|
117
|
+
const isSupportAutomaticJsx = (cwd)=>{
|
|
118
|
+
const reactVersion = getReactVersion(cwd);
|
|
119
|
+
if (!reactVersion) return false;
|
|
120
|
+
return external_compiled_js_namespaceObject.semver.satisfies(external_compiled_js_namespaceObject.semver.minVersion(reactVersion), '>=16.14.0');
|
|
127
121
|
};
|
|
128
|
-
const isReact18 = (cwd = process.cwd())
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return
|
|
132
|
-
}
|
|
133
|
-
return import_compiled.semver.gte(import_compiled.semver.minVersion(reactVersion), "18.0.0");
|
|
122
|
+
const isReact18 = (cwd = process.cwd())=>{
|
|
123
|
+
const reactVersion = getReactVersion(cwd);
|
|
124
|
+
if (!reactVersion) return false;
|
|
125
|
+
return external_compiled_js_namespaceObject.semver.gte(external_compiled_js_namespaceObject.semver.minVersion(reactVersion), '18.0.0');
|
|
134
126
|
};
|
|
135
|
-
const isTypescript = (root)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
127
|
+
const isTypescript = (root)=>external_compiled_js_namespaceObject.fs.existsSync(external_path_default().resolve(root, './tsconfig.json'));
|
|
128
|
+
exports.getReactVersion = __webpack_exports__.getReactVersion;
|
|
129
|
+
exports.isApiOnly = __webpack_exports__.isApiOnly;
|
|
130
|
+
exports.isBeyondReact17 = __webpack_exports__.isBeyondReact17;
|
|
131
|
+
exports.isDepExists = __webpack_exports__.isDepExists;
|
|
132
|
+
exports.isPackageInstalled = __webpack_exports__.isPackageInstalled;
|
|
133
|
+
exports.isReact18 = __webpack_exports__.isReact18;
|
|
134
|
+
exports.isSupportAutomaticJsx = __webpack_exports__.isSupportAutomaticJsx;
|
|
135
|
+
exports.isTypescript = __webpack_exports__.isTypescript;
|
|
136
|
+
exports.isVersionBeyond17 = __webpack_exports__.isVersionBeyond17;
|
|
137
|
+
exports.isWebOnly = __webpack_exports__.isWebOnly;
|
|
138
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
139
|
+
"getReactVersion",
|
|
140
|
+
"isApiOnly",
|
|
141
|
+
"isBeyondReact17",
|
|
142
|
+
"isDepExists",
|
|
143
|
+
"isPackageInstalled",
|
|
144
|
+
"isReact18",
|
|
145
|
+
"isSupportAutomaticJsx",
|
|
146
|
+
"isTypescript",
|
|
147
|
+
"isVersionBeyond17",
|
|
148
|
+
"isWebOnly"
|
|
149
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
150
|
+
Object.defineProperty(exports, '__esModule', {
|
|
151
|
+
value: true
|
|
148
152
|
});
|
package/dist/cjs/cli/is/type.js
CHANGED
|
@@ -1,68 +1,84 @@
|
|
|
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
|
-
|
|
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
|
+
isArray: ()=>isArray,
|
|
28
|
+
isEmpty: ()=>isEmpty,
|
|
29
|
+
isFunction: ()=>isFunction,
|
|
30
|
+
isObject: ()=>isObject,
|
|
31
|
+
isPlainObject: ()=>isPlainObject,
|
|
32
|
+
isPromise: ()=>isPromise,
|
|
33
|
+
isRegExp: ()=>isRegExp,
|
|
34
|
+
isString: ()=>isString,
|
|
35
|
+
isUndefined: ()=>isUndefined
|
|
30
36
|
});
|
|
31
|
-
module.exports = __toCommonJS(type_exports);
|
|
32
37
|
function isString(str) {
|
|
33
|
-
|
|
38
|
+
return 'string' == typeof str;
|
|
34
39
|
}
|
|
35
40
|
function isUndefined(obj) {
|
|
36
|
-
|
|
41
|
+
return void 0 === obj;
|
|
37
42
|
}
|
|
38
43
|
function isArray(obj) {
|
|
39
|
-
|
|
44
|
+
return Array.isArray(obj);
|
|
40
45
|
}
|
|
41
46
|
function isFunction(func) {
|
|
42
|
-
|
|
47
|
+
return 'function' == typeof func;
|
|
43
48
|
}
|
|
44
49
|
function isObject(obj) {
|
|
45
|
-
|
|
50
|
+
return null !== obj && 'object' == typeof obj;
|
|
46
51
|
}
|
|
47
52
|
function isPlainObject(obj) {
|
|
48
|
-
|
|
53
|
+
return isObject(obj) && '[object Object]' === Object.prototype.toString.call(obj);
|
|
49
54
|
}
|
|
50
55
|
function isPromise(obj) {
|
|
51
|
-
|
|
56
|
+
return Boolean(obj) && ('object' == typeof obj || 'function' == typeof obj) && 'function' == typeof obj.then;
|
|
52
57
|
}
|
|
53
58
|
function isRegExp(obj) {
|
|
54
|
-
|
|
59
|
+
return '[object RegExp]' === Object.prototype.toString.call(obj);
|
|
55
60
|
}
|
|
56
|
-
const isEmpty = (o)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
const isEmpty = (o)=>0 === Object.entries(o).length && o.constructor === Object;
|
|
62
|
+
exports.isArray = __webpack_exports__.isArray;
|
|
63
|
+
exports.isEmpty = __webpack_exports__.isEmpty;
|
|
64
|
+
exports.isFunction = __webpack_exports__.isFunction;
|
|
65
|
+
exports.isObject = __webpack_exports__.isObject;
|
|
66
|
+
exports.isPlainObject = __webpack_exports__.isPlainObject;
|
|
67
|
+
exports.isPromise = __webpack_exports__.isPromise;
|
|
68
|
+
exports.isRegExp = __webpack_exports__.isRegExp;
|
|
69
|
+
exports.isString = __webpack_exports__.isString;
|
|
70
|
+
exports.isUndefined = __webpack_exports__.isUndefined;
|
|
71
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
72
|
+
"isArray",
|
|
73
|
+
"isEmpty",
|
|
74
|
+
"isFunction",
|
|
75
|
+
"isObject",
|
|
76
|
+
"isPlainObject",
|
|
77
|
+
"isPromise",
|
|
78
|
+
"isRegExp",
|
|
79
|
+
"isString",
|
|
80
|
+
"isUndefined"
|
|
81
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
82
|
+
Object.defineProperty(exports, '__esModule', {
|
|
83
|
+
value: true
|
|
68
84
|
});
|
package/dist/cjs/cli/logger.js
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
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
|
-
|
|
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
|
+
createLogger: ()=>external_rslog_namespaceObject.createLogger,
|
|
28
|
+
logger: ()=>external_rslog_namespaceObject.logger
|
|
23
29
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const external_rslog_namespaceObject = require("rslog");
|
|
31
|
+
exports.createLogger = __webpack_exports__.createLogger;
|
|
32
|
+
exports.logger = __webpack_exports__.logger;
|
|
33
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
34
|
+
"createLogger",
|
|
35
|
+
"logger"
|
|
36
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
37
|
+
Object.defineProperty(exports, '__esModule', {
|
|
38
|
+
value: true
|
|
30
39
|
});
|