@itsflower/cli 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{flower.js → main.js} +492 -630
- package/package.json +3 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __getProtoOf = Object.getPrototypeOf;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
@@ -593,18 +592,142 @@ var init_dist = __esm(() => {
|
|
|
593
592
|
negativePrefixRe = /^no[-A-Z]/;
|
|
594
593
|
});
|
|
595
594
|
|
|
595
|
+
// ../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
596
|
+
var require_src = __commonJS((exports, module) => {
|
|
597
|
+
var ESC2 = "\x1B";
|
|
598
|
+
var CSI2 = `${ESC2}[`;
|
|
599
|
+
var beep = "\x07";
|
|
600
|
+
var cursor = {
|
|
601
|
+
to(x, y) {
|
|
602
|
+
if (!y)
|
|
603
|
+
return `${CSI2}${x + 1}G`;
|
|
604
|
+
return `${CSI2}${y + 1};${x + 1}H`;
|
|
605
|
+
},
|
|
606
|
+
move(x, y) {
|
|
607
|
+
let ret = "";
|
|
608
|
+
if (x < 0)
|
|
609
|
+
ret += `${CSI2}${-x}D`;
|
|
610
|
+
else if (x > 0)
|
|
611
|
+
ret += `${CSI2}${x}C`;
|
|
612
|
+
if (y < 0)
|
|
613
|
+
ret += `${CSI2}${-y}A`;
|
|
614
|
+
else if (y > 0)
|
|
615
|
+
ret += `${CSI2}${y}B`;
|
|
616
|
+
return ret;
|
|
617
|
+
},
|
|
618
|
+
up: (count = 1) => `${CSI2}${count}A`,
|
|
619
|
+
down: (count = 1) => `${CSI2}${count}B`,
|
|
620
|
+
forward: (count = 1) => `${CSI2}${count}C`,
|
|
621
|
+
backward: (count = 1) => `${CSI2}${count}D`,
|
|
622
|
+
nextLine: (count = 1) => `${CSI2}E`.repeat(count),
|
|
623
|
+
prevLine: (count = 1) => `${CSI2}F`.repeat(count),
|
|
624
|
+
left: `${CSI2}G`,
|
|
625
|
+
hide: `${CSI2}?25l`,
|
|
626
|
+
show: `${CSI2}?25h`,
|
|
627
|
+
save: `${ESC2}7`,
|
|
628
|
+
restore: `${ESC2}8`
|
|
629
|
+
};
|
|
630
|
+
var scroll = {
|
|
631
|
+
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
632
|
+
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
633
|
+
};
|
|
634
|
+
var erase = {
|
|
635
|
+
screen: `${CSI2}2J`,
|
|
636
|
+
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
637
|
+
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
638
|
+
line: `${CSI2}2K`,
|
|
639
|
+
lineEnd: `${CSI2}K`,
|
|
640
|
+
lineStart: `${CSI2}1K`,
|
|
641
|
+
lines(count) {
|
|
642
|
+
let clear = "";
|
|
643
|
+
for (let i = 0;i < count; i++)
|
|
644
|
+
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
645
|
+
if (count)
|
|
646
|
+
clear += cursor.left;
|
|
647
|
+
return clear;
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
module.exports = { cursor, scroll, erase, beep };
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
// package.json
|
|
654
|
+
var package_default;
|
|
655
|
+
var init_package = __esm(() => {
|
|
656
|
+
package_default = {
|
|
657
|
+
name: "@itsflower/cli",
|
|
658
|
+
version: "0.2.3",
|
|
659
|
+
description: "CLI for Flower - scaffold structured development workflows",
|
|
660
|
+
bin: {
|
|
661
|
+
flower: "./dist/main.js"
|
|
662
|
+
},
|
|
663
|
+
files: [
|
|
664
|
+
"dist"
|
|
665
|
+
],
|
|
666
|
+
type: "module",
|
|
667
|
+
scripts: {
|
|
668
|
+
build: "bun build ./src/main.ts --outdir ./dist --target node",
|
|
669
|
+
dev: "bun run ./src/main.ts",
|
|
670
|
+
typecheck: "tsc --noEmit"
|
|
671
|
+
},
|
|
672
|
+
dependencies: {
|
|
673
|
+
"@clack/prompts": "^1.2.0",
|
|
674
|
+
citty: "^0.2.2"
|
|
675
|
+
},
|
|
676
|
+
devDependencies: {
|
|
677
|
+
"@types/bun": "^1.3.12",
|
|
678
|
+
typescript: "^6.0.2"
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
// src/commands/version.ts
|
|
684
|
+
var exports_version = {};
|
|
685
|
+
__export(exports_version, {
|
|
686
|
+
default: () => version_default
|
|
687
|
+
});
|
|
688
|
+
var version_default;
|
|
689
|
+
var init_version = __esm(() => {
|
|
690
|
+
init_dist();
|
|
691
|
+
init_package();
|
|
692
|
+
version_default = defineCommand({
|
|
693
|
+
meta: {
|
|
694
|
+
name: "version",
|
|
695
|
+
description: "Display the current version"
|
|
696
|
+
},
|
|
697
|
+
run: () => {
|
|
698
|
+
console.log(`${package_default.name}@${package_default.version}`);
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
// src/main.ts
|
|
704
|
+
init_dist();
|
|
705
|
+
|
|
706
|
+
// ../../node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
|
|
707
|
+
import { styleText as y } from "node:util";
|
|
708
|
+
import { stdout as S, stdin as $ } from "node:process";
|
|
709
|
+
import P from "node:readline";
|
|
710
|
+
|
|
596
711
|
// ../../node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
|
|
597
712
|
var isAmbiguous = (x) => {
|
|
598
713
|
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
599
|
-
}
|
|
714
|
+
};
|
|
715
|
+
var isFullWidth = (x) => {
|
|
600
716
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
601
|
-
}
|
|
717
|
+
};
|
|
718
|
+
var isWide = (x) => {
|
|
602
719
|
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9800 && x <= 9811 || x === 9855 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
603
720
|
};
|
|
604
|
-
var init_utils = () => {};
|
|
605
721
|
|
|
606
722
|
// ../../node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
|
|
607
|
-
var ANSI_RE
|
|
723
|
+
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
724
|
+
var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
725
|
+
var TAB_RE = /\t{1,1000}/y;
|
|
726
|
+
var EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
|
|
727
|
+
var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
728
|
+
var MODIFIER_RE = /\p{M}+/gu;
|
|
729
|
+
var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
730
|
+
var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
608
731
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
609
732
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
610
733
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
@@ -746,39 +869,31 @@ var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION,
|
|
|
746
869
|
truncated: truncationEnabled,
|
|
747
870
|
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
748
871
|
};
|
|
749
|
-
}
|
|
750
|
-
var
|
|
751
|
-
init_utils();
|
|
752
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
753
|
-
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
754
|
-
TAB_RE = /\t{1,1000}/y;
|
|
755
|
-
EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
|
|
756
|
-
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
757
|
-
MODIFIER_RE = /\p{M}+/gu;
|
|
758
|
-
NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
759
|
-
dist_default = getStringTruncatedWidth;
|
|
760
|
-
});
|
|
872
|
+
};
|
|
873
|
+
var dist_default = getStringTruncatedWidth;
|
|
761
874
|
|
|
762
875
|
// ../../node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
|
|
763
|
-
var NO_TRUNCATION2
|
|
876
|
+
var NO_TRUNCATION2 = {
|
|
877
|
+
limit: Infinity,
|
|
878
|
+
ellipsis: "",
|
|
879
|
+
ellipsisWidth: 0
|
|
880
|
+
};
|
|
881
|
+
var fastStringWidth = (input, options = {}) => {
|
|
764
882
|
return dist_default(input, NO_TRUNCATION2, options).width;
|
|
765
|
-
}
|
|
766
|
-
var
|
|
767
|
-
init_dist2();
|
|
768
|
-
NO_TRUNCATION2 = {
|
|
769
|
-
limit: Infinity,
|
|
770
|
-
ellipsis: "",
|
|
771
|
-
ellipsisWidth: 0
|
|
772
|
-
};
|
|
773
|
-
dist_default2 = fastStringWidth;
|
|
774
|
-
});
|
|
883
|
+
};
|
|
884
|
+
var dist_default2 = fastStringWidth;
|
|
775
885
|
|
|
776
886
|
// ../../node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
var
|
|
887
|
+
var ESC = "\x1B";
|
|
888
|
+
var CSI = "";
|
|
889
|
+
var END_CODE = 39;
|
|
890
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
891
|
+
var ANSI_CSI = "[";
|
|
892
|
+
var ANSI_OSC = "]";
|
|
893
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
894
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
895
|
+
var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
896
|
+
var getClosingCode = (openingCode) => {
|
|
782
897
|
if (openingCode >= 30 && openingCode <= 37)
|
|
783
898
|
return 39;
|
|
784
899
|
if (openingCode >= 90 && openingCode <= 97)
|
|
@@ -802,7 +917,10 @@ var ESC = "\x1B", CSI = "", END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI
|
|
|
802
917
|
if (openingCode === 0)
|
|
803
918
|
return 0;
|
|
804
919
|
return;
|
|
805
|
-
}
|
|
920
|
+
};
|
|
921
|
+
var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
922
|
+
var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
923
|
+
var wrapWord = (rows, word, columns) => {
|
|
806
924
|
const characters = word[Symbol.iterator]();
|
|
807
925
|
let isInsideEscape = false;
|
|
808
926
|
let isInsideLinkEscape = false;
|
|
@@ -848,7 +966,8 @@ var ESC = "\x1B", CSI = "", END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI
|
|
|
848
966
|
if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {
|
|
849
967
|
rows[rows.length - 2] += rows.pop();
|
|
850
968
|
}
|
|
851
|
-
}
|
|
969
|
+
};
|
|
970
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
852
971
|
const words = string.split(" ");
|
|
853
972
|
let last = words.length;
|
|
854
973
|
while (last) {
|
|
@@ -861,7 +980,8 @@ var ESC = "\x1B", CSI = "", END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI
|
|
|
861
980
|
return string;
|
|
862
981
|
}
|
|
863
982
|
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
864
|
-
}
|
|
983
|
+
};
|
|
984
|
+
var exec = (string, columns, options = {}) => {
|
|
865
985
|
if (options.trim !== false && string.trim() === "") {
|
|
866
986
|
return "";
|
|
867
987
|
}
|
|
@@ -965,82 +1085,24 @@ var ESC = "\x1B", CSI = "", END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI
|
|
|
965
1085
|
}
|
|
966
1086
|
}
|
|
967
1087
|
return returnValue;
|
|
968
|
-
}
|
|
969
|
-
var
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
});
|
|
975
|
-
|
|
976
|
-
// ../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
977
|
-
var require_src = __commonJS((exports, module) => {
|
|
978
|
-
var ESC2 = "\x1B";
|
|
979
|
-
var CSI2 = `${ESC2}[`;
|
|
980
|
-
var beep = "\x07";
|
|
981
|
-
var cursor = {
|
|
982
|
-
to(x, y) {
|
|
983
|
-
if (!y)
|
|
984
|
-
return `${CSI2}${x + 1}G`;
|
|
985
|
-
return `${CSI2}${y + 1};${x + 1}H`;
|
|
986
|
-
},
|
|
987
|
-
move(x, y) {
|
|
988
|
-
let ret = "";
|
|
989
|
-
if (x < 0)
|
|
990
|
-
ret += `${CSI2}${-x}D`;
|
|
991
|
-
else if (x > 0)
|
|
992
|
-
ret += `${CSI2}${x}C`;
|
|
993
|
-
if (y < 0)
|
|
994
|
-
ret += `${CSI2}${-y}A`;
|
|
995
|
-
else if (y > 0)
|
|
996
|
-
ret += `${CSI2}${y}B`;
|
|
997
|
-
return ret;
|
|
998
|
-
},
|
|
999
|
-
up: (count = 1) => `${CSI2}${count}A`,
|
|
1000
|
-
down: (count = 1) => `${CSI2}${count}B`,
|
|
1001
|
-
forward: (count = 1) => `${CSI2}${count}C`,
|
|
1002
|
-
backward: (count = 1) => `${CSI2}${count}D`,
|
|
1003
|
-
nextLine: (count = 1) => `${CSI2}E`.repeat(count),
|
|
1004
|
-
prevLine: (count = 1) => `${CSI2}F`.repeat(count),
|
|
1005
|
-
left: `${CSI2}G`,
|
|
1006
|
-
hide: `${CSI2}?25l`,
|
|
1007
|
-
show: `${CSI2}?25h`,
|
|
1008
|
-
save: `${ESC2}7`,
|
|
1009
|
-
restore: `${ESC2}8`
|
|
1010
|
-
};
|
|
1011
|
-
var scroll = {
|
|
1012
|
-
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
1013
|
-
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
1014
|
-
};
|
|
1015
|
-
var erase = {
|
|
1016
|
-
screen: `${CSI2}2J`,
|
|
1017
|
-
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
1018
|
-
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
1019
|
-
line: `${CSI2}2K`,
|
|
1020
|
-
lineEnd: `${CSI2}K`,
|
|
1021
|
-
lineStart: `${CSI2}1K`,
|
|
1022
|
-
lines(count) {
|
|
1023
|
-
let clear = "";
|
|
1024
|
-
for (let i = 0;i < count; i++)
|
|
1025
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
1026
|
-
if (count)
|
|
1027
|
-
clear += cursor.left;
|
|
1028
|
-
return clear;
|
|
1029
|
-
}
|
|
1030
|
-
};
|
|
1031
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
1032
|
-
});
|
|
1088
|
+
};
|
|
1089
|
+
var CRLF_OR_LF = /\r?\n/;
|
|
1090
|
+
function wrapAnsi(string, columns, options) {
|
|
1091
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
|
|
1092
|
+
`);
|
|
1093
|
+
}
|
|
1033
1094
|
|
|
1034
1095
|
// ../../node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
|
|
1035
|
-
|
|
1036
|
-
import { stdout as S, stdin as $ } from "node:process";
|
|
1037
|
-
import P from "node:readline";
|
|
1096
|
+
var import_sisteransi = __toESM(require_src(), 1);
|
|
1038
1097
|
function d(r, t, e) {
|
|
1039
1098
|
if (!e.some((o) => !o.disabled))
|
|
1040
1099
|
return r;
|
|
1041
1100
|
const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
|
|
1042
1101
|
return e[n].disabled ? d(n, t < 0 ? -1 : 1, e) : n;
|
|
1043
1102
|
}
|
|
1103
|
+
var E = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
1104
|
+
var G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
1105
|
+
var u = { actions: new Set(E), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...G], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
|
|
1044
1106
|
function V(r, t) {
|
|
1045
1107
|
if (typeof r == "string")
|
|
1046
1108
|
return u.aliases.get(r) === t;
|
|
@@ -1059,62 +1121,14 @@ function j(r, t) {
|
|
|
1059
1121
|
e[o] !== s[o] && n.push(o);
|
|
1060
1122
|
return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
|
|
1061
1123
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
}
|
|
1124
|
+
var Y = globalThis.process.platform.startsWith("win");
|
|
1125
|
+
var C = Symbol("clack:cancel");
|
|
1065
1126
|
function w(r, t) {
|
|
1066
1127
|
const e = r;
|
|
1067
1128
|
e.isTTY && e.setRawMode(t);
|
|
1068
1129
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
return 0;
|
|
1072
|
-
const e = t.findIndex((s) => s.value === r);
|
|
1073
|
-
return e !== -1 ? e : 0;
|
|
1074
|
-
}
|
|
1075
|
-
function B(r, t) {
|
|
1076
|
-
return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
|
|
1077
|
-
}
|
|
1078
|
-
function J(r, t) {
|
|
1079
|
-
if (t)
|
|
1080
|
-
return r ? t : t[0];
|
|
1081
|
-
}
|
|
1082
|
-
function L(r) {
|
|
1083
|
-
return [...r].map((t) => X[t]);
|
|
1084
|
-
}
|
|
1085
|
-
function Z(r) {
|
|
1086
|
-
const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), e = [];
|
|
1087
|
-
let s = "/";
|
|
1088
|
-
for (const i of t)
|
|
1089
|
-
i.type === "literal" ? s = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && e.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
|
|
1090
|
-
return { segments: e, separator: s };
|
|
1091
|
-
}
|
|
1092
|
-
function k(r) {
|
|
1093
|
-
return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
|
|
1094
|
-
}
|
|
1095
|
-
function I(r) {
|
|
1096
|
-
return { year: k(r.year), month: k(r.month), day: k(r.day) };
|
|
1097
|
-
}
|
|
1098
|
-
function T(r, t) {
|
|
1099
|
-
return new Date(r || 2001, t || 1, 0).getDate();
|
|
1100
|
-
}
|
|
1101
|
-
function F(r) {
|
|
1102
|
-
const { year: t, month: e, day: s } = I(r);
|
|
1103
|
-
if (!t || t < 0 || t > 9999 || !e || e < 1 || e > 12 || !s || s < 1)
|
|
1104
|
-
return;
|
|
1105
|
-
const i = new Date(Date.UTC(t, e - 1, s));
|
|
1106
|
-
if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== e - 1 || i.getUTCDate() !== s))
|
|
1107
|
-
return { year: t, month: e, day: s };
|
|
1108
|
-
}
|
|
1109
|
-
function N(r) {
|
|
1110
|
-
const t = F(r);
|
|
1111
|
-
return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
|
|
1112
|
-
}
|
|
1113
|
-
function tt(r, t, e, s) {
|
|
1114
|
-
const i = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null, n = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null;
|
|
1115
|
-
return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : T(t.year, t.month) };
|
|
1116
|
-
}
|
|
1117
|
-
var import_sisteransi, E, G, u, Y, C, A = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20, p = class {
|
|
1130
|
+
var A = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20;
|
|
1131
|
+
var p = class {
|
|
1118
1132
|
input;
|
|
1119
1133
|
output;
|
|
1120
1134
|
_abortSignal;
|
|
@@ -1240,511 +1254,371 @@ var import_sisteransi, E, G, u, Y, C, A = (r) => ("rows" in r) && typeof r.rows
|
|
|
1240
1254
|
this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
|
|
1241
1255
|
}
|
|
1242
1256
|
}
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
return
|
|
1257
|
+
};
|
|
1258
|
+
function W(r, t) {
|
|
1259
|
+
if (r === undefined || t.length === 0)
|
|
1260
|
+
return 0;
|
|
1261
|
+
const e = t.findIndex((s) => s.value === r);
|
|
1262
|
+
return e !== -1 ? e : 0;
|
|
1263
|
+
}
|
|
1264
|
+
function B(r, t) {
|
|
1265
|
+
return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
|
|
1266
|
+
}
|
|
1267
|
+
function J(r, t) {
|
|
1268
|
+
if (t)
|
|
1269
|
+
return r ? t : t[0];
|
|
1270
|
+
}
|
|
1271
|
+
var H = class extends p {
|
|
1272
|
+
filteredOptions;
|
|
1273
|
+
multiple;
|
|
1274
|
+
isNavigating = false;
|
|
1275
|
+
selectedValues = [];
|
|
1276
|
+
focusedValue;
|
|
1277
|
+
#e = 0;
|
|
1278
|
+
#o = "";
|
|
1279
|
+
#t;
|
|
1280
|
+
#n;
|
|
1281
|
+
#a;
|
|
1282
|
+
get cursor() {
|
|
1283
|
+
return this.#e;
|
|
1284
|
+
}
|
|
1285
|
+
get userInputWithCursor() {
|
|
1286
|
+
if (!this.userInput)
|
|
1287
|
+
return y(["inverse", "hidden"], "_");
|
|
1288
|
+
if (this._cursor >= this.userInput.length)
|
|
1289
|
+
return `${this.userInput}█`;
|
|
1290
|
+
const t = this.userInput.slice(0, this._cursor), [e, ...s] = this.userInput.slice(this._cursor);
|
|
1291
|
+
return `${t}${y("inverse", e)}${s.join("")}`;
|
|
1292
|
+
}
|
|
1293
|
+
get options() {
|
|
1294
|
+
return typeof this.#n == "function" ? this.#n() : this.#n;
|
|
1295
|
+
}
|
|
1296
|
+
constructor(t) {
|
|
1297
|
+
super(t), this.#n = t.options, this.#a = t.placeholder;
|
|
1298
|
+
const e = this.options;
|
|
1299
|
+
this.filteredOptions = [...e], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? B;
|
|
1300
|
+
let s;
|
|
1301
|
+
if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? s = t.initialValue : s = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (s = [this.options[0].value]), s)
|
|
1302
|
+
for (const i of s) {
|
|
1303
|
+
const n = e.findIndex((o) => o.value === i);
|
|
1304
|
+
n !== -1 && (this.toggleSelected(i), this.#e = n);
|
|
1305
|
+
}
|
|
1306
|
+
this.focusedValue = this.options[this.#e]?.value, this.on("key", (i, n) => this.#s(i, n)), this.on("userInput", (i) => this.#i(i));
|
|
1307
|
+
}
|
|
1308
|
+
_isActionKey(t, e) {
|
|
1309
|
+
return t === "\t" || this.multiple && this.isNavigating && e.name === "space" && t !== undefined && t !== "";
|
|
1310
|
+
}
|
|
1311
|
+
#s(t, e) {
|
|
1312
|
+
const s = e.name === "up", i = e.name === "down", n = e.name === "return", o = this.userInput === "" || this.userInput === "\t", a = this.#a, h = this.options, l = a !== undefined && a !== "" && h.some((f) => !f.disabled && (this.#t ? this.#t(a, f) : true));
|
|
1313
|
+
if (e.name === "tab" && o && l) {
|
|
1314
|
+
this.userInput === "\t" && this._clearUserInput(), this._setUserInput(a, true), this.isNavigating = false;
|
|
1315
|
+
return;
|
|
1276
1316
|
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1317
|
+
s || i ? (this.#e = d(this.#e, s ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = J(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (e.name === "tab" || this.isNavigating && e.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
|
|
1318
|
+
}
|
|
1319
|
+
deselectAll() {
|
|
1320
|
+
this.selectedValues = [];
|
|
1321
|
+
}
|
|
1322
|
+
toggleSelected(t) {
|
|
1323
|
+
this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((e) => e !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
|
|
1324
|
+
}
|
|
1325
|
+
#i(t) {
|
|
1326
|
+
if (t !== this.#o) {
|
|
1327
|
+
this.#o = t;
|
|
1279
1328
|
const e = this.options;
|
|
1280
|
-
this
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
n !== -1 && (this.toggleSelected(i), this.#e = n);
|
|
1286
|
-
}
|
|
1287
|
-
this.focusedValue = this.options[this.#e]?.value, this.on("key", (i, n) => this.#s(i, n)), this.on("userInput", (i) => this.#i(i));
|
|
1329
|
+
t && this.#t ? this.filteredOptions = e.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...e];
|
|
1330
|
+
const s = W(this.focusedValue, this.filteredOptions);
|
|
1331
|
+
this.#e = d(s, 0, this.filteredOptions);
|
|
1332
|
+
const i = this.filteredOptions[this.#e];
|
|
1333
|
+
i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
1288
1334
|
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
var X = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
|
|
1338
|
+
function L(r) {
|
|
1339
|
+
return [...r].map((t) => X[t]);
|
|
1340
|
+
}
|
|
1341
|
+
function Z(r) {
|
|
1342
|
+
const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), e = [];
|
|
1343
|
+
let s = "/";
|
|
1344
|
+
for (const i of t)
|
|
1345
|
+
i.type === "literal" ? s = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && e.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
|
|
1346
|
+
return { segments: e, separator: s };
|
|
1347
|
+
}
|
|
1348
|
+
function k(r) {
|
|
1349
|
+
return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
|
|
1350
|
+
}
|
|
1351
|
+
function I(r) {
|
|
1352
|
+
return { year: k(r.year), month: k(r.month), day: k(r.day) };
|
|
1353
|
+
}
|
|
1354
|
+
function T(r, t) {
|
|
1355
|
+
return new Date(r || 2001, t || 1, 0).getDate();
|
|
1356
|
+
}
|
|
1357
|
+
function F(r) {
|
|
1358
|
+
const { year: t, month: e, day: s } = I(r);
|
|
1359
|
+
if (!t || t < 0 || t > 9999 || !e || e < 1 || e > 12 || !s || s < 1)
|
|
1360
|
+
return;
|
|
1361
|
+
const i = new Date(Date.UTC(t, e - 1, s));
|
|
1362
|
+
if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== e - 1 || i.getUTCDate() !== s))
|
|
1363
|
+
return { year: t, month: e, day: s };
|
|
1364
|
+
}
|
|
1365
|
+
function N(r) {
|
|
1366
|
+
const t = F(r);
|
|
1367
|
+
return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
|
|
1368
|
+
}
|
|
1369
|
+
function tt(r, t, e, s) {
|
|
1370
|
+
const i = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null, n = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null;
|
|
1371
|
+
return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : T(t.year, t.month) };
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
class et extends p {
|
|
1375
|
+
#e;
|
|
1376
|
+
#o;
|
|
1377
|
+
#t;
|
|
1378
|
+
#n;
|
|
1379
|
+
#a;
|
|
1380
|
+
#s = { segmentIndex: 0, positionInSegment: 0 };
|
|
1381
|
+
#i = true;
|
|
1382
|
+
#r = null;
|
|
1383
|
+
inlineError = "";
|
|
1384
|
+
get segmentCursor() {
|
|
1385
|
+
return { ...this.#s };
|
|
1386
|
+
}
|
|
1387
|
+
get segmentValues() {
|
|
1388
|
+
return { ...this.#t };
|
|
1389
|
+
}
|
|
1390
|
+
get segments() {
|
|
1391
|
+
return this.#e;
|
|
1392
|
+
}
|
|
1393
|
+
get separator() {
|
|
1394
|
+
return this.#o;
|
|
1395
|
+
}
|
|
1396
|
+
get formattedValue() {
|
|
1397
|
+
return this.#c(this.#t);
|
|
1398
|
+
}
|
|
1399
|
+
#c(t) {
|
|
1400
|
+
return this.#e.map((e) => t[e.type]).join(this.#o);
|
|
1401
|
+
}
|
|
1402
|
+
#h() {
|
|
1403
|
+
this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? undefined);
|
|
1404
|
+
}
|
|
1405
|
+
constructor(t) {
|
|
1406
|
+
const e = t.format ? { segments: L(t.format), separator: t.separator ?? "/" } : Z(t.locale), s = t.separator ?? e.separator, i = t.format ? L(t.format) : e.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, a = i.map((h) => o[h.type]).join(s);
|
|
1407
|
+
super({ ...t, initialUserInput: a }, false), this.#e = i, this.#o = s, this.#t = o, this.#n = t.minDate, this.#a = t.maxDate, this.#h(), this.on("cursor", (h) => this.#d(h)), this.on("key", (h, l) => this.#f(h, l)), this.on("finalize", () => this.#g(t));
|
|
1408
|
+
}
|
|
1409
|
+
#u() {
|
|
1410
|
+
const t = Math.max(0, Math.min(this.#s.segmentIndex, this.#e.length - 1)), e = this.#e[t];
|
|
1411
|
+
if (e)
|
|
1412
|
+
return this.#s.positionInSegment = Math.max(0, Math.min(this.#s.positionInSegment, e.len - 1)), { segment: e, index: t };
|
|
1413
|
+
}
|
|
1414
|
+
#l(t) {
|
|
1415
|
+
this.inlineError = "", this.#r = null;
|
|
1416
|
+
const e = this.#u();
|
|
1417
|
+
e && (this.#s.segmentIndex = Math.max(0, Math.min(this.#e.length - 1, e.index + t)), this.#s.positionInSegment = 0, this.#i = true);
|
|
1418
|
+
}
|
|
1419
|
+
#p(t) {
|
|
1420
|
+
const e = this.#u();
|
|
1421
|
+
if (!e)
|
|
1422
|
+
return;
|
|
1423
|
+
const { segment: s } = e, i = this.#t[s.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, a = tt(s.type, I(this.#t), this.#n, this.#a);
|
|
1424
|
+
let h;
|
|
1425
|
+
n ? h = t === 1 ? a.min : a.max : h = Math.max(Math.min(a.max, o + t), a.min), this.#t = { ...this.#t, [s.type]: h.toString().padStart(s.len, "0") }, this.#i = true, this.#r = null, this.#h();
|
|
1426
|
+
}
|
|
1427
|
+
#d(t) {
|
|
1428
|
+
if (t)
|
|
1429
|
+
switch (t) {
|
|
1430
|
+
case "right":
|
|
1431
|
+
return this.#l(1);
|
|
1432
|
+
case "left":
|
|
1433
|
+
return this.#l(-1);
|
|
1434
|
+
case "up":
|
|
1435
|
+
return this.#p(1);
|
|
1436
|
+
case "down":
|
|
1437
|
+
return this.#p(-1);
|
|
1297
1438
|
}
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
this.
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
this.#o = t;
|
|
1309
|
-
const e = this.options;
|
|
1310
|
-
t && this.#t ? this.filteredOptions = e.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...e];
|
|
1311
|
-
const s = W(this.focusedValue, this.filteredOptions);
|
|
1312
|
-
this.#e = d(s, 0, this.filteredOptions);
|
|
1313
|
-
const i = this.filteredOptions[this.#e];
|
|
1314
|
-
i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
1439
|
+
}
|
|
1440
|
+
#f(t, e) {
|
|
1441
|
+
if (e?.name === "backspace" || e?.sequence === "" || e?.sequence === "\b" || t === "" || t === "\b") {
|
|
1442
|
+
this.inlineError = "";
|
|
1443
|
+
const s = this.#u();
|
|
1444
|
+
if (!s)
|
|
1445
|
+
return;
|
|
1446
|
+
if (!this.#t[s.segment.type].replace(/_/g, "")) {
|
|
1447
|
+
this.#l(-1);
|
|
1448
|
+
return;
|
|
1315
1449
|
}
|
|
1450
|
+
this.#t[s.segment.type] = "_".repeat(s.segment.len), this.#i = true, this.#s.positionInSegment = 0, this.#h();
|
|
1451
|
+
return;
|
|
1316
1452
|
}
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
#o;
|
|
1322
|
-
#t;
|
|
1323
|
-
#n;
|
|
1324
|
-
#a;
|
|
1325
|
-
#s = { segmentIndex: 0, positionInSegment: 0 };
|
|
1326
|
-
#i = true;
|
|
1327
|
-
#r = null;
|
|
1328
|
-
inlineError = "";
|
|
1329
|
-
get segmentCursor() {
|
|
1330
|
-
return { ...this.#s };
|
|
1331
|
-
}
|
|
1332
|
-
get segmentValues() {
|
|
1333
|
-
return { ...this.#t };
|
|
1334
|
-
}
|
|
1335
|
-
get segments() {
|
|
1336
|
-
return this.#e;
|
|
1337
|
-
}
|
|
1338
|
-
get separator() {
|
|
1339
|
-
return this.#o;
|
|
1340
|
-
}
|
|
1341
|
-
get formattedValue() {
|
|
1342
|
-
return this.#c(this.#t);
|
|
1343
|
-
}
|
|
1344
|
-
#c(t) {
|
|
1345
|
-
return this.#e.map((e) => t[e.type]).join(this.#o);
|
|
1346
|
-
}
|
|
1347
|
-
#h() {
|
|
1348
|
-
this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? undefined);
|
|
1349
|
-
}
|
|
1350
|
-
constructor(t) {
|
|
1351
|
-
const e = t.format ? { segments: L(t.format), separator: t.separator ?? "/" } : Z(t.locale), s = t.separator ?? e.separator, i = t.format ? L(t.format) : e.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, a = i.map((h) => o[h.type]).join(s);
|
|
1352
|
-
super({ ...t, initialUserInput: a }, false), this.#e = i, this.#o = s, this.#t = o, this.#n = t.minDate, this.#a = t.maxDate, this.#h(), this.on("cursor", (h) => this.#d(h)), this.on("key", (h, l) => this.#f(h, l)), this.on("finalize", () => this.#g(t));
|
|
1353
|
-
}
|
|
1354
|
-
#u() {
|
|
1355
|
-
const t = Math.max(0, Math.min(this.#s.segmentIndex, this.#e.length - 1)), e = this.#e[t];
|
|
1356
|
-
if (e)
|
|
1357
|
-
return this.#s.positionInSegment = Math.max(0, Math.min(this.#s.positionInSegment, e.len - 1)), { segment: e, index: t };
|
|
1358
|
-
}
|
|
1359
|
-
#l(t) {
|
|
1360
|
-
this.inlineError = "", this.#r = null;
|
|
1361
|
-
const e = this.#u();
|
|
1362
|
-
e && (this.#s.segmentIndex = Math.max(0, Math.min(this.#e.length - 1, e.index + t)), this.#s.positionInSegment = 0, this.#i = true);
|
|
1363
|
-
}
|
|
1364
|
-
#p(t) {
|
|
1365
|
-
const e = this.#u();
|
|
1366
|
-
if (!e)
|
|
1453
|
+
if (e?.name === "tab") {
|
|
1454
|
+
this.inlineError = "";
|
|
1455
|
+
const s = this.#u();
|
|
1456
|
+
if (!s)
|
|
1367
1457
|
return;
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1370
|
-
|
|
1458
|
+
const i = e.shift ? -1 : 1, n = s.index + i;
|
|
1459
|
+
n >= 0 && n < this.#e.length && (this.#s.segmentIndex = n, this.#s.positionInSegment = 0, this.#i = true);
|
|
1460
|
+
return;
|
|
1371
1461
|
}
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
case "down":
|
|
1382
|
-
return this.#p(-1);
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
#f(t, e) {
|
|
1386
|
-
if (e?.name === "backspace" || e?.sequence === "" || e?.sequence === "\b" || t === "" || t === "\b") {
|
|
1387
|
-
this.inlineError = "";
|
|
1388
|
-
const s = this.#u();
|
|
1389
|
-
if (!s)
|
|
1390
|
-
return;
|
|
1391
|
-
if (!this.#t[s.segment.type].replace(/_/g, "")) {
|
|
1392
|
-
this.#l(-1);
|
|
1462
|
+
if (t && /^[0-9]$/.test(t)) {
|
|
1463
|
+
const s = this.#u();
|
|
1464
|
+
if (!s)
|
|
1465
|
+
return;
|
|
1466
|
+
const { segment: i } = s, n = !this.#t[i.type].replace(/_/g, "");
|
|
1467
|
+
if (this.#i && this.#r !== null && !n) {
|
|
1468
|
+
const m = this.#r + t, g = { ...this.#t, [i.type]: m }, b = this.#m(g, i);
|
|
1469
|
+
if (b) {
|
|
1470
|
+
this.inlineError = b, this.#r = null, this.#i = false;
|
|
1393
1471
|
return;
|
|
1394
1472
|
}
|
|
1395
|
-
this.#t[
|
|
1473
|
+
this.inlineError = "", this.#t[i.type] = m, this.#r = null, this.#i = false, this.#h(), s.index < this.#e.length - 1 && (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true);
|
|
1396
1474
|
return;
|
|
1397
1475
|
}
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
if (!s)
|
|
1402
|
-
return;
|
|
1403
|
-
const i = e.shift ? -1 : 1, n = s.index + i;
|
|
1404
|
-
n >= 0 && n < this.#e.length && (this.#s.segmentIndex = n, this.#s.positionInSegment = 0, this.#i = true);
|
|
1476
|
+
this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#s.positionInSegment = 0), this.#i = false, this.#r = null;
|
|
1477
|
+
const o = this.#t[i.type], a = o.indexOf("_"), h = a >= 0 ? a : Math.min(this.#s.positionInSegment, i.len - 1);
|
|
1478
|
+
if (h < 0 || h >= i.len)
|
|
1405
1479
|
return;
|
|
1480
|
+
let l = o.slice(0, h) + t + o.slice(h + 1), f = false;
|
|
1481
|
+
if (h === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
|
|
1482
|
+
const m = Number.parseInt(t, 10);
|
|
1483
|
+
l = `0${t}`, f = m <= (i.type === "month" ? 1 : 2);
|
|
1406
1484
|
}
|
|
1407
|
-
if (
|
|
1408
|
-
const
|
|
1409
|
-
if (
|
|
1410
|
-
|
|
1411
|
-
const { segment: i } = s, n = !this.#t[i.type].replace(/_/g, "");
|
|
1412
|
-
if (this.#i && this.#r !== null && !n) {
|
|
1413
|
-
const m = this.#r + t, g = { ...this.#t, [i.type]: m }, b = this.#m(g, i);
|
|
1414
|
-
if (b) {
|
|
1415
|
-
this.inlineError = b, this.#r = null, this.#i = false;
|
|
1416
|
-
return;
|
|
1417
|
-
}
|
|
1418
|
-
this.inlineError = "", this.#t[i.type] = m, this.#r = null, this.#i = false, this.#h(), s.index < this.#e.length - 1 && (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true);
|
|
1485
|
+
if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
|
|
1486
|
+
const m = { ...this.#t, [i.type]: l }, g = this.#m(m, i);
|
|
1487
|
+
if (g) {
|
|
1488
|
+
this.inlineError = g;
|
|
1419
1489
|
return;
|
|
1420
1490
|
}
|
|
1421
|
-
this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#s.positionInSegment = 0), this.#i = false, this.#r = null;
|
|
1422
|
-
const o = this.#t[i.type], a = o.indexOf("_"), h = a >= 0 ? a : Math.min(this.#s.positionInSegment, i.len - 1);
|
|
1423
|
-
if (h < 0 || h >= i.len)
|
|
1424
|
-
return;
|
|
1425
|
-
let l = o.slice(0, h) + t + o.slice(h + 1), f = false;
|
|
1426
|
-
if (h === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
|
|
1427
|
-
const m = Number.parseInt(t, 10);
|
|
1428
|
-
l = `0${t}`, f = m <= (i.type === "month" ? 1 : 2);
|
|
1429
|
-
}
|
|
1430
|
-
if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
|
|
1431
|
-
const m = { ...this.#t, [i.type]: l }, g = this.#m(m, i);
|
|
1432
|
-
if (g) {
|
|
1433
|
-
this.inlineError = g;
|
|
1434
|
-
return;
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
this.inlineError = "", this.#t[i.type] = l;
|
|
1438
|
-
const v = l.includes("_") ? undefined : F(this.#t);
|
|
1439
|
-
if (v) {
|
|
1440
|
-
const { year: m, month: g } = v, b = T(m, g);
|
|
1441
|
-
this.#t = { year: String(Math.max(0, Math.min(9999, m))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(b, v.day))).padStart(2, "0") };
|
|
1442
|
-
}
|
|
1443
|
-
this.#h();
|
|
1444
|
-
const U = l.indexOf("_");
|
|
1445
|
-
f ? (this.#i = true, this.#r = t) : U >= 0 ? this.#s.positionInSegment = U : a >= 0 && s.index < this.#e.length - 1 ? (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true) : this.#s.positionInSegment = Math.min(h + 1, i.len - 1);
|
|
1446
1491
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
if (e.type === "day" && (i < 0 || i > 31))
|
|
1453
|
-
return u.date.messages.invalidDay(31, "any month");
|
|
1454
|
-
}
|
|
1455
|
-
#g(t) {
|
|
1456
|
-
const { year: e, month: s, day: i } = I(this.#t);
|
|
1457
|
-
if (e && s && i) {
|
|
1458
|
-
const n = T(e, s);
|
|
1459
|
-
this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
|
|
1492
|
+
this.inlineError = "", this.#t[i.type] = l;
|
|
1493
|
+
const v = l.includes("_") ? undefined : F(this.#t);
|
|
1494
|
+
if (v) {
|
|
1495
|
+
const { year: m, month: g } = v, b = T(m, g);
|
|
1496
|
+
this.#t = { year: String(Math.max(0, Math.min(9999, m))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(b, v.day))).padStart(2, "0") };
|
|
1460
1497
|
}
|
|
1461
|
-
this
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
st = class st extends p {
|
|
1465
|
-
options;
|
|
1466
|
-
cursor = 0;
|
|
1467
|
-
#e;
|
|
1468
|
-
getGroupItems(t) {
|
|
1469
|
-
return this.options.filter((e) => e.group === t);
|
|
1498
|
+
this.#h();
|
|
1499
|
+
const U = l.indexOf("_");
|
|
1500
|
+
f ? (this.#i = true, this.#r = t) : U >= 0 ? this.#s.positionInSegment = U : a >= 0 && s.index < this.#e.length - 1 ? (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true) : this.#s.positionInSegment = Math.min(h + 1, i.len - 1);
|
|
1470
1501
|
}
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1502
|
+
}
|
|
1503
|
+
#m(t, e) {
|
|
1504
|
+
const { month: s, day: i } = I(t);
|
|
1505
|
+
if (e.type === "month" && (s < 0 || s > 12))
|
|
1506
|
+
return u.date.messages.invalidMonth;
|
|
1507
|
+
if (e.type === "day" && (i < 0 || i > 31))
|
|
1508
|
+
return u.date.messages.invalidDay(31, "any month");
|
|
1509
|
+
}
|
|
1510
|
+
#g(t) {
|
|
1511
|
+
const { year: e, month: s, day: i } = I(this.#t);
|
|
1512
|
+
if (e && s && i) {
|
|
1513
|
+
const n = T(e, s);
|
|
1514
|
+
this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
|
|
1474
1515
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1516
|
+
this.value = N(this.#t) ?? t.defaultValue ?? undefined;
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
class st extends p {
|
|
1521
|
+
options;
|
|
1522
|
+
cursor = 0;
|
|
1523
|
+
#e;
|
|
1524
|
+
getGroupItems(t) {
|
|
1525
|
+
return this.options.filter((e) => e.group === t);
|
|
1526
|
+
}
|
|
1527
|
+
isGroupSelected(t) {
|
|
1528
|
+
const e = this.getGroupItems(t), s = this.value;
|
|
1529
|
+
return s === undefined ? false : e.every((i) => s.includes(i.value));
|
|
1530
|
+
}
|
|
1531
|
+
toggleValue() {
|
|
1532
|
+
const t = this.options[this.cursor];
|
|
1533
|
+
if (this.value === undefined && (this.value = []), t.group === true) {
|
|
1534
|
+
const e = t.value, s = this.getGroupItems(e);
|
|
1535
|
+
this.isGroupSelected(e) ? this.value = this.value.filter((i) => s.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...s.map((i) => i.value)], this.value = Array.from(new Set(this.value));
|
|
1536
|
+
} else {
|
|
1537
|
+
const e = this.value.includes(t.value);
|
|
1538
|
+
this.value = e ? this.value.filter((s) => s !== t.value) : [...this.value, t.value];
|
|
1484
1539
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
case "down":
|
|
1498
|
-
case "right": {
|
|
1499
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1500
|
-
const i = this.options[this.cursor]?.group === true;
|
|
1501
|
-
!this.#e && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
1502
|
-
break;
|
|
1503
|
-
}
|
|
1504
|
-
case "space":
|
|
1505
|
-
this.toggleValue();
|
|
1506
|
-
break;
|
|
1540
|
+
}
|
|
1541
|
+
constructor(t) {
|
|
1542
|
+
super(t, false);
|
|
1543
|
+
const { options: e } = t;
|
|
1544
|
+
this.#e = t.selectableGroups !== false, this.options = Object.entries(e).flatMap(([s, i]) => [{ value: s, group: true, label: s }, ...i.map((n) => ({ ...n, group: s }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), this.#e ? 0 : 1), this.on("cursor", (s) => {
|
|
1545
|
+
switch (s) {
|
|
1546
|
+
case "left":
|
|
1547
|
+
case "up": {
|
|
1548
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1549
|
+
const i = this.options[this.cursor]?.group === true;
|
|
1550
|
+
!this.#e && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
|
|
1551
|
+
break;
|
|
1507
1552
|
}
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
return this._cursor;
|
|
1523
|
-
}
|
|
1524
|
-
constructor(t) {
|
|
1525
|
-
super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (e) => {
|
|
1526
|
-
this._setValue(e);
|
|
1527
|
-
}), this.on("finalize", () => {
|
|
1528
|
-
this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
|
|
1529
|
-
});
|
|
1530
|
-
}
|
|
1531
|
-
};
|
|
1532
|
-
});
|
|
1553
|
+
case "down":
|
|
1554
|
+
case "right": {
|
|
1555
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1556
|
+
const i = this.options[this.cursor]?.group === true;
|
|
1557
|
+
!this.#e && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
case "space":
|
|
1561
|
+
this.toggleValue();
|
|
1562
|
+
break;
|
|
1563
|
+
}
|
|
1564
|
+
});
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1533
1567
|
|
|
1534
1568
|
// ../../node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
|
|
1535
1569
|
import { styleText as t, stripVTControlCharacters as ne } from "node:util";
|
|
1536
1570
|
import P2 from "node:process";
|
|
1571
|
+
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
1537
1572
|
function Ze() {
|
|
1538
1573
|
return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1539
1574
|
}
|
|
1540
|
-
var
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1575
|
+
var ee = Ze();
|
|
1576
|
+
var w2 = (e, i) => ee ? e : i;
|
|
1577
|
+
var _e = w2("◆", "*");
|
|
1578
|
+
var oe = w2("■", "x");
|
|
1579
|
+
var ue = w2("▲", "x");
|
|
1580
|
+
var F2 = w2("◇", "o");
|
|
1581
|
+
var le = w2("┌", "T");
|
|
1582
|
+
var d2 = w2("│", "|");
|
|
1583
|
+
var E2 = w2("└", "—");
|
|
1584
|
+
var Ie = w2("┐", "T");
|
|
1585
|
+
var Ee = w2("┘", "—");
|
|
1586
|
+
var z2 = w2("●", ">");
|
|
1587
|
+
var H2 = w2("○", " ");
|
|
1588
|
+
var te = w2("◻", "[•]");
|
|
1589
|
+
var U = w2("◼", "[+]");
|
|
1590
|
+
var J2 = w2("◻", "[ ]");
|
|
1591
|
+
var xe = w2("▪", "•");
|
|
1592
|
+
var se = w2("─", "-");
|
|
1593
|
+
var ce = w2("╮", "+");
|
|
1594
|
+
var Ge = w2("├", "+");
|
|
1595
|
+
var $e = w2("╯", "+");
|
|
1596
|
+
var de = w2("╰", "+");
|
|
1597
|
+
var Oe = w2("╭", "+");
|
|
1598
|
+
var he = w2("●", "•");
|
|
1599
|
+
var pe = w2("◆", "*");
|
|
1600
|
+
var me = w2("▲", "!");
|
|
1601
|
+
var ge = w2("■", "x");
|
|
1602
|
+
var mt = (e = "", i) => {
|
|
1558
1603
|
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", le)} ` : "";
|
|
1559
1604
|
s.write(`${r}${e}
|
|
1560
1605
|
`);
|
|
1561
|
-
}
|
|
1606
|
+
};
|
|
1607
|
+
var gt = (e = "", i) => {
|
|
1562
1608
|
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", d2)}
|
|
1563
1609
|
${t("gray", E2)} ` : "";
|
|
1564
1610
|
s.write(`${r}${e}
|
|
1565
1611
|
|
|
1566
1612
|
`);
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
`, r = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), u2 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
|
|
1571
|
-
switch (this.state) {
|
|
1572
|
-
case "error": {
|
|
1573
|
-
const o = this.error ? ` ${t("yellow", this.error)}` : "", c2 = i ? `${t("yellow", d2)} ` : "", a = i ? t("yellow", E2) : "";
|
|
1574
|
-
return `${s.trim()}
|
|
1575
|
-
${c2}${u2}
|
|
1576
|
-
${a}${o}
|
|
1577
|
-
`;
|
|
1578
|
-
}
|
|
1579
|
-
case "submit": {
|
|
1580
|
-
const o = n ? ` ${t("dim", n)}` : "", c2 = i ? t("gray", d2) : "";
|
|
1581
|
-
return `${s}${c2}${o}`;
|
|
1582
|
-
}
|
|
1583
|
-
case "cancel": {
|
|
1584
|
-
const o = n ? ` ${t(["strikethrough", "dim"], n)}` : "", c2 = i ? t("gray", d2) : "";
|
|
1585
|
-
return `${s}${c2}${o}${n.trim() ? `
|
|
1586
|
-
${c2}` : ""}`;
|
|
1587
|
-
}
|
|
1588
|
-
default: {
|
|
1589
|
-
const o = i ? `${t("cyan", d2)} ` : "", c2 = i ? t("cyan", E2) : "";
|
|
1590
|
-
return `${s}${o}${u2}
|
|
1591
|
-
${c2}
|
|
1592
|
-
`;
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
} }).prompt();
|
|
1596
|
-
var init_dist5 = __esm(() => {
|
|
1597
|
-
init_dist4();
|
|
1598
|
-
init_dist4();
|
|
1599
|
-
init_main();
|
|
1600
|
-
init_dist3();
|
|
1601
|
-
import_sisteransi2 = __toESM(require_src(), 1);
|
|
1602
|
-
ee = Ze();
|
|
1603
|
-
_e = w2("◆", "*");
|
|
1604
|
-
oe = w2("■", "x");
|
|
1605
|
-
ue = w2("▲", "x");
|
|
1606
|
-
F2 = w2("◇", "o");
|
|
1607
|
-
le = w2("┌", "T");
|
|
1608
|
-
d2 = w2("│", "|");
|
|
1609
|
-
E2 = w2("└", "—");
|
|
1610
|
-
Ie = w2("┐", "T");
|
|
1611
|
-
Ee = w2("┘", "—");
|
|
1612
|
-
z2 = w2("●", ">");
|
|
1613
|
-
H2 = w2("○", " ");
|
|
1614
|
-
te = w2("◻", "[•]");
|
|
1615
|
-
U = w2("◼", "[+]");
|
|
1616
|
-
J2 = w2("◻", "[ ]");
|
|
1617
|
-
xe = w2("▪", "•");
|
|
1618
|
-
se = w2("─", "-");
|
|
1619
|
-
ce = w2("╮", "+");
|
|
1620
|
-
Ge = w2("├", "+");
|
|
1621
|
-
$e = w2("╯", "+");
|
|
1622
|
-
de = w2("╰", "+");
|
|
1623
|
-
Oe = w2("╭", "+");
|
|
1624
|
-
he = w2("●", "•");
|
|
1625
|
-
pe = w2("◆", "*");
|
|
1626
|
-
me = w2("▲", "!");
|
|
1627
|
-
ge = w2("■", "x");
|
|
1628
|
-
Ve = { light: w2("─", "-"), heavy: w2("━", "="), block: w2("█", "#") };
|
|
1629
|
-
je = `${t("gray", d2)} `;
|
|
1630
|
-
});
|
|
1631
|
-
|
|
1632
|
-
// package.json
|
|
1633
|
-
var package_default;
|
|
1634
|
-
var init_package = __esm(() => {
|
|
1635
|
-
package_default = {
|
|
1636
|
-
name: "@itsflower/cli",
|
|
1637
|
-
version: "0.2.2",
|
|
1638
|
-
description: "CLI for Flower - scaffold structured development workflows",
|
|
1639
|
-
bin: {
|
|
1640
|
-
flower: "./dist/flower.js"
|
|
1641
|
-
},
|
|
1642
|
-
files: [
|
|
1643
|
-
"dist"
|
|
1644
|
-
],
|
|
1645
|
-
type: "module",
|
|
1646
|
-
scripts: {
|
|
1647
|
-
build: "bun build ./src/main.ts --outfile ./dist/flower.js --target node",
|
|
1648
|
-
dev: "bun run ./src/main.ts",
|
|
1649
|
-
typecheck: "tsc --noEmit"
|
|
1650
|
-
},
|
|
1651
|
-
dependencies: {
|
|
1652
|
-
"@clack/prompts": "^1.2.0",
|
|
1653
|
-
citty: "^0.2.2"
|
|
1654
|
-
},
|
|
1655
|
-
devDependencies: {
|
|
1656
|
-
"@types/bun": "^1.3.12",
|
|
1657
|
-
typescript: "^6.0.2"
|
|
1658
|
-
}
|
|
1659
|
-
};
|
|
1660
|
-
});
|
|
1661
|
-
|
|
1662
|
-
// src/utils/prompts.ts
|
|
1663
|
-
function handleCancel(value) {
|
|
1664
|
-
if (q(value)) {
|
|
1665
|
-
pt("Operation cancelled");
|
|
1666
|
-
process.exit(0);
|
|
1667
|
-
}
|
|
1668
|
-
return false;
|
|
1669
|
-
}
|
|
1670
|
-
var init_prompts = __esm(() => {
|
|
1671
|
-
init_dist5();
|
|
1672
|
-
});
|
|
1673
|
-
|
|
1674
|
-
// src/commands/hello.ts
|
|
1675
|
-
var exports_hello = {};
|
|
1676
|
-
__export(exports_hello, {
|
|
1677
|
-
default: () => hello_default
|
|
1678
|
-
});
|
|
1679
|
-
var hello_default;
|
|
1680
|
-
var init_hello = __esm(() => {
|
|
1681
|
-
init_dist();
|
|
1682
|
-
init_dist5();
|
|
1683
|
-
init_prompts();
|
|
1684
|
-
hello_default = defineCommand({
|
|
1685
|
-
meta: {
|
|
1686
|
-
name: "hello",
|
|
1687
|
-
description: "Say hello to someone"
|
|
1688
|
-
},
|
|
1689
|
-
args: {
|
|
1690
|
-
name: {
|
|
1691
|
-
type: "positional",
|
|
1692
|
-
description: "Name to greet",
|
|
1693
|
-
required: false
|
|
1694
|
-
},
|
|
1695
|
-
formal: {
|
|
1696
|
-
type: "boolean",
|
|
1697
|
-
description: "Use formal greeting",
|
|
1698
|
-
alias: "f"
|
|
1699
|
-
}
|
|
1700
|
-
},
|
|
1701
|
-
run: async ({ args }) => {
|
|
1702
|
-
mt("hello");
|
|
1703
|
-
let name = args.name;
|
|
1704
|
-
if (!name) {
|
|
1705
|
-
const result = await Ot({
|
|
1706
|
-
message: "Who would you like to greet?",
|
|
1707
|
-
placeholder: "World"
|
|
1708
|
-
});
|
|
1709
|
-
if (handleCancel(result)) {
|
|
1710
|
-
return;
|
|
1711
|
-
}
|
|
1712
|
-
name = result || "World";
|
|
1713
|
-
}
|
|
1714
|
-
const greeting = args.formal ? "Good day" : "Hello";
|
|
1715
|
-
gt(`${greeting}, ${name}!`);
|
|
1716
|
-
}
|
|
1717
|
-
});
|
|
1718
|
-
});
|
|
1719
|
-
|
|
1720
|
-
// src/commands/version.ts
|
|
1721
|
-
var exports_version = {};
|
|
1722
|
-
__export(exports_version, {
|
|
1723
|
-
default: () => version_default
|
|
1724
|
-
});
|
|
1725
|
-
var version_default;
|
|
1726
|
-
var init_version = __esm(() => {
|
|
1727
|
-
init_dist();
|
|
1728
|
-
init_package();
|
|
1729
|
-
version_default = defineCommand({
|
|
1730
|
-
meta: {
|
|
1731
|
-
name: "version",
|
|
1732
|
-
description: "Display the current version"
|
|
1733
|
-
},
|
|
1734
|
-
run() {
|
|
1735
|
-
console.log(`${package_default.name}@${package_default.version}`);
|
|
1736
|
-
}
|
|
1737
|
-
});
|
|
1738
|
-
});
|
|
1613
|
+
};
|
|
1614
|
+
var Ve = { light: w2("─", "-"), heavy: w2("━", "="), block: w2("█", "#") };
|
|
1615
|
+
var je = `${t("gray", d2)} `;
|
|
1739
1616
|
|
|
1740
1617
|
// src/main.ts
|
|
1741
|
-
init_dist();
|
|
1742
|
-
init_dist5();
|
|
1743
1618
|
init_package();
|
|
1744
1619
|
|
|
1745
1620
|
// src/commands/index.ts
|
|
1746
1621
|
var commands_default = {
|
|
1747
|
-
hello: () => Promise.resolve().then(() => (init_hello(), exports_hello)).then((m) => m.default),
|
|
1748
1622
|
version: () => Promise.resolve().then(() => (init_version(), exports_version)).then((m) => m.default)
|
|
1749
1623
|
};
|
|
1750
1624
|
|
|
@@ -1755,19 +1629,7 @@ var main = defineCommand({
|
|
|
1755
1629
|
version: package_default.version,
|
|
1756
1630
|
description: "flower - \uD83C\uDF38 Scaffold structured development workflows in your project"
|
|
1757
1631
|
},
|
|
1758
|
-
args: {
|
|
1759
|
-
verbose: {
|
|
1760
|
-
type: "boolean",
|
|
1761
|
-
description: "Enable verbose output",
|
|
1762
|
-
alias: "v"
|
|
1763
|
-
}
|
|
1764
|
-
},
|
|
1765
1632
|
subCommands: commands_default,
|
|
1766
|
-
setup: ({ args }) => {
|
|
1767
|
-
if (args.verbose) {
|
|
1768
|
-
Bun.env.VERBOSE = "true";
|
|
1769
|
-
}
|
|
1770
|
-
},
|
|
1771
1633
|
run: () => {
|
|
1772
1634
|
mt("flower");
|
|
1773
1635
|
gt("Use `flower --help` to see available commands");
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itsflower/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "CLI for Flower - scaffold structured development workflows",
|
|
5
5
|
"bin": {
|
|
6
|
-
"flower": "./dist/
|
|
6
|
+
"flower": "./dist/main.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"type": "module",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "bun build ./src/main.ts --
|
|
13
|
+
"build": "bun build ./src/main.ts --outdir ./dist --target node",
|
|
14
14
|
"dev": "bun run ./src/main.ts",
|
|
15
15
|
"typecheck": "tsc --noEmit"
|
|
16
16
|
},
|