js-code-detector 0.0.40 → 0.0.42

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.
@@ -20,7 +20,7 @@ export declare function gitDiffDetect(): Promise<{
20
20
  effectsDownstream: string[];
21
21
  }[];
22
22
  }[];
23
- type: "add" | "delete" | "modify";
23
+ type: "modify" | "add" | "delete";
24
24
  filesDependsOnMe: string[];
25
25
  undefinedIdentifiers: string[];
26
26
  filePath: string;
@@ -42,7 +42,7 @@ export declare function gitDiffDetectByUrl(inputUrl: string): Promise<{
42
42
  effectsDownstream: string[];
43
43
  }[];
44
44
  }[];
45
- type: "add" | "delete" | "modify";
45
+ type: "modify" | "add" | "delete";
46
46
  filesDependsOnMe: string[];
47
47
  undefinedIdentifiers: string[];
48
48
  filePath: string;
@@ -21,7 +21,7 @@ export declare function generateGitDiffReport(arg: {
21
21
  effectsDownstream: string[];
22
22
  }[];
23
23
  }[];
24
- type: "add" | "delete" | "modify";
24
+ type: "modify" | "add" | "delete";
25
25
  filesDependsOnMe: string[];
26
26
  undefinedIdentifiers: string[];
27
27
  filePath: string;
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
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
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/util/report_util/getMadgeInstance.ts
@@ -23,16 +33,9 @@ __export(getMadgeInstance_exports, {
23
33
  });
24
34
  module.exports = __toCommonJS(getMadgeInstance_exports);
25
35
  var import_path = require("path");
26
- var import_utils = require("@umijs/utils");
27
- var MADGE_NAME = "madge";
36
+ var import_madge = __toESM(require("madge"));
28
37
  async function getMadgeInstance(devTmpDir, targetDirPath, exclude, filteredAlias, tsconfig = {}) {
29
38
  const exportsFile = (0, import_path.join)(devTmpDir, "exports.ts");
30
- const madgePkg = (0, import_path.dirname)(
31
- import_utils.resolve.sync(`${MADGE_NAME}/package.json`, {
32
- basedir: process.cwd()
33
- })
34
- );
35
- const madge = require(madgePkg);
36
39
  const madgeConfig = {
37
40
  tsConfig: {
38
41
  compilerOptions: {
@@ -58,7 +61,7 @@ async function getMadgeInstance(devTmpDir, targetDirPath, exclude, filteredAlias
58
61
  excludeRegExp: exclude,
59
62
  baseDir: targetDirPath
60
63
  };
61
- const res = await madge((0, import_path.join)(devTmpDir, "umi.ts"), madgeConfig);
64
+ const res = await (0, import_madge.default)((0, import_path.join)(devTmpDir, "umi.ts"), madgeConfig);
62
65
  return res;
63
66
  }
64
67
  // Annotate the CommonJS export names for ESM import in node:
@@ -28,7 +28,7 @@ export declare function gitDiffTool(arg: {
28
28
  effectsDownstream: string[];
29
29
  }[];
30
30
  }[];
31
- type: "add" | "delete" | "modify";
31
+ type: "modify" | "add" | "delete";
32
32
  filesDependsOnMe: string[];
33
33
  undefinedIdentifiers: string[];
34
34
  filePath: string;
@@ -26,7 +26,6 @@ var import_utils = require("@umijs/utils");
26
26
  var import_fs = require("fs");
27
27
  var import_path = require("path");
28
28
  var import_getMadgeInstance = require("../report_util/getMadgeInstance");
29
- var import_getRepoSupportFlag = require("./getRepoSupportFlag");
30
29
  var userAliasGetter = (cwd, appData) => {
31
30
  var _a;
32
31
  return ((_a = appData.config) == null ? void 0 : _a.alias) || {
@@ -37,8 +36,12 @@ var userAliasGetter = (cwd, appData) => {
37
36
  };
38
37
  };
39
38
  async function umi4SetUp({ targetDirPath }) {
40
- const minVersion = (0, import_getRepoSupportFlag.getMinVersion)((0, import_path.join)(targetDirPath, "package.json"), "@umijs/max");
41
- import_utils.logger.info(`正在安装 @umijs/max@ 并执行 setup 脚本...`);
39
+ import_utils.logger.info(`正在删除 yarn.lock 文件...`);
40
+ const yarnLockPath = (0, import_path.join)(targetDirPath, "yarn.lock");
41
+ if ((0, import_fs.existsSync)(yarnLockPath)) {
42
+ await import_utils.execa.execa(`mv ${yarnLockPath} ${(0, import_path.join)(targetDirPath, "yarn.lock.bak")}`, { shell: true });
43
+ }
44
+ import_utils.logger.info(`正在安装 @umijs/max 并执行 setup 脚本...`);
42
45
  const shellExeResult = await import_utils.execa.execa(`cd ${targetDirPath} && yarn remove @umijs/max && yarn add @umijs/max && npx max setup`, { shell: true });
43
46
  const tsconfig = await import_utils.tsconfigPaths.loadConfig(targetDirPath);
44
47
  let appData = { config: null };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-code-detector",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",