@umijs/plugins 4.0.51 → 4.0.52

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/access.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
package/dist/antd.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -52,9 +56,12 @@ var antd_default = (api) => {
52
56
  return Joi.alternatives().try(
53
57
  Joi.object({
54
58
  configProvider: Joi.object(),
59
+ // themes
55
60
  dark: Joi.boolean(),
56
61
  compact: Joi.boolean(),
62
+ // babel-plugin-import
57
63
  import: Joi.boolean(),
64
+ // less or css, default less
58
65
  style: Joi.string().allow("less", "css"),
59
66
  theme: Joi.object()
60
67
  }),
@@ -99,10 +106,10 @@ var antd_default = (api) => {
99
106
  ...theme,
100
107
  ...memo.theme
101
108
  };
102
- if ((_a = memo.antd) == null ? void 0 : _a.style) {
103
- const errorMessage = `Can't set antd.style while using antd5 (${antdVersion})`;
109
+ if ((_a = memo.antd) == null ? void 0 : _a.import) {
110
+ const errorMessage = `Can't set antd.import while using antd5 (${antdVersion})`;
104
111
  api.logger.fatal(
105
- "please remove config antd.style, then start server again"
112
+ "please change config antd.import to false, then start server again"
106
113
  );
107
114
  throw Error(errorMessage);
108
115
  }
package/dist/dva.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
package/dist/layout.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -28,13 +32,27 @@ __export(layout_exports, {
28
32
  default: () => layout_default
29
33
  });
30
34
  module.exports = __toCommonJS(layout_exports);
31
- var allIcons = __toESM(require("@ant-design/icons"));
32
35
  var import_fs = require("fs");
33
36
  var import_path = require("path");
34
37
  var import_umi = require("umi");
35
38
  var import_plugin_utils = require("umi/plugin-utils");
36
39
  var import_resolveProjectDep = require("./utils/resolveProjectDep");
37
40
  var import_withTmpPath = require("./utils/withTmpPath");
41
+ var antIconsPath = (0, import_plugin_utils.winPath)(
42
+ (0, import_path.dirname)(require.resolve("@ant-design/icons/package"))
43
+ );
44
+ var getAllIcons = () => {
45
+ const iconTypePath = (0, import_path.join)(antIconsPath, "./lib/icons/index.d.ts");
46
+ const iconTypeContent = (0, import_fs.readFileSync)(iconTypePath, "utf-8");
47
+ return [...iconTypeContent.matchAll(/default as (\w+)/g)].reduce(
48
+ (memo, cur) => {
49
+ memo[cur[1]] = true;
50
+ return memo;
51
+ },
52
+ {}
53
+ );
54
+ };
55
+ var allIcons = getAllIcons();
38
56
  var layout_default = (api) => {
39
57
  let antdVersion = "4.0.0";
40
58
  try {
@@ -342,9 +360,6 @@ export interface IRuntimeConfig {
342
360
  return memo;
343
361
  }, {});
344
362
  const icons = Object.keys(iconsMap);
345
- const antIconsPath = (0, import_plugin_utils.winPath)(
346
- (0, import_path.dirname)(require.resolve("@ant-design/icons/package"))
347
- );
348
363
  api.writeTmpFile({
349
364
  path: "icons.tsx",
350
365
  content: `
@@ -403,7 +418,6 @@ export function getRightRenderContent (opts: {
403
418
  );
404
419
  }
405
420
 
406
-
407
421
 
408
422
  const avatar = (
409
423
  <span className="umi-plugin-layout-action">
@@ -446,12 +460,11 @@ export function getRightRenderContent (opts: {
446
460
  },
447
461
  ],
448
462
  };
449
-
450
463
  // antd@5 和 4.24 之后推荐使用 menu,性能更好
451
464
  const dropdownProps =
452
465
  version.startsWith("5.") || version.startsWith("4.24.")
453
466
  ? { menu: langMenu }
454
- : { overlay: <Menu {...langMenu} /> };
467
+ : { overlay: <Menu {...langMenu} /> };
455
468
 
456
469
  return (
457
470
  <div className="umi-plugin-layout-right anticon">
@@ -479,7 +492,8 @@ export function getRightRenderContent (opts: {
479
492
  api.writeTmpFile({
480
493
  path: "Layout.less",
481
494
  content: `
482
- ${antdVersion.startsWith("5") ? "" : "@import '~antd/es/style/themes/default.less';"}
495
+ ${// antd@5里面没有这个样式了
496
+ antdVersion.startsWith("5") ? "" : "@import '~antd/es/style/themes/default.less';"}
483
497
  @media screen and (max-width: 480px) {
484
498
  // 在小屏幕的时候可以有更好的体验
485
499
  .umi-plugin-layout-container {
package/dist/locale.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
package/dist/mf.js CHANGED
@@ -109,6 +109,7 @@ function mf(api) {
109
109
  });
110
110
  api.onGenerateFiles(() => {
111
111
  api.writeTmpFile({
112
+ // ref https://webpack.js.org/concepts/module-federation/#infer-publicpath-from-script
112
113
  content: `/* infer remote public */;
113
114
  __webpack_public_path__ = document.currentScript.src + '/../';`,
114
115
  path: mfSetupPathFileName
package/dist/model.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -38,6 +42,7 @@ var moment2dayjs_default = (api) => {
38
42
  return Joi.alternatives().try(
39
43
  Joi.object({
40
44
  preset: Joi.string(),
45
+ // 'antd' | 'antdv3 | 'none'
41
46
  plugins: Joi.array()
42
47
  }),
43
48
  Joi.boolean().invalid(true)
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -130,6 +134,7 @@ export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts
130
134
  });
131
135
  api.writeTmpFile({
132
136
  path: "MicroAppLoader.tsx",
137
+ // 开启了 antd 插件的时候,使用 antd 的 loader 组件,否则提示用户必须设置一个自定义的 loader 组件
133
138
  content: api.isPluginEnable("antd") ? getFileContent("AntdLoader.tsx") : `export default function Loader() { console.warn(\`[plugins/qiankun]: Seems like you'r not using @umijs/plugin-antd, you need to provide a custom loader or set autoSetLoading false to shut down this warning!\`); return null; }`
134
139
  });
135
140
  [
@@ -150,6 +155,8 @@ export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts
150
155
  context: {
151
156
  dynamicRoot: false,
152
157
  hasModelPlugin: api.isPluginEnable("model")
158
+ // dynamicRoot:
159
+ // api.config.exportStatic && api.config.exportStatic.dynamicRoot,
153
160
  }
154
161
  });
155
162
  } else {
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -51,7 +55,7 @@ function handleOriginalHtml(api, microAppEntry, originalHtml) {
51
55
  );
52
56
  const $ = import_utils.cheerio.load(originalHtml);
53
57
  $("head").prepend(
54
- `<script>window.__QIANKUN_DEVELOPMENT__=true<\/script>
58
+ `<script>window.__QIANKUN_DEVELOPMENT__=true</script>
55
59
  <script type="extra-qiankun-config">${JSON.stringify({
56
60
  master: {
57
61
  apps: [
@@ -71,7 +75,7 @@ function handleOriginalHtml(api, microAppEntry, originalHtml) {
71
75
  ],
72
76
  prefetch: false
73
77
  }
74
- })}<\/script>`
78
+ })}</script>`
75
79
  );
76
80
  return api.applyPlugins({
77
81
  key: "modifyMasterHTML",
@@ -139,6 +143,7 @@ export interface IRuntimeConfig {
139
143
  };
140
144
  const modifiedDefaultConfig = {
141
145
  ...memo,
146
+ // 默认开启 runtimePublicPath,避免出现 dynamic import 场景子应用资源地址出问题
142
147
  runtimePublicPath: true,
143
148
  qiankun: {
144
149
  ...memo.qiankun,
package/dist/qiankun.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
package/dist/request.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -345,7 +349,9 @@ export type {
345
349
  AxiosResponse,
346
350
  AxiosError,
347
351
  RequestError,
348
- ResponseInterceptor } from './request';
352
+ ResponseInterceptor,
353
+ RequestOptions,
354
+ Request } from './request';
349
355
  `
350
356
  });
351
357
  api.writeTmpFile({
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -91,6 +91,8 @@ var getLocaleList = async (opts) => {
91
91
  return {
92
92
  lang,
93
93
  name,
94
+ // react-intl Function.supportedLocalesOf
95
+ // Uncaught RangeError: Incorrect locale information provided
94
96
  locale: name.split(separator).join("-"),
95
97
  country,
96
98
  antdLocale,
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -210,6 +214,7 @@ ${modelProps.join("\n")}
210
214
  }
211
215
  };
212
216
  var ModelUtils = _ModelUtils;
217
+ // https://github.com/umijs/umi/issues/9837
213
218
  ModelUtils.topologicalSort = (models) => {
214
219
  const graph = [];
215
220
  const namespaceToNode = {};
package/dist/valtio.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.51",
3
+ "version": "4.0.52",
4
4
  "description": "@umijs/plugins",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/plugins#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -29,7 +29,7 @@
29
29
  "@ant-design/pro-components": "^2.0.1",
30
30
  "@tanstack/react-query": "^4.22.0",
31
31
  "@tanstack/react-query-devtools": "^4.22.0",
32
- "@umijs/bundler-utils": "4.0.51",
32
+ "@umijs/bundler-utils": "4.0.52",
33
33
  "@umijs/valtio": "^1.0.3",
34
34
  "antd-dayjs-webpack-plugin": "^1.0.6",
35
35
  "axios": "^0.27.2",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "antd": "^4.24.1",
56
- "umi": "4.0.51"
56
+ "umi": "4.0.52"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"