@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.
- package/dist/commands/build.js +3 -0
- package/dist/commands/generators/prettier.js +3 -3
- package/dist/features/esbuildHelperChecker/esbuildHelperChecker.js +2 -0
- package/dist/features/icons/icons.js +2 -2
- package/dist/features/tmpFiles/tmpFiles.js +6 -3
- package/package.json +15 -15
- package/templates/history.tpl +6 -0
- package/templates/historyIntelli.tpl +8 -0
package/dist/commands/build.js
CHANGED
|
@@ -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"),
|
|
@@ -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 =
|
|
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
|
|
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.
|
|
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/
|
|
41
|
-
"@umijs/
|
|
42
|
-
"@umijs/
|
|
43
|
-
"@umijs/bundler-
|
|
44
|
-
"@umijs/
|
|
45
|
-
"@umijs/bundler-
|
|
46
|
-
"@umijs/core": "4.0.
|
|
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/
|
|
49
|
-
"@umijs/
|
|
50
|
-
"@umijs/renderer-react": "4.0.
|
|
51
|
-
"@umijs/server": "4.0.
|
|
52
|
-
"@umijs/
|
|
53
|
-
"@umijs/
|
|
54
|
-
"@umijs/
|
|
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",
|
package/templates/history.tpl
CHANGED
|
@@ -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 ---
|