create-rue 0.3.12 → 0.7.2

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/bundle.js CHANGED
@@ -1,16 +1,12 @@
1
1
  #!/usr/bin/env node
2
- /*! create-rue v0.3.12 | MIT */
2
+ /*! create-rue v0.7.2 | MIT */
3
3
  import { createRequire } from "node:module";
4
4
  import * as fs from "node:fs";
5
- import "node:fs";
6
5
  import * as path from "node:path";
7
- import "node:path";
8
6
  import { fileURLToPath, pathToFileURL } from "node:url";
9
- import { parseArgs, stripVTControlCharacters, styleText } from "node:util";
10
- import P, { stdin, stdout } from "node:process";
11
- import "node:readline";
12
- import P$1 from "node:readline";
13
- import "node:tty";
7
+ import { parseArgs, styleText } from "node:util";
8
+ import process$1, { stdin, stdout } from "node:process";
9
+ import l__default from "node:readline";
14
10
  //#region \0rolldown/runtime.js
15
11
  var __create = Object.create;
16
12
  var __defProp = Object.defineProperty;
@@ -35,20 +31,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
31
  }) : target, mod));
36
32
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
37
33
  //#endregion
38
- //#region node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
39
- const isAmbiguous = (x) => {
40
- 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;
41
- };
34
+ //#region node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
35
+ const getCodePointsLength = (() => {
36
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
37
+ return (input) => {
38
+ let surrogatePairsNr = 0;
39
+ SURROGATE_PAIR_RE.lastIndex = 0;
40
+ while (SURROGATE_PAIR_RE.test(input)) surrogatePairsNr += 1;
41
+ return input.length - surrogatePairsNr;
42
+ };
43
+ })();
42
44
  const isFullWidth = (x) => {
43
45
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
44
46
  };
45
- const isWide = (x) => {
46
- 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;
47
+ const isWideNotCJKTNotEmoji = (x) => {
48
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || 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 >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
47
49
  };
48
50
  //#endregion
49
- //#region node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
50
- const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
51
+ //#region node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
52
+ const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
51
53
  const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
54
+ const CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy;
52
55
  const TAB_RE = /\t{1,1000}/y;
53
56
  const 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?))*/uy;
54
57
  const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -61,14 +64,21 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
61
64
  const LIMIT = truncationOptions.limit ?? Infinity;
62
65
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
63
66
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
64
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
67
+ const ANSI_WIDTH = 0;
65
68
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
66
69
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
67
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
68
70
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
69
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
71
+ const FULL_WIDTH_WIDTH = 2;
70
72
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
71
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
73
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
74
+ const PARSE_BLOCKS = [
75
+ [LATIN_RE, REGULAR_WIDTH],
76
+ [ANSI_RE, ANSI_WIDTH],
77
+ [CONTROL_RE, CONTROL_WIDTH],
78
+ [TAB_RE, TAB_WIDTH],
79
+ [EMOJI_RE, EMOJI_WIDTH],
80
+ [CJKT_WIDE_RE, WIDE_WIDTH]
81
+ ];
72
82
  let indexPrev = 0;
73
83
  let index = 0;
74
84
  let length = input.length;
@@ -87,8 +97,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
87
97
  for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
88
98
  const codePoint = char.codePointAt(0) || 0;
89
99
  if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
90
- else if (isWide(codePoint)) widthExtra = WIDE_WIDTH;
91
- else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) widthExtra = AMBIGUOUS_WIDTH;
100
+ else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
92
101
  else widthExtra = REGULAR_WIDTH;
93
102
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
94
103
  if (width + widthExtra > LIMIT) {
@@ -100,77 +109,24 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
100
109
  }
101
110
  unmatchedStart = unmatchedEnd = 0;
102
111
  }
103
- if (index >= length) break;
104
- LATIN_RE.lastIndex = index;
105
- if (LATIN_RE.test(input)) {
106
- lengthExtra = LATIN_RE.lastIndex - index;
107
- widthExtra = lengthExtra * REGULAR_WIDTH;
108
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
109
- if (width + widthExtra > LIMIT) {
110
- truncationEnabled = true;
111
- break;
112
- }
113
- width += widthExtra;
114
- unmatchedStart = indexPrev;
115
- unmatchedEnd = index;
116
- index = indexPrev = LATIN_RE.lastIndex;
117
- continue;
118
- }
119
- ANSI_RE.lastIndex = index;
120
- if (ANSI_RE.test(input)) {
121
- if (width + ANSI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
122
- if (width + ANSI_WIDTH > LIMIT) {
123
- truncationEnabled = true;
124
- break;
125
- }
126
- width += ANSI_WIDTH;
127
- unmatchedStart = indexPrev;
128
- unmatchedEnd = index;
129
- index = indexPrev = ANSI_RE.lastIndex;
130
- continue;
131
- }
132
- CONTROL_RE.lastIndex = index;
133
- if (CONTROL_RE.test(input)) {
134
- lengthExtra = CONTROL_RE.lastIndex - index;
135
- widthExtra = lengthExtra * CONTROL_WIDTH;
136
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
137
- if (width + widthExtra > LIMIT) {
138
- truncationEnabled = true;
139
- break;
140
- }
141
- width += widthExtra;
142
- unmatchedStart = indexPrev;
143
- unmatchedEnd = index;
144
- index = indexPrev = CONTROL_RE.lastIndex;
145
- continue;
146
- }
147
- TAB_RE.lastIndex = index;
148
- if (TAB_RE.test(input)) {
149
- lengthExtra = TAB_RE.lastIndex - index;
150
- widthExtra = lengthExtra * TAB_WIDTH;
151
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
152
- if (width + widthExtra > LIMIT) {
153
- truncationEnabled = true;
154
- break;
155
- }
156
- width += widthExtra;
157
- unmatchedStart = indexPrev;
158
- unmatchedEnd = index;
159
- index = indexPrev = TAB_RE.lastIndex;
160
- continue;
161
- }
162
- EMOJI_RE.lastIndex = index;
163
- if (EMOJI_RE.test(input)) {
164
- if (width + EMOJI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
165
- if (width + EMOJI_WIDTH > LIMIT) {
166
- truncationEnabled = true;
167
- break;
112
+ if (index >= length) break outer;
113
+ for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
114
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
115
+ BLOCK_RE.lastIndex = index;
116
+ if (BLOCK_RE.test(input)) {
117
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
118
+ widthExtra = lengthExtra * BLOCK_WIDTH;
119
+ if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
120
+ if (width + widthExtra > LIMIT) {
121
+ truncationEnabled = true;
122
+ break outer;
123
+ }
124
+ width += widthExtra;
125
+ unmatchedStart = indexPrev;
126
+ unmatchedEnd = index;
127
+ index = indexPrev = BLOCK_RE.lastIndex;
128
+ continue outer;
168
129
  }
169
- width += EMOJI_WIDTH;
170
- unmatchedStart = indexPrev;
171
- unmatchedEnd = index;
172
- index = indexPrev = EMOJI_RE.lastIndex;
173
- continue;
174
130
  }
175
131
  index += 1;
176
132
  }
@@ -182,7 +138,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
182
138
  };
183
139
  };
184
140
  //#endregion
185
- //#region node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
141
+ //#region node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
186
142
  const NO_TRUNCATION = {
187
143
  limit: Infinity,
188
144
  ellipsis: "",
@@ -192,7 +148,7 @@ const fastStringWidth = (input, options = {}) => {
192
148
  return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
193
149
  };
194
150
  //#endregion
195
- //#region node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
151
+ //#region node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
196
152
  const ESC = "\x1B";
197
153
  const CSI = "›";
198
154
  const END_CODE = 39;
@@ -329,8 +285,10 @@ const exec = (string, columns, options = {}) => {
329
285
  for (let i = 0; i < preString.length; i++) {
330
286
  const character = preString[i];
331
287
  returnValue += character;
332
- if (!inSurrogate) inSurrogate = character >= "\ud800" && character <= "\udbff";
333
- else continue;
288
+ if (!inSurrogate) {
289
+ inSurrogate = character >= "\ud800" && character <= "\udbff";
290
+ if (inSurrogate) continue;
291
+ } else inSurrogate = false;
334
292
  if (character === ESC || character === CSI) {
335
293
  GROUP_REGEX.lastIndex = i + 1;
336
294
  const groups = GROUP_REGEX.exec(preString)?.groups;
@@ -355,7 +313,7 @@ function wrapAnsi(string, columns, options) {
355
313
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
356
314
  }
357
315
  //#endregion
358
- //#region node_modules/.pnpm/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
316
+ //#region node_modules/.pnpm/@clack+core@1.4.2/node_modules/@clack/core/dist/index.mjs
359
317
  var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
360
318
  const ESC = "\x1B";
361
319
  const CSI = `${ESC}[`;
@@ -408,12 +366,7 @@ var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
408
366
  beep
409
367
  };
410
368
  })))();
411
- function d$1(r, t, e) {
412
- if (!e.some((o) => !o.disabled)) return r;
413
- const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
414
- return e[n].disabled ? d$1(n, t < 0 ? -1 : 1, e) : n;
415
- }
416
- const u = {
369
+ const settings = {
417
370
  actions: new Set([
418
371
  "up",
419
372
  "down",
@@ -423,7 +376,7 @@ const u = {
423
376
  "enter",
424
377
  "cancel"
425
378
  ]),
426
- aliases: new Map([
379
+ aliases: /* @__PURE__ */ new Map([
427
380
  ["k", "up"],
428
381
  ["j", "down"],
429
382
  ["h", "left"],
@@ -435,7 +388,7 @@ const u = {
435
388
  cancel: "Canceled",
436
389
  error: "Something went wrong"
437
390
  },
438
- withGuide: !0,
391
+ withGuide: true,
439
392
  date: {
440
393
  monthNames: [...[
441
394
  "January",
@@ -454,56 +407,67 @@ const u = {
454
407
  messages: {
455
408
  required: "Please enter a valid date",
456
409
  invalidMonth: "There are only 12 months in a year",
457
- invalidDay: (r, t) => `There are only ${r} days in ${t}`,
458
- afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`,
459
- beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}`
410
+ invalidDay: (n, e) => `There are only ${n} days in ${e}`,
411
+ afterMin: (n) => `Date must be on or after ${n.toISOString().slice(0, 10)}`,
412
+ beforeMax: (n) => `Date must be on or before ${n.toISOString().slice(0, 10)}`
460
413
  }
461
414
  }
462
415
  };
463
- function V$1(r, t) {
464
- if (typeof r == "string") return u.aliases.get(r) === t;
465
- for (const e of r) if (e !== void 0 && V$1(e, t)) return !0;
466
- return !1;
416
+ function isActionKey(n, e) {
417
+ if (typeof n == "string") return settings.aliases.get(n) === e;
418
+ for (const s of n) if (s !== void 0 && isActionKey(s, e)) return true;
419
+ return false;
467
420
  }
468
- function j(r, t) {
469
- if (r === t) return;
470
- const e = r.split(`
471
- `), s = t.split(`
472
- `), i = Math.max(e.length, s.length), n = [];
473
- for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
421
+ function diffLines(i, s) {
422
+ if (i === s) return;
423
+ const e = i.split(`
424
+ `), t = s.split(`
425
+ `), r = Math.max(e.length, t.length), f = [];
426
+ for (let n = 0; n < r; n++) e[n] !== t[n] && f.push(n);
474
427
  return {
475
- lines: n,
428
+ lines: f,
476
429
  numLinesBefore: e.length,
477
- numLinesAfter: s.length,
478
- numLines: i
430
+ numLinesAfter: t.length,
431
+ numLines: r
479
432
  };
480
433
  }
481
434
  globalThis.process.platform.startsWith("win");
482
- const C = Symbol("clack:cancel");
483
- function q(r) {
484
- return r === C;
435
+ const CANCEL_SYMBOL = Symbol("clack:cancel");
436
+ function isCancel(e) {
437
+ return e === CANCEL_SYMBOL;
485
438
  }
486
- function w$1(r, t) {
487
- const e = r;
488
- e.isTTY && e.setRawMode(t);
439
+ function setRawMode(e, r) {
440
+ const o = e;
441
+ o.isTTY && o.setRawMode(r);
489
442
  }
490
- const O$1 = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80, A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
491
- function R(r, t, e, s = e) {
492
- return wrapAnsi(t, O$1(r ?? stdout) - e.length, {
493
- hard: !0,
494
- trim: !1
443
+ const getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80, getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
444
+ function wrapTextWithPrefix(e, r, o, t = o, s = o, n) {
445
+ return wrapAnsi(r, getColumns(e ?? stdout) - o.length, {
446
+ hard: true,
447
+ trim: false
495
448
  }).split(`
496
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
449
+ `).map((c, i, m) => {
450
+ const d = n ? n(c, i) : c;
451
+ return i === 0 ? `${t}${d}` : i === m.length - 1 ? `${s}${d}` : `${o}${d}`;
452
+ }).join(`
497
453
  `);
498
454
  }
499
- let p = class {
455
+ function runValidation(e, n) {
456
+ if ("~standard" in e) {
457
+ const a = e["~standard"].validate(n);
458
+ if (a instanceof Promise) throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
459
+ return a.issues?.at(0)?.message;
460
+ }
461
+ return e(n);
462
+ }
463
+ var V = class {
500
464
  input;
501
465
  output;
502
466
  _abortSignal;
503
467
  rl;
504
468
  opts;
505
469
  _render;
506
- _track = !1;
470
+ _track = false;
507
471
  _prevFrame = "";
508
472
  _subscribers = /* @__PURE__ */ new Map();
509
473
  _cursor = 0;
@@ -511,55 +475,80 @@ let p = class {
511
475
  error = "";
512
476
  value;
513
477
  userInput = "";
514
- constructor(t, e = !0) {
515
- const { input: s = stdin, output: i = stdout, render: n, signal: o, ...a } = t;
516
- this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = e, this._abortSignal = o, this.input = s, this.output = i;
478
+ constructor(t, e = true) {
479
+ const { input: i = stdin, output: n = stdout, render: s, signal: r, ...o } = t;
480
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s.bind(this), this._track = e, this._abortSignal = r, this.input = i, this.output = n;
517
481
  }
482
+ /**
483
+ * Unsubscribe all listeners
484
+ */
518
485
  unsubscribe() {
519
486
  this._subscribers.clear();
520
487
  }
488
+ /**
489
+ * Set a subscriber with opts
490
+ * @param event - The event name
491
+ */
521
492
  setSubscriber(t, e) {
522
- const s = this._subscribers.get(t) ?? [];
523
- s.push(e), this._subscribers.set(t, s);
493
+ const i = this._subscribers.get(t) ?? [];
494
+ i.push(e), this._subscribers.set(t, i);
524
495
  }
496
+ /**
497
+ * Subscribe to an event
498
+ * @param event - The event name
499
+ * @param cb - The callback
500
+ */
525
501
  on(t, e) {
526
502
  this.setSubscriber(t, { cb: e });
527
503
  }
504
+ /**
505
+ * Subscribe to an event once
506
+ * @param event - The event name
507
+ * @param cb - The callback
508
+ */
528
509
  once(t, e) {
529
510
  this.setSubscriber(t, {
530
511
  cb: e,
531
- once: !0
512
+ once: true
532
513
  });
533
514
  }
515
+ /**
516
+ * Emit an event with data
517
+ * @param event - The event name
518
+ * @param data - The data to pass to the callback
519
+ */
534
520
  emit(t, ...e) {
535
- const s = this._subscribers.get(t) ?? [], i = [];
536
- for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
537
- for (const n of i) n();
521
+ const i = this._subscribers.get(t) ?? [], n = [];
522
+ for (const s of i) s.cb(...e), s.once && n.push(() => i.splice(i.indexOf(s), 1));
523
+ for (const s of n) s();
538
524
  }
539
525
  prompt() {
540
526
  return new Promise((t) => {
541
527
  if (this._abortSignal) {
542
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(C);
528
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(CANCEL_SYMBOL);
543
529
  this._abortSignal.addEventListener("abort", () => {
544
530
  this.state = "cancel", this.close();
545
- }, { once: !0 });
531
+ }, { once: true });
546
532
  }
547
- this.rl = P$1.createInterface({
533
+ this.rl = l__default.createInterface({
548
534
  input: this.input,
549
535
  tabSize: 2,
550
536
  prompt: "",
551
537
  escapeCodeTimeout: 50,
552
- terminal: !0
553
- }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), w$1(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
554
- this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(this.value);
538
+ terminal: true
539
+ }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
540
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(this.value);
555
541
  }), this.once("cancel", () => {
556
- this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(C);
542
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(CANCEL_SYMBOL);
557
543
  });
558
544
  });
559
545
  }
560
546
  _isActionKey(t, e) {
561
547
  return t === " ";
562
548
  }
549
+ _shouldSubmit(t, e) {
550
+ return true;
551
+ }
563
552
  _setValue(t) {
564
553
  this.value = t, this.emit("value", this.value);
565
554
  }
@@ -568,22 +557,22 @@ let p = class {
568
557
  }
569
558
  _clearUserInput() {
570
559
  this.rl?.write(null, {
571
- ctrl: !0,
560
+ ctrl: true,
572
561
  name: "u"
573
562
  }), this._setUserInput("");
574
563
  }
575
564
  onKeypress(t, e) {
576
565
  if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
577
- ctrl: !0,
566
+ ctrl: true,
578
567
  name: "h"
579
- }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), e), e?.name === "return") {
568
+ }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t, e), e?.name === "return" && this._shouldSubmit(t, e)) {
580
569
  if (this.opts.validate) {
581
- const s = this.opts.validate(this.value);
582
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
570
+ const i = runValidation(this.opts.validate, this.value);
571
+ i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
583
572
  }
584
573
  this.state !== "error" && (this.state = "submit");
585
574
  }
586
- V$1([
575
+ isActionKey([
587
576
  t,
588
577
  e?.name,
589
578
  e?.sequence
@@ -591,48 +580,48 @@ let p = class {
591
580
  }
592
581
  close() {
593
582
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
594
- `), w$1(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
583
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
595
584
  }
596
585
  restoreCursor() {
597
586
  const t = wrapAnsi(this._prevFrame, process.stdout.columns, {
598
- hard: !0,
599
- trim: !1
587
+ hard: true,
588
+ trim: false
600
589
  }).split(`
601
590
  `).length - 1;
602
591
  this.output.write(import_src.cursor.move(-999, t * -1));
603
592
  }
604
593
  render() {
605
594
  const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
606
- hard: !0,
607
- trim: !1
595
+ hard: true,
596
+ trim: false
608
597
  });
609
598
  if (t !== this._prevFrame) {
610
599
  if (this.state === "initial") this.output.write(import_src.cursor.hide);
611
600
  else {
612
- const e = j(this._prevFrame, t), s = A(this.output);
601
+ const e = diffLines(this._prevFrame, t), i = getRows(this.output);
613
602
  if (this.restoreCursor(), e) {
614
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
615
- let o = e.lines.find((a) => a >= i);
616
- if (o === void 0) {
603
+ const n = Math.max(0, e.numLinesAfter - i), s = Math.max(0, e.numLinesBefore - i);
604
+ let r = e.lines.find((o) => o >= n);
605
+ if (r === void 0) {
617
606
  this._prevFrame = t;
618
607
  return;
619
608
  }
620
609
  if (e.lines.length === 1) {
621
- this.output.write(import_src.cursor.move(0, o - n)), this.output.write(import_src.erase.lines(1));
622
- const a = t.split(`
610
+ this.output.write(import_src.cursor.move(0, r - s)), this.output.write(import_src.erase.lines(1));
611
+ const o = t.split(`
623
612
  `);
624
- this.output.write(a[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, a.length - o - 1));
613
+ this.output.write(o[r]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, o.length - r - 1));
625
614
  return;
626
615
  } else if (e.lines.length > 1) {
627
- if (i < n) o = i;
616
+ if (n < s) r = n;
628
617
  else {
629
- const h = o - n;
618
+ const h = r - s;
630
619
  h > 0 && this.output.write(import_src.cursor.move(0, h));
631
620
  }
632
621
  this.output.write(import_src.erase.down());
633
- const a = t.split(`
634
- `).slice(o);
635
- this.output.write(a.join(`
622
+ const f = t.split(`
623
+ `).slice(r);
624
+ this.output.write(f.join(`
636
625
  `)), this._prevFrame = t;
637
626
  return;
638
627
  }
@@ -643,7 +632,7 @@ let p = class {
643
632
  }
644
633
  }
645
634
  };
646
- var Q$1 = class extends p {
635
+ var r = class extends V {
647
636
  get cursor() {
648
637
  return this.value ? 0 : 1;
649
638
  }
@@ -651,22 +640,22 @@ var Q$1 = class extends p {
651
640
  return this.cursor === 0;
652
641
  }
653
642
  constructor(t) {
654
- super(t, !1), this.value = !!t.initialValue, this.on("userInput", () => {
643
+ super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
655
644
  this.value = this._value;
656
- }), this.on("confirm", (e) => {
657
- this.output.write(import_src.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
645
+ }), this.on("confirm", (i) => {
646
+ this.output.write(import_src.cursor.move(0, -1)), this.value = i, this.state = "submit", this.close();
658
647
  }), this.on("cursor", () => {
659
648
  this.value = !this.value;
660
649
  });
661
650
  }
662
651
  };
663
- var at$1 = class extends p {
652
+ var n = class extends V {
664
653
  get userInputWithCursor() {
665
654
  if (this.state === "submit") return this.userInput;
666
655
  const t = this.userInput;
667
656
  if (this.cursor >= t.length) return `${this.userInput}\u2588`;
668
- const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
669
- return `${e}${styleText("inverse", s)}${i.join("")}`;
657
+ const e = t.slice(0, this.cursor), [s, ...r] = t.slice(this.cursor);
658
+ return `${e}${styleText("inverse", s)}${r.join("")}`;
670
659
  }
671
660
  get cursor() {
672
661
  return this._cursor;
@@ -683,165 +672,118 @@ var at$1 = class extends p {
683
672
  }
684
673
  };
685
674
  //#endregion
686
- //#region node_modules/.pnpm/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
687
- function Ze() {
688
- return P.platform !== "win32" ? P.env.TERM !== "linux" : !!P.env.CI || !!P.env.WT_SESSION || !!P.env.TERMINUS_SUBLIME || P.env.ConEmuTask === "{cmd::Cmder}" || P.env.TERM_PROGRAM === "Terminus-Sublime" || P.env.TERM_PROGRAM === "vscode" || P.env.TERM === "xterm-256color" || P.env.TERM === "alacritty" || P.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
675
+ //#region node_modules/.pnpm/@clack+prompts@1.6.0/node_modules/@clack/prompts/dist/index.mjs
676
+ function isUnicodeSupported() {
677
+ if (process$1.platform !== "win32") return process$1.env.TERM !== "linux";
678
+ return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
689
679
  }
690
- const ee = Ze(), w = (e, i) => ee ? e : i, _e = w("◆", "*"), oe = w("■", "x"), ue = w("▲", "x"), F = w("◇", "o"), le = w("┌", "T"), d = w("│", "|"), E = w("└", "—");
691
- const z = w("", ">"), H = w("○", " "), he = w("●", "•"), pe = w("◆", "*"), me = w("▲", "!"), ge = w("■", "x"), V = (e) => {
692
- switch (e) {
680
+ const unicode = isUnicodeSupported(), unicodeOr = (o, e) => unicode ? o : e, S_STEP_ACTIVE = unicodeOr("◆", "*"), S_STEP_CANCEL = unicodeOr("■", "x"), S_STEP_ERROR = unicodeOr("▲", "x"), S_STEP_SUBMIT = unicodeOr("◇", "o"), S_BAR_START = unicodeOr("┌", "T"), S_BAR = unicodeOr("│", "|"), S_BAR_END = unicodeOr("└", "—");
681
+ unicodeOr("", "T");
682
+ unicodeOr("┘", "—");
683
+ const S_RADIO_ACTIVE = unicodeOr("●", ">"), S_RADIO_INACTIVE = unicodeOr("○", " ");
684
+ unicodeOr("◻", "[•]");
685
+ unicodeOr("◼", "[+]");
686
+ unicodeOr("◻", "[ ]");
687
+ unicodeOr("▪", "•");
688
+ unicodeOr("─", "-");
689
+ unicodeOr("╮", "+");
690
+ unicodeOr("├", "+");
691
+ unicodeOr("╯", "+");
692
+ unicodeOr("╰", "+");
693
+ unicodeOr("╭", "+");
694
+ unicodeOr("●", "•");
695
+ unicodeOr("◆", "*");
696
+ unicodeOr("▲", "!");
697
+ unicodeOr("■", "x");
698
+ const symbol = (o) => {
699
+ switch (o) {
693
700
  case "initial":
694
- case "active": return styleText("cyan", _e);
695
- case "cancel": return styleText("red", oe);
696
- case "error": return styleText("yellow", ue);
697
- case "submit": return styleText("green", F);
701
+ case "active": return styleText("cyan", S_STEP_ACTIVE);
702
+ case "cancel": return styleText("red", S_STEP_CANCEL);
703
+ case "error": return styleText("yellow", S_STEP_ERROR);
704
+ case "submit": return styleText("green", S_STEP_SUBMIT);
698
705
  }
699
706
  };
700
- const ot = (e) => {
701
- const i = e.active ?? "Yes", s = e.inactive ?? "No";
702
- return new Q$1({
703
- active: i,
707
+ const confirm = (i) => {
708
+ const a = i.active ?? "Yes", s = i.inactive ?? "No";
709
+ return new r({
710
+ active: a,
704
711
  inactive: s,
705
- signal: e.signal,
706
- input: e.input,
707
- output: e.output,
708
- initialValue: e.initialValue ?? !0,
712
+ signal: i.signal,
713
+ input: i.input,
714
+ output: i.output,
715
+ initialValue: i.initialValue ?? true,
709
716
  render() {
710
- const r = e.withGuide ?? u.withGuide, u$4 = `${V(this.state)} `, n = r ? `${styleText("gray", d)} ` : "", o = R(e.output, e.message, n, u$4), c = `${r ? `${styleText("gray", d)}
711
- ` : ""}${o}
712
- `, a = this.value ? i : s;
717
+ const e = i.withGuide ?? settings.withGuide, u = `${symbol(this.state)} `, l = e ? `${styleText("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(i.output, i.message, l, u), o = `${e ? `${styleText("gray", S_BAR)}
718
+ ` : ""}${f}
719
+ `, c = this.value ? a : s;
713
720
  switch (this.state) {
714
- case "submit": return `${c}${r ? `${styleText("gray", d)} ` : ""}${styleText("dim", a)}`;
715
- case "cancel": return `${c}${r ? `${styleText("gray", d)} ` : ""}${styleText(["strikethrough", "dim"], a)}${r ? `
716
- ${styleText("gray", d)}` : ""}`;
721
+ case "submit": return `${o}${e ? `${styleText("gray", S_BAR)} ` : ""}${styleText("dim", c)}`;
722
+ case "cancel": return `${o}${e ? `${styleText("gray", S_BAR)} ` : ""}${styleText(["strikethrough", "dim"], c)}${e ? `
723
+ ${styleText("gray", S_BAR)}` : ""}`;
717
724
  default: {
718
- const l = r ? `${styleText("cyan", d)} ` : "", $ = r ? styleText("cyan", E) : "";
719
- return `${c}${l}${this.value ? `${styleText("green", z)} ${i}` : `${styleText("dim", H)} ${styleText("dim", i)}`}${e.vertical ? r ? `
720
- ${styleText("cyan", d)} ` : `
721
- ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", H)} ${styleText("dim", s)}` : `${styleText("green", z)} ${s}`}
722
- ${$}
725
+ const r = e ? `${styleText("cyan", S_BAR)} ` : "", g = e ? styleText("cyan", S_BAR_END) : "";
726
+ return `${o}${r}${this.value ? `${styleText("green", S_RADIO_ACTIVE)} ${a}` : `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", a)}`}${i.vertical ? e ? `
727
+ ${styleText("cyan", S_BAR)} ` : `
728
+ ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", s)}` : `${styleText("green", S_RADIO_ACTIVE)} ${s}`}
729
+ ${g}
723
730
  `;
724
731
  }
725
732
  }
726
733
  }
727
734
  }).prompt();
728
- }, O = {
729
- message: (e = [], { symbol: i = styleText("gray", d), secondarySymbol: s = styleText("gray", d), output: r = process.stdout, spacing: u$7 = 1, withGuide: n } = {}) => {
730
- const o = [], c = n ?? u.withGuide, a = c ? s : "", l = c ? `${i} ` : "", $ = c ? `${s} ` : "";
731
- for (let p = 0; p < u$7; p++) o.push(a);
732
- const y = Array.isArray(e) ? e : e.split(`
733
- `);
734
- if (y.length > 0) {
735
- const [p, ...m] = y;
736
- p.length > 0 ? o.push(`${l}${p}`) : o.push(c ? i : "");
737
- for (const g of m) g.length > 0 ? o.push(`${$}${g}`) : o.push(c ? s : "");
738
- }
739
- r.write(`${o.join(`
740
- `)}
741
- `);
742
- },
743
- info: (e, i) => {
744
- O.message(e, {
745
- ...i,
746
- symbol: styleText("blue", he)
747
- });
748
- },
749
- success: (e, i) => {
750
- O.message(e, {
751
- ...i,
752
- symbol: styleText("green", pe)
753
- });
754
- },
755
- step: (e, i) => {
756
- O.message(e, {
757
- ...i,
758
- symbol: styleText("green", F)
759
- });
760
- },
761
- warn: (e, i) => {
762
- O.message(e, {
763
- ...i,
764
- symbol: styleText("yellow", me)
765
- });
766
- },
767
- warning: (e, i) => {
768
- O.warn(e, i);
769
- },
770
- error: (e, i) => {
771
- O.message(e, {
772
- ...i,
773
- symbol: styleText("red", ge)
774
- });
775
- }
776
- }, pt = (e = "", i) => {
777
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", E)} ` : "";
778
- s.write(`${r}${styleText("red", e)}
735
+ };
736
+ `${styleText("dim", "↑/↓")}`, `${styleText("dim", "Space:")}`, `${styleText("dim", "Enter:")}`;
737
+ const cancel = (o = "", t) => {
738
+ const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR_END)} ` : "";
739
+ i.write(`${e}${styleText("red", o)}
779
740
 
780
741
  `);
781
- }, mt = (e = "", i) => {
782
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", le)} ` : "";
783
- s.write(`${r}${e}
742
+ }, intro = (o = "", t) => {
743
+ const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR_START)} ` : "";
744
+ i.write(`${e}${o}
784
745
  `);
785
- }, gt = (e = "", i) => {
786
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", d)}
787
- ${styleText("gray", E)} ` : "";
788
- s.write(`${r}${e}
746
+ }, outro = (o = "", t) => {
747
+ const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR)}
748
+ ${styleText("gray", S_BAR_END)} ` : "";
749
+ i.write(`${e}${o}
789
750
 
790
751
  `);
791
- }, je = `${styleText("gray", d)} `, K = {
792
- message: async (e, { symbol: i = styleText("gray", d) } = {}) => {
793
- process.stdout.write(`${styleText("gray", d)}
794
- ${i} `);
795
- let s = 3;
796
- for await (let r of e) {
797
- r = r.replace(/\n/g, `
798
- ${je}`), r.includes(`
799
- `) && (s = 3 + stripVTControlCharacters(r.slice(r.lastIndexOf(`
800
- `))).length);
801
- const u = stripVTControlCharacters(r).length;
802
- s + u < process.stdout.columns ? (s += u, process.stdout.write(r)) : (process.stdout.write(`
803
- ${je}${r.trimStart()}`), s = 3 + stripVTControlCharacters(r.trimStart()).length);
804
- }
805
- process.stdout.write(`
806
- `);
807
- },
808
- info: (e) => K.message(e, { symbol: styleText("blue", he) }),
809
- success: (e) => K.message(e, { symbol: styleText("green", pe) }),
810
- step: (e) => K.message(e, { symbol: styleText("green", F) }),
811
- warn: (e) => K.message(e, { symbol: styleText("yellow", me) }),
812
- warning: (e) => K.warn(e),
813
- error: (e) => K.message(e, { symbol: styleText("red", ge) })
814
- }, Ot = (e) => new at$1({
815
- validate: e.validate,
816
- placeholder: e.placeholder,
817
- defaultValue: e.defaultValue,
818
- initialValue: e.initialValue,
819
- output: e.output,
820
- signal: e.signal,
821
- input: e.input,
752
+ };
753
+ unicodeOr("─", "-"), unicodeOr("━", "="), unicodeOr("", "#");
754
+ `${styleText("dim", "↑/↓")}`, `${styleText("dim", "Enter:")}`;
755
+ `${styleText("gray", S_BAR)}`;
756
+ const text = (t) => new n({
757
+ validate: t.validate,
758
+ placeholder: t.placeholder,
759
+ defaultValue: t.defaultValue,
760
+ initialValue: t.initialValue,
761
+ output: t.output,
762
+ signal: t.signal,
763
+ input: t.input,
822
764
  render() {
823
- const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${styleText("gray", d)}
824
- ` : ""}${V(this.state)} `}${e.message}
825
- `, r = e.placeholder ? styleText("inverse", e.placeholder[0]) + styleText("dim", e.placeholder.slice(1)) : styleText(["inverse", "hidden"], "_"), u$13 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
765
+ const i = t?.withGuide ?? settings.withGuide, s = `${`${i ? `${styleText("gray", S_BAR)}
766
+ ` : ""}${symbol(this.state)} `}${t.message}
767
+ `, c = t.placeholder ? styleText("inverse", t.placeholder[0]) + styleText("dim", t.placeholder.slice(1)) : styleText(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : c, a = this.value ?? "";
826
768
  switch (this.state) {
827
769
  case "error": {
828
- const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", d)} ` : "", a = i ? styleText("yellow", E) : "";
770
+ const n = this.error ? ` ${styleText("yellow", this.error)}` : "", r = i ? `${styleText("yellow", S_BAR)} ` : "", d = i ? styleText("yellow", S_BAR_END) : "";
829
771
  return `${s.trim()}
830
- ${c}${u$13}
831
- ${a}${o}
772
+ ${r}${o}
773
+ ${d}${n}
832
774
  `;
833
775
  }
834
776
  case "submit": {
835
- const o = n ? ` ${styleText("dim", n)}` : "";
836
- return `${s}${i ? styleText("gray", d) : ""}${o}`;
777
+ const n = a ? ` ${styleText("dim", a)}` : "";
778
+ return `${s}${i ? styleText("gray", S_BAR) : ""}${n}`;
837
779
  }
838
780
  case "cancel": {
839
- const o = n ? ` ${styleText(["strikethrough", "dim"], n)}` : "", c = i ? styleText("gray", d) : "";
840
- return `${s}${c}${o}${n.trim() ? `
841
- ${c}` : ""}`;
781
+ const n = a ? ` ${styleText(["strikethrough", "dim"], a)}` : "", r = i ? styleText("gray", S_BAR) : "";
782
+ return `${s}${r}${n}${a.trim() ? `
783
+ ${r}` : ""}`;
842
784
  }
843
- default: return `${s}${i ? `${styleText("cyan", d)} ` : ""}${u$13}
844
- ${i ? styleText("cyan", E) : ""}
785
+ default: return `${s}${i ? `${styleText("cyan", S_BAR)} ` : ""}${o}
786
+ ${i ? styleText("cyan", S_BAR_END) : ""}
845
787
  `;
846
788
  }
847
789
  }
@@ -1799,8 +1741,8 @@ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
1799
1741
  //#region utils/banners.ts
1800
1742
  var import_picocolors = require_picocolors();
1801
1743
  var import_ejs = /* @__PURE__ */ __toESM(require_ejs(), 1);
1802
- const defaultBanner = "Rue.js - The Wasm Framework For Native DOM";
1803
- const gradientBanner = "\x1B[38;2;66;211;146mR\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;207;152m \x1B[39m\x1B[38;2;69;204;155m-\x1B[39m\x1B[38;2;70;202;158m \x1B[39m\x1B[38;2;71;200;160mT\x1B[39m\x1B[38;2;71;197;163mh\x1B[39m\x1B[38;2;72;195;166me\x1B[39m\x1B[38;2;73;193;169m \x1B[39m\x1B[38;2;74;190;172mW\x1B[39m\x1B[38;2;75;188;175ma\x1B[39m\x1B[38;2;76;186;178ms\x1B[39m\x1B[38;2;77;184;181mm\x1B[39m\x1B[38;2;78;181;184m \x1B[39m\x1B[38;2;79;179;187mF\x1B[39m\x1B[38;2;80;177;190mr\x1B[39m\x1B[38;2;81;174;193ma\x1B[39m\x1B[38;2;82;172;196mm\x1B[39m\x1B[38;2;82;170;199me\x1B[39m\x1B[38;2;83;167;202mw\x1B[39m\x1B[38;2;84;165;205mo\x1B[39m\x1B[38;2;85;163;208mr\x1B[39m\x1B[38;2;86;161;211mk\x1B[39m\x1B[38;2;87;158;214m \x1B[39m\x1B[38;2;88;156;217mF\x1B[39m\x1B[38;2;89;154;220mo\x1B[39m\x1B[38;2;90;151;223mr\x1B[39m\x1B[38;2;91;149;225m \x1B[39m\x1B[38;2;92;147;228mN\x1B[39m\x1B[38;2;93;144;231ma\x1B[39m\x1B[38;2;94;142;234mt\x1B[39m\x1B[38;2;94;140;237mi\x1B[39m\x1B[38;2;95;138;240mv\x1B[39m\x1B[38;2;96;135;243me\x1B[39m\x1B[38;2;97;133;246m \x1B[39m\x1B[38;2;98;131;249mD\x1B[39m\x1B[38;2;99;128;252mO\x1B[39m\x1B[38;2;100;126;255mM\x1B[39m";
1744
+ const defaultBanner = "Rue.js - The Wasm Framework For Vapor Native DOM";
1745
+ const gradientBanner = "\x1B[38;2;66;211;146mR\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;66;210;147ms\x1B[39m \x1B[38;2;68;206;152m-\x1B[39m \x1B[38;2;69;202;157mT\x1B[39m\x1B[38;2;70;200;160mh\x1B[39m\x1B[38;2;71;198;162me\x1B[39m \x1B[38;2;73;194;167mW\x1B[39m\x1B[38;2;73;192;170ma\x1B[39m\x1B[38;2;74;190;173ms\x1B[39m\x1B[38;2;75;188;175mm\x1B[39m \x1B[38;2;77;184;180mF\x1B[39m\x1B[38;2;77;182;183mr\x1B[39m\x1B[38;2;78;180;185ma\x1B[39m\x1B[38;2;79;178;188mm\x1B[39m\x1B[38;2;80;176;191me\x1B[39m\x1B[38;2;81;174;193mw\x1B[39m\x1B[38;2;82;172;196mo\x1B[39m\x1B[38;2;82;170;198mr\x1B[39m\x1B[38;2;83;168;201mk\x1B[39m \x1B[38;2;85;164;206mF\x1B[39m\x1B[38;2;86;162;209mo\x1B[39m\x1B[38;2;86;160;211mr\x1B[39m \x1B[38;2;88;156;216mV\x1B[39m\x1B[38;2;89;154;219ma\x1B[39m\x1B[38;2;90;152;222mp\x1B[39m\x1B[38;2;90;150;224mo\x1B[39m\x1B[38;2;91;148;227mr\x1B[39m \x1B[38;2;93;144;232mN\x1B[39m\x1B[38;2;94;142;234ma\x1B[39m\x1B[38;2;94;140;237mt\x1B[39m\x1B[38;2;95;138;240mi\x1B[39m\x1B[38;2;96;136;242mv\x1B[39m\x1B[38;2;97;134;245me\x1B[39m \x1B[38;2;98;130;250mD\x1B[39m\x1B[38;2;99;128;252mO\x1B[39m\x1B[38;2;100;126;255mM\x1B[39m";
1804
1746
  //#endregion
1805
1747
  //#region utils/deepMerge.ts
1806
1748
  const isObject = (val) => val && typeof val === "object";
@@ -2037,7 +1979,7 @@ function inferPackageManager() {
2037
1979
  //#endregion
2038
1980
  //#region package.json
2039
1981
  var name = "create-rue";
2040
- var version = "0.3.12";
1982
+ var version = "0.7.2";
2041
1983
  //#endregion
2042
1984
  //#region index.ts
2043
1985
  const language = await getLanguage(fileURLToPath(new URL("./locales", import.meta.url)));
@@ -2064,8 +2006,8 @@ function emptyDir(dir) {
2064
2006
  }
2065
2007
  async function unwrapPrompt(maybeCancelPromise) {
2066
2008
  const result = await maybeCancelPromise;
2067
- if (q(result)) {
2068
- pt((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
2009
+ if (isCancel(result)) {
2010
+ cancel((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
2069
2011
  process.exit(0);
2070
2012
  }
2071
2013
  return result;
@@ -2120,24 +2062,24 @@ async function init() {
2120
2062
  shouldOverwrite: forceOverwrite,
2121
2063
  packageName: defaultProjectName
2122
2064
  };
2123
- mt(process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner);
2124
- if (!targetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(Ot({
2065
+ intro(process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner);
2066
+ if (!targetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(text({
2125
2067
  message: language.projectName.message,
2126
2068
  placeholder: defaultProjectName,
2127
2069
  defaultValue: defaultProjectName,
2128
2070
  validate: (value) => !value || value.trim().length > 0 ? void 0 : language.projectName.invalidMessage
2129
2071
  })))?.trim() || defaultProjectName;
2130
2072
  if (!canSkipEmptying(targetDir) && !forceOverwrite) {
2131
- result.shouldOverwrite = await unwrapPrompt(ot({
2073
+ result.shouldOverwrite = await unwrapPrompt(confirm({
2132
2074
  message: `${targetDir === "." ? language.shouldOverwrite.dirForPrompts.current : `${language.shouldOverwrite.dirForPrompts.target} "${targetDir}"`} ${language.shouldOverwrite.message}`,
2133
2075
  initialValue: false
2134
2076
  }));
2135
2077
  if (!result.shouldOverwrite) {
2136
- pt((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
2078
+ cancel((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
2137
2079
  process.exit(0);
2138
2080
  }
2139
2081
  }
2140
- if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(Ot({
2082
+ if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(text({
2141
2083
  message: language.packageName.message,
2142
2084
  initialValue: toValidPackageName(targetDir),
2143
2085
  validate: (value) => isValidPackageName(value) ? void 0 : language.packageName.invalidMessage
@@ -2184,7 +2126,7 @@ async function init() {
2184
2126
  ${(0, import_picocolors.dim)("|")} ${language.infos.optionalGitCommand}
2185
2127
 
2186
2128
  ${(0, import_picocolors.bold)((0, import_picocolors.green)("git init && git add -A && git commit -m \"initial commit\""))}`;
2187
- gt(outroMessage);
2129
+ outro(outroMessage);
2188
2130
  }
2189
2131
  init().catch((e) => {
2190
2132
  console.error(e);