@umijs/plugins 4.0.16 → 4.0.19
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/layout.js +15 -10
- package/dist/qiankun/slave.js +17 -29
- package/dist/tailwindcss.js +8 -1
- package/package.json +4 -4
package/dist/layout.js
CHANGED
|
@@ -53,7 +53,11 @@ var layout_default = (api) => {
|
|
|
53
53
|
},
|
|
54
54
|
enableBy: api.EnableBy.config
|
|
55
55
|
});
|
|
56
|
-
const depList = [
|
|
56
|
+
const depList = [
|
|
57
|
+
"@alipay/tech-ui",
|
|
58
|
+
"@ant-design/pro-components",
|
|
59
|
+
"@ant-design/pro-layout"
|
|
60
|
+
];
|
|
57
61
|
const pkgHasDep = depList.find((dep) => {
|
|
58
62
|
var _a, _b;
|
|
59
63
|
const { pkg } = api;
|
|
@@ -70,7 +74,7 @@ var layout_default = (api) => {
|
|
|
70
74
|
if (pkgHasDep && api.cwd !== cwd && (0, import_fs.existsSync)((0, import_path.join)(cwd, "node_modules", pkgHasDep, "package.json"))) {
|
|
71
75
|
return (0, import_path.join)(cwd, "node_modules", pkgHasDep);
|
|
72
76
|
}
|
|
73
|
-
return (0, import_path.dirname)(require.resolve("@ant-design/pro-
|
|
77
|
+
return (0, import_path.dirname)(require.resolve("@ant-design/pro-components/package.json"));
|
|
74
78
|
};
|
|
75
79
|
const pkgPath = (0, import_plugin_utils.winPath)(getPkgPath());
|
|
76
80
|
api.modifyAppData((memo) => {
|
|
@@ -83,7 +87,8 @@ var layout_default = (api) => {
|
|
|
83
87
|
});
|
|
84
88
|
api.modifyConfig((memo) => {
|
|
85
89
|
if (!pkgHasDep) {
|
|
86
|
-
|
|
90
|
+
const name = require(`${pkgPath}/package.json`).name;
|
|
91
|
+
memo.alias[name] = pkgPath;
|
|
87
92
|
}
|
|
88
93
|
return memo;
|
|
89
94
|
});
|
|
@@ -97,7 +102,7 @@ import type { IRoute } from 'umi';
|
|
|
97
102
|
import React, { useMemo } from 'react';
|
|
98
103
|
import {
|
|
99
104
|
ProLayout,
|
|
100
|
-
} from "${pkgPath || "@ant-design/pro-
|
|
105
|
+
} from "${pkgPath || "@ant-design/pro-components"}";
|
|
101
106
|
import './Layout.less';
|
|
102
107
|
import Logo from './Logo';
|
|
103
108
|
import Exception from './Exception';
|
|
@@ -210,6 +215,7 @@ const { formatMessage } = useIntl();
|
|
|
210
215
|
}
|
|
211
216
|
return defaultDom;
|
|
212
217
|
}}
|
|
218
|
+
itemRender={(route) => <Link to={route.path}>{route.breadcrumbName}</Link>}
|
|
213
219
|
disableContentMargin
|
|
214
220
|
fixSiderbar
|
|
215
221
|
fixedHeader
|
|
@@ -259,7 +265,7 @@ const { formatMessage } = useIntl();
|
|
|
259
265
|
api.writeTmpFile({
|
|
260
266
|
path: "types.d.ts",
|
|
261
267
|
content: `
|
|
262
|
-
import type { ProLayoutProps, HeaderProps } from "${pkgPath || "@ant-design/pro-
|
|
268
|
+
import type { ProLayoutProps, HeaderProps } from "${pkgPath || "@ant-design/pro-components"}";
|
|
263
269
|
${hasInitialStatePlugin ? `import type InitialStateType from '@@/plugin-initialState/@@initialState';
|
|
264
270
|
type InitDataType = ReturnType<typeof InitialStateType>;
|
|
265
271
|
` : "type InitDataType = any;"}
|
|
@@ -439,8 +445,7 @@ export function getRightRenderContent (opts: {
|
|
|
439
445
|
path: "Layout.less",
|
|
440
446
|
content: `
|
|
441
447
|
${antdVersion.startsWith("5") ? "" : "@import '~antd/es/style/themes/default.less';"}
|
|
442
|
-
@
|
|
443
|
-
@media screen and (max-width: @screen-xs) {
|
|
448
|
+
@media screen and (max-width: 480px) {
|
|
444
449
|
// \u5728\u5C0F\u5C4F\u5E55\u7684\u65F6\u5019\u53EF\u4EE5\u6709\u66F4\u597D\u7684\u4F53\u9A8C
|
|
445
450
|
.umi-plugin-layout-container {
|
|
446
451
|
width: 100% !important;
|
|
@@ -471,14 +476,14 @@ ${antdVersion.startsWith("5") ? "" : "@import '~antd/es/style/themes/default.les
|
|
|
471
476
|
cursor: pointer;
|
|
472
477
|
transition: all 0.3s;
|
|
473
478
|
> i {
|
|
474
|
-
color:
|
|
479
|
+
color: rgba(255, 255, 255, 0.85);
|
|
475
480
|
vertical-align: middle;
|
|
476
481
|
}
|
|
477
482
|
&:hover {
|
|
478
|
-
background:
|
|
483
|
+
background: rgba(0, 0, 0, 0.025);
|
|
479
484
|
}
|
|
480
485
|
&:global(.opened) {
|
|
481
|
-
background:
|
|
486
|
+
background: rgba(0, 0, 0, 0.025);
|
|
482
487
|
}
|
|
483
488
|
}
|
|
484
489
|
.umi-plugin-layout-search {
|
package/dist/qiankun/slave.js
CHANGED
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
7
|
var __export = (target, all) => {
|
|
25
8
|
for (var name in all)
|
|
26
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -42,7 +25,7 @@ __export(slave_exports, {
|
|
|
42
25
|
default: () => slave_default
|
|
43
26
|
});
|
|
44
27
|
module.exports = __toCommonJS(slave_exports);
|
|
45
|
-
var import_http_proxy_middleware = require("@umijs/bundler-
|
|
28
|
+
var import_http_proxy_middleware = require("@umijs/bundler-utils/compiled/http-proxy-middleware");
|
|
46
29
|
var import_utils = require("@umijs/utils");
|
|
47
30
|
var import_assert = __toESM(require("assert"));
|
|
48
31
|
var import_fs = require("fs");
|
|
@@ -140,15 +123,19 @@ export interface IRuntimeConfig {
|
|
|
140
123
|
});
|
|
141
124
|
api.modifyDefaultConfig((memo) => {
|
|
142
125
|
var _a, _b, _c;
|
|
143
|
-
const initialSlaveOptions =
|
|
144
|
-
devSourceMap: true
|
|
145
|
-
|
|
146
|
-
|
|
126
|
+
const initialSlaveOptions = {
|
|
127
|
+
devSourceMap: true,
|
|
128
|
+
...JSON.parse(process.env.INITIAL_QIANKUN_SLAVE_OPTIONS || "{}"),
|
|
129
|
+
...(memo.qiankun || {}).slave
|
|
130
|
+
};
|
|
131
|
+
const modifiedDefaultConfig = {
|
|
132
|
+
...memo,
|
|
147
133
|
runtimePublicPath: true,
|
|
148
|
-
qiankun:
|
|
134
|
+
qiankun: {
|
|
135
|
+
...memo.qiankun,
|
|
149
136
|
slave: initialSlaveOptions
|
|
150
|
-
}
|
|
151
|
-
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
152
139
|
const shouldNotModifyDefaultBase = ((_b = (_a = api.userConfig.qiankun) == null ? void 0 : _a.slave) == null ? void 0 : _b.shouldNotModifyDefaultBase) ?? initialSlaveOptions.shouldNotModifyDefaultBase;
|
|
153
140
|
const historyType = ((_c = api.userConfig.history) == null ? void 0 : _c.type) || "browser";
|
|
154
141
|
if (!shouldNotModifyDefaultBase && historyType !== "hash") {
|
|
@@ -159,9 +146,10 @@ export interface IRuntimeConfig {
|
|
|
159
146
|
api.modifyConfig((config) => {
|
|
160
147
|
var _a, _b;
|
|
161
148
|
if (config.mfsu !== false) {
|
|
162
|
-
config.mfsu =
|
|
149
|
+
config.mfsu = {
|
|
150
|
+
...config.mfsu,
|
|
163
151
|
mfName: ((_a = config.mfsu) == null ? void 0 : _a.mfName) || `mf_${(_b = api.pkg.name) == null ? void 0 : _b.replace(/^@/, "").replace(/\W/g, "_")}`
|
|
164
|
-
}
|
|
152
|
+
};
|
|
165
153
|
}
|
|
166
154
|
return config;
|
|
167
155
|
});
|
|
@@ -234,10 +222,10 @@ export { connectMaster } from './connectMaster';
|
|
|
234
222
|
});
|
|
235
223
|
api.addMiddlewares(async () => {
|
|
236
224
|
return async (req, res, next) => {
|
|
237
|
-
var _a;
|
|
225
|
+
var _a, _b;
|
|
238
226
|
const qiankunConfig = api.config.qiankun || {};
|
|
239
227
|
const masterEntry = (_a = qiankunConfig.slave) == null ? void 0 : _a.masterEntry;
|
|
240
|
-
const isMasterApp = qiankunConfig.master.enable;
|
|
228
|
+
const isMasterApp = (_b = qiankunConfig.master) == null ? void 0 : _b.enable;
|
|
241
229
|
const { proxyToMasterEnabled } = await api.applyPlugins({
|
|
242
230
|
key: "shouldProxyToMaster",
|
|
243
231
|
type: api.ApplyPluginsType.modify,
|
package/dist/tailwindcss.js
CHANGED
|
@@ -39,7 +39,7 @@ var tailwindcss_default = (api) => {
|
|
|
39
39
|
api.onBeforeCompiler(() => {
|
|
40
40
|
const inputPath = (0, import_path.join)(api.cwd, "tailwind.css");
|
|
41
41
|
const generatedPath = (0, import_path.join)(api.paths.absTmpPath, outputPath);
|
|
42
|
-
const binPath = (
|
|
42
|
+
const binPath = getTailwindBinPath({ cwd: api.cwd });
|
|
43
43
|
const configPath = (0, import_path.join)(process.env.APP_ROOT || api.cwd, "tailwind.config.js");
|
|
44
44
|
return new Promise((resolve) => {
|
|
45
45
|
tailwind = (0, import_plugin_utils.crossSpawn)(`${binPath}`, [
|
|
@@ -73,5 +73,12 @@ var tailwindcss_default = (api) => {
|
|
|
73
73
|
return [{ source: generatedPath }];
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
+
function getTailwindBinPath(opts) {
|
|
77
|
+
const pkgPath = require.resolve("tailwindcss/package.json", {
|
|
78
|
+
paths: [opts.cwd]
|
|
79
|
+
});
|
|
80
|
+
const tailwindPath = require(pkgPath).bin["tailwind"];
|
|
81
|
+
return (0, import_path.join)((0, import_path.dirname)(pkgPath), tailwindPath);
|
|
82
|
+
}
|
|
76
83
|
// Annotate the CommonJS export names for ESM import in node:
|
|
77
84
|
0 && (module.exports = {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/plugins",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.19",
|
|
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",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@ahooksjs/use-request": "^2.0.0",
|
|
27
27
|
"@ant-design/antd-theme-variable": "^1.0.0",
|
|
28
28
|
"@ant-design/icons": "^4.7.0",
|
|
29
|
-
"@ant-design/pro-
|
|
30
|
-
"@umijs/bundler-utils": "4.0.
|
|
29
|
+
"@ant-design/pro-components": "^2.0.1",
|
|
30
|
+
"@umijs/bundler-utils": "4.0.19",
|
|
31
31
|
"antd-dayjs-webpack-plugin": "^1.0.6",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"babel-plugin-import": "^1.13.5",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"warning": "^4.0.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"umi": "4.0.
|
|
49
|
+
"umi": "4.0.19"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|