create-vue 3.22.2 → 3.22.3
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/LICENSE +89 -0
- package/bundle.js +699 -653
- package/package.json +5 -5
- package/template/base/package.json +3 -3
- package/template/config/cypress/package.json +1 -1
- package/template/config/cypress-ct/package.json +2 -2
- package/template/config/jsx/package.json +2 -2
- package/template/config/pinia/package.json +1 -1
- package/template/config/playwright/package.json +1 -1
- package/template/config/router/package.json +1 -1
- package/template/config/typescript/package.json +1 -1
- package/template/config/vitest/package.json +3 -3
- package/template/formatting/oxfmt/package.json +1 -1
- package/template/formatting/prettier/package.json +1 -1
- package/template/linting/base/package.json +1 -1
- package/template/linting/core/js/package.json +2 -2
- package/template/linting/core/ts/package.json +1 -1
- package/template/linting/cypress/package.json +1 -1
- package/template/linting/oxlint/package.json +2 -2
- package/template/linting/vitest/package.json +1 -1
- package/template/tsconfig/cypress/cypress/tsconfig.json +1 -5
package/bundle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! create-vue v3.22.
|
|
2
|
+
/*! create-vue v3.22.3 | MIT */
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import "node:fs";
|
|
@@ -7,9 +7,9 @@ import * as path$1 from "node:path";
|
|
|
7
7
|
import "node:path";
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
9
|
import { parseArgs, stripVTControlCharacters, styleText } from "node:util";
|
|
10
|
-
import
|
|
10
|
+
import P, { stdin, stdout } from "node:process";
|
|
11
11
|
import "node:readline";
|
|
12
|
-
import
|
|
12
|
+
import P$1 from "node:readline";
|
|
13
13
|
import "node:tty";
|
|
14
14
|
import * as path from "path";
|
|
15
15
|
//#region \0rolldown/runtime.js
|
|
@@ -19,7 +19,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
19
19
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
20
20
|
var __getProtoOf = Object.getPrototypeOf;
|
|
21
21
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
22
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
22
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
23
23
|
var __copyProps = (to, from, except, desc) => {
|
|
24
24
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
25
25
|
key = keys[i];
|
|
@@ -36,7 +36,327 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
}) : target, mod));
|
|
37
37
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
38
38
|
//#endregion
|
|
39
|
-
//#region node_modules/.pnpm
|
|
39
|
+
//#region node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
|
|
40
|
+
const isAmbiguous = (x) => {
|
|
41
|
+
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;
|
|
42
|
+
};
|
|
43
|
+
const isFullWidth = (x) => {
|
|
44
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
45
|
+
};
|
|
46
|
+
const isWide = (x) => {
|
|
47
|
+
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;
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
|
|
51
|
+
const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
52
|
+
const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
53
|
+
const TAB_RE = /\t{1,1000}/y;
|
|
54
|
+
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;
|
|
55
|
+
const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
56
|
+
const MODIFIER_RE = /\p{M}+/gu;
|
|
57
|
+
const NO_TRUNCATION$1 = {
|
|
58
|
+
limit: Infinity,
|
|
59
|
+
ellipsis: ""
|
|
60
|
+
};
|
|
61
|
+
const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
62
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
63
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
64
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
|
|
65
|
+
const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
|
|
66
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
67
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
68
|
+
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
69
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
70
|
+
const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
|
|
71
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
72
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
|
|
73
|
+
let indexPrev = 0;
|
|
74
|
+
let index = 0;
|
|
75
|
+
let length = input.length;
|
|
76
|
+
let lengthExtra = 0;
|
|
77
|
+
let truncationEnabled = false;
|
|
78
|
+
let truncationIndex = length;
|
|
79
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
80
|
+
let unmatchedStart = 0;
|
|
81
|
+
let unmatchedEnd = 0;
|
|
82
|
+
let width = 0;
|
|
83
|
+
let widthExtra = 0;
|
|
84
|
+
outer: while (true) {
|
|
85
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
86
|
+
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
87
|
+
lengthExtra = 0;
|
|
88
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
89
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
90
|
+
if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
|
|
91
|
+
else if (isWide(codePoint)) widthExtra = WIDE_WIDTH;
|
|
92
|
+
else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) widthExtra = AMBIGUOUS_WIDTH;
|
|
93
|
+
else widthExtra = REGULAR_WIDTH;
|
|
94
|
+
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
95
|
+
if (width + widthExtra > LIMIT) {
|
|
96
|
+
truncationEnabled = true;
|
|
97
|
+
break outer;
|
|
98
|
+
}
|
|
99
|
+
lengthExtra += char.length;
|
|
100
|
+
width += widthExtra;
|
|
101
|
+
}
|
|
102
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
103
|
+
}
|
|
104
|
+
if (index >= length) break;
|
|
105
|
+
LATIN_RE.lastIndex = index;
|
|
106
|
+
if (LATIN_RE.test(input)) {
|
|
107
|
+
lengthExtra = LATIN_RE.lastIndex - index;
|
|
108
|
+
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
109
|
+
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
110
|
+
if (width + widthExtra > LIMIT) {
|
|
111
|
+
truncationEnabled = true;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
width += widthExtra;
|
|
115
|
+
unmatchedStart = indexPrev;
|
|
116
|
+
unmatchedEnd = index;
|
|
117
|
+
index = indexPrev = LATIN_RE.lastIndex;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
ANSI_RE.lastIndex = index;
|
|
121
|
+
if (ANSI_RE.test(input)) {
|
|
122
|
+
if (width + ANSI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
|
|
123
|
+
if (width + ANSI_WIDTH > LIMIT) {
|
|
124
|
+
truncationEnabled = true;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
width += ANSI_WIDTH;
|
|
128
|
+
unmatchedStart = indexPrev;
|
|
129
|
+
unmatchedEnd = index;
|
|
130
|
+
index = indexPrev = ANSI_RE.lastIndex;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
CONTROL_RE.lastIndex = index;
|
|
134
|
+
if (CONTROL_RE.test(input)) {
|
|
135
|
+
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
136
|
+
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
137
|
+
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
138
|
+
if (width + widthExtra > LIMIT) {
|
|
139
|
+
truncationEnabled = true;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
width += widthExtra;
|
|
143
|
+
unmatchedStart = indexPrev;
|
|
144
|
+
unmatchedEnd = index;
|
|
145
|
+
index = indexPrev = CONTROL_RE.lastIndex;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
TAB_RE.lastIndex = index;
|
|
149
|
+
if (TAB_RE.test(input)) {
|
|
150
|
+
lengthExtra = TAB_RE.lastIndex - index;
|
|
151
|
+
widthExtra = lengthExtra * TAB_WIDTH;
|
|
152
|
+
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
153
|
+
if (width + widthExtra > LIMIT) {
|
|
154
|
+
truncationEnabled = true;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
width += widthExtra;
|
|
158
|
+
unmatchedStart = indexPrev;
|
|
159
|
+
unmatchedEnd = index;
|
|
160
|
+
index = indexPrev = TAB_RE.lastIndex;
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
EMOJI_RE.lastIndex = index;
|
|
164
|
+
if (EMOJI_RE.test(input)) {
|
|
165
|
+
if (width + EMOJI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
|
|
166
|
+
if (width + EMOJI_WIDTH > LIMIT) {
|
|
167
|
+
truncationEnabled = true;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
width += EMOJI_WIDTH;
|
|
171
|
+
unmatchedStart = indexPrev;
|
|
172
|
+
unmatchedEnd = index;
|
|
173
|
+
index = indexPrev = EMOJI_RE.lastIndex;
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
index += 1;
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
180
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
181
|
+
truncated: truncationEnabled,
|
|
182
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
|
|
187
|
+
const NO_TRUNCATION = {
|
|
188
|
+
limit: Infinity,
|
|
189
|
+
ellipsis: "",
|
|
190
|
+
ellipsisWidth: 0
|
|
191
|
+
};
|
|
192
|
+
const fastStringWidth = (input, options = {}) => {
|
|
193
|
+
return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
|
|
194
|
+
};
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
|
|
197
|
+
const ESC = "\x1B";
|
|
198
|
+
const CSI = "";
|
|
199
|
+
const END_CODE = 39;
|
|
200
|
+
const ANSI_ESCAPE_BELL = "\x07";
|
|
201
|
+
const ANSI_CSI = "[";
|
|
202
|
+
const ANSI_OSC = "]";
|
|
203
|
+
const ANSI_SGR_TERMINATOR = "m";
|
|
204
|
+
const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
205
|
+
const GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
206
|
+
const getClosingCode = (openingCode) => {
|
|
207
|
+
if (openingCode >= 30 && openingCode <= 37) return 39;
|
|
208
|
+
if (openingCode >= 90 && openingCode <= 97) return 39;
|
|
209
|
+
if (openingCode >= 40 && openingCode <= 47) return 49;
|
|
210
|
+
if (openingCode >= 100 && openingCode <= 107) return 49;
|
|
211
|
+
if (openingCode === 1 || openingCode === 2) return 22;
|
|
212
|
+
if (openingCode === 3) return 23;
|
|
213
|
+
if (openingCode === 4) return 24;
|
|
214
|
+
if (openingCode === 7) return 27;
|
|
215
|
+
if (openingCode === 8) return 28;
|
|
216
|
+
if (openingCode === 9) return 29;
|
|
217
|
+
if (openingCode === 0) return 0;
|
|
218
|
+
};
|
|
219
|
+
const wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
220
|
+
const wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
221
|
+
const wrapWord = (rows, word, columns) => {
|
|
222
|
+
const characters = word[Symbol.iterator]();
|
|
223
|
+
let isInsideEscape = false;
|
|
224
|
+
let isInsideLinkEscape = false;
|
|
225
|
+
let lastRow = rows.at(-1);
|
|
226
|
+
let visible = lastRow === void 0 ? 0 : fastStringWidth(lastRow);
|
|
227
|
+
let currentCharacter = characters.next();
|
|
228
|
+
let nextCharacter = characters.next();
|
|
229
|
+
let rawCharacterIndex = 0;
|
|
230
|
+
while (!currentCharacter.done) {
|
|
231
|
+
const character = currentCharacter.value;
|
|
232
|
+
const characterLength = fastStringWidth(character);
|
|
233
|
+
if (visible + characterLength <= columns) rows[rows.length - 1] += character;
|
|
234
|
+
else {
|
|
235
|
+
rows.push(character);
|
|
236
|
+
visible = 0;
|
|
237
|
+
}
|
|
238
|
+
if (character === ESC || character === CSI) {
|
|
239
|
+
isInsideEscape = true;
|
|
240
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
241
|
+
}
|
|
242
|
+
if (isInsideEscape) {
|
|
243
|
+
if (isInsideLinkEscape) {
|
|
244
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
245
|
+
isInsideEscape = false;
|
|
246
|
+
isInsideLinkEscape = false;
|
|
247
|
+
}
|
|
248
|
+
} else if (character === ANSI_SGR_TERMINATOR) isInsideEscape = false;
|
|
249
|
+
} else {
|
|
250
|
+
visible += characterLength;
|
|
251
|
+
if (visible === columns && !nextCharacter.done) {
|
|
252
|
+
rows.push("");
|
|
253
|
+
visible = 0;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
currentCharacter = nextCharacter;
|
|
257
|
+
nextCharacter = characters.next();
|
|
258
|
+
rawCharacterIndex += character.length;
|
|
259
|
+
}
|
|
260
|
+
lastRow = rows.at(-1);
|
|
261
|
+
if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) rows[rows.length - 2] += rows.pop();
|
|
262
|
+
};
|
|
263
|
+
const stringVisibleTrimSpacesRight = (string) => {
|
|
264
|
+
const words = string.split(" ");
|
|
265
|
+
let last = words.length;
|
|
266
|
+
while (last) {
|
|
267
|
+
if (fastStringWidth(words[last - 1])) break;
|
|
268
|
+
last--;
|
|
269
|
+
}
|
|
270
|
+
if (last === words.length) return string;
|
|
271
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
272
|
+
};
|
|
273
|
+
const exec = (string, columns, options = {}) => {
|
|
274
|
+
if (options.trim !== false && string.trim() === "") return "";
|
|
275
|
+
let returnValue = "";
|
|
276
|
+
let escapeCode;
|
|
277
|
+
let escapeUrl;
|
|
278
|
+
const words = string.split(" ");
|
|
279
|
+
let rows = [""];
|
|
280
|
+
let rowLength = 0;
|
|
281
|
+
for (let index = 0; index < words.length; index++) {
|
|
282
|
+
const word = words[index];
|
|
283
|
+
if (options.trim !== false) {
|
|
284
|
+
const row = rows.at(-1) ?? "";
|
|
285
|
+
const trimmed = row.trimStart();
|
|
286
|
+
if (row.length !== trimmed.length) {
|
|
287
|
+
rows[rows.length - 1] = trimmed;
|
|
288
|
+
rowLength = fastStringWidth(trimmed);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (index !== 0) {
|
|
292
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
293
|
+
rows.push("");
|
|
294
|
+
rowLength = 0;
|
|
295
|
+
}
|
|
296
|
+
if (rowLength || options.trim === false) {
|
|
297
|
+
rows[rows.length - 1] += " ";
|
|
298
|
+
rowLength++;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
const wordLength = fastStringWidth(word);
|
|
302
|
+
if (options.hard && wordLength > columns) {
|
|
303
|
+
const remainingColumns = columns - rowLength;
|
|
304
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
305
|
+
if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
|
|
306
|
+
wrapWord(rows, word, columns);
|
|
307
|
+
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
311
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
312
|
+
wrapWord(rows, word, columns);
|
|
313
|
+
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
rows.push("");
|
|
317
|
+
rowLength = 0;
|
|
318
|
+
}
|
|
319
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
320
|
+
wrapWord(rows, word, columns);
|
|
321
|
+
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
rows[rows.length - 1] += word;
|
|
325
|
+
rowLength += wordLength;
|
|
326
|
+
}
|
|
327
|
+
if (options.trim !== false) rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
328
|
+
const preString = rows.join("\n");
|
|
329
|
+
let inSurrogate = false;
|
|
330
|
+
for (let i = 0; i < preString.length; i++) {
|
|
331
|
+
const character = preString[i];
|
|
332
|
+
returnValue += character;
|
|
333
|
+
if (!inSurrogate) inSurrogate = character >= "\ud800" && character <= "\udbff";
|
|
334
|
+
else continue;
|
|
335
|
+
if (character === ESC || character === CSI) {
|
|
336
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
337
|
+
const groups = GROUP_REGEX.exec(preString)?.groups;
|
|
338
|
+
if (groups?.code !== void 0) {
|
|
339
|
+
const code = Number.parseFloat(groups.code);
|
|
340
|
+
escapeCode = code === END_CODE ? void 0 : code;
|
|
341
|
+
} else if (groups?.uri !== void 0) escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
342
|
+
}
|
|
343
|
+
if (preString[i + 1] === "\n") {
|
|
344
|
+
if (escapeUrl) returnValue += wrapAnsiHyperlink("");
|
|
345
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
346
|
+
if (escapeCode && closingCode) returnValue += wrapAnsiCode(closingCode);
|
|
347
|
+
} else if (character === "\n") {
|
|
348
|
+
if (escapeCode && getClosingCode(escapeCode)) returnValue += wrapAnsiCode(escapeCode);
|
|
349
|
+
if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return returnValue;
|
|
353
|
+
};
|
|
354
|
+
const CRLF_OR_LF = /\r?\n/;
|
|
355
|
+
function wrapAnsi(string, columns, options) {
|
|
356
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
357
|
+
}
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region node_modules/.pnpm/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
|
|
40
360
|
var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
41
361
|
const ESC = "\x1B";
|
|
42
362
|
const CSI = `${ESC}[`;
|
|
@@ -89,162 +409,12 @@ var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
89
409
|
beep
|
|
90
410
|
};
|
|
91
411
|
})))();
|
|
92
|
-
function
|
|
93
|
-
if (!
|
|
94
|
-
const
|
|
95
|
-
return
|
|
412
|
+
function d$1(r, t, e) {
|
|
413
|
+
if (!e.some((o) => !o.disabled)) return r;
|
|
414
|
+
const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
|
|
415
|
+
return e[n].disabled ? d$1(n, t < 0 ? -1 : 1, e) : n;
|
|
96
416
|
}
|
|
97
|
-
const
|
|
98
|
-
limit: Infinity,
|
|
99
|
-
ellipsis: ""
|
|
100
|
-
}, X$1 = (t, e = {}, s = {}) => {
|
|
101
|
-
const i = e.limit ?? Infinity, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X$1(r, ft$1, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V = s.wideWidth ?? 2;
|
|
102
|
-
let h = 0, o = 0, p = t.length, v = 0, F = !1, d = p, b = Math.max(0, i - n), C = 0, w = 0, c = 0, f = 0;
|
|
103
|
-
t: for (;;) {
|
|
104
|
-
if (w > C || o >= p && o > h) {
|
|
105
|
-
const ut = t.slice(C, w) || t.slice(h, o);
|
|
106
|
-
v = 0;
|
|
107
|
-
for (const Y of ut.replaceAll(ct, "")) {
|
|
108
|
-
const $ = Y.codePointAt(0) || 0;
|
|
109
|
-
if (lt($) ? f = m : ht($) ? f = V : E !== A && at($) ? f = E : f = A, c + f > b && (d = Math.min(d, Math.max(C, h) + v)), c + f > i) {
|
|
110
|
-
F = !0;
|
|
111
|
-
break t;
|
|
112
|
-
}
|
|
113
|
-
v += Y.length, c += f;
|
|
114
|
-
}
|
|
115
|
-
C = w = 0;
|
|
116
|
-
}
|
|
117
|
-
if (o >= p) break;
|
|
118
|
-
if (M.lastIndex = o, M.test(t)) {
|
|
119
|
-
if (v = M.lastIndex - o, f = v * A, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / A))), c + f > i) {
|
|
120
|
-
F = !0;
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
c += f, C = h, w = o, o = h = M.lastIndex;
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
if (O.lastIndex = o, O.test(t)) {
|
|
127
|
-
if (c + u > b && (d = Math.min(d, o)), c + u > i) {
|
|
128
|
-
F = !0;
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
c += u, C = h, w = o, o = h = O.lastIndex;
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
if (y.lastIndex = o, y.test(t)) {
|
|
135
|
-
if (v = y.lastIndex - o, f = v * a, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / a))), c + f > i) {
|
|
136
|
-
F = !0;
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
c += f, C = h, w = o, o = h = y.lastIndex;
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
if (L.lastIndex = o, L.test(t)) {
|
|
143
|
-
if (v = L.lastIndex - o, f = v * l, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / l))), c + f > i) {
|
|
144
|
-
F = !0;
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
c += f, C = h, w = o, o = h = L.lastIndex;
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
if (P.lastIndex = o, P.test(t)) {
|
|
151
|
-
if (c + g > b && (d = Math.min(d, o)), c + g > i) {
|
|
152
|
-
F = !0;
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
c += g, C = h, w = o, o = h = P.lastIndex;
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
o += 1;
|
|
159
|
-
}
|
|
160
|
-
return {
|
|
161
|
-
width: F ? b : c,
|
|
162
|
-
index: F ? d : p,
|
|
163
|
-
truncated: F,
|
|
164
|
-
ellipsed: F && i >= n
|
|
165
|
-
};
|
|
166
|
-
}, pt$1 = {
|
|
167
|
-
limit: Infinity,
|
|
168
|
-
ellipsis: "",
|
|
169
|
-
ellipsisWidth: 0
|
|
170
|
-
}, S = (t, e = {}) => X$1(t, pt$1, e).width, T = "\x1B", Z = "", Ft$1 = 39, j = "\x07", Q$1 = "[", dt = "]", tt = "m", U$1 = `${dt}8;;`, et = new RegExp(`(?:\\${Q$1}(?<code>\\d+)m|\\${U$1}(?<uri>.*)${j})`, "y"), mt$1 = (t) => {
|
|
171
|
-
if (t >= 30 && t <= 37 || t >= 90 && t <= 97) return 39;
|
|
172
|
-
if (t >= 40 && t <= 47 || t >= 100 && t <= 107) return 49;
|
|
173
|
-
if (t === 1 || t === 2) return 22;
|
|
174
|
-
if (t === 3) return 23;
|
|
175
|
-
if (t === 4) return 24;
|
|
176
|
-
if (t === 7) return 27;
|
|
177
|
-
if (t === 8) return 28;
|
|
178
|
-
if (t === 9) return 29;
|
|
179
|
-
if (t === 0) return 0;
|
|
180
|
-
}, st = (t) => `${T}${Q$1}${t}${tt}`, it = (t) => `${T}${U$1}${t}${j}`, gt$1 = (t) => t.map((e) => S(e)), G = (t, e, s) => {
|
|
181
|
-
const i = e[Symbol.iterator]();
|
|
182
|
-
let r = !1, n = !1, u = t.at(-1), a = u === void 0 ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
|
|
183
|
-
for (; !l.done;) {
|
|
184
|
-
const m = l.value, A = S(m);
|
|
185
|
-
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === T || m === Z) && (r = !0, n = e.startsWith(U$1, g + 1)), r ? n ? m === j && (r = !1, n = !1) : m === tt && (r = !1) : (a += A, a === s && !E.done && (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
|
|
186
|
-
}
|
|
187
|
-
u = t.at(-1), !a && u !== void 0 && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
188
|
-
}, vt$1 = (t) => {
|
|
189
|
-
const e = t.split(" ");
|
|
190
|
-
let s = e.length;
|
|
191
|
-
for (; s > 0 && !(S(e[s - 1]) > 0);) s--;
|
|
192
|
-
return s === e.length ? t : e.slice(0, s).join(" ") + e.slice(s).join("");
|
|
193
|
-
}, Et$1 = (t, e, s = {}) => {
|
|
194
|
-
if (s.trim !== !1 && t.trim() === "") return "";
|
|
195
|
-
let i = "", r, n;
|
|
196
|
-
const u = t.split(" "), a = gt$1(u);
|
|
197
|
-
let l = [""];
|
|
198
|
-
for (const [h, o] of u.entries()) {
|
|
199
|
-
s.trim !== !1 && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
|
|
200
|
-
let p = S(l.at(-1) ?? "");
|
|
201
|
-
if (h !== 0 && (p >= e && (s.wordWrap === !1 || s.trim === !1) && (l.push(""), p = 0), (p > 0 || s.trim === !1) && (l[l.length - 1] += " ", p++)), s.hard && a[h] > e) {
|
|
202
|
-
const v = e - p, F = 1 + Math.floor((a[h] - v - 1) / e);
|
|
203
|
-
Math.floor((a[h] - 1) / e) < F && l.push(""), G(l, o, e);
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
if (p + a[h] > e && p > 0 && a[h] > 0) {
|
|
207
|
-
if (s.wordWrap === !1 && p < e) {
|
|
208
|
-
G(l, o, e);
|
|
209
|
-
continue;
|
|
210
|
-
}
|
|
211
|
-
l.push("");
|
|
212
|
-
}
|
|
213
|
-
if (p + a[h] > e && s.wordWrap === !1) {
|
|
214
|
-
G(l, o, e);
|
|
215
|
-
continue;
|
|
216
|
-
}
|
|
217
|
-
l[l.length - 1] += o;
|
|
218
|
-
}
|
|
219
|
-
s.trim !== !1 && (l = l.map((h) => vt$1(h)));
|
|
220
|
-
const E = l.join(`
|
|
221
|
-
`), g = E[Symbol.iterator]();
|
|
222
|
-
let m = g.next(), A = g.next(), V = 0;
|
|
223
|
-
for (; !m.done;) {
|
|
224
|
-
const h = m.value, o = A.value;
|
|
225
|
-
if (i += h, h === T || h === Z) {
|
|
226
|
-
et.lastIndex = V + 1;
|
|
227
|
-
const F = et.exec(E)?.groups;
|
|
228
|
-
if (F?.code !== void 0) {
|
|
229
|
-
const d = Number.parseFloat(F.code);
|
|
230
|
-
r = d === Ft$1 ? void 0 : d;
|
|
231
|
-
} else F?.uri !== void 0 && (n = F.uri.length === 0 ? void 0 : F.uri);
|
|
232
|
-
}
|
|
233
|
-
const p = r ? mt$1(r) : void 0;
|
|
234
|
-
o === `
|
|
235
|
-
` ? (n && (i += it("")), r && p && (i += st(p))) : h === `
|
|
236
|
-
` && (r && p && (i += st(r)), n && (i += it(n))), V += h.length, m = A, A = g.next();
|
|
237
|
-
}
|
|
238
|
-
return i;
|
|
239
|
-
};
|
|
240
|
-
function K$1(t, e, s) {
|
|
241
|
-
return String(t).normalize().replaceAll(`\r
|
|
242
|
-
`, `
|
|
243
|
-
`).split(`
|
|
244
|
-
`).map((i) => Et$1(i, e, s)).join(`
|
|
245
|
-
`);
|
|
246
|
-
}
|
|
247
|
-
const _ = {
|
|
417
|
+
const u = {
|
|
248
418
|
actions: new Set([
|
|
249
419
|
"up",
|
|
250
420
|
"down",
|
|
@@ -266,45 +436,68 @@ const _ = {
|
|
|
266
436
|
cancel: "Canceled",
|
|
267
437
|
error: "Something went wrong"
|
|
268
438
|
},
|
|
269
|
-
withGuide: !0
|
|
439
|
+
withGuide: !0,
|
|
440
|
+
date: {
|
|
441
|
+
monthNames: [...[
|
|
442
|
+
"January",
|
|
443
|
+
"February",
|
|
444
|
+
"March",
|
|
445
|
+
"April",
|
|
446
|
+
"May",
|
|
447
|
+
"June",
|
|
448
|
+
"July",
|
|
449
|
+
"August",
|
|
450
|
+
"September",
|
|
451
|
+
"October",
|
|
452
|
+
"November",
|
|
453
|
+
"December"
|
|
454
|
+
]],
|
|
455
|
+
messages: {
|
|
456
|
+
required: "Please enter a valid date",
|
|
457
|
+
invalidMonth: "There are only 12 months in a year",
|
|
458
|
+
invalidDay: (r, t) => `There are only ${r} days in ${t}`,
|
|
459
|
+
afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`,
|
|
460
|
+
beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}`
|
|
461
|
+
}
|
|
462
|
+
}
|
|
270
463
|
};
|
|
271
|
-
function
|
|
272
|
-
if (typeof
|
|
273
|
-
for (const
|
|
464
|
+
function V$1(r, t) {
|
|
465
|
+
if (typeof r == "string") return u.aliases.get(r) === t;
|
|
466
|
+
for (const e of r) if (e !== void 0 && V$1(e, t)) return !0;
|
|
274
467
|
return !1;
|
|
275
468
|
}
|
|
276
|
-
function
|
|
277
|
-
if (
|
|
278
|
-
const
|
|
279
|
-
`),
|
|
280
|
-
`),
|
|
281
|
-
for (let
|
|
469
|
+
function j(r, t) {
|
|
470
|
+
if (r === t) return;
|
|
471
|
+
const e = r.split(`
|
|
472
|
+
`), s = t.split(`
|
|
473
|
+
`), i = Math.max(e.length, s.length), n = [];
|
|
474
|
+
for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
|
|
282
475
|
return {
|
|
283
476
|
lines: n,
|
|
284
|
-
numLinesBefore:
|
|
285
|
-
numLinesAfter:
|
|
286
|
-
numLines:
|
|
477
|
+
numLinesBefore: e.length,
|
|
478
|
+
numLinesAfter: s.length,
|
|
479
|
+
numLines: i
|
|
287
480
|
};
|
|
288
481
|
}
|
|
289
482
|
globalThis.process.platform.startsWith("win");
|
|
290
|
-
const
|
|
291
|
-
function
|
|
292
|
-
return
|
|
483
|
+
const C = Symbol("clack:cancel");
|
|
484
|
+
function q(r) {
|
|
485
|
+
return r === C;
|
|
293
486
|
}
|
|
294
|
-
function
|
|
295
|
-
const
|
|
296
|
-
|
|
487
|
+
function w$1(r, t) {
|
|
488
|
+
const e = r;
|
|
489
|
+
e.isTTY && e.setRawMode(t);
|
|
297
490
|
}
|
|
298
|
-
const
|
|
299
|
-
function
|
|
300
|
-
return
|
|
491
|
+
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;
|
|
492
|
+
function R(r, t, e, s = e) {
|
|
493
|
+
return wrapAnsi(t, O$1(r ?? stdout) - e.length, {
|
|
301
494
|
hard: !0,
|
|
302
495
|
trim: !1
|
|
303
496
|
}).split(`
|
|
304
|
-
`).map((n,
|
|
497
|
+
`).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
|
|
305
498
|
`);
|
|
306
499
|
}
|
|
307
|
-
|
|
500
|
+
let p = class {
|
|
308
501
|
input;
|
|
309
502
|
output;
|
|
310
503
|
_abortSignal;
|
|
@@ -319,60 +512,60 @@ var B = class {
|
|
|
319
512
|
error = "";
|
|
320
513
|
value;
|
|
321
514
|
userInput = "";
|
|
322
|
-
constructor(
|
|
323
|
-
const { input:
|
|
324
|
-
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 =
|
|
515
|
+
constructor(t, e = !0) {
|
|
516
|
+
const { input: s = stdin, output: i = stdout, render: n, signal: o, ...a } = t;
|
|
517
|
+
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;
|
|
325
518
|
}
|
|
326
519
|
unsubscribe() {
|
|
327
520
|
this._subscribers.clear();
|
|
328
521
|
}
|
|
329
|
-
setSubscriber(
|
|
330
|
-
const
|
|
331
|
-
|
|
522
|
+
setSubscriber(t, e) {
|
|
523
|
+
const s = this._subscribers.get(t) ?? [];
|
|
524
|
+
s.push(e), this._subscribers.set(t, s);
|
|
332
525
|
}
|
|
333
|
-
on(
|
|
334
|
-
this.setSubscriber(
|
|
526
|
+
on(t, e) {
|
|
527
|
+
this.setSubscriber(t, { cb: e });
|
|
335
528
|
}
|
|
336
|
-
once(
|
|
337
|
-
this.setSubscriber(
|
|
338
|
-
cb:
|
|
529
|
+
once(t, e) {
|
|
530
|
+
this.setSubscriber(t, {
|
|
531
|
+
cb: e,
|
|
339
532
|
once: !0
|
|
340
533
|
});
|
|
341
534
|
}
|
|
342
|
-
emit(
|
|
343
|
-
const
|
|
344
|
-
for (const n of
|
|
345
|
-
for (const n of
|
|
535
|
+
emit(t, ...e) {
|
|
536
|
+
const s = this._subscribers.get(t) ?? [], i = [];
|
|
537
|
+
for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
|
|
538
|
+
for (const n of i) n();
|
|
346
539
|
}
|
|
347
540
|
prompt() {
|
|
348
|
-
return new Promise((
|
|
541
|
+
return new Promise((t) => {
|
|
349
542
|
if (this._abortSignal) {
|
|
350
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(),
|
|
543
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(C);
|
|
351
544
|
this._abortSignal.addEventListener("abort", () => {
|
|
352
545
|
this.state = "cancel", this.close();
|
|
353
546
|
}, { once: !0 });
|
|
354
547
|
}
|
|
355
|
-
this.rl =
|
|
548
|
+
this.rl = P$1.createInterface({
|
|
356
549
|
input: this.input,
|
|
357
550
|
tabSize: 2,
|
|
358
551
|
prompt: "",
|
|
359
552
|
escapeCodeTimeout: 50,
|
|
360
553
|
terminal: !0
|
|
361
|
-
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress),
|
|
362
|
-
this.output.write(import_src.cursor.show), this.output.off("resize", this.render),
|
|
554
|
+
}), 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", () => {
|
|
555
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(this.value);
|
|
363
556
|
}), this.once("cancel", () => {
|
|
364
|
-
this.output.write(import_src.cursor.show), this.output.off("resize", this.render),
|
|
557
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(C);
|
|
365
558
|
});
|
|
366
559
|
});
|
|
367
560
|
}
|
|
368
|
-
_isActionKey(
|
|
369
|
-
return
|
|
561
|
+
_isActionKey(t, e) {
|
|
562
|
+
return t === " ";
|
|
370
563
|
}
|
|
371
|
-
_setValue(
|
|
372
|
-
this.value =
|
|
564
|
+
_setValue(t) {
|
|
565
|
+
this.value = t, this.emit("value", this.value);
|
|
373
566
|
}
|
|
374
|
-
_setUserInput(
|
|
375
|
-
this.userInput =
|
|
567
|
+
_setUserInput(t, e) {
|
|
568
|
+
this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
376
569
|
}
|
|
377
570
|
_clearUserInput() {
|
|
378
571
|
this.rl?.write(null, {
|
|
@@ -380,130 +573,132 @@ var B = class {
|
|
|
380
573
|
name: "u"
|
|
381
574
|
}), this._setUserInput("");
|
|
382
575
|
}
|
|
383
|
-
onKeypress(
|
|
384
|
-
if (this._track &&
|
|
576
|
+
onKeypress(t, e) {
|
|
577
|
+
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
|
|
385
578
|
ctrl: !0,
|
|
386
579
|
name: "h"
|
|
387
|
-
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"),
|
|
580
|
+
}), 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") {
|
|
388
581
|
if (this.opts.validate) {
|
|
389
|
-
const
|
|
390
|
-
|
|
582
|
+
const s = this.opts.validate(this.value);
|
|
583
|
+
s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
|
|
391
584
|
}
|
|
392
585
|
this.state !== "error" && (this.state = "submit");
|
|
393
586
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
587
|
+
V$1([
|
|
588
|
+
t,
|
|
589
|
+
e?.name,
|
|
590
|
+
e?.sequence
|
|
398
591
|
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
399
592
|
}
|
|
400
593
|
close() {
|
|
401
594
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
402
|
-
`),
|
|
595
|
+
`), w$1(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
403
596
|
}
|
|
404
597
|
restoreCursor() {
|
|
405
|
-
const
|
|
598
|
+
const t = wrapAnsi(this._prevFrame, process.stdout.columns, {
|
|
406
599
|
hard: !0,
|
|
407
600
|
trim: !1
|
|
408
601
|
}).split(`
|
|
409
602
|
`).length - 1;
|
|
410
|
-
this.output.write(import_src.cursor.move(-999,
|
|
603
|
+
this.output.write(import_src.cursor.move(-999, t * -1));
|
|
411
604
|
}
|
|
412
605
|
render() {
|
|
413
|
-
const
|
|
606
|
+
const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
414
607
|
hard: !0,
|
|
415
608
|
trim: !1
|
|
416
609
|
});
|
|
417
|
-
if (
|
|
610
|
+
if (t !== this._prevFrame) {
|
|
418
611
|
if (this.state === "initial") this.output.write(import_src.cursor.hide);
|
|
419
612
|
else {
|
|
420
|
-
const
|
|
421
|
-
if (this.restoreCursor(),
|
|
422
|
-
const
|
|
423
|
-
let
|
|
424
|
-
if (
|
|
425
|
-
this._prevFrame =
|
|
613
|
+
const e = j(this._prevFrame, t), s = A(this.output);
|
|
614
|
+
if (this.restoreCursor(), e) {
|
|
615
|
+
const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
|
|
616
|
+
let o = e.lines.find((a) => a >= i);
|
|
617
|
+
if (o === void 0) {
|
|
618
|
+
this._prevFrame = t;
|
|
426
619
|
return;
|
|
427
620
|
}
|
|
428
|
-
if (
|
|
429
|
-
this.output.write(import_src.cursor.move(0,
|
|
430
|
-
const a =
|
|
621
|
+
if (e.lines.length === 1) {
|
|
622
|
+
this.output.write(import_src.cursor.move(0, o - n)), this.output.write(import_src.erase.lines(1));
|
|
623
|
+
const a = t.split(`
|
|
431
624
|
`);
|
|
432
|
-
this.output.write(a[
|
|
625
|
+
this.output.write(a[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, a.length - o - 1));
|
|
433
626
|
return;
|
|
434
|
-
} else if (
|
|
435
|
-
if (
|
|
627
|
+
} else if (e.lines.length > 1) {
|
|
628
|
+
if (i < n) o = i;
|
|
436
629
|
else {
|
|
437
|
-
const
|
|
438
|
-
|
|
630
|
+
const h = o - n;
|
|
631
|
+
h > 0 && this.output.write(import_src.cursor.move(0, h));
|
|
439
632
|
}
|
|
440
633
|
this.output.write(import_src.erase.down());
|
|
441
|
-
const a =
|
|
442
|
-
`).slice(
|
|
634
|
+
const a = t.split(`
|
|
635
|
+
`).slice(o);
|
|
443
636
|
this.output.write(a.join(`
|
|
444
|
-
`)), this._prevFrame =
|
|
637
|
+
`)), this._prevFrame = t;
|
|
445
638
|
return;
|
|
446
639
|
}
|
|
447
640
|
}
|
|
448
641
|
this.output.write(import_src.erase.down());
|
|
449
642
|
}
|
|
450
|
-
this.output.write(
|
|
643
|
+
this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
|
|
451
644
|
}
|
|
452
645
|
}
|
|
453
646
|
};
|
|
454
|
-
var
|
|
647
|
+
var Q$1 = class extends p {
|
|
455
648
|
get cursor() {
|
|
456
649
|
return this.value ? 0 : 1;
|
|
457
650
|
}
|
|
458
651
|
get _value() {
|
|
459
652
|
return this.cursor === 0;
|
|
460
653
|
}
|
|
461
|
-
constructor(
|
|
462
|
-
super(
|
|
654
|
+
constructor(t) {
|
|
655
|
+
super(t, !1), this.value = !!t.initialValue, this.on("userInput", () => {
|
|
463
656
|
this.value = this._value;
|
|
464
|
-
}), this.on("confirm", (
|
|
465
|
-
this.output.write(import_src.cursor.move(0, -1)), this.value =
|
|
657
|
+
}), this.on("confirm", (e) => {
|
|
658
|
+
this.output.write(import_src.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
|
|
466
659
|
}), this.on("cursor", () => {
|
|
467
660
|
this.value = !this.value;
|
|
468
661
|
});
|
|
469
662
|
}
|
|
470
663
|
};
|
|
471
|
-
let
|
|
664
|
+
let it$1 = class extends p {
|
|
472
665
|
options;
|
|
473
666
|
cursor = 0;
|
|
474
667
|
get _value() {
|
|
475
668
|
return this.options[this.cursor].value;
|
|
476
669
|
}
|
|
477
670
|
get _enabledOptions() {
|
|
478
|
-
return this.options.filter((
|
|
671
|
+
return this.options.filter((t) => t.disabled !== !0);
|
|
479
672
|
}
|
|
480
673
|
toggleAll() {
|
|
481
|
-
const e = this.
|
|
482
|
-
this.value =
|
|
674
|
+
const t = this._enabledOptions, e = this.value !== void 0 && this.value.length === t.length;
|
|
675
|
+
this.value = e ? [] : t.map((s) => s.value);
|
|
483
676
|
}
|
|
484
677
|
toggleInvert() {
|
|
485
|
-
const
|
|
486
|
-
if (!
|
|
487
|
-
|
|
678
|
+
const t = this.value;
|
|
679
|
+
if (!t) return;
|
|
680
|
+
const e = this._enabledOptions.filter((s) => !t.includes(s.value));
|
|
681
|
+
this.value = e.map((s) => s.value);
|
|
488
682
|
}
|
|
489
683
|
toggleValue() {
|
|
490
684
|
this.value === void 0 && (this.value = []);
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
685
|
+
const t = this.value.includes(this._value);
|
|
686
|
+
this.value = t ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
|
|
687
|
+
}
|
|
688
|
+
constructor(t) {
|
|
689
|
+
super(t, !1), this.options = t.options, this.value = [...t.initialValues ?? []];
|
|
690
|
+
const e = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), 0);
|
|
691
|
+
this.cursor = this.options[e].disabled ? d$1(e, 1, this.options) : e, this.on("key", (s) => {
|
|
692
|
+
s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
|
|
693
|
+
}), this.on("cursor", (s) => {
|
|
694
|
+
switch (s) {
|
|
500
695
|
case "left":
|
|
501
696
|
case "up":
|
|
502
|
-
this.cursor =
|
|
697
|
+
this.cursor = d$1(this.cursor, -1, this.options);
|
|
503
698
|
break;
|
|
504
699
|
case "down":
|
|
505
700
|
case "right":
|
|
506
|
-
this.cursor =
|
|
701
|
+
this.cursor = d$1(this.cursor, 1, this.options);
|
|
507
702
|
break;
|
|
508
703
|
case "space":
|
|
509
704
|
this.toggleValue();
|
|
@@ -512,7 +707,7 @@ let Lt$1 = class extends B {
|
|
|
512
707
|
});
|
|
513
708
|
}
|
|
514
709
|
};
|
|
515
|
-
var
|
|
710
|
+
var nt$1 = class extends p {
|
|
516
711
|
options;
|
|
517
712
|
cursor = 0;
|
|
518
713
|
get _selectedValue() {
|
|
@@ -521,363 +716,214 @@ var Tt$1 = class extends B {
|
|
|
521
716
|
changeValue() {
|
|
522
717
|
this.value = this._selectedValue.value;
|
|
523
718
|
}
|
|
524
|
-
constructor(
|
|
525
|
-
super(
|
|
526
|
-
const
|
|
527
|
-
this.cursor = this.options[
|
|
528
|
-
switch (
|
|
719
|
+
constructor(t) {
|
|
720
|
+
super(t, !1), this.options = t.options;
|
|
721
|
+
const e = this.options.findIndex(({ value: i }) => i === t.initialValue), s = e === -1 ? 0 : e;
|
|
722
|
+
this.cursor = this.options[s].disabled ? d$1(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
|
|
723
|
+
switch (i) {
|
|
529
724
|
case "left":
|
|
530
725
|
case "up":
|
|
531
|
-
this.cursor =
|
|
726
|
+
this.cursor = d$1(this.cursor, -1, this.options);
|
|
532
727
|
break;
|
|
533
728
|
case "down":
|
|
534
729
|
case "right":
|
|
535
|
-
this.cursor =
|
|
730
|
+
this.cursor = d$1(this.cursor, 1, this.options);
|
|
536
731
|
break;
|
|
537
732
|
}
|
|
538
733
|
this.changeValue();
|
|
539
734
|
});
|
|
540
735
|
}
|
|
541
736
|
};
|
|
542
|
-
var $
|
|
737
|
+
var at$1 = class extends p {
|
|
543
738
|
get userInputWithCursor() {
|
|
544
739
|
if (this.state === "submit") return this.userInput;
|
|
545
|
-
const
|
|
546
|
-
if (this.cursor >=
|
|
547
|
-
const
|
|
548
|
-
return `${
|
|
740
|
+
const t = this.userInput;
|
|
741
|
+
if (this.cursor >= t.length) return `${this.userInput}\u2588`;
|
|
742
|
+
const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
|
|
743
|
+
return `${e}${styleText("inverse", s)}${i.join("")}`;
|
|
549
744
|
}
|
|
550
745
|
get cursor() {
|
|
551
746
|
return this._cursor;
|
|
552
747
|
}
|
|
553
|
-
constructor(
|
|
748
|
+
constructor(t) {
|
|
554
749
|
super({
|
|
555
|
-
...
|
|
556
|
-
initialUserInput:
|
|
557
|
-
}), this.on("userInput", (
|
|
558
|
-
this._setValue(
|
|
750
|
+
...t,
|
|
751
|
+
initialUserInput: t.initialUserInput ?? t.initialValue
|
|
752
|
+
}), this.on("userInput", (e) => {
|
|
753
|
+
this._setValue(e);
|
|
559
754
|
}), this.on("finalize", () => {
|
|
560
|
-
this.value || (this.value =
|
|
755
|
+
this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = "");
|
|
561
756
|
});
|
|
562
757
|
}
|
|
563
758
|
};
|
|
564
759
|
//#endregion
|
|
565
|
-
//#region node_modules/.pnpm/@clack+prompts@1.
|
|
566
|
-
function
|
|
567
|
-
return
|
|
760
|
+
//#region node_modules/.pnpm/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
|
|
761
|
+
function Ze() {
|
|
762
|
+
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";
|
|
568
763
|
}
|
|
569
|
-
const ee =
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
const z =
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
const
|
|
764
|
+
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("└", "—");
|
|
765
|
+
w("┐", "T");
|
|
766
|
+
w("┘", "—");
|
|
767
|
+
const z = w("●", ">"), H = w("○", " "), te = w("◻", "[•]"), U = w("◼", "[+]"), J = w("◻", "[ ]");
|
|
768
|
+
w("▪", "•");
|
|
769
|
+
w("─", "-");
|
|
770
|
+
w("╮", "+");
|
|
771
|
+
w("├", "+");
|
|
772
|
+
w("╯", "+");
|
|
773
|
+
w("╰", "+");
|
|
774
|
+
w("╭", "+");
|
|
775
|
+
const he = w("●", "•"), pe = w("◆", "*"), me = w("▲", "!"), ge = w("■", "x"), V = (e) => {
|
|
581
776
|
switch (e) {
|
|
582
777
|
case "initial":
|
|
583
|
-
case "active": return styleText("cyan",
|
|
584
|
-
case "cancel": return styleText("red",
|
|
585
|
-
case "error": return styleText("yellow",
|
|
586
|
-
case "submit": return styleText("green",
|
|
778
|
+
case "active": return styleText("cyan", _e);
|
|
779
|
+
case "cancel": return styleText("red", oe);
|
|
780
|
+
case "error": return styleText("yellow", ue);
|
|
781
|
+
case "submit": return styleText("green", F);
|
|
587
782
|
}
|
|
588
|
-
},
|
|
783
|
+
}, ye = (e) => {
|
|
589
784
|
switch (e) {
|
|
590
785
|
case "initial":
|
|
591
|
-
case "active": return styleText("cyan",
|
|
592
|
-
case "cancel": return styleText("red",
|
|
593
|
-
case "error": return styleText("yellow",
|
|
594
|
-
case "submit": return styleText("green",
|
|
595
|
-
}
|
|
596
|
-
}, mt = (e) => e === 161 || e === 164 || e === 167 || e === 168 || e === 170 || e === 173 || e === 174 || e >= 176 && e <= 180 || e >= 182 && e <= 186 || e >= 188 && e <= 191 || e === 198 || e === 208 || e === 215 || e === 216 || e >= 222 && e <= 225 || e === 230 || e >= 232 && e <= 234 || e === 236 || e === 237 || e === 240 || e === 242 || e === 243 || e >= 247 && e <= 250 || e === 252 || e === 254 || e === 257 || e === 273 || e === 275 || e === 283 || e === 294 || e === 295 || e === 299 || e >= 305 && e <= 307 || e === 312 || e >= 319 && e <= 322 || e === 324 || e >= 328 && e <= 331 || e === 333 || e === 338 || e === 339 || e === 358 || e === 359 || e === 363 || e === 462 || e === 464 || e === 466 || e === 468 || e === 470 || e === 472 || e === 474 || e === 476 || e === 593 || e === 609 || e === 708 || e === 711 || e >= 713 && e <= 715 || e === 717 || e === 720 || e >= 728 && e <= 731 || e === 733 || e === 735 || e >= 768 && e <= 879 || e >= 913 && e <= 929 || e >= 931 && e <= 937 || e >= 945 && e <= 961 || e >= 963 && e <= 969 || e === 1025 || e >= 1040 && e <= 1103 || e === 1105 || e === 8208 || e >= 8211 && e <= 8214 || e === 8216 || e === 8217 || e === 8220 || e === 8221 || e >= 8224 && e <= 8226 || e >= 8228 && e <= 8231 || e === 8240 || e === 8242 || e === 8243 || e === 8245 || e === 8251 || e === 8254 || e === 8308 || e === 8319 || e >= 8321 && e <= 8324 || e === 8364 || e === 8451 || e === 8453 || e === 8457 || e === 8467 || e === 8470 || e === 8481 || e === 8482 || e === 8486 || e === 8491 || e === 8531 || e === 8532 || e >= 8539 && e <= 8542 || e >= 8544 && e <= 8555 || e >= 8560 && e <= 8569 || e === 8585 || e >= 8592 && e <= 8601 || e === 8632 || e === 8633 || e === 8658 || e === 8660 || e === 8679 || e === 8704 || e === 8706 || e === 8707 || e === 8711 || e === 8712 || e === 8715 || e === 8719 || e === 8721 || e === 8725 || e === 8730 || e >= 8733 && e <= 8736 || e === 8739 || e === 8741 || e >= 8743 && e <= 8748 || e === 8750 || e >= 8756 && e <= 8759 || e === 8764 || e === 8765 || e === 8776 || e === 8780 || e === 8786 || e === 8800 || e === 8801 || e >= 8804 && e <= 8807 || e === 8810 || e === 8811 || e === 8814 || e === 8815 || e === 8834 || e === 8835 || e === 8838 || e === 8839 || e === 8853 || e === 8857 || e === 8869 || e === 8895 || e === 8978 || e >= 9312 && e <= 9449 || e >= 9451 && e <= 9547 || e >= 9552 && e <= 9587 || e >= 9600 && e <= 9615 || e >= 9618 && e <= 9621 || e === 9632 || e === 9633 || e >= 9635 && e <= 9641 || e === 9650 || e === 9651 || e === 9654 || e === 9655 || e === 9660 || e === 9661 || e === 9664 || e === 9665 || e >= 9670 && e <= 9672 || e === 9675 || e >= 9678 && e <= 9681 || e >= 9698 && e <= 9701 || e === 9711 || e === 9733 || e === 9734 || e === 9737 || e === 9742 || e === 9743 || e === 9756 || e === 9758 || e === 9792 || e === 9794 || e === 9824 || e === 9825 || e >= 9827 && e <= 9829 || e >= 9831 && e <= 9834 || e === 9836 || e === 9837 || e === 9839 || e === 9886 || e === 9887 || e === 9919 || e >= 9926 && e <= 9933 || e >= 9935 && e <= 9939 || e >= 9941 && e <= 9953 || e === 9955 || e === 9960 || e === 9961 || e >= 9963 && e <= 9969 || e === 9972 || e >= 9974 && e <= 9977 || e === 9979 || e === 9980 || e === 9982 || e === 9983 || e === 10045 || e >= 10102 && e <= 10111 || e >= 11094 && e <= 11097 || e >= 12872 && e <= 12879 || e >= 57344 && e <= 63743 || e >= 65024 && e <= 65039 || e === 65533 || e >= 127232 && e <= 127242 || e >= 127248 && e <= 127277 || e >= 127280 && e <= 127337 || e >= 127344 && e <= 127373 || e === 127375 || e === 127376 || e >= 127387 && e <= 127404 || e >= 917760 && e <= 917999 || e >= 983040 && e <= 1048573 || e >= 1048576 && e <= 1114109, gt = (e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, ft = (e) => e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9800 && e <= 9811 || e === 9855 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101632 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129672 || e >= 129680 && e <= 129725 || e >= 129727 && e <= 129733 || e >= 129742 && e <= 129755 || e >= 129760 && e <= 129768 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141, we = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, re = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, ie = /\t{1,1000}/y, Ae = /[\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, ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, Ft = /\p{M}+/gu, yt = {
|
|
597
|
-
limit: Infinity,
|
|
598
|
-
ellipsis: ""
|
|
599
|
-
}, Le = (e, r = {}, s = {}) => {
|
|
600
|
-
const i = r.limit ?? Infinity, a = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (a ? Le(a, yt, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, n = s.tabWidth ?? 8, c = s.ambiguousWidth ?? 1, p = s.emojiWidth ?? 2, f = s.fullWidthWidth ?? 2, g = s.regularWidth ?? 1, E = s.wideWidth ?? 2;
|
|
601
|
-
let $ = 0, m = 0, d = e.length, F = 0, y = !1, v = d, C = Math.max(0, i - o), A = 0, b = 0, w = 0, S = 0;
|
|
602
|
-
e: for (;;) {
|
|
603
|
-
if (b > A || m >= d && m > $) {
|
|
604
|
-
const T = e.slice(A, b) || e.slice($, m);
|
|
605
|
-
F = 0;
|
|
606
|
-
for (const M of T.replaceAll(Ft, "")) {
|
|
607
|
-
const O = M.codePointAt(0) || 0;
|
|
608
|
-
if (gt(O) ? S = f : ft(O) ? S = E : c !== g && mt(O) ? S = c : S = g, w + S > C && (v = Math.min(v, Math.max(A, $) + F)), w + S > i) {
|
|
609
|
-
y = !0;
|
|
610
|
-
break e;
|
|
611
|
-
}
|
|
612
|
-
F += M.length, w += S;
|
|
613
|
-
}
|
|
614
|
-
A = b = 0;
|
|
615
|
-
}
|
|
616
|
-
if (m >= d) break;
|
|
617
|
-
if (ne.lastIndex = m, ne.test(e)) {
|
|
618
|
-
if (F = ne.lastIndex - m, S = F * g, w + S > C && (v = Math.min(v, m + Math.floor((C - w) / g))), w + S > i) {
|
|
619
|
-
y = !0;
|
|
620
|
-
break;
|
|
621
|
-
}
|
|
622
|
-
w += S, A = $, b = m, m = $ = ne.lastIndex;
|
|
623
|
-
continue;
|
|
624
|
-
}
|
|
625
|
-
if (we.lastIndex = m, we.test(e)) {
|
|
626
|
-
if (w + u > C && (v = Math.min(v, m)), w + u > i) {
|
|
627
|
-
y = !0;
|
|
628
|
-
break;
|
|
629
|
-
}
|
|
630
|
-
w += u, A = $, b = m, m = $ = we.lastIndex;
|
|
631
|
-
continue;
|
|
632
|
-
}
|
|
633
|
-
if (re.lastIndex = m, re.test(e)) {
|
|
634
|
-
if (F = re.lastIndex - m, S = F * l, w + S > C && (v = Math.min(v, m + Math.floor((C - w) / l))), w + S > i) {
|
|
635
|
-
y = !0;
|
|
636
|
-
break;
|
|
637
|
-
}
|
|
638
|
-
w += S, A = $, b = m, m = $ = re.lastIndex;
|
|
639
|
-
continue;
|
|
640
|
-
}
|
|
641
|
-
if (ie.lastIndex = m, ie.test(e)) {
|
|
642
|
-
if (F = ie.lastIndex - m, S = F * n, w + S > C && (v = Math.min(v, m + Math.floor((C - w) / n))), w + S > i) {
|
|
643
|
-
y = !0;
|
|
644
|
-
break;
|
|
645
|
-
}
|
|
646
|
-
w += S, A = $, b = m, m = $ = ie.lastIndex;
|
|
647
|
-
continue;
|
|
648
|
-
}
|
|
649
|
-
if (Ae.lastIndex = m, Ae.test(e)) {
|
|
650
|
-
if (w + p > C && (v = Math.min(v, m)), w + p > i) {
|
|
651
|
-
y = !0;
|
|
652
|
-
break;
|
|
653
|
-
}
|
|
654
|
-
w += p, A = $, b = m, m = $ = Ae.lastIndex;
|
|
655
|
-
continue;
|
|
656
|
-
}
|
|
657
|
-
m += 1;
|
|
786
|
+
case "active": return styleText("cyan", d);
|
|
787
|
+
case "cancel": return styleText("red", d);
|
|
788
|
+
case "error": return styleText("yellow", d);
|
|
789
|
+
case "submit": return styleText("green", d);
|
|
658
790
|
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
};
|
|
665
|
-
}, Et = {
|
|
666
|
-
limit: Infinity,
|
|
667
|
-
ellipsis: "",
|
|
668
|
-
ellipsisWidth: 0
|
|
669
|
-
}, D = (e, r = {}) => Le(e, Et, r).width, ae = "\x1B", je = "", vt = 39, Ce = "\x07", ke = "[", wt = "]", Ve = "m", Se = `${wt}8;;`, He = new RegExp(`(?:\\${ke}(?<code>\\d+)m|\\${Se}(?<uri>.*)${Ce})`, "y"), At = (e) => {
|
|
670
|
-
if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
|
|
671
|
-
if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
|
|
672
|
-
if (e === 1 || e === 2) return 22;
|
|
673
|
-
if (e === 3) return 23;
|
|
674
|
-
if (e === 4) return 24;
|
|
675
|
-
if (e === 7) return 27;
|
|
676
|
-
if (e === 8) return 28;
|
|
677
|
-
if (e === 9) return 29;
|
|
678
|
-
if (e === 0) return 0;
|
|
679
|
-
}, Ue = (e) => `${ae}${ke}${e}${Ve}`, Ke = (e) => `${ae}${Se}${e}${Ce}`, Ct = (e) => e.map((r) => D(r)), Ie = (e, r, s) => {
|
|
680
|
-
const i = r[Symbol.iterator]();
|
|
681
|
-
let a = !1, o = !1, u = e.at(-1), l = u === void 0 ? 0 : D(u), n = i.next(), c = i.next(), p = 0;
|
|
682
|
-
for (; !n.done;) {
|
|
683
|
-
const f = n.value, g = D(f);
|
|
684
|
-
l + g <= s ? e[e.length - 1] += f : (e.push(f), l = 0), (f === ae || f === je) && (a = !0, o = r.startsWith(Se, p + 1)), a ? o ? f === Ce && (a = !1, o = !1) : f === Ve && (a = !1) : (l += g, l === s && !c.done && (e.push(""), l = 0)), n = c, c = i.next(), p += f.length;
|
|
685
|
-
}
|
|
686
|
-
u = e.at(-1), !l && u !== void 0 && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
687
|
-
}, St = (e) => {
|
|
688
|
-
const r = e.split(" ");
|
|
689
|
-
let s = r.length;
|
|
690
|
-
for (; s > 0 && !(D(r[s - 1]) > 0);) s--;
|
|
691
|
-
return s === r.length ? e : r.slice(0, s).join(" ") + r.slice(s).join("");
|
|
692
|
-
}, It = (e, r, s = {}) => {
|
|
693
|
-
if (s.trim !== !1 && e.trim() === "") return "";
|
|
694
|
-
let i = "", a, o;
|
|
695
|
-
const u = e.split(" "), l = Ct(u);
|
|
696
|
-
let n = [""];
|
|
697
|
-
for (const [$, m] of u.entries()) {
|
|
698
|
-
s.trim !== !1 && (n[n.length - 1] = (n.at(-1) ?? "").trimStart());
|
|
699
|
-
let d = D(n.at(-1) ?? "");
|
|
700
|
-
if ($ !== 0 && (d >= r && (s.wordWrap === !1 || s.trim === !1) && (n.push(""), d = 0), (d > 0 || s.trim === !1) && (n[n.length - 1] += " ", d++)), s.hard && l[$] > r) {
|
|
701
|
-
const F = r - d, y = 1 + Math.floor((l[$] - F - 1) / r);
|
|
702
|
-
Math.floor((l[$] - 1) / r) < y && n.push(""), Ie(n, m, r);
|
|
703
|
-
continue;
|
|
704
|
-
}
|
|
705
|
-
if (d + l[$] > r && d > 0 && l[$] > 0) {
|
|
706
|
-
if (s.wordWrap === !1 && d < r) {
|
|
707
|
-
Ie(n, m, r);
|
|
708
|
-
continue;
|
|
709
|
-
}
|
|
710
|
-
n.push("");
|
|
711
|
-
}
|
|
712
|
-
if (d + l[$] > r && s.wordWrap === !1) {
|
|
713
|
-
Ie(n, m, r);
|
|
714
|
-
continue;
|
|
715
|
-
}
|
|
716
|
-
n[n.length - 1] += m;
|
|
717
|
-
}
|
|
718
|
-
s.trim !== !1 && (n = n.map(($) => St($)));
|
|
719
|
-
const c = n.join(`
|
|
720
|
-
`), p = c[Symbol.iterator]();
|
|
721
|
-
let f = p.next(), g = p.next(), E = 0;
|
|
722
|
-
for (; !f.done;) {
|
|
723
|
-
const $ = f.value, m = g.value;
|
|
724
|
-
if (i += $, $ === ae || $ === je) {
|
|
725
|
-
He.lastIndex = E + 1;
|
|
726
|
-
const y = He.exec(c)?.groups;
|
|
727
|
-
if (y?.code !== void 0) {
|
|
728
|
-
const v = Number.parseFloat(y.code);
|
|
729
|
-
a = v === vt ? void 0 : v;
|
|
730
|
-
} else y?.uri !== void 0 && (o = y.uri.length === 0 ? void 0 : y.uri);
|
|
731
|
-
}
|
|
732
|
-
const d = a ? At(a) : void 0;
|
|
733
|
-
m === `
|
|
734
|
-
` ? (o && (i += Ke("")), a && d && (i += Ue(d))) : $ === `
|
|
735
|
-
` && (a && d && (i += Ue(a)), o && (i += Ke(o))), E += $.length, f = g, g = p.next();
|
|
736
|
-
}
|
|
737
|
-
return i;
|
|
738
|
-
};
|
|
739
|
-
function J(e, r, s) {
|
|
740
|
-
return String(e).normalize().replaceAll(`\r
|
|
741
|
-
`, `
|
|
742
|
-
`).split(`
|
|
743
|
-
`).map((i) => It(i, r, s)).join(`
|
|
744
|
-
`);
|
|
745
|
-
}
|
|
746
|
-
const bt = (e, r, s, i, a) => {
|
|
747
|
-
let o = r, u = 0;
|
|
748
|
-
for (let l = s; l < i; l++) {
|
|
749
|
-
const n = e[l];
|
|
750
|
-
if (o = o - n.length, u++, o <= a) break;
|
|
791
|
+
}, et = (e, i, s, r, u) => {
|
|
792
|
+
let n = i, o = 0;
|
|
793
|
+
for (let c = s; c < r; c++) {
|
|
794
|
+
const a = e[c];
|
|
795
|
+
if (n = n - a.length, o++, n <= u) break;
|
|
751
796
|
}
|
|
752
797
|
return {
|
|
753
|
-
lineCount:
|
|
754
|
-
removals:
|
|
798
|
+
lineCount: n,
|
|
799
|
+
removals: o
|
|
755
800
|
};
|
|
756
|
-
},
|
|
757
|
-
const
|
|
758
|
-
let
|
|
759
|
-
e >=
|
|
760
|
-
let
|
|
761
|
-
const
|
|
762
|
-
let
|
|
763
|
-
|
|
764
|
-
const
|
|
765
|
-
for (let
|
|
766
|
-
const
|
|
801
|
+
}, Y = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
|
|
802
|
+
const c = O$1(r) - n, a = A(r), l = styleText("dim", "..."), $ = Math.max(a - o, 0), y = Math.max(Math.min(u, $), 5);
|
|
803
|
+
let p = 0;
|
|
804
|
+
e >= y - 3 && (p = Math.max(Math.min(e - y + 3, i.length - y), 0));
|
|
805
|
+
let m = y < i.length && p > 0, g = y < i.length && p + y < i.length;
|
|
806
|
+
const S = Math.min(p + y, i.length), h = [];
|
|
807
|
+
let f = 0;
|
|
808
|
+
m && f++, g && f++;
|
|
809
|
+
const v = p + (m ? 1 : 0), T = S - (g ? 1 : 0);
|
|
810
|
+
for (let b = v; b < T; b++) {
|
|
811
|
+
const x = wrapAnsi(s(i[b], b === e), c, {
|
|
767
812
|
hard: !0,
|
|
768
813
|
trim: !1
|
|
769
814
|
}).split(`
|
|
770
815
|
`);
|
|
771
|
-
|
|
816
|
+
h.push(x), f += x.length;
|
|
772
817
|
}
|
|
773
|
-
if (
|
|
774
|
-
let
|
|
775
|
-
const
|
|
776
|
-
|
|
818
|
+
if (f > $) {
|
|
819
|
+
let b = 0, x = 0, G = f;
|
|
820
|
+
const M = e - v, R = (j, D) => et(h, G, j, D, $);
|
|
821
|
+
m ? ({lineCount: G, removals: b} = R(0, M), G > $ && ({lineCount: G, removals: x} = R(M + 1, h.length))) : ({lineCount: G, removals: x} = R(M + 1, h.length), G > $ && ({lineCount: G, removals: b} = R(0, M))), b > 0 && (m = !0, h.splice(0, b)), x > 0 && (g = !0, h.splice(h.length - x, x));
|
|
777
822
|
}
|
|
778
823
|
const C = [];
|
|
779
|
-
|
|
780
|
-
for (const
|
|
781
|
-
return
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
824
|
+
m && C.push(l);
|
|
825
|
+
for (const b of h) for (const x of b) C.push(x);
|
|
826
|
+
return g && C.push(l), C;
|
|
827
|
+
};
|
|
828
|
+
const ot = (e) => {
|
|
829
|
+
const i = e.active ?? "Yes", s = e.inactive ?? "No";
|
|
830
|
+
return new Q$1({
|
|
831
|
+
active: i,
|
|
786
832
|
inactive: s,
|
|
787
833
|
signal: e.signal,
|
|
788
834
|
input: e.input,
|
|
789
835
|
output: e.output,
|
|
790
836
|
initialValue: e.initialValue ?? !0,
|
|
791
837
|
render() {
|
|
792
|
-
const
|
|
793
|
-
` : ""}${
|
|
794
|
-
`,
|
|
838
|
+
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)}
|
|
839
|
+
` : ""}${o}
|
|
840
|
+
`, a = this.value ? i : s;
|
|
795
841
|
switch (this.state) {
|
|
796
|
-
case "submit": return `${
|
|
797
|
-
case "cancel": return `${
|
|
798
|
-
${styleText("gray",
|
|
842
|
+
case "submit": return `${c}${r ? `${styleText("gray", d)} ` : ""}${styleText("dim", a)}`;
|
|
843
|
+
case "cancel": return `${c}${r ? `${styleText("gray", d)} ` : ""}${styleText(["strikethrough", "dim"], a)}${r ? `
|
|
844
|
+
${styleText("gray", d)}` : ""}`;
|
|
799
845
|
default: {
|
|
800
|
-
const
|
|
801
|
-
return `${
|
|
802
|
-
${styleText("cyan",
|
|
846
|
+
const l = r ? `${styleText("cyan", d)} ` : "", $ = r ? styleText("cyan", E) : "";
|
|
847
|
+
return `${c}${l}${this.value ? `${styleText("green", z)} ${i}` : `${styleText("dim", H)} ${styleText("dim", i)}`}${e.vertical ? r ? `
|
|
848
|
+
${styleText("cyan", d)} ` : `
|
|
803
849
|
` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", H)} ${styleText("dim", s)}` : `${styleText("green", z)} ${s}`}
|
|
804
|
-
${
|
|
850
|
+
${$}
|
|
805
851
|
`;
|
|
806
852
|
}
|
|
807
853
|
}
|
|
808
854
|
}
|
|
809
855
|
}).prompt();
|
|
810
|
-
},
|
|
811
|
-
message: (e = [], { symbol:
|
|
812
|
-
const
|
|
813
|
-
for (let
|
|
814
|
-
const
|
|
856
|
+
}, O = {
|
|
857
|
+
message: (e = [], { symbol: i = styleText("gray", d), secondarySymbol: s = styleText("gray", d), output: r = process.stdout, spacing: u$7 = 1, withGuide: n } = {}) => {
|
|
858
|
+
const o = [], c = n ?? u.withGuide, a = c ? s : "", l = c ? `${i} ` : "", $ = c ? `${s} ` : "";
|
|
859
|
+
for (let p = 0; p < u$7; p++) o.push(a);
|
|
860
|
+
const y = Array.isArray(e) ? e : e.split(`
|
|
815
861
|
`);
|
|
816
|
-
if (
|
|
817
|
-
const [
|
|
818
|
-
|
|
819
|
-
for (const
|
|
862
|
+
if (y.length > 0) {
|
|
863
|
+
const [p, ...m] = y;
|
|
864
|
+
p.length > 0 ? o.push(`${l}${p}`) : o.push(c ? i : "");
|
|
865
|
+
for (const g of m) g.length > 0 ? o.push(`${$}${g}`) : o.push(c ? s : "");
|
|
820
866
|
}
|
|
821
|
-
|
|
867
|
+
r.write(`${o.join(`
|
|
822
868
|
`)}
|
|
823
869
|
`);
|
|
824
870
|
},
|
|
825
|
-
info: (e,
|
|
826
|
-
|
|
827
|
-
...
|
|
828
|
-
symbol: styleText("blue",
|
|
871
|
+
info: (e, i) => {
|
|
872
|
+
O.message(e, {
|
|
873
|
+
...i,
|
|
874
|
+
symbol: styleText("blue", he)
|
|
829
875
|
});
|
|
830
876
|
},
|
|
831
|
-
success: (e,
|
|
832
|
-
|
|
833
|
-
...
|
|
834
|
-
symbol: styleText("green",
|
|
877
|
+
success: (e, i) => {
|
|
878
|
+
O.message(e, {
|
|
879
|
+
...i,
|
|
880
|
+
symbol: styleText("green", pe)
|
|
835
881
|
});
|
|
836
882
|
},
|
|
837
|
-
step: (e,
|
|
838
|
-
|
|
839
|
-
...
|
|
840
|
-
symbol: styleText("green",
|
|
883
|
+
step: (e, i) => {
|
|
884
|
+
O.message(e, {
|
|
885
|
+
...i,
|
|
886
|
+
symbol: styleText("green", F)
|
|
841
887
|
});
|
|
842
888
|
},
|
|
843
|
-
warn: (e,
|
|
844
|
-
|
|
845
|
-
...
|
|
846
|
-
symbol: styleText("yellow",
|
|
889
|
+
warn: (e, i) => {
|
|
890
|
+
O.message(e, {
|
|
891
|
+
...i,
|
|
892
|
+
symbol: styleText("yellow", me)
|
|
847
893
|
});
|
|
848
894
|
},
|
|
849
|
-
warning: (e,
|
|
850
|
-
|
|
895
|
+
warning: (e, i) => {
|
|
896
|
+
O.warn(e, i);
|
|
851
897
|
},
|
|
852
|
-
error: (e,
|
|
853
|
-
|
|
854
|
-
...
|
|
855
|
-
symbol: styleText("red",
|
|
898
|
+
error: (e, i) => {
|
|
899
|
+
O.message(e, {
|
|
900
|
+
...i,
|
|
901
|
+
symbol: styleText("red", ge)
|
|
856
902
|
});
|
|
857
903
|
}
|
|
858
|
-
},
|
|
859
|
-
const s =
|
|
860
|
-
s.write(`${
|
|
904
|
+
}, pt = (e = "", i) => {
|
|
905
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", E)} ` : "";
|
|
906
|
+
s.write(`${r}${styleText("red", e)}
|
|
861
907
|
|
|
862
908
|
`);
|
|
863
|
-
},
|
|
864
|
-
const s =
|
|
865
|
-
s.write(`${
|
|
909
|
+
}, mt = (e = "", i) => {
|
|
910
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", le)} ` : "";
|
|
911
|
+
s.write(`${r}${e}
|
|
866
912
|
`);
|
|
867
|
-
},
|
|
868
|
-
const s =
|
|
869
|
-
${styleText("gray",
|
|
870
|
-
s.write(`${
|
|
913
|
+
}, gt = (e = "", i) => {
|
|
914
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", d)}
|
|
915
|
+
${styleText("gray", E)} ` : "";
|
|
916
|
+
s.write(`${r}${e}
|
|
871
917
|
|
|
872
918
|
`);
|
|
873
|
-
}, Q = (e,
|
|
874
|
-
`).map((s) =>
|
|
875
|
-
`),
|
|
876
|
-
const
|
|
877
|
-
const
|
|
878
|
-
return
|
|
919
|
+
}, Q = (e, i) => e.split(`
|
|
920
|
+
`).map((s) => i(s)).join(`
|
|
921
|
+
`), yt = (e) => {
|
|
922
|
+
const i = (r, u) => {
|
|
923
|
+
const n = r.label ?? String(r.value);
|
|
924
|
+
return u === "disabled" ? `${styleText("gray", J)} ${Q(n, (o) => styleText(["strikethrough", "gray"], o))}${r.hint ? ` ${styleText("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u === "active" ? `${styleText("cyan", te)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : u === "selected" ? `${styleText("green", U)} ${Q(n, (o) => styleText("dim", o))}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : u === "cancelled" ? `${Q(n, (o) => styleText(["strikethrough", "dim"], o))}` : u === "active-selected" ? `${styleText("green", U)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : u === "submitted" ? `${Q(n, (o) => styleText("dim", o))}` : `${styleText("dim", J)} ${Q(n, (o) => styleText("dim", o))}`;
|
|
879
925
|
}, s = e.required ?? !0;
|
|
880
|
-
return new
|
|
926
|
+
return new it$1({
|
|
881
927
|
options: e.options,
|
|
882
928
|
signal: e.signal,
|
|
883
929
|
input: e.input,
|
|
@@ -885,8 +931,8 @@ ${styleText("gray", x)} ` : "";
|
|
|
885
931
|
initialValues: e.initialValues,
|
|
886
932
|
required: s,
|
|
887
933
|
cursorAt: e.cursorAt,
|
|
888
|
-
validate(
|
|
889
|
-
if (s && (
|
|
934
|
+
validate(r) {
|
|
935
|
+
if (s && (r === void 0 || r.length === 0)) return `Please select at least one option.
|
|
890
936
|
${styleText("reset", styleText("dim", `Press ${styleText([
|
|
891
937
|
"gray",
|
|
892
938
|
"bgWhite",
|
|
@@ -894,141 +940,141 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
|
|
|
894
940
|
], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
|
|
895
941
|
},
|
|
896
942
|
render() {
|
|
897
|
-
const
|
|
898
|
-
${
|
|
899
|
-
`, o = this.value ?? [],
|
|
900
|
-
if (
|
|
901
|
-
const
|
|
902
|
-
return
|
|
943
|
+
const r = e.withGuide ?? u.withGuide, u$8 = R(e.output, e.message, r ? `${ye(this.state)} ` : "", `${V(this.state)} `), n = `${r ? `${styleText("gray", d)}
|
|
944
|
+
` : ""}${u$8}
|
|
945
|
+
`, o = this.value ?? [], c = (a, l) => {
|
|
946
|
+
if (a.disabled) return i(a, "disabled");
|
|
947
|
+
const $ = o.includes(a.value);
|
|
948
|
+
return l && $ ? i(a, "active-selected") : $ ? i(a, "selected") : i(a, l ? "active" : "inactive");
|
|
903
949
|
};
|
|
904
950
|
switch (this.state) {
|
|
905
951
|
case "submit": {
|
|
906
|
-
const
|
|
907
|
-
return `${
|
|
952
|
+
const a = this.options.filter(({ value: $ }) => o.includes($)).map(($) => i($, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none");
|
|
953
|
+
return `${n}${R(e.output, a, r ? `${styleText("gray", d)} ` : "")}`;
|
|
908
954
|
}
|
|
909
955
|
case "cancel": {
|
|
910
|
-
const
|
|
911
|
-
if (
|
|
912
|
-
return `${
|
|
913
|
-
${styleText("gray",
|
|
956
|
+
const a = this.options.filter(({ value: $ }) => o.includes($)).map(($) => i($, "cancelled")).join(styleText("dim", ", "));
|
|
957
|
+
if (a.trim() === "") return `${n}${styleText("gray", d)}`;
|
|
958
|
+
return `${n}${R(e.output, a, r ? `${styleText("gray", d)} ` : "")}${r ? `
|
|
959
|
+
${styleText("gray", d)}` : ""}`;
|
|
914
960
|
}
|
|
915
961
|
case "error": {
|
|
916
|
-
const
|
|
917
|
-
`).map((
|
|
918
|
-
`),
|
|
919
|
-
`).length,
|
|
962
|
+
const a = r ? `${styleText("yellow", d)} ` : "", l = this.error.split(`
|
|
963
|
+
`).map((p, m) => m === 0 ? `${r ? `${styleText("yellow", E)} ` : ""}${styleText("yellow", p)}` : ` ${p}`).join(`
|
|
964
|
+
`), $ = n.split(`
|
|
965
|
+
`).length, y = l.split(`
|
|
920
966
|
`).length + 1;
|
|
921
|
-
return `${
|
|
967
|
+
return `${n}${a}${Y({
|
|
922
968
|
output: e.output,
|
|
923
969
|
options: this.options,
|
|
924
970
|
cursor: this.cursor,
|
|
925
971
|
maxItems: e.maxItems,
|
|
926
|
-
columnPadding:
|
|
927
|
-
rowPadding:
|
|
928
|
-
style:
|
|
972
|
+
columnPadding: a.length,
|
|
973
|
+
rowPadding: $ + y,
|
|
974
|
+
style: c
|
|
929
975
|
}).join(`
|
|
930
|
-
${
|
|
931
|
-
${
|
|
976
|
+
${a}`)}
|
|
977
|
+
${l}
|
|
932
978
|
`;
|
|
933
979
|
}
|
|
934
980
|
default: {
|
|
935
|
-
const
|
|
936
|
-
`).length;
|
|
937
|
-
return `${
|
|
981
|
+
const a = r ? `${styleText("cyan", d)} ` : "", l = n.split(`
|
|
982
|
+
`).length, $ = r ? 2 : 1;
|
|
983
|
+
return `${n}${a}${Y({
|
|
938
984
|
output: e.output,
|
|
939
985
|
options: this.options,
|
|
940
986
|
cursor: this.cursor,
|
|
941
987
|
maxItems: e.maxItems,
|
|
942
|
-
columnPadding:
|
|
943
|
-
rowPadding:
|
|
944
|
-
style:
|
|
988
|
+
columnPadding: a.length,
|
|
989
|
+
rowPadding: l + $,
|
|
990
|
+
style: c
|
|
945
991
|
}).join(`
|
|
946
|
-
${
|
|
947
|
-
${styleText("cyan",
|
|
992
|
+
${a}`)}
|
|
993
|
+
${r ? styleText("cyan", E) : ""}
|
|
948
994
|
`;
|
|
949
995
|
}
|
|
950
996
|
}
|
|
951
997
|
}
|
|
952
998
|
}).prompt();
|
|
953
999
|
};
|
|
954
|
-
|
|
955
|
-
const
|
|
1000
|
+
w("─", "-"), w("━", "="), w("█", "#");
|
|
1001
|
+
const re = (e, i) => e.includes(`
|
|
956
1002
|
`) ? e.split(`
|
|
957
|
-
`).map((s) =>
|
|
958
|
-
`) :
|
|
959
|
-
const
|
|
960
|
-
const
|
|
961
|
-
switch (
|
|
962
|
-
case "disabled": return `${styleText("gray", H)} ${
|
|
963
|
-
case "selected": return `${
|
|
964
|
-
case "active": return `${styleText("green", z)} ${
|
|
965
|
-
case "cancelled": return `${
|
|
966
|
-
default: return `${styleText("dim", H)} ${
|
|
1003
|
+
`).map((s) => i(s)).join(`
|
|
1004
|
+
`) : i(e), _t = (e) => {
|
|
1005
|
+
const i = (s, r) => {
|
|
1006
|
+
const u = s.label ?? String(s.value);
|
|
1007
|
+
switch (r) {
|
|
1008
|
+
case "disabled": return `${styleText("gray", H)} ${re(u, (n) => styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
1009
|
+
case "selected": return `${re(u, (n) => styleText("dim", n))}`;
|
|
1010
|
+
case "active": return `${styleText("green", z)} ${u}${s.hint ? ` ${styleText("dim", `(${s.hint})`)}` : ""}`;
|
|
1011
|
+
case "cancelled": return `${re(u, (n) => styleText(["strikethrough", "dim"], n))}`;
|
|
1012
|
+
default: return `${styleText("dim", H)} ${re(u, (n) => styleText("dim", n))}`;
|
|
967
1013
|
}
|
|
968
1014
|
};
|
|
969
|
-
return new
|
|
1015
|
+
return new nt$1({
|
|
970
1016
|
options: e.options,
|
|
971
1017
|
signal: e.signal,
|
|
972
1018
|
input: e.input,
|
|
973
1019
|
output: e.output,
|
|
974
1020
|
initialValue: e.initialValue,
|
|
975
1021
|
render() {
|
|
976
|
-
const s = e.withGuide ??
|
|
977
|
-
` : ""}${
|
|
1022
|
+
const s = e.withGuide ?? u.withGuide, r = `${V(this.state)} `, u$12 = `${ye(this.state)} `, n = R(e.output, e.message, u$12, r), o = `${s ? `${styleText("gray", d)}
|
|
1023
|
+
` : ""}${n}
|
|
978
1024
|
`;
|
|
979
1025
|
switch (this.state) {
|
|
980
1026
|
case "submit": {
|
|
981
|
-
const
|
|
982
|
-
return `${
|
|
1027
|
+
const c = s ? `${styleText("gray", d)} ` : "";
|
|
1028
|
+
return `${o}${R(e.output, i(this.options[this.cursor], "selected"), c)}`;
|
|
983
1029
|
}
|
|
984
1030
|
case "cancel": {
|
|
985
|
-
const
|
|
986
|
-
return `${
|
|
987
|
-
${styleText("gray",
|
|
1031
|
+
const c = s ? `${styleText("gray", d)} ` : "";
|
|
1032
|
+
return `${o}${R(e.output, i(this.options[this.cursor], "cancelled"), c)}${s ? `
|
|
1033
|
+
${styleText("gray", d)}` : ""}`;
|
|
988
1034
|
}
|
|
989
1035
|
default: {
|
|
990
|
-
const
|
|
991
|
-
`).length,
|
|
992
|
-
return `${
|
|
1036
|
+
const c = s ? `${styleText("cyan", d)} ` : "", a = s ? styleText("cyan", E) : "", l = o.split(`
|
|
1037
|
+
`).length, $ = s ? 2 : 1;
|
|
1038
|
+
return `${o}${c}${Y({
|
|
993
1039
|
output: e.output,
|
|
994
1040
|
cursor: this.cursor,
|
|
995
1041
|
options: this.options,
|
|
996
1042
|
maxItems: e.maxItems,
|
|
997
|
-
columnPadding:
|
|
998
|
-
rowPadding:
|
|
999
|
-
style: (
|
|
1043
|
+
columnPadding: c.length,
|
|
1044
|
+
rowPadding: l + $,
|
|
1045
|
+
style: (y, p) => i(y, y.disabled ? "disabled" : p ? "active" : "inactive")
|
|
1000
1046
|
}).join(`
|
|
1001
|
-
${
|
|
1002
|
-
${
|
|
1047
|
+
${c}`)}
|
|
1048
|
+
${a}
|
|
1003
1049
|
`;
|
|
1004
1050
|
}
|
|
1005
1051
|
}
|
|
1006
1052
|
}
|
|
1007
1053
|
}).prompt();
|
|
1008
|
-
},
|
|
1009
|
-
message: async (e, { symbol:
|
|
1010
|
-
process.stdout.write(`${styleText("gray",
|
|
1011
|
-
${
|
|
1054
|
+
}, je = `${styleText("gray", d)} `, K = {
|
|
1055
|
+
message: async (e, { symbol: i = styleText("gray", d) } = {}) => {
|
|
1056
|
+
process.stdout.write(`${styleText("gray", d)}
|
|
1057
|
+
${i} `);
|
|
1012
1058
|
let s = 3;
|
|
1013
|
-
for await (let
|
|
1014
|
-
|
|
1015
|
-
${
|
|
1016
|
-
`) && (s = 3 + stripVTControlCharacters(
|
|
1059
|
+
for await (let r of e) {
|
|
1060
|
+
r = r.replace(/\n/g, `
|
|
1061
|
+
${je}`), r.includes(`
|
|
1062
|
+
`) && (s = 3 + stripVTControlCharacters(r.slice(r.lastIndexOf(`
|
|
1017
1063
|
`))).length);
|
|
1018
|
-
const
|
|
1019
|
-
s +
|
|
1020
|
-
${
|
|
1064
|
+
const u = stripVTControlCharacters(r).length;
|
|
1065
|
+
s + u < process.stdout.columns ? (s += u, process.stdout.write(r)) : (process.stdout.write(`
|
|
1066
|
+
${je}${r.trimStart()}`), s = 3 + stripVTControlCharacters(r.trimStart()).length);
|
|
1021
1067
|
}
|
|
1022
1068
|
process.stdout.write(`
|
|
1023
1069
|
`);
|
|
1024
1070
|
},
|
|
1025
|
-
info: (e) => K.message(e, { symbol: styleText("blue",
|
|
1026
|
-
success: (e) => K.message(e, { symbol: styleText("green",
|
|
1027
|
-
step: (e) => K.message(e, { symbol: styleText("green",
|
|
1028
|
-
warn: (e) => K.message(e, { symbol: styleText("yellow",
|
|
1071
|
+
info: (e) => K.message(e, { symbol: styleText("blue", he) }),
|
|
1072
|
+
success: (e) => K.message(e, { symbol: styleText("green", pe) }),
|
|
1073
|
+
step: (e) => K.message(e, { symbol: styleText("green", F) }),
|
|
1074
|
+
warn: (e) => K.message(e, { symbol: styleText("yellow", me) }),
|
|
1029
1075
|
warning: (e) => K.warn(e),
|
|
1030
|
-
error: (e) => K.message(e, { symbol: styleText("red",
|
|
1031
|
-
},
|
|
1076
|
+
error: (e) => K.message(e, { symbol: styleText("red", ge) })
|
|
1077
|
+
}, Ot = (e) => new at$1({
|
|
1032
1078
|
validate: e.validate,
|
|
1033
1079
|
placeholder: e.placeholder,
|
|
1034
1080
|
defaultValue: e.defaultValue,
|
|
@@ -1037,28 +1083,28 @@ ${Qe}${i.trimStart()}`), s = 3 + stripVTControlCharacters(i.trimStart()).length)
|
|
|
1037
1083
|
signal: e.signal,
|
|
1038
1084
|
input: e.input,
|
|
1039
1085
|
render() {
|
|
1040
|
-
const
|
|
1041
|
-
` : ""}${
|
|
1042
|
-
`,
|
|
1086
|
+
const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${styleText("gray", d)}
|
|
1087
|
+
` : ""}${V(this.state)} `}${e.message}
|
|
1088
|
+
`, 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 ?? "";
|
|
1043
1089
|
switch (this.state) {
|
|
1044
1090
|
case "error": {
|
|
1045
|
-
const
|
|
1091
|
+
const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", d)} ` : "", a = i ? styleText("yellow", E) : "";
|
|
1046
1092
|
return `${s.trim()}
|
|
1047
|
-
${
|
|
1048
|
-
${
|
|
1093
|
+
${c}${u$13}
|
|
1094
|
+
${a}${o}
|
|
1049
1095
|
`;
|
|
1050
1096
|
}
|
|
1051
1097
|
case "submit": {
|
|
1052
|
-
const
|
|
1053
|
-
return `${s}${
|
|
1098
|
+
const o = n ? ` ${styleText("dim", n)}` : "";
|
|
1099
|
+
return `${s}${i ? styleText("gray", d) : ""}${o}`;
|
|
1054
1100
|
}
|
|
1055
1101
|
case "cancel": {
|
|
1056
|
-
const
|
|
1057
|
-
return `${s}${
|
|
1058
|
-
${
|
|
1102
|
+
const o = n ? ` ${styleText(["strikethrough", "dim"], n)}` : "", c = i ? styleText("gray", d) : "";
|
|
1103
|
+
return `${s}${c}${o}${n.trim() ? `
|
|
1104
|
+
${c}` : ""}`;
|
|
1059
1105
|
}
|
|
1060
|
-
default: return `${s}${
|
|
1061
|
-
${
|
|
1106
|
+
default: return `${s}${i ? `${styleText("cyan", d)} ` : ""}${u$13}
|
|
1107
|
+
${i ? styleText("cyan", E) : ""}
|
|
1062
1108
|
`;
|
|
1063
1109
|
}
|
|
1064
1110
|
}
|
|
@@ -2412,7 +2458,7 @@ function getPackageManagerOptions(preferred) {
|
|
|
2412
2458
|
//#endregion
|
|
2413
2459
|
//#region package.json
|
|
2414
2460
|
var name = "create-vue";
|
|
2415
|
-
var version = "3.22.
|
|
2461
|
+
var version = "3.22.3";
|
|
2416
2462
|
//#endregion
|
|
2417
2463
|
//#region index.ts
|
|
2418
2464
|
const language = await getLanguage(fileURLToPath(new URL("./locales", import.meta.url)));
|
|
@@ -2495,8 +2541,8 @@ function emptyDir(dir) {
|
|
|
2495
2541
|
}
|
|
2496
2542
|
async function unwrapPrompt(maybeCancelPromise) {
|
|
2497
2543
|
const result = await maybeCancelPromise;
|
|
2498
|
-
if (
|
|
2499
|
-
|
|
2544
|
+
if (q(result)) {
|
|
2545
|
+
pt((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
|
|
2500
2546
|
process.exit(0);
|
|
2501
2547
|
}
|
|
2502
2548
|
return result;
|
|
@@ -2593,41 +2639,41 @@ async function init() {
|
|
|
2593
2639
|
experimentFeatures: [],
|
|
2594
2640
|
needsBareboneTemplates: false
|
|
2595
2641
|
};
|
|
2596
|
-
|
|
2597
|
-
if (!targetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(
|
|
2642
|
+
mt(process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner);
|
|
2643
|
+
if (!targetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(Ot({
|
|
2598
2644
|
message: language.projectName.message,
|
|
2599
2645
|
placeholder: defaultProjectName,
|
|
2600
2646
|
defaultValue: defaultProjectName,
|
|
2601
2647
|
validate: (value) => !value || value.trim().length > 0 ? void 0 : language.projectName.invalidMessage
|
|
2602
2648
|
})))?.trim() || defaultProjectName;
|
|
2603
2649
|
if (!canSkipEmptying(targetDir) && !forceOverwrite) {
|
|
2604
|
-
result.shouldOverwrite = await unwrapPrompt(
|
|
2650
|
+
result.shouldOverwrite = await unwrapPrompt(ot({
|
|
2605
2651
|
message: `${targetDir === "." ? language.shouldOverwrite.dirForPrompts.current : `${language.shouldOverwrite.dirForPrompts.target} "${targetDir}"`} ${language.shouldOverwrite.message}`,
|
|
2606
2652
|
initialValue: false
|
|
2607
2653
|
}));
|
|
2608
2654
|
if (!result.shouldOverwrite) {
|
|
2609
|
-
|
|
2655
|
+
pt((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
|
|
2610
2656
|
process.exit(0);
|
|
2611
2657
|
}
|
|
2612
2658
|
}
|
|
2613
|
-
if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(
|
|
2659
|
+
if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(Ot({
|
|
2614
2660
|
message: language.packageName.message,
|
|
2615
2661
|
initialValue: toValidPackageName(targetDir),
|
|
2616
2662
|
validate: (value) => isValidPackageName(value) ? void 0 : language.packageName.invalidMessage
|
|
2617
2663
|
}));
|
|
2618
2664
|
if (!isFeatureFlagsUsed) {
|
|
2619
|
-
result.needsTypeScript = await unwrapPrompt(
|
|
2665
|
+
result.needsTypeScript = await unwrapPrompt(ot({
|
|
2620
2666
|
message: language.needsTypeScript.message,
|
|
2621
2667
|
initialValue: true
|
|
2622
2668
|
}));
|
|
2623
|
-
result.features = await unwrapPrompt(
|
|
2669
|
+
result.features = await unwrapPrompt(yt({
|
|
2624
2670
|
message: `${language.featureSelection.message} ${(0, import_picocolors.dim)(language.featureSelection.hint)}`,
|
|
2625
2671
|
options: FEATURE_OPTIONS,
|
|
2626
2672
|
required: false
|
|
2627
2673
|
}));
|
|
2628
2674
|
if (result.features.includes("e2e")) {
|
|
2629
2675
|
const hasVitest = result.features.includes("vitest");
|
|
2630
|
-
result.e2eFramework = await unwrapPrompt(
|
|
2676
|
+
result.e2eFramework = await unwrapPrompt(_t({
|
|
2631
2677
|
message: `${language.e2eSelection.message} ${(0, import_picocolors.dim)(language.e2eSelection.hint)}`,
|
|
2632
2678
|
options: [{
|
|
2633
2679
|
value: "playwright",
|
|
@@ -2640,7 +2686,7 @@ async function init() {
|
|
|
2640
2686
|
}]
|
|
2641
2687
|
}));
|
|
2642
2688
|
}
|
|
2643
|
-
result.experimentFeatures = await unwrapPrompt(
|
|
2689
|
+
result.experimentFeatures = await unwrapPrompt(yt({
|
|
2644
2690
|
message: `${language.needsExperimentalFeatures.message} ${(0, import_picocolors.dim)(language.needsExperimentalFeatures.hint)}`,
|
|
2645
2691
|
options: EXPERIMENTAL_FEATURE_OPTIONS,
|
|
2646
2692
|
required: false
|
|
@@ -2650,14 +2696,14 @@ async function init() {
|
|
|
2650
2696
|
value: pm,
|
|
2651
2697
|
label: pm
|
|
2652
2698
|
}));
|
|
2653
|
-
result.packageManager = await unwrapPrompt(
|
|
2699
|
+
result.packageManager = await unwrapPrompt(_t({
|
|
2654
2700
|
message: `${language.packageManagerSelection.message} ${(0, import_picocolors.dim)(language.packageManagerSelection.hint)}`,
|
|
2655
2701
|
options: packageManagerOptions
|
|
2656
2702
|
}));
|
|
2657
2703
|
}
|
|
2658
2704
|
}
|
|
2659
2705
|
if (argv.bare) result.needsBareboneTemplates = true;
|
|
2660
|
-
else if (!isFeatureFlagsUsed) result.needsBareboneTemplates = await unwrapPrompt(
|
|
2706
|
+
else if (!isFeatureFlagsUsed) result.needsBareboneTemplates = await unwrapPrompt(ot({
|
|
2661
2707
|
message: language.needsBareboneTemplates.message,
|
|
2662
2708
|
initialValue: false
|
|
2663
2709
|
}));
|
|
@@ -2806,7 +2852,7 @@ async function init() {
|
|
|
2806
2852
|
${(0, import_picocolors.dim)("|")} ${language.infos.optionalGitCommand}
|
|
2807
2853
|
|
|
2808
2854
|
${(0, import_picocolors.bold)((0, import_picocolors.green)("git init && git add -A && git commit -m \"initial commit\""))}`;
|
|
2809
|
-
|
|
2855
|
+
gt(outroMessage);
|
|
2810
2856
|
}
|
|
2811
2857
|
init().catch((e) => {
|
|
2812
2858
|
console.error(e);
|