umi 4.0.0-canary.20220718.1 → 4.0.0-canary.20220727.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/client/client/plugin.js +263 -190
- package/client/client/utils.js +18 -11
- package/dist/cli/cli.d.ts +0 -1
- package/dist/cli/cli.js +66 -45
- package/dist/cli/dev.d.ts +0 -1
- package/dist/cli/dev.js +42 -23
- package/dist/cli/fork.d.ts +0 -1
- package/dist/cli/fork.js +59 -37
- package/dist/cli/forkedDev.d.ts +0 -1
- package/dist/cli/forkedDev.js +34 -40
- package/dist/cli/node.d.ts +0 -1
- package/dist/cli/node.js +48 -24
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +42 -11
- package/dist/defineConfig.d.ts +0 -1
- package/dist/defineConfig.js +29 -5
- package/dist/defineMock.d.ts +0 -1
- package/dist/defineMock.js +29 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +36 -23
- package/dist/pluginUtils.d.ts +0 -1
- package/dist/pluginUtils.js +38 -37
- package/dist/service/cwd.d.ts +0 -1
- package/dist/service/cwd.js +35 -11
- package/dist/service/requireHook.d.ts +0 -1
- package/dist/service/requireHook.js +12 -13
- package/dist/service/service.d.ts +0 -1
- package/dist/service/service.js +78 -42
- package/dist/test.d.ts +0 -1
- package/dist/test.js +69 -59
- package/package.json +13 -14
- package/dist/cli/cli.d.ts.map +0 -1
- package/dist/cli/dev.d.ts.map +0 -1
- package/dist/cli/fork.d.ts.map +0 -1
- package/dist/cli/forkedDev.d.ts.map +0 -1
- package/dist/cli/node.d.ts.map +0 -1
- package/dist/client/plugin.d.ts +0 -35
- package/dist/client/plugin.d.ts.map +0 -1
- package/dist/client/plugin.js +0 -124
- package/dist/client/utils.d.ts +0 -7
- package/dist/client/utils.d.ts.map +0 -1
- package/dist/client/utils.js +0 -20
- package/dist/constants.d.ts.map +0 -1
- package/dist/defineConfig.d.ts.map +0 -1
- package/dist/defineMock.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/pluginUtils.d.ts.map +0 -1
- package/dist/service/cwd.d.ts.map +0 -1
- package/dist/service/requireHook.d.ts.map +0 -1
- package/dist/service/service.d.ts.map +0 -1
- package/dist/test.d.ts.map +0 -1
package/dist/pluginUtils.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
10
|
};
|
|
28
|
-
var
|
|
29
|
-
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
30
18
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
|
|
23
|
+
// pluginUtils.ts
|
|
24
|
+
var pluginUtils_exports = {};
|
|
25
|
+
__export(pluginUtils_exports, {
|
|
26
|
+
createServerRoutes: () => import_server.createServerRoutes,
|
|
27
|
+
express: () => import_express.default,
|
|
28
|
+
httpProxyMiddleware: () => httpProxyMiddleware
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(pluginUtils_exports);
|
|
31
|
+
var import_express = __toESM(require("@umijs/bundler-utils/compiled/express"));
|
|
32
|
+
var httpProxyMiddleware = __toESM(require("@umijs/bundler-webpack/compiled/http-proxy-middleware"));
|
|
33
|
+
var import_server = require("@umijs/server");
|
|
34
|
+
__reExport(pluginUtils_exports, require("@umijs/utils"), module.exports);
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
createServerRoutes,
|
|
38
|
+
express,
|
|
39
|
+
httpProxyMiddleware
|
|
40
|
+
});
|
package/dist/service/cwd.d.ts
CHANGED
package/dist/service/cwd.js
CHANGED
|
@@ -1,13 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// cwd.ts
|
|
20
|
+
var cwd_exports = {};
|
|
21
|
+
__export(cwd_exports, {
|
|
22
|
+
getCwd: () => getCwd
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(cwd_exports);
|
|
25
|
+
var import_path = require("path");
|
|
5
26
|
function getCwd() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
27
|
+
const cwd = process.cwd();
|
|
28
|
+
const appRoot = process.env.APP_ROOT;
|
|
29
|
+
if (appRoot) {
|
|
30
|
+
return (0, import_path.isAbsolute)(appRoot) ? appRoot : (0, import_path.join)(cwd, appRoot);
|
|
31
|
+
}
|
|
32
|
+
return cwd;
|
|
12
33
|
}
|
|
13
|
-
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
getCwd
|
|
37
|
+
});
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
['umi/plugin-utils', (0, path_1.join)(__dirname, '../../plugin-utils.js')],
|
|
1
|
+
// requireHook.ts
|
|
2
|
+
var import_path = require("path");
|
|
3
|
+
var hookPropertyMap = /* @__PURE__ */ new Map([
|
|
4
|
+
["umi", (0, import_path.join)(__dirname, "../index.js")],
|
|
5
|
+
["umi/plugin-utils", (0, import_path.join)(__dirname, "../../plugin-utils.js")]
|
|
7
6
|
]);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
mod._resolveFilename = function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
var mod = require("module");
|
|
8
|
+
var resolveFilename = mod._resolveFilename;
|
|
9
|
+
mod._resolveFilename = function(request, parent, isMain, options) {
|
|
10
|
+
const hookResolved = hookPropertyMap.get(request);
|
|
11
|
+
if (hookResolved)
|
|
12
|
+
request = hookResolved;
|
|
13
|
+
return resolveFilename.call(mod, request, parent, isMain, options);
|
|
15
14
|
};
|
package/dist/service/service.js
CHANGED
|
@@ -1,44 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
env: process.env.NODE_ENV,
|
|
21
|
-
cwd,
|
|
22
|
-
defaultConfigFiles: constants_1.DEFAULT_CONFIG_FILES,
|
|
23
|
-
frameworkName: constants_1.FRAMEWORK_NAME,
|
|
24
|
-
presets: [require.resolve('@umijs/preset-umi'), ...((opts === null || opts === void 0 ? void 0 : opts.presets) || [])],
|
|
25
|
-
plugins: [
|
|
26
|
-
(0, fs_1.existsSync)((0, path_1.join)(cwd, 'plugin.ts')) && (0, path_1.join)(cwd, 'plugin.ts'),
|
|
27
|
-
(0, fs_1.existsSync)((0, path_1.join)(cwd, 'plugin.js')) && (0, path_1.join)(cwd, 'plugin.js'),
|
|
28
|
-
].filter(Boolean),
|
|
29
|
-
});
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
30
20
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __export = (target, all) => {
|
|
25
|
+
for (var name in all)
|
|
26
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
|
|
39
|
+
// service.ts
|
|
40
|
+
var service_exports = {};
|
|
41
|
+
__export(service_exports, {
|
|
42
|
+
Service: () => Service
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(service_exports);
|
|
45
|
+
var import_core = require("@umijs/core");
|
|
46
|
+
var import_fs = require("fs");
|
|
47
|
+
var import_path = require("path");
|
|
48
|
+
var import_constants = require("../constants");
|
|
49
|
+
var import_cwd = require("./cwd");
|
|
50
|
+
var Service = class extends import_core.Service {
|
|
51
|
+
constructor(opts) {
|
|
52
|
+
process.env.UMI_DIR = (0, import_path.dirname)(require.resolve("../../package"));
|
|
53
|
+
const cwd = (0, import_cwd.getCwd)();
|
|
54
|
+
require("./requireHook");
|
|
55
|
+
super(__spreadProps(__spreadValues({}, opts), {
|
|
56
|
+
env: process.env.NODE_ENV,
|
|
57
|
+
cwd,
|
|
58
|
+
defaultConfigFiles: import_constants.DEFAULT_CONFIG_FILES,
|
|
59
|
+
frameworkName: import_constants.FRAMEWORK_NAME,
|
|
60
|
+
presets: [require.resolve("@umijs/preset-umi"), ...(opts == null ? void 0 : opts.presets) || []],
|
|
61
|
+
plugins: [
|
|
62
|
+
(0, import_fs.existsSync)((0, import_path.join)(cwd, "plugin.ts")) && (0, import_path.join)(cwd, "plugin.ts"),
|
|
63
|
+
(0, import_fs.existsSync)((0, import_path.join)(cwd, "plugin.js")) && (0, import_path.join)(cwd, "plugin.js")
|
|
64
|
+
].filter(Boolean)
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
async run2(opts) {
|
|
68
|
+
let name = opts.name;
|
|
69
|
+
if ((opts == null ? void 0 : opts.args.version) || name === "v") {
|
|
70
|
+
name = "version";
|
|
71
|
+
} else if ((opts == null ? void 0 : opts.args.help) || !name || name === "h") {
|
|
72
|
+
name = "help";
|
|
42
73
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
74
|
+
return await this.run(__spreadProps(__spreadValues({}, opts), { name }));
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
+
0 && (module.exports = {
|
|
79
|
+
Service
|
|
80
|
+
});
|
package/dist/test.d.ts
CHANGED
package/dist/test.js
CHANGED
|
@@ -1,67 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// test.ts
|
|
21
|
+
var test_exports = {};
|
|
22
|
+
__export(test_exports, {
|
|
23
|
+
configUmiAlias: () => configUmiAlias,
|
|
24
|
+
getAliasPathWithKey: () => getAliasPathWithKey,
|
|
25
|
+
getUmiAlias: () => getUmiAlias
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(test_exports);
|
|
28
|
+
var import_fs = require("fs");
|
|
29
|
+
var import_service = require("./service/service");
|
|
30
|
+
__reExport(test_exports, require("@umijs/test"), module.exports);
|
|
21
31
|
function getAliasPathWithKey(alias, key) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
32
|
+
if (alias[key]) {
|
|
33
|
+
return getAliasPathWithKey(alias, alias[key]);
|
|
34
|
+
}
|
|
35
|
+
const aliasKeys = Object.keys(alias);
|
|
36
|
+
const keyStartedWith = aliasKeys.find((k) => !k.endsWith("$") && key.startsWith(`${k}/`));
|
|
37
|
+
if (keyStartedWith) {
|
|
38
|
+
const realPath = alias[keyStartedWith];
|
|
39
|
+
const newKey = realPath + key.slice(keyStartedWith.length);
|
|
40
|
+
return getAliasPathWithKey(alias, newKey);
|
|
41
|
+
} else {
|
|
42
|
+
return key;
|
|
43
|
+
}
|
|
35
44
|
}
|
|
36
|
-
|
|
37
|
-
let service;
|
|
45
|
+
var service;
|
|
38
46
|
async function getUmiAlias() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
if (!service) {
|
|
48
|
+
service = new import_service.Service();
|
|
49
|
+
await service.run2({
|
|
50
|
+
name: "setup",
|
|
51
|
+
args: { quiet: true }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return service.config.alias;
|
|
47
55
|
}
|
|
48
|
-
exports.getUmiAlias = getUmiAlias;
|
|
49
56
|
async function configUmiAlias(config) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
else {
|
|
62
|
-
config.moduleNameMapper[`^${key}$`] = aliasPath;
|
|
63
|
-
}
|
|
57
|
+
config.moduleNameMapper || (config.moduleNameMapper = {});
|
|
58
|
+
const alias = await getUmiAlias();
|
|
59
|
+
for (const key of Object.keys(alias)) {
|
|
60
|
+
const aliasPath = getAliasPathWithKey(alias, key);
|
|
61
|
+
if (key.endsWith("$")) {
|
|
62
|
+
config.moduleNameMapper[`^${key}`] = aliasPath;
|
|
63
|
+
} else if ((0, import_fs.existsSync)(aliasPath) && (0, import_fs.statSync)(aliasPath).isDirectory()) {
|
|
64
|
+
config.moduleNameMapper[`^${key}/(.*)$`] = `${aliasPath}/$1`;
|
|
65
|
+
config.moduleNameMapper[`^${key}$`] = aliasPath;
|
|
66
|
+
} else {
|
|
67
|
+
config.moduleNameMapper[`^${key}$`] = aliasPath;
|
|
64
68
|
}
|
|
65
|
-
|
|
69
|
+
}
|
|
70
|
+
return config;
|
|
66
71
|
}
|
|
67
|
-
|
|
72
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
+
0 && (module.exports = {
|
|
74
|
+
configUmiAlias,
|
|
75
|
+
getAliasPathWithKey,
|
|
76
|
+
getUmiAlias
|
|
77
|
+
});
|
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.20220727.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",
|
|
@@ -30,23 +30,22 @@
|
|
|
30
30
|
"stylelint.js"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "
|
|
34
|
-
"build:client": "pnpm tsc --project ./tsconfig.client.json",
|
|
33
|
+
"build": "umi-scripts father build",
|
|
35
34
|
"build:deps": "umi-scripts bundleDeps",
|
|
36
|
-
"dev": "
|
|
37
|
-
"dev:client": "pnpm build:client -- --watch",
|
|
35
|
+
"dev": "umi-scripts father dev",
|
|
38
36
|
"test": "umi-scripts jest-turbo"
|
|
39
37
|
},
|
|
40
38
|
"dependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@umijs/bundler-
|
|
43
|
-
"@umijs/
|
|
44
|
-
"@umijs/
|
|
45
|
-
"@umijs/
|
|
46
|
-
"@umijs/
|
|
47
|
-
"@umijs/
|
|
48
|
-
"@umijs/
|
|
49
|
-
"@umijs/
|
|
39
|
+
"@babel/runtime": "7.18.9",
|
|
40
|
+
"@umijs/bundler-utils": "4.0.0-canary.20220727.1",
|
|
41
|
+
"@umijs/bundler-webpack": "4.0.0-canary.20220727.1",
|
|
42
|
+
"@umijs/core": "4.0.0-canary.20220727.1",
|
|
43
|
+
"@umijs/lint": "4.0.0-canary.20220727.1",
|
|
44
|
+
"@umijs/preset-umi": "4.0.0-canary.20220727.1",
|
|
45
|
+
"@umijs/renderer-react": "4.0.0-canary.20220727.1",
|
|
46
|
+
"@umijs/server": "4.0.0-canary.20220727.1",
|
|
47
|
+
"@umijs/test": "4.0.0-canary.20220727.1",
|
|
48
|
+
"@umijs/utils": "4.0.0-canary.20220727.1",
|
|
50
49
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
51
50
|
"prettier-plugin-packagejson": "^2.2.17"
|
|
52
51
|
},
|
package/dist/cli/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAsB,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,iBAoCrC"}
|
package/dist/cli/dev.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAEA,wBAAgB,GAAG,SAiBlB"}
|
package/dist/cli/fork.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fork.d.ts","sourceRoot":"","sources":["../../src/cli/fork.ts"],"names":[],"mappings":";AAIA,UAAU,KAAK;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,wCA0ClD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forkedDev.d.ts","sourceRoot":"","sources":["../../src/cli/forkedDev.ts"],"names":[],"mappings":""}
|
package/dist/cli/node.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/cli/node.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,SAQ3B;AAED,wBAAgB,UAAU,SAIzB;AAED,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,QAIzC;AAED,wBAAgB,gBAAgB,SAK/B"}
|
package/dist/client/plugin.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare enum ApplyPluginsType {
|
|
2
|
-
compose = "compose",
|
|
3
|
-
modify = "modify",
|
|
4
|
-
event = "event"
|
|
5
|
-
}
|
|
6
|
-
interface IPlugin {
|
|
7
|
-
path?: string;
|
|
8
|
-
apply: Record<string, any>;
|
|
9
|
-
}
|
|
10
|
-
export declare class PluginManager {
|
|
11
|
-
opts: {
|
|
12
|
-
validKeys: string[];
|
|
13
|
-
};
|
|
14
|
-
hooks: {
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
};
|
|
17
|
-
constructor(opts: {
|
|
18
|
-
validKeys: string[];
|
|
19
|
-
});
|
|
20
|
-
register(plugin: IPlugin): void;
|
|
21
|
-
getHooks(keyWithDot: string): any;
|
|
22
|
-
applyPlugins({ key, type, initialValue, args, async, }: {
|
|
23
|
-
key: string;
|
|
24
|
-
type: ApplyPluginsType;
|
|
25
|
-
initialValue?: any;
|
|
26
|
-
args?: object;
|
|
27
|
-
async?: boolean;
|
|
28
|
-
}): any;
|
|
29
|
-
static create(opts: {
|
|
30
|
-
validKeys: string[];
|
|
31
|
-
plugins: IPlugin[];
|
|
32
|
-
}): PluginManager;
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
35
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/client/plugin.ts"],"names":[],"mappings":"AAEA,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,UAAU,OAAO;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B;AAED,qBAAa,aAAa;IACxB,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9B,KAAK,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAM;gBACK,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE;IAIzC,QAAQ,CAAC,MAAM,EAAE,OAAO;IAaxB,QAAQ,CAAC,UAAU,EAAE,MAAM;IAqB3B,YAAY,CAAC,EACX,GAAG,EACH,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,KAAK,GACN,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,gBAAgB,CAAC;QACvB,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;IAuFD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,EAAE,CAAA;KAAE;CAShE"}
|