@umijs/utils 4.0.63 → 4.0.64

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.
@@ -0,0 +1,32 @@
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/isJavaScriptFile.ts
20
+ var isJavaScriptFile_exports = {};
21
+ __export(isJavaScriptFile_exports, {
22
+ isJavaScriptFile: () => isJavaScriptFile
23
+ });
24
+ module.exports = __toCommonJS(isJavaScriptFile_exports);
25
+ var JS_EXT_REGX = /\.(:?js|jsx|mjs|ts|tsx)$/;
26
+ function isJavaScriptFile(f) {
27
+ return JS_EXT_REGX.test(f);
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ isJavaScriptFile
32
+ });
@@ -1,5 +1,5 @@
1
1
  export declare const AUTO_CSS_MODULE_EXTS: string[];
2
- export declare const isStyleFile: ({ filename, ext, }: {
2
+ export declare const isStyleFile: ({ filename, }: {
3
3
  filename?: string | undefined;
4
4
  ext?: string | undefined;
5
5
  }) => boolean | "" | undefined;
@@ -23,7 +23,6 @@ __export(isStyleFile_exports, {
23
23
  isStyleFile: () => isStyleFile
24
24
  });
25
25
  module.exports = __toCommonJS(isStyleFile_exports);
26
- var import_path = require("path");
27
26
  var AUTO_CSS_MODULE_EXTS = [
28
27
  ".css",
29
28
  ".less",
@@ -32,11 +31,11 @@ var AUTO_CSS_MODULE_EXTS = [
32
31
  ".stylus",
33
32
  ".styl"
34
33
  ];
34
+ var STYLE_EXT_REGX = /\.(:?css|less|scss|sass|stylus|styl)$/;
35
35
  var isStyleFile = ({
36
- filename,
37
- ext
36
+ filename
38
37
  }) => {
39
- return filename && AUTO_CSS_MODULE_EXTS.includes(ext || (0, import_path.extname)(filename));
38
+ return filename && STYLE_EXT_REGX.test(filename);
40
39
  };
41
40
  // Annotate the CommonJS export names for ESM import in node:
42
41
  0 && (module.exports = {
package/dist/npmClient.js CHANGED
@@ -17,6 +17,10 @@ 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.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -16,10 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  }
17
17
  return to;
18
18
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
- mod
22
- ));
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
23
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
21
 
25
22
  // src/randomColor/randomColor.ts
package/dist/register.js CHANGED
@@ -42,6 +42,8 @@ function transform(opts) {
42
42
  return implementor.transformSync(code, {
43
43
  sourcefile: filename,
44
44
  loader: ext.slice(1),
45
+ // consistent with `tsconfig.base.json`
46
+ // https://github.com/umijs/umi-next/pull/729
45
47
  target: "es2019",
46
48
  format: "cjs",
47
49
  logLevel: "error"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/utils",
3
- "version": "4.0.63",
3
+ "version": "4.0.64",
4
4
  "homepage": "https://github.com/umijs/umi/tree/master/packages/utils#readme",
5
5
  "bugs": "https://github.com/umijs/umi/issues",
6
6
  "repository": {
@@ -32,6 +32,7 @@
32
32
  "@types/prompts": "^2.4.2",
33
33
  "@types/rimraf": "3.0.2",
34
34
  "@types/semver": "7.3.13",
35
+ "@types/tar": "6.1.4",
35
36
  "@types/yargs-parser": "21.0.0",
36
37
  "address": "1.1.2",
37
38
  "axios": "0.27.2",
@@ -60,6 +61,7 @@
60
61
  "rimraf": "3.0.2",
61
62
  "semver": "7.3.8",
62
63
  "strip-ansi": "7.0.1",
64
+ "tar": "6.1.13",
63
65
  "tsconfig-paths": "4.1.2",
64
66
  "yargs-parser": "21.1.1",
65
67
  "zod": "3.20.6"
@@ -101,7 +103,8 @@
101
103
  "magic-string",
102
104
  "@ampproject/remapping",
103
105
  "tsconfig-paths",
104
- "zod"
106
+ "zod",
107
+ "tar"
105
108
  ],
106
109
  "externals": {
107
110
  "address": "$$LOCAL",