@umijs/preset-umi 4.3.4 → 4.3.5
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.
|
@@ -326,10 +326,14 @@ interface IUmiIconProps extends React.SVGAttributes<SVGElement> {
|
|
|
326
326
|
flip?: 'vertical' | 'horizontal' | 'horizontal,vertical' | 'vertical,horizontal';
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
+
export const getIconComponent = (icon: Pick<IUmiIconProps, 'icon'>) => {
|
|
330
|
+
const iconName = normalizeIconName(alias[icon] || icon);
|
|
331
|
+
return iconsMap[iconName];
|
|
332
|
+
}
|
|
333
|
+
|
|
329
334
|
export const Icon = React.forwardRef<HTMLSpanElement, IUmiIconProps>((props, ref) => {
|
|
330
335
|
const { icon, hover, style, className = '' , rotate, spin, flip, ...extraProps } = props;
|
|
331
|
-
const
|
|
332
|
-
const Component = iconsMap[iconName];
|
|
336
|
+
const Component = getIconComponent(icon);
|
|
333
337
|
if (!Component) {
|
|
334
338
|
// TODO: give a error icon when dev, to help developer find the error
|
|
335
339
|
return null;
|
|
@@ -53,6 +53,7 @@ var tmpFiles_default = (api) => {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
+
const TSCONFIG_FILE_NAME = "tsconfig.json";
|
|
56
57
|
api.onGenerateFiles(async (opts) => {
|
|
57
58
|
var _a, _b, _c, _d;
|
|
58
59
|
const rendererPath = (0, import_utils.winPath)(
|
|
@@ -75,6 +76,10 @@ var tmpFiles_default = (api) => {
|
|
|
75
76
|
const baseUrl = api.appData.hasSrcDir ? "../../" : "../";
|
|
76
77
|
const isTs5 = (_a = api.appData.typescript.tsVersion) == null ? void 0 : _a.startsWith("5");
|
|
77
78
|
const isTslibInstalled = !!api.appData.typescript.tslibVersion;
|
|
79
|
+
const tsconfigFilePath = (0, import_path.join)(api.paths.absTmpPath, TSCONFIG_FILE_NAME);
|
|
80
|
+
const relativeUmiDirPath = (0, import_utils.winPath)(
|
|
81
|
+
(0, import_path.relative)((0, import_path.dirname)(tsconfigFilePath), umiDir)
|
|
82
|
+
);
|
|
78
83
|
let umiTsConfig = {
|
|
79
84
|
compilerOptions: {
|
|
80
85
|
target: "esnext",
|
|
@@ -101,7 +106,7 @@ var tmpFiles_default = (api) => {
|
|
|
101
106
|
paths: {
|
|
102
107
|
"@/*": [`${srcPrefix}*`],
|
|
103
108
|
"@@/*": [`${umiTempDir}/*`],
|
|
104
|
-
[`${api.appData.umi.importSource}`]: [
|
|
109
|
+
[`${api.appData.umi.importSource}`]: [relativeUmiDirPath],
|
|
105
110
|
[`${api.appData.umi.importSource}/typings`]: [
|
|
106
111
|
`${umiTempDir}/typings`
|
|
107
112
|
],
|
|
@@ -126,7 +131,7 @@ var tmpFiles_default = (api) => {
|
|
|
126
131
|
});
|
|
127
132
|
api.writeTmpFile({
|
|
128
133
|
noPluginDir: true,
|
|
129
|
-
path:
|
|
134
|
+
path: TSCONFIG_FILE_NAME,
|
|
130
135
|
content: JSON.stringify(umiTsConfig, null, 2)
|
|
131
136
|
});
|
|
132
137
|
api.writeTmpFile({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.5",
|
|
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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@iconify/utils": "2.1.1",
|
|
23
23
|
"@svgr/core": "6.5.1",
|
|
24
|
-
"@umijs/bundler-mako": "0.7.6-
|
|
24
|
+
"@umijs/bundler-mako": "0.7.6-canary.20240712.1",
|
|
25
25
|
"@umijs/es-module-parser": "0.0.7",
|
|
26
26
|
"@umijs/history": "5.3.1",
|
|
27
27
|
"babel-plugin-dynamic-import-node": "2.3.3",
|
|
@@ -41,21 +41,21 @@
|
|
|
41
41
|
"react-router": "6.3.0",
|
|
42
42
|
"react-router-dom": "6.3.0",
|
|
43
43
|
"regenerator-runtime": "0.13.11",
|
|
44
|
-
"@umijs/ast": "4.3.
|
|
45
|
-
"@umijs/bundler-esbuild": "4.3.
|
|
46
|
-
"@umijs/
|
|
47
|
-
"@umijs/bundler-
|
|
48
|
-
"@umijs/bundler-
|
|
49
|
-
"@umijs/
|
|
50
|
-
"@umijs/
|
|
51
|
-
"@umijs/
|
|
52
|
-
"@umijs/
|
|
53
|
-
"@umijs/
|
|
54
|
-
"@umijs/
|
|
55
|
-
"@umijs/
|
|
44
|
+
"@umijs/ast": "4.3.5",
|
|
45
|
+
"@umijs/bundler-esbuild": "4.3.5",
|
|
46
|
+
"@umijs/bundler-utils": "4.3.5",
|
|
47
|
+
"@umijs/bundler-vite": "4.3.5",
|
|
48
|
+
"@umijs/bundler-webpack": "4.3.5",
|
|
49
|
+
"@umijs/core": "4.3.5",
|
|
50
|
+
"@umijs/mfsu": "4.3.5",
|
|
51
|
+
"@umijs/plugin-run": "4.3.5",
|
|
52
|
+
"@umijs/renderer-react": "4.3.5",
|
|
53
|
+
"@umijs/server": "4.3.5",
|
|
54
|
+
"@umijs/utils": "4.3.5",
|
|
55
|
+
"@umijs/babel-preset-umi": "4.3.5",
|
|
56
|
+
"@umijs/zod2ts": "4.3.5",
|
|
56
57
|
"@umijs/ui": "3.0.1",
|
|
57
|
-
"@umijs/
|
|
58
|
-
"@umijs/zod2ts": "4.3.4"
|
|
58
|
+
"@umijs/did-you-know": "1.0.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@manypkg/get-packages": "1.1.3",
|