@wise/wds-codemods 0.0.1-experimental-17cec9b → 0.0.1-experimental-9bffcbf

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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_reportManualReview = require('./reportManualReview-DXT7jYE1.js');
2
+ const require_reportManualReview = require('./reportManualReview-AT6NdVJd.js');
3
3
  const node_child_process = require_reportManualReview.__toESM(require("node:child_process"));
4
4
  const node_fs_promises = require_reportManualReview.__toESM(require("node:fs/promises"));
5
5
  const node_path = require_reportManualReview.__toESM(require("node:path"));
@@ -7,1625 +7,6 @@ const node_url = require_reportManualReview.__toESM(require("node:url"));
7
7
  const node_fs = require_reportManualReview.__toESM(require("node:fs"));
8
8
  const __inquirer_prompts = require_reportManualReview.__toESM(require("@inquirer/prompts"));
9
9
 
10
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js
11
- var require_constants = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js": ((exports, module) => {
12
- const SEMVER_SPEC_VERSION = "2.0.0";
13
- const MAX_LENGTH$2 = 256;
14
- const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || 9007199254740991;
15
- const MAX_SAFE_COMPONENT_LENGTH$1 = 16;
16
- const MAX_SAFE_BUILD_LENGTH$1 = MAX_LENGTH$2 - 6;
17
- const RELEASE_TYPES = [
18
- "major",
19
- "premajor",
20
- "minor",
21
- "preminor",
22
- "patch",
23
- "prepatch",
24
- "prerelease"
25
- ];
26
- module.exports = {
27
- MAX_LENGTH: MAX_LENGTH$2,
28
- MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH$1,
29
- MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH$1,
30
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
31
- RELEASE_TYPES,
32
- SEMVER_SPEC_VERSION,
33
- FLAG_INCLUDE_PRERELEASE: 1,
34
- FLAG_LOOSE: 2
35
- };
36
- }) });
37
-
38
- //#endregion
39
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js
40
- var require_debug = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js": ((exports, module) => {
41
- 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) : () => {};
42
- module.exports = debug$4;
43
- }) });
44
-
45
- //#endregion
46
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js
47
- var require_re = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js": ((exports, module) => {
48
- const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
49
- const debug$3 = require_debug();
50
- exports = module.exports = {};
51
- const re$4 = exports.re = [];
52
- const safeRe = exports.safeRe = [];
53
- const src = exports.src = [];
54
- const safeSrc = exports.safeSrc = [];
55
- const t$4 = exports.t = {};
56
- let R = 0;
57
- const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
58
- const safeRegexReplacements = [
59
- ["\\s", 1],
60
- ["\\d", MAX_LENGTH$1],
61
- [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
62
- ];
63
- const makeSafeRegex = (value) => {
64
- for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
65
- return value;
66
- };
67
- const createToken = (name, value, isGlobal) => {
68
- const safe = makeSafeRegex(value);
69
- const index = R++;
70
- debug$3(name, index, value);
71
- t$4[name] = index;
72
- src[index] = value;
73
- safeSrc[index] = safe;
74
- re$4[index] = new RegExp(value, isGlobal ? "g" : void 0);
75
- safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
76
- };
77
- createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
78
- createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
79
- createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
80
- createToken("MAINVERSION", `(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})`);
81
- createToken("MAINVERSIONLOOSE", `(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
82
- createToken("PRERELEASEIDENTIFIER", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIER]})`);
83
- createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
84
- createToken("PRERELEASE", `(?:-(${src[t$4.PRERELEASEIDENTIFIER]}(?:\\.${src[t$4.PRERELEASEIDENTIFIER]})*))`);
85
- createToken("PRERELEASELOOSE", `(?:-?(${src[t$4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t$4.PRERELEASEIDENTIFIERLOOSE]})*))`);
86
- createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
87
- createToken("BUILD", `(?:\\+(${src[t$4.BUILDIDENTIFIER]}(?:\\.${src[t$4.BUILDIDENTIFIER]})*))`);
88
- createToken("FULLPLAIN", `v?${src[t$4.MAINVERSION]}${src[t$4.PRERELEASE]}?${src[t$4.BUILD]}?`);
89
- createToken("FULL", `^${src[t$4.FULLPLAIN]}$`);
90
- createToken("LOOSEPLAIN", `[v=\\s]*${src[t$4.MAINVERSIONLOOSE]}${src[t$4.PRERELEASELOOSE]}?${src[t$4.BUILD]}?`);
91
- createToken("LOOSE", `^${src[t$4.LOOSEPLAIN]}$`);
92
- createToken("GTLT", "((?:<|>)?=?)");
93
- createToken("XRANGEIDENTIFIERLOOSE", `${src[t$4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
94
- createToken("XRANGEIDENTIFIER", `${src[t$4.NUMERICIDENTIFIER]}|x|X|\\*`);
95
- createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:${src[t$4.PRERELEASE]})?${src[t$4.BUILD]}?)?)?`);
96
- createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:${src[t$4.PRERELEASELOOSE]})?${src[t$4.BUILD]}?)?)?`);
97
- createToken("XRANGE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAIN]}$`);
98
- createToken("XRANGELOOSE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAINLOOSE]}$`);
99
- createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
100
- createToken("COERCE", `${src[t$4.COERCEPLAIN]}(?:$|[^\\d])`);
101
- createToken("COERCEFULL", src[t$4.COERCEPLAIN] + `(?:${src[t$4.PRERELEASE]})?(?:${src[t$4.BUILD]})?(?:$|[^\\d])`);
102
- createToken("COERCERTL", src[t$4.COERCE], true);
103
- createToken("COERCERTLFULL", src[t$4.COERCEFULL], true);
104
- createToken("LONETILDE", "(?:~>?)");
105
- createToken("TILDETRIM", `(\\s*)${src[t$4.LONETILDE]}\\s+`, true);
106
- exports.tildeTrimReplace = "$1~";
107
- createToken("TILDE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAIN]}$`);
108
- createToken("TILDELOOSE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAINLOOSE]}$`);
109
- createToken("LONECARET", "(?:\\^)");
110
- createToken("CARETTRIM", `(\\s*)${src[t$4.LONECARET]}\\s+`, true);
111
- exports.caretTrimReplace = "$1^";
112
- createToken("CARET", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAIN]}$`);
113
- createToken("CARETLOOSE", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAINLOOSE]}$`);
114
- createToken("COMPARATORLOOSE", `^${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]})$|^$`);
115
- createToken("COMPARATOR", `^${src[t$4.GTLT]}\\s*(${src[t$4.FULLPLAIN]})$|^$`);
116
- createToken("COMPARATORTRIM", `(\\s*)${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]}|${src[t$4.XRANGEPLAIN]})`, true);
117
- exports.comparatorTrimReplace = "$1$2$3";
118
- createToken("HYPHENRANGE", `^\\s*(${src[t$4.XRANGEPLAIN]})\\s+-\\s+(${src[t$4.XRANGEPLAIN]})\\s*$`);
119
- createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t$4.XRANGEPLAINLOOSE]})\\s*$`);
120
- createToken("STAR", "(<|>)?=?\\s*\\*");
121
- createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
122
- createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
123
- }) });
124
-
125
- //#endregion
126
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js
127
- var require_parse_options = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js": ((exports, module) => {
128
- const looseOption = Object.freeze({ loose: true });
129
- const emptyOpts = Object.freeze({});
130
- const parseOptions$3 = (options) => {
131
- if (!options) return emptyOpts;
132
- if (typeof options !== "object") return looseOption;
133
- return options;
134
- };
135
- module.exports = parseOptions$3;
136
- }) });
137
-
138
- //#endregion
139
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js
140
- var require_identifiers = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js": ((exports, module) => {
141
- const numeric = /^[0-9]+$/;
142
- const compareIdentifiers$1 = (a, b) => {
143
- const anum = numeric.test(a);
144
- const bnum = numeric.test(b);
145
- if (anum && bnum) {
146
- a = +a;
147
- b = +b;
148
- }
149
- return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
150
- };
151
- const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
152
- module.exports = {
153
- compareIdentifiers: compareIdentifiers$1,
154
- rcompareIdentifiers
155
- };
156
- }) });
157
-
158
- //#endregion
159
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
160
- var require_semver$1 = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js": ((exports, module) => {
161
- const debug$2 = require_debug();
162
- const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
163
- const { safeRe: re$3, t: t$3 } = require_re();
164
- const parseOptions$2 = require_parse_options();
165
- const { compareIdentifiers } = require_identifiers();
166
- var SemVer$15 = class SemVer$15 {
167
- constructor(version, options) {
168
- options = parseOptions$2(options);
169
- if (version instanceof SemVer$15) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
170
- else version = version.version;
171
- else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
172
- if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
173
- debug$2("SemVer", version, options);
174
- this.options = options;
175
- this.loose = !!options.loose;
176
- this.includePrerelease = !!options.includePrerelease;
177
- const m = version.trim().match(options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL]);
178
- if (!m) throw new TypeError(`Invalid Version: ${version}`);
179
- this.raw = version;
180
- this.major = +m[1];
181
- this.minor = +m[2];
182
- this.patch = +m[3];
183
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
184
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
185
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
186
- if (!m[4]) this.prerelease = [];
187
- else this.prerelease = m[4].split(".").map((id) => {
188
- if (/^[0-9]+$/.test(id)) {
189
- const num = +id;
190
- if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
191
- }
192
- return id;
193
- });
194
- this.build = m[5] ? m[5].split(".") : [];
195
- this.format();
196
- }
197
- format() {
198
- this.version = `${this.major}.${this.minor}.${this.patch}`;
199
- if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
200
- return this.version;
201
- }
202
- toString() {
203
- return this.version;
204
- }
205
- compare(other) {
206
- debug$2("SemVer.compare", this.version, this.options, other);
207
- if (!(other instanceof SemVer$15)) {
208
- if (typeof other === "string" && other === this.version) return 0;
209
- other = new SemVer$15(other, this.options);
210
- }
211
- if (other.version === this.version) return 0;
212
- return this.compareMain(other) || this.comparePre(other);
213
- }
214
- compareMain(other) {
215
- if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
216
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
217
- }
218
- comparePre(other) {
219
- if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
220
- if (this.prerelease.length && !other.prerelease.length) return -1;
221
- else if (!this.prerelease.length && other.prerelease.length) return 1;
222
- else if (!this.prerelease.length && !other.prerelease.length) return 0;
223
- let i = 0;
224
- do {
225
- const a = this.prerelease[i];
226
- const b = other.prerelease[i];
227
- debug$2("prerelease compare", i, a, b);
228
- if (a === void 0 && b === void 0) return 0;
229
- else if (b === void 0) return 1;
230
- else if (a === void 0) return -1;
231
- else if (a === b) continue;
232
- else return compareIdentifiers(a, b);
233
- } while (++i);
234
- }
235
- compareBuild(other) {
236
- if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
237
- let i = 0;
238
- do {
239
- const a = this.build[i];
240
- const b = other.build[i];
241
- debug$2("build compare", i, a, b);
242
- if (a === void 0 && b === void 0) return 0;
243
- else if (b === void 0) return 1;
244
- else if (a === void 0) return -1;
245
- else if (a === b) continue;
246
- else return compareIdentifiers(a, b);
247
- } while (++i);
248
- }
249
- inc(release, identifier, identifierBase) {
250
- if (release.startsWith("pre")) {
251
- if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
252
- if (identifier) {
253
- const match = `-${identifier}`.match(this.options.loose ? re$3[t$3.PRERELEASELOOSE] : re$3[t$3.PRERELEASE]);
254
- if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
255
- }
256
- }
257
- switch (release) {
258
- case "premajor":
259
- this.prerelease.length = 0;
260
- this.patch = 0;
261
- this.minor = 0;
262
- this.major++;
263
- this.inc("pre", identifier, identifierBase);
264
- break;
265
- case "preminor":
266
- this.prerelease.length = 0;
267
- this.patch = 0;
268
- this.minor++;
269
- this.inc("pre", identifier, identifierBase);
270
- break;
271
- case "prepatch":
272
- this.prerelease.length = 0;
273
- this.inc("patch", identifier, identifierBase);
274
- this.inc("pre", identifier, identifierBase);
275
- break;
276
- case "prerelease":
277
- if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
278
- this.inc("pre", identifier, identifierBase);
279
- break;
280
- case "release":
281
- if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
282
- this.prerelease.length = 0;
283
- break;
284
- case "major":
285
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
286
- this.minor = 0;
287
- this.patch = 0;
288
- this.prerelease = [];
289
- break;
290
- case "minor":
291
- if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
292
- this.patch = 0;
293
- this.prerelease = [];
294
- break;
295
- case "patch":
296
- if (this.prerelease.length === 0) this.patch++;
297
- this.prerelease = [];
298
- break;
299
- case "pre": {
300
- const base = Number(identifierBase) ? 1 : 0;
301
- if (this.prerelease.length === 0) this.prerelease = [base];
302
- else {
303
- let i = this.prerelease.length;
304
- while (--i >= 0) if (typeof this.prerelease[i] === "number") {
305
- this.prerelease[i]++;
306
- i = -2;
307
- }
308
- if (i === -1) {
309
- if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
310
- this.prerelease.push(base);
311
- }
312
- }
313
- if (identifier) {
314
- let prerelease$2 = [identifier, base];
315
- if (identifierBase === false) prerelease$2 = [identifier];
316
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
317
- if (isNaN(this.prerelease[1])) this.prerelease = prerelease$2;
318
- } else this.prerelease = prerelease$2;
319
- }
320
- break;
321
- }
322
- default: throw new Error(`invalid increment argument: ${release}`);
323
- }
324
- this.raw = this.format();
325
- if (this.build.length) this.raw += `+${this.build.join(".")}`;
326
- return this;
327
- }
328
- };
329
- module.exports = SemVer$15;
330
- }) });
331
-
332
- //#endregion
333
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js
334
- var require_parse = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js": ((exports, module) => {
335
- const SemVer$14 = require_semver$1();
336
- const parse$6 = (version, options, throwErrors = false) => {
337
- if (version instanceof SemVer$14) return version;
338
- try {
339
- return new SemVer$14(version, options);
340
- } catch (er) {
341
- if (!throwErrors) return null;
342
- throw er;
343
- }
344
- };
345
- module.exports = parse$6;
346
- }) });
347
-
348
- //#endregion
349
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js
350
- var require_valid$1 = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js": ((exports, module) => {
351
- const parse$5 = require_parse();
352
- const valid$1 = (version, options) => {
353
- const v = parse$5(version, options);
354
- return v ? v.version : null;
355
- };
356
- module.exports = valid$1;
357
- }) });
358
-
359
- //#endregion
360
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js
361
- var require_clean = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js": ((exports, module) => {
362
- const parse$4 = require_parse();
363
- const clean$1 = (version, options) => {
364
- const s = parse$4(version.trim().replace(/^[=v]+/, ""), options);
365
- return s ? s.version : null;
366
- };
367
- module.exports = clean$1;
368
- }) });
369
-
370
- //#endregion
371
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js
372
- var require_inc = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js": ((exports, module) => {
373
- const SemVer$13 = require_semver$1();
374
- const inc$1 = (version, release, options, identifier, identifierBase) => {
375
- if (typeof options === "string") {
376
- identifierBase = identifier;
377
- identifier = options;
378
- options = void 0;
379
- }
380
- try {
381
- return new SemVer$13(version instanceof SemVer$13 ? version.version : version, options).inc(release, identifier, identifierBase).version;
382
- } catch (er) {
383
- return null;
384
- }
385
- };
386
- module.exports = inc$1;
387
- }) });
388
-
389
- //#endregion
390
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js
391
- var require_diff = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js": ((exports, module) => {
392
- const parse$3 = require_parse();
393
- const diff$1 = (version1, version2) => {
394
- const v1 = parse$3(version1, null, true);
395
- const v2 = parse$3(version2, null, true);
396
- const comparison = v1.compare(v2);
397
- if (comparison === 0) return null;
398
- const v1Higher = comparison > 0;
399
- const highVersion = v1Higher ? v1 : v2;
400
- const lowVersion = v1Higher ? v2 : v1;
401
- const highHasPre = !!highVersion.prerelease.length;
402
- const lowHasPre = !!lowVersion.prerelease.length;
403
- if (lowHasPre && !highHasPre) {
404
- if (!lowVersion.patch && !lowVersion.minor) return "major";
405
- if (lowVersion.compareMain(highVersion) === 0) {
406
- if (lowVersion.minor && !lowVersion.patch) return "minor";
407
- return "patch";
408
- }
409
- }
410
- const prefix = highHasPre ? "pre" : "";
411
- if (v1.major !== v2.major) return prefix + "major";
412
- if (v1.minor !== v2.minor) return prefix + "minor";
413
- if (v1.patch !== v2.patch) return prefix + "patch";
414
- return "prerelease";
415
- };
416
- module.exports = diff$1;
417
- }) });
418
-
419
- //#endregion
420
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js
421
- var require_major = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js": ((exports, module) => {
422
- const SemVer$12 = require_semver$1();
423
- const major$1 = (a, loose) => new SemVer$12(a, loose).major;
424
- module.exports = major$1;
425
- }) });
426
-
427
- //#endregion
428
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js
429
- var require_minor = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js": ((exports, module) => {
430
- const SemVer$11 = require_semver$1();
431
- const minor$1 = (a, loose) => new SemVer$11(a, loose).minor;
432
- module.exports = minor$1;
433
- }) });
434
-
435
- //#endregion
436
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js
437
- var require_patch = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js": ((exports, module) => {
438
- const SemVer$10 = require_semver$1();
439
- const patch$1 = (a, loose) => new SemVer$10(a, loose).patch;
440
- module.exports = patch$1;
441
- }) });
442
-
443
- //#endregion
444
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js
445
- var require_prerelease = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js": ((exports, module) => {
446
- const parse$2 = require_parse();
447
- const prerelease$1 = (version, options) => {
448
- const parsed = parse$2(version, options);
449
- return parsed && parsed.prerelease.length ? parsed.prerelease : null;
450
- };
451
- module.exports = prerelease$1;
452
- }) });
453
-
454
- //#endregion
455
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
456
- var require_compare = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js": ((exports, module) => {
457
- const SemVer$9 = require_semver$1();
458
- const compare$11 = (a, b, loose) => new SemVer$9(a, loose).compare(new SemVer$9(b, loose));
459
- module.exports = compare$11;
460
- }) });
461
-
462
- //#endregion
463
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js
464
- var require_rcompare = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js": ((exports, module) => {
465
- const compare$10 = require_compare();
466
- const rcompare$1 = (a, b, loose) => compare$10(b, a, loose);
467
- module.exports = rcompare$1;
468
- }) });
469
-
470
- //#endregion
471
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js
472
- var require_compare_loose = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js": ((exports, module) => {
473
- const compare$9 = require_compare();
474
- const compareLoose$1 = (a, b) => compare$9(a, b, true);
475
- module.exports = compareLoose$1;
476
- }) });
477
-
478
- //#endregion
479
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js
480
- var require_compare_build = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js": ((exports, module) => {
481
- const SemVer$8 = require_semver$1();
482
- const compareBuild$3 = (a, b, loose) => {
483
- const versionA = new SemVer$8(a, loose);
484
- const versionB = new SemVer$8(b, loose);
485
- return versionA.compare(versionB) || versionA.compareBuild(versionB);
486
- };
487
- module.exports = compareBuild$3;
488
- }) });
489
-
490
- //#endregion
491
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js
492
- var require_sort = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js": ((exports, module) => {
493
- const compareBuild$2 = require_compare_build();
494
- const sort$1 = (list$1, loose) => list$1.sort((a, b) => compareBuild$2(a, b, loose));
495
- module.exports = sort$1;
496
- }) });
497
-
498
- //#endregion
499
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js
500
- var require_rsort = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js": ((exports, module) => {
501
- const compareBuild$1 = require_compare_build();
502
- const rsort$1 = (list$1, loose) => list$1.sort((a, b) => compareBuild$1(b, a, loose));
503
- module.exports = rsort$1;
504
- }) });
505
-
506
- //#endregion
507
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js
508
- var require_gt = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js": ((exports, module) => {
509
- const compare$8 = require_compare();
510
- const gt$4 = (a, b, loose) => compare$8(a, b, loose) > 0;
511
- module.exports = gt$4;
512
- }) });
513
-
514
- //#endregion
515
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js
516
- var require_lt = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js": ((exports, module) => {
517
- const compare$7 = require_compare();
518
- const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0;
519
- module.exports = lt$3;
520
- }) });
521
-
522
- //#endregion
523
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js
524
- var require_eq = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js": ((exports, module) => {
525
- const compare$6 = require_compare();
526
- const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0;
527
- module.exports = eq$2;
528
- }) });
529
-
530
- //#endregion
531
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js
532
- var require_neq = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js": ((exports, module) => {
533
- const compare$5 = require_compare();
534
- const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0;
535
- module.exports = neq$2;
536
- }) });
537
-
538
- //#endregion
539
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js
540
- var require_gte = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js": ((exports, module) => {
541
- const compare$4 = require_compare();
542
- const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0;
543
- module.exports = gte$3;
544
- }) });
545
-
546
- //#endregion
547
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js
548
- var require_lte = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js": ((exports, module) => {
549
- const compare$3 = require_compare();
550
- const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0;
551
- module.exports = lte$3;
552
- }) });
553
-
554
- //#endregion
555
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js
556
- var require_cmp = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js": ((exports, module) => {
557
- const eq$1 = require_eq();
558
- const neq$1 = require_neq();
559
- const gt$3 = require_gt();
560
- const gte$2 = require_gte();
561
- const lt$2 = require_lt();
562
- const lte$2 = require_lte();
563
- const cmp$2 = (a, op, b, loose) => {
564
- switch (op) {
565
- case "===":
566
- if (typeof a === "object") a = a.version;
567
- if (typeof b === "object") b = b.version;
568
- return a === b;
569
- case "!==":
570
- if (typeof a === "object") a = a.version;
571
- if (typeof b === "object") b = b.version;
572
- return a !== b;
573
- case "":
574
- case "=":
575
- case "==": return eq$1(a, b, loose);
576
- case "!=": return neq$1(a, b, loose);
577
- case ">": return gt$3(a, b, loose);
578
- case ">=": return gte$2(a, b, loose);
579
- case "<": return lt$2(a, b, loose);
580
- case "<=": return lte$2(a, b, loose);
581
- default: throw new TypeError(`Invalid operator: ${op}`);
582
- }
583
- };
584
- module.exports = cmp$2;
585
- }) });
586
-
587
- //#endregion
588
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js
589
- var require_coerce = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js": ((exports, module) => {
590
- const SemVer$7 = require_semver$1();
591
- const parse$1 = require_parse();
592
- const { safeRe: re$2, t: t$2 } = require_re();
593
- const coerce$1 = (version, options) => {
594
- if (version instanceof SemVer$7) return version;
595
- if (typeof version === "number") version = String(version);
596
- if (typeof version !== "string") return null;
597
- options = options || {};
598
- let match = null;
599
- if (!options.rtl) match = version.match(options.includePrerelease ? re$2[t$2.COERCEFULL] : re$2[t$2.COERCE]);
600
- else {
601
- const coerceRtlRegex = options.includePrerelease ? re$2[t$2.COERCERTLFULL] : re$2[t$2.COERCERTL];
602
- let next;
603
- while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
604
- if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
605
- coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
606
- }
607
- coerceRtlRegex.lastIndex = -1;
608
- }
609
- if (match === null) return null;
610
- const major$2 = match[2];
611
- const minor$2 = match[3] || "0";
612
- const patch$2 = match[4] || "0";
613
- const prerelease$2 = options.includePrerelease && match[5] ? `-${match[5]}` : "";
614
- const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
615
- return parse$1(`${major$2}.${minor$2}.${patch$2}${prerelease$2}${build}`, options);
616
- };
617
- module.exports = coerce$1;
618
- }) });
619
-
620
- //#endregion
621
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js
622
- var require_lrucache = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js": ((exports, module) => {
623
- var LRUCache = class {
624
- constructor() {
625
- this.max = 1e3;
626
- this.map = /* @__PURE__ */ new Map();
627
- }
628
- get(key) {
629
- const value = this.map.get(key);
630
- if (value === void 0) return void 0;
631
- else {
632
- this.map.delete(key);
633
- this.map.set(key, value);
634
- return value;
635
- }
636
- }
637
- delete(key) {
638
- return this.map.delete(key);
639
- }
640
- set(key, value) {
641
- const deleted = this.delete(key);
642
- if (!deleted && value !== void 0) {
643
- if (this.map.size >= this.max) {
644
- const firstKey = this.map.keys().next().value;
645
- this.delete(firstKey);
646
- }
647
- this.map.set(key, value);
648
- }
649
- return this;
650
- }
651
- };
652
- module.exports = LRUCache;
653
- }) });
654
-
655
- //#endregion
656
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js
657
- var require_range = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js": ((exports, module) => {
658
- const SPACE_CHARACTERS = /\s+/g;
659
- var Range$11 = class Range$11 {
660
- constructor(range, options) {
661
- options = parseOptions$1(options);
662
- if (range instanceof Range$11) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
663
- else return new Range$11(range.raw, options);
664
- if (range instanceof Comparator$4) {
665
- this.raw = range.value;
666
- this.set = [[range]];
667
- this.formatted = void 0;
668
- return this;
669
- }
670
- this.options = options;
671
- this.loose = !!options.loose;
672
- this.includePrerelease = !!options.includePrerelease;
673
- this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
674
- this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
675
- if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
676
- if (this.set.length > 1) {
677
- const first = this.set[0];
678
- this.set = this.set.filter((c) => !isNullSet(c[0]));
679
- if (this.set.length === 0) this.set = [first];
680
- else if (this.set.length > 1) {
681
- for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
682
- this.set = [c];
683
- break;
684
- }
685
- }
686
- }
687
- this.formatted = void 0;
688
- }
689
- get range() {
690
- if (this.formatted === void 0) {
691
- this.formatted = "";
692
- for (let i = 0; i < this.set.length; i++) {
693
- if (i > 0) this.formatted += "||";
694
- const comps = this.set[i];
695
- for (let k = 0; k < comps.length; k++) {
696
- if (k > 0) this.formatted += " ";
697
- this.formatted += comps[k].toString().trim();
698
- }
699
- }
700
- }
701
- return this.formatted;
702
- }
703
- format() {
704
- return this.range;
705
- }
706
- toString() {
707
- return this.range;
708
- }
709
- parseRange(range) {
710
- const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
711
- const memoKey = memoOpts + ":" + range;
712
- const cached = cache.get(memoKey);
713
- if (cached) return cached;
714
- const loose = this.options.loose;
715
- const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE];
716
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
717
- debug$1("hyphen replace", range);
718
- range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
719
- debug$1("comparator trim", range);
720
- range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
721
- debug$1("tilde trim", range);
722
- range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
723
- debug$1("caret trim", range);
724
- let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
725
- if (loose) rangeList = rangeList.filter((comp) => {
726
- debug$1("loose invalid filter", comp, this.options);
727
- return !!comp.match(re$1[t$1.COMPARATORLOOSE]);
728
- });
729
- debug$1("range list", rangeList);
730
- const rangeMap = /* @__PURE__ */ new Map();
731
- const comparators = rangeList.map((comp) => new Comparator$4(comp, this.options));
732
- for (const comp of comparators) {
733
- if (isNullSet(comp)) return [comp];
734
- rangeMap.set(comp.value, comp);
735
- }
736
- if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
737
- const result = [...rangeMap.values()];
738
- cache.set(memoKey, result);
739
- return result;
740
- }
741
- intersects(range, options) {
742
- if (!(range instanceof Range$11)) throw new TypeError("a Range is required");
743
- return this.set.some((thisComparators) => {
744
- return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
745
- return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
746
- return rangeComparators.every((rangeComparator) => {
747
- return thisComparator.intersects(rangeComparator, options);
748
- });
749
- });
750
- });
751
- });
752
- }
753
- test(version) {
754
- if (!version) return false;
755
- if (typeof version === "string") try {
756
- version = new SemVer$6(version, this.options);
757
- } catch (er) {
758
- return false;
759
- }
760
- for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
761
- return false;
762
- }
763
- };
764
- module.exports = Range$11;
765
- const LRU = require_lrucache();
766
- const cache = new LRU();
767
- const parseOptions$1 = require_parse_options();
768
- const Comparator$4 = require_comparator();
769
- const debug$1 = require_debug();
770
- const SemVer$6 = require_semver$1();
771
- const { safeRe: re$1, t: t$1, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
772
- const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
773
- const isNullSet = (c) => c.value === "<0.0.0-0";
774
- const isAny = (c) => c.value === "";
775
- const isSatisfiable = (comparators, options) => {
776
- let result = true;
777
- const remainingComparators = comparators.slice();
778
- let testComparator = remainingComparators.pop();
779
- while (result && remainingComparators.length) {
780
- result = remainingComparators.every((otherComparator) => {
781
- return testComparator.intersects(otherComparator, options);
782
- });
783
- testComparator = remainingComparators.pop();
784
- }
785
- return result;
786
- };
787
- const parseComparator = (comp, options) => {
788
- debug$1("comp", comp, options);
789
- comp = replaceCarets(comp, options);
790
- debug$1("caret", comp);
791
- comp = replaceTildes(comp, options);
792
- debug$1("tildes", comp);
793
- comp = replaceXRanges(comp, options);
794
- debug$1("xrange", comp);
795
- comp = replaceStars(comp, options);
796
- debug$1("stars", comp);
797
- return comp;
798
- };
799
- const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
800
- const replaceTildes = (comp, options) => {
801
- return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
802
- };
803
- const replaceTilde = (comp, options) => {
804
- const r = options.loose ? re$1[t$1.TILDELOOSE] : re$1[t$1.TILDE];
805
- return comp.replace(r, (_, M, m, p, pr) => {
806
- debug$1("tilde", comp, _, M, m, p, pr);
807
- let ret;
808
- if (isX(M)) ret = "";
809
- else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
810
- else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
811
- else if (pr) {
812
- debug$1("replaceTilde pr", pr);
813
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
814
- } else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
815
- debug$1("tilde return", ret);
816
- return ret;
817
- });
818
- };
819
- const replaceCarets = (comp, options) => {
820
- return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
821
- };
822
- const replaceCaret = (comp, options) => {
823
- debug$1("caret", comp, options);
824
- const r = options.loose ? re$1[t$1.CARETLOOSE] : re$1[t$1.CARET];
825
- const z = options.includePrerelease ? "-0" : "";
826
- return comp.replace(r, (_, M, m, p, pr) => {
827
- debug$1("caret", comp, _, M, m, p, pr);
828
- let ret;
829
- if (isX(M)) ret = "";
830
- else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
831
- else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
832
- else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
833
- else if (pr) {
834
- debug$1("replaceCaret pr", pr);
835
- if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
836
- else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
837
- else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
838
- } else {
839
- debug$1("no pr");
840
- if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
841
- else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
842
- else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
843
- }
844
- debug$1("caret return", ret);
845
- return ret;
846
- });
847
- };
848
- const replaceXRanges = (comp, options) => {
849
- debug$1("replaceXRanges", comp, options);
850
- return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
851
- };
852
- const replaceXRange = (comp, options) => {
853
- comp = comp.trim();
854
- const r = options.loose ? re$1[t$1.XRANGELOOSE] : re$1[t$1.XRANGE];
855
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
856
- debug$1("xRange", comp, ret, gtlt, M, m, p, pr);
857
- const xM = isX(M);
858
- const xm = xM || isX(m);
859
- const xp = xm || isX(p);
860
- const anyX = xp;
861
- if (gtlt === "=" && anyX) gtlt = "";
862
- pr = options.includePrerelease ? "-0" : "";
863
- if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
864
- else ret = "*";
865
- else if (gtlt && anyX) {
866
- if (xm) m = 0;
867
- p = 0;
868
- if (gtlt === ">") {
869
- gtlt = ">=";
870
- if (xm) {
871
- M = +M + 1;
872
- m = 0;
873
- p = 0;
874
- } else {
875
- m = +m + 1;
876
- p = 0;
877
- }
878
- } else if (gtlt === "<=") {
879
- gtlt = "<";
880
- if (xm) M = +M + 1;
881
- else m = +m + 1;
882
- }
883
- if (gtlt === "<") pr = "-0";
884
- ret = `${gtlt + M}.${m}.${p}${pr}`;
885
- } else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
886
- else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
887
- debug$1("xRange return", ret);
888
- return ret;
889
- });
890
- };
891
- const replaceStars = (comp, options) => {
892
- debug$1("replaceStars", comp, options);
893
- return comp.trim().replace(re$1[t$1.STAR], "");
894
- };
895
- const replaceGTE0 = (comp, options) => {
896
- debug$1("replaceGTE0", comp, options);
897
- return comp.trim().replace(re$1[options.includePrerelease ? t$1.GTE0PRE : t$1.GTE0], "");
898
- };
899
- const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
900
- if (isX(fM)) from = "";
901
- else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
902
- else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
903
- else if (fpr) from = `>=${from}`;
904
- else from = `>=${from}${incPr ? "-0" : ""}`;
905
- if (isX(tM)) to = "";
906
- else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
907
- else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
908
- else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
909
- else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
910
- else to = `<=${to}`;
911
- return `${from} ${to}`.trim();
912
- };
913
- const testSet = (set, version, options) => {
914
- for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
915
- if (version.prerelease.length && !options.includePrerelease) {
916
- for (let i = 0; i < set.length; i++) {
917
- debug$1(set[i].semver);
918
- if (set[i].semver === Comparator$4.ANY) continue;
919
- if (set[i].semver.prerelease.length > 0) {
920
- const allowed = set[i].semver;
921
- if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
922
- }
923
- }
924
- return false;
925
- }
926
- return true;
927
- };
928
- }) });
929
-
930
- //#endregion
931
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js
932
- var require_comparator = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js": ((exports, module) => {
933
- const ANY$2 = Symbol("SemVer ANY");
934
- var Comparator$3 = class Comparator$3 {
935
- static get ANY() {
936
- return ANY$2;
937
- }
938
- constructor(comp, options) {
939
- options = parseOptions(options);
940
- if (comp instanceof Comparator$3) if (comp.loose === !!options.loose) return comp;
941
- else comp = comp.value;
942
- comp = comp.trim().split(/\s+/).join(" ");
943
- debug("comparator", comp, options);
944
- this.options = options;
945
- this.loose = !!options.loose;
946
- this.parse(comp);
947
- if (this.semver === ANY$2) this.value = "";
948
- else this.value = this.operator + this.semver.version;
949
- debug("comp", this);
950
- }
951
- parse(comp) {
952
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
953
- const m = comp.match(r);
954
- if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
955
- this.operator = m[1] !== void 0 ? m[1] : "";
956
- if (this.operator === "=") this.operator = "";
957
- if (!m[2]) this.semver = ANY$2;
958
- else this.semver = new SemVer$5(m[2], this.options.loose);
959
- }
960
- toString() {
961
- return this.value;
962
- }
963
- test(version) {
964
- debug("Comparator.test", version, this.options.loose);
965
- if (this.semver === ANY$2 || version === ANY$2) return true;
966
- if (typeof version === "string") try {
967
- version = new SemVer$5(version, this.options);
968
- } catch (er) {
969
- return false;
970
- }
971
- return cmp$1(version, this.operator, this.semver, this.options);
972
- }
973
- intersects(comp, options) {
974
- if (!(comp instanceof Comparator$3)) throw new TypeError("a Comparator is required");
975
- if (this.operator === "") {
976
- if (this.value === "") return true;
977
- return new Range$10(comp.value, options).test(this.value);
978
- } else if (comp.operator === "") {
979
- if (comp.value === "") return true;
980
- return new Range$10(this.value, options).test(comp.semver);
981
- }
982
- options = parseOptions(options);
983
- if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
984
- if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
985
- if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
986
- if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
987
- if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
988
- if (cmp$1(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
989
- if (cmp$1(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
990
- return false;
991
- }
992
- };
993
- module.exports = Comparator$3;
994
- const parseOptions = require_parse_options();
995
- const { safeRe: re, t } = require_re();
996
- const cmp$1 = require_cmp();
997
- const debug = require_debug();
998
- const SemVer$5 = require_semver$1();
999
- const Range$10 = require_range();
1000
- }) });
1001
-
1002
- //#endregion
1003
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js
1004
- var require_satisfies = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js": ((exports, module) => {
1005
- const Range$9 = require_range();
1006
- const satisfies$4 = (version, range, options) => {
1007
- try {
1008
- range = new Range$9(range, options);
1009
- } catch (er) {
1010
- return false;
1011
- }
1012
- return range.test(version);
1013
- };
1014
- module.exports = satisfies$4;
1015
- }) });
1016
-
1017
- //#endregion
1018
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js
1019
- var require_to_comparators = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js": ((exports, module) => {
1020
- const Range$8 = require_range();
1021
- const toComparators$1 = (range, options) => new Range$8(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1022
- module.exports = toComparators$1;
1023
- }) });
1024
-
1025
- //#endregion
1026
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js
1027
- var require_max_satisfying = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js": ((exports, module) => {
1028
- const SemVer$4 = require_semver$1();
1029
- const Range$7 = require_range();
1030
- const maxSatisfying$1 = (versions, range, options) => {
1031
- let max = null;
1032
- let maxSV = null;
1033
- let rangeObj = null;
1034
- try {
1035
- rangeObj = new Range$7(range, options);
1036
- } catch (er) {
1037
- return null;
1038
- }
1039
- versions.forEach((v) => {
1040
- if (rangeObj.test(v)) {
1041
- if (!max || maxSV.compare(v) === -1) {
1042
- max = v;
1043
- maxSV = new SemVer$4(max, options);
1044
- }
1045
- }
1046
- });
1047
- return max;
1048
- };
1049
- module.exports = maxSatisfying$1;
1050
- }) });
1051
-
1052
- //#endregion
1053
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js
1054
- var require_min_satisfying = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js": ((exports, module) => {
1055
- const SemVer$3 = require_semver$1();
1056
- const Range$6 = require_range();
1057
- const minSatisfying$1 = (versions, range, options) => {
1058
- let min = null;
1059
- let minSV = null;
1060
- let rangeObj = null;
1061
- try {
1062
- rangeObj = new Range$6(range, options);
1063
- } catch (er) {
1064
- return null;
1065
- }
1066
- versions.forEach((v) => {
1067
- if (rangeObj.test(v)) {
1068
- if (!min || minSV.compare(v) === 1) {
1069
- min = v;
1070
- minSV = new SemVer$3(min, options);
1071
- }
1072
- }
1073
- });
1074
- return min;
1075
- };
1076
- module.exports = minSatisfying$1;
1077
- }) });
1078
-
1079
- //#endregion
1080
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js
1081
- var require_min_version = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js": ((exports, module) => {
1082
- const SemVer$2 = require_semver$1();
1083
- const Range$5 = require_range();
1084
- const gt$2 = require_gt();
1085
- const minVersion$1 = (range, loose) => {
1086
- range = new Range$5(range, loose);
1087
- let minver = new SemVer$2("0.0.0");
1088
- if (range.test(minver)) return minver;
1089
- minver = new SemVer$2("0.0.0-0");
1090
- if (range.test(minver)) return minver;
1091
- minver = null;
1092
- for (let i = 0; i < range.set.length; ++i) {
1093
- const comparators = range.set[i];
1094
- let setMin = null;
1095
- comparators.forEach((comparator) => {
1096
- const compver = new SemVer$2(comparator.semver.version);
1097
- switch (comparator.operator) {
1098
- case ">":
1099
- if (compver.prerelease.length === 0) compver.patch++;
1100
- else compver.prerelease.push(0);
1101
- compver.raw = compver.format();
1102
- case "":
1103
- case ">=":
1104
- if (!setMin || gt$2(compver, setMin)) setMin = compver;
1105
- break;
1106
- case "<":
1107
- case "<=": break;
1108
- default: throw new Error(`Unexpected operation: ${comparator.operator}`);
1109
- }
1110
- });
1111
- if (setMin && (!minver || gt$2(minver, setMin))) minver = setMin;
1112
- }
1113
- if (minver && range.test(minver)) return minver;
1114
- return null;
1115
- };
1116
- module.exports = minVersion$1;
1117
- }) });
1118
-
1119
- //#endregion
1120
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js
1121
- var require_valid = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js": ((exports, module) => {
1122
- const Range$4 = require_range();
1123
- const validRange$1 = (range, options) => {
1124
- try {
1125
- return new Range$4(range, options).range || "*";
1126
- } catch (er) {
1127
- return null;
1128
- }
1129
- };
1130
- module.exports = validRange$1;
1131
- }) });
1132
-
1133
- //#endregion
1134
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js
1135
- var require_outside = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js": ((exports, module) => {
1136
- const SemVer$1 = require_semver$1();
1137
- const Comparator$2 = require_comparator();
1138
- const { ANY: ANY$1 } = Comparator$2;
1139
- const Range$3 = require_range();
1140
- const satisfies$3 = require_satisfies();
1141
- const gt$1 = require_gt();
1142
- const lt$1 = require_lt();
1143
- const lte$1 = require_lte();
1144
- const gte$1 = require_gte();
1145
- const outside$3 = (version, range, hilo, options) => {
1146
- version = new SemVer$1(version, options);
1147
- range = new Range$3(range, options);
1148
- let gtfn, ltefn, ltfn, comp, ecomp;
1149
- switch (hilo) {
1150
- case ">":
1151
- gtfn = gt$1;
1152
- ltefn = lte$1;
1153
- ltfn = lt$1;
1154
- comp = ">";
1155
- ecomp = ">=";
1156
- break;
1157
- case "<":
1158
- gtfn = lt$1;
1159
- ltefn = gte$1;
1160
- ltfn = gt$1;
1161
- comp = "<";
1162
- ecomp = "<=";
1163
- break;
1164
- default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
1165
- }
1166
- if (satisfies$3(version, range, options)) return false;
1167
- for (let i = 0; i < range.set.length; ++i) {
1168
- const comparators = range.set[i];
1169
- let high = null;
1170
- let low = null;
1171
- comparators.forEach((comparator) => {
1172
- if (comparator.semver === ANY$1) comparator = new Comparator$2(">=0.0.0");
1173
- high = high || comparator;
1174
- low = low || comparator;
1175
- if (gtfn(comparator.semver, high.semver, options)) high = comparator;
1176
- else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
1177
- });
1178
- if (high.operator === comp || high.operator === ecomp) return false;
1179
- if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
1180
- else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
1181
- }
1182
- return true;
1183
- };
1184
- module.exports = outside$3;
1185
- }) });
1186
-
1187
- //#endregion
1188
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js
1189
- var require_gtr = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js": ((exports, module) => {
1190
- const outside$2 = require_outside();
1191
- const gtr$1 = (version, range, options) => outside$2(version, range, ">", options);
1192
- module.exports = gtr$1;
1193
- }) });
1194
-
1195
- //#endregion
1196
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js
1197
- var require_ltr = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js": ((exports, module) => {
1198
- const outside$1 = require_outside();
1199
- const ltr$1 = (version, range, options) => outside$1(version, range, "<", options);
1200
- module.exports = ltr$1;
1201
- }) });
1202
-
1203
- //#endregion
1204
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js
1205
- var require_intersects = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js": ((exports, module) => {
1206
- const Range$2 = require_range();
1207
- const intersects$1 = (r1, r2, options) => {
1208
- r1 = new Range$2(r1, options);
1209
- r2 = new Range$2(r2, options);
1210
- return r1.intersects(r2, options);
1211
- };
1212
- module.exports = intersects$1;
1213
- }) });
1214
-
1215
- //#endregion
1216
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js
1217
- var require_simplify = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js": ((exports, module) => {
1218
- const satisfies$2 = require_satisfies();
1219
- const compare$2 = require_compare();
1220
- module.exports = (versions, range, options) => {
1221
- const set = [];
1222
- let first = null;
1223
- let prev = null;
1224
- const v = versions.sort((a, b) => compare$2(a, b, options));
1225
- for (const version of v) {
1226
- const included = satisfies$2(version, range, options);
1227
- if (included) {
1228
- prev = version;
1229
- if (!first) first = version;
1230
- } else {
1231
- if (prev) set.push([first, prev]);
1232
- prev = null;
1233
- first = null;
1234
- }
1235
- }
1236
- if (first) set.push([first, null]);
1237
- const ranges = [];
1238
- for (const [min, max] of set) if (min === max) ranges.push(min);
1239
- else if (!max && min === v[0]) ranges.push("*");
1240
- else if (!max) ranges.push(`>=${min}`);
1241
- else if (min === v[0]) ranges.push(`<=${max}`);
1242
- else ranges.push(`${min} - ${max}`);
1243
- const simplified = ranges.join(" || ");
1244
- const original = typeof range.raw === "string" ? range.raw : String(range);
1245
- return simplified.length < original.length ? simplified : range;
1246
- };
1247
- }) });
1248
-
1249
- //#endregion
1250
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js
1251
- var require_subset = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js": ((exports, module) => {
1252
- const Range$1 = require_range();
1253
- const Comparator$1 = require_comparator();
1254
- const { ANY } = Comparator$1;
1255
- const satisfies$1 = require_satisfies();
1256
- const compare$1 = require_compare();
1257
- const subset$1 = (sub, dom, options = {}) => {
1258
- if (sub === dom) return true;
1259
- sub = new Range$1(sub, options);
1260
- dom = new Range$1(dom, options);
1261
- let sawNonNull = false;
1262
- OUTER: for (const simpleSub of sub.set) {
1263
- for (const simpleDom of dom.set) {
1264
- const isSub = simpleSubset(simpleSub, simpleDom, options);
1265
- sawNonNull = sawNonNull || isSub !== null;
1266
- if (isSub) continue OUTER;
1267
- }
1268
- if (sawNonNull) return false;
1269
- }
1270
- return true;
1271
- };
1272
- const minimumVersionWithPreRelease = [new Comparator$1(">=0.0.0-0")];
1273
- const minimumVersion = [new Comparator$1(">=0.0.0")];
1274
- const simpleSubset = (sub, dom, options) => {
1275
- if (sub === dom) return true;
1276
- if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
1277
- else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
1278
- else sub = minimumVersion;
1279
- if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
1280
- else dom = minimumVersion;
1281
- const eqSet = /* @__PURE__ */ new Set();
1282
- let gt$5, lt$4;
1283
- for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt$5 = higherGT(gt$5, c, options);
1284
- else if (c.operator === "<" || c.operator === "<=") lt$4 = lowerLT(lt$4, c, options);
1285
- else eqSet.add(c.semver);
1286
- if (eqSet.size > 1) return null;
1287
- let gtltComp;
1288
- if (gt$5 && lt$4) {
1289
- gtltComp = compare$1(gt$5.semver, lt$4.semver, options);
1290
- if (gtltComp > 0) return null;
1291
- else if (gtltComp === 0 && (gt$5.operator !== ">=" || lt$4.operator !== "<=")) return null;
1292
- }
1293
- for (const eq$3 of eqSet) {
1294
- if (gt$5 && !satisfies$1(eq$3, String(gt$5), options)) return null;
1295
- if (lt$4 && !satisfies$1(eq$3, String(lt$4), options)) return null;
1296
- for (const c of dom) if (!satisfies$1(eq$3, String(c), options)) return false;
1297
- return true;
1298
- }
1299
- let higher, lower;
1300
- let hasDomLT, hasDomGT;
1301
- let needDomLTPre = lt$4 && !options.includePrerelease && lt$4.semver.prerelease.length ? lt$4.semver : false;
1302
- let needDomGTPre = gt$5 && !options.includePrerelease && gt$5.semver.prerelease.length ? gt$5.semver : false;
1303
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt$4.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
1304
- for (const c of dom) {
1305
- hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1306
- hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1307
- if (gt$5) {
1308
- if (needDomGTPre) {
1309
- if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
1310
- }
1311
- if (c.operator === ">" || c.operator === ">=") {
1312
- higher = higherGT(gt$5, c, options);
1313
- if (higher === c && higher !== gt$5) return false;
1314
- } else if (gt$5.operator === ">=" && !satisfies$1(gt$5.semver, String(c), options)) return false;
1315
- }
1316
- if (lt$4) {
1317
- if (needDomLTPre) {
1318
- if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
1319
- }
1320
- if (c.operator === "<" || c.operator === "<=") {
1321
- lower = lowerLT(lt$4, c, options);
1322
- if (lower === c && lower !== lt$4) return false;
1323
- } else if (lt$4.operator === "<=" && !satisfies$1(lt$4.semver, String(c), options)) return false;
1324
- }
1325
- if (!c.operator && (lt$4 || gt$5) && gtltComp !== 0) return false;
1326
- }
1327
- if (gt$5 && hasDomLT && !lt$4 && gtltComp !== 0) return false;
1328
- if (lt$4 && hasDomGT && !gt$5 && gtltComp !== 0) return false;
1329
- if (needDomGTPre || needDomLTPre) return false;
1330
- return true;
1331
- };
1332
- const higherGT = (a, b, options) => {
1333
- if (!a) return b;
1334
- const comp = compare$1(a.semver, b.semver, options);
1335
- return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1336
- };
1337
- const lowerLT = (a, b, options) => {
1338
- if (!a) return b;
1339
- const comp = compare$1(a.semver, b.semver, options);
1340
- return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1341
- };
1342
- module.exports = subset$1;
1343
- }) });
1344
-
1345
- //#endregion
1346
- //#region node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js
1347
- var require_semver = /* @__PURE__ */ require_reportManualReview.__commonJS({ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js": ((exports, module) => {
1348
- const internalRe = require_re();
1349
- const constants = require_constants();
1350
- const SemVer = require_semver$1();
1351
- const identifiers = require_identifiers();
1352
- const parse = require_parse();
1353
- const valid = require_valid$1();
1354
- const clean = require_clean();
1355
- const inc = require_inc();
1356
- const diff = require_diff();
1357
- const major = require_major();
1358
- const minor = require_minor();
1359
- const patch = require_patch();
1360
- const prerelease = require_prerelease();
1361
- const compare = require_compare();
1362
- const rcompare = require_rcompare();
1363
- const compareLoose = require_compare_loose();
1364
- const compareBuild = require_compare_build();
1365
- const sort = require_sort();
1366
- const rsort = require_rsort();
1367
- const gt = require_gt();
1368
- const lt = require_lt();
1369
- const eq = require_eq();
1370
- const neq = require_neq();
1371
- const gte = require_gte();
1372
- const lte = require_lte();
1373
- const cmp = require_cmp();
1374
- const coerce = require_coerce();
1375
- const Comparator = require_comparator();
1376
- const Range = require_range();
1377
- const satisfies = require_satisfies();
1378
- const toComparators = require_to_comparators();
1379
- const maxSatisfying = require_max_satisfying();
1380
- const minSatisfying = require_min_satisfying();
1381
- const minVersion = require_min_version();
1382
- const validRange = require_valid();
1383
- const outside = require_outside();
1384
- const gtr = require_gtr();
1385
- const ltr = require_ltr();
1386
- const intersects = require_intersects();
1387
- const simplifyRange = require_simplify();
1388
- const subset = require_subset();
1389
- module.exports = {
1390
- parse,
1391
- valid,
1392
- clean,
1393
- inc,
1394
- diff,
1395
- major,
1396
- minor,
1397
- patch,
1398
- prerelease,
1399
- compare,
1400
- rcompare,
1401
- compareLoose,
1402
- compareBuild,
1403
- sort,
1404
- rsort,
1405
- gt,
1406
- lt,
1407
- eq,
1408
- neq,
1409
- gte,
1410
- lte,
1411
- cmp,
1412
- coerce,
1413
- Comparator,
1414
- Range,
1415
- satisfies,
1416
- toComparators,
1417
- maxSatisfying,
1418
- minSatisfying,
1419
- minVersion,
1420
- validRange,
1421
- outside,
1422
- gtr,
1423
- ltr,
1424
- intersects,
1425
- simplifyRange,
1426
- subset,
1427
- SemVer,
1428
- re: internalRe.re,
1429
- src: internalRe.src,
1430
- tokens: internalRe.t,
1431
- SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
1432
- RELEASE_TYPES: constants.RELEASE_TYPES,
1433
- compareIdentifiers: identifiers.compareIdentifiers,
1434
- rcompareIdentifiers: identifiers.rcompareIdentifiers
1435
- };
1436
- }) });
1437
-
1438
- //#endregion
1439
- //#region src/controller/helpers/repository.ts
1440
- var import_semver = /* @__PURE__ */ require_reportManualReview.__toESM(require_semver());
1441
- /**
1442
- * Finds the root of the project by looking for the `.git` directory.
1443
- */
1444
- function findProjectRoot() {
1445
- try {
1446
- const gitRoot = (0, node_child_process.execSync)("git rev-parse --show-toplevel", {
1447
- cwd: process.cwd(),
1448
- encoding: "utf8",
1449
- stdio: [
1450
- "ignore",
1451
- "pipe",
1452
- "ignore"
1453
- ]
1454
- }).trim();
1455
- return gitRoot && (0, node_fs.existsSync)(gitRoot) ? gitRoot : "";
1456
- } catch {
1457
- return "";
1458
- }
1459
- }
1460
- /**
1461
- * Quick and dirty way of determining package roots based on
1462
- * the presence of `package.json` files and them optimistically
1463
- * containing a `@transferwise/components` string.
1464
- * */
1465
- function findPackages() {
1466
- try {
1467
- const packages = (0, node_child_process.execSync)([
1468
- "find ./",
1469
- "-type f",
1470
- "-name \"package.json\"",
1471
- "-not -path \"*/node_modules/*\"",
1472
- "|",
1473
- "xargs grep -l \"@transferwise/components\""
1474
- ].join(" "), {
1475
- cwd: findProjectRoot(),
1476
- encoding: "utf8"
1477
- }).trim().split("\n").map(node_path.default.dirname);
1478
- if (packages.length === 0) throw new Error();
1479
- return packages;
1480
- } catch {
1481
- throw new Error("No suitable package roots found in the repository.");
1482
- }
1483
- }
1484
-
1485
- //#endregion
1486
- //#region src/controller/helpers/table.ts
1487
- /**
1488
- * Renders an object as a table in terminal
1489
- */
1490
- const renderTable = (data, indexHeading = "index") => {
1491
- const firstEntry = Object.values(data)[0];
1492
- if (!firstEntry) {
1493
- console.info("No data to display");
1494
- return;
1495
- }
1496
- const headings = [indexHeading, ...Object.keys(firstEntry)];
1497
- const tableData = [];
1498
- Object.entries(data).forEach(([packageName, details]) => {
1499
- tableData.push([packageName, ...Object.values(details)]);
1500
- });
1501
- const getDisplayWidth = (str) => {
1502
- return str.replace(/\x1b\[[0-9;]*m/gu, "").length;
1503
- };
1504
- const columnWidths = headings.map((heading, index) => {
1505
- const maxDataWidth = Math.max(...tableData.map((row) => getDisplayWidth(row[index] || "")));
1506
- return Math.max(heading.length, maxDataWidth);
1507
- });
1508
- const firstCellLine = "─".repeat(columnWidths[0] + 2);
1509
- const remainingLines = columnWidths.slice(1).map((width) => "─".repeat(width + 2));
1510
- const topSeparator = `┌${firstCellLine}┬${remainingLines.join("┬")}┐`;
1511
- const midSeparator = `├${firstCellLine}┼${remainingLines.join("┼")}┤`;
1512
- const endSeparator = `└${firstCellLine}┴${remainingLines.join("┴")}┘`;
1513
- const formatRow = (cells) => {
1514
- const formattedCells = cells.map((cell, index) => {
1515
- const width = columnWidths[index];
1516
- const displayWidth = getDisplayWidth(cell);
1517
- const padding = width - displayWidth;
1518
- return ` ${cell}${" ".repeat(Math.max(0, padding))} `;
1519
- });
1520
- return `│${formattedCells.join("│")}│`;
1521
- };
1522
- console.info(topSeparator);
1523
- console.info(formatRow(headings));
1524
- console.info(midSeparator);
1525
- tableData.forEach((row) => {
1526
- console.info(formatRow(row));
1527
- });
1528
- console.info(endSeparator);
1529
- };
1530
-
1531
- //#endregion
1532
- //#region src/controller/helpers/dependencyChecks.ts
1533
- /**
1534
- * Retrieves and parses a JSON file from a specified path.
1535
- */
1536
- const getJsonFromPath = (filePath, fileName) => {
1537
- const jsonPath = (0, node_path.join)(filePath, fileName);
1538
- try {
1539
- const jsonContent = (0, node_fs.readFileSync)(jsonPath, "utf8");
1540
- return JSON.parse(jsonContent);
1541
- } catch {
1542
- throw new Error(`Error reading ${jsonPath}`);
1543
- }
1544
- };
1545
- /**
1546
- * Checks if the installed version satisfies the given version requirement.
1547
- */
1548
- function isVersionSatisfied(installedVersion, versionRequirement) {
1549
- if (!installedVersion) return false;
1550
- if (import_semver.default.valid(installedVersion) && import_semver.default.satisfies(installedVersion, versionRequirement)) return true;
1551
- const cleanVersion = import_semver.default.coerce(installedVersion);
1552
- return cleanVersion ? import_semver.default.satisfies(cleanVersion.version, versionRequirement) : false;
1553
- }
1554
- /**
1555
- * Retrieves the version of a dependency from node_modules of a specific package.
1556
- */
1557
- function getVersionFromNodeModules(packagePath, packageName) {
1558
- try {
1559
- const nodeModulesPackageJson = (0, node_path.join)(packagePath, "node_modules", packageName, "package.json");
1560
- if (!(0, node_fs.existsSync)(nodeModulesPackageJson)) return "";
1561
- const packageJson = JSON.parse((0, node_fs.readFileSync)(nodeModulesPackageJson, "utf8"));
1562
- return packageJson.version || "";
1563
- } catch {
1564
- return "";
1565
- }
1566
- }
1567
- /**
1568
- * Finds the closest package.json by traversing up the directory tree
1569
- */
1570
- function findClosestPackageJson(startPath) {
1571
- let currentPath = (0, node_path.resolve)(startPath);
1572
- const projectRoot = findProjectRoot();
1573
- while (currentPath && currentPath !== (0, node_path.dirname)(currentPath)) {
1574
- const packageJsonPath = (0, node_path.join)(currentPath, "package.json");
1575
- if ((0, node_fs.existsSync)(packageJsonPath)) return currentPath;
1576
- if (projectRoot && currentPath === projectRoot) break;
1577
- currentPath = (0, node_path.dirname)(currentPath);
1578
- }
1579
- return null;
1580
- }
1581
- /**
1582
- * Assesses whether the given package meets the prerequisites defined in the codemod's config.json.
1583
- */
1584
- const assessPrerequisites = (packagePath, codemodPath) => {
1585
- try {
1586
- const SYMBOL = {
1587
- OK: "\x1B[32m✔\x1B[0m",
1588
- FAIL: "\x1B[31m✗\x1B[0m"
1589
- };
1590
- const codemodConfig = getJsonFromPath((0, node_path.dirname)(codemodPath), "config.json");
1591
- const resolvedPackagePath = (0, node_path.resolve)(process.cwd(), packagePath);
1592
- const actualPackagePath = (0, node_fs.existsSync)((0, node_path.join)(resolvedPackagePath, "package.json")) ? resolvedPackagePath : findClosestPackageJson(resolvedPackagePath);
1593
- if (!actualPackagePath) {
1594
- console.error(`${SYMBOL.FAIL} \x1b[1mCould not find a package.json in or above ${packagePath}\x1b[0m`);
1595
- return false;
1596
- }
1597
- if (actualPackagePath !== resolvedPackagePath) console.info(`Using package.json from ${actualPackagePath} for dependency checks`);
1598
- const { dependencies = {}, peerDependencies = {} } = getJsonFromPath(actualPackagePath, "package.json");
1599
- const comparisons = {};
1600
- let isCompliant = true;
1601
- if (codemodConfig.prerequisites) Object.entries(codemodConfig.prerequisites).forEach(([name, versionRequirement]) => {
1602
- const nodeModulesVersion = getVersionFromNodeModules(actualPackagePath, name);
1603
- const isDependencySatisfied = isVersionSatisfied(dependencies[name], versionRequirement);
1604
- const isPeerDependencySatisfied = isVersionSatisfied(peerDependencies[name], versionRequirement);
1605
- const isInstalledSatisfied = isVersionSatisfied(nodeModulesVersion, versionRequirement);
1606
- if (!isDependencySatisfied && !isPeerDependencySatisfied || !isInstalledSatisfied) {
1607
- isCompliant = false;
1608
- comparisons[name] = {
1609
- required: versionRequirement,
1610
- dependencies: isDependencySatisfied ? SYMBOL.OK : `${SYMBOL.FAIL} ${dependencies[name] || "N/A"}`,
1611
- peerDependencies: isPeerDependencySatisfied ? SYMBOL.OK : `${SYMBOL.FAIL} ${peerDependencies[name] || "N/A"}`,
1612
- node_modules: isInstalledSatisfied ? SYMBOL.OK : `${SYMBOL.FAIL} ${nodeModulesVersion || "N/A"}`
1613
- };
1614
- }
1615
- });
1616
- if (!isCompliant) {
1617
- console.info(`${SYMBOL.FAIL} \x1b[1mPrerequisite check failed.\x1b[0m`);
1618
- renderTable(comparisons, "package");
1619
- return false;
1620
- }
1621
- return true;
1622
- } catch (error) {
1623
- console.error("Cannot assess the state of prerequisites:", error);
1624
- return false;
1625
- }
1626
- };
1627
-
1628
- //#endregion
1629
10
  //#region src/controller/helpers/getOptions.ts
1630
11
  /**
1631
12
  * if args are provided via CLI, log them to the console in
@@ -1638,84 +19,14 @@ const logToInquirer = (label, value) => {
1638
19
  console.info(`${checkmark} ${boldLabel} ${greenValue}`);
1639
20
  };
1640
21
  /**
1641
- * Get all directories recursively for autocomplete
1642
- */
1643
- const getDirectoryChoices = (rootPath, currentInput = "", maxDepth = 3) => {
1644
- const SKIP_DIRS = new Set([
1645
- "node_modules",
1646
- "dist",
1647
- "build",
1648
- "coverage",
1649
- ".git",
1650
- ".next",
1651
- ".nuxt",
1652
- ".vscode",
1653
- ".idea",
1654
- "vendor",
1655
- "__pycache__"
1656
- ]);
1657
- const choices = /* @__PURE__ */ new Set();
1658
- choices.add(".");
1659
- const scanDirectory = (dirPath, depth = 0) => {
1660
- if (depth >= maxDepth) return;
1661
- try {
1662
- const items = (0, node_fs.readdirSync)(dirPath, { withFileTypes: true });
1663
- for (const item of items) if (!item.name.startsWith(".") && !SKIP_DIRS.has(item.name)) {
1664
- if (item.isDirectory()) {
1665
- const fullPath = (0, node_path.join)(dirPath, item.name);
1666
- const relativePath = (0, node_path.relative)(rootPath, fullPath);
1667
- if (relativePath && !relativePath.startsWith("..") && !relativePath.includes("..")) {
1668
- choices.add(relativePath);
1669
- scanDirectory(fullPath, depth + 1);
1670
- }
1671
- }
1672
- }
1673
- } catch {}
1674
- };
1675
- scanDirectory(rootPath);
1676
- const allChoices = Array.from(choices).sort();
1677
- if (currentInput.trim()) {
1678
- const inputLower = currentInput.toLowerCase();
1679
- return allChoices.filter((choice) => choice.toLowerCase().includes(inputLower)).slice(0, 10);
1680
- }
1681
- return allChoices.slice(0, 20);
1682
- };
1683
- /**
1684
22
  * Lets user pick from available packages to run the codemod on
1685
23
  */
1686
24
  const queryPackages = async (packages) => {
1687
25
  const message = "Path to run codemod on:";
1688
- const nonRootPackages = packages.filter((pkg) => pkg !== "." && pkg !== "./");
1689
- if (packages.length === 1 && (packages[0] === "." || packages[0] === "./")) {
1690
- const useCustomPath = await (0, __inquirer_prompts.confirm)({
1691
- message: "Do you want to target a specific folder instead of the entire project?",
1692
- default: false
1693
- });
1694
- if (useCustomPath) {
1695
- const customPath = await (0, __inquirer_prompts.search)({
1696
- message: "Enter the folder path (relative to project root):",
1697
- source: async (searchInput) => {
1698
- const rootPath = process.cwd();
1699
- const choices = getDirectoryChoices(rootPath, searchInput || "");
1700
- return choices.map((choice) => ({
1701
- name: choice === "." ? ". (entire project)" : choice,
1702
- value: choice,
1703
- description: choice === "." ? "Target the entire project" : `Target ${choice} directory`
1704
- }));
1705
- },
1706
- validate: (path$3) => {
1707
- if (!path$3?.trim()) return "Path cannot be empty";
1708
- const fullPath = (0, node_path.join)(process.cwd(), path$3);
1709
- if (!(0, node_fs.existsSync)(fullPath)) return "Folder does not exist";
1710
- if (!(0, node_fs.statSync)(fullPath).isDirectory()) return "Path must be a directory";
1711
- return true;
1712
- }
1713
- });
1714
- logToInquirer(message, customPath);
1715
- return [customPath];
1716
- }
1717
- logToInquirer(message, packages[0] === "./" ? "." : packages[0]);
1718
- return [packages[0] === "./" ? "." : packages[0]];
26
+ const nonRootPackages = packages.filter((pkg) => pkg !== ".");
27
+ if (packages.length === 1 && nonRootPackages.length === 0) {
28
+ logToInquirer(message, packages[0]);
29
+ return packages;
1719
30
  }
1720
31
  if (nonRootPackages.length >= 1) return (0, __inquirer_prompts.checkbox)({
1721
32
  required: true,
@@ -1726,7 +37,6 @@ const queryPackages = async (packages) => {
1726
37
  checked: true
1727
38
  }))
1728
39
  });
1729
- return ["."];
1730
40
  };
1731
41
  /**
1732
42
  * Determine user choice between CLI arg and Inquirer prompt: codemod
@@ -1870,6 +180,52 @@ async function loadTransformModules(transformsDir) {
1870
180
  }
1871
181
  var loadTransformModules_default = loadTransformModules;
1872
182
 
183
+ //#endregion
184
+ //#region src/controller/helpers/repository.ts
185
+ /**
186
+ * Finds the root of the project by looking for the `.git` directory.
187
+ */
188
+ function findProjectRoot() {
189
+ try {
190
+ const gitRoot = (0, node_child_process.execSync)("git rev-parse --show-toplevel", {
191
+ cwd: process.cwd(),
192
+ encoding: "utf8",
193
+ stdio: [
194
+ "ignore",
195
+ "pipe",
196
+ "ignore"
197
+ ]
198
+ }).trim();
199
+ return gitRoot && (0, node_fs.existsSync)(gitRoot) ? gitRoot : "";
200
+ } catch {
201
+ return "";
202
+ }
203
+ }
204
+ /**
205
+ * Quick and dirty way of determining package roots based on
206
+ * the presence of `package.json` files and them optimistically
207
+ * containing a `@transferwise/components` string.
208
+ * */
209
+ function findPackages() {
210
+ try {
211
+ const packages = (0, node_child_process.execSync)([
212
+ "find ./",
213
+ "-type f",
214
+ "-name \"package.json\"",
215
+ "-not -path \"*/node_modules/*\"",
216
+ "|",
217
+ "xargs grep -l \"@transferwise/components\""
218
+ ].join(" "), {
219
+ cwd: findProjectRoot(),
220
+ encoding: "utf8"
221
+ }).trim().split("\n").map(node_path.default.dirname);
222
+ if (packages.length === 0) throw new Error();
223
+ return packages;
224
+ } catch {
225
+ throw new Error("No suitable package roots found in the repository.");
226
+ }
227
+ }
228
+
1873
229
  //#endregion
1874
230
  //#region src/controller/index.ts
1875
231
  const currentFilePath = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
@@ -1907,26 +263,22 @@ async function runCodemod(transformsDir) {
1907
263
  root: findProjectRoot(),
1908
264
  transformFiles: await Promise.all(transformFiles)
1909
265
  });
1910
- const codemodPath = node_path.default.resolve(resolvedTransformsDir, options.transformFile, `transformer.js`);
266
+ const codemodPath = node_path.default.resolve(resolvedTransformsDir, `${options.transformFile}/transformer.js`);
1911
267
  console.debug(`Resolved codemod path: ${codemodPath}`);
1912
268
  options.targetPaths.map((targetPath) => {
1913
- console.info(`\n\x1b[34m➙\x1b[0m \x1b[1mProcessing:\x1b[0m \x1b[32m${targetPath}\x1b[0m`);
1914
- const isCompliant = assessPrerequisites(targetPath, codemodPath);
1915
- if (isCompliant) {
1916
- const args = [
1917
- "-t",
1918
- codemodPath,
1919
- targetPath,
1920
- options.isDry ? "--dry" : "",
1921
- options.isPrint ? "--print" : "",
1922
- options.ignorePatterns ? options.ignorePatterns.split(",").map((pattern) => `--ignore-pattern=${pattern.trim()}`).join(" ") : "",
1923
- options.useGitIgnore ? "--gitignore" : ""
1924
- ].filter(Boolean);
1925
- const command = `npx jscodeshift ${args.join(" ")}`;
1926
- console.debug(`Running: ${command}`);
1927
- return (0, node_child_process.execSync)(command, { stdio: "inherit" });
1928
- }
1929
- return void 0;
269
+ const args = [
270
+ "-t",
271
+ codemodPath,
272
+ targetPath,
273
+ options.isDry ? "--dry" : "",
274
+ options.isPrint ? "--print" : "",
275
+ options.ignorePatterns ? options.ignorePatterns.split(",").map((pattern) => `--ignore-pattern=${pattern.trim()}`).join(" ") : "",
276
+ options.useGitIgnore ? "--gitignore" : ""
277
+ ].filter(Boolean);
278
+ const command = `npx jscodeshift ${args.join(" ")}`;
279
+ console.info(`⚙️ \x1b[1mProcessing:\x1b[0m \x1b[32m${targetPath}\x1b[0m`);
280
+ console.debug(`Running: ${command}`);
281
+ return (0, node_child_process.execSync)(command, { stdio: "inherit" });
1930
282
  });
1931
283
  await summariseReportFile(reportPath);
1932
284
  } catch (error) {