@oclif/plugin-test-esbuild 0.4.19 → 0.4.20

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,26 +1,29 @@
1
1
  import {
2
2
  ESBuild
3
- } from "./chunk-DQOR6OMF.js";
3
+ } from "./chunk-NYAOQONU.js";
4
4
  import {
5
5
  Hello
6
- } from "./chunk-QWDKXXHB.js";
6
+ } from "./chunk-WBL2ZEOX.js";
7
7
  import {
8
8
  World
9
- } from "./chunk-BFB7DX4H.js";
9
+ } from "./chunk-4P6LCYSK.js";
10
10
  import {
11
11
  init_default
12
- } from "./chunk-QTRAB6EQ.js";
12
+ } from "./chunk-ROBJRQRG.js";
13
13
  import {
14
- __commonJS,
15
- __toESM,
16
- init_cjs_shims,
17
14
  require_lib,
18
15
  require_src
19
- } from "./chunk-XMMEVJHV.js";
16
+ } from "./chunk-24X2WV72.js";
17
+ import {
18
+ __commonJS,
19
+ __require,
20
+ __toESM,
21
+ init_cjs_shims
22
+ } from "./chunk-RRP6KXWN.js";
20
23
 
21
- // node_modules/semver/internal/constants.js
24
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/internal/constants.js
22
25
  var require_constants = __commonJS({
23
- "node_modules/semver/internal/constants.js"(exports, module) {
26
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/internal/constants.js"(exports, module) {
24
27
  init_cjs_shims();
25
28
  var SEMVER_SPEC_VERSION = "2.0.0";
26
29
  var MAX_LENGTH = 256;
@@ -50,26 +53,26 @@ var require_constants = __commonJS({
50
53
  }
51
54
  });
52
55
 
53
- // node_modules/semver/internal/debug.js
56
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/internal/debug.js
54
57
  var require_debug = __commonJS({
55
- "node_modules/semver/internal/debug.js"(exports, module) {
58
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/internal/debug.js"(exports, module) {
56
59
  init_cjs_shims();
57
- var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
60
+ var debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
58
61
  };
59
- module.exports = debug2;
62
+ module.exports = debug4;
60
63
  }
61
64
  });
62
65
 
63
- // node_modules/semver/internal/re.js
66
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/internal/re.js
64
67
  var require_re = __commonJS({
65
- "node_modules/semver/internal/re.js"(exports, module) {
68
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/internal/re.js"(exports, module) {
66
69
  init_cjs_shims();
67
70
  var {
68
71
  MAX_SAFE_COMPONENT_LENGTH,
69
72
  MAX_SAFE_BUILD_LENGTH,
70
73
  MAX_LENGTH
71
74
  } = require_constants();
72
- var debug2 = require_debug();
75
+ var debug4 = require_debug();
73
76
  exports = module.exports = {};
74
77
  var re = exports.re = [];
75
78
  var safeRe = exports.safeRe = [];
@@ -91,7 +94,7 @@ var require_re = __commonJS({
91
94
  var createToken = (name, value, isGlobal) => {
92
95
  const safe = makeSafeRegex(value);
93
96
  const index = R++;
94
- debug2(name, index, value);
97
+ debug4(name, index, value);
95
98
  t[name] = index;
96
99
  src[index] = value;
97
100
  re[index] = new RegExp(value, isGlobal ? "g" : void 0);
@@ -146,9 +149,9 @@ var require_re = __commonJS({
146
149
  }
147
150
  });
148
151
 
149
- // node_modules/semver/internal/parse-options.js
152
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/internal/parse-options.js
150
153
  var require_parse_options = __commonJS({
151
- "node_modules/semver/internal/parse-options.js"(exports, module) {
154
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/internal/parse-options.js"(exports, module) {
152
155
  init_cjs_shims();
153
156
  var looseOption = Object.freeze({ loose: true });
154
157
  var emptyOpts = Object.freeze({});
@@ -165,9 +168,9 @@ var require_parse_options = __commonJS({
165
168
  }
166
169
  });
167
170
 
168
- // node_modules/semver/internal/identifiers.js
171
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/internal/identifiers.js
169
172
  var require_identifiers = __commonJS({
170
- "node_modules/semver/internal/identifiers.js"(exports, module) {
173
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/internal/identifiers.js"(exports, module) {
171
174
  init_cjs_shims();
172
175
  var numeric = /^[0-9]+$/;
173
176
  var compareIdentifiers = (a, b) => {
@@ -187,11 +190,11 @@ var require_identifiers = __commonJS({
187
190
  }
188
191
  });
189
192
 
190
- // node_modules/semver/classes/semver.js
193
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/classes/semver.js
191
194
  var require_semver = __commonJS({
192
- "node_modules/semver/classes/semver.js"(exports, module) {
195
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/classes/semver.js"(exports, module) {
193
196
  init_cjs_shims();
194
- var debug2 = require_debug();
197
+ var debug4 = require_debug();
195
198
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
196
199
  var { safeRe: re, t } = require_re();
197
200
  var parseOptions = require_parse_options();
@@ -213,7 +216,7 @@ var require_semver = __commonJS({
213
216
  `version is longer than ${MAX_LENGTH} characters`
214
217
  );
215
218
  }
216
- debug2("SemVer", version, options);
219
+ debug4("SemVer", version, options);
217
220
  this.options = options;
218
221
  this.loose = !!options.loose;
219
222
  this.includePrerelease = !!options.includePrerelease;
@@ -261,7 +264,7 @@ var require_semver = __commonJS({
261
264
  return this.version;
262
265
  }
263
266
  compare(other) {
264
- debug2("SemVer.compare", this.version, this.options, other);
267
+ debug4("SemVer.compare", this.version, this.options, other);
265
268
  if (!(other instanceof _SemVer)) {
266
269
  if (typeof other === "string" && other === this.version) {
267
270
  return 0;
@@ -294,7 +297,7 @@ var require_semver = __commonJS({
294
297
  do {
295
298
  const a = this.prerelease[i];
296
299
  const b = other.prerelease[i];
297
- debug2("prerelease compare", i, a, b);
300
+ debug4("prerelease compare", i, a, b);
298
301
  if (a === void 0 && b === void 0) {
299
302
  return 0;
300
303
  } else if (b === void 0) {
@@ -316,7 +319,7 @@ var require_semver = __commonJS({
316
319
  do {
317
320
  const a = this.build[i];
318
321
  const b = other.build[i];
319
- debug2("prerelease compare", i, a, b);
322
+ debug4("build compare", i, a, b);
320
323
  if (a === void 0 && b === void 0) {
321
324
  return 0;
322
325
  } else if (b === void 0) {
@@ -430,9 +433,9 @@ var require_semver = __commonJS({
430
433
  }
431
434
  });
432
435
 
433
- // node_modules/semver/functions/parse.js
436
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/parse.js
434
437
  var require_parse = __commonJS({
435
- "node_modules/semver/functions/parse.js"(exports, module) {
438
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/parse.js"(exports, module) {
436
439
  init_cjs_shims();
437
440
  var SemVer = require_semver();
438
441
  var parse = (version, options, throwErrors = false) => {
@@ -452,9 +455,9 @@ var require_parse = __commonJS({
452
455
  }
453
456
  });
454
457
 
455
- // node_modules/semver/functions/valid.js
458
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/valid.js
456
459
  var require_valid = __commonJS({
457
- "node_modules/semver/functions/valid.js"(exports, module) {
460
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/valid.js"(exports, module) {
458
461
  init_cjs_shims();
459
462
  var parse = require_parse();
460
463
  var valid2 = (version, options) => {
@@ -465,9 +468,9 @@ var require_valid = __commonJS({
465
468
  }
466
469
  });
467
470
 
468
- // node_modules/semver/functions/clean.js
471
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/clean.js
469
472
  var require_clean = __commonJS({
470
- "node_modules/semver/functions/clean.js"(exports, module) {
473
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/clean.js"(exports, module) {
471
474
  init_cjs_shims();
472
475
  var parse = require_parse();
473
476
  var clean = (version, options) => {
@@ -478,9 +481,9 @@ var require_clean = __commonJS({
478
481
  }
479
482
  });
480
483
 
481
- // node_modules/semver/functions/inc.js
484
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/inc.js
482
485
  var require_inc = __commonJS({
483
- "node_modules/semver/functions/inc.js"(exports, module) {
486
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/inc.js"(exports, module) {
484
487
  init_cjs_shims();
485
488
  var SemVer = require_semver();
486
489
  var inc = (version, release, options, identifier, identifierBase) => {
@@ -502,9 +505,9 @@ var require_inc = __commonJS({
502
505
  }
503
506
  });
504
507
 
505
- // node_modules/semver/functions/diff.js
508
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/diff.js
506
509
  var require_diff = __commonJS({
507
- "node_modules/semver/functions/diff.js"(exports, module) {
510
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/diff.js"(exports, module) {
508
511
  init_cjs_shims();
509
512
  var parse = require_parse();
510
513
  var diff = (version1, version2) => {
@@ -547,9 +550,9 @@ var require_diff = __commonJS({
547
550
  }
548
551
  });
549
552
 
550
- // node_modules/semver/functions/major.js
553
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/major.js
551
554
  var require_major = __commonJS({
552
- "node_modules/semver/functions/major.js"(exports, module) {
555
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/major.js"(exports, module) {
553
556
  init_cjs_shims();
554
557
  var SemVer = require_semver();
555
558
  var major = (a, loose) => new SemVer(a, loose).major;
@@ -557,9 +560,9 @@ var require_major = __commonJS({
557
560
  }
558
561
  });
559
562
 
560
- // node_modules/semver/functions/minor.js
563
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/minor.js
561
564
  var require_minor = __commonJS({
562
- "node_modules/semver/functions/minor.js"(exports, module) {
565
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/minor.js"(exports, module) {
563
566
  init_cjs_shims();
564
567
  var SemVer = require_semver();
565
568
  var minor = (a, loose) => new SemVer(a, loose).minor;
@@ -567,9 +570,9 @@ var require_minor = __commonJS({
567
570
  }
568
571
  });
569
572
 
570
- // node_modules/semver/functions/patch.js
573
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/patch.js
571
574
  var require_patch = __commonJS({
572
- "node_modules/semver/functions/patch.js"(exports, module) {
575
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/patch.js"(exports, module) {
573
576
  init_cjs_shims();
574
577
  var SemVer = require_semver();
575
578
  var patch = (a, loose) => new SemVer(a, loose).patch;
@@ -577,9 +580,9 @@ var require_patch = __commonJS({
577
580
  }
578
581
  });
579
582
 
580
- // node_modules/semver/functions/prerelease.js
583
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/prerelease.js
581
584
  var require_prerelease = __commonJS({
582
- "node_modules/semver/functions/prerelease.js"(exports, module) {
585
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/prerelease.js"(exports, module) {
583
586
  init_cjs_shims();
584
587
  var parse = require_parse();
585
588
  var prerelease = (version, options) => {
@@ -590,9 +593,9 @@ var require_prerelease = __commonJS({
590
593
  }
591
594
  });
592
595
 
593
- // node_modules/semver/functions/compare.js
596
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/compare.js
594
597
  var require_compare = __commonJS({
595
- "node_modules/semver/functions/compare.js"(exports, module) {
598
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/compare.js"(exports, module) {
596
599
  init_cjs_shims();
597
600
  var SemVer = require_semver();
598
601
  var compare2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
@@ -600,9 +603,9 @@ var require_compare = __commonJS({
600
603
  }
601
604
  });
602
605
 
603
- // node_modules/semver/functions/rcompare.js
606
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/rcompare.js
604
607
  var require_rcompare = __commonJS({
605
- "node_modules/semver/functions/rcompare.js"(exports, module) {
608
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/rcompare.js"(exports, module) {
606
609
  init_cjs_shims();
607
610
  var compare2 = require_compare();
608
611
  var rcompare = (a, b, loose) => compare2(b, a, loose);
@@ -610,9 +613,9 @@ var require_rcompare = __commonJS({
610
613
  }
611
614
  });
612
615
 
613
- // node_modules/semver/functions/compare-loose.js
616
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/compare-loose.js
614
617
  var require_compare_loose = __commonJS({
615
- "node_modules/semver/functions/compare-loose.js"(exports, module) {
618
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/compare-loose.js"(exports, module) {
616
619
  init_cjs_shims();
617
620
  var compare2 = require_compare();
618
621
  var compareLoose = (a, b) => compare2(a, b, true);
@@ -620,9 +623,9 @@ var require_compare_loose = __commonJS({
620
623
  }
621
624
  });
622
625
 
623
- // node_modules/semver/functions/compare-build.js
626
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/compare-build.js
624
627
  var require_compare_build = __commonJS({
625
- "node_modules/semver/functions/compare-build.js"(exports, module) {
628
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/compare-build.js"(exports, module) {
626
629
  init_cjs_shims();
627
630
  var SemVer = require_semver();
628
631
  var compareBuild = (a, b, loose) => {
@@ -634,9 +637,9 @@ var require_compare_build = __commonJS({
634
637
  }
635
638
  });
636
639
 
637
- // node_modules/semver/functions/sort.js
640
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/sort.js
638
641
  var require_sort = __commonJS({
639
- "node_modules/semver/functions/sort.js"(exports, module) {
642
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/sort.js"(exports, module) {
640
643
  init_cjs_shims();
641
644
  var compareBuild = require_compare_build();
642
645
  var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
@@ -644,9 +647,9 @@ var require_sort = __commonJS({
644
647
  }
645
648
  });
646
649
 
647
- // node_modules/semver/functions/rsort.js
650
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/rsort.js
648
651
  var require_rsort = __commonJS({
649
- "node_modules/semver/functions/rsort.js"(exports, module) {
652
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/rsort.js"(exports, module) {
650
653
  init_cjs_shims();
651
654
  var compareBuild = require_compare_build();
652
655
  var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
@@ -654,9 +657,9 @@ var require_rsort = __commonJS({
654
657
  }
655
658
  });
656
659
 
657
- // node_modules/semver/functions/gt.js
660
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/gt.js
658
661
  var require_gt = __commonJS({
659
- "node_modules/semver/functions/gt.js"(exports, module) {
662
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/gt.js"(exports, module) {
660
663
  init_cjs_shims();
661
664
  var compare2 = require_compare();
662
665
  var gt2 = (a, b, loose) => compare2(a, b, loose) > 0;
@@ -664,9 +667,9 @@ var require_gt = __commonJS({
664
667
  }
665
668
  });
666
669
 
667
- // node_modules/semver/functions/lt.js
670
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/lt.js
668
671
  var require_lt = __commonJS({
669
- "node_modules/semver/functions/lt.js"(exports, module) {
672
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/lt.js"(exports, module) {
670
673
  init_cjs_shims();
671
674
  var compare2 = require_compare();
672
675
  var lt = (a, b, loose) => compare2(a, b, loose) < 0;
@@ -674,9 +677,9 @@ var require_lt = __commonJS({
674
677
  }
675
678
  });
676
679
 
677
- // node_modules/semver/functions/eq.js
680
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/eq.js
678
681
  var require_eq = __commonJS({
679
- "node_modules/semver/functions/eq.js"(exports, module) {
682
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/eq.js"(exports, module) {
680
683
  init_cjs_shims();
681
684
  var compare2 = require_compare();
682
685
  var eq = (a, b, loose) => compare2(a, b, loose) === 0;
@@ -684,9 +687,9 @@ var require_eq = __commonJS({
684
687
  }
685
688
  });
686
689
 
687
- // node_modules/semver/functions/neq.js
690
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/neq.js
688
691
  var require_neq = __commonJS({
689
- "node_modules/semver/functions/neq.js"(exports, module) {
692
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/neq.js"(exports, module) {
690
693
  init_cjs_shims();
691
694
  var compare2 = require_compare();
692
695
  var neq = (a, b, loose) => compare2(a, b, loose) !== 0;
@@ -694,9 +697,9 @@ var require_neq = __commonJS({
694
697
  }
695
698
  });
696
699
 
697
- // node_modules/semver/functions/gte.js
700
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/gte.js
698
701
  var require_gte = __commonJS({
699
- "node_modules/semver/functions/gte.js"(exports, module) {
702
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/gte.js"(exports, module) {
700
703
  init_cjs_shims();
701
704
  var compare2 = require_compare();
702
705
  var gte = (a, b, loose) => compare2(a, b, loose) >= 0;
@@ -704,9 +707,9 @@ var require_gte = __commonJS({
704
707
  }
705
708
  });
706
709
 
707
- // node_modules/semver/functions/lte.js
710
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/lte.js
708
711
  var require_lte = __commonJS({
709
- "node_modules/semver/functions/lte.js"(exports, module) {
712
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/lte.js"(exports, module) {
710
713
  init_cjs_shims();
711
714
  var compare2 = require_compare();
712
715
  var lte = (a, b, loose) => compare2(a, b, loose) <= 0;
@@ -714,9 +717,9 @@ var require_lte = __commonJS({
714
717
  }
715
718
  });
716
719
 
717
- // node_modules/semver/functions/cmp.js
720
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/cmp.js
718
721
  var require_cmp = __commonJS({
719
- "node_modules/semver/functions/cmp.js"(exports, module) {
722
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/cmp.js"(exports, module) {
720
723
  init_cjs_shims();
721
724
  var eq = require_eq();
722
725
  var neq = require_neq();
@@ -764,9 +767,9 @@ var require_cmp = __commonJS({
764
767
  }
765
768
  });
766
769
 
767
- // node_modules/semver/functions/coerce.js
770
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/coerce.js
768
771
  var require_coerce = __commonJS({
769
- "node_modules/semver/functions/coerce.js"(exports, module) {
772
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/coerce.js"(exports, module) {
770
773
  init_cjs_shims();
771
774
  var SemVer = require_semver();
772
775
  var parse = require_parse();
@@ -810,664 +813,47 @@ var require_coerce = __commonJS({
810
813
  }
811
814
  });
812
815
 
813
- // node_modules/yallist/iterator.js
814
- var require_iterator = __commonJS({
815
- "node_modules/yallist/iterator.js"(exports, module) {
816
- "use strict";
817
- init_cjs_shims();
818
- module.exports = function(Yallist) {
819
- Yallist.prototype[Symbol.iterator] = function* () {
820
- for (let walker = this.head; walker; walker = walker.next) {
821
- yield walker.value;
822
- }
823
- };
824
- };
825
- }
826
- });
827
-
828
- // node_modules/yallist/yallist.js
829
- var require_yallist = __commonJS({
830
- "node_modules/yallist/yallist.js"(exports, module) {
831
- "use strict";
832
- init_cjs_shims();
833
- module.exports = Yallist;
834
- Yallist.Node = Node;
835
- Yallist.create = Yallist;
836
- function Yallist(list) {
837
- var self = this;
838
- if (!(self instanceof Yallist)) {
839
- self = new Yallist();
840
- }
841
- self.tail = null;
842
- self.head = null;
843
- self.length = 0;
844
- if (list && typeof list.forEach === "function") {
845
- list.forEach(function(item) {
846
- self.push(item);
847
- });
848
- } else if (arguments.length > 0) {
849
- for (var i = 0, l = arguments.length; i < l; i++) {
850
- self.push(arguments[i]);
851
- }
852
- }
853
- return self;
854
- }
855
- Yallist.prototype.removeNode = function(node) {
856
- if (node.list !== this) {
857
- throw new Error("removing node which does not belong to this list");
858
- }
859
- var next = node.next;
860
- var prev = node.prev;
861
- if (next) {
862
- next.prev = prev;
863
- }
864
- if (prev) {
865
- prev.next = next;
866
- }
867
- if (node === this.head) {
868
- this.head = next;
869
- }
870
- if (node === this.tail) {
871
- this.tail = prev;
872
- }
873
- node.list.length--;
874
- node.next = null;
875
- node.prev = null;
876
- node.list = null;
877
- return next;
878
- };
879
- Yallist.prototype.unshiftNode = function(node) {
880
- if (node === this.head) {
881
- return;
882
- }
883
- if (node.list) {
884
- node.list.removeNode(node);
885
- }
886
- var head = this.head;
887
- node.list = this;
888
- node.next = head;
889
- if (head) {
890
- head.prev = node;
891
- }
892
- this.head = node;
893
- if (!this.tail) {
894
- this.tail = node;
895
- }
896
- this.length++;
897
- };
898
- Yallist.prototype.pushNode = function(node) {
899
- if (node === this.tail) {
900
- return;
901
- }
902
- if (node.list) {
903
- node.list.removeNode(node);
904
- }
905
- var tail = this.tail;
906
- node.list = this;
907
- node.prev = tail;
908
- if (tail) {
909
- tail.next = node;
910
- }
911
- this.tail = node;
912
- if (!this.head) {
913
- this.head = node;
914
- }
915
- this.length++;
916
- };
917
- Yallist.prototype.push = function() {
918
- for (var i = 0, l = arguments.length; i < l; i++) {
919
- push(this, arguments[i]);
920
- }
921
- return this.length;
922
- };
923
- Yallist.prototype.unshift = function() {
924
- for (var i = 0, l = arguments.length; i < l; i++) {
925
- unshift(this, arguments[i]);
926
- }
927
- return this.length;
928
- };
929
- Yallist.prototype.pop = function() {
930
- if (!this.tail) {
931
- return void 0;
932
- }
933
- var res = this.tail.value;
934
- this.tail = this.tail.prev;
935
- if (this.tail) {
936
- this.tail.next = null;
937
- } else {
938
- this.head = null;
939
- }
940
- this.length--;
941
- return res;
942
- };
943
- Yallist.prototype.shift = function() {
944
- if (!this.head) {
945
- return void 0;
946
- }
947
- var res = this.head.value;
948
- this.head = this.head.next;
949
- if (this.head) {
950
- this.head.prev = null;
951
- } else {
952
- this.tail = null;
953
- }
954
- this.length--;
955
- return res;
956
- };
957
- Yallist.prototype.forEach = function(fn, thisp) {
958
- thisp = thisp || this;
959
- for (var walker = this.head, i = 0; walker !== null; i++) {
960
- fn.call(thisp, walker.value, i, this);
961
- walker = walker.next;
962
- }
963
- };
964
- Yallist.prototype.forEachReverse = function(fn, thisp) {
965
- thisp = thisp || this;
966
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
967
- fn.call(thisp, walker.value, i, this);
968
- walker = walker.prev;
969
- }
970
- };
971
- Yallist.prototype.get = function(n) {
972
- for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
973
- walker = walker.next;
974
- }
975
- if (i === n && walker !== null) {
976
- return walker.value;
977
- }
978
- };
979
- Yallist.prototype.getReverse = function(n) {
980
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
981
- walker = walker.prev;
982
- }
983
- if (i === n && walker !== null) {
984
- return walker.value;
985
- }
986
- };
987
- Yallist.prototype.map = function(fn, thisp) {
988
- thisp = thisp || this;
989
- var res = new Yallist();
990
- for (var walker = this.head; walker !== null; ) {
991
- res.push(fn.call(thisp, walker.value, this));
992
- walker = walker.next;
993
- }
994
- return res;
995
- };
996
- Yallist.prototype.mapReverse = function(fn, thisp) {
997
- thisp = thisp || this;
998
- var res = new Yallist();
999
- for (var walker = this.tail; walker !== null; ) {
1000
- res.push(fn.call(thisp, walker.value, this));
1001
- walker = walker.prev;
1002
- }
1003
- return res;
1004
- };
1005
- Yallist.prototype.reduce = function(fn, initial) {
1006
- var acc;
1007
- var walker = this.head;
1008
- if (arguments.length > 1) {
1009
- acc = initial;
1010
- } else if (this.head) {
1011
- walker = this.head.next;
1012
- acc = this.head.value;
1013
- } else {
1014
- throw new TypeError("Reduce of empty list with no initial value");
1015
- }
1016
- for (var i = 0; walker !== null; i++) {
1017
- acc = fn(acc, walker.value, i);
1018
- walker = walker.next;
1019
- }
1020
- return acc;
1021
- };
1022
- Yallist.prototype.reduceReverse = function(fn, initial) {
1023
- var acc;
1024
- var walker = this.tail;
1025
- if (arguments.length > 1) {
1026
- acc = initial;
1027
- } else if (this.tail) {
1028
- walker = this.tail.prev;
1029
- acc = this.tail.value;
1030
- } else {
1031
- throw new TypeError("Reduce of empty list with no initial value");
1032
- }
1033
- for (var i = this.length - 1; walker !== null; i--) {
1034
- acc = fn(acc, walker.value, i);
1035
- walker = walker.prev;
1036
- }
1037
- return acc;
1038
- };
1039
- Yallist.prototype.toArray = function() {
1040
- var arr = new Array(this.length);
1041
- for (var i = 0, walker = this.head; walker !== null; i++) {
1042
- arr[i] = walker.value;
1043
- walker = walker.next;
1044
- }
1045
- return arr;
1046
- };
1047
- Yallist.prototype.toArrayReverse = function() {
1048
- var arr = new Array(this.length);
1049
- for (var i = 0, walker = this.tail; walker !== null; i++) {
1050
- arr[i] = walker.value;
1051
- walker = walker.prev;
1052
- }
1053
- return arr;
1054
- };
1055
- Yallist.prototype.slice = function(from, to) {
1056
- to = to || this.length;
1057
- if (to < 0) {
1058
- to += this.length;
1059
- }
1060
- from = from || 0;
1061
- if (from < 0) {
1062
- from += this.length;
1063
- }
1064
- var ret = new Yallist();
1065
- if (to < from || to < 0) {
1066
- return ret;
1067
- }
1068
- if (from < 0) {
1069
- from = 0;
1070
- }
1071
- if (to > this.length) {
1072
- to = this.length;
1073
- }
1074
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
1075
- walker = walker.next;
1076
- }
1077
- for (; walker !== null && i < to; i++, walker = walker.next) {
1078
- ret.push(walker.value);
1079
- }
1080
- return ret;
1081
- };
1082
- Yallist.prototype.sliceReverse = function(from, to) {
1083
- to = to || this.length;
1084
- if (to < 0) {
1085
- to += this.length;
1086
- }
1087
- from = from || 0;
1088
- if (from < 0) {
1089
- from += this.length;
1090
- }
1091
- var ret = new Yallist();
1092
- if (to < from || to < 0) {
1093
- return ret;
1094
- }
1095
- if (from < 0) {
1096
- from = 0;
1097
- }
1098
- if (to > this.length) {
1099
- to = this.length;
1100
- }
1101
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
1102
- walker = walker.prev;
1103
- }
1104
- for (; walker !== null && i > from; i--, walker = walker.prev) {
1105
- ret.push(walker.value);
1106
- }
1107
- return ret;
1108
- };
1109
- Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
1110
- if (start > this.length) {
1111
- start = this.length - 1;
1112
- }
1113
- if (start < 0) {
1114
- start = this.length + start;
1115
- }
1116
- for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
1117
- walker = walker.next;
1118
- }
1119
- var ret = [];
1120
- for (var i = 0; walker && i < deleteCount; i++) {
1121
- ret.push(walker.value);
1122
- walker = this.removeNode(walker);
1123
- }
1124
- if (walker === null) {
1125
- walker = this.tail;
1126
- }
1127
- if (walker !== this.head && walker !== this.tail) {
1128
- walker = walker.prev;
1129
- }
1130
- for (var i = 0; i < nodes.length; i++) {
1131
- walker = insert(this, walker, nodes[i]);
1132
- }
1133
- return ret;
1134
- };
1135
- Yallist.prototype.reverse = function() {
1136
- var head = this.head;
1137
- var tail = this.tail;
1138
- for (var walker = head; walker !== null; walker = walker.prev) {
1139
- var p = walker.prev;
1140
- walker.prev = walker.next;
1141
- walker.next = p;
1142
- }
1143
- this.head = tail;
1144
- this.tail = head;
1145
- return this;
1146
- };
1147
- function insert(self, node, value) {
1148
- var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
1149
- if (inserted.next === null) {
1150
- self.tail = inserted;
1151
- }
1152
- if (inserted.prev === null) {
1153
- self.head = inserted;
1154
- }
1155
- self.length++;
1156
- return inserted;
1157
- }
1158
- function push(self, item) {
1159
- self.tail = new Node(item, self.tail, null, self);
1160
- if (!self.head) {
1161
- self.head = self.tail;
1162
- }
1163
- self.length++;
1164
- }
1165
- function unshift(self, item) {
1166
- self.head = new Node(item, null, self.head, self);
1167
- if (!self.tail) {
1168
- self.tail = self.head;
1169
- }
1170
- self.length++;
1171
- }
1172
- function Node(value, prev, next, list) {
1173
- if (!(this instanceof Node)) {
1174
- return new Node(value, prev, next, list);
1175
- }
1176
- this.list = list;
1177
- this.value = value;
1178
- if (prev) {
1179
- prev.next = this;
1180
- this.prev = prev;
1181
- } else {
1182
- this.prev = null;
1183
- }
1184
- if (next) {
1185
- next.prev = this;
1186
- this.next = next;
1187
- } else {
1188
- this.next = null;
1189
- }
1190
- }
1191
- try {
1192
- require_iterator()(Yallist);
1193
- } catch (er) {
1194
- }
1195
- }
1196
- });
1197
-
1198
- // node_modules/semver/node_modules/lru-cache/index.js
1199
- var require_lru_cache = __commonJS({
1200
- "node_modules/semver/node_modules/lru-cache/index.js"(exports, module) {
1201
- "use strict";
816
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/internal/lrucache.js
817
+ var require_lrucache = __commonJS({
818
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/internal/lrucache.js"(exports, module) {
1202
819
  init_cjs_shims();
1203
- var Yallist = require_yallist();
1204
- var MAX = Symbol("max");
1205
- var LENGTH = Symbol("length");
1206
- var LENGTH_CALCULATOR = Symbol("lengthCalculator");
1207
- var ALLOW_STALE = Symbol("allowStale");
1208
- var MAX_AGE = Symbol("maxAge");
1209
- var DISPOSE = Symbol("dispose");
1210
- var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
1211
- var LRU_LIST = Symbol("lruList");
1212
- var CACHE = Symbol("cache");
1213
- var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
1214
- var naiveLength = () => 1;
1215
820
  var LRUCache = class {
1216
- constructor(options) {
1217
- if (typeof options === "number")
1218
- options = { max: options };
1219
- if (!options)
1220
- options = {};
1221
- if (options.max && (typeof options.max !== "number" || options.max < 0))
1222
- throw new TypeError("max must be a non-negative number");
1223
- const max = this[MAX] = options.max || Infinity;
1224
- const lc = options.length || naiveLength;
1225
- this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
1226
- this[ALLOW_STALE] = options.stale || false;
1227
- if (options.maxAge && typeof options.maxAge !== "number")
1228
- throw new TypeError("maxAge must be a number");
1229
- this[MAX_AGE] = options.maxAge || 0;
1230
- this[DISPOSE] = options.dispose;
1231
- this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
1232
- this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
1233
- this.reset();
1234
- }
1235
- // resize the cache when the max changes.
1236
- set max(mL) {
1237
- if (typeof mL !== "number" || mL < 0)
1238
- throw new TypeError("max must be a non-negative number");
1239
- this[MAX] = mL || Infinity;
1240
- trim(this);
1241
- }
1242
- get max() {
1243
- return this[MAX];
1244
- }
1245
- set allowStale(allowStale) {
1246
- this[ALLOW_STALE] = !!allowStale;
1247
- }
1248
- get allowStale() {
1249
- return this[ALLOW_STALE];
1250
- }
1251
- set maxAge(mA) {
1252
- if (typeof mA !== "number")
1253
- throw new TypeError("maxAge must be a non-negative number");
1254
- this[MAX_AGE] = mA;
1255
- trim(this);
1256
- }
1257
- get maxAge() {
1258
- return this[MAX_AGE];
1259
- }
1260
- // resize the cache when the lengthCalculator changes.
1261
- set lengthCalculator(lC) {
1262
- if (typeof lC !== "function")
1263
- lC = naiveLength;
1264
- if (lC !== this[LENGTH_CALCULATOR]) {
1265
- this[LENGTH_CALCULATOR] = lC;
1266
- this[LENGTH] = 0;
1267
- this[LRU_LIST].forEach((hit) => {
1268
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
1269
- this[LENGTH] += hit.length;
1270
- });
1271
- }
1272
- trim(this);
1273
- }
1274
- get lengthCalculator() {
1275
- return this[LENGTH_CALCULATOR];
1276
- }
1277
- get length() {
1278
- return this[LENGTH];
1279
- }
1280
- get itemCount() {
1281
- return this[LRU_LIST].length;
1282
- }
1283
- rforEach(fn, thisp) {
1284
- thisp = thisp || this;
1285
- for (let walker = this[LRU_LIST].tail; walker !== null; ) {
1286
- const prev = walker.prev;
1287
- forEachStep(this, fn, walker, thisp);
1288
- walker = prev;
1289
- }
1290
- }
1291
- forEach(fn, thisp) {
1292
- thisp = thisp || this;
1293
- for (let walker = this[LRU_LIST].head; walker !== null; ) {
1294
- const next = walker.next;
1295
- forEachStep(this, fn, walker, thisp);
1296
- walker = next;
1297
- }
1298
- }
1299
- keys() {
1300
- return this[LRU_LIST].toArray().map((k) => k.key);
1301
- }
1302
- values() {
1303
- return this[LRU_LIST].toArray().map((k) => k.value);
1304
- }
1305
- reset() {
1306
- if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
1307
- this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
1308
- }
1309
- this[CACHE] = /* @__PURE__ */ new Map();
1310
- this[LRU_LIST] = new Yallist();
1311
- this[LENGTH] = 0;
1312
- }
1313
- dump() {
1314
- return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
1315
- k: hit.key,
1316
- v: hit.value,
1317
- e: hit.now + (hit.maxAge || 0)
1318
- }).toArray().filter((h) => h);
1319
- }
1320
- dumpLru() {
1321
- return this[LRU_LIST];
1322
- }
1323
- set(key, value, maxAge) {
1324
- maxAge = maxAge || this[MAX_AGE];
1325
- if (maxAge && typeof maxAge !== "number")
1326
- throw new TypeError("maxAge must be a number");
1327
- const now = maxAge ? Date.now() : 0;
1328
- const len = this[LENGTH_CALCULATOR](value, key);
1329
- if (this[CACHE].has(key)) {
1330
- if (len > this[MAX]) {
1331
- del(this, this[CACHE].get(key));
1332
- return false;
1333
- }
1334
- const node = this[CACHE].get(key);
1335
- const item = node.value;
1336
- if (this[DISPOSE]) {
1337
- if (!this[NO_DISPOSE_ON_SET])
1338
- this[DISPOSE](key, item.value);
1339
- }
1340
- item.now = now;
1341
- item.maxAge = maxAge;
1342
- item.value = value;
1343
- this[LENGTH] += len - item.length;
1344
- item.length = len;
1345
- this.get(key);
1346
- trim(this);
1347
- return true;
1348
- }
1349
- const hit = new Entry(key, value, len, now, maxAge);
1350
- if (hit.length > this[MAX]) {
1351
- if (this[DISPOSE])
1352
- this[DISPOSE](key, value);
1353
- return false;
1354
- }
1355
- this[LENGTH] += hit.length;
1356
- this[LRU_LIST].unshift(hit);
1357
- this[CACHE].set(key, this[LRU_LIST].head);
1358
- trim(this);
1359
- return true;
1360
- }
1361
- has(key) {
1362
- if (!this[CACHE].has(key)) return false;
1363
- const hit = this[CACHE].get(key).value;
1364
- return !isStale(this, hit);
821
+ constructor() {
822
+ this.max = 1e3;
823
+ this.map = /* @__PURE__ */ new Map();
1365
824
  }
1366
825
  get(key) {
1367
- return get(this, key, true);
1368
- }
1369
- peek(key) {
1370
- return get(this, key, false);
1371
- }
1372
- pop() {
1373
- const node = this[LRU_LIST].tail;
1374
- if (!node)
1375
- return null;
1376
- del(this, node);
1377
- return node.value;
1378
- }
1379
- del(key) {
1380
- del(this, this[CACHE].get(key));
1381
- }
1382
- load(arr) {
1383
- this.reset();
1384
- const now = Date.now();
1385
- for (let l = arr.length - 1; l >= 0; l--) {
1386
- const hit = arr[l];
1387
- const expiresAt = hit.e || 0;
1388
- if (expiresAt === 0)
1389
- this.set(hit.k, hit.v);
1390
- else {
1391
- const maxAge = expiresAt - now;
1392
- if (maxAge > 0) {
1393
- this.set(hit.k, hit.v, maxAge);
1394
- }
1395
- }
826
+ const value = this.map.get(key);
827
+ if (value === void 0) {
828
+ return void 0;
829
+ } else {
830
+ this.map.delete(key);
831
+ this.map.set(key, value);
832
+ return value;
1396
833
  }
1397
834
  }
1398
- prune() {
1399
- this[CACHE].forEach((value, key) => get(this, key, false));
835
+ delete(key) {
836
+ return this.map.delete(key);
1400
837
  }
1401
- };
1402
- var get = (self, key, doUse) => {
1403
- const node = self[CACHE].get(key);
1404
- if (node) {
1405
- const hit = node.value;
1406
- if (isStale(self, hit)) {
1407
- del(self, node);
1408
- if (!self[ALLOW_STALE])
1409
- return void 0;
1410
- } else {
1411
- if (doUse) {
1412
- if (self[UPDATE_AGE_ON_GET])
1413
- node.value.now = Date.now();
1414
- self[LRU_LIST].unshiftNode(node);
838
+ set(key, value) {
839
+ const deleted = this.delete(key);
840
+ if (!deleted && value !== void 0) {
841
+ if (this.map.size >= this.max) {
842
+ const firstKey = this.map.keys().next().value;
843
+ this.delete(firstKey);
1415
844
  }
845
+ this.map.set(key, value);
1416
846
  }
1417
- return hit.value;
1418
- }
1419
- };
1420
- var isStale = (self, hit) => {
1421
- if (!hit || !hit.maxAge && !self[MAX_AGE])
1422
- return false;
1423
- const diff = Date.now() - hit.now;
1424
- return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
1425
- };
1426
- var trim = (self) => {
1427
- if (self[LENGTH] > self[MAX]) {
1428
- for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
1429
- const prev = walker.prev;
1430
- del(self, walker);
1431
- walker = prev;
1432
- }
1433
- }
1434
- };
1435
- var del = (self, node) => {
1436
- if (node) {
1437
- const hit = node.value;
1438
- if (self[DISPOSE])
1439
- self[DISPOSE](hit.key, hit.value);
1440
- self[LENGTH] -= hit.length;
1441
- self[CACHE].delete(hit.key);
1442
- self[LRU_LIST].removeNode(node);
1443
- }
1444
- };
1445
- var Entry = class {
1446
- constructor(key, value, length, now, maxAge) {
1447
- this.key = key;
1448
- this.value = value;
1449
- this.length = length;
1450
- this.now = now;
1451
- this.maxAge = maxAge || 0;
1452
- }
1453
- };
1454
- var forEachStep = (self, fn, node, thisp) => {
1455
- let hit = node.value;
1456
- if (isStale(self, hit)) {
1457
- del(self, node);
1458
- if (!self[ALLOW_STALE])
1459
- hit = void 0;
847
+ return this;
1460
848
  }
1461
- if (hit)
1462
- fn.call(thisp, hit.value, hit.key, self);
1463
849
  };
1464
850
  module.exports = LRUCache;
1465
851
  }
1466
852
  });
1467
853
 
1468
- // node_modules/semver/classes/range.js
854
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/classes/range.js
1469
855
  var require_range = __commonJS({
1470
- "node_modules/semver/classes/range.js"(exports, module) {
856
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/classes/range.js"(exports, module) {
1471
857
  init_cjs_shims();
1472
858
  var Range = class _Range {
1473
859
  constructor(range, options) {
@@ -1526,21 +912,21 @@ var require_range = __commonJS({
1526
912
  const loose = this.options.loose;
1527
913
  const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1528
914
  range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
1529
- debug2("hyphen replace", range);
915
+ debug4("hyphen replace", range);
1530
916
  range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1531
- debug2("comparator trim", range);
917
+ debug4("comparator trim", range);
1532
918
  range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1533
- debug2("tilde trim", range);
919
+ debug4("tilde trim", range);
1534
920
  range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1535
- debug2("caret trim", range);
921
+ debug4("caret trim", range);
1536
922
  let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
1537
923
  if (loose) {
1538
924
  rangeList = rangeList.filter((comp) => {
1539
- debug2("loose invalid filter", comp, this.options);
925
+ debug4("loose invalid filter", comp, this.options);
1540
926
  return !!comp.match(re[t.COMPARATORLOOSE]);
1541
927
  });
1542
928
  }
1543
- debug2("range list", rangeList);
929
+ debug4("range list", rangeList);
1544
930
  const rangeMap = /* @__PURE__ */ new Map();
1545
931
  const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
1546
932
  for (const comp of comparators) {
@@ -1591,11 +977,11 @@ var require_range = __commonJS({
1591
977
  }
1592
978
  };
1593
979
  module.exports = Range;
1594
- var LRU = require_lru_cache();
1595
- var cache = new LRU({ max: 1e3 });
980
+ var LRU = require_lrucache();
981
+ var cache = new LRU();
1596
982
  var parseOptions = require_parse_options();
1597
983
  var Comparator = require_comparator();
1598
- var debug2 = require_debug();
984
+ var debug4 = require_debug();
1599
985
  var SemVer = require_semver();
1600
986
  var {
1601
987
  safeRe: re,
@@ -1620,15 +1006,15 @@ var require_range = __commonJS({
1620
1006
  return result;
1621
1007
  };
1622
1008
  var parseComparator = (comp, options) => {
1623
- debug2("comp", comp, options);
1009
+ debug4("comp", comp, options);
1624
1010
  comp = replaceCarets(comp, options);
1625
- debug2("caret", comp);
1011
+ debug4("caret", comp);
1626
1012
  comp = replaceTildes(comp, options);
1627
- debug2("tildes", comp);
1013
+ debug4("tildes", comp);
1628
1014
  comp = replaceXRanges(comp, options);
1629
- debug2("xrange", comp);
1015
+ debug4("xrange", comp);
1630
1016
  comp = replaceStars(comp, options);
1631
- debug2("stars", comp);
1017
+ debug4("stars", comp);
1632
1018
  return comp;
1633
1019
  };
1634
1020
  var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
@@ -1638,7 +1024,7 @@ var require_range = __commonJS({
1638
1024
  var replaceTilde = (comp, options) => {
1639
1025
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1640
1026
  return comp.replace(r, (_, M, m, p, pr) => {
1641
- debug2("tilde", comp, _, M, m, p, pr);
1027
+ debug4("tilde", comp, _, M, m, p, pr);
1642
1028
  let ret;
1643
1029
  if (isX(M)) {
1644
1030
  ret = "";
@@ -1647,12 +1033,12 @@ var require_range = __commonJS({
1647
1033
  } else if (isX(p)) {
1648
1034
  ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
1649
1035
  } else if (pr) {
1650
- debug2("replaceTilde pr", pr);
1036
+ debug4("replaceTilde pr", pr);
1651
1037
  ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1652
1038
  } else {
1653
1039
  ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1654
1040
  }
1655
- debug2("tilde return", ret);
1041
+ debug4("tilde return", ret);
1656
1042
  return ret;
1657
1043
  });
1658
1044
  };
@@ -1660,11 +1046,11 @@ var require_range = __commonJS({
1660
1046
  return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1661
1047
  };
1662
1048
  var replaceCaret = (comp, options) => {
1663
- debug2("caret", comp, options);
1049
+ debug4("caret", comp, options);
1664
1050
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1665
1051
  const z = options.includePrerelease ? "-0" : "";
1666
1052
  return comp.replace(r, (_, M, m, p, pr) => {
1667
- debug2("caret", comp, _, M, m, p, pr);
1053
+ debug4("caret", comp, _, M, m, p, pr);
1668
1054
  let ret;
1669
1055
  if (isX(M)) {
1670
1056
  ret = "";
@@ -1677,7 +1063,7 @@ var require_range = __commonJS({
1677
1063
  ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1678
1064
  }
1679
1065
  } else if (pr) {
1680
- debug2("replaceCaret pr", pr);
1066
+ debug4("replaceCaret pr", pr);
1681
1067
  if (M === "0") {
1682
1068
  if (m === "0") {
1683
1069
  ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
@@ -1688,7 +1074,7 @@ var require_range = __commonJS({
1688
1074
  ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1689
1075
  }
1690
1076
  } else {
1691
- debug2("no pr");
1077
+ debug4("no pr");
1692
1078
  if (M === "0") {
1693
1079
  if (m === "0") {
1694
1080
  ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
@@ -1699,19 +1085,19 @@ var require_range = __commonJS({
1699
1085
  ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1700
1086
  }
1701
1087
  }
1702
- debug2("caret return", ret);
1088
+ debug4("caret return", ret);
1703
1089
  return ret;
1704
1090
  });
1705
1091
  };
1706
1092
  var replaceXRanges = (comp, options) => {
1707
- debug2("replaceXRanges", comp, options);
1093
+ debug4("replaceXRanges", comp, options);
1708
1094
  return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
1709
1095
  };
1710
1096
  var replaceXRange = (comp, options) => {
1711
1097
  comp = comp.trim();
1712
1098
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1713
1099
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1714
- debug2("xRange", comp, ret, gtlt, M, m, p, pr);
1100
+ debug4("xRange", comp, ret, gtlt, M, m, p, pr);
1715
1101
  const xM = isX(M);
1716
1102
  const xm = xM || isX(m);
1717
1103
  const xp = xm || isX(p);
@@ -1758,19 +1144,19 @@ var require_range = __commonJS({
1758
1144
  } else if (xp) {
1759
1145
  ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1760
1146
  }
1761
- debug2("xRange return", ret);
1147
+ debug4("xRange return", ret);
1762
1148
  return ret;
1763
1149
  });
1764
1150
  };
1765
1151
  var replaceStars = (comp, options) => {
1766
- debug2("replaceStars", comp, options);
1152
+ debug4("replaceStars", comp, options);
1767
1153
  return comp.trim().replace(re[t.STAR], "");
1768
1154
  };
1769
1155
  var replaceGTE0 = (comp, options) => {
1770
- debug2("replaceGTE0", comp, options);
1156
+ debug4("replaceGTE0", comp, options);
1771
1157
  return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1772
1158
  };
1773
- var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
1159
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1774
1160
  if (isX(fM)) {
1775
1161
  from = "";
1776
1162
  } else if (isX(fm)) {
@@ -1805,7 +1191,7 @@ var require_range = __commonJS({
1805
1191
  }
1806
1192
  if (version.prerelease.length && !options.includePrerelease) {
1807
1193
  for (let i = 0; i < set.length; i++) {
1808
- debug2(set[i].semver);
1194
+ debug4(set[i].semver);
1809
1195
  if (set[i].semver === Comparator.ANY) {
1810
1196
  continue;
1811
1197
  }
@@ -1823,9 +1209,9 @@ var require_range = __commonJS({
1823
1209
  }
1824
1210
  });
1825
1211
 
1826
- // node_modules/semver/classes/comparator.js
1212
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/classes/comparator.js
1827
1213
  var require_comparator = __commonJS({
1828
- "node_modules/semver/classes/comparator.js"(exports, module) {
1214
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/classes/comparator.js"(exports, module) {
1829
1215
  init_cjs_shims();
1830
1216
  var ANY = Symbol("SemVer ANY");
1831
1217
  var Comparator = class _Comparator {
@@ -1842,7 +1228,7 @@ var require_comparator = __commonJS({
1842
1228
  }
1843
1229
  }
1844
1230
  comp = comp.trim().split(/\s+/).join(" ");
1845
- debug2("comparator", comp, options);
1231
+ debug4("comparator", comp, options);
1846
1232
  this.options = options;
1847
1233
  this.loose = !!options.loose;
1848
1234
  this.parse(comp);
@@ -1851,7 +1237,7 @@ var require_comparator = __commonJS({
1851
1237
  } else {
1852
1238
  this.value = this.operator + this.semver.version;
1853
1239
  }
1854
- debug2("comp", this);
1240
+ debug4("comp", this);
1855
1241
  }
1856
1242
  parse(comp) {
1857
1243
  const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
@@ -1873,7 +1259,7 @@ var require_comparator = __commonJS({
1873
1259
  return this.value;
1874
1260
  }
1875
1261
  test(version) {
1876
- debug2("Comparator.test", version, this.options.loose);
1262
+ debug4("Comparator.test", version, this.options.loose);
1877
1263
  if (this.semver === ANY || version === ANY) {
1878
1264
  return true;
1879
1265
  }
@@ -1930,15 +1316,15 @@ var require_comparator = __commonJS({
1930
1316
  var parseOptions = require_parse_options();
1931
1317
  var { safeRe: re, t } = require_re();
1932
1318
  var cmp = require_cmp();
1933
- var debug2 = require_debug();
1319
+ var debug4 = require_debug();
1934
1320
  var SemVer = require_semver();
1935
1321
  var Range = require_range();
1936
1322
  }
1937
1323
  });
1938
1324
 
1939
- // node_modules/semver/functions/satisfies.js
1325
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/functions/satisfies.js
1940
1326
  var require_satisfies = __commonJS({
1941
- "node_modules/semver/functions/satisfies.js"(exports, module) {
1327
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/functions/satisfies.js"(exports, module) {
1942
1328
  init_cjs_shims();
1943
1329
  var Range = require_range();
1944
1330
  var satisfies = (version, range, options) => {
@@ -1953,9 +1339,9 @@ var require_satisfies = __commonJS({
1953
1339
  }
1954
1340
  });
1955
1341
 
1956
- // node_modules/semver/ranges/to-comparators.js
1342
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/to-comparators.js
1957
1343
  var require_to_comparators = __commonJS({
1958
- "node_modules/semver/ranges/to-comparators.js"(exports, module) {
1344
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/to-comparators.js"(exports, module) {
1959
1345
  init_cjs_shims();
1960
1346
  var Range = require_range();
1961
1347
  var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
@@ -1963,9 +1349,9 @@ var require_to_comparators = __commonJS({
1963
1349
  }
1964
1350
  });
1965
1351
 
1966
- // node_modules/semver/ranges/max-satisfying.js
1352
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/max-satisfying.js
1967
1353
  var require_max_satisfying = __commonJS({
1968
- "node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1354
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1969
1355
  init_cjs_shims();
1970
1356
  var SemVer = require_semver();
1971
1357
  var Range = require_range();
@@ -1992,9 +1378,9 @@ var require_max_satisfying = __commonJS({
1992
1378
  }
1993
1379
  });
1994
1380
 
1995
- // node_modules/semver/ranges/min-satisfying.js
1381
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/min-satisfying.js
1996
1382
  var require_min_satisfying = __commonJS({
1997
- "node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1383
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1998
1384
  init_cjs_shims();
1999
1385
  var SemVer = require_semver();
2000
1386
  var Range = require_range();
@@ -2021,9 +1407,9 @@ var require_min_satisfying = __commonJS({
2021
1407
  }
2022
1408
  });
2023
1409
 
2024
- // node_modules/semver/ranges/min-version.js
1410
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/min-version.js
2025
1411
  var require_min_version = __commonJS({
2026
- "node_modules/semver/ranges/min-version.js"(exports, module) {
1412
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/min-version.js"(exports, module) {
2027
1413
  init_cjs_shims();
2028
1414
  var SemVer = require_semver();
2029
1415
  var Range = require_range();
@@ -2078,9 +1464,9 @@ var require_min_version = __commonJS({
2078
1464
  }
2079
1465
  });
2080
1466
 
2081
- // node_modules/semver/ranges/valid.js
1467
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/valid.js
2082
1468
  var require_valid2 = __commonJS({
2083
- "node_modules/semver/ranges/valid.js"(exports, module) {
1469
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/valid.js"(exports, module) {
2084
1470
  init_cjs_shims();
2085
1471
  var Range = require_range();
2086
1472
  var validRange2 = (range, options) => {
@@ -2094,9 +1480,9 @@ var require_valid2 = __commonJS({
2094
1480
  }
2095
1481
  });
2096
1482
 
2097
- // node_modules/semver/ranges/outside.js
1483
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/outside.js
2098
1484
  var require_outside = __commonJS({
2099
- "node_modules/semver/ranges/outside.js"(exports, module) {
1485
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/outside.js"(exports, module) {
2100
1486
  init_cjs_shims();
2101
1487
  var SemVer = require_semver();
2102
1488
  var Comparator = require_comparator();
@@ -2163,9 +1549,9 @@ var require_outside = __commonJS({
2163
1549
  }
2164
1550
  });
2165
1551
 
2166
- // node_modules/semver/ranges/gtr.js
1552
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/gtr.js
2167
1553
  var require_gtr = __commonJS({
2168
- "node_modules/semver/ranges/gtr.js"(exports, module) {
1554
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/gtr.js"(exports, module) {
2169
1555
  init_cjs_shims();
2170
1556
  var outside = require_outside();
2171
1557
  var gtr = (version, range, options) => outside(version, range, ">", options);
@@ -2173,9 +1559,9 @@ var require_gtr = __commonJS({
2173
1559
  }
2174
1560
  });
2175
1561
 
2176
- // node_modules/semver/ranges/ltr.js
1562
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/ltr.js
2177
1563
  var require_ltr = __commonJS({
2178
- "node_modules/semver/ranges/ltr.js"(exports, module) {
1564
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/ltr.js"(exports, module) {
2179
1565
  init_cjs_shims();
2180
1566
  var outside = require_outside();
2181
1567
  var ltr = (version, range, options) => outside(version, range, "<", options);
@@ -2183,9 +1569,9 @@ var require_ltr = __commonJS({
2183
1569
  }
2184
1570
  });
2185
1571
 
2186
- // node_modules/semver/ranges/intersects.js
1572
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/intersects.js
2187
1573
  var require_intersects = __commonJS({
2188
- "node_modules/semver/ranges/intersects.js"(exports, module) {
1574
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/intersects.js"(exports, module) {
2189
1575
  init_cjs_shims();
2190
1576
  var Range = require_range();
2191
1577
  var intersects = (r1, r2, options) => {
@@ -2197,9 +1583,9 @@ var require_intersects = __commonJS({
2197
1583
  }
2198
1584
  });
2199
1585
 
2200
- // node_modules/semver/ranges/simplify.js
1586
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/simplify.js
2201
1587
  var require_simplify = __commonJS({
2202
- "node_modules/semver/ranges/simplify.js"(exports, module) {
1588
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/simplify.js"(exports, module) {
2203
1589
  init_cjs_shims();
2204
1590
  var satisfies = require_satisfies();
2205
1591
  var compare2 = require_compare();
@@ -2247,9 +1633,9 @@ var require_simplify = __commonJS({
2247
1633
  }
2248
1634
  });
2249
1635
 
2250
- // node_modules/semver/ranges/subset.js
1636
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/subset.js
2251
1637
  var require_subset = __commonJS({
2252
- "node_modules/semver/ranges/subset.js"(exports, module) {
1638
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/ranges/subset.js"(exports, module) {
2253
1639
  init_cjs_shims();
2254
1640
  var Range = require_range();
2255
1641
  var Comparator = require_comparator();
@@ -2409,12 +1795,12 @@ var require_subset = __commonJS({
2409
1795
  }
2410
1796
  });
2411
1797
 
2412
- // node_modules/semver/index.js
1798
+ // node_modules/@oclif/plugin-plugins/node_modules/semver/index.js
2413
1799
  var require_semver2 = __commonJS({
2414
- "node_modules/semver/index.js"(exports, module) {
1800
+ "node_modules/@oclif/plugin-plugins/node_modules/semver/index.js"(exports, module) {
2415
1801
  init_cjs_shims();
2416
1802
  var internalRe = require_re();
2417
- var constants2 = require_constants();
1803
+ var constants = require_constants();
2418
1804
  var SemVer = require_semver();
2419
1805
  var identifiers = require_identifiers();
2420
1806
  var parse = require_parse();
@@ -2496,97 +1882,21 @@ var require_semver2 = __commonJS({
2496
1882
  re: internalRe.re,
2497
1883
  src: internalRe.src,
2498
1884
  tokens: internalRe.t,
2499
- SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION,
2500
- RELEASE_TYPES: constants2.RELEASE_TYPES,
1885
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
1886
+ RELEASE_TYPES: constants.RELEASE_TYPES,
2501
1887
  compareIdentifiers: identifiers.compareIdentifiers,
2502
1888
  rcompareIdentifiers: identifiers.rcompareIdentifiers
2503
1889
  };
2504
1890
  }
2505
1891
  });
2506
1892
 
2507
- // node_modules/builtins/index.js
2508
- var require_builtins = __commonJS({
2509
- "node_modules/builtins/index.js"(exports, module) {
2510
- "use strict";
2511
- init_cjs_shims();
2512
- var semver = require_semver2();
2513
- var permanentModules = [
2514
- "assert",
2515
- "buffer",
2516
- "child_process",
2517
- "cluster",
2518
- "console",
2519
- "constants",
2520
- "crypto",
2521
- "dgram",
2522
- "dns",
2523
- "domain",
2524
- "events",
2525
- "fs",
2526
- "http",
2527
- "https",
2528
- "module",
2529
- "net",
2530
- "os",
2531
- "path",
2532
- "punycode",
2533
- "querystring",
2534
- "readline",
2535
- "repl",
2536
- "stream",
2537
- "string_decoder",
2538
- "sys",
2539
- "timers",
2540
- "tls",
2541
- "tty",
2542
- "url",
2543
- "util",
2544
- "vm",
2545
- "zlib"
2546
- ];
2547
- var versionLockedModules = {
2548
- freelist: "<6.0.0",
2549
- v8: ">=1.0.0",
2550
- process: ">=1.1.0",
2551
- inspector: ">=8.0.0",
2552
- async_hooks: ">=8.1.0",
2553
- http2: ">=8.4.0",
2554
- perf_hooks: ">=8.5.0",
2555
- trace_events: ">=10.0.0",
2556
- worker_threads: ">=12.0.0",
2557
- "node:test": ">=18.0.0"
2558
- };
2559
- var experimentalModules = {
2560
- worker_threads: ">=10.5.0",
2561
- wasi: ">=12.16.0",
2562
- diagnostics_channel: "^14.17.0 || >=15.1.0"
2563
- };
2564
- module.exports = ({ version = process.version, experimental = false } = {}) => {
2565
- const builtins = [...permanentModules];
2566
- for (const [name, semverRange] of Object.entries(versionLockedModules)) {
2567
- if (version === "*" || semver.satisfies(version, semverRange)) {
2568
- builtins.push(name);
2569
- }
2570
- }
2571
- if (experimental) {
2572
- for (const [name, semverRange] of Object.entries(experimentalModules)) {
2573
- if (!builtins.includes(name) && (version === "*" || semver.satisfies(version, semverRange))) {
2574
- builtins.push(name);
2575
- }
2576
- }
2577
- }
2578
- return builtins;
2579
- };
2580
- }
2581
- });
2582
-
2583
- // node_modules/validate-npm-package-name/lib/index.js
1893
+ // node_modules/@oclif/plugin-plugins/node_modules/validate-npm-package-name/lib/index.js
2584
1894
  var require_lib2 = __commonJS({
2585
- "node_modules/validate-npm-package-name/lib/index.js"(exports, module) {
1895
+ "node_modules/@oclif/plugin-plugins/node_modules/validate-npm-package-name/lib/index.js"(exports, module) {
2586
1896
  "use strict";
2587
1897
  init_cjs_shims();
1898
+ var { builtinModules: builtins } = __require("module");
2588
1899
  var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
2589
- var builtins = require_builtins();
2590
1900
  var blacklist = [
2591
1901
  "node_modules",
2592
1902
  "favicon.ico"
@@ -2623,11 +1933,9 @@ var require_lib2 = __commonJS({
2623
1933
  errors.push(blacklistedName + " is a blacklisted name");
2624
1934
  }
2625
1935
  });
2626
- builtins({ version: "*" }).forEach(function(builtin) {
2627
- if (name.toLowerCase() === builtin) {
2628
- warnings.push(builtin + " is a core module name");
2629
- }
2630
- });
1936
+ if (builtins.includes(name.toLowerCase())) {
1937
+ warnings.push(name + " is a core module name");
1938
+ }
2631
1939
  if (name.length > 214) {
2632
1940
  warnings.push("name can no longer contain more than 214 characters");
2633
1941
  }
@@ -2671,613 +1979,16 @@ var require_lib2 = __commonJS({
2671
1979
 
2672
1980
  // src/index.ts
2673
1981
  init_cjs_shims();
2674
- var import_core12 = __toESM(require_lib(), 1);
1982
+ var import_core13 = __toESM(require_lib(), 1);
2675
1983
 
2676
1984
  // node_modules/@oclif/plugin-plugins/lib/index.js
2677
1985
  init_cjs_shims();
2678
1986
 
2679
- // node_modules/@oclif/plugin-plugins/lib/plugins.js
1987
+ // node_modules/@oclif/plugin-plugins/lib/commands/plugins/index.js
2680
1988
  init_cjs_shims();
2681
- var import_core3 = __toESM(require_lib(), 1);
2682
- var import_debug2 = __toESM(require_src(), 1);
2683
- var import_semver = __toESM(require_semver2(), 1);
2684
- import { access, mkdir, readFile as readFile2, rename, writeFile } from "node:fs/promises";
2685
- import { dirname, join as join3, resolve } from "node:path";
1989
+ var import_core5 = __toESM(require_lib(), 1);
2686
1990
 
2687
- // node_modules/@oclif/plugin-plugins/lib/util.js
2688
- init_cjs_shims();
2689
- var import_core = __toESM(require_lib(), 1);
2690
- import * as fs from "node:fs";
2691
- import * as fsPromises from "node:fs/promises";
2692
- import { createRequire } from "node:module";
2693
- import { type } from "node:os";
2694
- import * as path from "node:path";
2695
- function compare(a, b) {
2696
- const itemA = a === void 0 ? 0 : a;
2697
- const itemB = b === void 0 ? 0 : b;
2698
- if (Array.isArray(itemA) && Array.isArray(itemB)) {
2699
- if (itemA.length === 0 && itemB.length === 0)
2700
- return 0;
2701
- const diff = compare(itemA[0], itemB[0]);
2702
- if (diff !== 0)
2703
- return diff;
2704
- return compare(itemA.slice(1), itemB.slice(1));
2705
- }
2706
- if (itemA < itemB)
2707
- return -1;
2708
- if (itemA > itemB)
2709
- return 1;
2710
- return 0;
2711
- }
2712
- function sortBy(arr, fn) {
2713
- return arr.sort((a, b) => compare(fn(a), fn(b)));
2714
- }
2715
- function uniq(arr) {
2716
- return arr.filter((a, i) => arr.indexOf(a) === i);
2717
- }
2718
- function uniqWith(arr, fn) {
2719
- return arr.filter((a, i) => !arr.some((b, j) => j > i && fn(a, b)));
2720
- }
2721
- var isExecutable = (filepath) => {
2722
- if (type() === "Windows_NT")
2723
- return filepath.endsWith("node.exe");
2724
- try {
2725
- if (filepath.endsWith("node")) {
2726
- fs.accessSync(filepath, fs.constants.X_OK);
2727
- return true;
2728
- }
2729
- } catch {
2730
- return false;
2731
- }
2732
- return false;
2733
- };
2734
- async function findNode(root) {
2735
- const cliBinDirs = [path.join(root, "bin"), path.join(root, "client", "bin")].filter((p) => fs.existsSync(p));
2736
- const { default: shelljs } = await import("shelljs");
2737
- if (cliBinDirs.length > 0) {
2738
- const node = shelljs.find(cliBinDirs).find((file) => isExecutable(file));
2739
- if (node) {
2740
- return fs.realpathSync(node);
2741
- }
2742
- }
2743
- const nodeShellString = shelljs.which("node");
2744
- if (nodeShellString?.code === 0 && nodeShellString?.stdout) {
2745
- return `${nodeShellString.stdout}`;
2746
- }
2747
- const err = new Error("Cannot locate node executable.");
2748
- err.name = "CannotFindNodeExecutable";
2749
- throw err;
2750
- }
2751
- async function findNpm() {
2752
- const require3 = createRequire(import.meta.url);
2753
- const npmPjsonPath = require3.resolve("npm/package.json");
2754
- const npmPjson = JSON.parse(await fsPromises.readFile(npmPjsonPath, { encoding: "utf8" }));
2755
- const npmPath = npmPjsonPath.slice(0, Math.max(0, npmPjsonPath.lastIndexOf(path.sep)));
2756
- return path.join(npmPath, npmPjson.bin.npm);
2757
- }
2758
- var YarnMessagesCache = class _YarnMessagesCache {
2759
- static errors = /* @__PURE__ */ new Set();
2760
- static instance;
2761
- static warnings = /* @__PURE__ */ new Set();
2762
- static getInstance() {
2763
- if (!_YarnMessagesCache.instance) {
2764
- _YarnMessagesCache.instance = new _YarnMessagesCache();
2765
- }
2766
- return _YarnMessagesCache.instance;
2767
- }
2768
- addErrors(...errors) {
2769
- for (const err of errors) {
2770
- _YarnMessagesCache.errors.add(err);
2771
- }
2772
- }
2773
- addWarnings(...warnings) {
2774
- for (const warning of warnings) {
2775
- if (warning.includes("Workspaces can only be enabled in private projects."))
2776
- continue;
2777
- _YarnMessagesCache.warnings.add(warning);
2778
- }
2779
- }
2780
- flush(plugin) {
2781
- if (_YarnMessagesCache.warnings.size === 0)
2782
- return;
2783
- let count = 0;
2784
- for (const warning of _YarnMessagesCache.warnings) {
2785
- if (!plugin) {
2786
- import_core.ux.warn(warning);
2787
- count += 1;
2788
- return;
2789
- }
2790
- if (warning.startsWith(plugin.name) || warning.startsWith(`"${plugin.name}`)) {
2791
- count += 1;
2792
- import_core.ux.warn(warning);
2793
- }
2794
- }
2795
- if (plugin && count > 0) {
2796
- import_core.ux.logToStderr(`
2797
- These warnings can only be addressed by the owner(s) of ${plugin.name}.`);
2798
- if (plugin.pjson.bugs || plugin.pjson.repository) {
2799
- import_core.ux.logToStderr(`We suggest that you create an issue at ${extractIssuesLocation(plugin.pjson.bugs, plugin.pjson.repository)} and ask the plugin owners to address them.
2800
- `);
2801
- }
2802
- }
2803
- if (_YarnMessagesCache.errors.size === 0)
2804
- return;
2805
- import_core.ux.logToStderr("\nThe following errors occurred:");
2806
- for (const err of _YarnMessagesCache.errors) {
2807
- import_core.ux.error(err, { exit: false });
2808
- }
2809
- }
2810
- };
2811
- function extractIssuesLocation(bugs, repository) {
2812
- if (bugs) {
2813
- return typeof bugs === "string" ? bugs : bugs.url;
2814
- }
2815
- if (repository) {
2816
- return typeof repository === "string" ? repository : repository.url.replace("git+", "").replace(".git", "");
2817
- }
2818
- }
2819
-
2820
- // node_modules/@oclif/plugin-plugins/lib/yarn.js
2821
- init_cjs_shims();
2822
- var import_core2 = __toESM(require_lib(), 1);
2823
- var import_debug = __toESM(require_src(), 1);
2824
- import { fork } from "node:child_process";
2825
- import { createRequire as createRequire2 } from "node:module";
2826
- import { join as join2 } from "node:path";
2827
- import { fileURLToPath } from "node:url";
2828
- var debug = (0, import_debug.default)("cli:yarn");
2829
- var require2 = createRequire2(import.meta.url);
2830
- var Yarn = class {
2831
- config;
2832
- constructor({ config }) {
2833
- this.config = config;
2834
- }
2835
- async exec(args = [], opts) {
2836
- const bin = require2.resolve("yarn/bin/yarn.js", { paths: [this.config.root, fileURLToPath(import.meta.url)] });
2837
- debug("yarn binary path", bin);
2838
- const { cwd, silent, verbose } = opts;
2839
- if (args[0] !== "run") {
2840
- const port = this.config.scopedEnvVar("NETWORK_MUTEX_PORT");
2841
- const optionalPort = port ? `:${port}` : "";
2842
- const mutex = this.config.scopedEnvVar("USE_NETWORK_MUTEX") ? `network${optionalPort}` : `file:${join2(cwd, "yarn.lock")}`;
2843
- const cacheDir = join2(this.config.cacheDir, "yarn");
2844
- args = [...args, "--non-interactive", `--mutex=${mutex}`, `--preferred-cache-folder=${cacheDir}`, "--check-files"];
2845
- const networkTimeout = this.config.scopedEnvVar("NETWORK_TIMEOUT");
2846
- if (networkTimeout)
2847
- args.push(`--network-timeout=${networkTimeout}`);
2848
- if (verbose && !silent)
2849
- args.push("--verbose");
2850
- if (silent && !verbose)
2851
- args.push("--silent");
2852
- if (this.config.npmRegistry)
2853
- args.push(`--registry=${this.config.npmRegistry}`);
2854
- }
2855
- const npmRunPath = require2("npm-run-path");
2856
- const options = {
2857
- ...opts,
2858
- cwd,
2859
- env: npmRunPath.env({ cwd, env: process.env }),
2860
- // The ts-node/esm loader isn't need to execute yarn commands anyways.
2861
- execArgv: process.execArgv.join(" ").replace("--loader ts-node/esm", "").replace("--loader=ts-node/esm", "").split(" ").filter(Boolean),
2862
- stdio: [0, null, null, "ipc"]
2863
- };
2864
- if (verbose) {
2865
- process.stderr.write(`${cwd}: ${bin} ${args.join(" ")}`);
2866
- }
2867
- debug(`${cwd}: ${bin} ${args.join(" ")}`);
2868
- try {
2869
- await this.fork(bin, args, options);
2870
- debug("yarn done");
2871
- } catch (error) {
2872
- const { message } = error;
2873
- debug("yarn error", error);
2874
- const networkConcurrency = "--network-concurrency=1";
2875
- if (message.includes("EAI_AGAIN") && !args.includes(networkConcurrency)) {
2876
- debug("EAI_AGAIN");
2877
- return this.exec([...args, networkConcurrency], opts);
2878
- }
2879
- throw error;
2880
- }
2881
- }
2882
- fork(modulePath, args = [], options) {
2883
- const cache = YarnMessagesCache.getInstance();
2884
- return new Promise((resolve2, reject) => {
2885
- const forked = fork(modulePath, args, {
2886
- ...options,
2887
- env: {
2888
- ...process.env,
2889
- // Disable husky hooks because a plugin might be trying to install them, which will
2890
- // break the install since the install location isn't a .git directory.
2891
- HUSKY: "0",
2892
- // YARN_IGNORE_PATH=1 prevents yarn from resolving to the globally configured yarn binary.
2893
- // In other words, it ensures that it resolves to the yarn binary that is available in the node_modules directory.
2894
- YARN_IGNORE_PATH: "1"
2895
- }
2896
- });
2897
- forked.stderr?.on("data", (d) => {
2898
- if (!options.silent) {
2899
- const str = d.toString();
2900
- if (str.startsWith("error"))
2901
- cache.addErrors(str);
2902
- else
2903
- cache.addWarnings(...str.split("\n").map((i) => i.trim().replace(/^warning/, "").trim()).filter(Boolean));
2904
- }
2905
- });
2906
- forked.stdout?.setEncoding("utf8");
2907
- forked.stdout?.on("data", (d) => {
2908
- if (options.verbose)
2909
- process.stdout.write(d);
2910
- else if (!options.noSpinner)
2911
- import_core2.ux.action.status = d.replace(/\n$/, "").split("\n").pop();
2912
- });
2913
- forked.on("error", reject);
2914
- forked.on("exit", (code) => {
2915
- if (code === 0) {
2916
- resolve2();
2917
- } else {
2918
- reject(new Error(`${modulePath} ${args.join(" ")} exited with code ${code}`));
2919
- }
2920
- });
2921
- });
2922
- }
2923
- };
2924
-
2925
- // node_modules/@oclif/plugin-plugins/lib/plugins.js
2926
- var initPJSON = {
2927
- dependencies: {},
2928
- oclif: { plugins: [], schema: 1 },
2929
- private: true
2930
- };
2931
- async function fileExists(filePath) {
2932
- try {
2933
- await access(filePath);
2934
- return true;
2935
- } catch {
2936
- return false;
2937
- }
2938
- }
2939
- var Plugins = class {
2940
- config;
2941
- silent = false;
2942
- verbose = false;
2943
- yarn;
2944
- debug;
2945
- constructor(config) {
2946
- this.config = config;
2947
- this.yarn = new Yarn({ config });
2948
- this.debug = (0, import_debug2.default)("@oclif/plugins");
2949
- }
2950
- async add(...plugins) {
2951
- const pjson = await this.pjson();
2952
- await this.savePJSON({
2953
- ...pjson,
2954
- oclif: {
2955
- ...pjson.oclif,
2956
- plugins: uniq([...pjson.oclif.plugins || [], ...plugins])
2957
- }
2958
- });
2959
- }
2960
- friendlyName(name) {
2961
- const { pluginPrefix, scope } = this.config.pjson.oclif;
2962
- if (!scope)
2963
- return name;
2964
- const match = name.match(`@${scope}/${pluginPrefix ?? "plugin"}-(.+)`);
2965
- return match?.[1] ?? name;
2966
- }
2967
- async hasPlugin(name) {
2968
- const list = await this.list();
2969
- return list.find((p) => this.friendlyName(p.name) === this.friendlyName(name)) ?? // friendly
2970
- list.find((p) => this.unfriendlyName(p.name) === this.unfriendlyName(name)) ?? // unfriendly
2971
- list.find((p) => p.type === "link" && resolve(p.root) === resolve(name)) ?? // link
2972
- false;
2973
- }
2974
- async install(name, { force = false, tag = "latest" } = {}) {
2975
- try {
2976
- this.debug(`installing plugin ${name}`);
2977
- const yarnOpts = { cwd: this.config.dataDir, silent: this.silent, verbose: this.verbose };
2978
- await this.createPJSON();
2979
- let plugin;
2980
- const add = force ? ["add", "--force"] : ["add"];
2981
- if (name.includes(":")) {
2982
- const url = name;
2983
- await this.yarn.exec([...add, url], yarnOpts);
2984
- const { dependencies } = await this.pjson();
2985
- name = Object.entries(dependencies ?? {}).find(([, u]) => u === url)[0];
2986
- const root = join3(this.config.dataDir, "node_modules", name);
2987
- plugin = await import_core3.Config.load({
2988
- devPlugins: false,
2989
- name,
2990
- root,
2991
- userPlugins: false
2992
- });
2993
- this.isValidPlugin(plugin);
2994
- await this.add({ name, type: "user", url });
2995
- if (plugin.getPluginsList().find((p) => p.root === root)?.moduleType === "module" && await fileExists(join3(plugin.root, "tsconfig.json"))) {
2996
- try {
2997
- await this.yarn.exec(["install"], { ...yarnOpts, cwd: plugin.root });
2998
- await this.yarn.exec(["run", "tsc"], { ...yarnOpts, cwd: plugin.root });
2999
- } catch (error) {
3000
- this.debug(error);
3001
- }
3002
- }
3003
- await this.refresh({ all: true, prod: true }, plugin.root);
3004
- } else {
3005
- const range = (0, import_semver.validRange)(tag);
3006
- const unfriendly = this.unfriendlyName(name);
3007
- if (unfriendly && await this.npmHasPackage(unfriendly)) {
3008
- name = unfriendly;
3009
- }
3010
- await this.npmHasPackage(name, true);
3011
- await this.yarn.exec([...add, `${name}@${tag}`], yarnOpts);
3012
- this.debug(`loading plugin ${name}...`);
3013
- plugin = await import_core3.Config.load({
3014
- devPlugins: false,
3015
- name,
3016
- root: join3(this.config.dataDir, "node_modules", name),
3017
- userPlugins: false
3018
- });
3019
- this.debug(`finished loading plugin ${name} at root ${plugin.root}`);
3020
- this.isValidPlugin(plugin);
3021
- await this.refresh({ all: true, prod: true }, plugin.root);
3022
- await this.add({ name, tag: range || tag, type: "user" });
3023
- }
3024
- return plugin;
3025
- } catch (error) {
3026
- this.debug("error installing plugin:", error);
3027
- await this.uninstall(name).catch((error2) => this.debug(error2));
3028
- if (String(error).includes("EACCES")) {
3029
- throw new import_core3.Errors.CLIError(error, {
3030
- suggestions: [
3031
- `Plugin failed to install because of a permissions error.
3032
- Does your current user own the directory ${this.config.dataDir}?`
3033
- ]
3034
- });
3035
- }
3036
- throw error;
3037
- }
3038
- }
3039
- async link(p, { install }) {
3040
- const c = await import_core3.Config.load(resolve(p));
3041
- this.isValidPlugin(c);
3042
- if (install)
3043
- await this.refresh({ all: false, prod: false }, c.root);
3044
- await this.add({ name: c.name, root: c.root, type: "link" });
3045
- return c;
3046
- }
3047
- async list() {
3048
- const pjson = await this.pjson();
3049
- return pjson.oclif.plugins;
3050
- }
3051
- async maybeUnfriendlyName(name) {
3052
- const unfriendly = this.unfriendlyName(name);
3053
- this.debug(`checking registry for expanded package name ${unfriendly}`);
3054
- if (unfriendly && await this.npmHasPackage(unfriendly)) {
3055
- return unfriendly;
3056
- }
3057
- this.debug(`expanded package name ${unfriendly} not found, using given package name ${name}`);
3058
- return name;
3059
- }
3060
- async pjson() {
3061
- const pjson = await this.readPJSON();
3062
- const plugins = pjson ? this.normalizePlugins(pjson.oclif.plugins) : [];
3063
- return {
3064
- ...initPJSON,
3065
- ...pjson,
3066
- oclif: {
3067
- ...initPJSON.oclif,
3068
- ...pjson?.oclif,
3069
- plugins
3070
- }
3071
- };
3072
- }
3073
- /**
3074
- * If a yarn.lock or oclif.lock exists at the root, refresh dependencies by
3075
- * rerunning yarn. If options.prod is true, only install production dependencies.
3076
- *
3077
- * As of v9 npm will always ignore the yarn.lock during `npm pack`]
3078
- * (see https://github.com/npm/cli/issues/6738). To get around this plugins can
3079
- * rename yarn.lock to oclif.lock before running `npm pack` using `oclif lock`.
3080
- *
3081
- * We still check for the existence of yarn.lock since it could be included if a plugin was
3082
- * packed using yarn or v8 of npm. Plugins installed directly from a git url will also
3083
- * have a yarn.lock.
3084
- *
3085
- * @param options {prod: boolean, all: boolean}
3086
- * @param roots string[]
3087
- * @returns Promise<void>
3088
- */
3089
- async refresh(options, ...roots) {
3090
- import_core3.ux.action.status = "Refreshing user plugins...";
3091
- const doRefresh = async (root) => {
3092
- await this.yarn.exec(options.prod ? ["--prod"] : [], {
3093
- cwd: root,
3094
- noSpinner: true,
3095
- silent: true,
3096
- verbose: false
3097
- });
3098
- };
3099
- const pluginRoots = [...roots];
3100
- if (options.all) {
3101
- const userPluginsRoots = this.config.getPluginsList().filter((p) => p.type === "user").map((p) => p.root);
3102
- pluginRoots.push(...userPluginsRoots);
3103
- }
3104
- const deduped = [...new Set(pluginRoots)];
3105
- await Promise.all(deduped.map(async (r) => {
3106
- if (await fileExists(join3(r, "yarn.lock"))) {
3107
- this.debug(`yarn.lock exists at ${r}. Installing prod dependencies`);
3108
- await doRefresh(r);
3109
- } else if (await fileExists(join3(r, "oclif.lock"))) {
3110
- this.debug(`oclif.lock exists at ${r}. Installing prod dependencies`);
3111
- await rename(join3(r, "oclif.lock"), join3(r, "yarn.lock"));
3112
- await doRefresh(r);
3113
- } else {
3114
- this.debug(`no yarn.lock or oclif.lock exists at ${r}. Skipping dependency refresh`);
3115
- }
3116
- }));
3117
- }
3118
- async remove(name) {
3119
- const pjson = await this.pjson();
3120
- if (pjson.dependencies)
3121
- delete pjson.dependencies[name];
3122
- await this.savePJSON({
3123
- ...pjson,
3124
- oclif: {
3125
- ...pjson.oclif,
3126
- plugins: pjson.oclif.plugins.filter((p) => p.name !== name)
3127
- }
3128
- });
3129
- }
3130
- unfriendlyName(name) {
3131
- if (name.includes("@"))
3132
- return;
3133
- const { pluginPrefix, scope } = this.config.pjson.oclif;
3134
- if (!scope)
3135
- return;
3136
- return `@${scope}/${pluginPrefix ?? "plugin"}-${name}`;
3137
- }
3138
- async uninstall(name) {
3139
- try {
3140
- const pjson = await this.pjson();
3141
- if ((pjson.oclif.plugins ?? []).some((p) => typeof p === "object" && p.type === "user" && p.name === name)) {
3142
- await this.yarn.exec(["remove", name], {
3143
- cwd: this.config.dataDir,
3144
- silent: this.silent,
3145
- verbose: this.verbose
3146
- });
3147
- }
3148
- } catch (error) {
3149
- import_core3.ux.warn(error);
3150
- } finally {
3151
- await this.remove(name);
3152
- }
3153
- }
3154
- async update() {
3155
- let plugins = (await this.list()).filter((p) => p.type === "user");
3156
- if (plugins.length === 0)
3157
- return;
3158
- const aliases = this.config.pjson.oclif.aliases || {};
3159
- for (const [name, to] of Object.entries(aliases)) {
3160
- const plugin = plugins.find((p) => p.name === name);
3161
- if (!plugin)
3162
- continue;
3163
- if (to)
3164
- await this.install(to);
3165
- await this.uninstall(name);
3166
- plugins = plugins.filter((p) => p.name !== name);
3167
- }
3168
- if (plugins.some((p) => Boolean(p.url))) {
3169
- await this.yarn.exec(["upgrade"], {
3170
- cwd: this.config.dataDir,
3171
- silent: this.silent,
3172
- verbose: this.verbose
3173
- });
3174
- }
3175
- const npmPlugins = plugins.filter((p) => !p.url);
3176
- const jitPlugins = this.config.pjson.oclif.jitPlugins ?? {};
3177
- const modifiedPlugins = [];
3178
- if (npmPlugins.length > 0) {
3179
- await this.yarn.exec([
3180
- "add",
3181
- ...npmPlugins.map((p) => {
3182
- if (!(0, import_semver.valid)(p.tag))
3183
- return `${p.name}@${p.tag}`;
3184
- if (p.tag && (0, import_semver.valid)(p.tag) && jitPlugins[p.name] && (0, import_semver.gt)(p.tag, jitPlugins[p.name])) {
3185
- return `${p.name}@${p.tag}`;
3186
- }
3187
- const tag = jitPlugins[p.name] ?? p.tag;
3188
- modifiedPlugins.push({ ...p, tag });
3189
- return `${p.name}@${tag}`;
3190
- })
3191
- ], { cwd: this.config.dataDir, silent: this.silent, verbose: this.verbose });
3192
- }
3193
- await this.refresh({ all: true, prod: true });
3194
- await this.add(...modifiedPlugins);
3195
- }
3196
- async createPJSON() {
3197
- if (!await fileExists(this.pjsonPath)) {
3198
- this.debug(`creating ${this.pjsonPath} with pjson: ${JSON.stringify(initPJSON, null, 2)}`);
3199
- await this.savePJSON(initPJSON);
3200
- }
3201
- }
3202
- isValidPlugin(p) {
3203
- if (p.valid)
3204
- return true;
3205
- if (this.config.plugins.get("@oclif/plugin-legacy") || // @ts-expect-error because _base is private
3206
- p._base.includes("@oclif/plugin-legacy")) {
3207
- return true;
3208
- }
3209
- throw new import_core3.Errors.CLIError("plugin is invalid", {
3210
- suggestions: [
3211
- "Plugin failed to install because it does not appear to be a valid CLI plugin.\nIf you are sure it is, contact the CLI developer noting this error."
3212
- ]
3213
- });
3214
- }
3215
- normalizePlugins(input) {
3216
- const plugins = (input ?? []).map((p) => {
3217
- if (typeof p === "string") {
3218
- return {
3219
- name: p,
3220
- tag: "latest",
3221
- type: "user"
3222
- };
3223
- }
3224
- return p;
3225
- });
3226
- return uniqWith(
3227
- plugins,
3228
- // @ts-expect-error because typescript doesn't think it's possible for a plugin to have the `link` type here
3229
- (a, b) => a.name === b.name || a.type === "link" && b.type === "link" && a.root === b.root
3230
- );
3231
- }
3232
- async npmHasPackage(name, throwOnNotFound = false) {
3233
- const nodeExecutable = await findNode(this.config.root);
3234
- const npmCli = await findNpm();
3235
- this.debug(`Using node executable located at: ${nodeExecutable}`);
3236
- this.debug(`Using npm executable located at: ${npmCli}`);
3237
- const registry = this.config.scopedEnvVar("NPM_REGISTRY");
3238
- const registryFlag = registry ? `--registry=${registry}` : "";
3239
- const command = `"${nodeExecutable}" "${npmCli}" show ${name} dist-tags ${registryFlag}`;
3240
- let npmShowResult;
3241
- try {
3242
- const { default: shelljs } = await import("shelljs");
3243
- npmShowResult = shelljs.exec(command, { silent: true });
3244
- } catch {
3245
- throw new import_core3.Errors.CLIError(`Could not run npm show for ${name}`);
3246
- }
3247
- if (npmShowResult?.code !== 0) {
3248
- this.debug(npmShowResult?.stderr);
3249
- if (throwOnNotFound)
3250
- throw new import_core3.Errors.CLIError(`${name} does not exist in the registry.`);
3251
- return false;
3252
- }
3253
- this.debug(`Found ${name} in the registry.`);
3254
- return true;
3255
- }
3256
- get pjsonPath() {
3257
- return join3(this.config.dataDir, "package.json");
3258
- }
3259
- async readPJSON() {
3260
- try {
3261
- return JSON.parse(await readFile2(this.pjsonPath, "utf8"));
3262
- } catch (error) {
3263
- this.debug(error);
3264
- const err = error;
3265
- if (err.code !== "ENOENT")
3266
- process.emitWarning(err);
3267
- }
3268
- }
3269
- async savePJSON(pjson) {
3270
- this.debug(`saving pjson at ${this.pjsonPath}`, JSON.stringify(pjson, null, 2));
3271
- await mkdir(dirname(this.pjsonPath), { recursive: true });
3272
- await writeFile(this.pjsonPath, JSON.stringify(pjson, null, 2));
3273
- }
3274
- };
3275
-
3276
- // node_modules/@oclif/plugin-plugins/lib/commands/plugins/index.js
3277
- init_cjs_shims();
3278
- var import_core4 = __toESM(require_lib(), 1);
3279
-
3280
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/index.js
1991
+ // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/index.js
3281
1992
  init_cjs_shims();
3282
1993
 
3283
1994
  // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/vendor/ansi-styles/index.js
@@ -3467,322 +2178,1059 @@ function assembleStyles() {
3467
2178
  var ansiStyles = assembleStyles();
3468
2179
  var ansi_styles_default = ansiStyles;
3469
2180
 
3470
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/vendor/supports-color/index.js
2181
+ // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/vendor/supports-color/index.js
2182
+ init_cjs_shims();
2183
+ import process2 from "node:process";
2184
+ import os from "node:os";
2185
+ import tty from "node:tty";
2186
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
2187
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
2188
+ const position = argv.indexOf(prefix + flag);
2189
+ const terminatorPosition = argv.indexOf("--");
2190
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
2191
+ }
2192
+ var { env } = process2;
2193
+ var flagForceColor;
2194
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
2195
+ flagForceColor = 0;
2196
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
2197
+ flagForceColor = 1;
2198
+ }
2199
+ function envForceColor() {
2200
+ if ("FORCE_COLOR" in env) {
2201
+ if (env.FORCE_COLOR === "true") {
2202
+ return 1;
2203
+ }
2204
+ if (env.FORCE_COLOR === "false") {
2205
+ return 0;
2206
+ }
2207
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
2208
+ }
2209
+ }
2210
+ function translateLevel(level) {
2211
+ if (level === 0) {
2212
+ return false;
2213
+ }
2214
+ return {
2215
+ level,
2216
+ hasBasic: true,
2217
+ has256: level >= 2,
2218
+ has16m: level >= 3
2219
+ };
2220
+ }
2221
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
2222
+ const noFlagForceColor = envForceColor();
2223
+ if (noFlagForceColor !== void 0) {
2224
+ flagForceColor = noFlagForceColor;
2225
+ }
2226
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
2227
+ if (forceColor === 0) {
2228
+ return 0;
2229
+ }
2230
+ if (sniffFlags) {
2231
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
2232
+ return 3;
2233
+ }
2234
+ if (hasFlag("color=256")) {
2235
+ return 2;
2236
+ }
2237
+ }
2238
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
2239
+ return 1;
2240
+ }
2241
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
2242
+ return 0;
2243
+ }
2244
+ const min = forceColor || 0;
2245
+ if (env.TERM === "dumb") {
2246
+ return min;
2247
+ }
2248
+ if (process2.platform === "win32") {
2249
+ const osRelease = os.release().split(".");
2250
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
2251
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
2252
+ }
2253
+ return 1;
2254
+ }
2255
+ if ("CI" in env) {
2256
+ if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
2257
+ return 3;
2258
+ }
2259
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
2260
+ return 1;
2261
+ }
2262
+ return min;
2263
+ }
2264
+ if ("TEAMCITY_VERSION" in env) {
2265
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
2266
+ }
2267
+ if (env.COLORTERM === "truecolor") {
2268
+ return 3;
2269
+ }
2270
+ if (env.TERM === "xterm-kitty") {
2271
+ return 3;
2272
+ }
2273
+ if ("TERM_PROGRAM" in env) {
2274
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
2275
+ switch (env.TERM_PROGRAM) {
2276
+ case "iTerm.app": {
2277
+ return version >= 3 ? 3 : 2;
2278
+ }
2279
+ case "Apple_Terminal": {
2280
+ return 2;
2281
+ }
2282
+ }
2283
+ }
2284
+ if (/-256(color)?$/i.test(env.TERM)) {
2285
+ return 2;
2286
+ }
2287
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
2288
+ return 1;
2289
+ }
2290
+ if ("COLORTERM" in env) {
2291
+ return 1;
2292
+ }
2293
+ return min;
2294
+ }
2295
+ function createSupportsColor(stream, options = {}) {
2296
+ const level = _supportsColor(stream, {
2297
+ streamIsTTY: stream && stream.isTTY,
2298
+ ...options
2299
+ });
2300
+ return translateLevel(level);
2301
+ }
2302
+ var supportsColor = {
2303
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
2304
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
2305
+ };
2306
+ var supports_color_default = supportsColor;
2307
+
2308
+ // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/utilities.js
3471
2309
  init_cjs_shims();
3472
- import process2 from "node:process";
3473
- import os from "node:os";
3474
- import tty from "node:tty";
3475
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
3476
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
3477
- const position = argv.indexOf(prefix + flag);
3478
- const terminatorPosition = argv.indexOf("--");
3479
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
2310
+ function stringReplaceAll(string, substring, replacer) {
2311
+ let index = string.indexOf(substring);
2312
+ if (index === -1) {
2313
+ return string;
2314
+ }
2315
+ const substringLength = substring.length;
2316
+ let endIndex = 0;
2317
+ let returnValue = "";
2318
+ do {
2319
+ returnValue += string.slice(endIndex, index) + substring + replacer;
2320
+ endIndex = index + substringLength;
2321
+ index = string.indexOf(substring, endIndex);
2322
+ } while (index !== -1);
2323
+ returnValue += string.slice(endIndex);
2324
+ return returnValue;
3480
2325
  }
3481
- var { env } = process2;
3482
- var flagForceColor;
3483
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
3484
- flagForceColor = 0;
3485
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
3486
- flagForceColor = 1;
2326
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
2327
+ let endIndex = 0;
2328
+ let returnValue = "";
2329
+ do {
2330
+ const gotCR = string[index - 1] === "\r";
2331
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
2332
+ endIndex = index + 1;
2333
+ index = string.indexOf("\n", endIndex);
2334
+ } while (index !== -1);
2335
+ returnValue += string.slice(endIndex);
2336
+ return returnValue;
3487
2337
  }
3488
- function envForceColor() {
3489
- if ("FORCE_COLOR" in env) {
3490
- if (env.FORCE_COLOR === "true") {
3491
- return 1;
2338
+
2339
+ // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/index.js
2340
+ var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
2341
+ var GENERATOR = Symbol("GENERATOR");
2342
+ var STYLER = Symbol("STYLER");
2343
+ var IS_EMPTY = Symbol("IS_EMPTY");
2344
+ var levelMapping = [
2345
+ "ansi",
2346
+ "ansi",
2347
+ "ansi256",
2348
+ "ansi16m"
2349
+ ];
2350
+ var styles2 = /* @__PURE__ */ Object.create(null);
2351
+ var applyOptions = (object, options = {}) => {
2352
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
2353
+ throw new Error("The `level` option should be an integer from 0 to 3");
2354
+ }
2355
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
2356
+ object.level = options.level === void 0 ? colorLevel : options.level;
2357
+ };
2358
+ var chalkFactory = (options) => {
2359
+ const chalk2 = (...strings) => strings.join(" ");
2360
+ applyOptions(chalk2, options);
2361
+ Object.setPrototypeOf(chalk2, createChalk.prototype);
2362
+ return chalk2;
2363
+ };
2364
+ function createChalk(options) {
2365
+ return chalkFactory(options);
2366
+ }
2367
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
2368
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
2369
+ styles2[styleName] = {
2370
+ get() {
2371
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
2372
+ Object.defineProperty(this, styleName, { value: builder });
2373
+ return builder;
3492
2374
  }
3493
- if (env.FORCE_COLOR === "false") {
3494
- return 0;
2375
+ };
2376
+ }
2377
+ styles2.visible = {
2378
+ get() {
2379
+ const builder = createBuilder(this, this[STYLER], true);
2380
+ Object.defineProperty(this, "visible", { value: builder });
2381
+ return builder;
2382
+ }
2383
+ };
2384
+ var getModelAnsi = (model, level, type, ...arguments_) => {
2385
+ if (model === "rgb") {
2386
+ if (level === "ansi16m") {
2387
+ return ansi_styles_default[type].ansi16m(...arguments_);
3495
2388
  }
3496
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
2389
+ if (level === "ansi256") {
2390
+ return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
2391
+ }
2392
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
2393
+ }
2394
+ if (model === "hex") {
2395
+ return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
3497
2396
  }
2397
+ return ansi_styles_default[type][model](...arguments_);
2398
+ };
2399
+ var usedModels = ["rgb", "hex", "ansi256"];
2400
+ for (const model of usedModels) {
2401
+ styles2[model] = {
2402
+ get() {
2403
+ const { level } = this;
2404
+ return function(...arguments_) {
2405
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
2406
+ return createBuilder(this, styler, this[IS_EMPTY]);
2407
+ };
2408
+ }
2409
+ };
2410
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
2411
+ styles2[bgModel] = {
2412
+ get() {
2413
+ const { level } = this;
2414
+ return function(...arguments_) {
2415
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
2416
+ return createBuilder(this, styler, this[IS_EMPTY]);
2417
+ };
2418
+ }
2419
+ };
3498
2420
  }
3499
- function translateLevel(level) {
3500
- if (level === 0) {
3501
- return false;
2421
+ var proto = Object.defineProperties(() => {
2422
+ }, {
2423
+ ...styles2,
2424
+ level: {
2425
+ enumerable: true,
2426
+ get() {
2427
+ return this[GENERATOR].level;
2428
+ },
2429
+ set(level) {
2430
+ this[GENERATOR].level = level;
2431
+ }
2432
+ }
2433
+ });
2434
+ var createStyler = (open, close, parent) => {
2435
+ let openAll;
2436
+ let closeAll;
2437
+ if (parent === void 0) {
2438
+ openAll = open;
2439
+ closeAll = close;
2440
+ } else {
2441
+ openAll = parent.openAll + open;
2442
+ closeAll = close + parent.closeAll;
3502
2443
  }
3503
2444
  return {
3504
- level,
3505
- hasBasic: true,
3506
- has256: level >= 2,
3507
- has16m: level >= 3
2445
+ open,
2446
+ close,
2447
+ openAll,
2448
+ closeAll,
2449
+ parent
3508
2450
  };
3509
- }
3510
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
3511
- const noFlagForceColor = envForceColor();
3512
- if (noFlagForceColor !== void 0) {
3513
- flagForceColor = noFlagForceColor;
2451
+ };
2452
+ var createBuilder = (self, _styler, _isEmpty) => {
2453
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
2454
+ Object.setPrototypeOf(builder, proto);
2455
+ builder[GENERATOR] = self;
2456
+ builder[STYLER] = _styler;
2457
+ builder[IS_EMPTY] = _isEmpty;
2458
+ return builder;
2459
+ };
2460
+ var applyStyle = (self, string) => {
2461
+ if (self.level <= 0 || !string) {
2462
+ return self[IS_EMPTY] ? "" : string;
3514
2463
  }
3515
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
3516
- if (forceColor === 0) {
3517
- return 0;
2464
+ let styler = self[STYLER];
2465
+ if (styler === void 0) {
2466
+ return string;
3518
2467
  }
3519
- if (sniffFlags) {
3520
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
3521
- return 3;
2468
+ const { openAll, closeAll } = styler;
2469
+ if (string.includes("\x1B")) {
2470
+ while (styler !== void 0) {
2471
+ string = stringReplaceAll(string, styler.close, styler.open);
2472
+ styler = styler.parent;
3522
2473
  }
3523
- if (hasFlag("color=256")) {
3524
- return 2;
2474
+ }
2475
+ const lfIndex = string.indexOf("\n");
2476
+ if (lfIndex !== -1) {
2477
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
2478
+ }
2479
+ return openAll + string + closeAll;
2480
+ };
2481
+ Object.defineProperties(createChalk.prototype, styles2);
2482
+ var chalk = createChalk();
2483
+ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
2484
+ var source_default = chalk;
2485
+
2486
+ // node_modules/@oclif/plugin-plugins/node_modules/object-treeify/lib/index.js
2487
+ init_cjs_shims();
2488
+
2489
+ // node_modules/@oclif/plugin-plugins/node_modules/object-treeify/lib/assert.js
2490
+ init_cjs_shims();
2491
+ var assert_default = (condition, message) => {
2492
+ if (!condition) {
2493
+ throw new Error(message);
2494
+ }
2495
+ };
2496
+
2497
+ // node_modules/@oclif/plugin-plugins/node_modules/object-treeify/lib/index.js
2498
+ var buildCtx = (opts) => {
2499
+ const ctx = {
2500
+ joined: true,
2501
+ spacerNoNeighbour: " ",
2502
+ spacerNeighbour: "\u2502 ",
2503
+ keyNoNeighbour: "\u2514\u2500 ",
2504
+ keyNeighbour: "\u251C\u2500 ",
2505
+ separator: ": ",
2506
+ renderFn: (node) => ["boolean", "string", "number"].includes(typeof node) ? node : void 0,
2507
+ sortFn: null,
2508
+ breakCircularWith: " (circular ref.)",
2509
+ ...opts
2510
+ };
2511
+ assert_default(Object.keys(ctx).length === 9, "Unexpected Option(s) provided");
2512
+ assert_default(typeof ctx.joined === "boolean", 'Option "joined" has invalid format');
2513
+ assert_default(typeof ctx.spacerNoNeighbour === "string", 'Option "spacerNoNeighbour" has invalid format');
2514
+ assert_default(typeof ctx.spacerNeighbour === "string", 'Option "spacerNeighbour" has invalid format');
2515
+ assert_default(typeof ctx.keyNoNeighbour === "string", 'Option "keyNoNeighbour" has invalid format');
2516
+ assert_default(typeof ctx.keyNeighbour === "string", 'Option "keyNeighbour" has invalid format');
2517
+ assert_default(typeof ctx.separator === "string", 'Option "separator" has invalid format');
2518
+ assert_default(typeof ctx.renderFn === "function", 'Option "renderFn" has invalid format');
2519
+ assert_default(typeof ctx.sortFn === "function" || ctx.sortFn === null, 'Option "sortFn" has invalid format');
2520
+ assert_default(
2521
+ typeof ctx.breakCircularWith === "string" || ctx.breakCircularWith === null,
2522
+ 'Option "breakCircularWith" has invalid format'
2523
+ );
2524
+ return ctx;
2525
+ };
2526
+ var lib_default = (tree, opts = {}) => {
2527
+ const ctx = buildCtx(opts);
2528
+ const result = [];
2529
+ const rootRendered = ctx.renderFn(tree);
2530
+ if (rootRendered !== void 0) {
2531
+ result.push(String(rootRendered));
2532
+ }
2533
+ const sort = (input) => ctx.sortFn === null ? input.reverse() : input.sort((a, b) => ctx.sortFn(b, a));
2534
+ const neighbours = [];
2535
+ const keys = sort(Object.keys(tree)).map((k) => [k]);
2536
+ const lookup = [tree];
2537
+ while (keys.length !== 0) {
2538
+ const key = keys.pop();
2539
+ const node = lookup[key.length - 1][key[key.length - 1]];
2540
+ const isCircular = ctx.breakCircularWith !== null && lookup.includes(node);
2541
+ neighbours[key.length - 1] = keys.length !== 0 && keys[keys.length - 1].length === key.length;
2542
+ const nodeRendered = ctx.renderFn(node);
2543
+ result.push([
2544
+ neighbours.slice(0, key.length - 1).map((n) => n ? ctx.spacerNeighbour : ctx.spacerNoNeighbour).join(""),
2545
+ neighbours[key.length - 1] ? ctx.keyNeighbour : ctx.keyNoNeighbour,
2546
+ key[key.length - 1],
2547
+ nodeRendered === void 0 ? "" : `${ctx.separator}${node}`,
2548
+ isCircular ? ctx.breakCircularWith : ""
2549
+ ].join(""));
2550
+ if (node instanceof Object && !Array.isArray(node) && !isCircular) {
2551
+ keys.push(...sort(Object.keys(node)).map((k) => key.concat(k)));
2552
+ lookup[key.length] = node;
2553
+ }
2554
+ }
2555
+ return ctx.joined === true ? result.join("\n") : result;
2556
+ };
2557
+
2558
+ // node_modules/@oclif/plugin-plugins/lib/plugins.js
2559
+ init_cjs_shims();
2560
+ var import_core4 = __toESM(require_lib(), 1);
2561
+ var import_debug4 = __toESM(require_src(), 1);
2562
+ var import_semver = __toESM(require_semver2(), 1);
2563
+ import { spawn as spawn2 } from "node:child_process";
2564
+ import { access, mkdir, readFile as readFile2, rename, rm, writeFile } from "node:fs/promises";
2565
+ import { basename, dirname, join as join2, resolve } from "node:path";
2566
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
2567
+
2568
+ // node_modules/@oclif/plugin-plugins/lib/npm.js
2569
+ init_cjs_shims();
2570
+ var import_core2 = __toESM(require_lib(), 1);
2571
+ var import_debug2 = __toESM(require_src(), 1);
2572
+ import { readFile } from "node:fs/promises";
2573
+ import { createRequire } from "node:module";
2574
+ import { join, sep } from "node:path";
2575
+
2576
+ // node_modules/@oclif/plugin-plugins/lib/spawn.js
2577
+ init_cjs_shims();
2578
+ var import_core = __toESM(require_lib(), 1);
2579
+ var import_debug = __toESM(require_src(), 1);
2580
+ import { spawn as cpSpawn } from "node:child_process";
2581
+
2582
+ // node_modules/npm-run-path/index.js
2583
+ init_cjs_shims();
2584
+ import process3 from "node:process";
2585
+ import path from "node:path";
2586
+ import { fileURLToPath } from "node:url";
2587
+
2588
+ // node_modules/npm-run-path/node_modules/path-key/index.js
2589
+ init_cjs_shims();
2590
+ function pathKey(options = {}) {
2591
+ const {
2592
+ env: env2 = process.env,
2593
+ platform = process.platform
2594
+ } = options;
2595
+ if (platform !== "win32") {
2596
+ return "PATH";
2597
+ }
2598
+ return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
2599
+ }
2600
+
2601
+ // node_modules/npm-run-path/index.js
2602
+ var npmRunPath = ({
2603
+ cwd = process3.cwd(),
2604
+ path: pathOption = process3.env[pathKey()],
2605
+ preferLocal = true,
2606
+ execPath = process3.execPath,
2607
+ addExecPath = true
2608
+ } = {}) => {
2609
+ const cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd;
2610
+ const cwdPath = path.resolve(cwdString);
2611
+ const result = [];
2612
+ if (preferLocal) {
2613
+ applyPreferLocal(result, cwdPath);
2614
+ }
2615
+ if (addExecPath) {
2616
+ applyExecPath(result, execPath, cwdPath);
2617
+ }
2618
+ return [...result, pathOption].join(path.delimiter);
2619
+ };
2620
+ var applyPreferLocal = (result, cwdPath) => {
2621
+ let previous;
2622
+ while (previous !== cwdPath) {
2623
+ result.push(path.join(cwdPath, "node_modules/.bin"));
2624
+ previous = cwdPath;
2625
+ cwdPath = path.resolve(cwdPath, "..");
2626
+ }
2627
+ };
2628
+ var applyExecPath = (result, execPath, cwdPath) => {
2629
+ const execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
2630
+ result.push(path.resolve(cwdPath, execPathString, ".."));
2631
+ };
2632
+ var npmRunPathEnv = ({ env: env2 = process3.env, ...options } = {}) => {
2633
+ env2 = { ...env2 };
2634
+ const pathName = pathKey({ env: env2 });
2635
+ options.path = env2[pathName];
2636
+ env2[pathName] = npmRunPath(options);
2637
+ return env2;
2638
+ };
2639
+
2640
+ // node_modules/@oclif/plugin-plugins/lib/spawn.js
2641
+ var debug = (0, import_debug.default)("@oclif/plugin-plugins:spawn");
2642
+ async function spawn(modulePath, args = [], { cwd, logLevel }) {
2643
+ return new Promise((resolve2, reject) => {
2644
+ if (process.platform === "win32" && modulePath.endsWith(".js")) {
2645
+ args.unshift(`"${modulePath}"`);
2646
+ modulePath = "node";
2647
+ }
2648
+ debug("modulePath", modulePath);
2649
+ debug("args", args);
2650
+ const spawned = cpSpawn(modulePath, args, {
2651
+ cwd,
2652
+ env: {
2653
+ ...npmRunPathEnv(),
2654
+ // Disable husky hooks because a plugin might be trying to install them, which will
2655
+ // break the install since the install location isn't a .git directory.
2656
+ HUSKY: "0"
2657
+ },
2658
+ stdio: "pipe",
2659
+ windowsVerbatimArguments: true,
2660
+ ...process.platform === "win32" && modulePath.toLowerCase().endsWith(".cmd") && { shell: true }
2661
+ });
2662
+ const possibleLastLinesOfNpmInstall = ["up to date", "added"];
2663
+ const stderr = [];
2664
+ const stdout = [];
2665
+ const loggedStderr = [];
2666
+ const loggedStdout = [];
2667
+ const shouldPrint = (str) => {
2668
+ const noOtherOutput = loggedStderr.length === 0 && loggedStdout.length === 0;
2669
+ const isLastLine = possibleLastLinesOfNpmInstall.some((line) => str.startsWith(line));
2670
+ if (noOtherOutput && isLastLine && logLevel === "notice") {
2671
+ return false;
2672
+ }
2673
+ return logLevel !== "silent";
2674
+ };
2675
+ spawned.stderr?.setEncoding("utf8");
2676
+ spawned.stderr?.on("data", (d) => {
2677
+ const output = d.toString().trim();
2678
+ stderr.push(output);
2679
+ if (shouldPrint(output)) {
2680
+ loggedStderr.push(output);
2681
+ import_core.ux.log(output);
2682
+ } else
2683
+ debug(output);
2684
+ });
2685
+ spawned.stdout?.setEncoding("utf8");
2686
+ spawned.stdout?.on("data", (d) => {
2687
+ const output = d.toString().trim();
2688
+ stdout.push(output);
2689
+ if (shouldPrint(output)) {
2690
+ loggedStdout.push(output);
2691
+ import_core.ux.log(output);
2692
+ } else
2693
+ debug(output);
2694
+ });
2695
+ spawned.on("error", reject);
2696
+ spawned.on("exit", (code) => {
2697
+ if (code === 0) {
2698
+ resolve2({ stderr, stdout });
2699
+ } else {
2700
+ reject(new import_core.Errors.CLIError(`${modulePath} ${args.join(" ")} exited with code ${code}`, {
2701
+ suggestions: ["Run with DEBUG=@oclif/plugin-plugins* to see debug output."]
2702
+ }));
2703
+ }
2704
+ });
2705
+ });
2706
+ }
2707
+
2708
+ // node_modules/@oclif/plugin-plugins/lib/npm.js
2709
+ var debug2 = (0, import_debug2.default)("@oclif/plugin-plugins:npm");
2710
+ var NPM = class {
2711
+ bin;
2712
+ config;
2713
+ logLevel;
2714
+ constructor({ config, logLevel }) {
2715
+ this.config = config;
2716
+ this.logLevel = logLevel;
2717
+ }
2718
+ async exec(args = [], options) {
2719
+ const bin = await this.findNpm();
2720
+ debug2("npm binary path", bin);
2721
+ args.push(`--loglevel=${this.logLevel}`, "--no-fund");
2722
+ if (this.config.npmRegistry)
2723
+ args.push(`--registry=${this.config.npmRegistry}`);
2724
+ if (options.logLevel !== "notice" && options.logLevel !== "silent") {
2725
+ import_core2.ux.logToStderr(`${options.cwd}: ${bin} ${args.join(" ")}`);
2726
+ }
2727
+ debug2(`${options.cwd}: ${bin} ${args.join(" ")}`);
2728
+ try {
2729
+ const output = await spawn(bin, args, options);
2730
+ debug2("npm done");
2731
+ return output;
2732
+ } catch (error) {
2733
+ debug2("npm error", error);
2734
+ throw error;
3525
2735
  }
3526
2736
  }
3527
- if ("TF_BUILD" in env && "AGENT_NAME" in env) {
3528
- return 1;
2737
+ async install(args, opts) {
2738
+ const prod = opts.prod ? ["--omit", "dev"] : [];
2739
+ return this.exec(["install", ...args, ...prod, "--no-audit"], opts);
3529
2740
  }
3530
- if (haveStream && !streamIsTTY && forceColor === void 0) {
3531
- return 0;
2741
+ async uninstall(args, opts) {
2742
+ return this.exec(["uninstall", ...args], opts);
3532
2743
  }
3533
- const min = forceColor || 0;
3534
- if (env.TERM === "dumb") {
3535
- return min;
2744
+ async update(args, opts) {
2745
+ return this.exec(["update", ...args], opts);
3536
2746
  }
3537
- if (process2.platform === "win32") {
3538
- const osRelease = os.release().split(".");
3539
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
3540
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
3541
- }
3542
- return 1;
2747
+ async view(args, opts) {
2748
+ return this.exec(["view", ...args], { ...opts, logLevel: "silent" });
3543
2749
  }
3544
- if ("CI" in env) {
3545
- if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
3546
- return 3;
2750
+ /**
2751
+ * Get the path to the npm CLI file.
2752
+ * This will resolve npm to the pinned version in `@oclif/plugin-plugins/package.json` if it exists.
2753
+ * Otherwise, it will use the globally installed npm.
2754
+ *
2755
+ * @returns The path to the `npm/bin/npm-cli.js` file.
2756
+ */
2757
+ async findNpm() {
2758
+ if (this.bin)
2759
+ return this.bin;
2760
+ try {
2761
+ const npmPjsonPath = createRequire(import.meta.url).resolve("npm/package.json");
2762
+ const npmPjson = JSON.parse(await readFile(npmPjsonPath, { encoding: "utf8" }));
2763
+ const npmPath = npmPjsonPath.slice(0, Math.max(0, npmPjsonPath.lastIndexOf(sep)));
2764
+ this.bin = join(npmPath, npmPjson.bin.npm);
2765
+ } catch {
2766
+ const { default: which } = await import("./lib-ZFTB4C3N.js");
2767
+ this.bin = await which("npm");
3547
2768
  }
3548
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
3549
- return 1;
2769
+ if (!this.bin) {
2770
+ throw new import_core2.Errors.CLIError("npm not found");
3550
2771
  }
3551
- return min;
3552
- }
3553
- if ("TEAMCITY_VERSION" in env) {
3554
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
3555
- }
3556
- if (env.COLORTERM === "truecolor") {
3557
- return 3;
2772
+ return this.bin;
3558
2773
  }
3559
- if (env.TERM === "xterm-kitty") {
3560
- return 3;
2774
+ };
2775
+
2776
+ // node_modules/@oclif/plugin-plugins/lib/util.js
2777
+ init_cjs_shims();
2778
+ function compare(a, b) {
2779
+ const itemA = a === void 0 ? 0 : a;
2780
+ const itemB = b === void 0 ? 0 : b;
2781
+ if (Array.isArray(itemA) && Array.isArray(itemB)) {
2782
+ if (itemA.length === 0 && itemB.length === 0)
2783
+ return 0;
2784
+ const diff = compare(itemA[0], itemB[0]);
2785
+ if (diff !== 0)
2786
+ return diff;
2787
+ return compare(itemA.slice(1), itemB.slice(1));
3561
2788
  }
3562
- if ("TERM_PROGRAM" in env) {
3563
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
3564
- switch (env.TERM_PROGRAM) {
3565
- case "iTerm.app": {
3566
- return version >= 3 ? 3 : 2;
3567
- }
3568
- case "Apple_Terminal": {
3569
- return 2;
3570
- }
2789
+ if (itemA < itemB)
2790
+ return -1;
2791
+ if (itemA > itemB)
2792
+ return 1;
2793
+ return 0;
2794
+ }
2795
+ function sortBy(arr, fn) {
2796
+ return arr.sort((a, b) => compare(fn(a), fn(b)));
2797
+ }
2798
+ function uniqWith(arr, fn) {
2799
+ return arr.filter((a, i) => !arr.some((b, j) => j > i && fn(a, b)));
2800
+ }
2801
+
2802
+ // node_modules/@oclif/plugin-plugins/lib/yarn.js
2803
+ init_cjs_shims();
2804
+ var import_core3 = __toESM(require_lib(), 1);
2805
+ var import_debug3 = __toESM(require_src(), 1);
2806
+ import { createRequire as createRequire2 } from "node:module";
2807
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
2808
+ var require2 = createRequire2(import.meta.url);
2809
+ var debug3 = (0, import_debug3.default)("@oclif/plugin-plugins:yarn");
2810
+ var Yarn = class {
2811
+ bin;
2812
+ config;
2813
+ logLevel;
2814
+ constructor({ config, logLevel }) {
2815
+ this.config = config;
2816
+ this.logLevel = logLevel;
2817
+ }
2818
+ async exec(args = [], options) {
2819
+ const bin = await this.findYarn();
2820
+ debug3("yarn binary path", bin);
2821
+ if (options.logLevel === "verbose")
2822
+ args.push("--verbose");
2823
+ if (this.config.npmRegistry)
2824
+ args.push(`--registry=${this.config.npmRegistry}`);
2825
+ if (options.logLevel !== "notice" && options.logLevel !== "silent") {
2826
+ import_core3.ux.logToStderr(`${options.cwd}: ${bin} ${args.join(" ")}`);
2827
+ }
2828
+ debug3(`${options.cwd}: ${bin} ${args.join(" ")}`);
2829
+ try {
2830
+ const output = await spawn(bin, args, options);
2831
+ debug3("yarn done");
2832
+ return output;
2833
+ } catch (error) {
2834
+ debug3("yarn error", error);
2835
+ throw error;
3571
2836
  }
3572
2837
  }
3573
- if (/-256(color)?$/i.test(env.TERM)) {
3574
- return 2;
3575
- }
3576
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
3577
- return 1;
2838
+ async install(args, opts) {
2839
+ return this.exec(["install", ...args], opts);
3578
2840
  }
3579
- if ("COLORTERM" in env) {
3580
- return 1;
2841
+ async findYarn() {
2842
+ if (this.bin)
2843
+ return this.bin;
2844
+ try {
2845
+ this.bin = require2.resolve("yarn/bin/yarn.js", { paths: [this.config.root, fileURLToPath2(import.meta.url)] });
2846
+ } catch {
2847
+ const { default: which } = await import("./lib-ZFTB4C3N.js");
2848
+ this.bin = await which("yarn");
2849
+ }
2850
+ if (!this.bin) {
2851
+ throw new import_core3.Errors.CLIError("yarn not found");
2852
+ }
2853
+ return this.bin;
3581
2854
  }
3582
- return min;
3583
- }
3584
- function createSupportsColor(stream, options = {}) {
3585
- const level = _supportsColor(stream, {
3586
- streamIsTTY: stream && stream.isTTY,
3587
- ...options
3588
- });
3589
- return translateLevel(level);
3590
- }
3591
- var supportsColor = {
3592
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
3593
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
3594
2855
  };
3595
- var supports_color_default = supportsColor;
3596
2856
 
3597
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/utilities.js
3598
- init_cjs_shims();
3599
- function stringReplaceAll(string, substring, replacer) {
3600
- let index = string.indexOf(substring);
3601
- if (index === -1) {
3602
- return string;
2857
+ // node_modules/@oclif/plugin-plugins/lib/plugins.js
2858
+ var initPJSON = {
2859
+ dependencies: {},
2860
+ oclif: { plugins: [], schema: 1 },
2861
+ private: true
2862
+ };
2863
+ async function fileExists(filePath) {
2864
+ try {
2865
+ await access(filePath);
2866
+ return true;
2867
+ } catch {
2868
+ return false;
3603
2869
  }
3604
- const substringLength = substring.length;
3605
- let endIndex = 0;
3606
- let returnValue = "";
3607
- do {
3608
- returnValue += string.slice(endIndex, index) + substring + replacer;
3609
- endIndex = index + substringLength;
3610
- index = string.indexOf(substring, endIndex);
3611
- } while (index !== -1);
3612
- returnValue += string.slice(endIndex);
3613
- return returnValue;
3614
2870
  }
3615
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
3616
- let endIndex = 0;
3617
- let returnValue = "";
3618
- do {
3619
- const gotCR = string[index - 1] === "\r";
3620
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
3621
- endIndex = index + 1;
3622
- index = string.indexOf("\n", endIndex);
3623
- } while (index !== -1);
3624
- returnValue += string.slice(endIndex);
3625
- return returnValue;
2871
+ function dedupePlugins(plugins) {
2872
+ return uniqWith(
2873
+ plugins,
2874
+ // @ts-expect-error because typescript doesn't think it's possible for a plugin to have the `link` type here
2875
+ (a, b) => a.name === b.name || a.type === "link" && b.type === "link" && a.root === b.root
2876
+ );
3626
2877
  }
3627
-
3628
- // node_modules/@oclif/plugin-plugins/node_modules/chalk/source/index.js
3629
- var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
3630
- var GENERATOR = Symbol("GENERATOR");
3631
- var STYLER = Symbol("STYLER");
3632
- var IS_EMPTY = Symbol("IS_EMPTY");
3633
- var levelMapping = [
3634
- "ansi",
3635
- "ansi",
3636
- "ansi256",
3637
- "ansi16m"
3638
- ];
3639
- var styles2 = /* @__PURE__ */ Object.create(null);
3640
- var applyOptions = (object, options = {}) => {
3641
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
3642
- throw new Error("The `level` option should be an integer from 0 to 3");
2878
+ function extractIssuesLocation(bugs, repository) {
2879
+ if (bugs) {
2880
+ return typeof bugs === "string" ? bugs : bugs.url;
2881
+ }
2882
+ if (repository) {
2883
+ return typeof repository === "string" ? repository : repository.url.replace("git+", "").replace(".git", "");
3643
2884
  }
3644
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
3645
- object.level = options.level === void 0 ? colorLevel : options.level;
3646
- };
3647
- var chalkFactory = (options) => {
3648
- const chalk2 = (...strings) => strings.join(" ");
3649
- applyOptions(chalk2, options);
3650
- Object.setPrototypeOf(chalk2, createChalk.prototype);
3651
- return chalk2;
3652
- };
3653
- function createChalk(options) {
3654
- return chalkFactory(options);
3655
2885
  }
3656
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
3657
- for (const [styleName, style] of Object.entries(ansi_styles_default)) {
3658
- styles2[styleName] = {
3659
- get() {
3660
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
3661
- Object.defineProperty(this, styleName, { value: builder });
3662
- return builder;
2886
+ function notifyUser(plugin, output) {
2887
+ const containsWarnings = [...output.stdout, ...output.stderr].some((l) => l.includes("npm WARN"));
2888
+ if (containsWarnings) {
2889
+ import_core4.ux.logToStderr(source_default.bold.yellow(`
2890
+ These warnings can only be addressed by the owner(s) of ${plugin.name}.`));
2891
+ if (plugin.pjson.bugs || plugin.pjson.repository) {
2892
+ import_core4.ux.logToStderr(`We suggest that you create an issue at ${extractIssuesLocation(plugin.pjson.bugs, plugin.pjson.repository)} and ask the plugin owners to address them.
2893
+ `);
3663
2894
  }
3664
- };
2895
+ }
3665
2896
  }
3666
- styles2.visible = {
3667
- get() {
3668
- const builder = createBuilder(this, this[STYLER], true);
3669
- Object.defineProperty(this, "visible", { value: builder });
3670
- return builder;
2897
+ var Plugins = class {
2898
+ config;
2899
+ npm;
2900
+ debug;
2901
+ logLevel;
2902
+ constructor(options) {
2903
+ this.config = options.config;
2904
+ this.debug = (0, import_debug4.default)("@oclif/plugin-plugins");
2905
+ this.logLevel = options.logLevel ?? "notice";
2906
+ this.npm = new NPM({
2907
+ config: this.config,
2908
+ logLevel: this.logLevel
2909
+ });
2910
+ }
2911
+ async add(...plugins) {
2912
+ const pjson = await this.pjson();
2913
+ const mergedPlugins = [...pjson.oclif.plugins || [], ...plugins];
2914
+ await this.savePJSON({
2915
+ ...pjson,
2916
+ oclif: {
2917
+ ...pjson.oclif,
2918
+ plugins: dedupePlugins(mergedPlugins)
2919
+ }
2920
+ });
2921
+ }
2922
+ friendlyName(name) {
2923
+ const { pluginPrefix, scope } = this.config.pjson.oclif;
2924
+ if (!scope)
2925
+ return name;
2926
+ const match = name.match(`@${scope}/${pluginPrefix ?? "plugin"}-(.+)`);
2927
+ return match?.[1] ?? name;
2928
+ }
2929
+ async hasPlugin(name) {
2930
+ const list = await this.list();
2931
+ const friendlyName = this.friendlyName(name);
2932
+ const unfriendlyName = this.unfriendlyName(name) ?? name;
2933
+ return list.find((p) => this.friendlyName(p.name) === friendlyName) ?? // friendly
2934
+ list.find((p) => this.unfriendlyName(p.name) === unfriendlyName) ?? // unfriendly
2935
+ list.find((p) => p.type === "link" && resolve(p.root) === resolve(name)) ?? // link
2936
+ false;
2937
+ }
2938
+ async install(name, { force = false, tag = "latest" } = {}) {
2939
+ await this.maybeCleanUp();
2940
+ try {
2941
+ this.debug(`installing plugin ${name}`);
2942
+ const options = { cwd: this.config.dataDir, logLevel: this.logLevel, prod: true };
2943
+ await this.ensurePJSON();
2944
+ let plugin;
2945
+ const args = force ? ["--force"] : [];
2946
+ if (name.includes(":")) {
2947
+ const url = name;
2948
+ const output = await this.npm.install([...args, url], options);
2949
+ const { dependencies } = await this.pjson();
2950
+ const { default: npa } = await import("./npa-MG6WRKUV.js");
2951
+ const normalizedUrl = npa(url);
2952
+ const matches = Object.entries(dependencies ?? {}).find(([, u]) => {
2953
+ const normalized = npa(u);
2954
+ return normalized.hosted?.type === normalizedUrl.hosted?.type && normalized.hosted?.user === normalizedUrl.hosted?.user && normalized.hosted?.project === normalizedUrl.hosted?.project;
2955
+ });
2956
+ const installedPluginName = matches?.[0];
2957
+ if (!installedPluginName)
2958
+ throw new import_core4.Errors.CLIError(`Could not find plugin name for ${url}`);
2959
+ const root = join2(this.config.dataDir, "node_modules", installedPluginName);
2960
+ plugin = await import_core4.Config.load({
2961
+ devPlugins: false,
2962
+ name: installedPluginName,
2963
+ root,
2964
+ userPlugins: false
2965
+ });
2966
+ notifyUser(plugin, output);
2967
+ this.isValidPlugin(plugin);
2968
+ await this.add({ name: installedPluginName, type: "user", url });
2969
+ const safeToNotExist = /* @__PURE__ */ new Set(["oclif.manifest.json", "oclif.lock", "npm-shrinkwrap.json"]);
2970
+ const files = (plugin.pjson.files ?? []).map((f) => join2(root, f)).filter((f) => !safeToNotExist.has(basename(f)));
2971
+ this.debug(`checking for existence of files: ${files.join(", ")}`);
2972
+ const results = Object.fromEntries(await Promise.all(files?.map(async (f) => [f, await fileExists(f)]) ?? []));
2973
+ this.debug(results);
2974
+ if (!Object.values(results).every(Boolean)) {
2975
+ import_core4.ux.warn(`This plugin from github may not work as expected because the prepare script did not produce all the expected files.`);
2976
+ }
2977
+ } else {
2978
+ const range = (0, import_semver.validRange)(tag);
2979
+ const unfriendly = this.unfriendlyName(name);
2980
+ if (unfriendly && await this.npmHasPackage(unfriendly)) {
2981
+ name = unfriendly;
2982
+ }
2983
+ await this.npmHasPackage(name, true);
2984
+ const output = await this.npm.install([...args, `${name}@${tag}`], options);
2985
+ this.debug(`loading plugin ${name}...`);
2986
+ plugin = await import_core4.Config.load({
2987
+ devPlugins: false,
2988
+ name,
2989
+ root: join2(this.config.dataDir, "node_modules", name),
2990
+ userPlugins: false
2991
+ });
2992
+ this.debug(`finished loading plugin ${name} at root ${plugin.root}`);
2993
+ notifyUser(plugin, output);
2994
+ this.isValidPlugin(plugin);
2995
+ await this.add({ name, tag: range ?? tag, type: "user" });
2996
+ }
2997
+ await rm(join2(this.config.dataDir, "yarn.lock"), { force: true });
2998
+ return plugin;
2999
+ } catch (error) {
3000
+ this.debug("error installing plugin:", error);
3001
+ await this.uninstall(name).catch((error2) => this.debug(error2));
3002
+ if (String(error).includes("EACCES")) {
3003
+ throw new import_core4.Errors.CLIError(error, {
3004
+ suggestions: [
3005
+ `Plugin failed to install because of a permissions error.
3006
+ Does your current user own the directory ${this.config.dataDir}?`
3007
+ ]
3008
+ });
3009
+ }
3010
+ throw error;
3011
+ }
3671
3012
  }
3672
- };
3673
- var getModelAnsi = (model, level, type2, ...arguments_) => {
3674
- if (model === "rgb") {
3675
- if (level === "ansi16m") {
3676
- return ansi_styles_default[type2].ansi16m(...arguments_);
3013
+ async link(p, { install }) {
3014
+ const c = await import_core4.Config.load(resolve(p));
3015
+ this.isValidPlugin(c);
3016
+ if (install) {
3017
+ if (await fileExists(join2(c.root, "yarn.lock"))) {
3018
+ this.debug("installing dependencies with yarn");
3019
+ const yarn = new Yarn({ config: this.config, logLevel: this.logLevel });
3020
+ await yarn.install([], {
3021
+ cwd: c.root,
3022
+ logLevel: this.logLevel
3023
+ });
3024
+ } else if (await fileExists(join2(c.root, "package-lock.json"))) {
3025
+ this.debug("installing dependencies with npm");
3026
+ await this.npm.install([], {
3027
+ cwd: c.root,
3028
+ logLevel: this.logLevel,
3029
+ prod: false
3030
+ });
3031
+ } else if (await fileExists(join2(c.root, "pnpm-lock.yaml"))) {
3032
+ import_core4.ux.warn(`pnpm is not supported for installing after a link. The link succeeded, but you may need to run 'pnpm install' in ${c.root}.`);
3033
+ } else {
3034
+ import_core4.ux.warn(`No lockfile found in ${c.root}. The link succeeded, but you may need to install the dependencies in your project.`);
3035
+ }
3677
3036
  }
3678
- if (level === "ansi256") {
3679
- return ansi_styles_default[type2].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
3037
+ await this.add({ name: c.name, root: c.root, type: "link" });
3038
+ return c;
3039
+ }
3040
+ async list() {
3041
+ const pjson = await this.pjson();
3042
+ return pjson.oclif.plugins;
3043
+ }
3044
+ async maybeUnfriendlyName(name) {
3045
+ await this.ensurePJSON();
3046
+ const unfriendly = this.unfriendlyName(name);
3047
+ this.debug(`checking registry for expanded package name ${unfriendly}`);
3048
+ if (unfriendly && await this.npmHasPackage(unfriendly)) {
3049
+ return unfriendly;
3680
3050
  }
3681
- return ansi_styles_default[type2].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
3051
+ this.debug(`expanded package name ${unfriendly} not found, using given package name ${name}`);
3052
+ return name;
3682
3053
  }
3683
- if (model === "hex") {
3684
- return getModelAnsi("rgb", level, type2, ...ansi_styles_default.hexToRgb(...arguments_));
3054
+ async pjson() {
3055
+ const pjson = await this.readPJSON();
3056
+ const plugins = pjson ? normalizePlugins(pjson.oclif.plugins) : [];
3057
+ return {
3058
+ ...initPJSON,
3059
+ ...pjson,
3060
+ oclif: {
3061
+ ...initPJSON.oclif,
3062
+ ...pjson?.oclif,
3063
+ plugins
3064
+ }
3065
+ };
3685
3066
  }
3686
- return ansi_styles_default[type2][model](...arguments_);
3687
- };
3688
- var usedModels = ["rgb", "hex", "ansi256"];
3689
- for (const model of usedModels) {
3690
- styles2[model] = {
3691
- get() {
3692
- const { level } = this;
3693
- return function(...arguments_) {
3694
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
3695
- return createBuilder(this, styler, this[IS_EMPTY]);
3696
- };
3067
+ async remove(name) {
3068
+ const pjson = await this.pjson();
3069
+ if (pjson.dependencies)
3070
+ delete pjson.dependencies[name];
3071
+ await this.savePJSON({
3072
+ ...pjson,
3073
+ oclif: {
3074
+ ...pjson.oclif,
3075
+ plugins: pjson.oclif.plugins.filter((p) => p.name !== name)
3076
+ }
3077
+ });
3078
+ }
3079
+ unfriendlyName(name) {
3080
+ if (name.includes("@"))
3081
+ return;
3082
+ const { pluginPrefix, scope } = this.config.pjson.oclif;
3083
+ if (!scope)
3084
+ return;
3085
+ return `@${scope}/${pluginPrefix ?? "plugin"}-${name}`;
3086
+ }
3087
+ async uninstall(name) {
3088
+ try {
3089
+ const pjson = await this.pjson();
3090
+ if ((pjson.oclif.plugins ?? []).some((p) => typeof p === "object" && p.type === "user" && p.name === name)) {
3091
+ await this.npm.uninstall([name], {
3092
+ cwd: this.config.dataDir,
3093
+ logLevel: this.logLevel
3094
+ });
3095
+ }
3096
+ } catch (error) {
3097
+ import_core4.ux.warn(error);
3098
+ } finally {
3099
+ await this.remove(name);
3697
3100
  }
3698
- };
3699
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3700
- styles2[bgModel] = {
3701
- get() {
3702
- const { level } = this;
3703
- return function(...arguments_) {
3704
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
3705
- return createBuilder(this, styler, this[IS_EMPTY]);
3706
- };
3101
+ }
3102
+ async update() {
3103
+ let plugins = (await this.list()).filter((p) => p.type === "user");
3104
+ if (plugins.length === 0)
3105
+ return;
3106
+ await this.maybeCleanUp();
3107
+ const aliases = this.config.pjson.oclif.aliases || {};
3108
+ for (const [name, to] of Object.entries(aliases)) {
3109
+ const plugin = plugins.find((p) => p.name === name);
3110
+ if (!plugin)
3111
+ continue;
3112
+ if (to)
3113
+ await this.install(to);
3114
+ await this.uninstall(name);
3115
+ plugins = plugins.filter((p) => p.name !== name);
3707
3116
  }
3708
- };
3709
- }
3710
- var proto = Object.defineProperties(() => {
3711
- }, {
3712
- ...styles2,
3713
- level: {
3714
- enumerable: true,
3715
- get() {
3716
- return this[GENERATOR].level;
3717
- },
3718
- set(level) {
3719
- this[GENERATOR].level = level;
3117
+ const urlPlugins = plugins.filter((p) => Boolean(p.url));
3118
+ if (urlPlugins.length > 0) {
3119
+ await this.npm.update(urlPlugins.map((p) => p.name), {
3120
+ cwd: this.config.dataDir,
3121
+ logLevel: this.logLevel
3122
+ });
3123
+ }
3124
+ const npmPlugins = plugins.filter((p) => !p.url);
3125
+ const jitPlugins = this.config.pjson.oclif.jitPlugins ?? {};
3126
+ const modifiedPlugins = [];
3127
+ if (npmPlugins.length > 0) {
3128
+ await this.npm.install(npmPlugins.map((p) => {
3129
+ if (!(0, import_semver.valid)(p.tag))
3130
+ return `${p.name}@${p.tag}`;
3131
+ if (p.tag && (0, import_semver.valid)(p.tag) && jitPlugins[p.name] && (0, import_semver.gt)(p.tag, jitPlugins[p.name])) {
3132
+ return `${p.name}@${p.tag}`;
3133
+ }
3134
+ const tag = jitPlugins[p.name] ?? p.tag;
3135
+ modifiedPlugins.push({ ...p, tag });
3136
+ return `${p.name}@${tag}`;
3137
+ }), { cwd: this.config.dataDir, logLevel: this.logLevel, prod: true });
3720
3138
  }
3139
+ await this.add(...modifiedPlugins);
3721
3140
  }
3722
- });
3723
- var createStyler = (open, close, parent) => {
3724
- let openAll;
3725
- let closeAll;
3726
- if (parent === void 0) {
3727
- openAll = open;
3728
- closeAll = close;
3729
- } else {
3730
- openAll = parent.openAll + open;
3731
- closeAll = close + parent.closeAll;
3141
+ async ensurePJSON() {
3142
+ if (!await fileExists(this.pjsonPath)) {
3143
+ this.debug(`creating ${this.pjsonPath} with pjson: ${JSON.stringify(initPJSON, null, 2)}`);
3144
+ await this.savePJSON(initPJSON);
3145
+ }
3732
3146
  }
3733
- return {
3734
- open,
3735
- close,
3736
- openAll,
3737
- closeAll,
3738
- parent
3739
- };
3740
- };
3741
- var createBuilder = (self, _styler, _isEmpty) => {
3742
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3743
- Object.setPrototypeOf(builder, proto);
3744
- builder[GENERATOR] = self;
3745
- builder[STYLER] = _styler;
3746
- builder[IS_EMPTY] = _isEmpty;
3747
- return builder;
3748
- };
3749
- var applyStyle = (self, string) => {
3750
- if (self.level <= 0 || !string) {
3751
- return self[IS_EMPTY] ? "" : string;
3147
+ isValidPlugin(p) {
3148
+ if (p.valid)
3149
+ return true;
3150
+ if (this.config.plugins.get("@oclif/plugin-legacy") || // @ts-expect-error because _base is private
3151
+ p._base.includes("@oclif/plugin-legacy")) {
3152
+ return true;
3153
+ }
3154
+ throw new import_core4.Errors.CLIError("plugin is invalid", {
3155
+ suggestions: [
3156
+ "Plugin failed to install because it does not appear to be a valid CLI plugin.\nIf you are sure it is, contact the CLI developer noting this error."
3157
+ ]
3158
+ });
3752
3159
  }
3753
- let styler = self[STYLER];
3754
- if (styler === void 0) {
3755
- return string;
3160
+ async maybeCleanUp() {
3161
+ if (await fileExists(join2(this.config.dataDir, "yarn.lock"))) {
3162
+ try {
3163
+ this.debug("Found yarn.lock! Removing yarn.lock and node_modules...");
3164
+ await Promise.all([
3165
+ rename(join2(this.config.dataDir, "node_modules"), join2(this.config.dataDir, "node_modules.old")),
3166
+ rm(join2(this.config.dataDir, "yarn.lock"), { force: true })
3167
+ ]);
3168
+ const rmScript = join2(dirname(fileURLToPath3(import.meta.url)), "rm.js");
3169
+ this.debug(`spawning ${rmScript} to remove node_modules.old`);
3170
+ spawn2(process.argv[0], [rmScript, join2(this.config.dataDir, "node_modules.old")], {
3171
+ detached: true,
3172
+ stdio: "ignore",
3173
+ ...this.config.windows ? { shell: true } : {}
3174
+ }).unref();
3175
+ } catch (error) {
3176
+ this.debug("Error cleaning up yarn.lock and node_modules:", error);
3177
+ }
3178
+ }
3756
3179
  }
3757
- const { openAll, closeAll } = styler;
3758
- if (string.includes("\x1B")) {
3759
- while (styler !== void 0) {
3760
- string = stringReplaceAll(string, styler.close, styler.open);
3761
- styler = styler.parent;
3180
+ async npmHasPackage(name, throwOnNotFound = false) {
3181
+ try {
3182
+ await this.npm.view([name], {
3183
+ cwd: this.config.dataDir,
3184
+ logLevel: this.logLevel
3185
+ });
3186
+ this.debug(`Found ${name} in the registry.`);
3187
+ return true;
3188
+ } catch (error) {
3189
+ this.debug(error);
3190
+ if (throwOnNotFound)
3191
+ throw new import_core4.Errors.CLIError(`${name} does not exist in the registry.`);
3192
+ return false;
3762
3193
  }
3763
3194
  }
3764
- const lfIndex = string.indexOf("\n");
3765
- if (lfIndex !== -1) {
3766
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3195
+ get pjsonPath() {
3196
+ return join2(this.config.dataDir, "package.json");
3197
+ }
3198
+ async readPJSON() {
3199
+ try {
3200
+ return JSON.parse(await readFile2(this.pjsonPath, "utf8"));
3201
+ } catch (error) {
3202
+ this.debug(error);
3203
+ const err = error;
3204
+ if (err.code !== "ENOENT")
3205
+ process.emitWarning(err);
3206
+ }
3207
+ }
3208
+ async savePJSON(pjson) {
3209
+ this.debug(`saving pjson at ${this.pjsonPath}`, JSON.stringify(pjson, null, 2));
3210
+ await mkdir(dirname(this.pjsonPath), { recursive: true });
3211
+ await writeFile(this.pjsonPath, JSON.stringify({ name: this.config.name, ...pjson }, null, 2));
3767
3212
  }
3768
- return openAll + string + closeAll;
3769
3213
  };
3770
- Object.defineProperties(createChalk.prototype, styles2);
3771
- var chalk = createChalk();
3772
- var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
3773
- var source_default = chalk;
3214
+ var normalizePlugins = (input) => dedupePlugins((input ?? []).map((p) => typeof p === "string" ? {
3215
+ name: p,
3216
+ tag: "latest",
3217
+ type: "user"
3218
+ } : p));
3774
3219
 
3775
3220
  // node_modules/@oclif/plugin-plugins/lib/commands/plugins/index.js
3776
- var PluginsIndex = class _PluginsIndex extends import_core4.Command {
3221
+ var PluginsIndex = class _PluginsIndex extends import_core5.Command {
3777
3222
  static description = "List installed plugins.";
3778
3223
  static enableJsonFlag = true;
3779
3224
  static examples = ["<%= config.bin %> <%= command.id %>"];
3780
3225
  static flags = {
3781
- core: import_core4.Flags.boolean({ description: "Show core plugins." })
3226
+ core: import_core5.Flags.boolean({ description: "Show core plugins." })
3782
3227
  };
3783
- plugins = new Plugins(this.config);
3228
+ plugins;
3784
3229
  async run() {
3785
3230
  const { flags } = await this.parse(_PluginsIndex);
3231
+ this.plugins = new Plugins({
3232
+ config: this.config
3233
+ });
3786
3234
  let plugins = this.config.getPluginsList();
3787
3235
  sortBy(plugins, (p) => this.plugins.friendlyName(p.name));
3788
3236
  if (!flags.core) {
@@ -3802,10 +3250,9 @@ var PluginsIndex = class _PluginsIndex extends import_core4.Command {
3802
3250
  return [...results.filter((p) => !p.parent), ...jitPlugins];
3803
3251
  }
3804
3252
  createTree(plugin) {
3805
- const tree = import_core4.ux.tree();
3253
+ const tree = {};
3806
3254
  for (const p of plugin.children) {
3807
- const name = this.formatPlugin(p);
3808
- tree.insert(name, this.createTree(p));
3255
+ tree[this.formatPlugin(p)] = this.createTree(p);
3809
3256
  }
3810
3257
  return tree;
3811
3258
  }
@@ -3814,7 +3261,7 @@ var PluginsIndex = class _PluginsIndex extends import_core4.Command {
3814
3261
  this.log(this.formatPlugin(plugin));
3815
3262
  if (plugin.children && plugin.children.length > 0) {
3816
3263
  const tree = this.createTree(plugin);
3817
- tree.display();
3264
+ this.log(lib_default(tree));
3818
3265
  }
3819
3266
  }
3820
3267
  }
@@ -3840,9 +3287,25 @@ var PluginsIndex = class _PluginsIndex extends import_core4.Command {
3840
3287
 
3841
3288
  // node_modules/@oclif/plugin-plugins/lib/commands/plugins/inspect.js
3842
3289
  init_cjs_shims();
3843
- var import_core5 = __toESM(require_lib(), 1);
3290
+ var import_core6 = __toESM(require_lib(), 1);
3844
3291
  import { readFile as readFile3 } from "node:fs/promises";
3845
- import { dirname as dirname2, join as join4, sep as sep2 } from "node:path";
3292
+ import { dirname as dirname2, join as join3, sep as sep2 } from "node:path";
3293
+
3294
+ // node_modules/@oclif/plugin-plugins/lib/log-level.js
3295
+ init_cjs_shims();
3296
+ var LOG_LEVELS = ["silent", "error", "warn", "notice", "http", "info", "verbose", "silly"];
3297
+ function determineLogLevel(config, flags, defaultLevel) {
3298
+ if (flags.verbose)
3299
+ return "verbose";
3300
+ if (flags.silent)
3301
+ return "silent";
3302
+ const envVar = config.scopedEnvVar("NPM_LOG_LEVEL");
3303
+ if (LOG_LEVELS.includes(envVar))
3304
+ return envVar;
3305
+ return defaultLevel;
3306
+ }
3307
+
3308
+ // node_modules/@oclif/plugin-plugins/lib/commands/plugins/inspect.js
3846
3309
  function trimUntil(fsPath, part) {
3847
3310
  const parts = fsPath.split(sep2);
3848
3311
  const indices = parts.reduce((result, current, index) => current === part ? [...result, index] : result, []);
@@ -3851,9 +3314,9 @@ function trimUntil(fsPath, part) {
3851
3314
  return fsPath;
3852
3315
  return parts.slice(0, partIndex + 1).join(sep2);
3853
3316
  }
3854
- var PluginsInspect = class _PluginsInspect extends import_core5.Command {
3317
+ var PluginsInspect = class _PluginsInspect extends import_core6.Command {
3855
3318
  static args = {
3856
- plugin: import_core5.Args.string({
3319
+ plugin: import_core6.Args.string({
3857
3320
  default: ".",
3858
3321
  description: "Plugin to inspect.",
3859
3322
  required: true
@@ -3863,15 +3326,15 @@ var PluginsInspect = class _PluginsInspect extends import_core5.Command {
3863
3326
  static enableJsonFlag = true;
3864
3327
  static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> '];
3865
3328
  static flags = {
3866
- help: import_core5.Flags.help({ char: "h" }),
3867
- verbose: import_core5.Flags.boolean({ char: "v" })
3329
+ help: import_core6.Flags.help({ char: "h" }),
3330
+ verbose: import_core6.Flags.boolean({ char: "v" })
3868
3331
  };
3869
3332
  static strict = false;
3870
3333
  static usage = "plugins:inspect PLUGIN...";
3871
- plugins = new Plugins(this.config);
3334
+ plugins;
3872
3335
  async findDep(plugin, dependency) {
3873
- const dependencyPath = join4(...dependency.split("/"));
3874
- let start = join4(plugin.root, "node_modules");
3336
+ const dependencyPath = join3(...dependency.split("/"));
3337
+ let start = join3(plugin.root, "node_modules");
3875
3338
  const paths = [start];
3876
3339
  while ((start.match(/node_modules/g) ?? []).length > 1) {
3877
3340
  start = trimUntil(dirname2(start), "node_modules");
@@ -3879,8 +3342,8 @@ var PluginsInspect = class _PluginsInspect extends import_core5.Command {
3879
3342
  }
3880
3343
  for (const p of paths) {
3881
3344
  try {
3882
- const fullPath = join4(p, dependencyPath);
3883
- const pkgJsonPath = join4(fullPath, "package.json");
3345
+ const fullPath = join3(p, dependencyPath);
3346
+ const pkgJsonPath = join3(fullPath, "package.json");
3884
3347
  const pkgJson = JSON.parse(await readFile3(pkgJsonPath, "utf8"));
3885
3348
  return { pkgPath: fullPath, version: pkgJson.version };
3886
3349
  } catch {
@@ -3899,42 +3362,38 @@ var PluginsInspect = class _PluginsInspect extends import_core5.Command {
3899
3362
  }
3900
3363
  async inspect(pluginName, verbose = false) {
3901
3364
  const plugin = this.findPlugin(pluginName);
3902
- const tree = import_core5.ux.tree();
3903
- const pluginHeader = source_default.bold.cyan(plugin.name);
3904
- tree.insert(pluginHeader);
3905
- tree.nodes[pluginHeader].insert(`version ${plugin.version}`);
3906
- if (plugin.tag)
3907
- tree.nodes[pluginHeader].insert(`tag ${plugin.tag}`);
3908
- if (plugin.pjson.homepage)
3909
- tree.nodes[pluginHeader].insert(`homepage ${plugin.pjson.homepage}`);
3910
- tree.nodes[pluginHeader].insert(`location ${plugin.root}`);
3911
- tree.nodes[pluginHeader].insert("commands");
3912
- const commands3 = sortBy(plugin.commandIDs, (c) => c);
3913
- for (const cmd of commands3)
3914
- tree.nodes[pluginHeader].nodes.commands.insert(cmd);
3915
- const dependencies = { ...plugin.pjson.dependencies };
3916
- tree.nodes[pluginHeader].insert("dependencies");
3917
- const deps = sortBy(Object.keys(dependencies), (d) => d);
3365
+ const dependencies = {};
3918
3366
  const depsJson = {};
3919
- for (const dep of deps) {
3367
+ for (const dep of sortBy(Object.keys({ ...plugin.pjson.dependencies }), (d) => d)) {
3920
3368
  const { pkgPath, version } = await this.findDep(plugin, dep);
3921
3369
  if (!version)
3922
3370
  continue;
3923
- const from = dependencies[dep] ?? null;
3371
+ const from = plugin.pjson.dependencies?.[dep];
3924
3372
  const versionMsg = source_default.dim(from ? `${from} => ${version}` : version);
3925
3373
  const msg = verbose ? `${dep} ${versionMsg} ${pkgPath}` : `${dep} ${versionMsg}`;
3926
- tree.nodes[pluginHeader].nodes.dependencies.insert(msg);
3374
+ dependencies[msg] = null;
3927
3375
  depsJson[dep] = { from, version };
3928
3376
  }
3929
- if (!this.jsonEnabled())
3930
- tree.display();
3377
+ const tree = {
3378
+ [source_default.bold.cyan(plugin.name)]: {
3379
+ [`version ${plugin.version}`]: null,
3380
+ ...plugin.tag ? { [`tag ${plugin.tag}`]: null } : {},
3381
+ ...plugin.pjson.homepage ? { [`homepage ${plugin.pjson.homepage}`]: null } : {},
3382
+ [`location ${plugin.root}`]: null,
3383
+ commands: Object.fromEntries(sortBy(plugin.commandIDs, (c) => c).map((id) => [id, null])),
3384
+ dependencies
3385
+ }
3386
+ };
3387
+ this.log(lib_default(tree));
3931
3388
  return { ...plugin, deps: depsJson };
3932
3389
  }
3933
3390
  /* eslint-disable no-await-in-loop */
3934
3391
  async run() {
3935
3392
  const { argv, flags } = await this.parse(_PluginsInspect);
3936
- if (flags.verbose)
3937
- this.plugins.verbose = true;
3393
+ this.plugins = new Plugins({
3394
+ config: this.config,
3395
+ logLevel: determineLogLevel(this.config, flags, "silent")
3396
+ });
3938
3397
  const aliases = this.config.pjson.oclif.aliases ?? {};
3939
3398
  const plugins = [];
3940
3399
  for (let name of argv) {
@@ -3959,33 +3418,41 @@ var PluginsInspect = class _PluginsInspect extends import_core5.Command {
3959
3418
 
3960
3419
  // node_modules/@oclif/plugin-plugins/lib/commands/plugins/install.js
3961
3420
  init_cjs_shims();
3962
- var import_core6 = __toESM(require_lib(), 1);
3421
+ var import_core7 = __toESM(require_lib(), 1);
3963
3422
  var import_validate_npm_package_name = __toESM(require_lib2(), 1);
3964
- var PluginsInstall = class _PluginsInstall extends import_core6.Command {
3423
+ var PluginsInstall = class _PluginsInstall extends import_core7.Command {
3965
3424
  static aliases = ["plugins:add"];
3966
3425
  static args = {
3967
- plugin: import_core6.Args.string({ description: "Plugin to install.", required: true })
3426
+ plugin: import_core7.Args.string({ description: "Plugin to install.", required: true })
3968
3427
  };
3969
- static description = `Installs a plugin into the CLI.
3970
- Can be installed from npm or a git url.
3428
+ static description = `Uses bundled npm executable to install plugins into <%= config.dataDir %>
3971
3429
 
3972
3430
  Installation of a user-installed plugin will override a core plugin.
3973
3431
 
3974
- e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in the CLI without the need to patch and update the whole CLI.
3975
- `;
3432
+ Use the <%= config.scopedEnvVarKey('NPM_LOG_LEVEL') %> environment variable to set the npm loglevel.
3433
+ Use the <%= config.scopedEnvVarKey('NPM_REGISTRY') %> environment variable to set the npm registry.`;
3976
3434
  static enableJsonFlag = true;
3977
3435
  static examples = [
3978
- '<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> ',
3979
- "<%= config.bin %> <%= command.id %> https://github.com/someuser/someplugin",
3980
- "<%= config.bin %> <%= command.id %> someuser/someplugin"
3436
+ {
3437
+ command: '<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> ',
3438
+ description: "Install a plugin from npm registry."
3439
+ },
3440
+ {
3441
+ command: "<%= config.bin %> <%= command.id %> https://github.com/someuser/someplugin",
3442
+ description: "Install a plugin from a github url."
3443
+ },
3444
+ {
3445
+ command: "<%= config.bin %> <%= command.id %> someuser/someplugin",
3446
+ description: "Install a plugin from a github slug."
3447
+ }
3981
3448
  ];
3982
3449
  static flags = {
3983
- force: import_core6.Flags.boolean({
3450
+ force: import_core7.Flags.boolean({
3984
3451
  char: "f",
3985
- description: "Run yarn install with force flag."
3452
+ description: "Force npm to fetch remote resources even if a local copy exists on disk."
3986
3453
  }),
3987
- help: import_core6.Flags.help({ char: "h" }),
3988
- jit: import_core6.Flags.boolean({
3454
+ help: import_core7.Flags.help({ char: "h" }),
3455
+ jit: import_core7.Flags.boolean({
3989
3456
  hidden: true,
3990
3457
  async parse(input, ctx) {
3991
3458
  if (input === false || input === void 0)
@@ -3996,43 +3463,42 @@ e.g. If you have a core plugin that has a 'hello' command, installing a user-ins
3996
3463
  const jitPluginsConfig = ctx.config.pjson.oclif.jitPlugins ?? {};
3997
3464
  if (Object.keys(jitPluginsConfig).length === 0)
3998
3465
  return input;
3999
- const plugins = new Plugins(ctx.config);
3466
+ const plugins = new Plugins({ config: ctx.config });
4000
3467
  const nonJitPlugins = await Promise.all(requestedPlugins.map(async (plugin) => {
4001
3468
  const name = await plugins.maybeUnfriendlyName(plugin);
4002
3469
  return { jit: Boolean(jitPluginsConfig[name]), name };
4003
3470
  }));
4004
3471
  const nonJitPluginsNames = nonJitPlugins.filter((p) => !p.jit).map((p) => p.name);
4005
3472
  if (nonJitPluginsNames.length > 0) {
4006
- throw new import_core6.Errors.CLIError(`The following plugins are not JIT plugins: ${nonJitPluginsNames.join(", ")}`);
3473
+ throw new import_core7.Errors.CLIError(`The following plugins are not JIT plugins: ${nonJitPluginsNames.join(", ")}`);
4007
3474
  }
4008
3475
  return input;
4009
3476
  }
4010
3477
  }),
4011
- silent: import_core6.Flags.boolean({
3478
+ silent: import_core7.Flags.boolean({
4012
3479
  char: "s",
4013
- description: "Silences yarn output.",
3480
+ description: "Silences npm output.",
4014
3481
  exclusive: ["verbose"]
4015
3482
  }),
4016
- verbose: import_core6.Flags.boolean({
3483
+ verbose: import_core7.Flags.boolean({
4017
3484
  char: "v",
4018
- description: "Show verbose yarn output.",
3485
+ description: "Show verbose npm output.",
4019
3486
  exclusive: ["silent"]
4020
3487
  })
4021
3488
  };
4022
3489
  static strict = false;
4023
- static usage = "plugins:install PLUGIN...";
3490
+ static summary = "Installs a plugin into <%= config.bin %>.";
4024
3491
  flags;
4025
- plugins = new Plugins(this.config);
4026
3492
  // In this case we want these operations to happen
4027
3493
  // sequentially so the `no-await-in-loop` rule is ignored
4028
- async parsePlugin(input) {
3494
+ async parsePlugin(plugins, input) {
4029
3495
  if (input.startsWith("git+ssh://") || input.endsWith(".git")) {
4030
3496
  return { type: "repo", url: input };
4031
3497
  }
4032
3498
  const getNameAndTag = async (input2) => {
4033
3499
  const regexAtSymbolNotAtBeginning = /(?<!^)@/;
4034
3500
  const [splitName, tag2 = "latest"] = input2.split(regexAtSymbolNotAtBeginning);
4035
- const name2 = splitName.startsWith("@") ? splitName : await this.plugins.maybeUnfriendlyName(splitName);
3501
+ const name2 = splitName.startsWith("@") ? splitName : await plugins.maybeUnfriendlyName(splitName);
4036
3502
  validateNpmPkgName(name2);
4037
3503
  if (this.flags.jit) {
4038
3504
  const jitVersion = this.config.pjson.oclif?.jitPlugins?.[name2];
@@ -4061,55 +3527,51 @@ e.g. If you have a core plugin that has a 'hello' command, installing a user-ins
4061
3527
  async run() {
4062
3528
  const { argv, flags } = await this.parse(_PluginsInstall);
4063
3529
  this.flags = flags;
4064
- if (flags.verbose && !flags.silent)
4065
- this.plugins.verbose = true;
4066
- if (flags.silent && !flags.verbose)
4067
- this.plugins.silent = true;
3530
+ const plugins = new Plugins({
3531
+ config: this.config,
3532
+ logLevel: determineLogLevel(this.config, this.flags, "notice")
3533
+ });
4068
3534
  const aliases = this.config.pjson.oclif.aliases || {};
4069
3535
  for (let name of argv) {
4070
3536
  if (aliases[name] === null)
4071
3537
  this.error(`${name} is blocked`);
4072
3538
  name = aliases[name] || name;
4073
- const p = await this.parsePlugin(name);
3539
+ const p = await this.parsePlugin(plugins, name);
4074
3540
  let plugin;
4075
3541
  await this.config.runHook("plugins:preinstall", {
4076
3542
  plugin: p
4077
3543
  });
4078
3544
  try {
4079
3545
  if (p.type === "npm") {
4080
- import_core6.ux.action.start(`Installing plugin ${source_default.cyan(this.plugins.friendlyName(p.name) + "@" + p.tag)}`);
4081
- plugin = await this.plugins.install(p.name, {
3546
+ import_core7.ux.action.start(`${this.config.name}: Installing plugin ${source_default.cyan(plugins.friendlyName(p.name) + "@" + p.tag)}`);
3547
+ plugin = await plugins.install(p.name, {
4082
3548
  force: flags.force,
4083
3549
  tag: p.tag
4084
3550
  });
4085
3551
  } else {
4086
- import_core6.ux.action.start(`Installing plugin ${source_default.cyan(p.url)}`);
4087
- plugin = await this.plugins.install(p.url, { force: flags.force });
3552
+ import_core7.ux.action.start(`${this.config.name}: Installing plugin ${source_default.cyan(p.url)}`);
3553
+ plugin = await plugins.install(p.url, { force: flags.force });
4088
3554
  }
4089
3555
  } catch (error) {
4090
- import_core6.ux.action.stop(source_default.bold.red("failed"));
4091
- YarnMessagesCache.getInstance().flush(plugin);
3556
+ import_core7.ux.action.stop(source_default.bold.red("failed"));
4092
3557
  throw error;
4093
3558
  }
4094
- import_core6.ux.action.stop(`installed v${plugin.version}`);
4095
- YarnMessagesCache.getInstance().flush(plugin);
4096
- this.log(source_default.green(`
4097
- Successfully installed ${plugin.name} v${plugin.version}`));
3559
+ import_core7.ux.action.stop(`installed v${plugin.version}`);
4098
3560
  }
4099
3561
  }
4100
3562
  };
4101
3563
  function validateNpmPkgName(name) {
4102
3564
  if (!(0, import_validate_npm_package_name.default)(name).validForNewPackages) {
4103
- throw new import_core6.Errors.CLIError("Invalid npm package name.");
3565
+ throw new import_core7.Errors.CLIError("Invalid npm package name.");
4104
3566
  }
4105
3567
  }
4106
3568
 
4107
3569
  // node_modules/@oclif/plugin-plugins/lib/commands/plugins/link.js
4108
3570
  init_cjs_shims();
4109
- var import_core7 = __toESM(require_lib(), 1);
4110
- var PluginsLink = class _PluginsLink extends import_core7.Command {
3571
+ var import_core8 = __toESM(require_lib(), 1);
3572
+ var PluginsLink = class _PluginsLink extends import_core8.Command {
4111
3573
  static args = {
4112
- path: import_core7.Args.string({ default: ".", description: "path to plugin", name: "path", required: true })
3574
+ path: import_core8.Args.string({ default: ".", description: "path to plugin", name: "path", required: true })
4113
3575
  };
4114
3576
  static description = `Links a plugin into the CLI for development.
4115
3577
  Installation of a linked plugin will override a user-installed or core plugin.
@@ -4118,44 +3580,46 @@ e.g. If you have a user-installed or core plugin that has a 'hello' command, ins
4118
3580
  `;
4119
3581
  static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> '];
4120
3582
  static flags = {
4121
- help: import_core7.Flags.help({ char: "h" }),
4122
- install: import_core7.Flags.boolean({
3583
+ help: import_core8.Flags.help({ char: "h" }),
3584
+ install: import_core8.Flags.boolean({
4123
3585
  allowNo: true,
4124
3586
  default: true,
4125
3587
  description: "Install dependencies after linking the plugin."
4126
3588
  }),
4127
- verbose: import_core7.Flags.boolean({ char: "v" })
3589
+ verbose: import_core8.Flags.boolean({ char: "v" })
4128
3590
  };
4129
- static usage = "plugins:link PLUGIN";
4130
- plugins = new Plugins(this.config);
4131
3591
  async run() {
4132
3592
  const { args, flags } = await this.parse(_PluginsLink);
4133
- this.plugins.verbose = flags.verbose;
4134
- import_core7.ux.action.start(`Linking plugin ${source_default.cyan(args.path)}`);
4135
- await this.plugins.link(args.path, { install: flags.install });
4136
- import_core7.ux.action.stop();
4137
- YarnMessagesCache.getInstance().flush();
3593
+ const plugins = new Plugins({
3594
+ config: this.config,
3595
+ logLevel: determineLogLevel(this.config, flags, "silent")
3596
+ });
3597
+ import_core8.ux.action.start(`${this.config.name}: Linking plugin ${source_default.cyan(args.path)}`);
3598
+ await plugins.link(args.path, { install: flags.install });
3599
+ import_core8.ux.action.stop();
4138
3600
  }
4139
3601
  };
4140
3602
 
4141
3603
  // node_modules/@oclif/plugin-plugins/lib/commands/plugins/reset.js
4142
3604
  init_cjs_shims();
4143
- var import_core8 = __toESM(require_lib(), 1);
4144
- import { rm } from "node:fs/promises";
4145
- import { join as join5 } from "node:path";
4146
- var Reset = class _Reset extends import_core8.Command {
3605
+ var import_core9 = __toESM(require_lib(), 1);
3606
+ import { rm as rm2 } from "node:fs/promises";
3607
+ import { join as join4 } from "node:path";
3608
+ var Reset = class _Reset extends import_core9.Command {
4147
3609
  static flags = {
4148
- hard: import_core8.Flags.boolean({
3610
+ hard: import_core9.Flags.boolean({
4149
3611
  summary: "Delete node_modules and package manager related files in addition to uninstalling plugins."
4150
3612
  }),
4151
- reinstall: import_core8.Flags.boolean({
3613
+ reinstall: import_core9.Flags.boolean({
4152
3614
  summary: "Reinstall all plugins after uninstalling."
4153
3615
  })
4154
3616
  };
4155
3617
  static summary = "Remove all user-installed and linked plugins.";
4156
3618
  async run() {
4157
3619
  const { flags } = await this.parse(_Reset);
4158
- const plugins = new Plugins(this.config);
3620
+ const plugins = new Plugins({
3621
+ config: this.config
3622
+ });
4159
3623
  const userPlugins = await plugins.list();
4160
3624
  this.log(`Found ${userPlugins.length} plugin${userPlugins.length === 0 ? "" : "s"}:`);
4161
3625
  for (const plugin of userPlugins) {
@@ -4163,16 +3627,16 @@ var Reset = class _Reset extends import_core8.Command {
4163
3627
  }
4164
3628
  if (flags.hard) {
4165
3629
  const filesToDelete = [
4166
- join5(this.config.dataDir, "node_modules"),
4167
- join5(this.config.dataDir, "package.json"),
4168
- join5(this.config.dataDir, "yarn.lock"),
4169
- join5(this.config.dataDir, "package-lock.json")
3630
+ join4(this.config.dataDir, "node_modules"),
3631
+ join4(this.config.dataDir, "package.json"),
3632
+ join4(this.config.dataDir, "yarn.lock"),
3633
+ join4(this.config.dataDir, "package-lock.json")
4170
3634
  ];
4171
3635
  this.log("\u2705 Removed the following files:");
4172
3636
  for (const file of filesToDelete) {
4173
3637
  this.log(`- ${file}`);
4174
3638
  }
4175
- await Promise.all(filesToDelete.map((file) => rm(file, { force: true, recursive: true })));
3639
+ await Promise.all(filesToDelete.map((file) => rm2(file, { force: true, recursive: true })));
4176
3640
  for (const plugin of userPlugins) {
4177
3641
  this.log(`\u2705 ${plugin.type === "link" ? "Unlinked" : "Uninstalled"} ${plugin.name}`);
4178
3642
  }
@@ -4200,7 +3664,7 @@ var Reset = class _Reset extends import_core8.Command {
4200
3664
  }
4201
3665
  if (plugin.type === "user") {
4202
3666
  try {
4203
- const newPlugin = await plugins.install(plugin.name, { tag: plugin.tag });
3667
+ const newPlugin = plugin.url ? await plugins.install(plugin.url) : await plugins.install(plugin.name, { tag: plugin.tag });
4204
3668
  const newVersion = source_default.dim(`-> ${newPlugin.version}`);
4205
3669
  const tag = plugin.tag ? `@${plugin.tag}` : plugin.url ? ` (${plugin.url})` : "";
4206
3670
  this.log(`\u2705 Reinstalled ${plugin.name}${tag} ${newVersion}`);
@@ -4215,7 +3679,7 @@ var Reset = class _Reset extends import_core8.Command {
4215
3679
 
4216
3680
  // node_modules/@oclif/plugin-plugins/lib/commands/plugins/uninstall.js
4217
3681
  init_cjs_shims();
4218
- var import_core9 = __toESM(require_lib(), 1);
3682
+ var import_core10 = __toESM(require_lib(), 1);
4219
3683
  function removeTags(plugin) {
4220
3684
  if (plugin.includes("@")) {
4221
3685
  const chunked = plugin.split("@");
@@ -4227,33 +3691,31 @@ function removeTags(plugin) {
4227
3691
  }
4228
3692
  return plugin;
4229
3693
  }
4230
- var PluginsUninstall = class _PluginsUninstall extends import_core9.Command {
3694
+ var PluginsUninstall = class _PluginsUninstall extends import_core10.Command {
4231
3695
  static aliases = ["plugins:unlink", "plugins:remove"];
4232
3696
  static args = {
4233
- plugin: import_core9.Args.string({ description: "plugin to uninstall" })
3697
+ plugin: import_core10.Args.string({ description: "plugin to uninstall" })
4234
3698
  };
4235
3699
  static description = "Removes a plugin from the CLI.";
4236
3700
  static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %>'];
4237
3701
  static flags = {
4238
- help: import_core9.Flags.help({ char: "h" }),
4239
- verbose: import_core9.Flags.boolean({ char: "v" })
3702
+ help: import_core10.Flags.help({ char: "h" }),
3703
+ verbose: import_core10.Flags.boolean({ char: "v" })
4240
3704
  };
4241
3705
  static strict = false;
4242
- static usage = "plugins:uninstall PLUGIN...";
4243
- plugins = new Plugins(this.config);
4244
3706
  // In this case we want these operations to happen
4245
3707
  // sequentially so the `no-await-in-loop` rule is ignored
4246
3708
  async run() {
4247
3709
  const { argv, flags } = await this.parse(_PluginsUninstall);
4248
- this.plugins = new Plugins(this.config);
4249
- if (flags.verbose)
4250
- this.plugins.verbose = true;
3710
+ const plugins = new Plugins({
3711
+ config: this.config,
3712
+ logLevel: determineLogLevel(this.config, flags, "silent")
3713
+ });
4251
3714
  if (argv.length === 0)
4252
3715
  argv.push(".");
4253
3716
  for (const plugin of argv) {
4254
- const friendly = removeTags(this.plugins.friendlyName(plugin));
4255
- import_core9.ux.action.start(`Uninstalling ${friendly}`);
4256
- const unfriendly = await this.plugins.hasPlugin(removeTags(plugin));
3717
+ const friendly = removeTags(plugins.friendlyName(plugin));
3718
+ const unfriendly = await plugins.hasPlugin(removeTags(plugin));
4257
3719
  if (!unfriendly) {
4258
3720
  const p = this.config.getPluginsList().find((p2) => p2.name === plugin);
4259
3721
  if (p?.parent)
@@ -4262,41 +3724,45 @@ var PluginsUninstall = class _PluginsUninstall extends import_core9.Command {
4262
3724
  }
4263
3725
  try {
4264
3726
  const { name } = unfriendly;
4265
- await this.plugins.uninstall(name);
3727
+ const displayName = friendly === "." ? name : friendly ?? name;
3728
+ import_core10.ux.action.start(`${this.config.name}: Uninstalling ${displayName}`);
3729
+ await plugins.uninstall(name);
4266
3730
  } catch (error) {
4267
- import_core9.ux.action.stop(source_default.bold.red("failed"));
3731
+ import_core10.ux.action.stop(source_default.bold.red("failed"));
4268
3732
  throw error;
4269
3733
  }
4270
- import_core9.ux.action.stop();
4271
- YarnMessagesCache.getInstance().flush();
3734
+ import_core10.ux.action.stop();
4272
3735
  }
4273
3736
  }
4274
3737
  };
4275
3738
 
4276
3739
  // node_modules/@oclif/plugin-plugins/lib/commands/plugins/update.js
4277
3740
  init_cjs_shims();
4278
- var import_core10 = __toESM(require_lib(), 1);
4279
- var PluginsUpdate = class _PluginsUpdate extends import_core10.Command {
3741
+ var import_core11 = __toESM(require_lib(), 1);
3742
+ var PluginsUpdate = class _PluginsUpdate extends import_core11.Command {
4280
3743
  static description = "Update installed plugins.";
4281
3744
  static flags = {
4282
- help: import_core10.Flags.help({ char: "h" }),
4283
- verbose: import_core10.Flags.boolean({ char: "v" })
3745
+ help: import_core11.Flags.help({ char: "h" }),
3746
+ verbose: import_core11.Flags.boolean({ char: "v" })
4284
3747
  };
4285
- plugins = new Plugins(this.config);
4286
3748
  async run() {
4287
3749
  const { flags } = await this.parse(_PluginsUpdate);
4288
- this.plugins.verbose = flags.verbose;
4289
- import_core10.ux.action.start(`${this.config.name}: Updating plugins`);
4290
- await this.plugins.update();
4291
- import_core10.ux.action.stop();
4292
- YarnMessagesCache.getInstance().flush();
3750
+ const plugins = new Plugins({
3751
+ config: this.config,
3752
+ logLevel: determineLogLevel(this.config, flags, "silent")
3753
+ });
3754
+ import_core11.ux.action.start(`${this.config.name}: Updating plugins`);
3755
+ await plugins.update();
3756
+ import_core11.ux.action.stop();
4293
3757
  }
4294
3758
  };
4295
3759
 
4296
3760
  // node_modules/@oclif/plugin-plugins/lib/hooks/update.js
4297
3761
  init_cjs_shims();
4298
3762
  var update = async function() {
4299
- const plugins = new Plugins(this.config);
3763
+ const plugins = new Plugins({
3764
+ config: this.config
3765
+ });
4300
3766
  try {
4301
3767
  await plugins.update();
4302
3768
  } catch (error) {
@@ -4325,23 +3791,23 @@ init_cjs_shims();
4325
3791
 
4326
3792
  // node_modules/@oclif/plugin-test-esm-1/dist/commands/esm1.js
4327
3793
  init_cjs_shims();
4328
- var import_core11 = __toESM(require_lib(), 1);
4329
- var ESM1 = class _ESM1 extends import_core11.Command {
3794
+ var import_core12 = __toESM(require_lib(), 1);
3795
+ var ESM1 = class _ESM1 extends import_core12.Command {
4330
3796
  static flags = {
4331
- optionalString: import_core11.Flags.string(),
4332
- defaultString: import_core11.Flags.string({
3797
+ optionalString: import_core12.Flags.string(),
3798
+ defaultString: import_core12.Flags.string({
4333
3799
  default: "simple string default"
4334
3800
  }),
4335
- defaultFnString: import_core11.Flags.string({
3801
+ defaultFnString: import_core12.Flags.string({
4336
3802
  default: async () => "async fn default"
4337
3803
  })
4338
3804
  };
4339
3805
  static args = {
4340
- optionalArg: import_core11.Args.string(),
4341
- defaultArg: import_core11.Args.string({
3806
+ optionalArg: import_core12.Args.string(),
3807
+ defaultArg: import_core12.Args.string({
4342
3808
  default: "simple string default"
4343
3809
  }),
4344
- defaultFnArg: import_core11.Args.string({
3810
+ defaultFnArg: import_core12.Args.string({
4345
3811
  default: async () => "async fn default"
4346
3812
  })
4347
3813
  };
@@ -4380,7 +3846,7 @@ var COMMANDS = {
4380
3846
  "hello:world": World
4381
3847
  };
4382
3848
  async function run() {
4383
- await (0, import_core12.execute)({ dir: import.meta.url });
3849
+ await (0, import_core13.execute)({ dir: import.meta.url });
4384
3850
  }
4385
3851
  export {
4386
3852
  COMMANDS,