@modern-js/repo-generator 0.0.0-next-20240313095804 → 0.0.0-next-20240313181743

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.
Files changed (2) hide show
  1. package/dist/index.js +29 -10
  2. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -28563,7 +28563,7 @@ var require_binary_search = __commonJS({
28563
28563
  var require_quick_sort = __commonJS({
28564
28564
  "../../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(exports) {
28565
28565
  "use strict";
28566
- function swap(ary, x, y) {
28566
+ function swap2(ary, x, y) {
28567
28567
  var temp = ary[x];
28568
28568
  ary[x] = ary[y];
28569
28569
  ary[y] = temp;
@@ -28575,15 +28575,15 @@ var require_quick_sort = __commonJS({
28575
28575
  if (p < r) {
28576
28576
  var pivotIndex = randomIntInRange(p, r);
28577
28577
  var i = p - 1;
28578
- swap(ary, pivotIndex, r);
28578
+ swap2(ary, pivotIndex, r);
28579
28579
  var pivot = ary[r];
28580
28580
  for (var j = p; j < r; j++) {
28581
28581
  if (comparator(ary[j], pivot) <= 0) {
28582
28582
  i += 1;
28583
- swap(ary, i, j);
28583
+ swap2(ary, i, j);
28584
28584
  }
28585
28585
  }
28586
- swap(ary, i + 1, j);
28586
+ swap2(ary, i + 1, j);
28587
28587
  var q = i + 1;
28588
28588
  doQuickSort(ary, comparator, p, q - 1);
28589
28589
  doQuickSort(ary, comparator, q + 1, r);
@@ -64263,10 +64263,10 @@ var require_extend_node = __commonJS({
64263
64263
  length = void 0;
64264
64264
  }
64265
64265
  } else {
64266
- var swap = encoding;
64266
+ var swap2 = encoding;
64267
64267
  encoding = offset;
64268
64268
  offset = length;
64269
- length = swap;
64269
+ length = swap2;
64270
64270
  }
64271
64271
  offset = +offset || 0;
64272
64272
  var remaining = this.length - offset;
@@ -64320,10 +64320,10 @@ var require_extend_node = __commonJS({
64320
64320
  length = void 0;
64321
64321
  }
64322
64322
  } else {
64323
- var swap = encoding;
64323
+ var swap2 = encoding;
64324
64324
  encoding = offset;
64325
64325
  offset = length;
64326
- length = swap;
64326
+ length = swap2;
64327
64327
  }
64328
64328
  encoding = String(encoding || "utf8").toLowerCase();
64329
64329
  if (Buffer2.isNativeEncoding(encoding))
@@ -85739,7 +85739,13 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
85739
85739
  // ../../new-action/dist/esm/utils/index.js
85740
85740
  var import_path15 = __toESM(require("path"));
85741
85741
  var import_utils53 = require("@modern-js/utils");
85742
- var import_fs_extra = require("@modern-js/utils/fs-extra");
85742
+ var swap = (obj) => {
85743
+ return Object.keys(obj).reduce((acc, key) => {
85744
+ acc[obj[key]] = key;
85745
+ return acc;
85746
+ }, {});
85747
+ };
85748
+ var dependenceToSolution = swap(SolutionToolsMap);
85743
85749
  function alreadyRepo(cwd = process.cwd()) {
85744
85750
  try {
85745
85751
  return import_utils50.fs.existsSync(import_path15.default.resolve(cwd, "package.json"));
@@ -85747,9 +85753,22 @@ function alreadyRepo(cwd = process.cwd()) {
85747
85753
  return false;
85748
85754
  }
85749
85755
  }
85756
+ var readJson = (jsonPath) => {
85757
+ if (!import_utils50.fs.existsSync(jsonPath)) {
85758
+ return {};
85759
+ }
85760
+ const jsonStr = import_utils50.fs.readFileSync(jsonPath, {
85761
+ encoding: "utf8"
85762
+ });
85763
+ try {
85764
+ return import_utils53.json5.parse(jsonStr);
85765
+ } catch (error) {
85766
+ throw Error(`${jsonPath} is not a valid json, please check and try again.`);
85767
+ }
85768
+ };
85750
85769
  function hasEnabledFunction(action2, dependencies, devDependencies, peerDependencies, cwd) {
85751
85770
  const packageJsonPath = import_path15.default.normalize(`${cwd}/package.json`);
85752
- const packageJson = (0, import_fs_extra.readJsonSync)(packageJsonPath);
85771
+ const packageJson = readJson(packageJsonPath);
85753
85772
  if (!dependencies[action2] && !devDependencies[action2]) {
85754
85773
  return false;
85755
85774
  }
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-20240313095804",
18
+ "version": "0.0.0-next-20240313181743",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -23,7 +23,7 @@
23
23
  "/dist/index.js"
24
24
  ],
25
25
  "dependencies": {
26
- "@modern-js/utils": "0.0.0-next-20240313095804"
26
+ "@modern-js/utils": "0.0.0-next-20240313181743"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@modern-js/codesmith": "2.3.5",
@@ -32,15 +32,15 @@
32
32
  "@types/node": "^14",
33
33
  "jest": "^29",
34
34
  "typescript": "^5",
35
- "@modern-js/base-generator": "0.0.0-next-20240313095804",
36
- "@modern-js/generator-plugin": "0.0.0-next-20240313095804",
37
- "@modern-js/generator-common": "0.0.0-next-20240313095804",
38
- "@modern-js/generator-utils": "0.0.0-next-20240313095804",
39
- "@modern-js/module-generator": "0.0.0-next-20240313095804",
40
- "@modern-js/monorepo-generator": "0.0.0-next-20240313095804",
41
- "@modern-js/mwa-generator": "0.0.0-next-20240313095804",
42
- "@scripts/build": "0.0.0-next-20240313095804",
43
- "@scripts/jest-config": "0.0.0-next-20240313095804"
35
+ "@modern-js/base-generator": "0.0.0-next-20240313181743",
36
+ "@modern-js/generator-common": "0.0.0-next-20240313181743",
37
+ "@modern-js/generator-plugin": "0.0.0-next-20240313181743",
38
+ "@modern-js/generator-utils": "0.0.0-next-20240313181743",
39
+ "@modern-js/module-generator": "0.0.0-next-20240313181743",
40
+ "@modern-js/monorepo-generator": "0.0.0-next-20240313181743",
41
+ "@modern-js/mwa-generator": "0.0.0-next-20240313181743",
42
+ "@scripts/build": "0.0.0-next-20240313181743",
43
+ "@scripts/jest-config": "0.0.0-next-20240313181743"
44
44
  },
45
45
  "sideEffects": false,
46
46
  "publishConfig": {