vite-plus 0.1.21-alpha.3 → 0.1.21-alpha.5

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.
@@ -1,6 +1,6 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "./chunk-q7NCDQ7-.js";
2
2
  import { c as VITE_PLUS_VERSION, i as BASEURL_TSCONFIG_WARNING, l as isForceOverrideMode, o as VITE_PLUS_NAME, s as VITE_PLUS_OVERRIDE_PACKAGES } from "./main-A6UrSTYb.js";
3
- import { a as runCommandSilently, n as hasBaseUrlInTsconfig, o as require_cross_spawn, r as removeDeprecatedTsconfigFalseOption, t as findTsconfigFiles } from "./tsconfig-BQeK6Jxp.js";
3
+ import { i as rewriteTypesInTsconfig, n as hasBaseUrlInTsconfig, o as runCommandSilently, r as removeDeprecatedTsconfigFalseOption, s as require_cross_spawn, t as findTsconfigFiles } from "./tsconfig-lBAWm4sf.js";
4
4
  import { t as accent } from "./terminal-CxTMfsxZ.js";
5
5
  import { t as require_dist } from "./dist-DjG9AYbK.js";
6
6
  import { c as editJsonFile, l as isJsonFile, n as detectPackageMetadata, u as readJsonFile } from "./package-CrKanQYM.js";
@@ -10,24 +10,31 @@ import { downloadPackageManager, mergeJsonConfig, mergeTsdownConfig, rewriteEsli
10
10
  import fs from "node:fs";
11
11
  import { styleText } from "node:util";
12
12
  import process$1, { stdin, stdout } from "node:process";
13
- import * as _ from "node:readline";
14
- import P from "node:readline";
13
+ import * as b from "node:readline";
14
+ import l from "node:readline";
15
15
  import { ReadStream } from "node:tty";
16
16
  import fsPromises from "node:fs/promises";
17
- //#region ../../node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
18
- const isAmbiguous$1 = (x) => {
19
- 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;
20
- };
17
+ //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
18
+ const getCodePointsLength = (() => {
19
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
20
+ return (input) => {
21
+ let surrogatePairsNr = 0;
22
+ SURROGATE_PAIR_RE.lastIndex = 0;
23
+ while (SURROGATE_PAIR_RE.test(input)) surrogatePairsNr += 1;
24
+ return input.length - surrogatePairsNr;
25
+ };
26
+ })();
21
27
  const isFullWidth$1 = (x) => {
22
28
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
23
29
  };
24
- const isWide$1 = (x) => {
25
- 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;
30
+ const isWideNotCJKTNotEmoji = (x) => {
31
+ 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;
26
32
  };
27
33
  //#endregion
28
- //#region ../../node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
29
- const ANSI_RE$1 = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
34
+ //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
35
+ const ANSI_RE$1 = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
30
36
  const CONTROL_RE$1 = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
37
+ 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;
31
38
  const TAB_RE$1 = /\t{1,1000}/y;
32
39
  const EMOJI_RE$1 = /[\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;
33
40
  const LATIN_RE$1 = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -40,14 +47,21 @@ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions =
40
47
  const LIMIT = truncationOptions.limit ?? Infinity;
41
48
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
42
49
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth$1(ELLIPSIS, NO_TRUNCATION$3, widthOptions).width : 0);
43
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
50
+ const ANSI_WIDTH = 0;
44
51
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
45
52
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
46
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
47
53
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
48
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
54
+ const FULL_WIDTH_WIDTH = 2;
49
55
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
50
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
56
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
57
+ const PARSE_BLOCKS = [
58
+ [LATIN_RE$1, REGULAR_WIDTH],
59
+ [ANSI_RE$1, ANSI_WIDTH],
60
+ [CONTROL_RE$1, CONTROL_WIDTH],
61
+ [TAB_RE$1, TAB_WIDTH],
62
+ [EMOJI_RE$1, EMOJI_WIDTH],
63
+ [CJKT_WIDE_RE, WIDE_WIDTH]
64
+ ];
51
65
  let indexPrev = 0;
52
66
  let index = 0;
53
67
  let length = input.length;
@@ -66,8 +80,7 @@ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions =
66
80
  for (const char of unmatched.replaceAll(MODIFIER_RE$1, "")) {
67
81
  const codePoint = char.codePointAt(0) || 0;
68
82
  if (isFullWidth$1(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
69
- else if (isWide$1(codePoint)) widthExtra = WIDE_WIDTH;
70
- else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous$1(codePoint)) widthExtra = AMBIGUOUS_WIDTH;
83
+ else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
71
84
  else widthExtra = REGULAR_WIDTH;
72
85
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
73
86
  if (width + widthExtra > LIMIT) {
@@ -79,77 +92,24 @@ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions =
79
92
  }
80
93
  unmatchedStart = unmatchedEnd = 0;
81
94
  }
82
- if (index >= length) break;
83
- LATIN_RE$1.lastIndex = index;
84
- if (LATIN_RE$1.test(input)) {
85
- lengthExtra = LATIN_RE$1.lastIndex - index;
86
- widthExtra = lengthExtra * REGULAR_WIDTH;
87
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
88
- if (width + widthExtra > LIMIT) {
89
- truncationEnabled = true;
90
- break;
91
- }
92
- width += widthExtra;
93
- unmatchedStart = indexPrev;
94
- unmatchedEnd = index;
95
- index = indexPrev = LATIN_RE$1.lastIndex;
96
- continue;
97
- }
98
- ANSI_RE$1.lastIndex = index;
99
- if (ANSI_RE$1.test(input)) {
100
- if (width + ANSI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
101
- if (width + ANSI_WIDTH > LIMIT) {
102
- truncationEnabled = true;
103
- break;
104
- }
105
- width += ANSI_WIDTH;
106
- unmatchedStart = indexPrev;
107
- unmatchedEnd = index;
108
- index = indexPrev = ANSI_RE$1.lastIndex;
109
- continue;
110
- }
111
- CONTROL_RE$1.lastIndex = index;
112
- if (CONTROL_RE$1.test(input)) {
113
- lengthExtra = CONTROL_RE$1.lastIndex - index;
114
- widthExtra = lengthExtra * CONTROL_WIDTH;
115
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
116
- if (width + widthExtra > LIMIT) {
117
- truncationEnabled = true;
118
- break;
119
- }
120
- width += widthExtra;
121
- unmatchedStart = indexPrev;
122
- unmatchedEnd = index;
123
- index = indexPrev = CONTROL_RE$1.lastIndex;
124
- continue;
125
- }
126
- TAB_RE$1.lastIndex = index;
127
- if (TAB_RE$1.test(input)) {
128
- lengthExtra = TAB_RE$1.lastIndex - index;
129
- widthExtra = lengthExtra * TAB_WIDTH;
130
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
131
- if (width + widthExtra > LIMIT) {
132
- truncationEnabled = true;
133
- break;
134
- }
135
- width += widthExtra;
136
- unmatchedStart = indexPrev;
137
- unmatchedEnd = index;
138
- index = indexPrev = TAB_RE$1.lastIndex;
139
- continue;
140
- }
141
- EMOJI_RE$1.lastIndex = index;
142
- if (EMOJI_RE$1.test(input)) {
143
- if (width + EMOJI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
144
- if (width + EMOJI_WIDTH > LIMIT) {
145
- truncationEnabled = true;
146
- break;
95
+ if (index >= length) break outer;
96
+ for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
97
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
98
+ BLOCK_RE.lastIndex = index;
99
+ if (BLOCK_RE.test(input)) {
100
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE$1 ? 1 : BLOCK_RE.lastIndex - index;
101
+ widthExtra = lengthExtra * BLOCK_WIDTH;
102
+ if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
103
+ if (width + widthExtra > LIMIT) {
104
+ truncationEnabled = true;
105
+ break outer;
106
+ }
107
+ width += widthExtra;
108
+ unmatchedStart = indexPrev;
109
+ unmatchedEnd = index;
110
+ index = indexPrev = BLOCK_RE.lastIndex;
111
+ continue outer;
147
112
  }
148
- width += EMOJI_WIDTH;
149
- unmatchedStart = indexPrev;
150
- unmatchedEnd = index;
151
- index = indexPrev = EMOJI_RE$1.lastIndex;
152
- continue;
153
113
  }
154
114
  index += 1;
155
115
  }
@@ -161,7 +121,7 @@ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions =
161
121
  };
162
122
  };
163
123
  //#endregion
164
- //#region ../../node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
124
+ //#region ../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
165
125
  const NO_TRUNCATION$2 = {
166
126
  limit: Infinity,
167
127
  ellipsis: "",
@@ -171,7 +131,7 @@ const fastStringWidth$1 = (input, options = {}) => {
171
131
  return getStringTruncatedWidth$1(input, NO_TRUNCATION$2, options).width;
172
132
  };
173
133
  //#endregion
174
- //#region ../../node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
134
+ //#region ../../node_modules/.pnpm/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js
175
135
  const ESC$1 = "\x1B";
176
136
  const CSI$1 = "›";
177
137
  const END_CODE$1 = 39;
@@ -308,8 +268,10 @@ const exec$1 = (string, columns, options = {}) => {
308
268
  for (let i = 0; i < preString.length; i++) {
309
269
  const character = preString[i];
310
270
  returnValue += character;
311
- if (!inSurrogate) inSurrogate = character >= "\ud800" && character <= "\udbff";
312
- else continue;
271
+ if (!inSurrogate) {
272
+ inSurrogate = character >= "\ud800" && character <= "\udbff";
273
+ if (inSurrogate) continue;
274
+ } else inSurrogate = false;
313
275
  if (character === ESC$1 || character === CSI$1) {
314
276
  GROUP_REGEX$1.lastIndex = i + 1;
315
277
  const groups = GROUP_REGEX$1.exec(preString)?.groups;
@@ -334,7 +296,7 @@ function wrapAnsi$1(string, columns, options) {
334
296
  return String(string).normalize().split(CRLF_OR_LF$1).map((line) => exec$1(line, columns, options)).join("\n");
335
297
  }
336
298
  //#endregion
337
- //#region ../../node_modules/.pnpm/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
299
+ //#region ../../node_modules/.pnpm/@clack+core@1.3.0/node_modules/@clack/core/dist/index.mjs
338
300
  var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
339
301
  const ESC = "\x1B";
340
302
  const CSI = `${ESC}[`;
@@ -387,12 +349,12 @@ var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
387
349
  beep
388
350
  };
389
351
  })))();
390
- function d(r, t, e) {
391
- if (!e.some((o) => !o.disabled)) return r;
392
- const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
393
- return e[n].disabled ? d(n, t < 0 ? -1 : 1, e) : n;
352
+ function d(r, t, s) {
353
+ if (!s.some((o) => !o.disabled)) return r;
354
+ const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
355
+ return s[n].disabled ? d(n, t < 0 ? -1 : 1, s) : n;
394
356
  }
395
- const u = {
357
+ const h = {
396
358
  actions: new Set([
397
359
  "up",
398
360
  "down",
@@ -439,68 +401,71 @@ const u = {
439
401
  }
440
402
  }
441
403
  };
442
- function V(r, t) {
443
- if (typeof r == "string") return u.aliases.get(r) === t;
444
- for (const e of r) if (e !== void 0 && V(e, t)) return !0;
404
+ function C(r, t) {
405
+ if (typeof r == "string") return h.aliases.get(r) === t;
406
+ for (const s of r) if (s !== void 0 && C(s, t)) return !0;
445
407
  return !1;
446
408
  }
447
- function j(r, t) {
409
+ function z(r, t) {
448
410
  if (r === t) return;
449
- const e = r.split(`
450
- `), s = t.split(`
451
- `), i = Math.max(e.length, s.length), n = [];
452
- for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
411
+ const s = r.split(`
412
+ `), e = t.split(`
413
+ `), i = Math.max(s.length, e.length), n = [];
414
+ for (let o = 0; o < i; o++) s[o] !== e[o] && n.push(o);
453
415
  return {
454
416
  lines: n,
455
- numLinesBefore: e.length,
456
- numLinesAfter: s.length,
417
+ numLinesBefore: s.length,
418
+ numLinesAfter: e.length,
457
419
  numLines: i
458
420
  };
459
421
  }
460
- const Y = globalThis.process.platform.startsWith("win"), C = Symbol("clack:cancel");
422
+ const Y = globalThis.process.platform.startsWith("win"), k = Symbol("clack:cancel");
461
423
  function q(r) {
462
- return r === C;
424
+ return r === k;
463
425
  }
464
426
  function w(r, t) {
465
- const e = r;
466
- e.isTTY && e.setRawMode(t);
427
+ const s = r;
428
+ s.isTTY && s.setRawMode(t);
467
429
  }
468
- function z({ input: r = stdin, output: t = stdout, overwrite: e = !0, hideCursor: s = !0 } = {}) {
469
- const i = _.createInterface({
430
+ function R({ input: r = stdin, output: t = stdout, overwrite: s = !0, hideCursor: e = !0 } = {}) {
431
+ const i = b.createInterface({
470
432
  input: r,
471
433
  output: t,
472
434
  prompt: "",
473
435
  tabSize: 1
474
436
  });
475
- _.emitKeypressEvents(r, i), r instanceof ReadStream && r.isTTY && r.setRawMode(!0);
476
- const n = (o, { name: a, sequence: h }) => {
477
- if (V([
437
+ b.emitKeypressEvents(r, i), r instanceof ReadStream && r.isTTY && r.setRawMode(!0);
438
+ const n = (o, { name: u, sequence: a }) => {
439
+ if (C([
478
440
  String(o),
479
- a,
480
- h
441
+ u,
442
+ a
481
443
  ], "cancel")) {
482
- s && t.write(import_src.cursor.show), process.exit(0);
444
+ e && t.write(import_src.cursor.show), process.exit(0);
483
445
  return;
484
446
  }
485
- if (!e) return;
486
- const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
487
- _.moveCursor(t, f, v, () => {
488
- _.clearLine(t, 1, () => {
447
+ if (!s) return;
448
+ const f = u === "return" ? 0 : -1, y = u === "return" ? -1 : 0;
449
+ b.moveCursor(t, f, y, () => {
450
+ b.clearLine(t, 1, () => {
489
451
  r.once("keypress", n);
490
452
  });
491
453
  });
492
454
  };
493
- return s && t.write(import_src.cursor.hide), r.once("keypress", n), () => {
494
- r.off("keypress", n), s && t.write(import_src.cursor.show), r instanceof ReadStream && r.isTTY && !Y && r.setRawMode(!1), i.terminal = !1, i.close();
455
+ return e && t.write(import_src.cursor.hide), r.once("keypress", n), () => {
456
+ r.off("keypress", n), e && t.write(import_src.cursor.show), r instanceof ReadStream && r.isTTY && !Y && r.setRawMode(!1), i.terminal = !1, i.close();
495
457
  };
496
458
  }
497
- const O = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80, A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
498
- function R(r, t, e, s = e) {
499
- return wrapAnsi$1(t, O(r ?? stdout) - e.length, {
459
+ const A = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80, L = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
460
+ function W(r, t, s, e = s, i) {
461
+ return wrapAnsi$1(t, A(r ?? stdout) - s.length, {
500
462
  hard: !0,
501
463
  trim: !1
502
464
  }).split(`
503
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
465
+ `).map((o, u) => {
466
+ const a = i ? i(o, u) : o;
467
+ return `${u === 0 ? e : s}${a}`;
468
+ }).join(`
504
469
  `);
505
470
  }
506
471
  let p = class {
@@ -518,40 +483,40 @@ let p = class {
518
483
  error = "";
519
484
  value;
520
485
  userInput = "";
521
- constructor(t, e = !0) {
522
- const { input: s = stdin, output: i = stdout, render: n, signal: o, ...a } = t;
523
- 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;
486
+ constructor(t, s = !0) {
487
+ const { input: e = stdin, output: i = stdout, render: n, signal: o, ...u } = t;
488
+ this.opts = u, 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 = s, this._abortSignal = o, this.input = e, this.output = i;
524
489
  }
525
490
  unsubscribe() {
526
491
  this._subscribers.clear();
527
492
  }
528
- setSubscriber(t, e) {
529
- const s = this._subscribers.get(t) ?? [];
530
- s.push(e), this._subscribers.set(t, s);
493
+ setSubscriber(t, s) {
494
+ const e = this._subscribers.get(t) ?? [];
495
+ e.push(s), this._subscribers.set(t, e);
531
496
  }
532
- on(t, e) {
533
- this.setSubscriber(t, { cb: e });
497
+ on(t, s) {
498
+ this.setSubscriber(t, { cb: s });
534
499
  }
535
- once(t, e) {
500
+ once(t, s) {
536
501
  this.setSubscriber(t, {
537
- cb: e,
502
+ cb: s,
538
503
  once: !0
539
504
  });
540
505
  }
541
- emit(t, ...e) {
542
- const s = this._subscribers.get(t) ?? [], i = [];
543
- for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
506
+ emit(t, ...s) {
507
+ const e = this._subscribers.get(t) ?? [], i = [];
508
+ for (const n of e) n.cb(...s), n.once && i.push(() => e.splice(e.indexOf(n), 1));
544
509
  for (const n of i) n();
545
510
  }
546
511
  prompt() {
547
512
  return new Promise((t) => {
548
513
  if (this._abortSignal) {
549
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(C);
514
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(k);
550
515
  this._abortSignal.addEventListener("abort", () => {
551
516
  this.state = "cancel", this.close();
552
517
  }, { once: !0 });
553
518
  }
554
- this.rl = P.createInterface({
519
+ this.rl = l.createInterface({
555
520
  input: this.input,
556
521
  tabSize: 2,
557
522
  prompt: "",
@@ -560,18 +525,21 @@ let p = class {
560
525
  }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), w(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
561
526
  this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(this.value);
562
527
  }), this.once("cancel", () => {
563
- this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(C);
528
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(k);
564
529
  });
565
530
  });
566
531
  }
567
- _isActionKey(t, e) {
532
+ _isActionKey(t, s) {
568
533
  return t === " ";
569
534
  }
535
+ _shouldSubmit(t, s) {
536
+ return !0;
537
+ }
570
538
  _setValue(t) {
571
539
  this.value = t, this.emit("value", this.value);
572
540
  }
573
- _setUserInput(t, e) {
574
- this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
541
+ _setUserInput(t, s) {
542
+ this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
575
543
  }
576
544
  _clearUserInput() {
577
545
  this.rl?.write(null, {
@@ -579,21 +547,21 @@ let p = class {
579
547
  name: "u"
580
548
  }), this._setUserInput("");
581
549
  }
582
- onKeypress(t, e) {
583
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
550
+ onKeypress(t, s) {
551
+ if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, {
584
552
  ctrl: !0,
585
553
  name: "h"
586
- }), 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") {
554
+ }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), s), s?.name === "return" && this._shouldSubmit(t, s)) {
587
555
  if (this.opts.validate) {
588
- const s = this.opts.validate(this.value);
589
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
556
+ const e = this.opts.validate(this.value);
557
+ e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
590
558
  }
591
559
  this.state !== "error" && (this.state = "submit");
592
560
  }
593
- V([
561
+ C([
594
562
  t,
595
- e?.name,
596
- e?.sequence
563
+ s?.name,
564
+ s?.sequence
597
565
  ], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
598
566
  }
599
567
  close() {
@@ -616,30 +584,30 @@ let p = class {
616
584
  if (t !== this._prevFrame) {
617
585
  if (this.state === "initial") this.output.write(import_src.cursor.hide);
618
586
  else {
619
- const e = j(this._prevFrame, t), s = A(this.output);
620
- if (this.restoreCursor(), e) {
621
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
622
- let o = e.lines.find((a) => a >= i);
587
+ const s = z(this._prevFrame, t), e = L(this.output);
588
+ if (this.restoreCursor(), s) {
589
+ const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
590
+ let o = s.lines.find((u) => u >= i);
623
591
  if (o === void 0) {
624
592
  this._prevFrame = t;
625
593
  return;
626
594
  }
627
- if (e.lines.length === 1) {
595
+ if (s.lines.length === 1) {
628
596
  this.output.write(import_src.cursor.move(0, o - n)), this.output.write(import_src.erase.lines(1));
629
- const a = t.split(`
597
+ const u = t.split(`
630
598
  `);
631
- this.output.write(a[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, a.length - o - 1));
599
+ this.output.write(u[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, u.length - o - 1));
632
600
  return;
633
- } else if (e.lines.length > 1) {
601
+ } else if (s.lines.length > 1) {
634
602
  if (i < n) o = i;
635
603
  else {
636
- const h = o - n;
637
- h > 0 && this.output.write(import_src.cursor.move(0, h));
604
+ const a = o - n;
605
+ a > 0 && this.output.write(import_src.cursor.move(0, a));
638
606
  }
639
607
  this.output.write(import_src.erase.down());
640
- const a = t.split(`
608
+ const u = t.split(`
641
609
  `).slice(o);
642
- this.output.write(a.join(`
610
+ this.output.write(u.join(`
643
611
  `)), this._prevFrame = t;
644
612
  return;
645
613
  }
@@ -650,7 +618,7 @@ let p = class {
650
618
  }
651
619
  }
652
620
  };
653
- var Q = class extends p {
621
+ var X = class extends p {
654
622
  get cursor() {
655
623
  return this.value ? 0 : 1;
656
624
  }
@@ -660,14 +628,14 @@ var Q = class extends p {
660
628
  constructor(t) {
661
629
  super(t, !1), this.value = !!t.initialValue, this.on("userInput", () => {
662
630
  this.value = this._value;
663
- }), this.on("confirm", (e) => {
664
- this.output.write(import_src.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
631
+ }), this.on("confirm", (s) => {
632
+ this.output.write(import_src.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
665
633
  }), this.on("cursor", () => {
666
634
  this.value = !this.value;
667
635
  });
668
636
  }
669
637
  };
670
- let it = class extends p {
638
+ let nt = class extends p {
671
639
  options;
672
640
  cursor = 0;
673
641
  get _value() {
@@ -677,27 +645,27 @@ let it = class extends p {
677
645
  return this.options.filter((t) => t.disabled !== !0);
678
646
  }
679
647
  toggleAll() {
680
- const t = this._enabledOptions, e = this.value !== void 0 && this.value.length === t.length;
681
- this.value = e ? [] : t.map((s) => s.value);
648
+ const t = this._enabledOptions, s = this.value !== void 0 && this.value.length === t.length;
649
+ this.value = s ? [] : t.map((e) => e.value);
682
650
  }
683
651
  toggleInvert() {
684
652
  const t = this.value;
685
653
  if (!t) return;
686
- const e = this._enabledOptions.filter((s) => !t.includes(s.value));
687
- this.value = e.map((s) => s.value);
654
+ const s = this._enabledOptions.filter((e) => !t.includes(e.value));
655
+ this.value = s.map((e) => e.value);
688
656
  }
689
657
  toggleValue() {
690
658
  this.value === void 0 && (this.value = []);
691
659
  const t = this.value.includes(this._value);
692
- this.value = t ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
660
+ this.value = t ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
693
661
  }
694
662
  constructor(t) {
695
663
  super(t, !1), this.options = t.options, this.value = [...t.initialValues ?? []];
696
- const e = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), 0);
697
- this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.on("key", (s) => {
698
- s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
699
- }), this.on("cursor", (s) => {
700
- switch (s) {
664
+ const s = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), 0);
665
+ this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.on("key", (e) => {
666
+ e === "a" && this.toggleAll(), e === "i" && this.toggleInvert();
667
+ }), this.on("cursor", (e) => {
668
+ switch (e) {
701
669
  case "left":
702
670
  case "up":
703
671
  this.cursor = d(this.cursor, -1, this.options);
@@ -713,7 +681,7 @@ let it = class extends p {
713
681
  });
714
682
  }
715
683
  };
716
- var nt = class extends p {
684
+ var ut = class extends p {
717
685
  options;
718
686
  cursor = 0;
719
687
  get _selectedValue() {
@@ -724,8 +692,8 @@ var nt = class extends p {
724
692
  }
725
693
  constructor(t) {
726
694
  super(t, !1), this.options = t.options;
727
- const e = this.options.findIndex(({ value: i }) => i === t.initialValue), s = e === -1 ? 0 : e;
728
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
695
+ const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e = s === -1 ? 0 : s;
696
+ this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i) => {
729
697
  switch (i) {
730
698
  case "left":
731
699
  case "up":
@@ -740,13 +708,13 @@ var nt = class extends p {
740
708
  });
741
709
  }
742
710
  };
743
- var at = class extends p {
711
+ var ht = class extends p {
744
712
  get userInputWithCursor() {
745
713
  if (this.state === "submit") return this.userInput;
746
714
  const t = this.userInput;
747
715
  if (this.cursor >= t.length) return `${this.userInput}\u2588`;
748
- const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
749
- return `${e}${styleText("inverse", s)}${i.join("")}`;
716
+ const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
717
+ return `${s}${styleText("inverse", e)}${i.join("")}`;
750
718
  }
751
719
  get cursor() {
752
720
  return this._cursor;
@@ -755,8 +723,8 @@ var at = class extends p {
755
723
  super({
756
724
  ...t,
757
725
  initialUserInput: t.initialUserInput ?? t.initialValue
758
- }), this.on("userInput", (e) => {
759
- this._setValue(e);
726
+ }), this.on("userInput", (s) => {
727
+ this._setValue(s);
760
728
  }), this.on("finalize", () => {
761
729
  this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = "");
762
730
  });
@@ -1204,11 +1172,11 @@ const trimLines = (groups, initialLineCount, startIndex, endIndex, maxLines) =>
1204
1172
  const limitOptions = (params) => {
1205
1173
  const { cursor, options, style } = params;
1206
1174
  const output = params.output ?? process.stdout;
1207
- const columns = O(output);
1175
+ const columns = A(output);
1208
1176
  const columnPadding = params.columnPadding ?? 0;
1209
1177
  const rowPadding = params.rowPadding ?? 4;
1210
1178
  const maxWidth = columns - columnPadding;
1211
- const rows = A(output);
1179
+ const rows = L(output);
1212
1180
  const overflowFormat = import_picocolors.default.dim("...");
1213
1181
  const paramMaxItems = params.maxItems ?? Number.POSITIVE_INFINITY;
1214
1182
  const outputMaxItems = Math.max(rows - rowPadding, 0);
@@ -1263,7 +1231,7 @@ const limitOptions = (params) => {
1263
1231
  const confirm = (opts) => {
1264
1232
  const active = opts.active ?? "Yes";
1265
1233
  const inactive = opts.inactive ?? "No";
1266
- return new Q({
1234
+ return new X({
1267
1235
  active,
1268
1236
  inactive,
1269
1237
  signal: opts.signal,
@@ -1373,7 +1341,7 @@ const multiselect = (opts) => {
1373
1341
  };
1374
1342
  const required = opts.required ?? true;
1375
1343
  const hint = " " + import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`));
1376
- return new it({
1344
+ return new nt({
1377
1345
  options: opts.options,
1378
1346
  signal: opts.signal,
1379
1347
  input: opts.input,
@@ -1390,7 +1358,7 @@ const multiselect = (opts) => {
1390
1358
  const formatMessageLines = (message) => {
1391
1359
  return message.split("\n").map((line, index) => `${index === 0 ? `${symbol(this.state)} ` : nestedPrefix}${line}`).join("\n");
1392
1360
  };
1393
- const wrappedMessage = hasGuide ? R(opts.output, opts.message, `${symbolBar(this.state)} `, `${symbol(this.state)} `) : formatMessageLines(opts.message);
1361
+ const wrappedMessage = hasGuide ? W(opts.output, opts.message, `${symbolBar(this.state)} `, `${symbol(this.state)} `) : formatMessageLines(opts.message);
1394
1362
  const title = `${hasGuide ? `${import_picocolors.default.gray(S_BAR)}\n` : ""}${wrappedMessage}\n`;
1395
1363
  const value = this.value ?? [];
1396
1364
  const styleOption = (option, active) => {
@@ -1404,13 +1372,13 @@ const multiselect = (opts) => {
1404
1372
  case "submit": {
1405
1373
  const submitText = this.options.filter(({ value: optionValue }) => value.includes(optionValue)).map((option) => opt(option, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none");
1406
1374
  const submitPrefix = hasGuide ? `${import_picocolors.default.gray(S_BAR)} ` : nestedPrefix;
1407
- return `${title}${R(opts.output, submitText, submitPrefix)}\n`;
1375
+ return `${title}${W(opts.output, submitText, submitPrefix)}\n`;
1408
1376
  }
1409
1377
  case "cancel": {
1410
1378
  const label = this.options.filter(({ value: optionValue }) => value.includes(optionValue)).map((option) => opt(option, "cancelled")).join(import_picocolors.default.dim(", "));
1411
1379
  if (label.trim() === "") return hasGuide ? `${title}${import_picocolors.default.gray(S_BAR)}\n` : `${title.trimEnd()}\n`;
1412
1380
  const cancelPrefix = hasGuide ? `${import_picocolors.default.gray(S_BAR)} ` : nestedPrefix;
1413
- const wrappedLabel = R(opts.output, label, cancelPrefix);
1381
+ const wrappedLabel = W(opts.output, label, cancelPrefix);
1414
1382
  return hasGuide ? `${title}${wrappedLabel}\n${import_picocolors.default.gray(S_BAR)}\n` : `${title}${wrappedLabel}\n`;
1415
1383
  }
1416
1384
  case "error": {
@@ -1476,14 +1444,14 @@ const spinner = ({ indicator = "dots", onCancel, output = process.stdout, cancel
1476
1444
  let _prevMessage;
1477
1445
  let _origin = performance.now();
1478
1446
  let _elapsedMs = 0;
1479
- const columns = O(output);
1447
+ const columns = A(output);
1480
1448
  const styleFn = opts?.styleFrame ?? defaultStyleFn;
1481
1449
  const getElapsedMs = () => {
1482
1450
  if (!isSpinnerActive) return _elapsedMs;
1483
1451
  return _elapsedMs + (performance.now() - _origin);
1484
1452
  };
1485
1453
  const handleExit = (code) => {
1486
- const msg = code > 1 ? errorMessage ?? u.messages.error : cancelMessage ?? u.messages.cancel;
1454
+ const msg = code > 1 ? errorMessage ?? h.messages.error : cancelMessage ?? h.messages.cancel;
1487
1455
  isCancelled = code === 1;
1488
1456
  if (isSpinnerActive) {
1489
1457
  _stop(msg, code);
@@ -1522,7 +1490,7 @@ const spinner = ({ indicator = "dots", onCancel, output = process.stdout, cancel
1522
1490
  const hasGuide = opts.withGuide ?? false;
1523
1491
  const startLoop = () => {
1524
1492
  isSpinnerActive = true;
1525
- unblock = z({ output });
1493
+ unblock = R({ output });
1526
1494
  _origin = performance.now();
1527
1495
  _prevMessage = void 0;
1528
1496
  if (hasGuide) output.write(`${import_picocolors.default.gray(S_BAR)}\n`);
@@ -1623,7 +1591,7 @@ const select = (opts) => {
1623
1591
  default: return withMarker(import_picocolors.default.dim(" "), label, (text) => text, hint);
1624
1592
  }
1625
1593
  };
1626
- return new nt({
1594
+ return new ut({
1627
1595
  options: opts.options,
1628
1596
  signal: opts.signal,
1629
1597
  input: opts.input,
@@ -1636,16 +1604,16 @@ const select = (opts) => {
1636
1604
  return message.split("\n").map((line, index) => `${index === 0 ? `${symbol(this.state)} ` : nestedPrefix}${line}`).join("\n");
1637
1605
  };
1638
1606
  const hasMessage = opts.message.trim().length > 0;
1639
- const messageLines = !hasMessage ? "" : hasGuide ? R(opts.output, opts.message, `${symbolBar(this.state)} `, `${symbol(this.state)} `) : formatMessageLines(opts.message);
1607
+ const messageLines = !hasMessage ? "" : hasGuide ? W(opts.output, opts.message, `${symbolBar(this.state)} `, `${symbol(this.state)} `) : formatMessageLines(opts.message);
1640
1608
  const title = hasMessage ? `${hasGuide ? `${import_picocolors.default.gray(S_BAR)}\n` : ""}${messageLines}\n` : "";
1641
1609
  switch (this.state) {
1642
1610
  case "submit": {
1643
1611
  const submitPrefix = hasGuide ? `${import_picocolors.default.gray(S_BAR)} ` : nestedPrefix;
1644
- return `${title}${R(opts.output, opt(this.options[this.cursor], "selected"), submitPrefix)}\n`;
1612
+ return `${title}${W(opts.output, opt(this.options[this.cursor], "selected"), submitPrefix)}\n`;
1645
1613
  }
1646
1614
  case "cancel": {
1647
1615
  const cancelPrefix = hasGuide ? `${import_picocolors.default.gray(S_BAR)} ` : nestedPrefix;
1648
- return `${title}${R(opts.output, opt(this.options[this.cursor], "cancelled"), cancelPrefix)}${hasGuide ? `\n${import_picocolors.default.gray(S_BAR)}` : ""}\n`;
1616
+ return `${title}${W(opts.output, opt(this.options[this.cursor], "cancelled"), cancelPrefix)}${hasGuide ? `\n${import_picocolors.default.gray(S_BAR)}` : ""}\n`;
1649
1617
  }
1650
1618
  default: {
1651
1619
  const prefix = hasGuide ? `${import_picocolors.default.blue(S_BAR)} ` : nestedPrefix;
@@ -1667,7 +1635,7 @@ const select = (opts) => {
1667
1635
  }).prompt();
1668
1636
  };
1669
1637
  const text = (opts) => {
1670
- return new at({
1638
+ return new ht({
1671
1639
  validate: opts.validate,
1672
1640
  placeholder: opts.placeholder,
1673
1641
  defaultValue: opts.defaultValue,
@@ -3076,6 +3044,20 @@ function displayRelative(to, from = process.cwd()) {
3076
3044
  }
3077
3045
  //#endregion
3078
3046
  //#region src/utils/prompts.ts
3047
+ /**
3048
+ * pnpm v11 promoted `ERR_PNPM_IGNORED_BUILDS` from a warning to a hard
3049
+ * exit-1. Auto-installs run by `vp migrate` / `vp create` happen before the
3050
+ * user has a chance to approve build scripts via `pnpm.onlyBuiltDependencies`,
3051
+ * so transitive deps like `esbuild` would fail the install. Pass
3052
+ * `--ignore-scripts` in that window so the orchestration succeeds; the user's
3053
+ * own subsequent `vp install` keeps default pnpm behavior.
3054
+ */
3055
+ function shouldIgnoreScriptsForAutoInstall(packageManager, packageManagerVersion) {
3056
+ if (packageManager !== PackageManager.pnpm) return false;
3057
+ const coerced = packageManagerVersion ? import_semver.default.coerce(packageManagerVersion)?.version : void 0;
3058
+ if (!coerced) return false;
3059
+ return import_semver.default.gte(coerced, "11.0.0");
3060
+ }
3079
3061
  function cancelAndExit(message = "Operation cancelled", exitCode = 0) {
3080
3062
  cancel(message);
3081
3063
  process.exit(exitCode);
@@ -3117,12 +3099,14 @@ async function runViteInstall(cwd, interactive, extraArgs, options) {
3117
3099
  durationMs: 0,
3118
3100
  status: "skipped"
3119
3101
  };
3102
+ const installArgs = [...extraArgs ?? []];
3103
+ if (shouldIgnoreScriptsForAutoInstall(options?.packageManager, options?.packageManagerVersion) && !installArgs.includes("--ignore-scripts")) installArgs.push("--ignore-scripts");
3120
3104
  const spinner = options?.silent ? getSilentSpinner() : getSpinner(interactive);
3121
3105
  const startTime = Date.now();
3122
3106
  spinner.start(`Installing dependencies...`);
3123
3107
  const { exitCode, stderr, stdout } = await runCommandSilently({
3124
3108
  command: process.env.VP_CLI_BIN ?? "vp",
3125
- args: ["install", ...extraArgs ?? []],
3109
+ args: ["install", ...installArgs],
3126
3110
  cwd,
3127
3111
  envs: process.env
3128
3112
  });
@@ -3738,6 +3722,13 @@ function cleanupDeprecatedTsconfigOptions(projectPath, silent = false, report) {
3738
3722
  warnMigration(`Removed \`"${name}": false\` from ${displayRelative(filePath)} — this option has been deprecated. See https://github.com/oxc-project/tsgolint/issues/351, https://github.com/microsoft/TypeScript/issues/62529`, report);
3739
3723
  }
3740
3724
  }
3725
+ function rewriteTsconfigTypes(projectPath, silent = false, report) {
3726
+ const files = findTsconfigFiles(projectPath);
3727
+ for (const filePath of files) if (rewriteTypesInTsconfig(filePath)) {
3728
+ if (report) report.removedConfigCount++;
3729
+ if (!silent) log.success(`✔ Rewrote types in ${displayRelative(filePath)}`);
3730
+ }
3731
+ }
3741
3732
  const FRAMEWORK_SHIMS = {
3742
3733
  vue: [
3743
3734
  "declare module '*.vue' {",
@@ -3868,6 +3859,7 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
3868
3859
  }
3869
3860
  if (!skipStagedMigration) rewriteLintStagedConfigFile(projectPath, report);
3870
3861
  cleanupDeprecatedTsconfigOptions(projectPath, silent, report);
3862
+ rewriteTsconfigTypes(projectPath, silent, report);
3871
3863
  mergeViteConfigFiles(projectPath, silent, report);
3872
3864
  injectLintTypeCheckDefaults(projectPath, silent, report);
3873
3865
  injectFmtDefaults(projectPath, silent, report);
@@ -3888,6 +3880,7 @@ function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, rep
3888
3880
  for (const pkg of workspaceInfo.packages) rewriteMonorepoProject(path.join(workspaceInfo.rootDir, pkg.path), workspaceInfo.packageManager, skipStagedMigration, silent, report, catalogDependencyResolver);
3889
3881
  if (!skipStagedMigration) rewriteLintStagedConfigFile(workspaceInfo.rootDir, report);
3890
3882
  cleanupDeprecatedTsconfigOptions(workspaceInfo.rootDir, silent, report);
3883
+ rewriteTsconfigTypes(workspaceInfo.rootDir, silent, report);
3891
3884
  mergeViteConfigFiles(workspaceInfo.rootDir, silent, report);
3892
3885
  injectLintTypeCheckDefaults(workspaceInfo.rootDir, silent, report);
3893
3886
  injectFmtDefaults(workspaceInfo.rootDir, silent, report);
@@ -3901,6 +3894,7 @@ function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, rep
3901
3894
  */
3902
3895
  function rewriteMonorepoProject(projectPath, packageManager, skipStagedMigration, silent = false, report, catalogDependencyResolver) {
3903
3896
  cleanupDeprecatedTsconfigOptions(projectPath, silent, report);
3897
+ rewriteTsconfigTypes(projectPath, silent, report);
3904
3898
  mergeViteConfigFiles(projectPath, silent, report);
3905
3899
  mergeTsdownConfigFile(projectPath, silent, report);
3906
3900
  const packageJsonPath = path.join(projectPath, "package.json");