umi 4.0.0-beta.1 → 4.0.0-beta.10
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/bin/forkedDev.js +4 -0
- package/bin/umi.js +9 -0
- package/dist/cli/cli.d.ts +4 -0
- package/dist/cli/cli.js +40 -33
- package/dist/cli/node.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +15 -0
- package/dist/service/service.js +1 -4
- package/index.d.ts +1 -1
- package/package.json +22 -18
package/bin/forkedDev.js
ADDED
package/bin/umi.js
ADDED
package/dist/cli/cli.d.ts
CHANGED
package/dist/cli/cli.js
CHANGED
|
@@ -9,43 +9,50 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.run = void 0;
|
|
12
13
|
const utils_1 = require("@umijs/utils");
|
|
13
14
|
const constants_1 = require("../constants");
|
|
14
15
|
const service_1 = require("../service/service");
|
|
15
16
|
const dev_1 = require("./dev");
|
|
16
17
|
const node_1 = require("./node");
|
|
17
|
-
|
|
18
|
-
(0,
|
|
19
|
-
(0, node_1.
|
|
20
|
-
(0, node_1.
|
|
21
|
-
(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(0
|
|
38
|
-
|
|
39
|
-
else {
|
|
40
|
-
try {
|
|
41
|
-
yield new service_1.Service().run2({
|
|
42
|
-
name: args._[0],
|
|
43
|
-
args,
|
|
44
|
-
});
|
|
18
|
+
function run(opts) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
(0, node_1.checkVersion)();
|
|
21
|
+
(0, node_1.checkLocal)();
|
|
22
|
+
(0, node_1.setNodeTitle)();
|
|
23
|
+
(0, node_1.setNoDeprecation)();
|
|
24
|
+
const args = (0, utils_1.yParser)(process.argv.slice(2), {
|
|
25
|
+
alias: {
|
|
26
|
+
version: ['v'],
|
|
27
|
+
help: ['h'],
|
|
28
|
+
},
|
|
29
|
+
boolean: ['version'],
|
|
30
|
+
});
|
|
31
|
+
const command = args._[0];
|
|
32
|
+
if ([constants_1.DEV_COMMAND, 'setup'].includes(command)) {
|
|
33
|
+
process.env.NODE_ENV = 'development';
|
|
34
|
+
}
|
|
35
|
+
else if (command === 'build') {
|
|
36
|
+
process.env.NODE_ENV = 'production';
|
|
37
|
+
}
|
|
38
|
+
if (opts === null || opts === void 0 ? void 0 : opts.presets) {
|
|
39
|
+
process.env.UMI_PRESETS = opts.presets.join(',');
|
|
45
40
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
process.exit(1);
|
|
41
|
+
if (command === constants_1.DEV_COMMAND) {
|
|
42
|
+
(0, dev_1.dev)();
|
|
49
43
|
}
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
else {
|
|
45
|
+
try {
|
|
46
|
+
yield new service_1.Service().run2({
|
|
47
|
+
name: args._[0],
|
|
48
|
+
args,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
utils_1.logger.error(e);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
exports.run = run;
|
package/dist/cli/node.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,8 +6,23 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
9
21
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
22
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
23
|
};
|
|
12
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.utils = void 0;
|
|
26
|
+
const utils = __importStar(require("@umijs/utils"));
|
|
27
|
+
exports.utils = utils;
|
|
13
28
|
__exportStar(require("./service/service"), exports);
|
package/dist/service/service.js
CHANGED
|
@@ -19,10 +19,7 @@ class Service extends core_1.Service {
|
|
|
19
19
|
constructor(opts) {
|
|
20
20
|
process.env.UMI_DIR = (0, path_1.dirname)(require.resolve('../../package'));
|
|
21
21
|
const cwd = (0, cwd_1.getCwd)();
|
|
22
|
-
super(Object.assign(Object.assign({}, opts), { env: process.env.NODE_ENV, cwd, defaultConfigFiles: constants_1.DEFAULT_CONFIG_FILES, frameworkName: constants_1.FRAMEWORK_NAME, presets: [
|
|
23
|
-
require.resolve('@umijs/preset-built-in'),
|
|
24
|
-
...((opts === null || opts === void 0 ? void 0 : opts.presets) || []),
|
|
25
|
-
], plugins: [
|
|
22
|
+
super(Object.assign(Object.assign({}, opts), { env: process.env.NODE_ENV, cwd, defaultConfigFiles: constants_1.DEFAULT_CONFIG_FILES, frameworkName: constants_1.FRAMEWORK_NAME, presets: [require.resolve('@umijs/preset-umi'), ...((opts === null || opts === void 0 ? void 0 : opts.presets) || [])], plugins: [
|
|
26
23
|
(0, fs_1.existsSync)((0, path_1.join)(cwd, 'plugin.ts')) && (0, path_1.join)(cwd, 'plugin.ts'),
|
|
27
24
|
(0, fs_1.existsSync)((0, path_1.join)(cwd, 'plugin.js')) && (0, path_1.join)(cwd, 'plugin.js'),
|
|
28
25
|
].filter(Boolean) }));
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "umi",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.10",
|
|
4
4
|
"description": "umi",
|
|
5
|
+
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/umi#readme",
|
|
6
|
+
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/umijs/umi-next"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
5
12
|
"main": "dist/index.js",
|
|
6
13
|
"module": "index.esm.js",
|
|
7
14
|
"types": "index.d.ts",
|
|
15
|
+
"bin": {
|
|
16
|
+
"umi": "bin/umi.js"
|
|
17
|
+
},
|
|
8
18
|
"files": [
|
|
9
19
|
"dist",
|
|
10
20
|
"index.d.ts",
|
|
11
21
|
"index.esm.js",
|
|
12
|
-
"client"
|
|
22
|
+
"client",
|
|
23
|
+
"bin"
|
|
13
24
|
],
|
|
14
25
|
"scripts": {
|
|
15
26
|
"build": "pnpm tsc",
|
|
@@ -17,24 +28,17 @@
|
|
|
17
28
|
"build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
|
|
18
29
|
"dev": "pnpm build -- --watch"
|
|
19
30
|
},
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@umijs/core": "4.0.0-beta.10",
|
|
33
|
+
"@umijs/preset-umi": "4.0.0-beta.10",
|
|
34
|
+
"@umijs/renderer-react": "4.0.0-beta.10",
|
|
35
|
+
"@umijs/utils": "4.0.0-beta.10",
|
|
36
|
+
"v8-compile-cache": "2.3.0"
|
|
23
37
|
},
|
|
24
|
-
"authors": [
|
|
25
|
-
"chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
|
|
26
|
-
],
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
29
|
-
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/umi#readme",
|
|
30
38
|
"publishConfig": {
|
|
31
39
|
"access": "public"
|
|
32
40
|
},
|
|
33
|
-
"
|
|
34
|
-
"@
|
|
35
|
-
|
|
36
|
-
"@umijs/renderer-react": "4.0.0-beta.1",
|
|
37
|
-
"@umijs/utils": "4.0.0-beta.1",
|
|
38
|
-
"v8-compile-cache": "2.3.0"
|
|
39
|
-
}
|
|
41
|
+
"authors": [
|
|
42
|
+
"chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
|
|
43
|
+
]
|
|
40
44
|
}
|