@storm-software/linting-tools 1.111.0 → 1.112.0
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/README.md +1 -1
- package/bin/lint.cjs +961 -78
- package/bin/lint.js +953 -70
- package/package.json +3 -4
package/bin/lint.js
CHANGED
|
@@ -229,6 +229,139 @@ var require_file_entry_cache = __commonJS({
|
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
+
// ../../node_modules/.pnpm/@manypkg+get-packages@2.2.1/node_modules/@manypkg/get-packages/dist/manypkg-get-packages.cjs.prod.js
|
|
233
|
+
var require_manypkg_get_packages_cjs_prod = __commonJS({
|
|
234
|
+
"../../node_modules/.pnpm/@manypkg+get-packages@2.2.1/node_modules/@manypkg/get-packages/dist/manypkg-get-packages.cjs.prod.js"(exports) {
|
|
235
|
+
"use strict";
|
|
236
|
+
init_esm_shims();
|
|
237
|
+
Object.defineProperty(exports, "__esModule", {
|
|
238
|
+
value: true
|
|
239
|
+
});
|
|
240
|
+
var path10 = __require("path");
|
|
241
|
+
var findRoot = __require("@manypkg/find-root");
|
|
242
|
+
function _interopDefault(e) {
|
|
243
|
+
return e && e.__esModule ? e : {
|
|
244
|
+
"default": e
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
__name(_interopDefault, "_interopDefault");
|
|
248
|
+
var path__default = /* @__PURE__ */ _interopDefault(path10);
|
|
249
|
+
var PackageJsonMissingNameError = class PackageJsonMissingNameError extends Error {
|
|
250
|
+
static {
|
|
251
|
+
__name(this, "PackageJsonMissingNameError");
|
|
252
|
+
}
|
|
253
|
+
constructor(directories) {
|
|
254
|
+
super(`The following package.jsons are missing the "name" field:
|
|
255
|
+
${directories.join("\n")}`);
|
|
256
|
+
this.directories = directories;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
async function getPackages5(dir, options) {
|
|
260
|
+
const monorepoRoot = await findRoot.findRoot(dir, options);
|
|
261
|
+
const packages = await monorepoRoot.tool.getPackages(monorepoRoot.rootDir);
|
|
262
|
+
validatePackages(packages);
|
|
263
|
+
return packages;
|
|
264
|
+
}
|
|
265
|
+
__name(getPackages5, "getPackages");
|
|
266
|
+
function getPackagesSync(dir, options) {
|
|
267
|
+
const monorepoRoot = findRoot.findRootSync(dir, options);
|
|
268
|
+
const packages = monorepoRoot.tool.getPackagesSync(monorepoRoot.rootDir);
|
|
269
|
+
validatePackages(packages);
|
|
270
|
+
return packages;
|
|
271
|
+
}
|
|
272
|
+
__name(getPackagesSync, "getPackagesSync");
|
|
273
|
+
function validatePackages(packages) {
|
|
274
|
+
const pkgJsonsMissingNameField = [];
|
|
275
|
+
for (const pkg of packages.packages) {
|
|
276
|
+
if (!pkg.packageJson.name) {
|
|
277
|
+
pkgJsonsMissingNameField.push(path__default["default"].join(pkg.relativeDir, "package.json"));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (pkgJsonsMissingNameField.length > 0) {
|
|
281
|
+
pkgJsonsMissingNameField.sort();
|
|
282
|
+
throw new PackageJsonMissingNameError(pkgJsonsMissingNameField);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
__name(validatePackages, "validatePackages");
|
|
286
|
+
exports.PackageJsonMissingNameError = PackageJsonMissingNameError;
|
|
287
|
+
exports.getPackages = getPackages5;
|
|
288
|
+
exports.getPackagesSync = getPackagesSync;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
// ../../node_modules/.pnpm/@manypkg+get-packages@2.2.1/node_modules/@manypkg/get-packages/dist/manypkg-get-packages.cjs.dev.js
|
|
293
|
+
var require_manypkg_get_packages_cjs_dev = __commonJS({
|
|
294
|
+
"../../node_modules/.pnpm/@manypkg+get-packages@2.2.1/node_modules/@manypkg/get-packages/dist/manypkg-get-packages.cjs.dev.js"(exports) {
|
|
295
|
+
"use strict";
|
|
296
|
+
init_esm_shims();
|
|
297
|
+
Object.defineProperty(exports, "__esModule", {
|
|
298
|
+
value: true
|
|
299
|
+
});
|
|
300
|
+
var path10 = __require("path");
|
|
301
|
+
var findRoot = __require("@manypkg/find-root");
|
|
302
|
+
function _interopDefault(e) {
|
|
303
|
+
return e && e.__esModule ? e : {
|
|
304
|
+
"default": e
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
__name(_interopDefault, "_interopDefault");
|
|
308
|
+
var path__default = /* @__PURE__ */ _interopDefault(path10);
|
|
309
|
+
var PackageJsonMissingNameError = class PackageJsonMissingNameError extends Error {
|
|
310
|
+
static {
|
|
311
|
+
__name(this, "PackageJsonMissingNameError");
|
|
312
|
+
}
|
|
313
|
+
constructor(directories) {
|
|
314
|
+
super(`The following package.jsons are missing the "name" field:
|
|
315
|
+
${directories.join("\n")}`);
|
|
316
|
+
this.directories = directories;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
async function getPackages5(dir, options) {
|
|
320
|
+
const monorepoRoot = await findRoot.findRoot(dir, options);
|
|
321
|
+
const packages = await monorepoRoot.tool.getPackages(monorepoRoot.rootDir);
|
|
322
|
+
validatePackages(packages);
|
|
323
|
+
return packages;
|
|
324
|
+
}
|
|
325
|
+
__name(getPackages5, "getPackages");
|
|
326
|
+
function getPackagesSync(dir, options) {
|
|
327
|
+
const monorepoRoot = findRoot.findRootSync(dir, options);
|
|
328
|
+
const packages = monorepoRoot.tool.getPackagesSync(monorepoRoot.rootDir);
|
|
329
|
+
validatePackages(packages);
|
|
330
|
+
return packages;
|
|
331
|
+
}
|
|
332
|
+
__name(getPackagesSync, "getPackagesSync");
|
|
333
|
+
function validatePackages(packages) {
|
|
334
|
+
const pkgJsonsMissingNameField = [];
|
|
335
|
+
for (const pkg of packages.packages) {
|
|
336
|
+
if (!pkg.packageJson.name) {
|
|
337
|
+
pkgJsonsMissingNameField.push(path__default["default"].join(pkg.relativeDir, "package.json"));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (pkgJsonsMissingNameField.length > 0) {
|
|
341
|
+
pkgJsonsMissingNameField.sort();
|
|
342
|
+
throw new PackageJsonMissingNameError(pkgJsonsMissingNameField);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
__name(validatePackages, "validatePackages");
|
|
346
|
+
exports.PackageJsonMissingNameError = PackageJsonMissingNameError;
|
|
347
|
+
exports.getPackages = getPackages5;
|
|
348
|
+
exports.getPackagesSync = getPackagesSync;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// ../../node_modules/.pnpm/@manypkg+get-packages@2.2.1/node_modules/@manypkg/get-packages/dist/manypkg-get-packages.cjs.js
|
|
353
|
+
var require_manypkg_get_packages_cjs = __commonJS({
|
|
354
|
+
"../../node_modules/.pnpm/@manypkg+get-packages@2.2.1/node_modules/@manypkg/get-packages/dist/manypkg-get-packages.cjs.js"(exports, module) {
|
|
355
|
+
"use strict";
|
|
356
|
+
init_esm_shims();
|
|
357
|
+
if (process.env.NODE_ENV === "production") {
|
|
358
|
+
module.exports = require_manypkg_get_packages_cjs_prod();
|
|
359
|
+
} else {
|
|
360
|
+
module.exports = require_manypkg_get_packages_cjs_dev();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
|
|
232
365
|
// bin/lint.ts
|
|
233
366
|
init_esm_shims();
|
|
234
367
|
|
|
@@ -467,65 +600,65 @@ __name(normalizeWindowsPath, "normalizeWindowsPath");
|
|
|
467
600
|
var _UNC_REGEX = /^[/\\]{2}/;
|
|
468
601
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
469
602
|
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
470
|
-
var correctPaths = /* @__PURE__ */ __name(function(
|
|
471
|
-
if (!
|
|
603
|
+
var correctPaths = /* @__PURE__ */ __name(function(path10) {
|
|
604
|
+
if (!path10 || path10.length === 0) {
|
|
472
605
|
return ".";
|
|
473
606
|
}
|
|
474
|
-
|
|
475
|
-
const isUNCPath =
|
|
476
|
-
const isPathAbsolute = isAbsolute(
|
|
477
|
-
const trailingSeparator =
|
|
478
|
-
|
|
479
|
-
if (
|
|
607
|
+
path10 = normalizeWindowsPath(path10);
|
|
608
|
+
const isUNCPath = path10.match(_UNC_REGEX);
|
|
609
|
+
const isPathAbsolute = isAbsolute(path10);
|
|
610
|
+
const trailingSeparator = path10[path10.length - 1] === "/";
|
|
611
|
+
path10 = normalizeString(path10, !isPathAbsolute);
|
|
612
|
+
if (path10.length === 0) {
|
|
480
613
|
if (isPathAbsolute) {
|
|
481
614
|
return "/";
|
|
482
615
|
}
|
|
483
616
|
return trailingSeparator ? "./" : ".";
|
|
484
617
|
}
|
|
485
618
|
if (trailingSeparator) {
|
|
486
|
-
|
|
619
|
+
path10 += "/";
|
|
487
620
|
}
|
|
488
|
-
if (_DRIVE_LETTER_RE.test(
|
|
489
|
-
|
|
621
|
+
if (_DRIVE_LETTER_RE.test(path10)) {
|
|
622
|
+
path10 += "/";
|
|
490
623
|
}
|
|
491
624
|
if (isUNCPath) {
|
|
492
625
|
if (!isPathAbsolute) {
|
|
493
|
-
return `//./${
|
|
626
|
+
return `//./${path10}`;
|
|
494
627
|
}
|
|
495
|
-
return `//${
|
|
628
|
+
return `//${path10}`;
|
|
496
629
|
}
|
|
497
|
-
return isPathAbsolute && !isAbsolute(
|
|
630
|
+
return isPathAbsolute && !isAbsolute(path10) ? `/${path10}` : path10;
|
|
498
631
|
}, "correctPaths");
|
|
499
632
|
var joinPaths = /* @__PURE__ */ __name(function(...segments) {
|
|
500
|
-
let
|
|
633
|
+
let path10 = "";
|
|
501
634
|
for (const seg of segments) {
|
|
502
635
|
if (!seg) {
|
|
503
636
|
continue;
|
|
504
637
|
}
|
|
505
|
-
if (
|
|
506
|
-
const pathTrailing =
|
|
638
|
+
if (path10.length > 0) {
|
|
639
|
+
const pathTrailing = path10[path10.length - 1] === "/";
|
|
507
640
|
const segLeading = seg[0] === "/";
|
|
508
641
|
const both = pathTrailing && segLeading;
|
|
509
642
|
if (both) {
|
|
510
|
-
|
|
643
|
+
path10 += seg.slice(1);
|
|
511
644
|
} else {
|
|
512
|
-
|
|
645
|
+
path10 += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
513
646
|
}
|
|
514
647
|
} else {
|
|
515
|
-
|
|
648
|
+
path10 += seg;
|
|
516
649
|
}
|
|
517
650
|
}
|
|
518
|
-
return correctPaths(
|
|
651
|
+
return correctPaths(path10);
|
|
519
652
|
}, "joinPaths");
|
|
520
|
-
function normalizeString(
|
|
653
|
+
function normalizeString(path10, allowAboveRoot) {
|
|
521
654
|
let res = "";
|
|
522
655
|
let lastSegmentLength = 0;
|
|
523
656
|
let lastSlash = -1;
|
|
524
657
|
let dots = 0;
|
|
525
658
|
let char = null;
|
|
526
|
-
for (let index = 0; index <=
|
|
527
|
-
if (index <
|
|
528
|
-
char =
|
|
659
|
+
for (let index = 0; index <= path10.length; ++index) {
|
|
660
|
+
if (index < path10.length) {
|
|
661
|
+
char = path10[index];
|
|
529
662
|
} else if (char === "/") {
|
|
530
663
|
break;
|
|
531
664
|
} else {
|
|
@@ -561,9 +694,9 @@ function normalizeString(path9, allowAboveRoot) {
|
|
|
561
694
|
}
|
|
562
695
|
} else {
|
|
563
696
|
if (res.length > 0) {
|
|
564
|
-
res += `/${
|
|
697
|
+
res += `/${path10.slice(lastSlash + 1, index)}`;
|
|
565
698
|
} else {
|
|
566
|
-
res =
|
|
699
|
+
res = path10.slice(lastSlash + 1, index);
|
|
567
700
|
}
|
|
568
701
|
lastSegmentLength = index - lastSlash - 1;
|
|
569
702
|
}
|
|
@@ -968,13 +1101,13 @@ var exitWithSuccess = /* @__PURE__ */ __name((config) => {
|
|
|
968
1101
|
}, "exitWithSuccess");
|
|
969
1102
|
var handleProcess = /* @__PURE__ */ __name((config) => {
|
|
970
1103
|
writeTrace(`Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
|
|
971
|
-
process.on("unhandledRejection", (
|
|
972
|
-
writeError(`An Unhandled Rejection occurred while running the program: ${
|
|
1104
|
+
process.on("unhandledRejection", (error2) => {
|
|
1105
|
+
writeError(`An Unhandled Rejection occurred while running the program: ${error2}`, config);
|
|
973
1106
|
exitWithError(config);
|
|
974
1107
|
});
|
|
975
|
-
process.on("uncaughtException", (
|
|
976
|
-
writeError(`An Uncaught Exception occurred while running the program: ${
|
|
977
|
-
Stacktrace: ${
|
|
1108
|
+
process.on("uncaughtException", (error2) => {
|
|
1109
|
+
writeError(`An Uncaught Exception occurred while running the program: ${error2.message}
|
|
1110
|
+
Stacktrace: ${error2.stack}`, config);
|
|
978
1111
|
exitWithError(config);
|
|
979
1112
|
});
|
|
980
1113
|
process.on("SIGTERM", (signal) => {
|
|
@@ -1695,11 +1828,11 @@ function getReporter(options, config) {
|
|
|
1695
1828
|
__name(relativeIssue, "relativeIssue");
|
|
1696
1829
|
const issuesCollection = showProgress ? [] : void 0;
|
|
1697
1830
|
const errorCollection = [];
|
|
1698
|
-
function errorEmitter(message,
|
|
1699
|
-
if (isSpellingDictionaryLoadError(
|
|
1700
|
-
|
|
1831
|
+
function errorEmitter(message, error2) {
|
|
1832
|
+
if (isSpellingDictionaryLoadError(error2)) {
|
|
1833
|
+
error2 = error2.cause;
|
|
1701
1834
|
}
|
|
1702
|
-
const errorText = format(chalk2.red(message),
|
|
1835
|
+
const errorText = format(chalk2.red(message), error2.toString());
|
|
1703
1836
|
errorCollection?.push(errorText);
|
|
1704
1837
|
console.error(errorText);
|
|
1705
1838
|
}
|
|
@@ -1725,7 +1858,7 @@ function getReporter(options, config) {
|
|
|
1725
1858
|
if (errorCollection?.length && issues2 > 5) {
|
|
1726
1859
|
console.error("-------------------------------------------");
|
|
1727
1860
|
console.error("Errors:");
|
|
1728
|
-
errorCollection.forEach((
|
|
1861
|
+
errorCollection.forEach((error2) => console.error(error2));
|
|
1729
1862
|
}
|
|
1730
1863
|
if (options.showPerfSummary) {
|
|
1731
1864
|
console.error("-------------------------------------------");
|
|
@@ -2217,8 +2350,8 @@ function readFileInfo(filename, encoding = UTF8, handleNotFound = false) {
|
|
|
2217
2350
|
filename = resolveFilename(filename);
|
|
2218
2351
|
const pText = filename.startsWith(STDINProtocol) ? getStdin() : cioReadFile(filename, encoding);
|
|
2219
2352
|
return pText.then((text) => ({ text, filename }), (e) => {
|
|
2220
|
-
const
|
|
2221
|
-
return handleNotFound &&
|
|
2353
|
+
const error2 = toError(e);
|
|
2354
|
+
return handleNotFound && error2.code === "EISDIR" ? Promise.resolve({ text: "", filename, errorCode: error2.code }) : handleNotFound && error2.code === "ENOENT" ? Promise.resolve({ text: "", filename, errorCode: error2.code }) : Promise.reject(new IOError(`Error reading file: "${filename}"`, error2));
|
|
2222
2355
|
});
|
|
2223
2356
|
}
|
|
2224
2357
|
__name(readFileInfo, "readFileInfo");
|
|
@@ -2988,13 +3121,13 @@ async function runLint(cfg) {
|
|
|
2988
3121
|
dictCollection.dictionaries.forEach((dict) => {
|
|
2989
3122
|
const dictErrors = dict.getErrors?.() || [];
|
|
2990
3123
|
const msg = `Dictionary Error with (${dict.name})`;
|
|
2991
|
-
dictErrors.forEach((
|
|
2992
|
-
const key = msg +
|
|
3124
|
+
dictErrors.forEach((error2) => {
|
|
3125
|
+
const key = msg + error2.toString();
|
|
2993
3126
|
if (configErrors.has(key))
|
|
2994
3127
|
return;
|
|
2995
3128
|
configErrors.add(key);
|
|
2996
3129
|
count += 1;
|
|
2997
|
-
reporter.error(msg,
|
|
3130
|
+
reporter.error(msg, error2);
|
|
2998
3131
|
});
|
|
2999
3132
|
});
|
|
3000
3133
|
return count;
|
|
@@ -3190,7 +3323,7 @@ function getLoggerFromReporter(reporter) {
|
|
|
3190
3323
|
const msg = format3(...params);
|
|
3191
3324
|
reporter.info(msg, "Info");
|
|
3192
3325
|
}, "log");
|
|
3193
|
-
const
|
|
3326
|
+
const error2 = /* @__PURE__ */ __name((...params) => {
|
|
3194
3327
|
const msg = format3(...params);
|
|
3195
3328
|
const err = { message: "", name: "error", toString: /* @__PURE__ */ __name(() => "", "toString") };
|
|
3196
3329
|
reporter.error(msg, err);
|
|
@@ -3202,7 +3335,7 @@ function getLoggerFromReporter(reporter) {
|
|
|
3202
3335
|
return {
|
|
3203
3336
|
log,
|
|
3204
3337
|
warn,
|
|
3205
|
-
error
|
|
3338
|
+
error: error2
|
|
3206
3339
|
};
|
|
3207
3340
|
}
|
|
3208
3341
|
__name(getLoggerFromReporter, "getLoggerFromReporter");
|
|
@@ -3496,9 +3629,9 @@ var runAlex = /* @__PURE__ */ __name((rcName = "@storm-software/linting-tools/al
|
|
|
3496
3629
|
silentlyIgnore: true,
|
|
3497
3630
|
frail: true,
|
|
3498
3631
|
defaultConfig: transform({})
|
|
3499
|
-
}, (
|
|
3500
|
-
if (
|
|
3501
|
-
console.error(
|
|
3632
|
+
}, (error2, code) => {
|
|
3633
|
+
if (error2) {
|
|
3634
|
+
console.error(error2.message);
|
|
3502
3635
|
return reject(code);
|
|
3503
3636
|
}
|
|
3504
3637
|
return resolve7(code);
|
|
@@ -3638,15 +3771,765 @@ __name(validateUser, "validateUser");
|
|
|
3638
3771
|
|
|
3639
3772
|
// src/manypkg/index.ts
|
|
3640
3773
|
init_esm_shims();
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3774
|
+
|
|
3775
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/index.ts
|
|
3776
|
+
init_esm_shims();
|
|
3777
|
+
|
|
3778
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/EXTERNAL_MISMATCH.ts
|
|
3779
|
+
init_esm_shims();
|
|
3780
|
+
|
|
3781
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/utils.ts
|
|
3782
|
+
init_esm_shims();
|
|
3783
|
+
import * as semver from "semver";
|
|
3784
|
+
import { highest } from "sembear";
|
|
3785
|
+
var NORMAL_DEPENDENCY_TYPES = [
|
|
3786
|
+
"dependencies",
|
|
3787
|
+
"devDependencies",
|
|
3788
|
+
"optionalDependencies"
|
|
3789
|
+
];
|
|
3790
|
+
var DEPENDENCY_TYPES = [
|
|
3791
|
+
"dependencies",
|
|
3792
|
+
"devDependencies",
|
|
3793
|
+
"optionalDependencies",
|
|
3794
|
+
"peerDependencies"
|
|
3795
|
+
];
|
|
3796
|
+
function sortObject(prevObj) {
|
|
3797
|
+
let newObj = {};
|
|
3798
|
+
for (let key of Object.keys(prevObj).sort()) {
|
|
3799
|
+
newObj[key] = prevObj[key];
|
|
3800
|
+
}
|
|
3801
|
+
return newObj;
|
|
3802
|
+
}
|
|
3803
|
+
__name(sortObject, "sortObject");
|
|
3804
|
+
function sortDeps(pkg) {
|
|
3805
|
+
for (let depType of DEPENDENCY_TYPES) {
|
|
3806
|
+
let prevDeps = pkg.packageJson[depType];
|
|
3807
|
+
if (prevDeps) {
|
|
3808
|
+
pkg.packageJson[depType] = sortObject(prevDeps);
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
__name(sortDeps, "sortDeps");
|
|
3813
|
+
function weakMemoize(func) {
|
|
3814
|
+
let cache = /* @__PURE__ */ new WeakMap();
|
|
3815
|
+
return (arg) => {
|
|
3816
|
+
if (cache.has(arg)) {
|
|
3817
|
+
return cache.get(arg);
|
|
3818
|
+
}
|
|
3819
|
+
let ret = func(arg);
|
|
3820
|
+
cache.set(arg, ret);
|
|
3821
|
+
return ret;
|
|
3822
|
+
};
|
|
3823
|
+
}
|
|
3824
|
+
__name(weakMemoize, "weakMemoize");
|
|
3825
|
+
var getMostCommonRangeMap = weakMemoize(/* @__PURE__ */ __name(function getMostCommonRanges(allPackages) {
|
|
3826
|
+
let dependencyRangesMapping = /* @__PURE__ */ new Map();
|
|
3827
|
+
for (let [pkgName, pkg] of allPackages) {
|
|
3828
|
+
for (let depType of NORMAL_DEPENDENCY_TYPES) {
|
|
3829
|
+
let deps = pkg.packageJson[depType];
|
|
3830
|
+
if (deps) {
|
|
3831
|
+
for (let depName in deps) {
|
|
3832
|
+
const depSpecifier = deps[depName];
|
|
3833
|
+
if (!allPackages.has(depName)) {
|
|
3834
|
+
if (!semver.validRange(deps[depName])) {
|
|
3835
|
+
continue;
|
|
3836
|
+
}
|
|
3837
|
+
let dependencyRanges = dependencyRangesMapping.get(depName) || {};
|
|
3838
|
+
const specifierCount = dependencyRanges[depSpecifier] || 0;
|
|
3839
|
+
dependencyRanges[depSpecifier] = specifierCount + 1;
|
|
3840
|
+
dependencyRangesMapping.set(depName, dependencyRanges);
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3846
|
+
let mostCommonRangeMap = /* @__PURE__ */ new Map();
|
|
3847
|
+
for (let [depName, specifierMap] of dependencyRangesMapping) {
|
|
3848
|
+
const specifierMapEntryArray = Object.entries(specifierMap);
|
|
3849
|
+
const [first] = specifierMapEntryArray;
|
|
3850
|
+
const maxValue = specifierMapEntryArray.reduce((acc, value) => {
|
|
3851
|
+
if (acc[1] === value[1]) {
|
|
3852
|
+
const highestRange = highest([
|
|
3853
|
+
acc[0],
|
|
3854
|
+
value[0]
|
|
3855
|
+
]);
|
|
3856
|
+
return [
|
|
3857
|
+
highestRange,
|
|
3858
|
+
acc[1]
|
|
3859
|
+
];
|
|
3860
|
+
}
|
|
3861
|
+
if (acc[1] > value[1]) {
|
|
3862
|
+
return acc;
|
|
3863
|
+
}
|
|
3864
|
+
return value;
|
|
3865
|
+
}, first);
|
|
3866
|
+
mostCommonRangeMap.set(depName, maxValue[0]);
|
|
3867
|
+
}
|
|
3868
|
+
return mostCommonRangeMap;
|
|
3869
|
+
}, "getMostCommonRanges"));
|
|
3870
|
+
function versionRangeToRangeType(versionRange) {
|
|
3871
|
+
if (versionRange.charAt(0) === "^") return "^";
|
|
3872
|
+
if (versionRange.charAt(0) === "~") return "~";
|
|
3873
|
+
return "";
|
|
3874
|
+
}
|
|
3875
|
+
__name(versionRangeToRangeType, "versionRangeToRangeType");
|
|
3876
|
+
function isArrayEqual(arrA, arrB) {
|
|
3877
|
+
for (var i = 0; i < arrA.length; i++) {
|
|
3878
|
+
if (arrA[i] !== arrB[i]) {
|
|
3879
|
+
return false;
|
|
3880
|
+
}
|
|
3881
|
+
}
|
|
3882
|
+
return true;
|
|
3883
|
+
}
|
|
3884
|
+
__name(isArrayEqual, "isArrayEqual");
|
|
3885
|
+
function makeCheck(check) {
|
|
3886
|
+
return check;
|
|
3887
|
+
}
|
|
3888
|
+
__name(makeCheck, "makeCheck");
|
|
3889
|
+
|
|
3890
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/EXTERNAL_MISMATCH.ts
|
|
3891
|
+
import { validRange as validRange2 } from "semver";
|
|
3892
|
+
var EXTERNAL_MISMATCH_default = makeCheck({
|
|
3893
|
+
validate: /* @__PURE__ */ __name((workspace, allWorkspace) => {
|
|
3894
|
+
let errors = [];
|
|
3895
|
+
let mostCommonRangeMap = getMostCommonRangeMap(allWorkspace);
|
|
3896
|
+
for (let depType of NORMAL_DEPENDENCY_TYPES) {
|
|
3897
|
+
let deps = workspace.packageJson[depType];
|
|
3898
|
+
if (deps) {
|
|
3899
|
+
for (let depName in deps) {
|
|
3900
|
+
let range = deps[depName];
|
|
3901
|
+
let mostCommonRange = mostCommonRangeMap.get(depName);
|
|
3902
|
+
if (mostCommonRange !== void 0 && mostCommonRange !== range && validRange2(range)) {
|
|
3903
|
+
errors.push({
|
|
3904
|
+
type: "EXTERNAL_MISMATCH",
|
|
3905
|
+
workspace,
|
|
3906
|
+
dependencyName: depName,
|
|
3907
|
+
dependencyRange: range,
|
|
3908
|
+
mostCommonDependencyRange: mostCommonRange
|
|
3909
|
+
});
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
return errors;
|
|
3915
|
+
}, "validate"),
|
|
3916
|
+
fix: /* @__PURE__ */ __name((error2) => {
|
|
3917
|
+
for (let depType of NORMAL_DEPENDENCY_TYPES) {
|
|
3918
|
+
let deps = error2.workspace.packageJson[depType];
|
|
3919
|
+
if (deps && deps[error2.dependencyName]) {
|
|
3920
|
+
deps[error2.dependencyName] = error2.mostCommonDependencyRange;
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
return {
|
|
3924
|
+
requiresInstall: true
|
|
3925
|
+
};
|
|
3926
|
+
}, "fix"),
|
|
3927
|
+
print: /* @__PURE__ */ __name((error2) => `${error2.workspace.packageJson.name} has a dependency on ${error2.dependencyName}@${error2.dependencyRange} but the most common range in the repo is ${error2.mostCommonDependencyRange}, the range should be set to ${error2.mostCommonDependencyRange}`, "print"),
|
|
3928
|
+
type: "all"
|
|
3929
|
+
});
|
|
3930
|
+
|
|
3931
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/INTERNAL_MISMATCH.ts
|
|
3932
|
+
init_esm_shims();
|
|
3933
|
+
import semver2 from "semver";
|
|
3934
|
+
var INTERNAL_MISMATCH_default = makeCheck({
|
|
3935
|
+
validate: /* @__PURE__ */ __name((workspace, allWorkspaces) => {
|
|
3936
|
+
let errors = [];
|
|
3937
|
+
for (let depType of NORMAL_DEPENDENCY_TYPES) {
|
|
3938
|
+
let deps = workspace.packageJson[depType];
|
|
3939
|
+
if (deps) {
|
|
3940
|
+
for (let depName in deps) {
|
|
3941
|
+
let range = deps[depName];
|
|
3942
|
+
let dependencyWorkspace = allWorkspaces.get(depName);
|
|
3943
|
+
if (dependencyWorkspace !== void 0 && !range.startsWith("npm:") && !range.startsWith("workspace:") && !semver2.satisfies(dependencyWorkspace.packageJson.version, range)) {
|
|
3944
|
+
errors.push({
|
|
3945
|
+
type: "INTERNAL_MISMATCH",
|
|
3946
|
+
workspace,
|
|
3947
|
+
dependencyWorkspace,
|
|
3948
|
+
dependencyRange: range
|
|
3949
|
+
});
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
return errors;
|
|
3955
|
+
}, "validate"),
|
|
3956
|
+
fix: /* @__PURE__ */ __name((error2) => {
|
|
3957
|
+
for (let depType of NORMAL_DEPENDENCY_TYPES) {
|
|
3958
|
+
let deps = error2.workspace.packageJson[depType];
|
|
3959
|
+
if (deps && deps[error2.dependencyWorkspace.packageJson.name]) {
|
|
3960
|
+
deps[error2.dependencyWorkspace.packageJson.name] = versionRangeToRangeType(deps[error2.dependencyWorkspace.packageJson.name]) + error2.dependencyWorkspace.packageJson.version;
|
|
3961
|
+
}
|
|
3962
|
+
}
|
|
3963
|
+
return {
|
|
3964
|
+
requiresInstall: true
|
|
3965
|
+
};
|
|
3966
|
+
}, "fix"),
|
|
3967
|
+
print: /* @__PURE__ */ __name((error2) => `${error2.workspace.packageJson.name} has a dependency on ${error2.dependencyWorkspace.packageJson.name}@${error2.dependencyRange} but the version of ${error2.dependencyWorkspace.packageJson.name} in the repo is ${error2.dependencyWorkspace.packageJson.version} which is not within range of the depended on version, please update the dependency version`, "print"),
|
|
3968
|
+
type: "all"
|
|
3969
|
+
});
|
|
3970
|
+
|
|
3971
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP.ts
|
|
3972
|
+
init_esm_shims();
|
|
3973
|
+
import { upperBoundOfRangeAWithinBoundsOfB } from "sembear";
|
|
3974
|
+
import semver3 from "semver";
|
|
3975
|
+
var INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP_default = makeCheck({
|
|
3976
|
+
type: "all",
|
|
3977
|
+
validate: /* @__PURE__ */ __name((workspace, allWorkspaces) => {
|
|
3978
|
+
let errors = [];
|
|
3979
|
+
let peerDeps = workspace.packageJson.peerDependencies;
|
|
3980
|
+
let devDeps = workspace.packageJson.devDependencies || {};
|
|
3981
|
+
if (peerDeps) {
|
|
3982
|
+
for (let depName in peerDeps) {
|
|
3983
|
+
if (!devDeps[depName]) {
|
|
3984
|
+
let highestRanges = getMostCommonRangeMap(allWorkspaces);
|
|
3985
|
+
let idealDevVersion = highestRanges.get(depName);
|
|
3986
|
+
let isInternalDependency = allWorkspaces.has(depName);
|
|
3987
|
+
if (isInternalDependency) {
|
|
3988
|
+
idealDevVersion = "*";
|
|
3989
|
+
} else if (idealDevVersion === void 0) {
|
|
3990
|
+
idealDevVersion = peerDeps[depName];
|
|
3991
|
+
}
|
|
3992
|
+
errors.push({
|
|
3993
|
+
type: "INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP",
|
|
3994
|
+
workspace,
|
|
3995
|
+
peerVersion: peerDeps[depName],
|
|
3996
|
+
dependencyName: depName,
|
|
3997
|
+
devVersion: null,
|
|
3998
|
+
idealDevVersion
|
|
3999
|
+
});
|
|
4000
|
+
} else if (semver3.validRange(devDeps[depName]) && // TODO: we should probably error when a peer dep has an invalid range (in a seperate rule)
|
|
4001
|
+
// (also would be good to do a bit more validation instead of just ignoring invalid ranges for normal dep types)
|
|
4002
|
+
semver3.validRange(peerDeps[depName]) && !upperBoundOfRangeAWithinBoundsOfB(devDeps[depName], peerDeps[depName])) {
|
|
4003
|
+
let highestRanges = getMostCommonRangeMap(allWorkspaces);
|
|
4004
|
+
let idealDevVersion = highestRanges.get(depName);
|
|
4005
|
+
if (idealDevVersion === void 0) {
|
|
4006
|
+
idealDevVersion = peerDeps[depName];
|
|
4007
|
+
}
|
|
4008
|
+
errors.push({
|
|
4009
|
+
type: "INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP",
|
|
4010
|
+
workspace,
|
|
4011
|
+
dependencyName: depName,
|
|
4012
|
+
peerVersion: peerDeps[depName],
|
|
4013
|
+
devVersion: devDeps[depName],
|
|
4014
|
+
idealDevVersion
|
|
4015
|
+
});
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
return errors;
|
|
4020
|
+
}, "validate"),
|
|
4021
|
+
fix: /* @__PURE__ */ __name((error2) => {
|
|
4022
|
+
if (!error2.workspace.packageJson.devDependencies) {
|
|
4023
|
+
error2.workspace.packageJson.devDependencies = {};
|
|
4024
|
+
}
|
|
4025
|
+
error2.workspace.packageJson.devDependencies[error2.dependencyName] = error2.idealDevVersion;
|
|
4026
|
+
return {
|
|
4027
|
+
requiresInstall: true
|
|
4028
|
+
};
|
|
4029
|
+
}, "fix"),
|
|
4030
|
+
print: /* @__PURE__ */ __name((error2) => {
|
|
4031
|
+
if (error2.devVersion === null) {
|
|
4032
|
+
return `${error2.workspace.packageJson.name} has a peerDependency on ${error2.dependencyName} but it is not also specified in devDependencies, please add it there.`;
|
|
4033
|
+
}
|
|
4034
|
+
return `${error2.workspace.packageJson.name} has a peerDependency on ${error2.dependencyName} but the range specified in devDependency is not greater than or equal to the range specified in peerDependencies`;
|
|
4035
|
+
}, "print")
|
|
4036
|
+
});
|
|
4037
|
+
|
|
4038
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/INVALID_PACKAGE_NAME.ts
|
|
4039
|
+
init_esm_shims();
|
|
4040
|
+
import validateNpmPackageName from "validate-npm-package-name";
|
|
4041
|
+
var INVALID_PACKAGE_NAME_default = makeCheck({
|
|
4042
|
+
type: "all",
|
|
4043
|
+
validate: /* @__PURE__ */ __name((workspace) => {
|
|
4044
|
+
if (!workspace.packageJson.name) {
|
|
4045
|
+
return [
|
|
4046
|
+
{
|
|
4047
|
+
type: "INVALID_PACKAGE_NAME",
|
|
4048
|
+
workspace,
|
|
4049
|
+
errors: [
|
|
4050
|
+
"name cannot be undefined"
|
|
4051
|
+
]
|
|
4052
|
+
}
|
|
4053
|
+
];
|
|
4054
|
+
}
|
|
4055
|
+
let validationErrors = validateNpmPackageName(workspace.packageJson.name);
|
|
4056
|
+
let errors = [
|
|
4057
|
+
...validationErrors.errors || [],
|
|
4058
|
+
...validationErrors.warnings || []
|
|
4059
|
+
];
|
|
4060
|
+
if (errors.length) {
|
|
4061
|
+
return [
|
|
4062
|
+
{
|
|
4063
|
+
type: "INVALID_PACKAGE_NAME",
|
|
4064
|
+
workspace,
|
|
4065
|
+
errors
|
|
4066
|
+
}
|
|
4067
|
+
];
|
|
4068
|
+
}
|
|
4069
|
+
return [];
|
|
4070
|
+
}, "validate"),
|
|
4071
|
+
print: /* @__PURE__ */ __name((error2) => {
|
|
4072
|
+
if (!error2.workspace.packageJson.name) {
|
|
4073
|
+
return `The package at ${JSON.stringify(error2.workspace.relativeDir)} does not have a name`;
|
|
4074
|
+
}
|
|
4075
|
+
return `${error2.workspace.packageJson.name} is an invalid package name for the following reasons:
|
|
4076
|
+
${error2.errors.join("\n")}`;
|
|
4077
|
+
}, "print")
|
|
4078
|
+
});
|
|
4079
|
+
|
|
4080
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/MULTIPLE_DEPENDENCY_TYPES.ts
|
|
4081
|
+
init_esm_shims();
|
|
4082
|
+
var MULTIPLE_DEPENDENCY_TYPES_default = makeCheck({
|
|
4083
|
+
validate: /* @__PURE__ */ __name((workspace, allWorkspaces) => {
|
|
4084
|
+
let dependencies = /* @__PURE__ */ new Set();
|
|
4085
|
+
let errors = [];
|
|
4086
|
+
if (workspace.packageJson.dependencies) {
|
|
4087
|
+
for (let depName in workspace.packageJson.dependencies) {
|
|
4088
|
+
dependencies.add(depName);
|
|
4089
|
+
}
|
|
4090
|
+
}
|
|
4091
|
+
for (let depType of [
|
|
4092
|
+
"devDependencies",
|
|
4093
|
+
"optionalDependencies"
|
|
4094
|
+
]) {
|
|
4095
|
+
let deps = workspace.packageJson[depType];
|
|
4096
|
+
if (deps) {
|
|
4097
|
+
for (let depName in deps) {
|
|
4098
|
+
if (dependencies.has(depName)) {
|
|
4099
|
+
errors.push({
|
|
4100
|
+
type: "MULTIPLE_DEPENDENCY_TYPES",
|
|
4101
|
+
dependencyType: depType,
|
|
4102
|
+
dependencyName: depName,
|
|
4103
|
+
workspace
|
|
4104
|
+
});
|
|
4105
|
+
}
|
|
4106
|
+
}
|
|
4107
|
+
}
|
|
4108
|
+
}
|
|
4109
|
+
return errors;
|
|
4110
|
+
}, "validate"),
|
|
4111
|
+
type: "all",
|
|
4112
|
+
fix: /* @__PURE__ */ __name((error2) => {
|
|
4113
|
+
let deps = error2.workspace.packageJson[error2.dependencyType];
|
|
4114
|
+
if (deps) {
|
|
4115
|
+
delete deps[error2.dependencyName];
|
|
4116
|
+
if (Object.keys(deps).length === 0) {
|
|
4117
|
+
delete error2.workspace.packageJson[error2.dependencyType];
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
return {
|
|
4121
|
+
requiresInstall: true
|
|
4122
|
+
};
|
|
4123
|
+
}, "fix"),
|
|
4124
|
+
print: /* @__PURE__ */ __name((error2) => `${error2.workspace.packageJson.name} has a dependency and a ${error2.dependencyType === "devDependencies" ? "devDependency" : "optionalDependency"} on ${error2.dependencyName}, this is unnecessary, it should be removed from ${error2.dependencyType}`, "print")
|
|
4125
|
+
});
|
|
4126
|
+
|
|
4127
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/ROOT_HAS_DEV_DEPENDENCIES.ts
|
|
4128
|
+
init_esm_shims();
|
|
4129
|
+
import chalk4 from "chalk";
|
|
4130
|
+
var ROOT_HAS_DEV_DEPENDENCIES_default = makeCheck({
|
|
4131
|
+
type: "root",
|
|
4132
|
+
validate: /* @__PURE__ */ __name((rootWorkspace) => {
|
|
4133
|
+
if (rootWorkspace.packageJson.devDependencies) {
|
|
4134
|
+
return [
|
|
4135
|
+
{
|
|
4136
|
+
type: "ROOT_HAS_DEV_DEPENDENCIES",
|
|
4137
|
+
workspace: rootWorkspace
|
|
4138
|
+
}
|
|
4139
|
+
];
|
|
4140
|
+
}
|
|
4141
|
+
return [];
|
|
4142
|
+
}, "validate"),
|
|
4143
|
+
fix: /* @__PURE__ */ __name((error2) => {
|
|
4144
|
+
error2.workspace.packageJson.dependencies = sortObject({
|
|
4145
|
+
...error2.workspace.packageJson.devDependencies,
|
|
4146
|
+
...error2.workspace.packageJson.dependencies
|
|
4147
|
+
});
|
|
4148
|
+
delete error2.workspace.packageJson.devDependencies;
|
|
4149
|
+
}, "fix"),
|
|
4150
|
+
print: /* @__PURE__ */ __name(() => {
|
|
4151
|
+
return `the root package.json contains ${chalk4.yellow("devDependencies")}, this is disallowed as ${chalk4.yellow("devDependencies")} vs ${chalk4.green("dependencies")} in a private package does not affect anything and creates confusion.`;
|
|
4152
|
+
}, "print")
|
|
4153
|
+
});
|
|
4154
|
+
|
|
4155
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/UNSORTED_DEPENDENCIES.ts
|
|
4156
|
+
init_esm_shims();
|
|
4157
|
+
var UNSORTED_DEPENDENCIES_default = makeCheck({
|
|
4158
|
+
type: "all",
|
|
4159
|
+
validate: /* @__PURE__ */ __name((workspace) => {
|
|
4160
|
+
for (let depType of DEPENDENCY_TYPES) {
|
|
4161
|
+
let deps = workspace.packageJson[depType];
|
|
4162
|
+
if (deps && !isArrayEqual(Object.keys(deps), Object.keys(deps).sort())) {
|
|
4163
|
+
return [
|
|
4164
|
+
{
|
|
4165
|
+
type: "UNSORTED_DEPENDENCIES",
|
|
4166
|
+
workspace
|
|
4167
|
+
}
|
|
4168
|
+
];
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
return [];
|
|
4172
|
+
}, "validate"),
|
|
4173
|
+
fix: /* @__PURE__ */ __name((error2) => {
|
|
4174
|
+
sortDeps(error2.workspace);
|
|
4175
|
+
}, "fix"),
|
|
4176
|
+
print: /* @__PURE__ */ __name((error2) => `${error2.workspace.packageJson.name}'s dependencies are unsorted, this can cause large diffs when packages are added, resulting in dependencies being sorted`, "print")
|
|
4177
|
+
});
|
|
4178
|
+
|
|
4179
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/INCORRECT_REPOSITORY_FIELD.ts
|
|
4180
|
+
init_esm_shims();
|
|
4181
|
+
import parseGithubUrl from "parse-github-url";
|
|
4182
|
+
import normalizePath2 from "normalize-path";
|
|
4183
|
+
var INCORRECT_REPOSITORY_FIELD_default = makeCheck({
|
|
4184
|
+
type: "all",
|
|
4185
|
+
validate: /* @__PURE__ */ __name((workspace, allWorkspaces, rootWorkspace, options) => {
|
|
4186
|
+
let rootRepositoryField = rootWorkspace?.packageJson?.repository;
|
|
4187
|
+
if (typeof rootRepositoryField === "string") {
|
|
4188
|
+
let result = parseGithubUrl(rootRepositoryField);
|
|
4189
|
+
if (result !== null && (result.host === "github.com" || result.host === "dev.azure.com")) {
|
|
4190
|
+
let baseRepositoryUrl = "";
|
|
4191
|
+
if (result.host === "github.com") {
|
|
4192
|
+
baseRepositoryUrl = `${result.protocol}//${result.host}/${result.owner}/${result.name}`;
|
|
4193
|
+
} else if (result.host === "dev.azure.com") {
|
|
4194
|
+
baseRepositoryUrl = `${result.protocol}//${result.host}/${result.owner}/${result.name}/_git/${result.filepath}`;
|
|
4195
|
+
}
|
|
4196
|
+
if (workspace === rootWorkspace) {
|
|
4197
|
+
let correctRepositoryField = baseRepositoryUrl;
|
|
4198
|
+
if (rootRepositoryField !== correctRepositoryField) {
|
|
4199
|
+
return [
|
|
4200
|
+
{
|
|
4201
|
+
type: "INCORRECT_REPOSITORY_FIELD",
|
|
4202
|
+
workspace,
|
|
4203
|
+
currentRepositoryField: rootRepositoryField,
|
|
4204
|
+
correctRepositoryField
|
|
4205
|
+
}
|
|
4206
|
+
];
|
|
4207
|
+
}
|
|
4208
|
+
} else {
|
|
4209
|
+
let correctRepositoryField = "";
|
|
4210
|
+
if (result.host === "github.com") {
|
|
4211
|
+
correctRepositoryField = `${baseRepositoryUrl}/tree/${options.defaultBranch}/${normalizePath2(workspace.relativeDir)}`;
|
|
4212
|
+
} else if (result.host === "dev.azure.com") {
|
|
4213
|
+
correctRepositoryField = `${baseRepositoryUrl}?path=${normalizePath2(workspace.relativeDir)}&version=GB${options.defaultBranch}&_a=contents`;
|
|
4214
|
+
}
|
|
4215
|
+
let currentRepositoryField = workspace.packageJson.repository;
|
|
4216
|
+
if (correctRepositoryField !== currentRepositoryField) {
|
|
4217
|
+
return [
|
|
4218
|
+
{
|
|
4219
|
+
type: "INCORRECT_REPOSITORY_FIELD",
|
|
4220
|
+
workspace,
|
|
4221
|
+
currentRepositoryField,
|
|
4222
|
+
correctRepositoryField
|
|
4223
|
+
}
|
|
4224
|
+
];
|
|
4225
|
+
}
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
return [];
|
|
4230
|
+
}, "validate"),
|
|
4231
|
+
fix: /* @__PURE__ */ __name((error2) => {
|
|
4232
|
+
error2.workspace.packageJson.repository = error2.correctRepositoryField;
|
|
4233
|
+
}, "fix"),
|
|
4234
|
+
print: /* @__PURE__ */ __name((error2) => {
|
|
4235
|
+
if (error2.currentRepositoryField === void 0) {
|
|
4236
|
+
return `${error2.workspace.packageJson.name} does not have a repository field when it should be ${JSON.stringify(error2.correctRepositoryField)}`;
|
|
4237
|
+
}
|
|
4238
|
+
return `${error2.workspace.packageJson.name} has a repository field of ${JSON.stringify(error2.currentRepositoryField)} when it should be ${JSON.stringify(error2.correctRepositoryField)}`;
|
|
4239
|
+
}, "print")
|
|
4240
|
+
});
|
|
4241
|
+
|
|
4242
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/WORKSPACE_REQUIRED.ts
|
|
4243
|
+
init_esm_shims();
|
|
4244
|
+
var WORKSPACE_REQUIRED_default = makeCheck({
|
|
4245
|
+
validate: /* @__PURE__ */ __name((workspace, allWorkspaces, root, opts) => {
|
|
4246
|
+
if (opts.workspaceProtocol !== "require") return [];
|
|
4247
|
+
let errors = [];
|
|
4248
|
+
for (let depType of NORMAL_DEPENDENCY_TYPES) {
|
|
4249
|
+
let deps = workspace.packageJson[depType];
|
|
4250
|
+
if (deps) {
|
|
4251
|
+
for (let depName in deps) {
|
|
4252
|
+
if (allWorkspaces.has(depName) && !deps[depName].startsWith("workspace:")) {
|
|
4253
|
+
errors.push({
|
|
4254
|
+
type: "WORKSPACE_REQUIRED",
|
|
4255
|
+
workspace,
|
|
4256
|
+
depName,
|
|
4257
|
+
depType
|
|
4258
|
+
});
|
|
4259
|
+
}
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
return errors;
|
|
4264
|
+
}, "validate"),
|
|
4265
|
+
fix: /* @__PURE__ */ __name((error2) => {
|
|
4266
|
+
let deps = error2.workspace.packageJson[error2.depType];
|
|
4267
|
+
if (deps && deps[error2.depName]) {
|
|
4268
|
+
deps[error2.depName] = "workspace:^";
|
|
4269
|
+
}
|
|
4270
|
+
return {
|
|
4271
|
+
requiresInstall: true
|
|
4272
|
+
};
|
|
4273
|
+
}, "fix"),
|
|
4274
|
+
print: /* @__PURE__ */ __name((error2) => `${error2.workspace.packageJson.name} has a dependency on ${error2.depName} without using the workspace: protocol but this project requires using the workspace: protocol, please change it to workspace:^ or etc.`, "print"),
|
|
4275
|
+
type: "all"
|
|
4276
|
+
});
|
|
4277
|
+
|
|
4278
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/checks/index.ts
|
|
4279
|
+
var checks = {
|
|
4280
|
+
EXTERNAL_MISMATCH: EXTERNAL_MISMATCH_default,
|
|
4281
|
+
INTERNAL_MISMATCH: INTERNAL_MISMATCH_default,
|
|
4282
|
+
INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP: INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP_default,
|
|
4283
|
+
INVALID_PACKAGE_NAME: INVALID_PACKAGE_NAME_default,
|
|
4284
|
+
MULTIPLE_DEPENDENCY_TYPES: MULTIPLE_DEPENDENCY_TYPES_default,
|
|
4285
|
+
ROOT_HAS_DEV_DEPENDENCIES: ROOT_HAS_DEV_DEPENDENCIES_default,
|
|
4286
|
+
UNSORTED_DEPENDENCIES: UNSORTED_DEPENDENCIES_default,
|
|
4287
|
+
INCORRECT_REPOSITORY_FIELD: INCORRECT_REPOSITORY_FIELD_default,
|
|
4288
|
+
WORKSPACE_REQUIRED: WORKSPACE_REQUIRED_default
|
|
4289
|
+
};
|
|
4290
|
+
|
|
4291
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/errors.ts
|
|
4292
|
+
init_esm_shims();
|
|
4293
|
+
var ExitError = class extends Error {
|
|
4294
|
+
static {
|
|
4295
|
+
__name(this, "ExitError");
|
|
4296
|
+
}
|
|
4297
|
+
code;
|
|
4298
|
+
constructor(code) {
|
|
4299
|
+
super(`The process should exit with code ${code}`);
|
|
4300
|
+
this.code = code;
|
|
4301
|
+
}
|
|
4302
|
+
};
|
|
4303
|
+
|
|
4304
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/npm-tag.ts
|
|
4305
|
+
init_esm_shims();
|
|
4306
|
+
var import_get_packages = __toESM(require_manypkg_get_packages_cjs());
|
|
3649
4307
|
import spawn from "spawndamnit";
|
|
4308
|
+
import pLimit from "p-limit";
|
|
4309
|
+
var npmLimit = pLimit(40);
|
|
4310
|
+
function getCorrectRegistry() {
|
|
4311
|
+
let registry = process.env.npm_config_registry === "https://registry.yarnpkg.com" ? void 0 : process.env.npm_config_registry;
|
|
4312
|
+
return registry;
|
|
4313
|
+
}
|
|
4314
|
+
__name(getCorrectRegistry, "getCorrectRegistry");
|
|
4315
|
+
async function tagApackage(packageJson, tag, otpCode) {
|
|
4316
|
+
const envOverride = {
|
|
4317
|
+
npm_config_registry: getCorrectRegistry()
|
|
4318
|
+
};
|
|
4319
|
+
let flags = [];
|
|
4320
|
+
if (otpCode) {
|
|
4321
|
+
flags.push("--otp", otpCode);
|
|
4322
|
+
}
|
|
4323
|
+
return await spawn("npm", [
|
|
4324
|
+
"dist-tag",
|
|
4325
|
+
"add",
|
|
4326
|
+
`${packageJson.name}@${packageJson.version}`,
|
|
4327
|
+
tag,
|
|
4328
|
+
...flags
|
|
4329
|
+
], {
|
|
4330
|
+
stdio: "inherit",
|
|
4331
|
+
env: Object.assign({}, process.env, envOverride)
|
|
4332
|
+
});
|
|
4333
|
+
}
|
|
4334
|
+
__name(tagApackage, "tagApackage");
|
|
4335
|
+
async function npmTagAll([tag, _, otp]) {
|
|
4336
|
+
let { packages } = await (0, import_get_packages.getPackages)(process.cwd());
|
|
4337
|
+
await Promise.all(packages.filter(({ packageJson }) => packageJson.private !== true).map(({ packageJson }) => npmLimit(() => tagApackage(packageJson, tag, otp))));
|
|
4338
|
+
}
|
|
4339
|
+
__name(npmTagAll, "npmTagAll");
|
|
4340
|
+
|
|
4341
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/run.ts
|
|
4342
|
+
init_esm_shims();
|
|
4343
|
+
var import_get_packages2 = __toESM(require_manypkg_get_packages_cjs());
|
|
4344
|
+
import spawn2 from "spawndamnit";
|
|
4345
|
+
|
|
4346
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/logger.ts
|
|
4347
|
+
init_esm_shims();
|
|
4348
|
+
import chalk5 from "chalk";
|
|
4349
|
+
import util from "util";
|
|
4350
|
+
function format4(args, messageType, scope) {
|
|
4351
|
+
let prefix = {
|
|
4352
|
+
error: chalk5.red("error"),
|
|
4353
|
+
success: chalk5.green("success"),
|
|
4354
|
+
info: chalk5.cyan("info")
|
|
4355
|
+
}[messageType];
|
|
4356
|
+
let fullPrefix = "\u2614\uFE0F " + prefix + (scope === void 0 ? "" : " " + scope);
|
|
4357
|
+
return fullPrefix + util.format("", ...args).split("\n").join("\n" + fullPrefix + " ");
|
|
4358
|
+
}
|
|
4359
|
+
__name(format4, "format");
|
|
4360
|
+
function error(message, scope) {
|
|
4361
|
+
console.error(format4([
|
|
4362
|
+
message
|
|
4363
|
+
], "error", scope));
|
|
4364
|
+
}
|
|
4365
|
+
__name(error, "error");
|
|
4366
|
+
|
|
4367
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/run.ts
|
|
4368
|
+
async function runCmd(args, cwd) {
|
|
4369
|
+
let { packages, rootDir } = await (0, import_get_packages2.getPackages)(cwd);
|
|
4370
|
+
const exactMatchingPackage = packages.find((pkg) => {
|
|
4371
|
+
return pkg.packageJson.name === args[0] || pkg.relativeDir === args[0];
|
|
4372
|
+
});
|
|
4373
|
+
if (exactMatchingPackage) {
|
|
4374
|
+
const { code } = await spawn2("yarn", args.slice(1), {
|
|
4375
|
+
cwd: exactMatchingPackage.dir,
|
|
4376
|
+
stdio: "inherit"
|
|
4377
|
+
});
|
|
4378
|
+
throw new ExitError(code);
|
|
4379
|
+
}
|
|
4380
|
+
const matchingPackages = packages.filter((pkg) => {
|
|
4381
|
+
return pkg.packageJson.name.includes(args[0]) || pkg.relativeDir.includes(args[0]);
|
|
4382
|
+
});
|
|
4383
|
+
if (matchingPackages.length > 1) {
|
|
4384
|
+
error(`an identifier must only match a single package but "${args[0]}" matches the following packages:
|
|
4385
|
+
${matchingPackages.map((x) => x.packageJson.name).join("\n")}`);
|
|
4386
|
+
throw new ExitError(1);
|
|
4387
|
+
} else if (matchingPackages.length === 0) {
|
|
4388
|
+
error("No matching packages found");
|
|
4389
|
+
throw new ExitError(1);
|
|
4390
|
+
} else {
|
|
4391
|
+
const { code } = await spawn2("yarn", args.slice(1), {
|
|
4392
|
+
cwd: matchingPackages[0].dir,
|
|
4393
|
+
stdio: "inherit"
|
|
4394
|
+
});
|
|
4395
|
+
throw new ExitError(code);
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
__name(runCmd, "runCmd");
|
|
4399
|
+
|
|
4400
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/upgrade.ts
|
|
4401
|
+
init_esm_shims();
|
|
4402
|
+
var import_get_packages3 = __toESM(require_manypkg_get_packages_cjs());
|
|
4403
|
+
import semver4 from "semver";
|
|
4404
|
+
import pLimit2 from "p-limit";
|
|
4405
|
+
|
|
4406
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/utils.ts
|
|
4407
|
+
init_esm_shims();
|
|
4408
|
+
import * as fs4 from "fs-extra";
|
|
4409
|
+
import path9 from "path";
|
|
4410
|
+
import spawn3 from "spawndamnit";
|
|
4411
|
+
import detectIndent from "detect-indent";
|
|
4412
|
+
async function writePackage(pkg) {
|
|
4413
|
+
let pkgRaw = await fs4.readFile(path9.join(pkg.dir, "package.json"), "utf-8");
|
|
4414
|
+
let indent = detectIndent(pkgRaw).indent || " ";
|
|
4415
|
+
return fs4.writeFile(path9.join(pkg.dir, "package.json"), JSON.stringify(pkg.packageJson, null, indent) + (pkgRaw.endsWith("\n") ? "\n" : ""));
|
|
4416
|
+
}
|
|
4417
|
+
__name(writePackage, "writePackage");
|
|
4418
|
+
async function install(toolType, cwd) {
|
|
4419
|
+
const cliRunners = {
|
|
4420
|
+
bolt: "bolt",
|
|
4421
|
+
lerna: "lerna",
|
|
4422
|
+
pnpm: "pnpm",
|
|
4423
|
+
root: "yarn",
|
|
4424
|
+
rush: "rushx",
|
|
4425
|
+
yarn: "yarn"
|
|
4426
|
+
};
|
|
4427
|
+
await spawn3(cliRunners[toolType], toolType === "pnpm" ? [
|
|
4428
|
+
"install"
|
|
4429
|
+
] : toolType === "lerna" ? [
|
|
4430
|
+
"bootstrap",
|
|
4431
|
+
"--since",
|
|
4432
|
+
"HEAD"
|
|
4433
|
+
] : [], {
|
|
4434
|
+
cwd,
|
|
4435
|
+
stdio: "inherit"
|
|
4436
|
+
});
|
|
4437
|
+
}
|
|
4438
|
+
__name(install, "install");
|
|
4439
|
+
|
|
4440
|
+
// ../../node_modules/.pnpm/@manypkg+cli@0.21.4/node_modules/@manypkg/cli/src/upgrade.ts
|
|
4441
|
+
async function upgradeDependency([name, tag = "latest"]) {
|
|
4442
|
+
let { packages, tool, rootPackage, rootDir } = await (0, import_get_packages3.getPackages)(process.cwd());
|
|
4443
|
+
let isScope = name.startsWith("@") && !name.includes("/");
|
|
4444
|
+
let newVersion = semver4.validRange(tag) ? tag : null;
|
|
4445
|
+
let packagesToUpdate = /* @__PURE__ */ new Set();
|
|
4446
|
+
let filteredPackages = packages.filter(({ packageJson }) => {
|
|
4447
|
+
let requiresUpdate = false;
|
|
4448
|
+
DEPENDENCY_TYPES.forEach((t) => {
|
|
4449
|
+
let deps = packageJson[t];
|
|
4450
|
+
if (!deps) return;
|
|
4451
|
+
let packageNames = Object.keys(deps);
|
|
4452
|
+
packageNames.forEach((pkgName) => {
|
|
4453
|
+
if (isScope && pkgName.startsWith(`${name}/`) || pkgName === name) {
|
|
4454
|
+
requiresUpdate = true;
|
|
4455
|
+
packagesToUpdate.add(pkgName);
|
|
4456
|
+
}
|
|
4457
|
+
});
|
|
4458
|
+
});
|
|
4459
|
+
return requiresUpdate;
|
|
4460
|
+
});
|
|
4461
|
+
if (rootPackage) {
|
|
4462
|
+
let rootRequiresUpdate = false;
|
|
4463
|
+
DEPENDENCY_TYPES.forEach((t) => {
|
|
4464
|
+
let deps = rootPackage.packageJson[t];
|
|
4465
|
+
if (!deps) return;
|
|
4466
|
+
let packageNames = Object.keys(deps);
|
|
4467
|
+
packageNames.forEach((pkgName) => {
|
|
4468
|
+
if (isScope && pkgName.startsWith(`${name}/`) || pkgName === name) {
|
|
4469
|
+
rootRequiresUpdate = true;
|
|
4470
|
+
packagesToUpdate.add(pkgName);
|
|
4471
|
+
}
|
|
4472
|
+
});
|
|
4473
|
+
if (rootRequiresUpdate) {
|
|
4474
|
+
filteredPackages.push(rootPackage);
|
|
4475
|
+
}
|
|
4476
|
+
});
|
|
4477
|
+
}
|
|
4478
|
+
let newVersions = await Promise.all([
|
|
4479
|
+
...packagesToUpdate
|
|
4480
|
+
].map(async (pkgName) => {
|
|
4481
|
+
if (!newVersion) {
|
|
4482
|
+
let info = await getPackageInfo(pkgName);
|
|
4483
|
+
let distTags = info["dist-tags"];
|
|
4484
|
+
let version2 = distTags[tag];
|
|
4485
|
+
return {
|
|
4486
|
+
pkgName,
|
|
4487
|
+
version: version2
|
|
4488
|
+
};
|
|
4489
|
+
} else {
|
|
4490
|
+
return {
|
|
4491
|
+
pkgName,
|
|
4492
|
+
version: newVersion
|
|
4493
|
+
};
|
|
4494
|
+
}
|
|
4495
|
+
}));
|
|
4496
|
+
filteredPackages.forEach(({ packageJson }) => {
|
|
4497
|
+
DEPENDENCY_TYPES.forEach((t) => {
|
|
4498
|
+
let deps = packageJson[t];
|
|
4499
|
+
if (deps) {
|
|
4500
|
+
newVersions.forEach(({ pkgName, version: version2 }) => {
|
|
4501
|
+
if (deps[pkgName] && version2) {
|
|
4502
|
+
if (!newVersion) {
|
|
4503
|
+
deps[pkgName] = `${versionRangeToRangeType(deps[pkgName])}${version2}`;
|
|
4504
|
+
} else {
|
|
4505
|
+
deps[pkgName] = version2;
|
|
4506
|
+
}
|
|
4507
|
+
}
|
|
4508
|
+
});
|
|
4509
|
+
}
|
|
4510
|
+
});
|
|
4511
|
+
});
|
|
4512
|
+
await Promise.all([
|
|
4513
|
+
...filteredPackages
|
|
4514
|
+
].map(writePackage));
|
|
4515
|
+
await install(tool.type, rootDir);
|
|
4516
|
+
}
|
|
4517
|
+
__name(upgradeDependency, "upgradeDependency");
|
|
4518
|
+
var npmRequestLimit = pLimit2(40);
|
|
4519
|
+
function getPackageInfo(pkgName) {
|
|
4520
|
+
return npmRequestLimit(async () => {
|
|
4521
|
+
const getPackageJson = (await import("package-json")).default;
|
|
4522
|
+
return getPackageJson(pkgName, {
|
|
4523
|
+
allVersions: true
|
|
4524
|
+
});
|
|
4525
|
+
});
|
|
4526
|
+
}
|
|
4527
|
+
__name(getPackageInfo, "getPackageInfo");
|
|
4528
|
+
|
|
4529
|
+
// src/manypkg/index.ts
|
|
4530
|
+
var import_get_packages4 = __toESM(require_manypkg_get_packages_cjs(), 1);
|
|
4531
|
+
import pLimit3 from "p-limit";
|
|
4532
|
+
import spawn4 from "spawndamnit";
|
|
3650
4533
|
var defaultOptions = {
|
|
3651
4534
|
defaultBranch: "main"
|
|
3652
4535
|
};
|
|
@@ -3662,8 +4545,8 @@ var runChecks = /* @__PURE__ */ __name((allWorkspaces, rootWorkspace, shouldFix,
|
|
|
3662
4545
|
for (const [, workspace] of allWorkspaces) {
|
|
3663
4546
|
const errors = check.validate(workspace, allWorkspaces, rootWorkspace, options);
|
|
3664
4547
|
if (shouldFix && check.fix !== void 0) {
|
|
3665
|
-
for (const
|
|
3666
|
-
const output = check.fix(
|
|
4548
|
+
for (const error2 of errors) {
|
|
4549
|
+
const output = check.fix(error2, options) || {
|
|
3667
4550
|
requiresInstall: false
|
|
3668
4551
|
};
|
|
3669
4552
|
if (output.requiresInstall) {
|
|
@@ -3671,9 +4554,9 @@ var runChecks = /* @__PURE__ */ __name((allWorkspaces, rootWorkspace, shouldFix,
|
|
|
3671
4554
|
}
|
|
3672
4555
|
}
|
|
3673
4556
|
} else {
|
|
3674
|
-
for (const
|
|
4557
|
+
for (const error2 of errors) {
|
|
3675
4558
|
hasErrored = true;
|
|
3676
|
-
console.error(check.print(
|
|
4559
|
+
console.error(check.print(error2, options));
|
|
3677
4560
|
}
|
|
3678
4561
|
}
|
|
3679
4562
|
}
|
|
@@ -3681,8 +4564,8 @@ var runChecks = /* @__PURE__ */ __name((allWorkspaces, rootWorkspace, shouldFix,
|
|
|
3681
4564
|
if (check.type === "root" && rootWorkspace) {
|
|
3682
4565
|
const errors = check.validate(rootWorkspace, allWorkspaces, options);
|
|
3683
4566
|
if (shouldFix && check.fix !== void 0) {
|
|
3684
|
-
for (const
|
|
3685
|
-
const output = check.fix(
|
|
4567
|
+
for (const error2 of errors) {
|
|
4568
|
+
const output = check.fix(error2, options) || {
|
|
3686
4569
|
requiresInstall: false
|
|
3687
4570
|
};
|
|
3688
4571
|
if (output.requiresInstall) {
|
|
@@ -3690,9 +4573,9 @@ var runChecks = /* @__PURE__ */ __name((allWorkspaces, rootWorkspace, shouldFix,
|
|
|
3690
4573
|
}
|
|
3691
4574
|
}
|
|
3692
4575
|
} else {
|
|
3693
|
-
for (const
|
|
4576
|
+
for (const error2 of errors) {
|
|
3694
4577
|
hasErrored = true;
|
|
3695
|
-
console.error(check.print(
|
|
4578
|
+
console.error(check.print(error2, options));
|
|
3696
4579
|
}
|
|
3697
4580
|
}
|
|
3698
4581
|
}
|
|
@@ -3702,13 +4585,13 @@ var runChecks = /* @__PURE__ */ __name((allWorkspaces, rootWorkspace, shouldFix,
|
|
|
3702
4585
|
hasErrored
|
|
3703
4586
|
};
|
|
3704
4587
|
}, "runChecks");
|
|
3705
|
-
var execLimit =
|
|
4588
|
+
var execLimit = pLimit3(4);
|
|
3706
4589
|
async function execCmd(args) {
|
|
3707
|
-
const { packages } = await getPackages(process.cwd());
|
|
4590
|
+
const { packages } = await (0, import_get_packages4.getPackages)(process.cwd());
|
|
3708
4591
|
let highestExitCode = 0;
|
|
3709
4592
|
await Promise.all(packages.map((pkg) => {
|
|
3710
4593
|
return execLimit(async () => {
|
|
3711
|
-
const { code } = await
|
|
4594
|
+
const { code } = await spawn4(args[0], args.slice(1), {
|
|
3712
4595
|
cwd: pkg.dir,
|
|
3713
4596
|
stdio: "inherit"
|
|
3714
4597
|
});
|
|
@@ -3743,7 +4626,7 @@ async function runManypkg(manypkgType = "fix", manypkgArgs) {
|
|
|
3743
4626
|
console.error(`command ${manypkgType} not found, only check, exec, run, upgrade, npm-tag and fix exist`);
|
|
3744
4627
|
process.exit(1);
|
|
3745
4628
|
}
|
|
3746
|
-
const { packages, rootPackage, rootDir } = await getPackages(process.env.STORM_WORKSPACE_ROOT ? process.env.STORM_WORKSPACE_ROOT : process.cwd());
|
|
4629
|
+
const { packages, rootPackage, rootDir } = await (0, import_get_packages4.getPackages)(process.env.STORM_WORKSPACE_ROOT ? process.env.STORM_WORKSPACE_ROOT : process.cwd());
|
|
3747
4630
|
const options = {
|
|
3748
4631
|
...defaultOptions,
|
|
3749
4632
|
...rootPackage?.packageJson.manypkg
|
|
@@ -4002,10 +4885,10 @@ void (async () => {
|
|
|
4002
4885
|
await program.parseAsync(process.argv);
|
|
4003
4886
|
writeSuccess("\u{1F389} Code linting and fixing completed successfully!", config);
|
|
4004
4887
|
exitWithSuccess(config);
|
|
4005
|
-
} catch (
|
|
4888
|
+
} catch (error2) {
|
|
4006
4889
|
writeFatal(`A fatal error occurred while running the Storm Lint tool:
|
|
4007
|
-
${
|
|
4008
|
-
Stack Trace: ${
|
|
4890
|
+
${error2?.message ? error2.message : JSON.stringify(error2)}${error2?.stack ? `
|
|
4891
|
+
Stack Trace: ${error2.stack}` : ""}`, config);
|
|
4009
4892
|
exitWithError(config);
|
|
4010
4893
|
process.exit(1);
|
|
4011
4894
|
}
|