@umijs/preset-umi 4.0.70 → 4.0.71

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.
@@ -130,6 +130,9 @@ umi build --clean
130
130
  let stats;
131
131
  if (api.config.vite) {
132
132
  stats = await bundlerVite.build(opts);
133
+ } else if (process.env.OKAM) {
134
+ const { build } = require(process.env.OKAM);
135
+ stats = await build(opts);
133
136
  } else {
134
137
  const absOutputPath = (0, import_path.resolve)(
135
138
  opts.cwd,
@@ -43,9 +43,9 @@ var prettier_default = (api) => {
43
43
  fn: async () => {
44
44
  const h = new import_utils2.GeneratorHelper(api);
45
45
  h.addDevDeps({
46
- prettier: "^2",
47
- "prettier-plugin-organize-imports": "^2",
48
- "prettier-plugin-packagejson": "^2"
46
+ prettier: "^2.8.8",
47
+ "prettier-plugin-organize-imports": "^3.2.2",
48
+ "prettier-plugin-packagejson": "^2.4.3"
49
49
  });
50
50
  (0, import_fs.writeFileSync)(
51
51
  (0, import_path.join)(api.cwd, ".prettierrc"),
@@ -98,6 +98,8 @@ var esbuildHelperChecker_default = (api) => {
98
98
  }
99
99
  });
100
100
  api.onBuildComplete(async ({ err }) => {
101
+ if (process.env.OKAM)
102
+ return;
101
103
  if (err)
102
104
  return;
103
105
  const jsMinifier = api.config.jsMinifier || "esbuild";
@@ -323,7 +323,7 @@ interface IUmiIconProps extends React.SVGAttributes<SVGElement> {
323
323
  }
324
324
 
325
325
  export const Icon = React.forwardRef<HTMLSpanElement, IUmiIconProps>((props, ref) => {
326
- const { icon, hover, style, className = '' , rotate, flip, ...extraProps } = props;
326
+ const { icon, hover, style, className = '' , rotate, spin, flip, ...extraProps } = props;
327
327
  const iconName = normalizeIconName(alias[icon] || icon);
328
328
  const Component = iconsMap[iconName];
329
329
  if (!Component) {
@@ -331,7 +331,7 @@ export const Icon = React.forwardRef<HTMLSpanElement, IUmiIconProps>((props, ref
331
331
  return null;
332
332
  }
333
333
  const HoverComponent = hover ? iconsMap[normalizeIconName(alias[hover] || hover)] : null;
334
- const cls = props.spin ? 'umiIconLoadingCircle' : undefined;
334
+ const cls = spin ? 'umiIconLoadingCircle' : undefined;
335
335
  const svgStyle = {};
336
336
  const transform: string[] = [];
337
337
  if (rotate) {
@@ -475,13 +475,15 @@ if (process.env.NODE_ENV === 'development') {
475
475
  });
476
476
  }
477
477
  if (api.appData.framework === "react") {
478
- const historyPath = api.config.historyWithQuery ? (0, import_utils.winPath)((0, import_path.dirname)(require.resolve("@umijs/history/package.json"))) : rendererPath;
478
+ const { historyWithQuery, reactRouter5Compat } = api.config;
479
+ const historyPath = historyWithQuery ? (0, import_utils.winPath)((0, import_path.dirname)(require.resolve("@umijs/history/package.json"))) : rendererPath;
479
480
  api.writeTmpFile({
480
481
  noPluginDir: true,
481
482
  path: "core/history.ts",
482
483
  tplPath: (0, import_path.join)(import_constants.TEMPLATES_DIR, "history.tpl"),
483
484
  context: {
484
- historyPath
485
+ historyPath,
486
+ reactRouter5Compat
485
487
  }
486
488
  });
487
489
  api.writeTmpFile({
@@ -489,7 +491,8 @@ if (process.env.NODE_ENV === 'development') {
489
491
  path: "core/historyIntelli.ts",
490
492
  tplPath: (0, import_path.join)(import_constants.TEMPLATES_DIR, "historyIntelli.tpl"),
491
493
  context: {
492
- historyPath
494
+ historyPath,
495
+ reactRouter5Compat
493
496
  }
494
497
  });
495
498
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.0.70",
3
+ "version": "4.0.71",
4
4
  "description": "@umijs/preset-umi",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/preset-umi#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -37,21 +37,21 @@
37
37
  "react-router": "6.3.0",
38
38
  "react-router-dom": "6.3.0",
39
39
  "regenerator-runtime": "0.13.11",
40
- "@umijs/babel-preset-umi": "4.0.70",
41
- "@umijs/ast": "4.0.70",
42
- "@umijs/bundler-utils": "4.0.70",
43
- "@umijs/bundler-esbuild": "4.0.70",
44
- "@umijs/bundler-webpack": "4.0.70",
45
- "@umijs/bundler-vite": "4.0.70",
46
- "@umijs/core": "4.0.70",
40
+ "@umijs/bundler-esbuild": "4.0.71",
41
+ "@umijs/bundler-utils": "4.0.71",
42
+ "@umijs/ast": "4.0.71",
43
+ "@umijs/bundler-vite": "4.0.71",
44
+ "@umijs/babel-preset-umi": "4.0.71",
45
+ "@umijs/bundler-webpack": "4.0.71",
46
+ "@umijs/core": "4.0.71",
47
47
  "@umijs/did-you-know": "1.0.3",
48
- "@umijs/plugin-run": "4.0.70",
49
- "@umijs/mfsu": "4.0.70",
50
- "@umijs/renderer-react": "4.0.70",
51
- "@umijs/server": "4.0.70",
52
- "@umijs/ui": "3.0.1",
53
- "@umijs/utils": "4.0.70",
54
- "@umijs/zod2ts": "4.0.70"
48
+ "@umijs/mfsu": "4.0.71",
49
+ "@umijs/plugin-run": "4.0.71",
50
+ "@umijs/renderer-react": "4.0.71",
51
+ "@umijs/server": "4.0.71",
52
+ "@umijs/utils": "4.0.71",
53
+ "@umijs/zod2ts": "4.0.71",
54
+ "@umijs/ui": "3.0.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@manypkg/get-packages": "1.1.3",
@@ -16,6 +16,12 @@ export function createHistory(opts: any) {
16
16
  basename = opts.basename;
17
17
  }
18
18
 
19
+ {{#reactRouter5Compat}}
20
+ h.goBack = function() {
21
+ h.back();
22
+ };
23
+ {{/reactRouter5Compat}}
24
+
19
25
  history = {
20
26
  ...h,
21
27
  push(to, state) {
@@ -71,9 +71,17 @@ type UmiTo = UmiPathname | UmiPath
71
71
 
72
72
  type UmiPush = (to: UmiTo, state?: any) => void
73
73
  type UmiReplace = (to: UmiTo, state?: any) => void
74
+ {{#reactRouter5Compat}}
75
+ type UmiGoBack = () => void
76
+ {{/reactRouter5Compat}}
77
+
78
+
74
79
  export interface UmiHistory extends History {
75
80
  push: UmiPush
76
81
  replace: UmiReplace
82
+ {{#reactRouter5Compat}}
83
+ goBack: UmiGoBack
84
+ {{/reactRouter5Compat}}
77
85
  }
78
86
 
79
87
  // --- type utils ---