create-vue 2.1.0-beta → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/outfile.cjs +454 -2896
  2. package/package.json +6 -3
  3. package/template/base/.vscode/extensions.json +1 -1
  4. package/template/base/node_modules/.bin/terser +17 -0
  5. package/template/base/node_modules/.bin/vite +17 -0
  6. package/template/base/package.json +6 -5
  7. package/template/{code/default → base}/src/assets/base.css +0 -0
  8. package/template/{code/default → base}/src/assets/logo.svg +0 -0
  9. package/template/base/src/assets/main.css +35 -0
  10. package/template/base/vite.config.js +1 -1
  11. package/template/code/default/src/App.vue +5 -39
  12. package/template/code/router/src/App.vue +6 -40
  13. package/template/code/typescript-default/src/App.vue +5 -39
  14. package/template/code/typescript-router/src/App.vue +6 -40
  15. package/template/{code/default/cypress/integration/example.spec.js → config/cypress/cypress/e2e/example.cy.js} +0 -0
  16. package/template/config/cypress/cypress/{jsconfig.json → e2e/jsconfig.json} +1 -1
  17. package/template/config/cypress/cypress/support/commands.ts +37 -0
  18. package/template/config/cypress/cypress/support/{index.js → e2e.js} +0 -0
  19. package/template/config/cypress/cypress.config.js +8 -0
  20. package/template/config/cypress/cypress.config.ts +8 -0
  21. package/template/config/cypress/node_modules/.bin/cypress +17 -0
  22. package/template/config/cypress/node_modules/.bin/server-test +17 -0
  23. package/template/config/cypress/node_modules/.bin/start-server-and-test +17 -0
  24. package/template/config/cypress/node_modules/.bin/start-test +17 -0
  25. package/template/config/cypress/package.json +4 -9
  26. package/template/config/cypress-ct/cypress/support/component-index.html +12 -0
  27. package/template/config/cypress-ct/cypress/support/component.js +30 -0
  28. package/template/config/cypress-ct/cypress/support/component.ts +42 -0
  29. package/template/config/cypress-ct/cypress.config.js +15 -0
  30. package/template/config/cypress-ct/cypress.config.ts +15 -0
  31. package/template/config/cypress-ct/node_modules/.bin/cypress +17 -0
  32. package/template/config/cypress-ct/package.json +12 -0
  33. package/template/{code/typescript-default/src/components/__tests__/HelloWorld.spec.ts → config/cypress-ct/src/components/__tests__/HelloWorld.cy.js} +2 -3
  34. package/template/config/jsx/node_modules/.bin/vite +17 -0
  35. package/template/config/jsx/package.json +9 -0
  36. package/template/config/jsx/vite.config.js +23 -0
  37. package/template/config/pinia/package.json +2 -1
  38. package/template/config/router/package.json +1 -1
  39. package/template/config/typescript/node_modules/.bin/npm-run-all +17 -0
  40. package/template/config/typescript/node_modules/.bin/run-p +17 -0
  41. package/template/config/typescript/node_modules/.bin/run-s +17 -0
  42. package/template/config/typescript/node_modules/.bin/tsc +17 -0
  43. package/template/config/typescript/node_modules/.bin/tsserver +17 -0
  44. package/template/config/typescript/node_modules/.bin/vue-tsc +17 -0
  45. package/template/config/typescript/package.json +7 -5
  46. package/template/config/vitest/node_modules/.bin/vitest +17 -0
  47. package/template/config/vitest/package.json +14 -0
  48. package/template/config/vitest/src/components/__tests__/HelloWorld.spec.js +11 -0
  49. package/template/entry/default/src/main.js +2 -0
  50. package/template/entry/pinia/src/main.js +2 -0
  51. package/template/entry/router/src/main.js +2 -0
  52. package/template/entry/router-and-pinia/src/main.js +2 -0
  53. package/template/eslint/package.json +11 -0
  54. package/template/tsconfig/base/package.json +5 -0
  55. package/template/tsconfig/base/tsconfig.config.json +8 -0
  56. package/template/tsconfig/base/tsconfig.json +16 -0
  57. package/template/tsconfig/cypress/cypress/e2e/tsconfig.json +10 -0
  58. package/template/tsconfig/cypress-ct/tsconfig.app.json +12 -0
  59. package/template/tsconfig/cypress-ct/tsconfig.cypress-ct.json +8 -0
  60. package/template/tsconfig/cypress-ct/tsconfig.json +14 -0
  61. package/template/tsconfig/vitest/package.json +8 -0
  62. package/template/tsconfig/vitest/tsconfig.app.json +12 -0
  63. package/template/tsconfig/vitest/tsconfig.json +14 -0
  64. package/template/tsconfig/vitest/tsconfig.vitest.json +9 -0
  65. package/template/code/default/src/components/__tests__/HelloWorld.spec.js +0 -13
  66. package/template/code/router/cypress/integration/example.spec.js +0 -13
  67. package/template/code/router/src/assets/base.css +0 -74
  68. package/template/code/router/src/assets/logo.svg +0 -1
  69. package/template/code/router/src/components/__tests__/HelloWorld.spec.js +0 -13
  70. package/template/code/typescript-default/cypress/integration/example.spec.ts +0 -8
  71. package/template/code/typescript-default/src/assets/base.css +0 -74
  72. package/template/code/typescript-default/src/assets/logo.svg +0 -1
  73. package/template/code/typescript-router/cypress/integration/example.spec.ts +0 -13
  74. package/template/code/typescript-router/src/assets/base.css +0 -74
  75. package/template/code/typescript-router/src/assets/logo.svg +0 -1
  76. package/template/code/typescript-router/src/components/__tests__/HelloWorld.spec.ts +0 -13
  77. package/template/config/cypress/cypress/plugins/index.js +0 -28
  78. package/template/config/cypress/cypress.json +0 -7
  79. package/template/config/typescript/tsconfig.json +0 -24
package/outfile.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- /*! create-vue v2.1.0-beta | MIT */
2
+ /*! create-vue v2.2.0 | MIT */
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -318,2714 +318,8 @@ var require_kleur = __commonJS({
318
318
  }
319
319
  });
320
320
 
321
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js
322
- var require_action = __commonJS({
323
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js"(exports, module2) {
324
- "use strict";
325
- module2.exports = (key, isSelect) => {
326
- if (key.meta && key.name !== "escape")
327
- return;
328
- if (key.ctrl) {
329
- if (key.name === "a")
330
- return "first";
331
- if (key.name === "c")
332
- return "abort";
333
- if (key.name === "d")
334
- return "abort";
335
- if (key.name === "e")
336
- return "last";
337
- if (key.name === "g")
338
- return "reset";
339
- }
340
- if (isSelect) {
341
- if (key.name === "j")
342
- return "down";
343
- if (key.name === "k")
344
- return "up";
345
- }
346
- if (key.name === "return")
347
- return "submit";
348
- if (key.name === "enter")
349
- return "submit";
350
- if (key.name === "backspace")
351
- return "delete";
352
- if (key.name === "delete")
353
- return "deleteForward";
354
- if (key.name === "abort")
355
- return "abort";
356
- if (key.name === "escape")
357
- return "exit";
358
- if (key.name === "tab")
359
- return "next";
360
- if (key.name === "pagedown")
361
- return "nextPage";
362
- if (key.name === "pageup")
363
- return "prevPage";
364
- if (key.name === "home")
365
- return "home";
366
- if (key.name === "end")
367
- return "end";
368
- if (key.name === "up")
369
- return "up";
370
- if (key.name === "down")
371
- return "down";
372
- if (key.name === "right")
373
- return "right";
374
- if (key.name === "left")
375
- return "left";
376
- return false;
377
- };
378
- }
379
- });
380
-
381
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js
382
- var require_strip = __commonJS({
383
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js"(exports, module2) {
384
- "use strict";
385
- module2.exports = (str) => {
386
- const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");
387
- const RGX = new RegExp(pattern, "g");
388
- return typeof str === "string" ? str.replace(RGX, "") : str;
389
- };
390
- }
391
- });
392
-
393
- // node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
394
- var require_src = __commonJS({
395
- "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module2) {
396
- "use strict";
397
- var ESC = "\x1B";
398
- var CSI = `${ESC}[`;
399
- var beep = "\x07";
400
- var cursor = {
401
- to(x, y) {
402
- if (!y)
403
- return `${CSI}${x + 1}G`;
404
- return `${CSI}${y + 1};${x + 1}H`;
405
- },
406
- move(x, y) {
407
- let ret = "";
408
- if (x < 0)
409
- ret += `${CSI}${-x}D`;
410
- else if (x > 0)
411
- ret += `${CSI}${x}C`;
412
- if (y < 0)
413
- ret += `${CSI}${-y}A`;
414
- else if (y > 0)
415
- ret += `${CSI}${y}B`;
416
- return ret;
417
- },
418
- up: (count = 1) => `${CSI}${count}A`,
419
- down: (count = 1) => `${CSI}${count}B`,
420
- forward: (count = 1) => `${CSI}${count}C`,
421
- backward: (count = 1) => `${CSI}${count}D`,
422
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
423
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
424
- left: `${CSI}G`,
425
- hide: `${CSI}?25l`,
426
- show: `${CSI}?25h`,
427
- save: `${ESC}7`,
428
- restore: `${ESC}8`
429
- };
430
- var scroll = {
431
- up: (count = 1) => `${CSI}S`.repeat(count),
432
- down: (count = 1) => `${CSI}T`.repeat(count)
433
- };
434
- var erase = {
435
- screen: `${CSI}2J`,
436
- up: (count = 1) => `${CSI}1J`.repeat(count),
437
- down: (count = 1) => `${CSI}J`.repeat(count),
438
- line: `${CSI}2K`,
439
- lineEnd: `${CSI}K`,
440
- lineStart: `${CSI}1K`,
441
- lines(count) {
442
- let clear = "";
443
- for (let i = 0; i < count; i++)
444
- clear += this.line + (i < count - 1 ? cursor.up() : "");
445
- if (count)
446
- clear += cursor.left;
447
- return clear;
448
- }
449
- };
450
- module2.exports = { cursor, scroll, erase, beep };
451
- }
452
- });
453
-
454
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js
455
- var require_clear = __commonJS({
456
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js"(exports, module2) {
457
- "use strict";
458
- function _createForOfIteratorHelper(o, allowArrayLike) {
459
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
460
- if (!it) {
461
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
462
- if (it)
463
- o = it;
464
- var i = 0;
465
- var F = function F2() {
466
- };
467
- return { s: F, n: function n() {
468
- if (i >= o.length)
469
- return { done: true };
470
- return { done: false, value: o[i++] };
471
- }, e: function e(_e) {
472
- throw _e;
473
- }, f: F };
474
- }
475
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
476
- }
477
- var normalCompletion = true, didErr = false, err;
478
- return { s: function s() {
479
- it = it.call(o);
480
- }, n: function n() {
481
- var step = it.next();
482
- normalCompletion = step.done;
483
- return step;
484
- }, e: function e(_e2) {
485
- didErr = true;
486
- err = _e2;
487
- }, f: function f() {
488
- try {
489
- if (!normalCompletion && it.return != null)
490
- it.return();
491
- } finally {
492
- if (didErr)
493
- throw err;
494
- }
495
- } };
496
- }
497
- function _unsupportedIterableToArray(o, minLen) {
498
- if (!o)
499
- return;
500
- if (typeof o === "string")
501
- return _arrayLikeToArray(o, minLen);
502
- var n = Object.prototype.toString.call(o).slice(8, -1);
503
- if (n === "Object" && o.constructor)
504
- n = o.constructor.name;
505
- if (n === "Map" || n === "Set")
506
- return Array.from(o);
507
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
508
- return _arrayLikeToArray(o, minLen);
509
- }
510
- function _arrayLikeToArray(arr, len) {
511
- if (len == null || len > arr.length)
512
- len = arr.length;
513
- for (var i = 0, arr2 = new Array(len); i < len; i++)
514
- arr2[i] = arr[i];
515
- return arr2;
516
- }
517
- var strip = require_strip();
518
- var _require = require_src();
519
- var erase = _require.erase;
520
- var cursor = _require.cursor;
521
- var width = (str) => [...strip(str)].length;
522
- module2.exports = function(prompt, perLine) {
523
- if (!perLine)
524
- return erase.line + cursor.to(0);
525
- let rows = 0;
526
- const lines = prompt.split(/\r?\n/);
527
- var _iterator = _createForOfIteratorHelper(lines), _step;
528
- try {
529
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
530
- let line = _step.value;
531
- rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);
532
- }
533
- } catch (err) {
534
- _iterator.e(err);
535
- } finally {
536
- _iterator.f();
537
- }
538
- return erase.lines(rows);
539
- };
540
- }
541
- });
542
-
543
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js
544
- var require_figures = __commonJS({
545
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js"(exports, module2) {
546
- "use strict";
547
- var main = {
548
- arrowUp: "\u2191",
549
- arrowDown: "\u2193",
550
- arrowLeft: "\u2190",
551
- arrowRight: "\u2192",
552
- radioOn: "\u25C9",
553
- radioOff: "\u25EF",
554
- tick: "\u2714",
555
- cross: "\u2716",
556
- ellipsis: "\u2026",
557
- pointerSmall: "\u203A",
558
- line: "\u2500",
559
- pointer: "\u276F"
560
- };
561
- var win = {
562
- arrowUp: main.arrowUp,
563
- arrowDown: main.arrowDown,
564
- arrowLeft: main.arrowLeft,
565
- arrowRight: main.arrowRight,
566
- radioOn: "(*)",
567
- radioOff: "( )",
568
- tick: "\u221A",
569
- cross: "\xD7",
570
- ellipsis: "...",
571
- pointerSmall: "\xBB",
572
- line: "\u2500",
573
- pointer: ">"
574
- };
575
- var figures = process.platform === "win32" ? win : main;
576
- module2.exports = figures;
577
- }
578
- });
579
-
580
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js
581
- var require_style = __commonJS({
582
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js"(exports, module2) {
583
- "use strict";
584
- var c = require_kleur();
585
- var figures = require_figures();
586
- var styles = Object.freeze({
587
- password: {
588
- scale: 1,
589
- render: (input) => "*".repeat(input.length)
590
- },
591
- emoji: {
592
- scale: 2,
593
- render: (input) => "\u{1F603}".repeat(input.length)
594
- },
595
- invisible: {
596
- scale: 0,
597
- render: (input) => ""
598
- },
599
- default: {
600
- scale: 1,
601
- render: (input) => `${input}`
602
- }
603
- });
604
- var render = (type) => styles[type] || styles.default;
605
- var symbols = Object.freeze({
606
- aborted: c.red(figures.cross),
607
- done: c.green(figures.tick),
608
- exited: c.yellow(figures.cross),
609
- default: c.cyan("?")
610
- });
611
- var symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;
612
- var delimiter = (completing) => c.gray(completing ? figures.ellipsis : figures.pointerSmall);
613
- var item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line);
614
- module2.exports = {
615
- styles,
616
- render,
617
- symbols,
618
- symbol,
619
- delimiter,
620
- item
621
- };
622
- }
623
- });
624
-
625
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js
626
- var require_lines = __commonJS({
627
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js"(exports, module2) {
628
- "use strict";
629
- var strip = require_strip();
630
- module2.exports = function(msg, perLine) {
631
- let lines = String(strip(msg) || "").split(/\r?\n/);
632
- if (!perLine)
633
- return lines.length;
634
- return lines.map((l) => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);
635
- };
636
- }
637
- });
638
-
639
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js
640
- var require_wrap = __commonJS({
641
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js"(exports, module2) {
642
- "use strict";
643
- module2.exports = (msg, opts = {}) => {
644
- const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(" ").join("") : opts.margin || "";
645
- const width = opts.width;
646
- return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w) => {
647
- if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width)
648
- arr[arr.length - 1] += ` ${w}`;
649
- else
650
- arr.push(`${tab}${w}`);
651
- return arr;
652
- }, [tab]).join("\n")).join("\n");
653
- };
654
- }
655
- });
656
-
657
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js
658
- var require_entriesToDisplay = __commonJS({
659
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js"(exports, module2) {
660
- "use strict";
661
- module2.exports = (cursor, total, maxVisible) => {
662
- maxVisible = maxVisible || total;
663
- let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));
664
- if (startIndex < 0)
665
- startIndex = 0;
666
- let endIndex = Math.min(startIndex + maxVisible, total);
667
- return {
668
- startIndex,
669
- endIndex
670
- };
671
- };
672
- }
673
- });
674
-
675
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js
676
- var require_util = __commonJS({
677
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js"(exports, module2) {
678
- "use strict";
679
- module2.exports = {
680
- action: require_action(),
681
- clear: require_clear(),
682
- style: require_style(),
683
- strip: require_strip(),
684
- figures: require_figures(),
685
- lines: require_lines(),
686
- wrap: require_wrap(),
687
- entriesToDisplay: require_entriesToDisplay()
688
- };
689
- }
690
- });
691
-
692
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js
693
- var require_prompt = __commonJS({
694
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js"(exports, module2) {
695
- "use strict";
696
- var readline = require("readline");
697
- var _require = require_util();
698
- var action = _require.action;
699
- var EventEmitter = require("events");
700
- var _require2 = require_src();
701
- var beep = _require2.beep;
702
- var cursor = _require2.cursor;
703
- var color = require_kleur();
704
- var Prompt = class extends EventEmitter {
705
- constructor(opts = {}) {
706
- super();
707
- this.firstRender = true;
708
- this.in = opts.stdin || process.stdin;
709
- this.out = opts.stdout || process.stdout;
710
- this.onRender = (opts.onRender || (() => void 0)).bind(this);
711
- const rl = readline.createInterface({
712
- input: this.in,
713
- escapeCodeTimeout: 50
714
- });
715
- readline.emitKeypressEvents(this.in, rl);
716
- if (this.in.isTTY)
717
- this.in.setRawMode(true);
718
- const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
719
- const keypress = (str, key) => {
720
- let a = action(key, isSelect);
721
- if (a === false) {
722
- this._ && this._(str, key);
723
- } else if (typeof this[a] === "function") {
724
- this[a](key);
725
- } else {
726
- this.bell();
727
- }
728
- };
729
- this.close = () => {
730
- this.out.write(cursor.show);
731
- this.in.removeListener("keypress", keypress);
732
- if (this.in.isTTY)
733
- this.in.setRawMode(false);
734
- rl.close();
735
- this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value);
736
- this.closed = true;
737
- };
738
- this.in.on("keypress", keypress);
739
- }
740
- fire() {
741
- this.emit("state", {
742
- value: this.value,
743
- aborted: !!this.aborted,
744
- exited: !!this.exited
745
- });
746
- }
747
- bell() {
748
- this.out.write(beep);
749
- }
750
- render() {
751
- this.onRender(color);
752
- if (this.firstRender)
753
- this.firstRender = false;
754
- }
755
- };
756
- module2.exports = Prompt;
757
- }
758
- });
759
-
760
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js
761
- var require_text = __commonJS({
762
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js"(exports, module2) {
763
- "use strict";
764
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
765
- try {
766
- var info = gen[key](arg);
767
- var value = info.value;
768
- } catch (error) {
769
- reject(error);
770
- return;
771
- }
772
- if (info.done) {
773
- resolve(value);
774
- } else {
775
- Promise.resolve(value).then(_next, _throw);
776
- }
777
- }
778
- function _asyncToGenerator(fn) {
779
- return function() {
780
- var self2 = this, args = arguments;
781
- return new Promise(function(resolve, reject) {
782
- var gen = fn.apply(self2, args);
783
- function _next(value) {
784
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
785
- }
786
- function _throw(err) {
787
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
788
- }
789
- _next(void 0);
790
- });
791
- };
792
- }
793
- var color = require_kleur();
794
- var Prompt = require_prompt();
795
- var _require = require_src();
796
- var erase = _require.erase;
797
- var cursor = _require.cursor;
798
- var _require2 = require_util();
799
- var style = _require2.style;
800
- var clear = _require2.clear;
801
- var lines = _require2.lines;
802
- var figures = _require2.figures;
803
- var TextPrompt = class extends Prompt {
804
- constructor(opts = {}) {
805
- super(opts);
806
- this.transform = style.render(opts.style);
807
- this.scale = this.transform.scale;
808
- this.msg = opts.message;
809
- this.initial = opts.initial || ``;
810
- this.validator = opts.validate || (() => true);
811
- this.value = ``;
812
- this.errorMsg = opts.error || `Please Enter A Valid Value`;
813
- this.cursor = Number(!!this.initial);
814
- this.cursorOffset = 0;
815
- this.clear = clear(``, this.out.columns);
816
- this.render();
817
- }
818
- set value(v) {
819
- if (!v && this.initial) {
820
- this.placeholder = true;
821
- this.rendered = color.gray(this.transform.render(this.initial));
822
- } else {
823
- this.placeholder = false;
824
- this.rendered = this.transform.render(v);
825
- }
826
- this._value = v;
827
- this.fire();
828
- }
829
- get value() {
830
- return this._value;
831
- }
832
- reset() {
833
- this.value = ``;
834
- this.cursor = Number(!!this.initial);
835
- this.cursorOffset = 0;
836
- this.fire();
837
- this.render();
838
- }
839
- exit() {
840
- this.abort();
841
- }
842
- abort() {
843
- this.value = this.value || this.initial;
844
- this.done = this.aborted = true;
845
- this.error = false;
846
- this.red = false;
847
- this.fire();
848
- this.render();
849
- this.out.write("\n");
850
- this.close();
851
- }
852
- validate() {
853
- var _this = this;
854
- return _asyncToGenerator(function* () {
855
- let valid = yield _this.validator(_this.value);
856
- if (typeof valid === `string`) {
857
- _this.errorMsg = valid;
858
- valid = false;
859
- }
860
- _this.error = !valid;
861
- })();
862
- }
863
- submit() {
864
- var _this2 = this;
865
- return _asyncToGenerator(function* () {
866
- _this2.value = _this2.value || _this2.initial;
867
- _this2.cursorOffset = 0;
868
- _this2.cursor = _this2.rendered.length;
869
- yield _this2.validate();
870
- if (_this2.error) {
871
- _this2.red = true;
872
- _this2.fire();
873
- _this2.render();
874
- return;
875
- }
876
- _this2.done = true;
877
- _this2.aborted = false;
878
- _this2.fire();
879
- _this2.render();
880
- _this2.out.write("\n");
881
- _this2.close();
882
- })();
883
- }
884
- next() {
885
- if (!this.placeholder)
886
- return this.bell();
887
- this.value = this.initial;
888
- this.cursor = this.rendered.length;
889
- this.fire();
890
- this.render();
891
- }
892
- moveCursor(n) {
893
- if (this.placeholder)
894
- return;
895
- this.cursor = this.cursor + n;
896
- this.cursorOffset += n;
897
- }
898
- _(c, key) {
899
- let s1 = this.value.slice(0, this.cursor);
900
- let s2 = this.value.slice(this.cursor);
901
- this.value = `${s1}${c}${s2}`;
902
- this.red = false;
903
- this.cursor = this.placeholder ? 0 : s1.length + 1;
904
- this.render();
905
- }
906
- delete() {
907
- if (this.isCursorAtStart())
908
- return this.bell();
909
- let s1 = this.value.slice(0, this.cursor - 1);
910
- let s2 = this.value.slice(this.cursor);
911
- this.value = `${s1}${s2}`;
912
- this.red = false;
913
- if (this.isCursorAtStart()) {
914
- this.cursorOffset = 0;
915
- } else {
916
- this.cursorOffset++;
917
- this.moveCursor(-1);
918
- }
919
- this.render();
920
- }
921
- deleteForward() {
922
- if (this.cursor * this.scale >= this.rendered.length || this.placeholder)
923
- return this.bell();
924
- let s1 = this.value.slice(0, this.cursor);
925
- let s2 = this.value.slice(this.cursor + 1);
926
- this.value = `${s1}${s2}`;
927
- this.red = false;
928
- if (this.isCursorAtEnd()) {
929
- this.cursorOffset = 0;
930
- } else {
931
- this.cursorOffset++;
932
- }
933
- this.render();
934
- }
935
- first() {
936
- this.cursor = 0;
937
- this.render();
938
- }
939
- last() {
940
- this.cursor = this.value.length;
941
- this.render();
942
- }
943
- left() {
944
- if (this.cursor <= 0 || this.placeholder)
945
- return this.bell();
946
- this.moveCursor(-1);
947
- this.render();
948
- }
949
- right() {
950
- if (this.cursor * this.scale >= this.rendered.length || this.placeholder)
951
- return this.bell();
952
- this.moveCursor(1);
953
- this.render();
954
- }
955
- isCursorAtStart() {
956
- return this.cursor === 0 || this.placeholder && this.cursor === 1;
957
- }
958
- isCursorAtEnd() {
959
- return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;
960
- }
961
- render() {
962
- if (this.closed)
963
- return;
964
- if (!this.firstRender) {
965
- if (this.outputError)
966
- this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
967
- this.out.write(clear(this.outputText, this.out.columns));
968
- }
969
- super.render();
970
- this.outputError = "";
971
- this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.red ? color.red(this.rendered) : this.rendered].join(` `);
972
- if (this.error) {
973
- this.outputError += this.errorMsg.split(`
974
- `).reduce((a, l, i) => a + `
975
- ${i ? " " : figures.pointerSmall} ${color.red().italic(l)}`, ``);
976
- }
977
- this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));
978
- }
979
- };
980
- module2.exports = TextPrompt;
981
- }
982
- });
983
-
984
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js
985
- var require_select = __commonJS({
986
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js"(exports, module2) {
987
- "use strict";
988
- var color = require_kleur();
989
- var Prompt = require_prompt();
990
- var _require = require_util();
991
- var style = _require.style;
992
- var clear = _require.clear;
993
- var figures = _require.figures;
994
- var wrap = _require.wrap;
995
- var entriesToDisplay = _require.entriesToDisplay;
996
- var _require2 = require_src();
997
- var cursor = _require2.cursor;
998
- var SelectPrompt = class extends Prompt {
999
- constructor(opts = {}) {
1000
- super(opts);
1001
- this.msg = opts.message;
1002
- this.hint = opts.hint || "- Use arrow-keys. Return to submit.";
1003
- this.warn = opts.warn || "- This option is disabled";
1004
- this.cursor = opts.initial || 0;
1005
- this.choices = opts.choices.map((ch, idx) => {
1006
- if (typeof ch === "string")
1007
- ch = {
1008
- title: ch,
1009
- value: idx
1010
- };
1011
- return {
1012
- title: ch && (ch.title || ch.value || ch),
1013
- value: ch && (ch.value === void 0 ? idx : ch.value),
1014
- description: ch && ch.description,
1015
- selected: ch && ch.selected,
1016
- disabled: ch && ch.disabled
1017
- };
1018
- });
1019
- this.optionsPerPage = opts.optionsPerPage || 10;
1020
- this.value = (this.choices[this.cursor] || {}).value;
1021
- this.clear = clear("", this.out.columns);
1022
- this.render();
1023
- }
1024
- moveCursor(n) {
1025
- this.cursor = n;
1026
- this.value = this.choices[n].value;
1027
- this.fire();
1028
- }
1029
- reset() {
1030
- this.moveCursor(0);
1031
- this.fire();
1032
- this.render();
1033
- }
1034
- exit() {
1035
- this.abort();
1036
- }
1037
- abort() {
1038
- this.done = this.aborted = true;
1039
- this.fire();
1040
- this.render();
1041
- this.out.write("\n");
1042
- this.close();
1043
- }
1044
- submit() {
1045
- if (!this.selection.disabled) {
1046
- this.done = true;
1047
- this.aborted = false;
1048
- this.fire();
1049
- this.render();
1050
- this.out.write("\n");
1051
- this.close();
1052
- } else
1053
- this.bell();
1054
- }
1055
- first() {
1056
- this.moveCursor(0);
1057
- this.render();
1058
- }
1059
- last() {
1060
- this.moveCursor(this.choices.length - 1);
1061
- this.render();
1062
- }
1063
- up() {
1064
- if (this.cursor === 0) {
1065
- this.moveCursor(this.choices.length - 1);
1066
- } else {
1067
- this.moveCursor(this.cursor - 1);
1068
- }
1069
- this.render();
1070
- }
1071
- down() {
1072
- if (this.cursor === this.choices.length - 1) {
1073
- this.moveCursor(0);
1074
- } else {
1075
- this.moveCursor(this.cursor + 1);
1076
- }
1077
- this.render();
1078
- }
1079
- next() {
1080
- this.moveCursor((this.cursor + 1) % this.choices.length);
1081
- this.render();
1082
- }
1083
- _(c, key) {
1084
- if (c === " ")
1085
- return this.submit();
1086
- }
1087
- get selection() {
1088
- return this.choices[this.cursor];
1089
- }
1090
- render() {
1091
- if (this.closed)
1092
- return;
1093
- if (this.firstRender)
1094
- this.out.write(cursor.hide);
1095
- else
1096
- this.out.write(clear(this.outputText, this.out.columns));
1097
- super.render();
1098
- let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
1099
- this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)].join(" ");
1100
- if (!this.done) {
1101
- this.outputText += "\n";
1102
- for (let i = startIndex; i < endIndex; i++) {
1103
- let title, prefix, desc = "", v = this.choices[i];
1104
- if (i === startIndex && startIndex > 0) {
1105
- prefix = figures.arrowUp;
1106
- } else if (i === endIndex - 1 && endIndex < this.choices.length) {
1107
- prefix = figures.arrowDown;
1108
- } else {
1109
- prefix = " ";
1110
- }
1111
- if (v.disabled) {
1112
- title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
1113
- prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + " " : " ") + prefix;
1114
- } else {
1115
- title = this.cursor === i ? color.cyan().underline(v.title) : v.title;
1116
- prefix = (this.cursor === i ? color.cyan(figures.pointer) + " " : " ") + prefix;
1117
- if (v.description && this.cursor === i) {
1118
- desc = ` - ${v.description}`;
1119
- if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
1120
- desc = "\n" + wrap(v.description, {
1121
- margin: 3,
1122
- width: this.out.columns
1123
- });
1124
- }
1125
- }
1126
- }
1127
- this.outputText += `${prefix} ${title}${color.gray(desc)}
1128
- `;
1129
- }
1130
- }
1131
- this.out.write(this.outputText);
1132
- }
1133
- };
1134
- module2.exports = SelectPrompt;
1135
- }
1136
- });
1137
-
1138
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js
1139
- var require_toggle = __commonJS({
1140
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js"(exports, module2) {
1141
- "use strict";
1142
- var color = require_kleur();
1143
- var Prompt = require_prompt();
1144
- var _require = require_util();
1145
- var style = _require.style;
1146
- var clear = _require.clear;
1147
- var _require2 = require_src();
1148
- var cursor = _require2.cursor;
1149
- var erase = _require2.erase;
1150
- var TogglePrompt = class extends Prompt {
1151
- constructor(opts = {}) {
1152
- super(opts);
1153
- this.msg = opts.message;
1154
- this.value = !!opts.initial;
1155
- this.active = opts.active || "on";
1156
- this.inactive = opts.inactive || "off";
1157
- this.initialValue = this.value;
1158
- this.render();
1159
- }
1160
- reset() {
1161
- this.value = this.initialValue;
1162
- this.fire();
1163
- this.render();
1164
- }
1165
- exit() {
1166
- this.abort();
1167
- }
1168
- abort() {
1169
- this.done = this.aborted = true;
1170
- this.fire();
1171
- this.render();
1172
- this.out.write("\n");
1173
- this.close();
1174
- }
1175
- submit() {
1176
- this.done = true;
1177
- this.aborted = false;
1178
- this.fire();
1179
- this.render();
1180
- this.out.write("\n");
1181
- this.close();
1182
- }
1183
- deactivate() {
1184
- if (this.value === false)
1185
- return this.bell();
1186
- this.value = false;
1187
- this.render();
1188
- }
1189
- activate() {
1190
- if (this.value === true)
1191
- return this.bell();
1192
- this.value = true;
1193
- this.render();
1194
- }
1195
- delete() {
1196
- this.deactivate();
1197
- }
1198
- left() {
1199
- this.deactivate();
1200
- }
1201
- right() {
1202
- this.activate();
1203
- }
1204
- down() {
1205
- this.deactivate();
1206
- }
1207
- up() {
1208
- this.activate();
1209
- }
1210
- next() {
1211
- this.value = !this.value;
1212
- this.fire();
1213
- this.render();
1214
- }
1215
- _(c, key) {
1216
- if (c === " ") {
1217
- this.value = !this.value;
1218
- } else if (c === "1") {
1219
- this.value = true;
1220
- } else if (c === "0") {
1221
- this.value = false;
1222
- } else
1223
- return this.bell();
1224
- this.render();
1225
- }
1226
- render() {
1227
- if (this.closed)
1228
- return;
1229
- if (this.firstRender)
1230
- this.out.write(cursor.hide);
1231
- else
1232
- this.out.write(clear(this.outputText, this.out.columns));
1233
- super.render();
1234
- this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color.cyan().underline(this.inactive), color.gray("/"), this.value ? color.cyan().underline(this.active) : this.active].join(" ");
1235
- this.out.write(erase.line + cursor.to(0) + this.outputText);
1236
- }
1237
- };
1238
- module2.exports = TogglePrompt;
1239
- }
1240
- });
1241
-
1242
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js
1243
- var require_datepart = __commonJS({
1244
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js"(exports, module2) {
1245
- "use strict";
1246
- var DatePart = class {
1247
- constructor({
1248
- token,
1249
- date,
1250
- parts,
1251
- locales
1252
- }) {
1253
- this.token = token;
1254
- this.date = date || new Date();
1255
- this.parts = parts || [this];
1256
- this.locales = locales || {};
1257
- }
1258
- up() {
1259
- }
1260
- down() {
1261
- }
1262
- next() {
1263
- const currentIdx = this.parts.indexOf(this);
1264
- return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
1265
- }
1266
- setTo(val) {
1267
- }
1268
- prev() {
1269
- let parts = [].concat(this.parts).reverse();
1270
- const currentIdx = parts.indexOf(this);
1271
- return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
1272
- }
1273
- toString() {
1274
- return String(this.date);
1275
- }
1276
- };
1277
- module2.exports = DatePart;
1278
- }
1279
- });
1280
-
1281
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js
1282
- var require_meridiem = __commonJS({
1283
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js"(exports, module2) {
1284
- "use strict";
1285
- var DatePart = require_datepart();
1286
- var Meridiem = class extends DatePart {
1287
- constructor(opts = {}) {
1288
- super(opts);
1289
- }
1290
- up() {
1291
- this.date.setHours((this.date.getHours() + 12) % 24);
1292
- }
1293
- down() {
1294
- this.up();
1295
- }
1296
- toString() {
1297
- let meridiem = this.date.getHours() > 12 ? "pm" : "am";
1298
- return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
1299
- }
1300
- };
1301
- module2.exports = Meridiem;
1302
- }
1303
- });
1304
-
1305
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js
1306
- var require_day = __commonJS({
1307
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js"(exports, module2) {
1308
- "use strict";
1309
- var DatePart = require_datepart();
1310
- var pos = (n) => {
1311
- n = n % 10;
1312
- return n === 1 ? "st" : n === 2 ? "nd" : n === 3 ? "rd" : "th";
1313
- };
1314
- var Day = class extends DatePart {
1315
- constructor(opts = {}) {
1316
- super(opts);
1317
- }
1318
- up() {
1319
- this.date.setDate(this.date.getDate() + 1);
1320
- }
1321
- down() {
1322
- this.date.setDate(this.date.getDate() - 1);
1323
- }
1324
- setTo(val) {
1325
- this.date.setDate(parseInt(val.substr(-2)));
1326
- }
1327
- toString() {
1328
- let date = this.date.getDate();
1329
- let day = this.date.getDay();
1330
- return this.token === "DD" ? String(date).padStart(2, "0") : this.token === "Do" ? date + pos(date) : this.token === "d" ? day + 1 : this.token === "ddd" ? this.locales.weekdaysShort[day] : this.token === "dddd" ? this.locales.weekdays[day] : date;
1331
- }
1332
- };
1333
- module2.exports = Day;
1334
- }
1335
- });
1336
-
1337
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js
1338
- var require_hours = __commonJS({
1339
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js"(exports, module2) {
1340
- "use strict";
1341
- var DatePart = require_datepart();
1342
- var Hours = class extends DatePart {
1343
- constructor(opts = {}) {
1344
- super(opts);
1345
- }
1346
- up() {
1347
- this.date.setHours(this.date.getHours() + 1);
1348
- }
1349
- down() {
1350
- this.date.setHours(this.date.getHours() - 1);
1351
- }
1352
- setTo(val) {
1353
- this.date.setHours(parseInt(val.substr(-2)));
1354
- }
1355
- toString() {
1356
- let hours = this.date.getHours();
1357
- if (/h/.test(this.token))
1358
- hours = hours % 12 || 12;
1359
- return this.token.length > 1 ? String(hours).padStart(2, "0") : hours;
1360
- }
1361
- };
1362
- module2.exports = Hours;
1363
- }
1364
- });
1365
-
1366
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js
1367
- var require_milliseconds = __commonJS({
1368
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js"(exports, module2) {
1369
- "use strict";
1370
- var DatePart = require_datepart();
1371
- var Milliseconds = class extends DatePart {
1372
- constructor(opts = {}) {
1373
- super(opts);
1374
- }
1375
- up() {
1376
- this.date.setMilliseconds(this.date.getMilliseconds() + 1);
1377
- }
1378
- down() {
1379
- this.date.setMilliseconds(this.date.getMilliseconds() - 1);
1380
- }
1381
- setTo(val) {
1382
- this.date.setMilliseconds(parseInt(val.substr(-this.token.length)));
1383
- }
1384
- toString() {
1385
- return String(this.date.getMilliseconds()).padStart(4, "0").substr(0, this.token.length);
1386
- }
1387
- };
1388
- module2.exports = Milliseconds;
1389
- }
1390
- });
1391
-
1392
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js
1393
- var require_minutes = __commonJS({
1394
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js"(exports, module2) {
1395
- "use strict";
1396
- var DatePart = require_datepart();
1397
- var Minutes = class extends DatePart {
1398
- constructor(opts = {}) {
1399
- super(opts);
1400
- }
1401
- up() {
1402
- this.date.setMinutes(this.date.getMinutes() + 1);
1403
- }
1404
- down() {
1405
- this.date.setMinutes(this.date.getMinutes() - 1);
1406
- }
1407
- setTo(val) {
1408
- this.date.setMinutes(parseInt(val.substr(-2)));
1409
- }
1410
- toString() {
1411
- let m = this.date.getMinutes();
1412
- return this.token.length > 1 ? String(m).padStart(2, "0") : m;
1413
- }
1414
- };
1415
- module2.exports = Minutes;
1416
- }
1417
- });
1418
-
1419
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js
1420
- var require_month = __commonJS({
1421
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js"(exports, module2) {
1422
- "use strict";
1423
- var DatePart = require_datepart();
1424
- var Month = class extends DatePart {
1425
- constructor(opts = {}) {
1426
- super(opts);
1427
- }
1428
- up() {
1429
- this.date.setMonth(this.date.getMonth() + 1);
1430
- }
1431
- down() {
1432
- this.date.setMonth(this.date.getMonth() - 1);
1433
- }
1434
- setTo(val) {
1435
- val = parseInt(val.substr(-2)) - 1;
1436
- this.date.setMonth(val < 0 ? 0 : val);
1437
- }
1438
- toString() {
1439
- let month = this.date.getMonth();
1440
- let tl = this.token.length;
1441
- return tl === 2 ? String(month + 1).padStart(2, "0") : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1);
1442
- }
1443
- };
1444
- module2.exports = Month;
1445
- }
1446
- });
1447
-
1448
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js
1449
- var require_seconds = __commonJS({
1450
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js"(exports, module2) {
1451
- "use strict";
1452
- var DatePart = require_datepart();
1453
- var Seconds = class extends DatePart {
1454
- constructor(opts = {}) {
1455
- super(opts);
1456
- }
1457
- up() {
1458
- this.date.setSeconds(this.date.getSeconds() + 1);
1459
- }
1460
- down() {
1461
- this.date.setSeconds(this.date.getSeconds() - 1);
1462
- }
1463
- setTo(val) {
1464
- this.date.setSeconds(parseInt(val.substr(-2)));
1465
- }
1466
- toString() {
1467
- let s = this.date.getSeconds();
1468
- return this.token.length > 1 ? String(s).padStart(2, "0") : s;
1469
- }
1470
- };
1471
- module2.exports = Seconds;
1472
- }
1473
- });
1474
-
1475
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js
1476
- var require_year = __commonJS({
1477
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js"(exports, module2) {
1478
- "use strict";
1479
- var DatePart = require_datepart();
1480
- var Year = class extends DatePart {
1481
- constructor(opts = {}) {
1482
- super(opts);
1483
- }
1484
- up() {
1485
- this.date.setFullYear(this.date.getFullYear() + 1);
1486
- }
1487
- down() {
1488
- this.date.setFullYear(this.date.getFullYear() - 1);
1489
- }
1490
- setTo(val) {
1491
- this.date.setFullYear(val.substr(-4));
1492
- }
1493
- toString() {
1494
- let year = String(this.date.getFullYear()).padStart(4, "0");
1495
- return this.token.length === 2 ? year.substr(-2) : year;
1496
- }
1497
- };
1498
- module2.exports = Year;
1499
- }
1500
- });
1501
-
1502
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js
1503
- var require_dateparts = __commonJS({
1504
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js"(exports, module2) {
1505
- "use strict";
1506
- module2.exports = {
1507
- DatePart: require_datepart(),
1508
- Meridiem: require_meridiem(),
1509
- Day: require_day(),
1510
- Hours: require_hours(),
1511
- Milliseconds: require_milliseconds(),
1512
- Minutes: require_minutes(),
1513
- Month: require_month(),
1514
- Seconds: require_seconds(),
1515
- Year: require_year()
1516
- };
1517
- }
1518
- });
1519
-
1520
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js
1521
- var require_date = __commonJS({
1522
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js"(exports, module2) {
1523
- "use strict";
1524
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1525
- try {
1526
- var info = gen[key](arg);
1527
- var value = info.value;
1528
- } catch (error) {
1529
- reject(error);
1530
- return;
1531
- }
1532
- if (info.done) {
1533
- resolve(value);
1534
- } else {
1535
- Promise.resolve(value).then(_next, _throw);
1536
- }
1537
- }
1538
- function _asyncToGenerator(fn) {
1539
- return function() {
1540
- var self2 = this, args = arguments;
1541
- return new Promise(function(resolve, reject) {
1542
- var gen = fn.apply(self2, args);
1543
- function _next(value) {
1544
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1545
- }
1546
- function _throw(err) {
1547
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1548
- }
1549
- _next(void 0);
1550
- });
1551
- };
1552
- }
1553
- var color = require_kleur();
1554
- var Prompt = require_prompt();
1555
- var _require = require_util();
1556
- var style = _require.style;
1557
- var clear = _require.clear;
1558
- var figures = _require.figures;
1559
- var _require2 = require_src();
1560
- var erase = _require2.erase;
1561
- var cursor = _require2.cursor;
1562
- var _require3 = require_dateparts();
1563
- var DatePart = _require3.DatePart;
1564
- var Meridiem = _require3.Meridiem;
1565
- var Day = _require3.Day;
1566
- var Hours = _require3.Hours;
1567
- var Milliseconds = _require3.Milliseconds;
1568
- var Minutes = _require3.Minutes;
1569
- var Month = _require3.Month;
1570
- var Seconds = _require3.Seconds;
1571
- var Year = _require3.Year;
1572
- var regex = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;
1573
- var regexGroups = {
1574
- 1: ({
1575
- token
1576
- }) => token.replace(/\\(.)/g, "$1"),
1577
- 2: (opts) => new Day(opts),
1578
- 3: (opts) => new Month(opts),
1579
- 4: (opts) => new Year(opts),
1580
- 5: (opts) => new Meridiem(opts),
1581
- 6: (opts) => new Hours(opts),
1582
- 7: (opts) => new Minutes(opts),
1583
- 8: (opts) => new Seconds(opts),
1584
- 9: (opts) => new Milliseconds(opts)
1585
- };
1586
- var dfltLocales = {
1587
- months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
1588
- monthsShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),
1589
- weekdays: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),
1590
- weekdaysShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")
1591
- };
1592
- var DatePrompt = class extends Prompt {
1593
- constructor(opts = {}) {
1594
- super(opts);
1595
- this.msg = opts.message;
1596
- this.cursor = 0;
1597
- this.typed = "";
1598
- this.locales = Object.assign(dfltLocales, opts.locales);
1599
- this._date = opts.initial || new Date();
1600
- this.errorMsg = opts.error || "Please Enter A Valid Value";
1601
- this.validator = opts.validate || (() => true);
1602
- this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss";
1603
- this.clear = clear("", this.out.columns);
1604
- this.render();
1605
- }
1606
- get value() {
1607
- return this.date;
1608
- }
1609
- get date() {
1610
- return this._date;
1611
- }
1612
- set date(date) {
1613
- if (date)
1614
- this._date.setTime(date.getTime());
1615
- }
1616
- set mask(mask) {
1617
- let result;
1618
- this.parts = [];
1619
- while (result = regex.exec(mask)) {
1620
- let match = result.shift();
1621
- let idx = result.findIndex((gr) => gr != null);
1622
- this.parts.push(idx in regexGroups ? regexGroups[idx]({
1623
- token: result[idx] || match,
1624
- date: this.date,
1625
- parts: this.parts,
1626
- locales: this.locales
1627
- }) : result[idx] || match);
1628
- }
1629
- let parts = this.parts.reduce((arr, i) => {
1630
- if (typeof i === "string" && typeof arr[arr.length - 1] === "string")
1631
- arr[arr.length - 1] += i;
1632
- else
1633
- arr.push(i);
1634
- return arr;
1635
- }, []);
1636
- this.parts.splice(0);
1637
- this.parts.push(...parts);
1638
- this.reset();
1639
- }
1640
- moveCursor(n) {
1641
- this.typed = "";
1642
- this.cursor = n;
1643
- this.fire();
1644
- }
1645
- reset() {
1646
- this.moveCursor(this.parts.findIndex((p) => p instanceof DatePart));
1647
- this.fire();
1648
- this.render();
1649
- }
1650
- exit() {
1651
- this.abort();
1652
- }
1653
- abort() {
1654
- this.done = this.aborted = true;
1655
- this.error = false;
1656
- this.fire();
1657
- this.render();
1658
- this.out.write("\n");
1659
- this.close();
1660
- }
1661
- validate() {
1662
- var _this = this;
1663
- return _asyncToGenerator(function* () {
1664
- let valid = yield _this.validator(_this.value);
1665
- if (typeof valid === "string") {
1666
- _this.errorMsg = valid;
1667
- valid = false;
1668
- }
1669
- _this.error = !valid;
1670
- })();
1671
- }
1672
- submit() {
1673
- var _this2 = this;
1674
- return _asyncToGenerator(function* () {
1675
- yield _this2.validate();
1676
- if (_this2.error) {
1677
- _this2.color = "red";
1678
- _this2.fire();
1679
- _this2.render();
1680
- return;
1681
- }
1682
- _this2.done = true;
1683
- _this2.aborted = false;
1684
- _this2.fire();
1685
- _this2.render();
1686
- _this2.out.write("\n");
1687
- _this2.close();
1688
- })();
1689
- }
1690
- up() {
1691
- this.typed = "";
1692
- this.parts[this.cursor].up();
1693
- this.render();
1694
- }
1695
- down() {
1696
- this.typed = "";
1697
- this.parts[this.cursor].down();
1698
- this.render();
1699
- }
1700
- left() {
1701
- let prev = this.parts[this.cursor].prev();
1702
- if (prev == null)
1703
- return this.bell();
1704
- this.moveCursor(this.parts.indexOf(prev));
1705
- this.render();
1706
- }
1707
- right() {
1708
- let next = this.parts[this.cursor].next();
1709
- if (next == null)
1710
- return this.bell();
1711
- this.moveCursor(this.parts.indexOf(next));
1712
- this.render();
1713
- }
1714
- next() {
1715
- let next = this.parts[this.cursor].next();
1716
- this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart));
1717
- this.render();
1718
- }
1719
- _(c) {
1720
- if (/\d/.test(c)) {
1721
- this.typed += c;
1722
- this.parts[this.cursor].setTo(this.typed);
1723
- this.render();
1724
- }
1725
- }
1726
- render() {
1727
- if (this.closed)
1728
- return;
1729
- if (this.firstRender)
1730
- this.out.write(cursor.hide);
1731
- else
1732
- this.out.write(clear(this.outputText, this.out.columns));
1733
- super.render();
1734
- this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join("")].join(" ");
1735
- if (this.error) {
1736
- this.outputText += this.errorMsg.split("\n").reduce((a, l, i) => a + `
1737
- ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
1738
- }
1739
- this.out.write(erase.line + cursor.to(0) + this.outputText);
1740
- }
1741
- };
1742
- module2.exports = DatePrompt;
1743
- }
1744
- });
1745
-
1746
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js
1747
- var require_number = __commonJS({
1748
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js"(exports, module2) {
1749
- "use strict";
1750
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1751
- try {
1752
- var info = gen[key](arg);
1753
- var value = info.value;
1754
- } catch (error) {
1755
- reject(error);
1756
- return;
1757
- }
1758
- if (info.done) {
1759
- resolve(value);
1760
- } else {
1761
- Promise.resolve(value).then(_next, _throw);
1762
- }
1763
- }
1764
- function _asyncToGenerator(fn) {
1765
- return function() {
1766
- var self2 = this, args = arguments;
1767
- return new Promise(function(resolve, reject) {
1768
- var gen = fn.apply(self2, args);
1769
- function _next(value) {
1770
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1771
- }
1772
- function _throw(err) {
1773
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1774
- }
1775
- _next(void 0);
1776
- });
1777
- };
1778
- }
1779
- var color = require_kleur();
1780
- var Prompt = require_prompt();
1781
- var _require = require_src();
1782
- var cursor = _require.cursor;
1783
- var erase = _require.erase;
1784
- var _require2 = require_util();
1785
- var style = _require2.style;
1786
- var figures = _require2.figures;
1787
- var clear = _require2.clear;
1788
- var lines = _require2.lines;
1789
- var isNumber = /[0-9]/;
1790
- var isDef = (any) => any !== void 0;
1791
- var round = (number, precision) => {
1792
- let factor = Math.pow(10, precision);
1793
- return Math.round(number * factor) / factor;
1794
- };
1795
- var NumberPrompt = class extends Prompt {
1796
- constructor(opts = {}) {
1797
- super(opts);
1798
- this.transform = style.render(opts.style);
1799
- this.msg = opts.message;
1800
- this.initial = isDef(opts.initial) ? opts.initial : "";
1801
- this.float = !!opts.float;
1802
- this.round = opts.round || 2;
1803
- this.inc = opts.increment || 1;
1804
- this.min = isDef(opts.min) ? opts.min : -Infinity;
1805
- this.max = isDef(opts.max) ? opts.max : Infinity;
1806
- this.errorMsg = opts.error || `Please Enter A Valid Value`;
1807
- this.validator = opts.validate || (() => true);
1808
- this.color = `cyan`;
1809
- this.value = ``;
1810
- this.typed = ``;
1811
- this.lastHit = 0;
1812
- this.render();
1813
- }
1814
- set value(v) {
1815
- if (!v && v !== 0) {
1816
- this.placeholder = true;
1817
- this.rendered = color.gray(this.transform.render(`${this.initial}`));
1818
- this._value = ``;
1819
- } else {
1820
- this.placeholder = false;
1821
- this.rendered = this.transform.render(`${round(v, this.round)}`);
1822
- this._value = round(v, this.round);
1823
- }
1824
- this.fire();
1825
- }
1826
- get value() {
1827
- return this._value;
1828
- }
1829
- parse(x) {
1830
- return this.float ? parseFloat(x) : parseInt(x);
1831
- }
1832
- valid(c) {
1833
- return c === `-` || c === `.` && this.float || isNumber.test(c);
1834
- }
1835
- reset() {
1836
- this.typed = ``;
1837
- this.value = ``;
1838
- this.fire();
1839
- this.render();
1840
- }
1841
- exit() {
1842
- this.abort();
1843
- }
1844
- abort() {
1845
- let x = this.value;
1846
- this.value = x !== `` ? x : this.initial;
1847
- this.done = this.aborted = true;
1848
- this.error = false;
1849
- this.fire();
1850
- this.render();
1851
- this.out.write(`
1852
- `);
1853
- this.close();
1854
- }
1855
- validate() {
1856
- var _this = this;
1857
- return _asyncToGenerator(function* () {
1858
- let valid = yield _this.validator(_this.value);
1859
- if (typeof valid === `string`) {
1860
- _this.errorMsg = valid;
1861
- valid = false;
1862
- }
1863
- _this.error = !valid;
1864
- })();
1865
- }
1866
- submit() {
1867
- var _this2 = this;
1868
- return _asyncToGenerator(function* () {
1869
- yield _this2.validate();
1870
- if (_this2.error) {
1871
- _this2.color = `red`;
1872
- _this2.fire();
1873
- _this2.render();
1874
- return;
1875
- }
1876
- let x = _this2.value;
1877
- _this2.value = x !== `` ? x : _this2.initial;
1878
- _this2.done = true;
1879
- _this2.aborted = false;
1880
- _this2.error = false;
1881
- _this2.fire();
1882
- _this2.render();
1883
- _this2.out.write(`
1884
- `);
1885
- _this2.close();
1886
- })();
1887
- }
1888
- up() {
1889
- this.typed = ``;
1890
- if (this.value === "") {
1891
- this.value = this.min - this.inc;
1892
- }
1893
- if (this.value >= this.max)
1894
- return this.bell();
1895
- this.value += this.inc;
1896
- this.color = `cyan`;
1897
- this.fire();
1898
- this.render();
1899
- }
1900
- down() {
1901
- this.typed = ``;
1902
- if (this.value === "") {
1903
- this.value = this.min + this.inc;
1904
- }
1905
- if (this.value <= this.min)
1906
- return this.bell();
1907
- this.value -= this.inc;
1908
- this.color = `cyan`;
1909
- this.fire();
1910
- this.render();
1911
- }
1912
- delete() {
1913
- let val = this.value.toString();
1914
- if (val.length === 0)
1915
- return this.bell();
1916
- this.value = this.parse(val = val.slice(0, -1)) || ``;
1917
- if (this.value !== "" && this.value < this.min) {
1918
- this.value = this.min;
1919
- }
1920
- this.color = `cyan`;
1921
- this.fire();
1922
- this.render();
1923
- }
1924
- next() {
1925
- this.value = this.initial;
1926
- this.fire();
1927
- this.render();
1928
- }
1929
- _(c, key) {
1930
- if (!this.valid(c))
1931
- return this.bell();
1932
- const now = Date.now();
1933
- if (now - this.lastHit > 1e3)
1934
- this.typed = ``;
1935
- this.typed += c;
1936
- this.lastHit = now;
1937
- this.color = `cyan`;
1938
- if (c === `.`)
1939
- return this.fire();
1940
- this.value = Math.min(this.parse(this.typed), this.max);
1941
- if (this.value > this.max)
1942
- this.value = this.max;
1943
- if (this.value < this.min)
1944
- this.value = this.min;
1945
- this.fire();
1946
- this.render();
1947
- }
1948
- render() {
1949
- if (this.closed)
1950
- return;
1951
- if (!this.firstRender) {
1952
- if (this.outputError)
1953
- this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
1954
- this.out.write(clear(this.outputText, this.out.columns));
1955
- }
1956
- super.render();
1957
- this.outputError = "";
1958
- this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered].join(` `);
1959
- if (this.error) {
1960
- this.outputError += this.errorMsg.split(`
1961
- `).reduce((a, l, i) => a + `
1962
- ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
1963
- }
1964
- this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);
1965
- }
1966
- };
1967
- module2.exports = NumberPrompt;
1968
- }
1969
- });
1970
-
1971
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js
1972
- var require_multiselect = __commonJS({
1973
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js"(exports, module2) {
1974
- "use strict";
1975
- var color = require_kleur();
1976
- var _require = require_src();
1977
- var cursor = _require.cursor;
1978
- var Prompt = require_prompt();
1979
- var _require2 = require_util();
1980
- var clear = _require2.clear;
1981
- var figures = _require2.figures;
1982
- var style = _require2.style;
1983
- var wrap = _require2.wrap;
1984
- var entriesToDisplay = _require2.entriesToDisplay;
1985
- var MultiselectPrompt = class extends Prompt {
1986
- constructor(opts = {}) {
1987
- super(opts);
1988
- this.msg = opts.message;
1989
- this.cursor = opts.cursor || 0;
1990
- this.scrollIndex = opts.cursor || 0;
1991
- this.hint = opts.hint || "";
1992
- this.warn = opts.warn || "- This option is disabled -";
1993
- this.minSelected = opts.min;
1994
- this.showMinError = false;
1995
- this.maxChoices = opts.max;
1996
- this.instructions = opts.instructions;
1997
- this.optionsPerPage = opts.optionsPerPage || 10;
1998
- this.value = opts.choices.map((ch, idx) => {
1999
- if (typeof ch === "string")
2000
- ch = {
2001
- title: ch,
2002
- value: idx
2003
- };
2004
- return {
2005
- title: ch && (ch.title || ch.value || ch),
2006
- description: ch && ch.description,
2007
- value: ch && (ch.value === void 0 ? idx : ch.value),
2008
- selected: ch && ch.selected,
2009
- disabled: ch && ch.disabled
2010
- };
2011
- });
2012
- this.clear = clear("", this.out.columns);
2013
- if (!opts.overrideRender) {
2014
- this.render();
2015
- }
2016
- }
2017
- reset() {
2018
- this.value.map((v) => !v.selected);
2019
- this.cursor = 0;
2020
- this.fire();
2021
- this.render();
2022
- }
2023
- selected() {
2024
- return this.value.filter((v) => v.selected);
2025
- }
2026
- exit() {
2027
- this.abort();
2028
- }
2029
- abort() {
2030
- this.done = this.aborted = true;
2031
- this.fire();
2032
- this.render();
2033
- this.out.write("\n");
2034
- this.close();
2035
- }
2036
- submit() {
2037
- const selected = this.value.filter((e) => e.selected);
2038
- if (this.minSelected && selected.length < this.minSelected) {
2039
- this.showMinError = true;
2040
- this.render();
2041
- } else {
2042
- this.done = true;
2043
- this.aborted = false;
2044
- this.fire();
2045
- this.render();
2046
- this.out.write("\n");
2047
- this.close();
2048
- }
2049
- }
2050
- first() {
2051
- this.cursor = 0;
2052
- this.render();
2053
- }
2054
- last() {
2055
- this.cursor = this.value.length - 1;
2056
- this.render();
2057
- }
2058
- next() {
2059
- this.cursor = (this.cursor + 1) % this.value.length;
2060
- this.render();
2061
- }
2062
- up() {
2063
- if (this.cursor === 0) {
2064
- this.cursor = this.value.length - 1;
2065
- } else {
2066
- this.cursor--;
2067
- }
2068
- this.render();
2069
- }
2070
- down() {
2071
- if (this.cursor === this.value.length - 1) {
2072
- this.cursor = 0;
2073
- } else {
2074
- this.cursor++;
2075
- }
2076
- this.render();
2077
- }
2078
- left() {
2079
- this.value[this.cursor].selected = false;
2080
- this.render();
2081
- }
2082
- right() {
2083
- if (this.value.filter((e) => e.selected).length >= this.maxChoices)
2084
- return this.bell();
2085
- this.value[this.cursor].selected = true;
2086
- this.render();
2087
- }
2088
- handleSpaceToggle() {
2089
- const v = this.value[this.cursor];
2090
- if (v.selected) {
2091
- v.selected = false;
2092
- this.render();
2093
- } else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) {
2094
- return this.bell();
2095
- } else {
2096
- v.selected = true;
2097
- this.render();
2098
- }
2099
- }
2100
- toggleAll() {
2101
- if (this.maxChoices !== void 0 || this.value[this.cursor].disabled) {
2102
- return this.bell();
2103
- }
2104
- const newSelected = !this.value[this.cursor].selected;
2105
- this.value.filter((v) => !v.disabled).forEach((v) => v.selected = newSelected);
2106
- this.render();
2107
- }
2108
- _(c, key) {
2109
- if (c === " ") {
2110
- this.handleSpaceToggle();
2111
- } else if (c === "a") {
2112
- this.toggleAll();
2113
- } else {
2114
- return this.bell();
2115
- }
2116
- }
2117
- renderInstructions() {
2118
- if (this.instructions === void 0 || this.instructions) {
2119
- if (typeof this.instructions === "string") {
2120
- return this.instructions;
2121
- }
2122
- return `
2123
- Instructions:
2124
- ${figures.arrowUp}/${figures.arrowDown}: Highlight option
2125
- ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
2126
- ` + (this.maxChoices === void 0 ? ` a: Toggle all
2127
- ` : "") + ` enter/return: Complete answer`;
2128
- }
2129
- return "";
2130
- }
2131
- renderOption(cursor2, v, i, arrowIndicator) {
2132
- const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " ";
2133
- let title, desc;
2134
- if (v.disabled) {
2135
- title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
2136
- } else {
2137
- title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
2138
- if (cursor2 === i && v.description) {
2139
- desc = ` - ${v.description}`;
2140
- if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
2141
- desc = "\n" + wrap(v.description, {
2142
- margin: prefix.length,
2143
- width: this.out.columns
2144
- });
2145
- }
2146
- }
2147
- }
2148
- return prefix + title + color.gray(desc || "");
2149
- }
2150
- paginateOptions(options2) {
2151
- if (options2.length === 0) {
2152
- return color.red("No matches for this query.");
2153
- }
2154
- let _entriesToDisplay = entriesToDisplay(this.cursor, options2.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
2155
- let prefix, styledOptions = [];
2156
- for (let i = startIndex; i < endIndex; i++) {
2157
- if (i === startIndex && startIndex > 0) {
2158
- prefix = figures.arrowUp;
2159
- } else if (i === endIndex - 1 && endIndex < options2.length) {
2160
- prefix = figures.arrowDown;
2161
- } else {
2162
- prefix = " ";
2163
- }
2164
- styledOptions.push(this.renderOption(this.cursor, options2[i], i, prefix));
2165
- }
2166
- return "\n" + styledOptions.join("\n");
2167
- }
2168
- renderOptions(options2) {
2169
- if (!this.done) {
2170
- return this.paginateOptions(options2);
2171
- }
2172
- return "";
2173
- }
2174
- renderDoneOrInstructions() {
2175
- if (this.done) {
2176
- return this.value.filter((e) => e.selected).map((v) => v.title).join(", ");
2177
- }
2178
- const output = [color.gray(this.hint), this.renderInstructions()];
2179
- if (this.value[this.cursor].disabled) {
2180
- output.push(color.yellow(this.warn));
2181
- }
2182
- return output.join(" ");
2183
- }
2184
- render() {
2185
- if (this.closed)
2186
- return;
2187
- if (this.firstRender)
2188
- this.out.write(cursor.hide);
2189
- super.render();
2190
- let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
2191
- if (this.showMinError) {
2192
- prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);
2193
- this.showMinError = false;
2194
- }
2195
- prompt += this.renderOptions(this.value);
2196
- this.out.write(this.clear + prompt);
2197
- this.clear = clear(prompt, this.out.columns);
2198
- }
2199
- };
2200
- module2.exports = MultiselectPrompt;
2201
- }
2202
- });
2203
-
2204
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js
2205
- var require_autocomplete = __commonJS({
2206
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js"(exports, module2) {
2207
- "use strict";
2208
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2209
- try {
2210
- var info = gen[key](arg);
2211
- var value = info.value;
2212
- } catch (error) {
2213
- reject(error);
2214
- return;
2215
- }
2216
- if (info.done) {
2217
- resolve(value);
2218
- } else {
2219
- Promise.resolve(value).then(_next, _throw);
2220
- }
2221
- }
2222
- function _asyncToGenerator(fn) {
2223
- return function() {
2224
- var self2 = this, args = arguments;
2225
- return new Promise(function(resolve, reject) {
2226
- var gen = fn.apply(self2, args);
2227
- function _next(value) {
2228
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
2229
- }
2230
- function _throw(err) {
2231
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
2232
- }
2233
- _next(void 0);
2234
- });
2235
- };
2236
- }
2237
- var color = require_kleur();
2238
- var Prompt = require_prompt();
2239
- var _require = require_src();
2240
- var erase = _require.erase;
2241
- var cursor = _require.cursor;
2242
- var _require2 = require_util();
2243
- var style = _require2.style;
2244
- var clear = _require2.clear;
2245
- var figures = _require2.figures;
2246
- var wrap = _require2.wrap;
2247
- var entriesToDisplay = _require2.entriesToDisplay;
2248
- var getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);
2249
- var getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);
2250
- var getIndex = (arr, valOrTitle) => {
2251
- const index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle);
2252
- return index > -1 ? index : void 0;
2253
- };
2254
- var AutocompletePrompt = class extends Prompt {
2255
- constructor(opts = {}) {
2256
- super(opts);
2257
- this.msg = opts.message;
2258
- this.suggest = opts.suggest;
2259
- this.choices = opts.choices;
2260
- this.initial = typeof opts.initial === "number" ? opts.initial : getIndex(opts.choices, opts.initial);
2261
- this.select = this.initial || opts.cursor || 0;
2262
- this.i18n = {
2263
- noMatches: opts.noMatches || "no matches found"
2264
- };
2265
- this.fallback = opts.fallback || this.initial;
2266
- this.clearFirst = opts.clearFirst || false;
2267
- this.suggestions = [];
2268
- this.input = "";
2269
- this.limit = opts.limit || 10;
2270
- this.cursor = 0;
2271
- this.transform = style.render(opts.style);
2272
- this.scale = this.transform.scale;
2273
- this.render = this.render.bind(this);
2274
- this.complete = this.complete.bind(this);
2275
- this.clear = clear("", this.out.columns);
2276
- this.complete(this.render);
2277
- this.render();
2278
- }
2279
- set fallback(fb) {
2280
- this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;
2281
- }
2282
- get fallback() {
2283
- let choice;
2284
- if (typeof this._fb === "number")
2285
- choice = this.choices[this._fb];
2286
- else if (typeof this._fb === "string")
2287
- choice = {
2288
- title: this._fb
2289
- };
2290
- return choice || this._fb || {
2291
- title: this.i18n.noMatches
2292
- };
2293
- }
2294
- moveSelect(i) {
2295
- this.select = i;
2296
- if (this.suggestions.length > 0)
2297
- this.value = getVal(this.suggestions, i);
2298
- else
2299
- this.value = this.fallback.value;
2300
- this.fire();
2301
- }
2302
- complete(cb) {
2303
- var _this = this;
2304
- return _asyncToGenerator(function* () {
2305
- const p = _this.completing = _this.suggest(_this.input, _this.choices);
2306
- const suggestions = yield p;
2307
- if (_this.completing !== p)
2308
- return;
2309
- _this.suggestions = suggestions.map((s, i, arr) => ({
2310
- title: getTitle(arr, i),
2311
- value: getVal(arr, i),
2312
- description: s.description
2313
- }));
2314
- _this.completing = false;
2315
- const l = Math.max(suggestions.length - 1, 0);
2316
- _this.moveSelect(Math.min(l, _this.select));
2317
- cb && cb();
2318
- })();
2319
- }
2320
- reset() {
2321
- this.input = "";
2322
- this.complete(() => {
2323
- this.moveSelect(this.initial !== void 0 ? this.initial : 0);
2324
- this.render();
2325
- });
2326
- this.render();
2327
- }
2328
- exit() {
2329
- if (this.clearFirst && this.input.length > 0) {
2330
- this.reset();
2331
- } else {
2332
- this.done = this.exited = true;
2333
- this.aborted = false;
2334
- this.fire();
2335
- this.render();
2336
- this.out.write("\n");
2337
- this.close();
2338
- }
2339
- }
2340
- abort() {
2341
- this.done = this.aborted = true;
2342
- this.exited = false;
2343
- this.fire();
2344
- this.render();
2345
- this.out.write("\n");
2346
- this.close();
2347
- }
2348
- submit() {
2349
- this.done = true;
2350
- this.aborted = this.exited = false;
2351
- this.fire();
2352
- this.render();
2353
- this.out.write("\n");
2354
- this.close();
2355
- }
2356
- _(c, key) {
2357
- let s1 = this.input.slice(0, this.cursor);
2358
- let s2 = this.input.slice(this.cursor);
2359
- this.input = `${s1}${c}${s2}`;
2360
- this.cursor = s1.length + 1;
2361
- this.complete(this.render);
2362
- this.render();
2363
- }
2364
- delete() {
2365
- if (this.cursor === 0)
2366
- return this.bell();
2367
- let s1 = this.input.slice(0, this.cursor - 1);
2368
- let s2 = this.input.slice(this.cursor);
2369
- this.input = `${s1}${s2}`;
2370
- this.complete(this.render);
2371
- this.cursor = this.cursor - 1;
2372
- this.render();
2373
- }
2374
- deleteForward() {
2375
- if (this.cursor * this.scale >= this.rendered.length)
2376
- return this.bell();
2377
- let s1 = this.input.slice(0, this.cursor);
2378
- let s2 = this.input.slice(this.cursor + 1);
2379
- this.input = `${s1}${s2}`;
2380
- this.complete(this.render);
2381
- this.render();
2382
- }
2383
- first() {
2384
- this.moveSelect(0);
2385
- this.render();
2386
- }
2387
- last() {
2388
- this.moveSelect(this.suggestions.length - 1);
2389
- this.render();
2390
- }
2391
- up() {
2392
- if (this.select === 0) {
2393
- this.moveSelect(this.suggestions.length - 1);
2394
- } else {
2395
- this.moveSelect(this.select - 1);
2396
- }
2397
- this.render();
2398
- }
2399
- down() {
2400
- if (this.select === this.suggestions.length - 1) {
2401
- this.moveSelect(0);
2402
- } else {
2403
- this.moveSelect(this.select + 1);
2404
- }
2405
- this.render();
2406
- }
2407
- next() {
2408
- if (this.select === this.suggestions.length - 1) {
2409
- this.moveSelect(0);
2410
- } else
2411
- this.moveSelect(this.select + 1);
2412
- this.render();
2413
- }
2414
- nextPage() {
2415
- this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));
2416
- this.render();
2417
- }
2418
- prevPage() {
2419
- this.moveSelect(Math.max(this.select - this.limit, 0));
2420
- this.render();
2421
- }
2422
- left() {
2423
- if (this.cursor <= 0)
2424
- return this.bell();
2425
- this.cursor = this.cursor - 1;
2426
- this.render();
2427
- }
2428
- right() {
2429
- if (this.cursor * this.scale >= this.rendered.length)
2430
- return this.bell();
2431
- this.cursor = this.cursor + 1;
2432
- this.render();
2433
- }
2434
- renderOption(v, hovered, isStart, isEnd) {
2435
- let desc;
2436
- let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " ";
2437
- let title = hovered ? color.cyan().underline(v.title) : v.title;
2438
- prefix = (hovered ? color.cyan(figures.pointer) + " " : " ") + prefix;
2439
- if (v.description) {
2440
- desc = ` - ${v.description}`;
2441
- if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
2442
- desc = "\n" + wrap(v.description, {
2443
- margin: 3,
2444
- width: this.out.columns
2445
- });
2446
- }
2447
- }
2448
- return prefix + " " + title + color.gray(desc || "");
2449
- }
2450
- render() {
2451
- if (this.closed)
2452
- return;
2453
- if (this.firstRender)
2454
- this.out.write(cursor.hide);
2455
- else
2456
- this.out.write(clear(this.outputText, this.out.columns));
2457
- super.render();
2458
- let _entriesToDisplay = entriesToDisplay(this.select, this.choices.length, this.limit), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
2459
- this.outputText = [style.symbol(this.done, this.aborted, this.exited), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)].join(" ");
2460
- if (!this.done) {
2461
- const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i) => this.renderOption(item, this.select === i + startIndex, i === 0 && startIndex > 0, i + startIndex === endIndex - 1 && endIndex < this.choices.length)).join("\n");
2462
- this.outputText += `
2463
- ` + (suggestions || color.gray(this.fallback.title));
2464
- }
2465
- this.out.write(erase.line + cursor.to(0) + this.outputText);
2466
- }
2467
- };
2468
- module2.exports = AutocompletePrompt;
2469
- }
2470
- });
2471
-
2472
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js
2473
- var require_autocompleteMultiselect = __commonJS({
2474
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js"(exports, module2) {
2475
- "use strict";
2476
- var color = require_kleur();
2477
- var _require = require_src();
2478
- var cursor = _require.cursor;
2479
- var MultiselectPrompt = require_multiselect();
2480
- var _require2 = require_util();
2481
- var clear = _require2.clear;
2482
- var style = _require2.style;
2483
- var figures = _require2.figures;
2484
- var AutocompleteMultiselectPrompt = class extends MultiselectPrompt {
2485
- constructor(opts = {}) {
2486
- opts.overrideRender = true;
2487
- super(opts);
2488
- this.inputValue = "";
2489
- this.clear = clear("", this.out.columns);
2490
- this.filteredOptions = this.value;
2491
- this.render();
2492
- }
2493
- last() {
2494
- this.cursor = this.filteredOptions.length - 1;
2495
- this.render();
2496
- }
2497
- next() {
2498
- this.cursor = (this.cursor + 1) % this.filteredOptions.length;
2499
- this.render();
2500
- }
2501
- up() {
2502
- if (this.cursor === 0) {
2503
- this.cursor = this.filteredOptions.length - 1;
2504
- } else {
2505
- this.cursor--;
2506
- }
2507
- this.render();
2508
- }
2509
- down() {
2510
- if (this.cursor === this.filteredOptions.length - 1) {
2511
- this.cursor = 0;
2512
- } else {
2513
- this.cursor++;
2514
- }
2515
- this.render();
2516
- }
2517
- left() {
2518
- this.filteredOptions[this.cursor].selected = false;
2519
- this.render();
2520
- }
2521
- right() {
2522
- if (this.value.filter((e) => e.selected).length >= this.maxChoices)
2523
- return this.bell();
2524
- this.filteredOptions[this.cursor].selected = true;
2525
- this.render();
2526
- }
2527
- delete() {
2528
- if (this.inputValue.length) {
2529
- this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);
2530
- this.updateFilteredOptions();
2531
- }
2532
- }
2533
- updateFilteredOptions() {
2534
- const currentHighlight = this.filteredOptions[this.cursor];
2535
- this.filteredOptions = this.value.filter((v) => {
2536
- if (this.inputValue) {
2537
- if (typeof v.title === "string") {
2538
- if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) {
2539
- return true;
2540
- }
2541
- }
2542
- if (typeof v.value === "string") {
2543
- if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) {
2544
- return true;
2545
- }
2546
- }
2547
- return false;
2548
- }
2549
- return true;
2550
- });
2551
- const newHighlightIndex = this.filteredOptions.findIndex((v) => v === currentHighlight);
2552
- this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;
2553
- this.render();
2554
- }
2555
- handleSpaceToggle() {
2556
- const v = this.filteredOptions[this.cursor];
2557
- if (v.selected) {
2558
- v.selected = false;
2559
- this.render();
2560
- } else if (v.disabled || this.value.filter((e) => e.selected).length >= this.maxChoices) {
2561
- return this.bell();
2562
- } else {
2563
- v.selected = true;
2564
- this.render();
2565
- }
2566
- }
2567
- handleInputChange(c) {
2568
- this.inputValue = this.inputValue + c;
2569
- this.updateFilteredOptions();
2570
- }
2571
- _(c, key) {
2572
- if (c === " ") {
2573
- this.handleSpaceToggle();
2574
- } else {
2575
- this.handleInputChange(c);
2576
- }
2577
- }
2578
- renderInstructions() {
2579
- if (this.instructions === void 0 || this.instructions) {
2580
- if (typeof this.instructions === "string") {
2581
- return this.instructions;
2582
- }
2583
- return `
2584
- Instructions:
2585
- ${figures.arrowUp}/${figures.arrowDown}: Highlight option
2586
- ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
2587
- [a,b,c]/delete: Filter choices
2588
- enter/return: Complete answer
2589
- `;
2590
- }
2591
- return "";
2592
- }
2593
- renderCurrentInput() {
2594
- return `
2595
- Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter something to filter")}
2596
- `;
2597
- }
2598
- renderOption(cursor2, v, i) {
2599
- let title;
2600
- if (v.disabled)
2601
- title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
2602
- else
2603
- title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
2604
- return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title;
2605
- }
2606
- renderDoneOrInstructions() {
2607
- if (this.done) {
2608
- return this.value.filter((e) => e.selected).map((v) => v.title).join(", ");
2609
- }
2610
- const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];
2611
- if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {
2612
- output.push(color.yellow(this.warn));
2613
- }
2614
- return output.join(" ");
2615
- }
2616
- render() {
2617
- if (this.closed)
2618
- return;
2619
- if (this.firstRender)
2620
- this.out.write(cursor.hide);
2621
- super.render();
2622
- let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
2623
- if (this.showMinError) {
2624
- prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);
2625
- this.showMinError = false;
2626
- }
2627
- prompt += this.renderOptions(this.filteredOptions);
2628
- this.out.write(this.clear + prompt);
2629
- this.clear = clear(prompt, this.out.columns);
2630
- }
2631
- };
2632
- module2.exports = AutocompleteMultiselectPrompt;
2633
- }
2634
- });
2635
-
2636
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js
2637
- var require_confirm = __commonJS({
2638
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js"(exports, module2) {
2639
- "use strict";
2640
- var color = require_kleur();
2641
- var Prompt = require_prompt();
2642
- var _require = require_util();
2643
- var style = _require.style;
2644
- var clear = _require.clear;
2645
- var _require2 = require_src();
2646
- var erase = _require2.erase;
2647
- var cursor = _require2.cursor;
2648
- var ConfirmPrompt = class extends Prompt {
2649
- constructor(opts = {}) {
2650
- super(opts);
2651
- this.msg = opts.message;
2652
- this.value = opts.initial;
2653
- this.initialValue = !!opts.initial;
2654
- this.yesMsg = opts.yes || "yes";
2655
- this.yesOption = opts.yesOption || "(Y/n)";
2656
- this.noMsg = opts.no || "no";
2657
- this.noOption = opts.noOption || "(y/N)";
2658
- this.render();
2659
- }
2660
- reset() {
2661
- this.value = this.initialValue;
2662
- this.fire();
2663
- this.render();
2664
- }
2665
- exit() {
2666
- this.abort();
2667
- }
2668
- abort() {
2669
- this.done = this.aborted = true;
2670
- this.fire();
2671
- this.render();
2672
- this.out.write("\n");
2673
- this.close();
2674
- }
2675
- submit() {
2676
- this.value = this.value || false;
2677
- this.done = true;
2678
- this.aborted = false;
2679
- this.fire();
2680
- this.render();
2681
- this.out.write("\n");
2682
- this.close();
2683
- }
2684
- _(c, key) {
2685
- if (c.toLowerCase() === "y") {
2686
- this.value = true;
2687
- return this.submit();
2688
- }
2689
- if (c.toLowerCase() === "n") {
2690
- this.value = false;
2691
- return this.submit();
2692
- }
2693
- return this.bell();
2694
- }
2695
- render() {
2696
- if (this.closed)
2697
- return;
2698
- if (this.firstRender)
2699
- this.out.write(cursor.hide);
2700
- else
2701
- this.out.write(clear(this.outputText, this.out.columns));
2702
- super.render();
2703
- this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)].join(" ");
2704
- this.out.write(erase.line + cursor.to(0) + this.outputText);
2705
- }
2706
- };
2707
- module2.exports = ConfirmPrompt;
2708
- }
2709
- });
2710
-
2711
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js
2712
- var require_elements = __commonJS({
2713
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js"(exports, module2) {
2714
- "use strict";
2715
- module2.exports = {
2716
- TextPrompt: require_text(),
2717
- SelectPrompt: require_select(),
2718
- TogglePrompt: require_toggle(),
2719
- DatePrompt: require_date(),
2720
- NumberPrompt: require_number(),
2721
- MultiselectPrompt: require_multiselect(),
2722
- AutocompletePrompt: require_autocomplete(),
2723
- AutocompleteMultiselectPrompt: require_autocompleteMultiselect(),
2724
- ConfirmPrompt: require_confirm()
2725
- };
2726
- }
2727
- });
2728
-
2729
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js
2730
- var require_prompts = __commonJS({
2731
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js"(exports) {
2732
- "use strict";
2733
- var $ = exports;
2734
- var el = require_elements();
2735
- var noop = (v) => v;
2736
- function toPrompt(type, args, opts = {}) {
2737
- return new Promise((res, rej) => {
2738
- const p = new el[type](args);
2739
- const onAbort = opts.onAbort || noop;
2740
- const onSubmit = opts.onSubmit || noop;
2741
- const onExit = opts.onExit || noop;
2742
- p.on("state", args.onState || noop);
2743
- p.on("submit", (x) => res(onSubmit(x)));
2744
- p.on("exit", (x) => res(onExit(x)));
2745
- p.on("abort", (x) => rej(onAbort(x)));
2746
- });
2747
- }
2748
- $.text = (args) => toPrompt("TextPrompt", args);
2749
- $.password = (args) => {
2750
- args.style = "password";
2751
- return $.text(args);
2752
- };
2753
- $.invisible = (args) => {
2754
- args.style = "invisible";
2755
- return $.text(args);
2756
- };
2757
- $.number = (args) => toPrompt("NumberPrompt", args);
2758
- $.date = (args) => toPrompt("DatePrompt", args);
2759
- $.confirm = (args) => toPrompt("ConfirmPrompt", args);
2760
- $.list = (args) => {
2761
- const sep = args.separator || ",";
2762
- return toPrompt("TextPrompt", args, {
2763
- onSubmit: (str) => str.split(sep).map((s) => s.trim())
2764
- });
2765
- };
2766
- $.toggle = (args) => toPrompt("TogglePrompt", args);
2767
- $.select = (args) => toPrompt("SelectPrompt", args);
2768
- $.multiselect = (args) => {
2769
- args.choices = [].concat(args.choices || []);
2770
- const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);
2771
- return toPrompt("MultiselectPrompt", args, {
2772
- onAbort: toSelected,
2773
- onSubmit: toSelected
2774
- });
2775
- };
2776
- $.autocompleteMultiselect = (args) => {
2777
- args.choices = [].concat(args.choices || []);
2778
- const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);
2779
- return toPrompt("AutocompleteMultiselectPrompt", args, {
2780
- onAbort: toSelected,
2781
- onSubmit: toSelected
2782
- });
2783
- };
2784
- var byTitle = (input, choices) => Promise.resolve(choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()));
2785
- $.autocomplete = (args) => {
2786
- args.suggest = args.suggest || byTitle;
2787
- args.choices = [].concat(args.choices || []);
2788
- return toPrompt("AutocompletePrompt", args);
2789
- };
2790
- }
2791
- });
2792
-
2793
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js
2794
- var require_dist = __commonJS({
2795
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js"(exports, module2) {
2796
- "use strict";
2797
- function ownKeys(object, enumerableOnly) {
2798
- var keys = Object.keys(object);
2799
- if (Object.getOwnPropertySymbols) {
2800
- var symbols = Object.getOwnPropertySymbols(object);
2801
- if (enumerableOnly) {
2802
- symbols = symbols.filter(function(sym) {
2803
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2804
- });
2805
- }
2806
- keys.push.apply(keys, symbols);
2807
- }
2808
- return keys;
2809
- }
2810
- function _objectSpread(target) {
2811
- for (var i = 1; i < arguments.length; i++) {
2812
- var source = arguments[i] != null ? arguments[i] : {};
2813
- if (i % 2) {
2814
- ownKeys(Object(source), true).forEach(function(key) {
2815
- _defineProperty(target, key, source[key]);
2816
- });
2817
- } else if (Object.getOwnPropertyDescriptors) {
2818
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2819
- } else {
2820
- ownKeys(Object(source)).forEach(function(key) {
2821
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2822
- });
2823
- }
2824
- }
2825
- return target;
2826
- }
2827
- function _defineProperty(obj, key, value) {
2828
- if (key in obj) {
2829
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
2830
- } else {
2831
- obj[key] = value;
2832
- }
2833
- return obj;
2834
- }
2835
- function _createForOfIteratorHelper(o, allowArrayLike) {
2836
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
2837
- if (!it) {
2838
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
2839
- if (it)
2840
- o = it;
2841
- var i = 0;
2842
- var F = function F2() {
2843
- };
2844
- return { s: F, n: function n() {
2845
- if (i >= o.length)
2846
- return { done: true };
2847
- return { done: false, value: o[i++] };
2848
- }, e: function e(_e) {
2849
- throw _e;
2850
- }, f: F };
2851
- }
2852
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2853
- }
2854
- var normalCompletion = true, didErr = false, err;
2855
- return { s: function s() {
2856
- it = it.call(o);
2857
- }, n: function n() {
2858
- var step = it.next();
2859
- normalCompletion = step.done;
2860
- return step;
2861
- }, e: function e(_e2) {
2862
- didErr = true;
2863
- err = _e2;
2864
- }, f: function f() {
2865
- try {
2866
- if (!normalCompletion && it.return != null)
2867
- it.return();
2868
- } finally {
2869
- if (didErr)
2870
- throw err;
2871
- }
2872
- } };
2873
- }
2874
- function _unsupportedIterableToArray(o, minLen) {
2875
- if (!o)
2876
- return;
2877
- if (typeof o === "string")
2878
- return _arrayLikeToArray(o, minLen);
2879
- var n = Object.prototype.toString.call(o).slice(8, -1);
2880
- if (n === "Object" && o.constructor)
2881
- n = o.constructor.name;
2882
- if (n === "Map" || n === "Set")
2883
- return Array.from(o);
2884
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
2885
- return _arrayLikeToArray(o, minLen);
2886
- }
2887
- function _arrayLikeToArray(arr, len) {
2888
- if (len == null || len > arr.length)
2889
- len = arr.length;
2890
- for (var i = 0, arr2 = new Array(len); i < len; i++)
2891
- arr2[i] = arr[i];
2892
- return arr2;
2893
- }
2894
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2895
- try {
2896
- var info = gen[key](arg);
2897
- var value = info.value;
2898
- } catch (error) {
2899
- reject(error);
2900
- return;
2901
- }
2902
- if (info.done) {
2903
- resolve(value);
2904
- } else {
2905
- Promise.resolve(value).then(_next, _throw);
2906
- }
2907
- }
2908
- function _asyncToGenerator(fn) {
2909
- return function() {
2910
- var self2 = this, args = arguments;
2911
- return new Promise(function(resolve, reject) {
2912
- var gen = fn.apply(self2, args);
2913
- function _next(value) {
2914
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
2915
- }
2916
- function _throw(err) {
2917
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
2918
- }
2919
- _next(void 0);
2920
- });
2921
- };
2922
- }
2923
- var prompts2 = require_prompts();
2924
- var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
2925
- var noop = () => {
2926
- };
2927
- function prompt() {
2928
- return _prompt.apply(this, arguments);
2929
- }
2930
- function _prompt() {
2931
- _prompt = _asyncToGenerator(function* (questions = [], {
2932
- onSubmit = noop,
2933
- onCancel = noop
2934
- } = {}) {
2935
- const answers = {};
2936
- const override2 = prompt._override || {};
2937
- questions = [].concat(questions);
2938
- let answer, question, quit, name, type, lastPrompt;
2939
- const getFormattedAnswer = /* @__PURE__ */ function() {
2940
- var _ref = _asyncToGenerator(function* (question2, answer2, skipValidation = false) {
2941
- if (!skipValidation && question2.validate && question2.validate(answer2) !== true) {
2942
- return;
2943
- }
2944
- return question2.format ? yield question2.format(answer2, answers) : answer2;
2945
- });
2946
- return function getFormattedAnswer2(_x, _x2) {
2947
- return _ref.apply(this, arguments);
2948
- };
2949
- }();
2950
- var _iterator = _createForOfIteratorHelper(questions), _step;
2951
- try {
2952
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
2953
- question = _step.value;
2954
- var _question = question;
2955
- name = _question.name;
2956
- type = _question.type;
2957
- if (typeof type === "function") {
2958
- type = yield type(answer, _objectSpread({}, answers), question);
2959
- question["type"] = type;
2960
- }
2961
- if (!type)
2962
- continue;
2963
- for (let key in question) {
2964
- if (passOn.includes(key))
2965
- continue;
2966
- let value = question[key];
2967
- question[key] = typeof value === "function" ? yield value(answer, _objectSpread({}, answers), lastPrompt) : value;
2968
- }
2969
- lastPrompt = question;
2970
- if (typeof question.message !== "string") {
2971
- throw new Error("prompt message is required");
2972
- }
2973
- var _question2 = question;
2974
- name = _question2.name;
2975
- type = _question2.type;
2976
- if (prompts2[type] === void 0) {
2977
- throw new Error(`prompt type (${type}) is not defined`);
2978
- }
2979
- if (override2[question.name] !== void 0) {
2980
- answer = yield getFormattedAnswer(question, override2[question.name]);
2981
- if (answer !== void 0) {
2982
- answers[name] = answer;
2983
- continue;
2984
- }
2985
- }
2986
- try {
2987
- answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts2[type](question);
2988
- answers[name] = answer = yield getFormattedAnswer(question, answer, true);
2989
- quit = yield onSubmit(question, answer, answers);
2990
- } catch (err) {
2991
- quit = !(yield onCancel(question, answers));
2992
- }
2993
- if (quit)
2994
- return answers;
2995
- }
2996
- } catch (err) {
2997
- _iterator.e(err);
2998
- } finally {
2999
- _iterator.f();
3000
- }
3001
- return answers;
3002
- });
3003
- return _prompt.apply(this, arguments);
3004
- }
3005
- function getInjectedAnswer(injected, deafultValue) {
3006
- const answer = injected.shift();
3007
- if (answer instanceof Error) {
3008
- throw answer;
3009
- }
3010
- return answer === void 0 ? deafultValue : answer;
3011
- }
3012
- function inject(answers) {
3013
- prompt._injected = (prompt._injected || []).concat(answers);
3014
- }
3015
- function override(answers) {
3016
- prompt._override = Object.assign({}, answers);
3017
- }
3018
- module2.exports = Object.assign(prompt, {
3019
- prompt,
3020
- prompts: prompts2,
3021
- inject,
3022
- override
3023
- });
3024
- }
3025
- });
3026
-
3027
321
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js
3028
- var require_action2 = __commonJS({
322
+ var require_action = __commonJS({
3029
323
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js"(exports, module2) {
3030
324
  "use strict";
3031
325
  module2.exports = (key, isSelect) => {
@@ -3085,7 +379,7 @@ var require_action2 = __commonJS({
3085
379
  });
3086
380
 
3087
381
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js
3088
- var require_strip2 = __commonJS({
382
+ var require_strip = __commonJS({
3089
383
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js"(exports, module2) {
3090
384
  "use strict";
3091
385
  module2.exports = (str) => {
@@ -3099,11 +393,72 @@ var require_strip2 = __commonJS({
3099
393
  }
3100
394
  });
3101
395
 
396
+ // node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
397
+ var require_src = __commonJS({
398
+ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module2) {
399
+ "use strict";
400
+ var ESC = "\x1B";
401
+ var CSI = `${ESC}[`;
402
+ var beep = "\x07";
403
+ var cursor = {
404
+ to(x, y) {
405
+ if (!y)
406
+ return `${CSI}${x + 1}G`;
407
+ return `${CSI}${y + 1};${x + 1}H`;
408
+ },
409
+ move(x, y) {
410
+ let ret = "";
411
+ if (x < 0)
412
+ ret += `${CSI}${-x}D`;
413
+ else if (x > 0)
414
+ ret += `${CSI}${x}C`;
415
+ if (y < 0)
416
+ ret += `${CSI}${-y}A`;
417
+ else if (y > 0)
418
+ ret += `${CSI}${y}B`;
419
+ return ret;
420
+ },
421
+ up: (count = 1) => `${CSI}${count}A`,
422
+ down: (count = 1) => `${CSI}${count}B`,
423
+ forward: (count = 1) => `${CSI}${count}C`,
424
+ backward: (count = 1) => `${CSI}${count}D`,
425
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
426
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
427
+ left: `${CSI}G`,
428
+ hide: `${CSI}?25l`,
429
+ show: `${CSI}?25h`,
430
+ save: `${ESC}7`,
431
+ restore: `${ESC}8`
432
+ };
433
+ var scroll = {
434
+ up: (count = 1) => `${CSI}S`.repeat(count),
435
+ down: (count = 1) => `${CSI}T`.repeat(count)
436
+ };
437
+ var erase = {
438
+ screen: `${CSI}2J`,
439
+ up: (count = 1) => `${CSI}1J`.repeat(count),
440
+ down: (count = 1) => `${CSI}J`.repeat(count),
441
+ line: `${CSI}2K`,
442
+ lineEnd: `${CSI}K`,
443
+ lineStart: `${CSI}1K`,
444
+ lines(count) {
445
+ let clear = "";
446
+ for (let i = 0; i < count; i++)
447
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
448
+ if (count)
449
+ clear += cursor.left;
450
+ return clear;
451
+ }
452
+ };
453
+ module2.exports = { cursor, scroll, erase, beep };
454
+ }
455
+ });
456
+
3102
457
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js
3103
- var require_clear2 = __commonJS({
458
+ var require_clear = __commonJS({
3104
459
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js"(exports, module2) {
3105
460
  "use strict";
3106
- var strip = require_strip2();
461
+ var strip = require_strip();
3107
462
  var { erase, cursor } = require_src();
3108
463
  var width = (str) => [...strip(str)].length;
3109
464
  module2.exports = function(prompt, perLine) {
@@ -3120,7 +475,7 @@ var require_clear2 = __commonJS({
3120
475
  });
3121
476
 
3122
477
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js
3123
- var require_figures2 = __commonJS({
478
+ var require_figures = __commonJS({
3124
479
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js"(exports, module2) {
3125
480
  "use strict";
3126
481
  var main = {
@@ -3157,11 +512,11 @@ var require_figures2 = __commonJS({
3157
512
  });
3158
513
 
3159
514
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js
3160
- var require_style2 = __commonJS({
515
+ var require_style = __commonJS({
3161
516
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js"(exports, module2) {
3162
517
  "use strict";
3163
518
  var c = require_kleur();
3164
- var figures = require_figures2();
519
+ var figures = require_figures();
3165
520
  var styles = Object.freeze({
3166
521
  password: { scale: 1, render: (input) => "*".repeat(input.length) },
3167
522
  emoji: { scale: 2, render: (input) => "\u{1F603}".repeat(input.length) },
@@ -3190,10 +545,10 @@ var require_style2 = __commonJS({
3190
545
  });
3191
546
 
3192
547
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js
3193
- var require_lines2 = __commonJS({
548
+ var require_lines = __commonJS({
3194
549
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js"(exports, module2) {
3195
550
  "use strict";
3196
- var strip = require_strip2();
551
+ var strip = require_strip();
3197
552
  module2.exports = function(msg, perLine) {
3198
553
  let lines = String(strip(msg) || "").split(/\r?\n/);
3199
554
  if (!perLine)
@@ -3204,7 +559,7 @@ var require_lines2 = __commonJS({
3204
559
  });
3205
560
 
3206
561
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js
3207
- var require_wrap2 = __commonJS({
562
+ var require_wrap = __commonJS({
3208
563
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js"(exports, module2) {
3209
564
  "use strict";
3210
565
  module2.exports = (msg, opts = {}) => {
@@ -3222,7 +577,7 @@ var require_wrap2 = __commonJS({
3222
577
  });
3223
578
 
3224
579
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js
3225
- var require_entriesToDisplay2 = __commonJS({
580
+ var require_entriesToDisplay = __commonJS({
3226
581
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js"(exports, module2) {
3227
582
  "use strict";
3228
583
  module2.exports = (cursor, total, maxVisible) => {
@@ -3237,28 +592,28 @@ var require_entriesToDisplay2 = __commonJS({
3237
592
  });
3238
593
 
3239
594
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js
3240
- var require_util2 = __commonJS({
595
+ var require_util = __commonJS({
3241
596
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js"(exports, module2) {
3242
597
  "use strict";
3243
598
  module2.exports = {
3244
- action: require_action2(),
3245
- clear: require_clear2(),
3246
- style: require_style2(),
3247
- strip: require_strip2(),
3248
- figures: require_figures2(),
3249
- lines: require_lines2(),
3250
- wrap: require_wrap2(),
3251
- entriesToDisplay: require_entriesToDisplay2()
599
+ action: require_action(),
600
+ clear: require_clear(),
601
+ style: require_style(),
602
+ strip: require_strip(),
603
+ figures: require_figures(),
604
+ lines: require_lines(),
605
+ wrap: require_wrap(),
606
+ entriesToDisplay: require_entriesToDisplay()
3252
607
  };
3253
608
  }
3254
609
  });
3255
610
 
3256
611
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js
3257
- var require_prompt2 = __commonJS({
612
+ var require_prompt = __commonJS({
3258
613
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js"(exports, module2) {
3259
614
  "use strict";
3260
615
  var readline = require("readline");
3261
- var { action } = require_util2();
616
+ var { action } = require_util();
3262
617
  var EventEmitter = require("events");
3263
618
  var { beep, cursor } = require_src();
3264
619
  var color = require_kleur();
@@ -3316,12 +671,12 @@ var require_prompt2 = __commonJS({
3316
671
  });
3317
672
 
3318
673
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js
3319
- var require_text2 = __commonJS({
674
+ var require_text = __commonJS({
3320
675
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js"(exports, module2) {
3321
676
  var color = require_kleur();
3322
- var Prompt = require_prompt2();
677
+ var Prompt = require_prompt();
3323
678
  var { erase, cursor } = require_src();
3324
- var { style, clear, lines, figures } = require_util2();
679
+ var { style, clear, lines, figures } = require_util();
3325
680
  var TextPrompt = class extends Prompt {
3326
681
  constructor(opts = {}) {
3327
682
  super(opts);
@@ -3503,12 +858,12 @@ ${i ? " " : figures.pointerSmall} ${color.red().italic(l)}`, ``);
3503
858
  });
3504
859
 
3505
860
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js
3506
- var require_select2 = __commonJS({
861
+ var require_select = __commonJS({
3507
862
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js"(exports, module2) {
3508
863
  "use strict";
3509
864
  var color = require_kleur();
3510
- var Prompt = require_prompt2();
3511
- var { style, clear, figures, wrap, entriesToDisplay } = require_util2();
865
+ var Prompt = require_prompt();
866
+ var { style, clear, figures, wrap, entriesToDisplay } = require_util();
3512
867
  var { cursor } = require_src();
3513
868
  var SelectPrompt = class extends Prompt {
3514
869
  constructor(opts = {}) {
@@ -3650,11 +1005,11 @@ var require_select2 = __commonJS({
3650
1005
  });
3651
1006
 
3652
1007
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js
3653
- var require_toggle2 = __commonJS({
1008
+ var require_toggle = __commonJS({
3654
1009
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js"(exports, module2) {
3655
1010
  var color = require_kleur();
3656
- var Prompt = require_prompt2();
3657
- var { style, clear } = require_util2();
1011
+ var Prompt = require_prompt();
1012
+ var { style, clear } = require_util();
3658
1013
  var { cursor, erase } = require_src();
3659
1014
  var TogglePrompt = class extends Prompt {
3660
1015
  constructor(opts = {}) {
@@ -3756,7 +1111,7 @@ var require_toggle2 = __commonJS({
3756
1111
  });
3757
1112
 
3758
1113
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js
3759
- var require_datepart2 = __commonJS({
1114
+ var require_datepart = __commonJS({
3760
1115
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js"(exports, module2) {
3761
1116
  "use strict";
3762
1117
  var DatePart = class {
@@ -3790,10 +1145,10 @@ var require_datepart2 = __commonJS({
3790
1145
  });
3791
1146
 
3792
1147
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js
3793
- var require_meridiem2 = __commonJS({
1148
+ var require_meridiem = __commonJS({
3794
1149
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js"(exports, module2) {
3795
1150
  "use strict";
3796
- var DatePart = require_datepart2();
1151
+ var DatePart = require_datepart();
3797
1152
  var Meridiem = class extends DatePart {
3798
1153
  constructor(opts = {}) {
3799
1154
  super(opts);
@@ -3814,10 +1169,10 @@ var require_meridiem2 = __commonJS({
3814
1169
  });
3815
1170
 
3816
1171
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js
3817
- var require_day2 = __commonJS({
1172
+ var require_day = __commonJS({
3818
1173
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js"(exports, module2) {
3819
1174
  "use strict";
3820
- var DatePart = require_datepart2();
1175
+ var DatePart = require_datepart();
3821
1176
  var pos = (n) => {
3822
1177
  n = n % 10;
3823
1178
  return n === 1 ? "st" : n === 2 ? "nd" : n === 3 ? "rd" : "th";
@@ -3846,10 +1201,10 @@ var require_day2 = __commonJS({
3846
1201
  });
3847
1202
 
3848
1203
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js
3849
- var require_hours2 = __commonJS({
1204
+ var require_hours = __commonJS({
3850
1205
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js"(exports, module2) {
3851
1206
  "use strict";
3852
- var DatePart = require_datepart2();
1207
+ var DatePart = require_datepart();
3853
1208
  var Hours = class extends DatePart {
3854
1209
  constructor(opts = {}) {
3855
1210
  super(opts);
@@ -3875,10 +1230,10 @@ var require_hours2 = __commonJS({
3875
1230
  });
3876
1231
 
3877
1232
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js
3878
- var require_milliseconds2 = __commonJS({
1233
+ var require_milliseconds = __commonJS({
3879
1234
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js"(exports, module2) {
3880
1235
  "use strict";
3881
- var DatePart = require_datepart2();
1236
+ var DatePart = require_datepart();
3882
1237
  var Milliseconds = class extends DatePart {
3883
1238
  constructor(opts = {}) {
3884
1239
  super(opts);
@@ -3901,10 +1256,10 @@ var require_milliseconds2 = __commonJS({
3901
1256
  });
3902
1257
 
3903
1258
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js
3904
- var require_minutes2 = __commonJS({
1259
+ var require_minutes = __commonJS({
3905
1260
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js"(exports, module2) {
3906
1261
  "use strict";
3907
- var DatePart = require_datepart2();
1262
+ var DatePart = require_datepart();
3908
1263
  var Minutes = class extends DatePart {
3909
1264
  constructor(opts = {}) {
3910
1265
  super(opts);
@@ -3928,10 +1283,10 @@ var require_minutes2 = __commonJS({
3928
1283
  });
3929
1284
 
3930
1285
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js
3931
- var require_month2 = __commonJS({
1286
+ var require_month = __commonJS({
3932
1287
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js"(exports, module2) {
3933
1288
  "use strict";
3934
- var DatePart = require_datepart2();
1289
+ var DatePart = require_datepart();
3935
1290
  var Month = class extends DatePart {
3936
1291
  constructor(opts = {}) {
3937
1292
  super(opts);
@@ -3957,10 +1312,10 @@ var require_month2 = __commonJS({
3957
1312
  });
3958
1313
 
3959
1314
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js
3960
- var require_seconds2 = __commonJS({
1315
+ var require_seconds = __commonJS({
3961
1316
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js"(exports, module2) {
3962
1317
  "use strict";
3963
- var DatePart = require_datepart2();
1318
+ var DatePart = require_datepart();
3964
1319
  var Seconds = class extends DatePart {
3965
1320
  constructor(opts = {}) {
3966
1321
  super(opts);
@@ -3984,10 +1339,10 @@ var require_seconds2 = __commonJS({
3984
1339
  });
3985
1340
 
3986
1341
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js
3987
- var require_year2 = __commonJS({
1342
+ var require_year = __commonJS({
3988
1343
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js"(exports, module2) {
3989
1344
  "use strict";
3990
- var DatePart = require_datepart2();
1345
+ var DatePart = require_datepart();
3991
1346
  var Year = class extends DatePart {
3992
1347
  constructor(opts = {}) {
3993
1348
  super(opts);
@@ -4011,32 +1366,32 @@ var require_year2 = __commonJS({
4011
1366
  });
4012
1367
 
4013
1368
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js
4014
- var require_dateparts2 = __commonJS({
1369
+ var require_dateparts = __commonJS({
4015
1370
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js"(exports, module2) {
4016
1371
  "use strict";
4017
1372
  module2.exports = {
4018
- DatePart: require_datepart2(),
4019
- Meridiem: require_meridiem2(),
4020
- Day: require_day2(),
4021
- Hours: require_hours2(),
4022
- Milliseconds: require_milliseconds2(),
4023
- Minutes: require_minutes2(),
4024
- Month: require_month2(),
4025
- Seconds: require_seconds2(),
4026
- Year: require_year2()
1373
+ DatePart: require_datepart(),
1374
+ Meridiem: require_meridiem(),
1375
+ Day: require_day(),
1376
+ Hours: require_hours(),
1377
+ Milliseconds: require_milliseconds(),
1378
+ Minutes: require_minutes(),
1379
+ Month: require_month(),
1380
+ Seconds: require_seconds(),
1381
+ Year: require_year()
4027
1382
  };
4028
1383
  }
4029
1384
  });
4030
1385
 
4031
1386
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js
4032
- var require_date2 = __commonJS({
1387
+ var require_date = __commonJS({
4033
1388
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js"(exports, module2) {
4034
1389
  "use strict";
4035
1390
  var color = require_kleur();
4036
- var Prompt = require_prompt2();
4037
- var { style, clear, figures } = require_util2();
1391
+ var Prompt = require_prompt();
1392
+ var { style, clear, figures } = require_util();
4038
1393
  var { erase, cursor } = require_src();
4039
- var { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require_dateparts2();
1394
+ var { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require_dateparts();
4040
1395
  var regex = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;
4041
1396
  var regexGroups = {
4042
1397
  1: ({ token }) => token.replace(/\\(.)/g, "$1"),
@@ -4204,12 +1559,12 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
4204
1559
  });
4205
1560
 
4206
1561
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js
4207
- var require_number2 = __commonJS({
1562
+ var require_number = __commonJS({
4208
1563
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js"(exports, module2) {
4209
1564
  var color = require_kleur();
4210
- var Prompt = require_prompt2();
1565
+ var Prompt = require_prompt();
4211
1566
  var { cursor, erase } = require_src();
4212
- var { style, figures, clear, lines } = require_util2();
1567
+ var { style, figures, clear, lines } = require_util();
4213
1568
  var isNumber = /[0-9]/;
4214
1569
  var isDef = (any) => any !== void 0;
4215
1570
  var round = (number, precision) => {
@@ -4392,13 +1747,13 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
4392
1747
  });
4393
1748
 
4394
1749
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js
4395
- var require_multiselect2 = __commonJS({
1750
+ var require_multiselect = __commonJS({
4396
1751
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js"(exports, module2) {
4397
1752
  "use strict";
4398
1753
  var color = require_kleur();
4399
1754
  var { cursor } = require_src();
4400
- var Prompt = require_prompt2();
4401
- var { clear, figures, style, wrap, entriesToDisplay } = require_util2();
1755
+ var Prompt = require_prompt();
1756
+ var { clear, figures, style, wrap, entriesToDisplay } = require_util();
4402
1757
  var MultiselectPrompt = class extends Prompt {
4403
1758
  constructor(opts = {}) {
4404
1759
  super(opts);
@@ -4618,13 +1973,13 @@ Instructions:
4618
1973
  });
4619
1974
 
4620
1975
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js
4621
- var require_autocomplete2 = __commonJS({
1976
+ var require_autocomplete = __commonJS({
4622
1977
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js"(exports, module2) {
4623
1978
  "use strict";
4624
1979
  var color = require_kleur();
4625
- var Prompt = require_prompt2();
1980
+ var Prompt = require_prompt();
4626
1981
  var { erase, cursor } = require_src();
4627
- var { style, clear, figures, wrap, entriesToDisplay } = require_util2();
1982
+ var { style, clear, figures, wrap, entriesToDisplay } = require_util();
4628
1983
  var getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);
4629
1984
  var getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);
4630
1985
  var getIndex = (arr, valOrTitle) => {
@@ -4839,13 +2194,13 @@ var require_autocomplete2 = __commonJS({
4839
2194
  });
4840
2195
 
4841
2196
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js
4842
- var require_autocompleteMultiselect2 = __commonJS({
2197
+ var require_autocompleteMultiselect = __commonJS({
4843
2198
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports, module2) {
4844
2199
  "use strict";
4845
2200
  var color = require_kleur();
4846
2201
  var { cursor } = require_src();
4847
- var MultiselectPrompt = require_multiselect2();
4848
- var { clear, style, figures } = require_util2();
2202
+ var MultiselectPrompt = require_multiselect();
2203
+ var { clear, style, figures } = require_util();
4849
2204
  var AutocompleteMultiselectPrompt = class extends MultiselectPrompt {
4850
2205
  constructor(opts = {}) {
4851
2206
  opts.overrideRender = true;
@@ -5004,11 +2359,11 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
5004
2359
  });
5005
2360
 
5006
2361
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js
5007
- var require_confirm2 = __commonJS({
2362
+ var require_confirm = __commonJS({
5008
2363
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js"(exports, module2) {
5009
2364
  var color = require_kleur();
5010
- var Prompt = require_prompt2();
5011
- var { style, clear } = require_util2();
2365
+ var Prompt = require_prompt();
2366
+ var { style, clear } = require_util();
5012
2367
  var { erase, cursor } = require_src();
5013
2368
  var ConfirmPrompt = class extends Prompt {
5014
2369
  constructor(opts = {}) {
@@ -5079,29 +2434,29 @@ var require_confirm2 = __commonJS({
5079
2434
  });
5080
2435
 
5081
2436
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js
5082
- var require_elements2 = __commonJS({
2437
+ var require_elements = __commonJS({
5083
2438
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js"(exports, module2) {
5084
2439
  "use strict";
5085
2440
  module2.exports = {
5086
- TextPrompt: require_text2(),
5087
- SelectPrompt: require_select2(),
5088
- TogglePrompt: require_toggle2(),
5089
- DatePrompt: require_date2(),
5090
- NumberPrompt: require_number2(),
5091
- MultiselectPrompt: require_multiselect2(),
5092
- AutocompletePrompt: require_autocomplete2(),
5093
- AutocompleteMultiselectPrompt: require_autocompleteMultiselect2(),
5094
- ConfirmPrompt: require_confirm2()
2441
+ TextPrompt: require_text(),
2442
+ SelectPrompt: require_select(),
2443
+ TogglePrompt: require_toggle(),
2444
+ DatePrompt: require_date(),
2445
+ NumberPrompt: require_number(),
2446
+ MultiselectPrompt: require_multiselect(),
2447
+ AutocompletePrompt: require_autocomplete(),
2448
+ AutocompleteMultiselectPrompt: require_autocompleteMultiselect(),
2449
+ ConfirmPrompt: require_confirm()
5095
2450
  };
5096
2451
  }
5097
2452
  });
5098
2453
 
5099
2454
  // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js
5100
- var require_prompts2 = __commonJS({
2455
+ var require_prompts = __commonJS({
5101
2456
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js"(exports) {
5102
2457
  "use strict";
5103
2458
  var $ = exports;
5104
- var el = require_elements2();
2459
+ var el = require_elements();
5105
2460
  var noop = (v) => v;
5106
2461
  function toPrompt(type, args, opts = {}) {
5107
2462
  return new Promise((res, rej) => {
@@ -5164,7 +2519,7 @@ var require_prompts2 = __commonJS({
5164
2519
  var require_lib = __commonJS({
5165
2520
  "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js"(exports, module2) {
5166
2521
  "use strict";
5167
- var prompts2 = require_prompts2();
2522
+ var prompts2 = require_prompts();
5168
2523
  var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
5169
2524
  var noop = () => {
5170
2525
  };
@@ -5237,29 +2592,11 @@ var require_lib = __commonJS({
5237
2592
  }
5238
2593
  });
5239
2594
 
5240
- // node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js
5241
- var require_prompts3 = __commonJS({
5242
- "node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js"(exports, module2) {
5243
- function isNodeLT(tar) {
5244
- tar = (Array.isArray(tar) ? tar : tar.split(".")).map(Number);
5245
- let i = 0, src = process.versions.node.split(".").map(Number);
5246
- for (; i < tar.length; i++) {
5247
- if (src[i] > tar[i])
5248
- return false;
5249
- if (tar[i] > src[i])
5250
- return true;
5251
- }
5252
- return false;
5253
- }
5254
- module2.exports = isNodeLT("8.6.0") ? require_dist() : require_lib();
5255
- }
5256
- });
5257
-
5258
- // index.js
5259
- var import_fs3 = __toESM(require("fs"), 1);
5260
- var import_path3 = __toESM(require("path"), 1);
2595
+ // index.ts
2596
+ var fs4 = __toESM(require("fs"), 1);
2597
+ var path4 = __toESM(require("path"), 1);
5261
2598
  var import_minimist = __toESM(require_minimist(), 1);
5262
- var import_prompts = __toESM(require_prompts3(), 1);
2599
+ var import_prompts = __toESM(require_lib(), 1);
5263
2600
 
5264
2601
  // node_modules/.pnpm/kolorist@1.5.1/node_modules/kolorist/dist/esm/index.mjs
5265
2602
  var enabled = true;
@@ -5343,11 +2680,11 @@ var bgLightMagenta = kolorist(105, 49);
5343
2680
  var bgLightCyan = kolorist(106, 49);
5344
2681
  var bgLightGray = kolorist(47, 49);
5345
2682
 
5346
- // utils/renderTemplate.js
5347
- var import_fs = __toESM(require("fs"), 1);
5348
- var import_path = __toESM(require("path"), 1);
2683
+ // utils/renderTemplate.ts
2684
+ var fs = __toESM(require("fs"), 1);
2685
+ var path = __toESM(require("path"), 1);
5349
2686
 
5350
- // utils/deepMerge.js
2687
+ // utils/deepMerge.ts
5351
2688
  var isObject = (val) => val && typeof val === "object";
5352
2689
  var mergeArrayWithDedupe = (a, b) => Array.from(/* @__PURE__ */ new Set([...a, ...b]));
5353
2690
  function deepMerge(target, obj) {
@@ -5366,7 +2703,7 @@ function deepMerge(target, obj) {
5366
2703
  }
5367
2704
  var deepMerge_default = deepMerge;
5368
2705
 
5369
- // utils/sortDependencies.js
2706
+ // utils/sortDependencies.ts
5370
2707
  function sortDependencies(packageJson) {
5371
2708
  const sorted = {};
5372
2709
  const depTypes = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
@@ -5384,40 +2721,43 @@ function sortDependencies(packageJson) {
5384
2721
  };
5385
2722
  }
5386
2723
 
5387
- // utils/renderTemplate.js
2724
+ // utils/renderTemplate.ts
5388
2725
  function renderTemplate(src, dest) {
5389
- const stats = import_fs.default.statSync(src);
2726
+ const stats = fs.statSync(src);
5390
2727
  if (stats.isDirectory()) {
5391
- import_fs.default.mkdirSync(dest, { recursive: true });
5392
- for (const file of import_fs.default.readdirSync(src)) {
5393
- renderTemplate(import_path.default.resolve(src, file), import_path.default.resolve(dest, file));
2728
+ if (path.basename(src) === "node_modules") {
2729
+ return;
2730
+ }
2731
+ fs.mkdirSync(dest, { recursive: true });
2732
+ for (const file of fs.readdirSync(src)) {
2733
+ renderTemplate(path.resolve(src, file), path.resolve(dest, file));
5394
2734
  }
5395
2735
  return;
5396
2736
  }
5397
- const filename = import_path.default.basename(src);
5398
- if (filename === "package.json" && import_fs.default.existsSync(dest)) {
5399
- const existing = JSON.parse(import_fs.default.readFileSync(dest));
5400
- const newPackage = JSON.parse(import_fs.default.readFileSync(src));
2737
+ const filename = path.basename(src);
2738
+ if (filename === "package.json" && fs.existsSync(dest)) {
2739
+ const existing = JSON.parse(fs.readFileSync(dest, "utf8"));
2740
+ const newPackage = JSON.parse(fs.readFileSync(src, "utf8"));
5401
2741
  const pkg = sortDependencies(deepMerge_default(existing, newPackage));
5402
- import_fs.default.writeFileSync(dest, JSON.stringify(pkg, null, 2) + "\n");
2742
+ fs.writeFileSync(dest, JSON.stringify(pkg, null, 2) + "\n");
5403
2743
  return;
5404
2744
  }
5405
2745
  if (filename.startsWith("_")) {
5406
- dest = import_path.default.resolve(import_path.default.dirname(dest), filename.replace(/^_/, "."));
2746
+ dest = path.resolve(path.dirname(dest), filename.replace(/^_/, "."));
5407
2747
  }
5408
- import_fs.default.copyFileSync(src, dest);
2748
+ fs.copyFileSync(src, dest);
5409
2749
  }
5410
2750
  var renderTemplate_default = renderTemplate;
5411
2751
 
5412
- // utils/directoryTraverse.js
5413
- var import_fs2 = __toESM(require("fs"), 1);
5414
- var import_path2 = __toESM(require("path"), 1);
2752
+ // utils/directoryTraverse.ts
2753
+ var fs2 = __toESM(require("fs"), 1);
2754
+ var path2 = __toESM(require("path"), 1);
5415
2755
  function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
5416
- for (const filename of import_fs2.default.readdirSync(dir)) {
5417
- const fullpath = import_path2.default.resolve(dir, filename);
5418
- if (import_fs2.default.lstatSync(fullpath).isDirectory()) {
2756
+ for (const filename of fs2.readdirSync(dir)) {
2757
+ const fullpath = path2.resolve(dir, filename);
2758
+ if (fs2.lstatSync(fullpath).isDirectory()) {
5419
2759
  dirCallback(fullpath);
5420
- if (import_fs2.default.existsSync(fullpath)) {
2760
+ if (fs2.existsSync(fullpath)) {
5421
2761
  preOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
5422
2762
  }
5423
2763
  continue;
@@ -5426,9 +2766,9 @@ function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
5426
2766
  }
5427
2767
  }
5428
2768
  function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
5429
- for (const filename of import_fs2.default.readdirSync(dir)) {
5430
- const fullpath = import_path2.default.resolve(dir, filename);
5431
- if (import_fs2.default.lstatSync(fullpath).isDirectory()) {
2769
+ for (const filename of fs2.readdirSync(dir)) {
2770
+ const fullpath = path2.resolve(dir, filename);
2771
+ if (fs2.lstatSync(fullpath).isDirectory()) {
5432
2772
  postOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
5433
2773
  dirCallback(fullpath);
5434
2774
  continue;
@@ -5437,7 +2777,7 @@ function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
5437
2777
  }
5438
2778
  }
5439
2779
 
5440
- // utils/getCommand.js
2780
+ // utils/getCommand.ts
5441
2781
  function getCommand(packageManager, scriptName) {
5442
2782
  if (scriptName === "install") {
5443
2783
  return packageManager === "yarn" ? "yarn" : `${packageManager} install`;
@@ -5445,21 +2785,37 @@ function getCommand(packageManager, scriptName) {
5445
2785
  return packageManager === "npm" ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`;
5446
2786
  }
5447
2787
 
5448
- // utils/generateReadme.js
5449
- var sfcTypeSupportDoc = "\n## Type Support for `.vue` Imports in TS\n\nSince TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates.\n\nHowever, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can run `Volar: Switch TS Plugin on/off` from VSCode command palette.\n";
2788
+ // utils/generateReadme.ts
2789
+ var sfcTypeSupportDoc = [
2790
+ "",
2791
+ "## Type Support for `.vue` Imports in TS",
2792
+ "",
2793
+ "TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.",
2794
+ "",
2795
+ "If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:",
2796
+ "",
2797
+ "1. Disable the built-in TypeScript Extension",
2798
+ " 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette",
2799
+ " 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`",
2800
+ "2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.",
2801
+ ""
2802
+ ].join("\n");
5450
2803
  function generateReadme({
5451
2804
  projectName,
5452
2805
  packageManager,
5453
2806
  needsTypeScript,
5454
- needsTests
2807
+ needsCypress,
2808
+ needsCypressCT,
2809
+ needsVitest,
2810
+ needsEslint
5455
2811
  }) {
5456
2812
  let readme = `# ${projectName}
5457
2813
 
5458
- This template should help get you started developing with Vue 2 in Vite.
2814
+ This template should help get you started developing with Vue 3 in Vite.
5459
2815
 
5460
2816
  ## Recommended IDE Setup
5461
2817
 
5462
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur).
2818
+ [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
5463
2819
  ${needsTypeScript ? sfcTypeSupportDoc : ""}
5464
2820
  ## Customize configuration
5465
2821
 
@@ -5484,50 +2840,178 @@ ${getCommand(packageManager, "dev")}
5484
2840
  ${getCommand(packageManager, "build")}
5485
2841
  \`\`\`
5486
2842
  `;
5487
- if (needsTests) {
2843
+ if (needsVitest) {
5488
2844
  npmScriptsDescriptions += `
5489
- ### Run Unit Tests with [Cypress Component Testing](https://docs.cypress.io/guides/component-testing/introduction)
2845
+ ### Run Unit Tests with [Vitest](https://vitest.dev/)
5490
2846
 
5491
2847
  \`\`\`sh
5492
- ${getCommand(packageManager, "test:unit")} # or \`${getCommand(packageManager, "test:unit:ci")}\` for headless testing
2848
+ ${getCommand(packageManager, "test:unit")}
5493
2849
  \`\`\`
2850
+ `;
2851
+ }
2852
+ if (needsCypressCT) {
2853
+ npmScriptsDescriptions += `
2854
+ ### Run Headed Component Tests with [Cypress Component Testing](https://on.cypress.io/component)
5494
2855
 
2856
+ \`\`\`sh
2857
+ ${getCommand(packageManager, "test:unit")} # or \`${getCommand(packageManager, "test:unit:ci")}\` for headless testing
2858
+ \`\`\`
2859
+ `;
2860
+ }
2861
+ if (needsCypress) {
2862
+ npmScriptsDescriptions += `
5495
2863
  ### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
5496
2864
 
5497
2865
  \`\`\`sh
5498
2866
  ${getCommand(packageManager, "build")}
5499
2867
  ${getCommand(packageManager, "test:e2e")} # or \`${getCommand(packageManager, "test:e2e:ci")}\` for headless testing
5500
2868
  \`\`\`
2869
+ `;
2870
+ }
2871
+ if (needsEslint) {
2872
+ npmScriptsDescriptions += `
2873
+ ### Lint with [ESLint](https://eslint.org/)
2874
+
2875
+ \`\`\`sh
2876
+ ${getCommand(packageManager, "lint")}
2877
+ \`\`\`
5501
2878
  `;
5502
2879
  }
5503
2880
  readme += npmScriptsDescriptions;
5504
2881
  return readme;
5505
2882
  }
5506
2883
 
5507
- // index.js
2884
+ // utils/renderEslint.ts
2885
+ var fs3 = __toESM(require("fs"), 1);
2886
+ var path3 = __toESM(require("path"), 1);
2887
+
2888
+ // template/eslint/package.json
2889
+ var devDependencies = {
2890
+ "@rushstack/eslint-patch": "^1.1.0",
2891
+ "@vue/eslint-config-prettier": "^7.0.0",
2892
+ "@vue/eslint-config-typescript": "^11.0.0",
2893
+ eslint: "^8.5.0",
2894
+ "eslint-plugin-cypress": "^2.12.1",
2895
+ "eslint-plugin-vue": "^9.0.0",
2896
+ prettier: "^2.5.1"
2897
+ };
2898
+
2899
+ // utils/renderEslint.ts
2900
+ var dependencies = {};
2901
+ function addEslintDependency(name) {
2902
+ dependencies[name] = devDependencies[name];
2903
+ }
2904
+ addEslintDependency("eslint");
2905
+ addEslintDependency("eslint-plugin-vue");
2906
+ var config = {
2907
+ root: true,
2908
+ extends: ["plugin:vue/essential"]
2909
+ };
2910
+ function configureEslint({ language, styleGuide, needsPrettier, needsCypress, needsCypressCT }) {
2911
+ switch (`${styleGuide}-${language}`) {
2912
+ case "default-javascript":
2913
+ config.extends.push("eslint:recommended");
2914
+ break;
2915
+ case "default-typescript":
2916
+ addEslintDependency("@vue/eslint-config-typescript");
2917
+ config.extends.push("eslint:recommended");
2918
+ config.extends.push("@vue/eslint-config-typescript/recommended");
2919
+ break;
2920
+ }
2921
+ if (needsPrettier) {
2922
+ addEslintDependency("prettier");
2923
+ addEslintDependency("@vue/eslint-config-prettier");
2924
+ config.extends.push("@vue/eslint-config-prettier");
2925
+ }
2926
+ if (needsCypress) {
2927
+ const cypressOverrides = [
2928
+ {
2929
+ files: needsCypressCT ? ["**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}", "cypress/e2e/**.{cy,spec}.{js,ts,jsx,tsx}"] : ["cypress/e2e/**.{cy,spec}.{js,ts,jsx,tsx}"],
2930
+ extends: ["plugin:cypress/recommended"]
2931
+ }
2932
+ ];
2933
+ addEslintDependency("eslint-plugin-cypress");
2934
+ config.overrides = cypressOverrides;
2935
+ }
2936
+ let configuration = "/* eslint-env node */\n";
2937
+ if (styleGuide !== "default" || language !== "javascript" || needsPrettier) {
2938
+ addEslintDependency("@rushstack/eslint-patch");
2939
+ configuration += `require("@rushstack/eslint-patch/modern-module-resolution");
2940
+
2941
+ `;
2942
+ }
2943
+ configuration += `module.exports = ${JSON.stringify(config, void 0, 2)}
2944
+ `;
2945
+ return {
2946
+ dependencies,
2947
+ configuration
2948
+ };
2949
+ }
2950
+ function renderEslint(rootDir, { needsTypeScript, needsCypress, needsCypressCT, needsPrettier }) {
2951
+ const { dependencies: dependencies2, configuration } = configureEslint({
2952
+ language: needsTypeScript ? "typescript" : "javascript",
2953
+ styleGuide: "default",
2954
+ needsPrettier,
2955
+ needsCypress,
2956
+ needsCypressCT
2957
+ });
2958
+ const packageJsonPath = path3.resolve(rootDir, "package.json");
2959
+ const existingPkg = JSON.parse(fs3.readFileSync(packageJsonPath, "utf8"));
2960
+ const pkg = sortDependencies(deepMerge_default(existingPkg, {
2961
+ scripts: {
2962
+ lint: needsTypeScript ? "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" : "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
2963
+ },
2964
+ devDependencies: dependencies2
2965
+ }));
2966
+ fs3.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
2967
+ const eslintrcPath = path3.resolve(rootDir, ".eslintrc.cjs");
2968
+ fs3.writeFileSync(eslintrcPath, configuration);
2969
+ }
2970
+
2971
+ // utils/banner.ts
2972
+ var banner = "\x1B[38;2;66;211;146mV\x1B[39m\x1B[38;2;66;211;146mu\x1B[39m\x1B[38;2;66;211;146me\x1B[39m\x1B[38;2;66;211;146m.\x1B[39m\x1B[38;2;66;211;146mj\x1B[39m\x1B[38;2;67;209;149ms\x1B[39m \x1B[38;2;68;206;152m-\x1B[39m \x1B[38;2;69;204;155mT\x1B[39m\x1B[38;2;70;201;158mh\x1B[39m\x1B[38;2;71;199;162me\x1B[39m \x1B[38;2;72;196;165mP\x1B[39m\x1B[38;2;73;194;168mr\x1B[39m\x1B[38;2;74;192;171mo\x1B[39m\x1B[38;2;75;189;174mg\x1B[39m\x1B[38;2;76;187;177mr\x1B[39m\x1B[38;2;77;184;180me\x1B[39m\x1B[38;2;78;182;183ms\x1B[39m\x1B[38;2;79;179;186ms\x1B[39m\x1B[38;2;80;177;190mi\x1B[39m\x1B[38;2;81;175;193mv\x1B[39m\x1B[38;2;82;172;196me\x1B[39m \x1B[38;2;83;170;199mJ\x1B[39m\x1B[38;2;83;167;202ma\x1B[39m\x1B[38;2;84;165;205mv\x1B[39m\x1B[38;2;85;162;208ma\x1B[39m\x1B[38;2;86;160;211mS\x1B[39m\x1B[38;2;87;158;215mc\x1B[39m\x1B[38;2;88;155;218mr\x1B[39m\x1B[38;2;89;153;221mi\x1B[39m\x1B[38;2;90;150;224mp\x1B[39m\x1B[38;2;91;148;227mt\x1B[39m \x1B[38;2;92;145;230mF\x1B[39m\x1B[38;2;93;143;233mr\x1B[39m\x1B[38;2;94;141;236ma\x1B[39m\x1B[38;2;95;138;239mm\x1B[39m\x1B[38;2;96;136;243me\x1B[39m\x1B[38;2;97;133;246mw\x1B[39m\x1B[38;2;98;131;249mo\x1B[39m\x1B[38;2;99;128;252mr\x1B[39m\x1B[38;2;100;126;255mk\x1B[39m";
2973
+ var banner_default = banner;
2974
+
2975
+ // index.ts
5508
2976
  function isValidPackageName(projectName) {
5509
2977
  return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName);
5510
2978
  }
5511
2979
  function toValidPackageName(projectName) {
5512
2980
  return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9-~]+/g, "-");
5513
2981
  }
5514
- function canSafelyOverwrite(dir) {
5515
- return !import_fs3.default.existsSync(dir) || import_fs3.default.readdirSync(dir).length === 0;
2982
+ function canSkipEmptying(dir) {
2983
+ if (!fs4.existsSync(dir)) {
2984
+ return true;
2985
+ }
2986
+ const files = fs4.readdirSync(dir);
2987
+ if (files.length === 0) {
2988
+ return true;
2989
+ }
2990
+ if (files.length === 1 && files[0] === ".git") {
2991
+ return true;
2992
+ }
2993
+ return false;
5516
2994
  }
5517
2995
  function emptyDir(dir) {
5518
- postOrderDirectoryTraverse(dir, (dir2) => import_fs3.default.rmdirSync(dir2), (file) => import_fs3.default.unlinkSync(file));
2996
+ if (!fs4.existsSync(dir)) {
2997
+ return;
2998
+ }
2999
+ postOrderDirectoryTraverse(dir, (dir2) => fs4.rmdirSync(dir2), (file) => fs4.unlinkSync(file));
5519
3000
  }
5520
3001
  async function init() {
3002
+ console.log(`
3003
+ ${banner_default}
3004
+ `);
5521
3005
  const cwd = process.cwd();
5522
3006
  const argv = (0, import_minimist.default)(process.argv.slice(2), {
5523
3007
  alias: {
5524
3008
  typescript: ["ts"],
5525
- "with-tests": ["tests", "cypress"],
3009
+ "with-tests": ["tests"],
5526
3010
  router: ["vue-router"]
5527
3011
  },
5528
3012
  boolean: true
5529
3013
  });
5530
- const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.router || argv.pinia || argv.tests) === "boolean";
3014
+ const isFeatureFlagsUsed = typeof (argv.default ?? argv.ts ?? argv.jsx ?? argv.router ?? argv.pinia ?? argv.tests ?? argv.vitest ?? argv.cypress ?? argv.eslint) === "boolean";
5531
3015
  let targetDir = argv._[0];
5532
3016
  const defaultProjectName = !targetDir ? "vue-project" : targetDir;
5533
3017
  const forceOverwrite = argv.force;
@@ -5543,7 +3027,7 @@ async function init() {
5543
3027
  },
5544
3028
  {
5545
3029
  name: "shouldOverwrite",
5546
- type: () => canSafelyOverwrite(targetDir) || forceOverwrite ? null : "confirm",
3030
+ type: () => canSkipEmptying(targetDir) || forceOverwrite ? null : "confirm",
5547
3031
  message: () => {
5548
3032
  const dirForPrompt = targetDir === "." ? "Current directory" : `Target directory "${targetDir}"`;
5549
3033
  return `${dirForPrompt} is not empty. Remove existing files and continue?`;
@@ -5551,7 +3035,7 @@ async function init() {
5551
3035
  },
5552
3036
  {
5553
3037
  name: "overwriteChecker",
5554
- type: (prev, values = {}) => {
3038
+ type: (prev, values) => {
5555
3039
  if (values.shouldOverwrite === false) {
5556
3040
  throw new Error(red("\u2716") + " Operation cancelled");
5557
3041
  }
@@ -5573,6 +3057,14 @@ async function init() {
5573
3057
  active: "Yes",
5574
3058
  inactive: "No"
5575
3059
  },
3060
+ {
3061
+ name: "needsJsx",
3062
+ type: () => isFeatureFlagsUsed ? null : "toggle",
3063
+ message: "Add JSX Support?",
3064
+ initial: false,
3065
+ active: "Yes",
3066
+ inactive: "No"
3067
+ },
5576
3068
  {
5577
3069
  name: "needsRouter",
5578
3070
  type: () => isFeatureFlagsUsed ? null : "toggle",
@@ -5590,9 +3082,38 @@ async function init() {
5590
3082
  inactive: "No"
5591
3083
  },
5592
3084
  {
5593
- name: "needsTests",
3085
+ name: "needsVitest",
3086
+ type: () => isFeatureFlagsUsed ? null : "toggle",
3087
+ message: "Add Vitest for Unit Testing?",
3088
+ initial: false,
3089
+ active: "Yes",
3090
+ inactive: "No"
3091
+ },
3092
+ {
3093
+ name: "needsCypress",
3094
+ type: () => isFeatureFlagsUsed ? null : "toggle",
3095
+ message: (prev, answers) => answers.needsVitest ? "Add Cypress for End-to-End testing?" : "Add Cypress for both Unit and End-to-End testing?",
3096
+ initial: false,
3097
+ active: "Yes",
3098
+ inactive: "No"
3099
+ },
3100
+ {
3101
+ name: "needsEslint",
5594
3102
  type: () => isFeatureFlagsUsed ? null : "toggle",
5595
- message: "Add Cypress for testing?",
3103
+ message: "Add ESLint for code quality?",
3104
+ initial: false,
3105
+ active: "Yes",
3106
+ inactive: "No"
3107
+ },
3108
+ {
3109
+ name: "needsPrettier",
3110
+ type: (prev, values) => {
3111
+ if (isFeatureFlagsUsed || !values.needsEslint) {
3112
+ return null;
3113
+ }
3114
+ return "toggle";
3115
+ },
3116
+ message: "Add Prettier for code formatting?",
5596
3117
  initial: false,
5597
3118
  active: "Yes",
5598
3119
  inactive: "No"
@@ -5607,40 +3128,68 @@ async function init() {
5607
3128
  process.exit(1);
5608
3129
  }
5609
3130
  const {
5610
- packageName = toValidPackageName(defaultProjectName),
5611
- shouldOverwrite,
3131
+ projectName,
3132
+ packageName = projectName ?? defaultProjectName,
3133
+ shouldOverwrite = argv.force,
3134
+ needsJsx = argv.jsx,
5612
3135
  needsTypeScript = argv.typescript,
5613
3136
  needsRouter = argv.router,
5614
3137
  needsPinia = argv.pinia,
5615
- needsTests = argv.tests
3138
+ needsCypress = argv.cypress || argv.tests,
3139
+ needsVitest = argv.vitest || argv.tests,
3140
+ needsEslint = argv.eslint || argv["eslint-with-prettier"],
3141
+ needsPrettier = argv["eslint-with-prettier"]
5616
3142
  } = result;
5617
- const root = import_path3.default.join(cwd, targetDir);
5618
- if (shouldOverwrite) {
3143
+ const needsCypressCT = needsCypress && !needsVitest;
3144
+ const root = path4.join(cwd, targetDir);
3145
+ if (fs4.existsSync(root) && shouldOverwrite) {
5619
3146
  emptyDir(root);
5620
- } else if (!import_fs3.default.existsSync(root)) {
5621
- import_fs3.default.mkdirSync(root);
3147
+ } else if (!fs4.existsSync(root)) {
3148
+ fs4.mkdirSync(root);
5622
3149
  }
5623
3150
  console.log(`
5624
3151
  Scaffolding project in ${root}...`);
5625
3152
  const pkg = { name: packageName, version: "0.0.0" };
5626
- import_fs3.default.writeFileSync(import_path3.default.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
5627
- const templateRoot = import_path3.default.resolve(__dirname, "template");
3153
+ fs4.writeFileSync(path4.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
3154
+ const templateRoot = path4.resolve(__dirname, "template");
5628
3155
  const render = function render2(templateName) {
5629
- const templateDir = import_path3.default.resolve(templateRoot, templateName);
3156
+ const templateDir = path4.resolve(templateRoot, templateName);
5630
3157
  renderTemplate_default(templateDir, root);
5631
3158
  };
5632
3159
  render("base");
3160
+ if (needsJsx) {
3161
+ render("config/jsx");
3162
+ }
5633
3163
  if (needsRouter) {
5634
3164
  render("config/router");
5635
3165
  }
5636
3166
  if (needsPinia) {
5637
3167
  render("config/pinia");
5638
3168
  }
5639
- if (needsTests) {
3169
+ if (needsVitest) {
3170
+ render("config/vitest");
3171
+ }
3172
+ if (needsCypress) {
5640
3173
  render("config/cypress");
5641
3174
  }
3175
+ if (needsCypressCT) {
3176
+ render("config/cypress-ct");
3177
+ }
5642
3178
  if (needsTypeScript) {
5643
3179
  render("config/typescript");
3180
+ render("tsconfig/base");
3181
+ if (needsCypress) {
3182
+ render("tsconfig/cypress");
3183
+ }
3184
+ if (needsCypressCT) {
3185
+ render("tsconfig/cypress-ct");
3186
+ }
3187
+ if (needsVitest) {
3188
+ render("tsconfig/vitest");
3189
+ }
3190
+ }
3191
+ if (needsEslint) {
3192
+ renderEslint(root, { needsTypeScript, needsCypress, needsCypressCT, needsPrettier });
5644
3193
  }
5645
3194
  const codeTemplate = (needsTypeScript ? "typescript-" : "") + (needsRouter ? "router" : "default");
5646
3195
  render(`code/${codeTemplate}`);
@@ -5657,39 +3206,48 @@ Scaffolding project in ${root}...`);
5657
3206
  preOrderDirectoryTraverse(root, () => {
5658
3207
  }, (filepath) => {
5659
3208
  if (filepath.endsWith(".js")) {
5660
- import_fs3.default.renameSync(filepath, filepath.replace(/\.js$/, ".ts"));
5661
- } else if (import_path3.default.basename(filepath) === "jsconfig.json") {
5662
- import_fs3.default.renameSync(filepath, filepath.replace(/jsconfig\.json$/, "tsconfig.json"));
3209
+ const tsFilePath = filepath.replace(/\.js$/, ".ts");
3210
+ if (fs4.existsSync(tsFilePath)) {
3211
+ fs4.unlinkSync(filepath);
3212
+ } else {
3213
+ fs4.renameSync(filepath, tsFilePath);
3214
+ }
3215
+ } else if (path4.basename(filepath) === "jsconfig.json") {
3216
+ fs4.unlinkSync(filepath);
5663
3217
  }
5664
3218
  });
5665
- const indexHtmlPath = import_path3.default.resolve(root, "index.html");
5666
- const indexHtmlContent = import_fs3.default.readFileSync(indexHtmlPath, "utf8");
5667
- import_fs3.default.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
5668
- }
5669
- if (!needsTests) {
5670
- preOrderDirectoryTraverse(root, (dirpath) => {
5671
- const dirname = import_path3.default.basename(dirpath);
5672
- if (dirname === "cypress" || dirname === "__tests__") {
5673
- emptyDir(dirpath);
5674
- import_fs3.default.rmdirSync(dirpath);
5675
- }
5676
- }, () => {
3219
+ const indexHtmlPath = path4.resolve(root, "index.html");
3220
+ const indexHtmlContent = fs4.readFileSync(indexHtmlPath, "utf8");
3221
+ fs4.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
3222
+ } else {
3223
+ preOrderDirectoryTraverse(root, () => {
3224
+ }, (filepath) => {
3225
+ if (filepath.endsWith(".ts")) {
3226
+ fs4.unlinkSync(filepath);
3227
+ }
5677
3228
  });
5678
3229
  }
5679
- const packageManager = /pnpm/.test(process.env.npm_execpath) ? "pnpm" : /yarn/.test(process.env.npm_execpath) ? "yarn" : "npm";
5680
- import_fs3.default.writeFileSync(import_path3.default.resolve(root, "README.md"), generateReadme({
5681
- projectName: result.projectName || defaultProjectName,
3230
+ const userAgent = process.env.npm_config_user_agent ?? "";
3231
+ const packageManager = /pnpm/.test(userAgent) ? "pnpm" : /yarn/.test(userAgent) ? "yarn" : "npm";
3232
+ fs4.writeFileSync(path4.resolve(root, "README.md"), generateReadme({
3233
+ projectName: result.projectName ?? defaultProjectName,
5682
3234
  packageManager,
5683
3235
  needsTypeScript,
5684
- needsTests
3236
+ needsVitest,
3237
+ needsCypress,
3238
+ needsCypressCT,
3239
+ needsEslint
5685
3240
  }));
5686
3241
  console.log(`
5687
3242
  Done. Now run:
5688
3243
  `);
5689
3244
  if (root !== cwd) {
5690
- console.log(` ${bold(green(`cd ${import_path3.default.relative(cwd, root)}`))}`);
3245
+ console.log(` ${bold(green(`cd ${path4.relative(cwd, root)}`))}`);
5691
3246
  }
5692
3247
  console.log(` ${bold(green(getCommand(packageManager, "install")))}`);
3248
+ if (needsPrettier) {
3249
+ console.log(` ${bold(green(getCommand(packageManager, "lint")))}`);
3250
+ }
5693
3251
  console.log(` ${bold(green(getCommand(packageManager, "dev")))}`);
5694
3252
  console.log();
5695
3253
  }