umi 4.0.0-canary.20230224.1 → 4.0.0-canary.20230302.1
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/cli/cli.js +3 -1
- package/dist/cli/node.d.ts +1 -0
- package/dist/cli/node.js +12 -3
- package/package.json +13 -13
package/dist/cli/cli.js
CHANGED
|
@@ -27,6 +27,7 @@ var import_constants = require("../constants");
|
|
|
27
27
|
var import_service = require("../service/service");
|
|
28
28
|
var import_dev = require("./dev");
|
|
29
29
|
var import_node = require("./node");
|
|
30
|
+
(0, import_node.catchUnhandledRejection)();
|
|
30
31
|
async function run(opts) {
|
|
31
32
|
(0, import_node.checkVersion)();
|
|
32
33
|
(0, import_node.checkLocal)();
|
|
@@ -40,7 +41,8 @@ async function run(opts) {
|
|
|
40
41
|
boolean: ["version"]
|
|
41
42
|
});
|
|
42
43
|
const command = args._[0];
|
|
43
|
-
|
|
44
|
+
const FEATURE_COMMANDS = ["mfsu", "setup", "deadcode"];
|
|
45
|
+
if ([import_constants.DEV_COMMAND, ...FEATURE_COMMANDS].includes(command)) {
|
|
44
46
|
process.env.NODE_ENV = "development";
|
|
45
47
|
} else if (command === "build") {
|
|
46
48
|
process.env.NODE_ENV = "production";
|
package/dist/cli/node.d.ts
CHANGED
package/dist/cli/node.js
CHANGED
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/cli/node.ts
|
|
20
20
|
var node_exports = {};
|
|
21
21
|
__export(node_exports, {
|
|
22
|
+
catchUnhandledRejection: () => catchUnhandledRejection,
|
|
22
23
|
checkLocal: () => checkLocal,
|
|
23
24
|
checkVersion: () => checkVersion,
|
|
24
25
|
setNodeTitle: () => setNodeTitle
|
|
@@ -26,11 +27,11 @@ __export(node_exports, {
|
|
|
26
27
|
module.exports = __toCommonJS(node_exports);
|
|
27
28
|
var import_utils = require("@umijs/utils");
|
|
28
29
|
var import_constants = require("../constants");
|
|
30
|
+
var ver = parseInt(process.version.slice(1));
|
|
29
31
|
function checkVersion() {
|
|
30
|
-
|
|
31
|
-
if (v < import_constants.MIN_NODE_VERSION || v === 15 || v === 17) {
|
|
32
|
+
if (ver < import_constants.MIN_NODE_VERSION || ver === 15 || ver === 17) {
|
|
32
33
|
import_utils.logger.error(
|
|
33
|
-
`Your node version ${
|
|
34
|
+
`Your node version ${ver} is not supported, please upgrade to ${import_constants.MIN_NODE_VERSION} or above except 15 or 17.`
|
|
34
35
|
);
|
|
35
36
|
process.exit(1);
|
|
36
37
|
}
|
|
@@ -45,8 +46,16 @@ function setNodeTitle(name) {
|
|
|
45
46
|
process.title = name || import_constants.FRAMEWORK_NAME;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
49
|
+
function catchUnhandledRejection() {
|
|
50
|
+
if (ver <= 14) {
|
|
51
|
+
process.on("unhandledRejection", (err) => {
|
|
52
|
+
throw err;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
48
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
49
57
|
0 && (module.exports = {
|
|
58
|
+
catchUnhandledRejection,
|
|
50
59
|
checkLocal,
|
|
51
60
|
checkVersion,
|
|
52
61
|
setNodeTitle
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "umi",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.20230302.1",
|
|
4
4
|
"description": "umi",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/umi#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"test": "umi-scripts jest-turbo"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@babel/runtime": "7.
|
|
41
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
42
|
-
"@umijs/bundler-webpack": "4.0.0-canary.
|
|
43
|
-
"@umijs/core": "4.0.0-canary.
|
|
44
|
-
"@umijs/lint": "4.0.0-canary.
|
|
45
|
-
"@umijs/preset-umi": "4.0.0-canary.
|
|
46
|
-
"@umijs/renderer-react": "4.0.0-canary.
|
|
47
|
-
"@umijs/server": "4.0.0-canary.
|
|
48
|
-
"@umijs/test": "4.0.0-canary.
|
|
49
|
-
"@umijs/utils": "4.0.0-canary.
|
|
50
|
-
"prettier-plugin-organize-imports": "^3.2.
|
|
51
|
-
"prettier-plugin-packagejson": "2.3
|
|
40
|
+
"@babel/runtime": "7.21.0",
|
|
41
|
+
"@umijs/bundler-utils": "4.0.0-canary.20230302.1",
|
|
42
|
+
"@umijs/bundler-webpack": "4.0.0-canary.20230302.1",
|
|
43
|
+
"@umijs/core": "4.0.0-canary.20230302.1",
|
|
44
|
+
"@umijs/lint": "4.0.0-canary.20230302.1",
|
|
45
|
+
"@umijs/preset-umi": "4.0.0-canary.20230302.1",
|
|
46
|
+
"@umijs/renderer-react": "4.0.0-canary.20230302.1",
|
|
47
|
+
"@umijs/server": "4.0.0-canary.20230302.1",
|
|
48
|
+
"@umijs/test": "4.0.0-canary.20230302.1",
|
|
49
|
+
"@umijs/utils": "4.0.0-canary.20230302.1",
|
|
50
|
+
"prettier-plugin-organize-imports": "^3.2.2",
|
|
51
|
+
"prettier-plugin-packagejson": "2.4.3"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=14"
|