@umijs/core 4.0.5 → 4.0.8

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.
Files changed (49) hide show
  1. package/compiled/dotenv-expand/LICENSE +24 -0
  2. package/compiled/dotenv-expand/index.js +1 -0
  3. package/compiled/dotenv-expand/lib/main.d.ts +29 -0
  4. package/compiled/dotenv-expand/package.json +1 -0
  5. package/dist/config/config.d.ts +0 -0
  6. package/dist/config/config.js +197 -176
  7. package/dist/config/utils.d.ts +0 -0
  8. package/dist/config/utils.js +36 -11
  9. package/dist/constants.d.ts +0 -0
  10. package/dist/constants.js +44 -11
  11. package/dist/index.d.ts +0 -0
  12. package/dist/index.js +46 -24
  13. package/dist/route/defineRoutes.d.ts +0 -0
  14. package/dist/route/defineRoutes.js +52 -28
  15. package/dist/route/route.d.ts +0 -0
  16. package/dist/route/route.js +20 -22
  17. package/dist/route/routeUtils.d.ts +0 -0
  18. package/dist/route/routeUtils.js +40 -20
  19. package/dist/route/routesConfig.d.ts +0 -0
  20. package/dist/route/routesConfig.js +120 -73
  21. package/dist/route/routesConvention.d.ts +0 -0
  22. package/dist/route/routesConvention.js +89 -62
  23. package/dist/route/utils.d.ts +0 -0
  24. package/dist/route/utils.js +48 -23
  25. package/dist/service/command.d.ts +0 -0
  26. package/dist/service/command.js +39 -15
  27. package/dist/service/env.d.ts +0 -0
  28. package/dist/service/env.js +44 -18
  29. package/dist/service/generatePlugin.d.ts +0 -0
  30. package/dist/service/generatePlugin.js +98 -77
  31. package/dist/service/generator.d.ts +0 -0
  32. package/dist/service/generator.js +50 -12
  33. package/dist/service/hook.d.ts +0 -0
  34. package/dist/service/hook.js +41 -17
  35. package/dist/service/path.d.ts +0 -0
  36. package/dist/service/path.js +51 -29
  37. package/dist/service/plugin.d.ts +0 -0
  38. package/dist/service/plugin.js +137 -140
  39. package/dist/service/pluginAPI.d.ts +0 -0
  40. package/dist/service/pluginAPI.js +183 -160
  41. package/dist/service/service.d.ts +0 -0
  42. package/dist/service/service.js +385 -420
  43. package/dist/service/servicePlugin.d.ts +0 -0
  44. package/dist/service/servicePlugin.js +37 -13
  45. package/dist/service/utils.d.ts +0 -0
  46. package/dist/service/utils.js +32 -8
  47. package/dist/types.d.ts +0 -0
  48. package/dist/types.js +77 -42
  49. package/package.json +6 -5
File without changes
@@ -1,14 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = (api) => {
4
- [
5
- 'onCheck',
6
- 'onStart',
7
- 'modifyAppData',
8
- 'modifyConfig',
9
- 'modifyDefaultConfig',
10
- 'modifyPaths',
11
- ].forEach((name) => {
12
- api.registerMethod({ name });
13
- });
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 });
14
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
+ // servicePlugin.ts
20
+ var servicePlugin_exports = {};
21
+ __export(servicePlugin_exports, {
22
+ default: () => servicePlugin_default
23
+ });
24
+ module.exports = __toCommonJS(servicePlugin_exports);
25
+ var servicePlugin_default = (api) => {
26
+ [
27
+ "onCheck",
28
+ "onStart",
29
+ "modifyAppData",
30
+ "modifyConfig",
31
+ "modifyDefaultConfig",
32
+ "modifyPaths"
33
+ ].forEach((name) => {
34
+ api.registerMethod({ name });
35
+ });
36
+ };
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {});
File without changes
@@ -1,12 +1,36 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeArray = exports.isPromise = void 0;
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
+ // utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ isPromise: () => isPromise,
23
+ makeArray: () => makeArray
24
+ });
25
+ module.exports = __toCommonJS(utils_exports);
4
26
  function isPromise(obj) {
5
- return ((typeof obj === 'object' || typeof obj === 'function') &&
6
- typeof obj.then === 'function');
27
+ return (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
7
28
  }
8
- exports.isPromise = isPromise;
9
29
  function makeArray(item) {
10
- return Array.isArray(item) ? item : [item];
30
+ return Array.isArray(item) ? item : [item];
11
31
  }
12
- exports.makeArray = makeArray;
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ isPromise,
35
+ makeArray
36
+ });
package/dist/types.d.ts CHANGED
File without changes
package/dist/types.js CHANGED
@@ -1,42 +1,77 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EnableBy = exports.ApplyPluginsType = exports.ConfigChangeType = exports.ServiceStage = exports.PluginType = exports.Env = void 0;
4
- var Env;
5
- (function (Env) {
6
- Env["development"] = "development";
7
- Env["production"] = "production";
8
- Env["test"] = "test";
9
- })(Env = exports.Env || (exports.Env = {}));
10
- var PluginType;
11
- (function (PluginType) {
12
- PluginType["preset"] = "preset";
13
- PluginType["plugin"] = "plugin";
14
- })(PluginType = exports.PluginType || (exports.PluginType = {}));
15
- var ServiceStage;
16
- (function (ServiceStage) {
17
- ServiceStage[ServiceStage["uninitialized"] = 0] = "uninitialized";
18
- ServiceStage[ServiceStage["init"] = 1] = "init";
19
- ServiceStage[ServiceStage["initPresets"] = 2] = "initPresets";
20
- ServiceStage[ServiceStage["initPlugins"] = 3] = "initPlugins";
21
- ServiceStage[ServiceStage["resolveConfig"] = 4] = "resolveConfig";
22
- ServiceStage[ServiceStage["collectAppData"] = 5] = "collectAppData";
23
- ServiceStage[ServiceStage["onCheck"] = 6] = "onCheck";
24
- ServiceStage[ServiceStage["onStart"] = 7] = "onStart";
25
- ServiceStage[ServiceStage["runCommand"] = 8] = "runCommand";
26
- })(ServiceStage = exports.ServiceStage || (exports.ServiceStage = {}));
27
- var ConfigChangeType;
28
- (function (ConfigChangeType) {
29
- ConfigChangeType["reload"] = "reload";
30
- ConfigChangeType["regenerateTmpFiles"] = "regenerateTmpFiles";
31
- })(ConfigChangeType = exports.ConfigChangeType || (exports.ConfigChangeType = {}));
32
- var ApplyPluginsType;
33
- (function (ApplyPluginsType) {
34
- ApplyPluginsType["add"] = "add";
35
- ApplyPluginsType["modify"] = "modify";
36
- ApplyPluginsType["event"] = "event";
37
- })(ApplyPluginsType = exports.ApplyPluginsType || (exports.ApplyPluginsType = {}));
38
- var EnableBy;
39
- (function (EnableBy) {
40
- EnableBy["register"] = "register";
41
- EnableBy["config"] = "config";
42
- })(EnableBy = exports.EnableBy || (exports.EnableBy = {}));
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
+ // types.ts
20
+ var types_exports = {};
21
+ __export(types_exports, {
22
+ ApplyPluginsType: () => ApplyPluginsType,
23
+ ConfigChangeType: () => ConfigChangeType,
24
+ EnableBy: () => EnableBy,
25
+ Env: () => Env,
26
+ PluginType: () => PluginType,
27
+ ServiceStage: () => ServiceStage
28
+ });
29
+ module.exports = __toCommonJS(types_exports);
30
+ var Env = /* @__PURE__ */ ((Env2) => {
31
+ Env2["development"] = "development";
32
+ Env2["production"] = "production";
33
+ Env2["test"] = "test";
34
+ return Env2;
35
+ })(Env || {});
36
+ var PluginType = /* @__PURE__ */ ((PluginType2) => {
37
+ PluginType2["preset"] = "preset";
38
+ PluginType2["plugin"] = "plugin";
39
+ return PluginType2;
40
+ })(PluginType || {});
41
+ var ServiceStage = /* @__PURE__ */ ((ServiceStage2) => {
42
+ ServiceStage2[ServiceStage2["uninitialized"] = 0] = "uninitialized";
43
+ ServiceStage2[ServiceStage2["init"] = 1] = "init";
44
+ ServiceStage2[ServiceStage2["initPresets"] = 2] = "initPresets";
45
+ ServiceStage2[ServiceStage2["initPlugins"] = 3] = "initPlugins";
46
+ ServiceStage2[ServiceStage2["resolveConfig"] = 4] = "resolveConfig";
47
+ ServiceStage2[ServiceStage2["collectAppData"] = 5] = "collectAppData";
48
+ ServiceStage2[ServiceStage2["onCheck"] = 6] = "onCheck";
49
+ ServiceStage2[ServiceStage2["onStart"] = 7] = "onStart";
50
+ ServiceStage2[ServiceStage2["runCommand"] = 8] = "runCommand";
51
+ return ServiceStage2;
52
+ })(ServiceStage || {});
53
+ var ConfigChangeType = /* @__PURE__ */ ((ConfigChangeType2) => {
54
+ ConfigChangeType2["reload"] = "reload";
55
+ ConfigChangeType2["regenerateTmpFiles"] = "regenerateTmpFiles";
56
+ return ConfigChangeType2;
57
+ })(ConfigChangeType || {});
58
+ var ApplyPluginsType = /* @__PURE__ */ ((ApplyPluginsType2) => {
59
+ ApplyPluginsType2["add"] = "add";
60
+ ApplyPluginsType2["modify"] = "modify";
61
+ ApplyPluginsType2["event"] = "event";
62
+ return ApplyPluginsType2;
63
+ })(ApplyPluginsType || {});
64
+ var EnableBy = /* @__PURE__ */ ((EnableBy2) => {
65
+ EnableBy2["register"] = "register";
66
+ EnableBy2["config"] = "config";
67
+ return EnableBy2;
68
+ })(EnableBy || {});
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ ApplyPluginsType,
72
+ ConfigChangeType,
73
+ EnableBy,
74
+ Env,
75
+ PluginType,
76
+ ServiceStage
77
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/core",
3
- "version": "4.0.5",
3
+ "version": "4.0.8",
4
4
  "homepage": "https://github.com/umijs/umi/tree/master/packages/core#readme",
5
5
  "bugs": "https://github.com/umijs/umi/issues",
6
6
  "repository": {
@@ -15,17 +15,18 @@
15
15
  "compiled"
16
16
  ],
17
17
  "scripts": {
18
- "build": "pnpm tsc",
18
+ "build": "pnpm father build",
19
19
  "build:deps": "umi-scripts bundleDeps",
20
- "dev": "pnpm build --watch",
20
+ "dev": "pnpm father dev",
21
21
  "test": "umi-scripts jest-turbo"
22
22
  },
23
23
  "dependencies": {
24
- "@umijs/bundler-utils": "4.0.5",
25
- "@umijs/utils": "4.0.5"
24
+ "@umijs/bundler-utils": "4.0.8",
25
+ "@umijs/utils": "4.0.8"
26
26
  },
27
27
  "devDependencies": {
28
28
  "dotenv": "16.0.0",
29
+ "dotenv-expand": "8.0.3",
29
30
  "just-diff": "5.0.1"
30
31
  },
31
32
  "publishConfig": {