@umijs/utils 4.0.80 → 4.0.82
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/BaseGenerator/generateFile.js +0 -4
- package/dist/aliasUtils/getAliasValue.js +0 -4
- package/dist/getDevBanner.js +0 -4
- package/dist/getGitInfo.js +0 -4
- package/dist/importLazy.js +0 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -1
- package/dist/installDeps.js +0 -4
- package/dist/isMonorepo.js +1 -2
- package/dist/node.d.ts +4 -0
- package/dist/node.js +61 -0
- package/dist/randomColor/randomColor.js +0 -4
- package/package.json +1 -1
|
@@ -17,10 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
21
|
mod
|
|
26
22
|
));
|
|
@@ -17,10 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
21
|
mod
|
|
26
22
|
));
|
package/dist/getDevBanner.js
CHANGED
|
@@ -17,10 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
21
|
mod
|
|
26
22
|
));
|
package/dist/getGitInfo.js
CHANGED
|
@@ -17,10 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
21
|
mod
|
|
26
22
|
));
|
package/dist/importLazy.js
CHANGED
|
@@ -17,10 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
21
|
mod
|
|
26
22
|
));
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export * from './isJavaScriptFile';
|
|
|
44
44
|
export * from './isLocalDev';
|
|
45
45
|
export * from './isMonorepo';
|
|
46
46
|
export * from './isStyleFile';
|
|
47
|
+
export * from './node';
|
|
47
48
|
export * from './npmClient';
|
|
48
49
|
export * from './randomColor/randomColor';
|
|
49
50
|
export * from './readDirFiles';
|
package/dist/index.js
CHANGED
|
@@ -118,6 +118,7 @@ __reExport(src_exports, require("./isJavaScriptFile"), module.exports);
|
|
|
118
118
|
__reExport(src_exports, require("./isLocalDev"), module.exports);
|
|
119
119
|
__reExport(src_exports, require("./isMonorepo"), module.exports);
|
|
120
120
|
__reExport(src_exports, require("./isStyleFile"), module.exports);
|
|
121
|
+
__reExport(src_exports, require("./node"), module.exports);
|
|
121
122
|
__reExport(src_exports, require("./npmClient"), module.exports);
|
|
122
123
|
__reExport(src_exports, require("./randomColor/randomColor"), module.exports);
|
|
123
124
|
__reExport(src_exports, require("./readDirFiles"), module.exports);
|
|
@@ -167,5 +168,20 @@ __reExport(src_exports, require("./zod/isZodSchema"), module.exports);
|
|
|
167
168
|
tsconfigPaths,
|
|
168
169
|
updatePackageJSON,
|
|
169
170
|
yParser,
|
|
170
|
-
zod
|
|
171
|
+
zod,
|
|
172
|
+
...require("./getCorejsVersion"),
|
|
173
|
+
...require("./getDevBanner"),
|
|
174
|
+
...require("./importLazy"),
|
|
175
|
+
...require("./isJavaScriptFile"),
|
|
176
|
+
...require("./isLocalDev"),
|
|
177
|
+
...require("./isMonorepo"),
|
|
178
|
+
...require("./isStyleFile"),
|
|
179
|
+
...require("./node"),
|
|
180
|
+
...require("./npmClient"),
|
|
181
|
+
...require("./randomColor/randomColor"),
|
|
182
|
+
...require("./readDirFiles"),
|
|
183
|
+
...require("./setNoDeprecation"),
|
|
184
|
+
...require("./tryPaths"),
|
|
185
|
+
...require("./winPath"),
|
|
186
|
+
...require("./zod/isZodSchema")
|
|
171
187
|
});
|
package/dist/installDeps.js
CHANGED
|
@@ -17,10 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
21
|
mod
|
|
26
22
|
));
|
package/dist/isMonorepo.js
CHANGED
|
@@ -35,8 +35,7 @@ function isMonorepo(opts) {
|
|
|
35
35
|
const pkgExist = (0, import_fs.existsSync)(pkgPath);
|
|
36
36
|
return pkgExist && (MONOREPO_FILE.some((file) => {
|
|
37
37
|
return (0, import_fs.existsSync)((0, import_path.join)(opts.root, file));
|
|
38
|
-
}) ||
|
|
39
|
-
(pkg == null ? void 0 : pkg.workspaces));
|
|
38
|
+
}) || (pkg == null ? void 0 : pkg.workspaces));
|
|
40
39
|
}
|
|
41
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
42
41
|
0 && (module.exports = {
|
package/dist/node.d.ts
ADDED
package/dist/node.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
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/node.ts
|
|
20
|
+
var node_exports = {};
|
|
21
|
+
__export(node_exports, {
|
|
22
|
+
catchUnhandledRejection: () => catchUnhandledRejection,
|
|
23
|
+
checkLocal: () => checkLocal,
|
|
24
|
+
checkVersion: () => checkVersion,
|
|
25
|
+
setNodeTitle: () => setNodeTitle
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(node_exports);
|
|
28
|
+
var import__ = require("./");
|
|
29
|
+
var ver = parseInt(process.version.slice(1));
|
|
30
|
+
function checkVersion(minVersion, message) {
|
|
31
|
+
if (ver < minVersion || ver === 15 || ver === 17 || ver === 19) {
|
|
32
|
+
import__.logger.error(
|
|
33
|
+
message || `Your node version ${ver} is not supported, please upgrade to ${minVersion} or above except 15 or 17.`
|
|
34
|
+
);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function checkLocal() {
|
|
39
|
+
if ((0, import__.isLocalDev)()) {
|
|
40
|
+
import__.logger.info("@local");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function setNodeTitle(name) {
|
|
44
|
+
if (process.title === "node") {
|
|
45
|
+
process.title = name;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function catchUnhandledRejection() {
|
|
49
|
+
if (ver <= 14) {
|
|
50
|
+
process.on("unhandledRejection", (err) => {
|
|
51
|
+
throw err;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
catchUnhandledRejection,
|
|
58
|
+
checkLocal,
|
|
59
|
+
checkVersion,
|
|
60
|
+
setNodeTitle
|
|
61
|
+
});
|
|
@@ -17,10 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
21
|
mod
|
|
26
22
|
));
|