create-rue 0.8.0 → 0.9.7
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 +322 -264
- package/package.json +3 -3
- package/template/base/app/pages/Home.tsx +1 -1
- package/template/base/app/pages/TodoApp.tsx +431 -163
- package/template/base/app/pages/components/Layout.tsx +135 -29
- package/template/base/package.json +18 -19
- package/template/base/tsconfig.json +3 -4
- package/template/base/vite.config.ts +7 -14
- package/template/base/app/env.d.ts +0 -1
package/bundle.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! create-rue v0.
|
|
2
|
+
/*! create-rue v0.9.7 | MIT */
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
|
+
import "node:fs";
|
|
5
6
|
import * as path from "node:path";
|
|
7
|
+
import "node:path";
|
|
6
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
|
-
import { parseArgs, styleText } from "node:util";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
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";
|
|
10
14
|
//#region \0rolldown/runtime.js
|
|
11
15
|
var __create = Object.create;
|
|
12
16
|
var __defProp = Object.defineProperty;
|
|
@@ -31,27 +35,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
35
|
}) : target, mod));
|
|
32
36
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
33
37
|
//#endregion
|
|
34
|
-
//#region node_modules/.pnpm/fast-string-truncated-width@
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
})();
|
|
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
|
+
};
|
|
44
42
|
const isFullWidth = (x) => {
|
|
45
43
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
46
44
|
};
|
|
47
|
-
const
|
|
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;
|
|
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;
|
|
49
47
|
};
|
|
50
48
|
//#endregion
|
|
51
|
-
//#region node_modules/.pnpm/fast-string-truncated-width@
|
|
52
|
-
const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]
|
|
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;
|
|
53
51
|
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;
|
|
55
52
|
const TAB_RE = /\t{1,1000}/y;
|
|
56
53
|
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;
|
|
57
54
|
const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -64,21 +61,14 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
|
|
|
64
61
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
65
62
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
66
63
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
|
|
67
|
-
const ANSI_WIDTH = 0;
|
|
64
|
+
const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
|
|
68
65
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
69
66
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
67
|
+
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
70
68
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
71
|
-
const FULL_WIDTH_WIDTH = 2;
|
|
69
|
+
const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
|
|
72
70
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
73
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
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
|
-
];
|
|
71
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
|
|
82
72
|
let indexPrev = 0;
|
|
83
73
|
let index = 0;
|
|
84
74
|
let length = input.length;
|
|
@@ -97,7 +87,8 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
|
|
|
97
87
|
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
98
88
|
const codePoint = char.codePointAt(0) || 0;
|
|
99
89
|
if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
|
|
100
|
-
else if (
|
|
90
|
+
else if (isWide(codePoint)) widthExtra = WIDE_WIDTH;
|
|
91
|
+
else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) widthExtra = AMBIGUOUS_WIDTH;
|
|
101
92
|
else widthExtra = REGULAR_WIDTH;
|
|
102
93
|
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
103
94
|
if (width + widthExtra > LIMIT) {
|
|
@@ -109,24 +100,77 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
|
|
|
109
100
|
}
|
|
110
101
|
unmatchedStart = unmatchedEnd = 0;
|
|
111
102
|
}
|
|
112
|
-
if (index >= length) break
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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;
|
|
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;
|
|
129
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;
|
|
168
|
+
}
|
|
169
|
+
width += EMOJI_WIDTH;
|
|
170
|
+
unmatchedStart = indexPrev;
|
|
171
|
+
unmatchedEnd = index;
|
|
172
|
+
index = indexPrev = EMOJI_RE.lastIndex;
|
|
173
|
+
continue;
|
|
130
174
|
}
|
|
131
175
|
index += 1;
|
|
132
176
|
}
|
|
@@ -138,7 +182,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
|
|
|
138
182
|
};
|
|
139
183
|
};
|
|
140
184
|
//#endregion
|
|
141
|
-
//#region node_modules/.pnpm/fast-string-width@
|
|
185
|
+
//#region node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
|
|
142
186
|
const NO_TRUNCATION = {
|
|
143
187
|
limit: Infinity,
|
|
144
188
|
ellipsis: "",
|
|
@@ -148,7 +192,7 @@ const fastStringWidth = (input, options = {}) => {
|
|
|
148
192
|
return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
|
|
149
193
|
};
|
|
150
194
|
//#endregion
|
|
151
|
-
//#region node_modules/.pnpm/fast-wrap-ansi@0.
|
|
195
|
+
//#region node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
|
|
152
196
|
const ESC = "\x1B";
|
|
153
197
|
const CSI = "";
|
|
154
198
|
const END_CODE = 39;
|
|
@@ -285,10 +329,8 @@ const exec = (string, columns, options = {}) => {
|
|
|
285
329
|
for (let i = 0; i < preString.length; i++) {
|
|
286
330
|
const character = preString[i];
|
|
287
331
|
returnValue += character;
|
|
288
|
-
if (!inSurrogate)
|
|
289
|
-
|
|
290
|
-
if (inSurrogate) continue;
|
|
291
|
-
} else inSurrogate = false;
|
|
332
|
+
if (!inSurrogate) inSurrogate = character >= "\ud800" && character <= "\udbff";
|
|
333
|
+
else continue;
|
|
292
334
|
if (character === ESC || character === CSI) {
|
|
293
335
|
GROUP_REGEX.lastIndex = i + 1;
|
|
294
336
|
const groups = GROUP_REGEX.exec(preString)?.groups;
|
|
@@ -313,7 +355,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
313
355
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
314
356
|
}
|
|
315
357
|
//#endregion
|
|
316
|
-
//#region node_modules/.pnpm/@clack+core@1.
|
|
358
|
+
//#region node_modules/.pnpm/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
|
|
317
359
|
var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
318
360
|
const ESC = "\x1B";
|
|
319
361
|
const CSI = `${ESC}[`;
|
|
@@ -366,7 +408,12 @@ var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
366
408
|
beep
|
|
367
409
|
};
|
|
368
410
|
})))();
|
|
369
|
-
|
|
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 = {
|
|
370
417
|
actions: new Set([
|
|
371
418
|
"up",
|
|
372
419
|
"down",
|
|
@@ -376,7 +423,7 @@ const settings = {
|
|
|
376
423
|
"enter",
|
|
377
424
|
"cancel"
|
|
378
425
|
]),
|
|
379
|
-
aliases:
|
|
426
|
+
aliases: new Map([
|
|
380
427
|
["k", "up"],
|
|
381
428
|
["j", "down"],
|
|
382
429
|
["h", "left"],
|
|
@@ -388,7 +435,7 @@ const settings = {
|
|
|
388
435
|
cancel: "Canceled",
|
|
389
436
|
error: "Something went wrong"
|
|
390
437
|
},
|
|
391
|
-
withGuide:
|
|
438
|
+
withGuide: !0,
|
|
392
439
|
date: {
|
|
393
440
|
monthNames: [...[
|
|
394
441
|
"January",
|
|
@@ -407,67 +454,56 @@ const settings = {
|
|
|
407
454
|
messages: {
|
|
408
455
|
required: "Please enter a valid date",
|
|
409
456
|
invalidMonth: "There are only 12 months in a year",
|
|
410
|
-
invalidDay: (
|
|
411
|
-
afterMin: (
|
|
412
|
-
beforeMax: (
|
|
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)}`
|
|
413
460
|
}
|
|
414
461
|
}
|
|
415
462
|
};
|
|
416
|
-
function
|
|
417
|
-
if (typeof
|
|
418
|
-
for (const
|
|
419
|
-
return
|
|
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;
|
|
420
467
|
}
|
|
421
|
-
function
|
|
422
|
-
if (
|
|
423
|
-
const e =
|
|
424
|
-
`),
|
|
425
|
-
`),
|
|
426
|
-
for (let
|
|
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);
|
|
427
474
|
return {
|
|
428
|
-
lines:
|
|
475
|
+
lines: n,
|
|
429
476
|
numLinesBefore: e.length,
|
|
430
|
-
numLinesAfter:
|
|
431
|
-
numLines:
|
|
477
|
+
numLinesAfter: s.length,
|
|
478
|
+
numLines: i
|
|
432
479
|
};
|
|
433
480
|
}
|
|
434
481
|
globalThis.process.platform.startsWith("win");
|
|
435
|
-
const
|
|
436
|
-
function
|
|
437
|
-
return
|
|
482
|
+
const C = Symbol("clack:cancel");
|
|
483
|
+
function q(r) {
|
|
484
|
+
return r === C;
|
|
438
485
|
}
|
|
439
|
-
function
|
|
440
|
-
const
|
|
441
|
-
|
|
486
|
+
function w$1(r, t) {
|
|
487
|
+
const e = r;
|
|
488
|
+
e.isTTY && e.setRawMode(t);
|
|
442
489
|
}
|
|
443
|
-
const
|
|
444
|
-
function
|
|
445
|
-
return wrapAnsi(
|
|
446
|
-
hard:
|
|
447
|
-
trim:
|
|
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
|
|
448
495
|
}).split(`
|
|
449
|
-
`).map((
|
|
450
|
-
const d = n ? n(c, i) : c;
|
|
451
|
-
return i === 0 ? `${t}${d}` : i === m.length - 1 ? `${s}${d}` : `${o}${d}`;
|
|
452
|
-
}).join(`
|
|
496
|
+
`).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
|
|
453
497
|
`);
|
|
454
498
|
}
|
|
455
|
-
|
|
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 {
|
|
499
|
+
let p = class {
|
|
464
500
|
input;
|
|
465
501
|
output;
|
|
466
502
|
_abortSignal;
|
|
467
503
|
rl;
|
|
468
504
|
opts;
|
|
469
505
|
_render;
|
|
470
|
-
_track =
|
|
506
|
+
_track = !1;
|
|
471
507
|
_prevFrame = "";
|
|
472
508
|
_subscribers = /* @__PURE__ */ new Map();
|
|
473
509
|
_cursor = 0;
|
|
@@ -475,80 +511,55 @@ var V = class {
|
|
|
475
511
|
error = "";
|
|
476
512
|
value;
|
|
477
513
|
userInput = "";
|
|
478
|
-
constructor(t, e =
|
|
479
|
-
const { input:
|
|
480
|
-
this.opts =
|
|
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;
|
|
481
517
|
}
|
|
482
|
-
/**
|
|
483
|
-
* Unsubscribe all listeners
|
|
484
|
-
*/
|
|
485
518
|
unsubscribe() {
|
|
486
519
|
this._subscribers.clear();
|
|
487
520
|
}
|
|
488
|
-
/**
|
|
489
|
-
* Set a subscriber with opts
|
|
490
|
-
* @param event - The event name
|
|
491
|
-
*/
|
|
492
521
|
setSubscriber(t, e) {
|
|
493
|
-
const
|
|
494
|
-
|
|
522
|
+
const s = this._subscribers.get(t) ?? [];
|
|
523
|
+
s.push(e), this._subscribers.set(t, s);
|
|
495
524
|
}
|
|
496
|
-
/**
|
|
497
|
-
* Subscribe to an event
|
|
498
|
-
* @param event - The event name
|
|
499
|
-
* @param cb - The callback
|
|
500
|
-
*/
|
|
501
525
|
on(t, e) {
|
|
502
526
|
this.setSubscriber(t, { cb: e });
|
|
503
527
|
}
|
|
504
|
-
/**
|
|
505
|
-
* Subscribe to an event once
|
|
506
|
-
* @param event - The event name
|
|
507
|
-
* @param cb - The callback
|
|
508
|
-
*/
|
|
509
528
|
once(t, e) {
|
|
510
529
|
this.setSubscriber(t, {
|
|
511
530
|
cb: e,
|
|
512
|
-
once:
|
|
531
|
+
once: !0
|
|
513
532
|
});
|
|
514
533
|
}
|
|
515
|
-
/**
|
|
516
|
-
* Emit an event with data
|
|
517
|
-
* @param event - The event name
|
|
518
|
-
* @param data - The data to pass to the callback
|
|
519
|
-
*/
|
|
520
534
|
emit(t, ...e) {
|
|
521
|
-
const
|
|
522
|
-
for (const
|
|
523
|
-
for (const
|
|
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();
|
|
524
538
|
}
|
|
525
539
|
prompt() {
|
|
526
540
|
return new Promise((t) => {
|
|
527
541
|
if (this._abortSignal) {
|
|
528
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(
|
|
542
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(C);
|
|
529
543
|
this._abortSignal.addEventListener("abort", () => {
|
|
530
544
|
this.state = "cancel", this.close();
|
|
531
|
-
}, { once:
|
|
545
|
+
}, { once: !0 });
|
|
532
546
|
}
|
|
533
|
-
this.rl =
|
|
547
|
+
this.rl = P$1.createInterface({
|
|
534
548
|
input: this.input,
|
|
535
549
|
tabSize: 2,
|
|
536
550
|
prompt: "",
|
|
537
551
|
escapeCodeTimeout: 50,
|
|
538
|
-
terminal:
|
|
539
|
-
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput,
|
|
540
|
-
this.output.write(import_src.cursor.show), this.output.off("resize", this.render),
|
|
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);
|
|
541
555
|
}), this.once("cancel", () => {
|
|
542
|
-
this.output.write(import_src.cursor.show), this.output.off("resize", this.render),
|
|
556
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(C);
|
|
543
557
|
});
|
|
544
558
|
});
|
|
545
559
|
}
|
|
546
560
|
_isActionKey(t, e) {
|
|
547
561
|
return t === " ";
|
|
548
562
|
}
|
|
549
|
-
_shouldSubmit(t, e) {
|
|
550
|
-
return true;
|
|
551
|
-
}
|
|
552
563
|
_setValue(t) {
|
|
553
564
|
this.value = t, this.emit("value", this.value);
|
|
554
565
|
}
|
|
@@ -557,22 +568,22 @@ var V = class {
|
|
|
557
568
|
}
|
|
558
569
|
_clearUserInput() {
|
|
559
570
|
this.rl?.write(null, {
|
|
560
|
-
ctrl:
|
|
571
|
+
ctrl: !0,
|
|
561
572
|
name: "u"
|
|
562
573
|
}), this._setUserInput("");
|
|
563
574
|
}
|
|
564
575
|
onKeypress(t, e) {
|
|
565
576
|
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
|
|
566
|
-
ctrl:
|
|
577
|
+
ctrl: !0,
|
|
567
578
|
name: "h"
|
|
568
|
-
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track &&
|
|
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") {
|
|
569
580
|
if (this.opts.validate) {
|
|
570
|
-
const
|
|
571
|
-
|
|
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));
|
|
572
583
|
}
|
|
573
584
|
this.state !== "error" && (this.state = "submit");
|
|
574
585
|
}
|
|
575
|
-
|
|
586
|
+
V$1([
|
|
576
587
|
t,
|
|
577
588
|
e?.name,
|
|
578
589
|
e?.sequence
|
|
@@ -580,48 +591,48 @@ var V = class {
|
|
|
580
591
|
}
|
|
581
592
|
close() {
|
|
582
593
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
583
|
-
`),
|
|
594
|
+
`), w$1(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
584
595
|
}
|
|
585
596
|
restoreCursor() {
|
|
586
597
|
const t = wrapAnsi(this._prevFrame, process.stdout.columns, {
|
|
587
|
-
hard:
|
|
588
|
-
trim:
|
|
598
|
+
hard: !0,
|
|
599
|
+
trim: !1
|
|
589
600
|
}).split(`
|
|
590
601
|
`).length - 1;
|
|
591
602
|
this.output.write(import_src.cursor.move(-999, t * -1));
|
|
592
603
|
}
|
|
593
604
|
render() {
|
|
594
605
|
const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
595
|
-
hard:
|
|
596
|
-
trim:
|
|
606
|
+
hard: !0,
|
|
607
|
+
trim: !1
|
|
597
608
|
});
|
|
598
609
|
if (t !== this._prevFrame) {
|
|
599
610
|
if (this.state === "initial") this.output.write(import_src.cursor.hide);
|
|
600
611
|
else {
|
|
601
|
-
const e =
|
|
612
|
+
const e = j(this._prevFrame, t), s = A(this.output);
|
|
602
613
|
if (this.restoreCursor(), e) {
|
|
603
|
-
const
|
|
604
|
-
let
|
|
605
|
-
if (
|
|
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) {
|
|
606
617
|
this._prevFrame = t;
|
|
607
618
|
return;
|
|
608
619
|
}
|
|
609
620
|
if (e.lines.length === 1) {
|
|
610
|
-
this.output.write(import_src.cursor.move(0,
|
|
611
|
-
const
|
|
621
|
+
this.output.write(import_src.cursor.move(0, o - n)), this.output.write(import_src.erase.lines(1));
|
|
622
|
+
const a = t.split(`
|
|
612
623
|
`);
|
|
613
|
-
this.output.write(o
|
|
624
|
+
this.output.write(a[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, a.length - o - 1));
|
|
614
625
|
return;
|
|
615
626
|
} else if (e.lines.length > 1) {
|
|
616
|
-
if (
|
|
627
|
+
if (i < n) o = i;
|
|
617
628
|
else {
|
|
618
|
-
const h =
|
|
629
|
+
const h = o - n;
|
|
619
630
|
h > 0 && this.output.write(import_src.cursor.move(0, h));
|
|
620
631
|
}
|
|
621
632
|
this.output.write(import_src.erase.down());
|
|
622
|
-
const
|
|
623
|
-
`).slice(
|
|
624
|
-
this.output.write(
|
|
633
|
+
const a = t.split(`
|
|
634
|
+
`).slice(o);
|
|
635
|
+
this.output.write(a.join(`
|
|
625
636
|
`)), this._prevFrame = t;
|
|
626
637
|
return;
|
|
627
638
|
}
|
|
@@ -632,7 +643,7 @@ var V = class {
|
|
|
632
643
|
}
|
|
633
644
|
}
|
|
634
645
|
};
|
|
635
|
-
var
|
|
646
|
+
var Q$1 = class extends p {
|
|
636
647
|
get cursor() {
|
|
637
648
|
return this.value ? 0 : 1;
|
|
638
649
|
}
|
|
@@ -640,22 +651,22 @@ var r = class extends V {
|
|
|
640
651
|
return this.cursor === 0;
|
|
641
652
|
}
|
|
642
653
|
constructor(t) {
|
|
643
|
-
super(t,
|
|
654
|
+
super(t, !1), this.value = !!t.initialValue, this.on("userInput", () => {
|
|
644
655
|
this.value = this._value;
|
|
645
|
-
}), this.on("confirm", (
|
|
646
|
-
this.output.write(import_src.cursor.move(0, -1)), 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();
|
|
647
658
|
}), this.on("cursor", () => {
|
|
648
659
|
this.value = !this.value;
|
|
649
660
|
});
|
|
650
661
|
}
|
|
651
662
|
};
|
|
652
|
-
var
|
|
663
|
+
var at$1 = class extends p {
|
|
653
664
|
get userInputWithCursor() {
|
|
654
665
|
if (this.state === "submit") return this.userInput;
|
|
655
666
|
const t = this.userInput;
|
|
656
667
|
if (this.cursor >= t.length) return `${this.userInput}\u2588`;
|
|
657
|
-
const e = t.slice(0, this.cursor), [s, ...
|
|
658
|
-
return `${e}${styleText("inverse", s)}${
|
|
668
|
+
const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
|
|
669
|
+
return `${e}${styleText("inverse", s)}${i.join("")}`;
|
|
659
670
|
}
|
|
660
671
|
get cursor() {
|
|
661
672
|
return this._cursor;
|
|
@@ -672,118 +683,165 @@ var n = class extends V {
|
|
|
672
683
|
}
|
|
673
684
|
};
|
|
674
685
|
//#endregion
|
|
675
|
-
//#region node_modules/.pnpm/@clack+prompts@1.
|
|
676
|
-
function
|
|
677
|
-
|
|
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";
|
|
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";
|
|
679
689
|
}
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
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) {
|
|
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) {
|
|
700
693
|
case "initial":
|
|
701
|
-
case "active": return styleText("cyan",
|
|
702
|
-
case "cancel": return styleText("red",
|
|
703
|
-
case "error": return styleText("yellow",
|
|
704
|
-
case "submit": return styleText("green",
|
|
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);
|
|
705
698
|
}
|
|
706
699
|
};
|
|
707
|
-
const
|
|
708
|
-
const
|
|
709
|
-
return new
|
|
710
|
-
active:
|
|
700
|
+
const ot = (e) => {
|
|
701
|
+
const i = e.active ?? "Yes", s = e.inactive ?? "No";
|
|
702
|
+
return new Q$1({
|
|
703
|
+
active: i,
|
|
711
704
|
inactive: s,
|
|
712
|
-
signal:
|
|
713
|
-
input:
|
|
714
|
-
output:
|
|
715
|
-
initialValue:
|
|
705
|
+
signal: e.signal,
|
|
706
|
+
input: e.input,
|
|
707
|
+
output: e.output,
|
|
708
|
+
initialValue: e.initialValue ?? !0,
|
|
716
709
|
render() {
|
|
717
|
-
const
|
|
718
|
-
` : ""}${
|
|
719
|
-
`,
|
|
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;
|
|
720
713
|
switch (this.state) {
|
|
721
|
-
case "submit": return `${
|
|
722
|
-
case "cancel": return `${
|
|
723
|
-
${styleText("gray",
|
|
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)}` : ""}`;
|
|
724
717
|
default: {
|
|
725
|
-
const
|
|
726
|
-
return `${
|
|
727
|
-
${styleText("cyan",
|
|
728
|
-
` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim",
|
|
729
|
-
${
|
|
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
|
+
${$}
|
|
730
723
|
`;
|
|
731
724
|
}
|
|
732
725
|
}
|
|
733
726
|
}
|
|
734
727
|
}).prompt();
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
|
|
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)}
|
|
740
779
|
|
|
741
780
|
`);
|
|
742
|
-
},
|
|
743
|
-
const
|
|
744
|
-
|
|
781
|
+
}, mt = (e = "", i) => {
|
|
782
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", le)} ` : "";
|
|
783
|
+
s.write(`${r}${e}
|
|
745
784
|
`);
|
|
746
|
-
},
|
|
747
|
-
const
|
|
748
|
-
${styleText("gray",
|
|
749
|
-
|
|
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}
|
|
750
789
|
|
|
751
790
|
`);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
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,
|
|
764
822
|
render() {
|
|
765
|
-
const i =
|
|
766
|
-
` : ""}${
|
|
767
|
-
`,
|
|
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 ?? "";
|
|
768
826
|
switch (this.state) {
|
|
769
827
|
case "error": {
|
|
770
|
-
const
|
|
828
|
+
const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", d)} ` : "", a = i ? styleText("yellow", E) : "";
|
|
771
829
|
return `${s.trim()}
|
|
772
|
-
${
|
|
773
|
-
${
|
|
830
|
+
${c}${u$13}
|
|
831
|
+
${a}${o}
|
|
774
832
|
`;
|
|
775
833
|
}
|
|
776
834
|
case "submit": {
|
|
777
|
-
const
|
|
778
|
-
return `${s}${i ? styleText("gray",
|
|
835
|
+
const o = n ? ` ${styleText("dim", n)}` : "";
|
|
836
|
+
return `${s}${i ? styleText("gray", d) : ""}${o}`;
|
|
779
837
|
}
|
|
780
838
|
case "cancel": {
|
|
781
|
-
const
|
|
782
|
-
return `${s}${
|
|
783
|
-
${
|
|
839
|
+
const o = n ? ` ${styleText(["strikethrough", "dim"], n)}` : "", c = i ? styleText("gray", d) : "";
|
|
840
|
+
return `${s}${c}${o}${n.trim() ? `
|
|
841
|
+
${c}` : ""}`;
|
|
784
842
|
}
|
|
785
|
-
default: return `${s}${i ? `${styleText("cyan",
|
|
786
|
-
${i ? styleText("cyan",
|
|
843
|
+
default: return `${s}${i ? `${styleText("cyan", d)} ` : ""}${u$13}
|
|
844
|
+
${i ? styleText("cyan", E) : ""}
|
|
787
845
|
`;
|
|
788
846
|
}
|
|
789
847
|
}
|
|
@@ -1741,7 +1799,7 @@ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1741
1799
|
//#region utils/banners.ts
|
|
1742
1800
|
var import_picocolors = require_picocolors();
|
|
1743
1801
|
var import_ejs = /* @__PURE__ */ __toESM(require_ejs(), 1);
|
|
1744
|
-
const defaultBanner = "Rue.js - The
|
|
1802
|
+
const defaultBanner = "Rue.js - The Compiler Framework For Native DOM";
|
|
1745
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;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";
|
|
1746
1804
|
//#endregion
|
|
1747
1805
|
//#region utils/deepMerge.ts
|
|
@@ -1979,7 +2037,7 @@ function inferPackageManager() {
|
|
|
1979
2037
|
//#endregion
|
|
1980
2038
|
//#region package.json
|
|
1981
2039
|
var name = "create-rue";
|
|
1982
|
-
var version = "0.
|
|
2040
|
+
var version = "0.9.7";
|
|
1983
2041
|
//#endregion
|
|
1984
2042
|
//#region index.ts
|
|
1985
2043
|
const language = await getLanguage(fileURLToPath(new URL("./locales", import.meta.url)));
|
|
@@ -2006,8 +2064,8 @@ function emptyDir(dir) {
|
|
|
2006
2064
|
}
|
|
2007
2065
|
async function unwrapPrompt(maybeCancelPromise) {
|
|
2008
2066
|
const result = await maybeCancelPromise;
|
|
2009
|
-
if (
|
|
2010
|
-
|
|
2067
|
+
if (q(result)) {
|
|
2068
|
+
pt((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
|
|
2011
2069
|
process.exit(0);
|
|
2012
2070
|
}
|
|
2013
2071
|
return result;
|
|
@@ -2062,24 +2120,24 @@ async function init() {
|
|
|
2062
2120
|
shouldOverwrite: forceOverwrite,
|
|
2063
2121
|
packageName: defaultProjectName
|
|
2064
2122
|
};
|
|
2065
|
-
|
|
2066
|
-
if (!targetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(
|
|
2123
|
+
mt(process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner);
|
|
2124
|
+
if (!targetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(Ot({
|
|
2067
2125
|
message: language.projectName.message,
|
|
2068
2126
|
placeholder: defaultProjectName,
|
|
2069
2127
|
defaultValue: defaultProjectName,
|
|
2070
2128
|
validate: (value) => !value || value.trim().length > 0 ? void 0 : language.projectName.invalidMessage
|
|
2071
2129
|
})))?.trim() || defaultProjectName;
|
|
2072
2130
|
if (!canSkipEmptying(targetDir) && !forceOverwrite) {
|
|
2073
|
-
result.shouldOverwrite = await unwrapPrompt(
|
|
2131
|
+
result.shouldOverwrite = await unwrapPrompt(ot({
|
|
2074
2132
|
message: `${targetDir === "." ? language.shouldOverwrite.dirForPrompts.current : `${language.shouldOverwrite.dirForPrompts.target} "${targetDir}"`} ${language.shouldOverwrite.message}`,
|
|
2075
2133
|
initialValue: false
|
|
2076
2134
|
}));
|
|
2077
2135
|
if (!result.shouldOverwrite) {
|
|
2078
|
-
|
|
2136
|
+
pt((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
|
|
2079
2137
|
process.exit(0);
|
|
2080
2138
|
}
|
|
2081
2139
|
}
|
|
2082
|
-
if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(
|
|
2140
|
+
if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(Ot({
|
|
2083
2141
|
message: language.packageName.message,
|
|
2084
2142
|
initialValue: toValidPackageName(targetDir),
|
|
2085
2143
|
validate: (value) => isValidPackageName(value) ? void 0 : language.packageName.invalidMessage
|
|
@@ -2126,7 +2184,7 @@ async function init() {
|
|
|
2126
2184
|
${(0, import_picocolors.dim)("|")} ${language.infos.optionalGitCommand}
|
|
2127
2185
|
|
|
2128
2186
|
${(0, import_picocolors.bold)((0, import_picocolors.green)("git init && git add -A && git commit -m \"initial commit\""))}`;
|
|
2129
|
-
|
|
2187
|
+
gt(outroMessage);
|
|
2130
2188
|
}
|
|
2131
2189
|
init().catch((e) => {
|
|
2132
2190
|
console.error(e);
|