@wise/wds-codemods 1.0.0-experimental-37647bf → 1.0.0-experimental-31a00f9
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 +101 -83
- package/dist/constants-CcE2TmzN.js +59 -0
- package/dist/constants-CcE2TmzN.js.map +1 -0
- package/dist/{helpers-BNLAPdMR.js → helpers-IFtIGywc.js} +187 -160
- package/dist/helpers-IFtIGywc.js.map +1 -0
- package/dist/index.js +71 -40
- package/dist/index.js.map +1 -1
- package/dist/transformer-DoAMzZmy.js +468 -0
- package/dist/transformer-DoAMzZmy.js.map +1 -0
- package/dist/transforms/button/transformer.js +2 -1
- package/dist/transforms/button/transformer.js.map +1 -1
- package/dist/transforms/list-item/config.json +6 -0
- package/dist/transforms/list-item/transformer.js +4 -0
- package/package.json +9 -4
- package/dist/helpers-BNLAPdMR.js.map +0 -1
|
@@ -1,41 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
-
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
-
__defProp(to, key, {
|
|
15
|
-
get: ((k) => from[k]).bind(null, key),
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
-
value: mod,
|
|
25
|
-
enumerable: true
|
|
26
|
-
}) : target, mod));
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
1
|
+
const require_constants$1 = require('./constants-CcE2TmzN.js');
|
|
29
2
|
let node_child_process = require("node:child_process");
|
|
30
3
|
let node_fs_promises = require("node:fs/promises");
|
|
31
|
-
node_fs_promises = __toESM(node_fs_promises);
|
|
4
|
+
node_fs_promises = require_constants$1.__toESM(node_fs_promises);
|
|
32
5
|
let node_path = require("node:path");
|
|
33
|
-
node_path = __toESM(node_path);
|
|
6
|
+
node_path = require_constants$1.__toESM(node_path);
|
|
34
7
|
let __inquirer_prompts = require("@inquirer/prompts");
|
|
35
8
|
let node_fs = require("node:fs");
|
|
9
|
+
node_fs = require_constants$1.__toESM(node_fs);
|
|
10
|
+
let node_util = require("node:util");
|
|
36
11
|
|
|
37
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
38
|
-
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js
|
|
13
|
+
var require_constants = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
39
14
|
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
40
15
|
const MAX_LENGTH$2 = 256;
|
|
41
16
|
const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
@@ -63,15 +38,15 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
63
38
|
}));
|
|
64
39
|
|
|
65
40
|
//#endregion
|
|
66
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
67
|
-
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
41
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js
|
|
42
|
+
var require_debug = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
68
43
|
const debug$4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
69
44
|
module.exports = debug$4;
|
|
70
45
|
}));
|
|
71
46
|
|
|
72
47
|
//#endregion
|
|
73
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
74
|
-
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
48
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js
|
|
49
|
+
var require_re = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
75
50
|
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
|
|
76
51
|
const debug$3 = require_debug();
|
|
77
52
|
exports = module.exports = {};
|
|
@@ -150,8 +125,8 @@ var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150
125
|
}));
|
|
151
126
|
|
|
152
127
|
//#endregion
|
|
153
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
154
|
-
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
128
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js
|
|
129
|
+
var require_parse_options = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
155
130
|
const looseOption = Object.freeze({ loose: true });
|
|
156
131
|
const emptyOpts = Object.freeze({});
|
|
157
132
|
const parseOptions$3 = (options) => {
|
|
@@ -163,11 +138,10 @@ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
163
138
|
}));
|
|
164
139
|
|
|
165
140
|
//#endregion
|
|
166
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
167
|
-
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
141
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js
|
|
142
|
+
var require_identifiers = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
168
143
|
const numeric = /^[0-9]+$/;
|
|
169
144
|
const compareIdentifiers$1 = (a, b) => {
|
|
170
|
-
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
171
145
|
const anum = numeric.test(a);
|
|
172
146
|
const bnum = numeric.test(b);
|
|
173
147
|
if (anum && bnum) {
|
|
@@ -184,8 +158,8 @@ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
184
158
|
}));
|
|
185
159
|
|
|
186
160
|
//#endregion
|
|
187
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
188
|
-
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
161
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
|
|
162
|
+
var require_semver$1 = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
189
163
|
const debug$2 = require_debug();
|
|
190
164
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
191
165
|
const { safeRe: re$3, t: t$3 } = require_re();
|
|
@@ -241,13 +215,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
241
215
|
}
|
|
242
216
|
compareMain(other) {
|
|
243
217
|
if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
|
|
244
|
-
|
|
245
|
-
if (this.major > other.major) return 1;
|
|
246
|
-
if (this.minor < other.minor) return -1;
|
|
247
|
-
if (this.minor > other.minor) return 1;
|
|
248
|
-
if (this.patch < other.patch) return -1;
|
|
249
|
-
if (this.patch > other.patch) return 1;
|
|
250
|
-
return 0;
|
|
218
|
+
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
251
219
|
}
|
|
252
220
|
comparePre(other) {
|
|
253
221
|
if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
|
|
@@ -364,8 +332,8 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
364
332
|
}));
|
|
365
333
|
|
|
366
334
|
//#endregion
|
|
367
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
368
|
-
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
335
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js
|
|
336
|
+
var require_parse = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
369
337
|
const SemVer$14 = require_semver$1();
|
|
370
338
|
const parse$6 = (version, options, throwErrors = false) => {
|
|
371
339
|
if (version instanceof SemVer$14) return version;
|
|
@@ -380,8 +348,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
380
348
|
}));
|
|
381
349
|
|
|
382
350
|
//#endregion
|
|
383
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
384
|
-
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
351
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js
|
|
352
|
+
var require_valid$1 = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
385
353
|
const parse$5 = require_parse();
|
|
386
354
|
const valid$1 = (version, options) => {
|
|
387
355
|
const v = parse$5(version, options);
|
|
@@ -391,8 +359,8 @@ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
391
359
|
}));
|
|
392
360
|
|
|
393
361
|
//#endregion
|
|
394
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
395
|
-
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
362
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js
|
|
363
|
+
var require_clean = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
396
364
|
const parse$4 = require_parse();
|
|
397
365
|
const clean$1 = (version, options) => {
|
|
398
366
|
const s = parse$4(version.trim().replace(/^[=v]+/, ""), options);
|
|
@@ -402,8 +370,8 @@ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
402
370
|
}));
|
|
403
371
|
|
|
404
372
|
//#endregion
|
|
405
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
406
|
-
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
373
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js
|
|
374
|
+
var require_inc = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
407
375
|
const SemVer$13 = require_semver$1();
|
|
408
376
|
const inc$1 = (version, release, options, identifier, identifierBase) => {
|
|
409
377
|
if (typeof options === "string") {
|
|
@@ -421,8 +389,8 @@ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
421
389
|
}));
|
|
422
390
|
|
|
423
391
|
//#endregion
|
|
424
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
425
|
-
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
392
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js
|
|
393
|
+
var require_diff = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
426
394
|
const parse$3 = require_parse();
|
|
427
395
|
const diff$1 = (version1, version2) => {
|
|
428
396
|
const v1 = parse$3(version1, null, true);
|
|
@@ -450,32 +418,32 @@ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
450
418
|
}));
|
|
451
419
|
|
|
452
420
|
//#endregion
|
|
453
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
454
|
-
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
421
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js
|
|
422
|
+
var require_major = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
455
423
|
const SemVer$12 = require_semver$1();
|
|
456
424
|
const major$1 = (a, loose) => new SemVer$12(a, loose).major;
|
|
457
425
|
module.exports = major$1;
|
|
458
426
|
}));
|
|
459
427
|
|
|
460
428
|
//#endregion
|
|
461
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
462
|
-
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
429
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js
|
|
430
|
+
var require_minor = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
463
431
|
const SemVer$11 = require_semver$1();
|
|
464
432
|
const minor$1 = (a, loose) => new SemVer$11(a, loose).minor;
|
|
465
433
|
module.exports = minor$1;
|
|
466
434
|
}));
|
|
467
435
|
|
|
468
436
|
//#endregion
|
|
469
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
470
|
-
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
437
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js
|
|
438
|
+
var require_patch = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
471
439
|
const SemVer$10 = require_semver$1();
|
|
472
440
|
const patch$1 = (a, loose) => new SemVer$10(a, loose).patch;
|
|
473
441
|
module.exports = patch$1;
|
|
474
442
|
}));
|
|
475
443
|
|
|
476
444
|
//#endregion
|
|
477
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
478
|
-
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
445
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js
|
|
446
|
+
var require_prerelease = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
479
447
|
const parse$2 = require_parse();
|
|
480
448
|
const prerelease$1 = (version, options) => {
|
|
481
449
|
const parsed = parse$2(version, options);
|
|
@@ -485,32 +453,32 @@ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
485
453
|
}));
|
|
486
454
|
|
|
487
455
|
//#endregion
|
|
488
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
489
|
-
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
456
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
|
|
457
|
+
var require_compare = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
490
458
|
const SemVer$9 = require_semver$1();
|
|
491
459
|
const compare$11 = (a, b, loose) => new SemVer$9(a, loose).compare(new SemVer$9(b, loose));
|
|
492
460
|
module.exports = compare$11;
|
|
493
461
|
}));
|
|
494
462
|
|
|
495
463
|
//#endregion
|
|
496
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
497
|
-
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
464
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js
|
|
465
|
+
var require_rcompare = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
498
466
|
const compare$10 = require_compare();
|
|
499
467
|
const rcompare$1 = (a, b, loose) => compare$10(b, a, loose);
|
|
500
468
|
module.exports = rcompare$1;
|
|
501
469
|
}));
|
|
502
470
|
|
|
503
471
|
//#endregion
|
|
504
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
505
|
-
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
472
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js
|
|
473
|
+
var require_compare_loose = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
506
474
|
const compare$9 = require_compare();
|
|
507
475
|
const compareLoose$1 = (a, b) => compare$9(a, b, true);
|
|
508
476
|
module.exports = compareLoose$1;
|
|
509
477
|
}));
|
|
510
478
|
|
|
511
479
|
//#endregion
|
|
512
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
513
|
-
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
480
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js
|
|
481
|
+
var require_compare_build = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
514
482
|
const SemVer$8 = require_semver$1();
|
|
515
483
|
const compareBuild$3 = (a, b, loose) => {
|
|
516
484
|
const versionA = new SemVer$8(a, loose);
|
|
@@ -521,72 +489,72 @@ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
521
489
|
}));
|
|
522
490
|
|
|
523
491
|
//#endregion
|
|
524
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
525
|
-
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
492
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js
|
|
493
|
+
var require_sort = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
526
494
|
const compareBuild$2 = require_compare_build();
|
|
527
495
|
const sort$1 = (list$1, loose) => list$1.sort((a, b) => compareBuild$2(a, b, loose));
|
|
528
496
|
module.exports = sort$1;
|
|
529
497
|
}));
|
|
530
498
|
|
|
531
499
|
//#endregion
|
|
532
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
533
|
-
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
500
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js
|
|
501
|
+
var require_rsort = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
534
502
|
const compareBuild$1 = require_compare_build();
|
|
535
503
|
const rsort$1 = (list$1, loose) => list$1.sort((a, b) => compareBuild$1(b, a, loose));
|
|
536
504
|
module.exports = rsort$1;
|
|
537
505
|
}));
|
|
538
506
|
|
|
539
507
|
//#endregion
|
|
540
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
541
|
-
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
508
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js
|
|
509
|
+
var require_gt = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
542
510
|
const compare$8 = require_compare();
|
|
543
511
|
const gt$4 = (a, b, loose) => compare$8(a, b, loose) > 0;
|
|
544
512
|
module.exports = gt$4;
|
|
545
513
|
}));
|
|
546
514
|
|
|
547
515
|
//#endregion
|
|
548
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
549
|
-
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
516
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js
|
|
517
|
+
var require_lt = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
550
518
|
const compare$7 = require_compare();
|
|
551
519
|
const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0;
|
|
552
520
|
module.exports = lt$3;
|
|
553
521
|
}));
|
|
554
522
|
|
|
555
523
|
//#endregion
|
|
556
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
557
|
-
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
524
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js
|
|
525
|
+
var require_eq = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
558
526
|
const compare$6 = require_compare();
|
|
559
527
|
const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0;
|
|
560
528
|
module.exports = eq$2;
|
|
561
529
|
}));
|
|
562
530
|
|
|
563
531
|
//#endregion
|
|
564
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
565
|
-
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
532
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js
|
|
533
|
+
var require_neq = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
566
534
|
const compare$5 = require_compare();
|
|
567
535
|
const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0;
|
|
568
536
|
module.exports = neq$2;
|
|
569
537
|
}));
|
|
570
538
|
|
|
571
539
|
//#endregion
|
|
572
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
573
|
-
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
540
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js
|
|
541
|
+
var require_gte = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
574
542
|
const compare$4 = require_compare();
|
|
575
543
|
const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0;
|
|
576
544
|
module.exports = gte$3;
|
|
577
545
|
}));
|
|
578
546
|
|
|
579
547
|
//#endregion
|
|
580
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
581
|
-
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
548
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js
|
|
549
|
+
var require_lte = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
582
550
|
const compare$3 = require_compare();
|
|
583
551
|
const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0;
|
|
584
552
|
module.exports = lte$3;
|
|
585
553
|
}));
|
|
586
554
|
|
|
587
555
|
//#endregion
|
|
588
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
589
|
-
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
556
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js
|
|
557
|
+
var require_cmp = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
590
558
|
const eq$1 = require_eq();
|
|
591
559
|
const neq$1 = require_neq();
|
|
592
560
|
const gt$3 = require_gt();
|
|
@@ -618,8 +586,8 @@ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
618
586
|
}));
|
|
619
587
|
|
|
620
588
|
//#endregion
|
|
621
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
622
|
-
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
589
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js
|
|
590
|
+
var require_coerce = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
623
591
|
const SemVer$7 = require_semver$1();
|
|
624
592
|
const parse$1 = require_parse();
|
|
625
593
|
const { safeRe: re$2, t: t$2 } = require_re();
|
|
@@ -647,8 +615,8 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
647
615
|
}));
|
|
648
616
|
|
|
649
617
|
//#endregion
|
|
650
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
651
|
-
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
618
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js
|
|
619
|
+
var require_lrucache = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
652
620
|
var LRUCache = class {
|
|
653
621
|
constructor() {
|
|
654
622
|
this.max = 1e3;
|
|
@@ -681,8 +649,8 @@ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
681
649
|
}));
|
|
682
650
|
|
|
683
651
|
//#endregion
|
|
684
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
685
|
-
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
652
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js
|
|
653
|
+
var require_range = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
686
654
|
const SPACE_CHARACTERS = /\s+/g;
|
|
687
655
|
var Range$11 = class Range$11 {
|
|
688
656
|
constructor(range, options) {
|
|
@@ -811,7 +779,6 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
811
779
|
return result;
|
|
812
780
|
};
|
|
813
781
|
const parseComparator = (comp, options) => {
|
|
814
|
-
comp = comp.replace(re$1[t$1.BUILD], "");
|
|
815
782
|
debug$1("comp", comp, options);
|
|
816
783
|
comp = replaceCarets(comp, options);
|
|
817
784
|
debug$1("caret", comp);
|
|
@@ -955,8 +922,8 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
955
922
|
}));
|
|
956
923
|
|
|
957
924
|
//#endregion
|
|
958
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
959
|
-
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
925
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js
|
|
926
|
+
var require_comparator = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
960
927
|
const ANY$2 = Symbol("SemVer ANY");
|
|
961
928
|
var Comparator$3 = class Comparator$3 {
|
|
962
929
|
static get ANY() {
|
|
@@ -1027,8 +994,8 @@ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1027
994
|
}));
|
|
1028
995
|
|
|
1029
996
|
//#endregion
|
|
1030
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1031
|
-
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
997
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js
|
|
998
|
+
var require_satisfies = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1032
999
|
const Range$9 = require_range();
|
|
1033
1000
|
const satisfies$4 = (version, range, options) => {
|
|
1034
1001
|
try {
|
|
@@ -1042,16 +1009,16 @@ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1042
1009
|
}));
|
|
1043
1010
|
|
|
1044
1011
|
//#endregion
|
|
1045
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1046
|
-
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1012
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js
|
|
1013
|
+
var require_to_comparators = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1047
1014
|
const Range$8 = require_range();
|
|
1048
1015
|
const toComparators$1 = (range, options) => new Range$8(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1049
1016
|
module.exports = toComparators$1;
|
|
1050
1017
|
}));
|
|
1051
1018
|
|
|
1052
1019
|
//#endregion
|
|
1053
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1054
|
-
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1020
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js
|
|
1021
|
+
var require_max_satisfying = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1055
1022
|
const SemVer$4 = require_semver$1();
|
|
1056
1023
|
const Range$7 = require_range();
|
|
1057
1024
|
const maxSatisfying$1 = (versions, range, options) => {
|
|
@@ -1077,8 +1044,8 @@ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
1077
1044
|
}));
|
|
1078
1045
|
|
|
1079
1046
|
//#endregion
|
|
1080
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1081
|
-
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1047
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js
|
|
1048
|
+
var require_min_satisfying = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1082
1049
|
const SemVer$3 = require_semver$1();
|
|
1083
1050
|
const Range$6 = require_range();
|
|
1084
1051
|
const minSatisfying$1 = (versions, range, options) => {
|
|
@@ -1104,8 +1071,8 @@ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
1104
1071
|
}));
|
|
1105
1072
|
|
|
1106
1073
|
//#endregion
|
|
1107
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1108
|
-
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1074
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js
|
|
1075
|
+
var require_min_version = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1109
1076
|
const SemVer$2 = require_semver$1();
|
|
1110
1077
|
const Range$5 = require_range();
|
|
1111
1078
|
const gt$2 = require_gt();
|
|
@@ -1144,8 +1111,8 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1144
1111
|
}));
|
|
1145
1112
|
|
|
1146
1113
|
//#endregion
|
|
1147
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1148
|
-
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1114
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js
|
|
1115
|
+
var require_valid = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1149
1116
|
const Range$4 = require_range();
|
|
1150
1117
|
const validRange$1 = (range, options) => {
|
|
1151
1118
|
try {
|
|
@@ -1158,8 +1125,8 @@ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1158
1125
|
}));
|
|
1159
1126
|
|
|
1160
1127
|
//#endregion
|
|
1161
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1162
|
-
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1128
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js
|
|
1129
|
+
var require_outside = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1163
1130
|
const SemVer$1 = require_semver$1();
|
|
1164
1131
|
const Comparator$2 = require_comparator();
|
|
1165
1132
|
const { ANY: ANY$1 } = Comparator$2;
|
|
@@ -1212,24 +1179,24 @@ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1212
1179
|
}));
|
|
1213
1180
|
|
|
1214
1181
|
//#endregion
|
|
1215
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1216
|
-
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1182
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js
|
|
1183
|
+
var require_gtr = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1217
1184
|
const outside$2 = require_outside();
|
|
1218
1185
|
const gtr$1 = (version, range, options) => outside$2(version, range, ">", options);
|
|
1219
1186
|
module.exports = gtr$1;
|
|
1220
1187
|
}));
|
|
1221
1188
|
|
|
1222
1189
|
//#endregion
|
|
1223
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1224
|
-
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1190
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js
|
|
1191
|
+
var require_ltr = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1225
1192
|
const outside$1 = require_outside();
|
|
1226
1193
|
const ltr$1 = (version, range, options) => outside$1(version, range, "<", options);
|
|
1227
1194
|
module.exports = ltr$1;
|
|
1228
1195
|
}));
|
|
1229
1196
|
|
|
1230
1197
|
//#endregion
|
|
1231
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1232
|
-
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1198
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js
|
|
1199
|
+
var require_intersects = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1233
1200
|
const Range$2 = require_range();
|
|
1234
1201
|
const intersects$1 = (r1, r2, options) => {
|
|
1235
1202
|
r1 = new Range$2(r1, options);
|
|
@@ -1240,8 +1207,8 @@ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1240
1207
|
}));
|
|
1241
1208
|
|
|
1242
1209
|
//#endregion
|
|
1243
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1244
|
-
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1210
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js
|
|
1211
|
+
var require_simplify = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1245
1212
|
const satisfies$2 = require_satisfies();
|
|
1246
1213
|
const compare$2 = require_compare();
|
|
1247
1214
|
module.exports = (versions, range, options) => {
|
|
@@ -1271,8 +1238,8 @@ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1271
1238
|
}));
|
|
1272
1239
|
|
|
1273
1240
|
//#endregion
|
|
1274
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1275
|
-
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1241
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js
|
|
1242
|
+
var require_subset = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1276
1243
|
const Range$1 = require_range();
|
|
1277
1244
|
const Comparator$1 = require_comparator();
|
|
1278
1245
|
const { ANY } = Comparator$1;
|
|
@@ -1367,8 +1334,8 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1367
1334
|
}));
|
|
1368
1335
|
|
|
1369
1336
|
//#endregion
|
|
1370
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1371
|
-
var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1337
|
+
//#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js
|
|
1338
|
+
var require_semver = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1372
1339
|
const internalRe = require_re();
|
|
1373
1340
|
const constants = require_constants();
|
|
1374
1341
|
const SemVer = require_semver$1();
|
|
@@ -1461,6 +1428,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1461
1428
|
|
|
1462
1429
|
//#endregion
|
|
1463
1430
|
//#region src/controller/helpers/getCodemodConfig.ts
|
|
1431
|
+
/** Retrieves a JSON object from a file path, returning null if the file does not exist */
|
|
1464
1432
|
const getJsonFromPath = (baseDir, fileName) => {
|
|
1465
1433
|
const jsonPath = (0, node_path.join)(baseDir, fileName);
|
|
1466
1434
|
try {
|
|
@@ -1482,6 +1450,7 @@ function getCodemodConfig(codemodPath, options = {}) {
|
|
|
1482
1450
|
|
|
1483
1451
|
//#endregion
|
|
1484
1452
|
//#region src/controller/helpers/repository.ts
|
|
1453
|
+
const execAsync = (0, node_util.promisify)(node_child_process.exec);
|
|
1485
1454
|
/**
|
|
1486
1455
|
* Finds the root of the project by looking for the `.git` directory.
|
|
1487
1456
|
*/
|
|
@@ -1506,9 +1475,9 @@ function findProjectRoot() {
|
|
|
1506
1475
|
* the presence of `package.json` files and them optimistically
|
|
1507
1476
|
* containing a `@transferwise/components` string.
|
|
1508
1477
|
* */
|
|
1509
|
-
function findPackages() {
|
|
1478
|
+
async function findPackages() {
|
|
1510
1479
|
try {
|
|
1511
|
-
const
|
|
1480
|
+
const { stdout } = await execAsync([
|
|
1512
1481
|
"find ./",
|
|
1513
1482
|
"-type f",
|
|
1514
1483
|
"-name \"package.json\"",
|
|
@@ -1518,7 +1487,8 @@ function findPackages() {
|
|
|
1518
1487
|
].join(" "), {
|
|
1519
1488
|
cwd: findProjectRoot(),
|
|
1520
1489
|
encoding: "utf8"
|
|
1521
|
-
})
|
|
1490
|
+
});
|
|
1491
|
+
const packages = stdout.trim().split("\n").filter(Boolean).map(node_path.default.dirname);
|
|
1522
1492
|
if (packages.length === 0) throw new Error();
|
|
1523
1493
|
return packages;
|
|
1524
1494
|
} catch {
|
|
@@ -1571,7 +1541,7 @@ const renderTable = (data, indexHeading = "index") => {
|
|
|
1571
1541
|
|
|
1572
1542
|
//#endregion
|
|
1573
1543
|
//#region src/controller/helpers/dependencyChecks.ts
|
|
1574
|
-
var import_semver = /* @__PURE__ */ __toESM(require_semver());
|
|
1544
|
+
var import_semver = /* @__PURE__ */ require_constants$1.__toESM(require_semver());
|
|
1575
1545
|
/**
|
|
1576
1546
|
* Checks if the installed version satisfies the given version requirement.
|
|
1577
1547
|
*/
|
|
@@ -1610,22 +1580,20 @@ function findClosestPackageJson(currentPath) {
|
|
|
1610
1580
|
*/
|
|
1611
1581
|
const assessPrerequisites = (packagePath, codemodPath) => {
|
|
1612
1582
|
try {
|
|
1613
|
-
const SYMBOL = {
|
|
1614
|
-
OK: "\x1B[32m✔\x1B[0m",
|
|
1615
|
-
FAIL: "\x1B[31m✗\x1B[0m"
|
|
1616
|
-
};
|
|
1617
1583
|
const codemodConfig = getJsonFromPath((0, node_path.dirname)(codemodPath), "config.json");
|
|
1618
1584
|
const resolvedPackagePath = (0, node_path.resolve)(process.cwd(), packagePath);
|
|
1619
1585
|
const actualPackagePath = (0, node_fs.existsSync)((0, node_path.join)(resolvedPackagePath, "package.json")) ? resolvedPackagePath : findClosestPackageJson(resolvedPackagePath);
|
|
1620
1586
|
if (!actualPackagePath) {
|
|
1621
|
-
console.error(`${
|
|
1587
|
+
console.error(`${require_constants$1.CONSOLE_ICONS.error} \x1b[1mCould not find a package.json in or above ${packagePath}\x1b[0m`);
|
|
1622
1588
|
return false;
|
|
1623
1589
|
}
|
|
1624
|
-
if (actualPackagePath !== resolvedPackagePath) console.info(
|
|
1625
|
-
const
|
|
1590
|
+
if (actualPackagePath !== resolvedPackagePath) console.info(`${require_constants$1.CONSOLE_ICONS.info} Using package.json from ${actualPackagePath} for dependency checks`);
|
|
1591
|
+
const packageJson = getJsonFromPath(actualPackagePath, "package.json");
|
|
1592
|
+
if (!packageJson) return false;
|
|
1593
|
+
const { dependencies = {}, peerDependencies = {} } = packageJson;
|
|
1626
1594
|
const comparisons = {};
|
|
1627
1595
|
let isCompliant = true;
|
|
1628
|
-
if (codemodConfig
|
|
1596
|
+
if (codemodConfig?.prerequisites) Object.entries(codemodConfig.prerequisites).forEach(([name, versionRequirement]) => {
|
|
1629
1597
|
const nodeModulesVersion = getVersionFromNodeModules(actualPackagePath, name);
|
|
1630
1598
|
const isDependencySatisfied = isVersionSatisfied(dependencies[name], versionRequirement);
|
|
1631
1599
|
const isPeerDependencySatisfied = isVersionSatisfied(peerDependencies[name], versionRequirement);
|
|
@@ -1634,14 +1602,14 @@ const assessPrerequisites = (packagePath, codemodPath) => {
|
|
|
1634
1602
|
isCompliant = false;
|
|
1635
1603
|
comparisons[name] = {
|
|
1636
1604
|
required: versionRequirement,
|
|
1637
|
-
dependencies: isDependencySatisfied ?
|
|
1638
|
-
peerDependencies: isPeerDependencySatisfied ?
|
|
1639
|
-
node_modules: isInstalledSatisfied ?
|
|
1605
|
+
dependencies: isDependencySatisfied ? require_constants$1.CONSOLE_ICONS.success : `${require_constants$1.CONSOLE_ICONS.error} ${dependencies[name] || "N/A"}`,
|
|
1606
|
+
peerDependencies: isPeerDependencySatisfied ? require_constants$1.CONSOLE_ICONS.success : `${require_constants$1.CONSOLE_ICONS.error} ${peerDependencies[name] || "N/A"}`,
|
|
1607
|
+
node_modules: isInstalledSatisfied ? require_constants$1.CONSOLE_ICONS.success : `${require_constants$1.CONSOLE_ICONS.error} ${nodeModulesVersion || "N/A"}`
|
|
1640
1608
|
};
|
|
1641
1609
|
}
|
|
1642
1610
|
});
|
|
1643
1611
|
if (!isCompliant) {
|
|
1644
|
-
console.info(`${
|
|
1612
|
+
console.info(`${require_constants$1.CONSOLE_ICONS.error} \x1b[31mPrerequisite check failed -\x1b[0m \x1b[2m${packagePath}\x1b[0m`);
|
|
1645
1613
|
renderTable(comparisons, "package");
|
|
1646
1614
|
return false;
|
|
1647
1615
|
}
|
|
@@ -1651,6 +1619,50 @@ const assessPrerequisites = (packagePath, codemodPath) => {
|
|
|
1651
1619
|
return false;
|
|
1652
1620
|
}
|
|
1653
1621
|
};
|
|
1622
|
+
/**
|
|
1623
|
+
* Batch prerequisite assessment across multiple target paths.
|
|
1624
|
+
* - Resolves each target to its effective package root (closest package.json)
|
|
1625
|
+
* - Deduplicates by package root and checks each unique root once
|
|
1626
|
+
* - Logs a concise summary; detailed table is logged by assessPrerequisites on failure
|
|
1627
|
+
*/
|
|
1628
|
+
const assessPrerequisitesBatch = (targetPaths, codemodPath, spinnies) => {
|
|
1629
|
+
const packageRootToTargets = /* @__PURE__ */ new Map();
|
|
1630
|
+
const failedTargetsNoPackage = [];
|
|
1631
|
+
for (const target of targetPaths) {
|
|
1632
|
+
const resolved = (0, node_path.resolve)(process.cwd(), target);
|
|
1633
|
+
const actual = (0, node_fs.existsSync)((0, node_path.join)(resolved, "package.json")) ? resolved : findClosestPackageJson(resolved);
|
|
1634
|
+
if (actual) {
|
|
1635
|
+
const list$1 = packageRootToTargets.get(actual) ?? [];
|
|
1636
|
+
list$1.push(target);
|
|
1637
|
+
packageRootToTargets.set(target, list$1);
|
|
1638
|
+
} else failedTargetsNoPackage.push(target);
|
|
1639
|
+
}
|
|
1640
|
+
let allPassed = true;
|
|
1641
|
+
const results = /* @__PURE__ */ new Map();
|
|
1642
|
+
for (const [pkgRoot] of packageRootToTargets.entries()) {
|
|
1643
|
+
const passed = assessPrerequisites(pkgRoot, codemodPath);
|
|
1644
|
+
results.set(pkgRoot, passed);
|
|
1645
|
+
if (!passed) allPassed = false;
|
|
1646
|
+
}
|
|
1647
|
+
const totalTargets = targetPaths.length;
|
|
1648
|
+
const uniquePackages = packageRootToTargets.size;
|
|
1649
|
+
const passedCount = Array.from(results.values()).filter(Boolean).length;
|
|
1650
|
+
const failedCount = uniquePackages - passedCount;
|
|
1651
|
+
if (failedTargetsNoPackage.length || !passedCount) if (!passedCount) spinnies.fail("prerequisite-check", { text: "All targets failed prerequisite checks" });
|
|
1652
|
+
else {
|
|
1653
|
+
spinnies.fail("prerequisite-check", { text: `No package.json found for ${failedTargetsNoPackage.length} target${failedTargetsNoPackage.length !== 1 ? "s" : ""} (searching upwards to project root).` });
|
|
1654
|
+
failedTargetsNoPackage.forEach((t$5) => console.error(`- ${t$5}`));
|
|
1655
|
+
}
|
|
1656
|
+
else spinnies.succeed("prerequisite-check", { text: `\x1b[0mChecked ${totalTargets} target${totalTargets !== 1 ? "s" : ""} across ${uniquePackages} package${uniquePackages !== 1 ? "s" : ""}:\x1b[0m \x1b[32m${passedCount} passed\x1b[0m, \x1b[31m${failedCount} failed\x1b[0m.` });
|
|
1657
|
+
const failedPackageRoots = Array.from(results.entries()).filter(([, ok]) => !ok).map(([root]) => root);
|
|
1658
|
+
return {
|
|
1659
|
+
allPassed,
|
|
1660
|
+
results,
|
|
1661
|
+
packageRootToTargets,
|
|
1662
|
+
failedPackageRoots,
|
|
1663
|
+
failedTargetsNoPackage
|
|
1664
|
+
};
|
|
1665
|
+
};
|
|
1654
1666
|
|
|
1655
1667
|
//#endregion
|
|
1656
1668
|
//#region src/controller/helpers/getOptions.ts
|
|
@@ -1727,9 +1739,9 @@ const queryPackages = async (packages) => {
|
|
|
1727
1739
|
description: choice === "." ? "Target the entire project" : `Target ${choice} directory`
|
|
1728
1740
|
}));
|
|
1729
1741
|
},
|
|
1730
|
-
validate: (path$
|
|
1731
|
-
if (!path$
|
|
1732
|
-
const fullPath = (0, node_path.join)(process.cwd(), path$
|
|
1742
|
+
validate: (path$4) => {
|
|
1743
|
+
if (!path$4?.trim()) return "Path cannot be empty";
|
|
1744
|
+
const fullPath = (0, node_path.join)(process.cwd(), path$4);
|
|
1733
1745
|
if (!(0, node_fs.existsSync)(fullPath)) return "Folder does not exist";
|
|
1734
1746
|
if (!(0, node_fs.statSync)(fullPath).isDirectory()) return "Path must be a directory";
|
|
1735
1747
|
return true;
|
|
@@ -1854,20 +1866,21 @@ const determineGitIgnore = async (args) => {
|
|
|
1854
1866
|
async function getOptions({ transformFiles, packages, root, preselectedTransformFile }) {
|
|
1855
1867
|
const args = process.argv.slice(2);
|
|
1856
1868
|
if (preselectedTransformFile && args[0] === preselectedTransformFile) args.shift();
|
|
1869
|
+
const transformFile = preselectedTransformFile || await determineTransformer({
|
|
1870
|
+
candidate: args[0] ?? "",
|
|
1871
|
+
transformFiles
|
|
1872
|
+
});
|
|
1857
1873
|
return {
|
|
1858
|
-
transformFile
|
|
1859
|
-
candidate: args[0] ?? "",
|
|
1860
|
-
transformFiles
|
|
1861
|
-
}),
|
|
1874
|
+
transformFile,
|
|
1862
1875
|
targetPaths: await determinePaths({
|
|
1863
1876
|
candidate: preselectedTransformFile ? args[0] ?? "" : args[1] ?? "",
|
|
1864
1877
|
root,
|
|
1865
1878
|
packages
|
|
1866
1879
|
}),
|
|
1867
|
-
isDry: await determineIsDryMode(args),
|
|
1880
|
+
isDry: transformFile === "button" ? await determineIsDryMode(args) : false,
|
|
1868
1881
|
isPrint: await determineIsPrint(args),
|
|
1869
|
-
ignorePatterns: await determineIgnorePatterns(args),
|
|
1870
|
-
useGitIgnore: await determineGitIgnore(args)
|
|
1882
|
+
ignorePatterns: transformFile === "list-item" ? ALWAYS_IGNORED_FOLDERS.join(",") : await determineIgnorePatterns(args),
|
|
1883
|
+
useGitIgnore: transformFile === "button" ? await determineGitIgnore(args) : true
|
|
1871
1884
|
};
|
|
1872
1885
|
}
|
|
1873
1886
|
var getOptions_default = getOptions;
|
|
@@ -1955,16 +1968,24 @@ async function runTransformPrompts(codemodPath) {
|
|
|
1955
1968
|
}
|
|
1956
1969
|
|
|
1957
1970
|
//#endregion
|
|
1958
|
-
|
|
1971
|
+
//#region src/controller/helpers/validateClaudeConfig.ts
|
|
1972
|
+
const CLAUDE_SETTINGS_FILE = ".claude/settings.json";
|
|
1973
|
+
function validateClaudeConfig() {
|
|
1974
|
+
const claudeSettingsPath = node_path.default.resolve(process.env.HOME || "", CLAUDE_SETTINGS_FILE);
|
|
1975
|
+
if (!node_fs.default.existsSync(claudeSettingsPath)) throw new Error(`${require_constants$1.CONSOLE_ICONS.error} Claude Code is not configured. Expected settings file at: ${claudeSettingsPath}. Please follow the setup instructions:\n https://transferwise.atlassian.net/wiki/spaces/GenAIP/pages/3709765113/Configuring+Claude+Code\n`);
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
//#endregion
|
|
1979
|
+
Object.defineProperty(exports, 'assessPrerequisites', {
|
|
1959
1980
|
enumerable: true,
|
|
1960
1981
|
get: function () {
|
|
1961
|
-
return
|
|
1982
|
+
return assessPrerequisites;
|
|
1962
1983
|
}
|
|
1963
1984
|
});
|
|
1964
|
-
Object.defineProperty(exports, '
|
|
1985
|
+
Object.defineProperty(exports, 'assessPrerequisitesBatch', {
|
|
1965
1986
|
enumerable: true,
|
|
1966
1987
|
get: function () {
|
|
1967
|
-
return
|
|
1988
|
+
return assessPrerequisitesBatch;
|
|
1968
1989
|
}
|
|
1969
1990
|
});
|
|
1970
1991
|
Object.defineProperty(exports, 'findPackages', {
|
|
@@ -2009,4 +2030,10 @@ Object.defineProperty(exports, 'runTransformPrompts', {
|
|
|
2009
2030
|
return runTransformPrompts;
|
|
2010
2031
|
}
|
|
2011
2032
|
});
|
|
2012
|
-
|
|
2033
|
+
Object.defineProperty(exports, 'validateClaudeConfig', {
|
|
2034
|
+
enumerable: true,
|
|
2035
|
+
get: function () {
|
|
2036
|
+
return validateClaudeConfig;
|
|
2037
|
+
}
|
|
2038
|
+
});
|
|
2039
|
+
//# sourceMappingURL=helpers-IFtIGywc.js.map
|