@umijs/plugins 4.0.50 → 4.0.51
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/confetti.d.ts +3 -0
- package/dist/confetti.js +66 -0
- package/dist/mf.js +75 -0
- package/package.json +3 -3
package/dist/confetti.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/confetti.ts
|
|
20
|
+
var confetti_exports = {};
|
|
21
|
+
__export(confetti_exports, {
|
|
22
|
+
default: () => confetti_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(confetti_exports);
|
|
25
|
+
var import_plugin_utils = require("umi/plugin-utils");
|
|
26
|
+
var handleConfetti = () => {
|
|
27
|
+
const confettiShell = `
|
|
28
|
+
open raycast://confetti;
|
|
29
|
+
exit;
|
|
30
|
+
`;
|
|
31
|
+
const confetti = (0, import_plugin_utils.crossSpawn)(confettiShell, [], {
|
|
32
|
+
stdio: "pipe",
|
|
33
|
+
shell: true
|
|
34
|
+
});
|
|
35
|
+
confetti.on("error", (err) => {
|
|
36
|
+
const errStr = "[confetti] " + err;
|
|
37
|
+
import_plugin_utils.logger.error(errStr);
|
|
38
|
+
});
|
|
39
|
+
confetti.stderr && confetti.stderr.on("data", () => {
|
|
40
|
+
const err = `[confetti] 未安装 Raycast , 请安装后尝试 https://www.raycast.com`;
|
|
41
|
+
import_plugin_utils.logger.error(err);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var confetti_default = (api) => {
|
|
45
|
+
api.describe({
|
|
46
|
+
key: "confetti",
|
|
47
|
+
config: {
|
|
48
|
+
schema(joi) {
|
|
49
|
+
return joi.object();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
enableBy: api.EnableBy.config
|
|
53
|
+
});
|
|
54
|
+
api.onBuildComplete(({ err }) => {
|
|
55
|
+
if (!err) {
|
|
56
|
+
handleConfetti();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
api.onDevCompileDone(({ isFirstCompile }) => {
|
|
60
|
+
if (isFirstCompile) {
|
|
61
|
+
handleConfetti();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {});
|
package/dist/mf.js
CHANGED
|
@@ -208,6 +208,11 @@ function mf(api) {
|
|
|
208
208
|
`module federation name is not defined , "unNamedMF" will be used`
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
|
+
if (!isValidIdentifyName(name)) {
|
|
212
|
+
throw new Error(
|
|
213
|
+
`module federation name '${name}' is not valid javascript identifier.`
|
|
214
|
+
);
|
|
215
|
+
}
|
|
211
216
|
return name || "unNamedMF";
|
|
212
217
|
}
|
|
213
218
|
function getShared() {
|
|
@@ -239,6 +244,76 @@ function mf(api) {
|
|
|
239
244
|
function addMFEntry(config, mfName2, path) {
|
|
240
245
|
config.entry[mfName2] = path;
|
|
241
246
|
}
|
|
247
|
+
function isValidIdentifyName(name) {
|
|
248
|
+
const reservedKeywords = [
|
|
249
|
+
"abstract",
|
|
250
|
+
"await",
|
|
251
|
+
"boolean",
|
|
252
|
+
"break",
|
|
253
|
+
"byte",
|
|
254
|
+
"case",
|
|
255
|
+
"catch",
|
|
256
|
+
"char",
|
|
257
|
+
"class",
|
|
258
|
+
"const",
|
|
259
|
+
"continue",
|
|
260
|
+
"debugger",
|
|
261
|
+
"default",
|
|
262
|
+
"delete",
|
|
263
|
+
"do",
|
|
264
|
+
"double",
|
|
265
|
+
"else",
|
|
266
|
+
"enum",
|
|
267
|
+
"export",
|
|
268
|
+
"extends",
|
|
269
|
+
"false",
|
|
270
|
+
"final",
|
|
271
|
+
"finally",
|
|
272
|
+
"float",
|
|
273
|
+
"for",
|
|
274
|
+
"function",
|
|
275
|
+
"goto",
|
|
276
|
+
"if",
|
|
277
|
+
"implements",
|
|
278
|
+
"import",
|
|
279
|
+
"in",
|
|
280
|
+
"instanceof",
|
|
281
|
+
"int",
|
|
282
|
+
"interface",
|
|
283
|
+
"let",
|
|
284
|
+
"long",
|
|
285
|
+
"native",
|
|
286
|
+
"new",
|
|
287
|
+
"null",
|
|
288
|
+
"package",
|
|
289
|
+
"private",
|
|
290
|
+
"protected",
|
|
291
|
+
"public",
|
|
292
|
+
"return",
|
|
293
|
+
"short",
|
|
294
|
+
"static",
|
|
295
|
+
"super",
|
|
296
|
+
"switch",
|
|
297
|
+
"synchronized",
|
|
298
|
+
"this",
|
|
299
|
+
"throw",
|
|
300
|
+
"transient",
|
|
301
|
+
"true",
|
|
302
|
+
"try",
|
|
303
|
+
"typeof",
|
|
304
|
+
"var",
|
|
305
|
+
"void",
|
|
306
|
+
"volatile",
|
|
307
|
+
"while",
|
|
308
|
+
"with",
|
|
309
|
+
"yield"
|
|
310
|
+
];
|
|
311
|
+
const regexIdentifierName = /^(?:[$_\p{ID_Start}])(?:[$_\u200C\u200D\p{ID_Continue}])*$/u;
|
|
312
|
+
if (reservedKeywords.includes(name) || !regexIdentifierName.test(name)) {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
242
317
|
}
|
|
243
318
|
// Annotate the CommonJS export names for ESM import in node:
|
|
244
319
|
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.51",
|
|
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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@ant-design/pro-components": "^2.0.1",
|
|
30
30
|
"@tanstack/react-query": "^4.22.0",
|
|
31
31
|
"@tanstack/react-query-devtools": "^4.22.0",
|
|
32
|
-
"@umijs/bundler-utils": "4.0.
|
|
32
|
+
"@umijs/bundler-utils": "4.0.51",
|
|
33
33
|
"@umijs/valtio": "^1.0.3",
|
|
34
34
|
"antd-dayjs-webpack-plugin": "^1.0.6",
|
|
35
35
|
"axios": "^0.27.2",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"antd": "^4.24.1",
|
|
56
|
-
"umi": "4.0.
|
|
56
|
+
"umi": "4.0.51"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|