@umijs/plugins 4.0.0-canary.20241107.1 → 4.0.0-canary.20250918.1
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/model.js +6 -1
- package/dist/styled-components.js +1 -1
- package/dist/tailwindcss.js +3 -3
- package/dist/unocss.js +12 -3
- package/package.json +3 -3
package/dist/model.js
CHANGED
|
@@ -43,14 +43,19 @@ var model_default = (api) => {
|
|
|
43
43
|
config: {
|
|
44
44
|
schema({ zod }) {
|
|
45
45
|
return zod.object({
|
|
46
|
-
extraModels: zod.array(zod.string())
|
|
46
|
+
extraModels: zod.array(zod.string()),
|
|
47
|
+
sort: zod.function().optional()
|
|
47
48
|
}).partial();
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
enableBy: api.EnableBy.config
|
|
51
52
|
});
|
|
52
53
|
api.onGenerateFiles(async () => {
|
|
54
|
+
var _a;
|
|
53
55
|
const models = await getAllModels(api);
|
|
56
|
+
if ((_a = api.userConfig.model) == null ? void 0 : _a.sort) {
|
|
57
|
+
models.sort(api.userConfig.model.sort);
|
|
58
|
+
}
|
|
54
59
|
api.writeTmpFile({
|
|
55
60
|
path: "model.ts",
|
|
56
61
|
content: import_modelUtils.ModelUtils.getModelsContent(models)
|
|
@@ -50,7 +50,7 @@ var styled_components_default = (api) => {
|
|
|
50
50
|
});
|
|
51
51
|
api.modifyConfig((memo) => {
|
|
52
52
|
var _a, _b;
|
|
53
|
-
if (api.userConfig.mako || process.env.OKAM) {
|
|
53
|
+
if (api.userConfig.mako || process.env.OKAM || api.userConfig.utoopack) {
|
|
54
54
|
return memo;
|
|
55
55
|
}
|
|
56
56
|
const isProd = api.env === "production";
|
package/dist/tailwindcss.js
CHANGED
|
@@ -26,7 +26,7 @@ var import_fs = require("fs");
|
|
|
26
26
|
var import_path = require("path");
|
|
27
27
|
var import_plugin_utils = require("umi/plugin-utils");
|
|
28
28
|
var CHECK_INTERVAL = 300;
|
|
29
|
-
var
|
|
29
|
+
var CHECK_TIMEOUT = process.env.CHECK_TIMEOUT ? parseInt(process.env.CHECK_TIMEOUT, 10) : 5;
|
|
30
30
|
var tailwindcss_default = (api) => {
|
|
31
31
|
api.describe({
|
|
32
32
|
key: "tailwindcss",
|
|
@@ -84,11 +84,11 @@ var tailwindcss_default = (api) => {
|
|
|
84
84
|
if (!(0, import_fs.existsSync)(generatedPath)) {
|
|
85
85
|
clearInterval(timer);
|
|
86
86
|
api.logger.error(
|
|
87
|
-
`tailwindcss generate failed after ${
|
|
87
|
+
`tailwindcss generate failed after ${CHECK_TIMEOUT} seconds, please check your tailwind.css and tailwind.config.js`
|
|
88
88
|
);
|
|
89
89
|
process.exit(1);
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, CHECK_TIMEOUT * 1e3);
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
});
|
package/dist/unocss.js
CHANGED
|
@@ -40,8 +40,7 @@ var unocss_default = (api) => {
|
|
|
40
40
|
});
|
|
41
41
|
const outputPath = "uno.css";
|
|
42
42
|
api.onBeforeCompiler(async () => {
|
|
43
|
-
if (process.env.IS_UMI_BUILD_WORKER)
|
|
44
|
-
return;
|
|
43
|
+
if (process.env.IS_UMI_BUILD_WORKER) return;
|
|
45
44
|
if (!(0, import_fs.existsSync)((0, import_path.join)(api.paths.cwd, "unocss.config.ts")))
|
|
46
45
|
api.logger.warn(
|
|
47
46
|
"请在项目目录中添加 unocss.config.ts 文件,并配置需要的 unocss presets,否则插件将没有效果!"
|
|
@@ -60,7 +59,17 @@ var unocss_default = (api) => {
|
|
|
60
59
|
cwd: api.cwd,
|
|
61
60
|
stdio: isDev ? "pipe" : "inherit"
|
|
62
61
|
});
|
|
63
|
-
if (
|
|
62
|
+
if (isDev) {
|
|
63
|
+
await new Promise((resolve) => {
|
|
64
|
+
const { stdout } = execaRes;
|
|
65
|
+
function dataHandler() {
|
|
66
|
+
resolve();
|
|
67
|
+
stdout == null ? void 0 : stdout.off("data", dataHandler);
|
|
68
|
+
}
|
|
69
|
+
stdout == null ? void 0 : stdout.on("data", dataHandler);
|
|
70
|
+
});
|
|
71
|
+
api.logger.info("unocss watch mode is running!");
|
|
72
|
+
} else {
|
|
64
73
|
await execaRes;
|
|
65
74
|
}
|
|
66
75
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/plugins",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.20250918.1",
|
|
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",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"styled-components": "6.1.1",
|
|
46
46
|
"tslib": "^2",
|
|
47
47
|
"warning": "^4.0.3",
|
|
48
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
48
|
+
"@umijs/bundler-utils": "4.0.0-canary.20250918.1",
|
|
49
49
|
"@umijs/valtio": "1.0.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"antd": "^4.24.1",
|
|
53
|
-
"umi": "4.0.0-canary.
|
|
53
|
+
"umi": "4.0.0-canary.20250918.1"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|