vite-plus 1.2.0 → 1.3.0
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 +29 -0
- package/binding/index.cjs +54 -54
- package/binding/index.d.cts +4 -0
- package/dist/{agent-KeDc6vmg.js → agent-97KmGCyL.js} +4 -4
- package/dist/bin.js +8 -8
- package/dist/{command-CguLh2KL.js → command-CdMBoZFD.js} +13 -13
- package/dist/command-DVTILtS-.js +1 -0
- package/dist/config/bin.js +3 -3
- package/dist/{constants-BW3g7VnD.js → constants-DR55DpRm.js} +2 -2
- package/dist/create/bin.js +28 -13
- package/dist/{define-config-Dq_23Eyr.cjs → define-config-BxDc_9BK.cjs} +2 -2
- package/dist/{define-config-CIlk9scU.js → define-config-CvE5pHqB.js} +1 -1
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-Bi7ZEK3c.js → dist-DIpm7mot.js} +5 -5
- package/dist/dist-Dhu07wmN.js +3 -0
- package/dist/{editor-b1XUwt9v.js → editor-CtJGQP7C.js} +13 -13
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +8 -8
- package/dist/{oxlint-plugin-config-Dx-ZY2MN.js → oxlint-plugin-config-BIzrO2y2.js} +1 -1
- package/dist/oxlint-plugin.js +2 -2
- package/dist/pack-bin.js +1 -1
- package/dist/{package-BP16iQby.js → package-CQDXTm6j.js} +1 -1
- package/dist/{prompts-BGpQtC5z.js → prompts-1xNz_ne0.js} +90 -196
- package/dist/{resolve-vite-config-CGzlyhGr.js → resolve-vite-config-7WDtXO4G.js} +1 -1
- package/dist/{resolve-vite-config-x47JetlI.js → resolve-vite-config-BVr1SUNg.js} +2 -2
- package/dist/{rolldown-runtime-CMFfr-1z.js → rolldown-runtime-kJ_i4yPo.js} +1 -1
- package/dist/staged/bin.js +33 -5
- package/dist/sync-versions/bin.js +4 -3
- package/dist/sync-versions/bin.mjs +8 -7
- package/dist/toolchain.js +6 -6
- package/dist/toolchain.json +6 -6
- package/dist/{tsconfig-D2DzAQ_D.js → tsconfig-BZu7kl-x.js} +3 -3
- package/dist/{tsconfig-C5PnJfW4.js → tsconfig-zWgHiQ3X.js} +1 -1
- package/dist/version.js +2 -2
- package/dist/versions.js +2 -2
- package/docs/guide/create.md +34 -0
- package/docs/guide/env.md +16 -9
- package/docs/guide/local-cli.md +4 -4
- package/docs/guide/migrate.md +5 -5
- package/docs/guide/package-management.md +18 -1
- package/docs/guide/test.md +1 -1
- package/docs/guide/vitest-v5.md +2 -2
- package/package.json +23 -23
- package/dist/command-DaRqSNpP.js +0 -1
- package/dist/dist-CBWGibx8.js +0 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-
|
|
1
|
+
import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-kJ_i4yPo.js";
|
|
2
2
|
import { t as accent } from "./terminal-MKGAuy-p.js";
|
|
3
|
-
import { f as VITE_PLUS_VERSION } from "./constants-
|
|
3
|
+
import { f as VITE_PLUS_VERSION } from "./constants-DR55DpRm.js";
|
|
4
4
|
import { a as writeJsonFile, i as readJsonFile } from "./json-JP24qHUF.js";
|
|
5
5
|
import { _ as isGreaterThanOrEqual, b as safeRegex, g as formatComparableVersion, l as PRERELEASE, n as COERCE, r as COERCE_FULL, u as PRERELEASE_LOOSE, x as tryParse, y as parse } from "./comparison-CmVirWIW-DUGaiYqF.js";
|
|
6
|
-
import { n as runCommandSilently } from "./command-
|
|
7
|
-
import { t as require_dist } from "./dist-
|
|
6
|
+
import { n as runCommandSilently } from "./command-CdMBoZFD.js";
|
|
7
|
+
import { t as require_dist } from "./dist-DIpm7mot.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { downloadPackageManager } from "../binding/index.js";
|
|
10
10
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
@@ -23,7 +23,7 @@ const getCodePointsLength$1 = (() => {
|
|
|
23
23
|
return input.length - surrogatePairsNr;
|
|
24
24
|
};
|
|
25
25
|
})();
|
|
26
|
-
const isFullWidth$
|
|
26
|
+
const isFullWidth$1 = (x) => {
|
|
27
27
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
28
28
|
};
|
|
29
29
|
const isWideNotCJKTNotEmoji$1 = (x) => {
|
|
@@ -31,21 +31,21 @@ const isWideNotCJKTNotEmoji$1 = (x) => {
|
|
|
31
31
|
};
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
34
|
-
const ANSI_RE$
|
|
35
|
-
const CONTROL_RE$
|
|
34
|
+
const ANSI_RE$1 = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
35
|
+
const CONTROL_RE$1 = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
36
36
|
const CJKT_WIDE_RE$1 = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy;
|
|
37
|
-
const TAB_RE$
|
|
38
|
-
const EMOJI_RE$
|
|
39
|
-
const LATIN_RE$
|
|
40
|
-
const MODIFIER_RE$
|
|
41
|
-
const NO_TRUNCATION$
|
|
37
|
+
const TAB_RE$1 = /\t{1,1000}/y;
|
|
38
|
+
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;
|
|
39
|
+
const LATIN_RE$1 = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
40
|
+
const MODIFIER_RE$1 = /\p{M}+/gu;
|
|
41
|
+
const NO_TRUNCATION$3 = {
|
|
42
42
|
limit: Infinity,
|
|
43
43
|
ellipsis: ""
|
|
44
44
|
};
|
|
45
|
-
const getStringTruncatedWidth$
|
|
45
|
+
const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
46
46
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
47
47
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
48
|
-
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth$
|
|
48
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth$1(ELLIPSIS, NO_TRUNCATION$3, widthOptions).width : 0);
|
|
49
49
|
const ANSI_WIDTH = 0;
|
|
50
50
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
51
51
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
@@ -54,11 +54,11 @@ const getStringTruncatedWidth$2 = (input, truncationOptions = {}, widthOptions =
|
|
|
54
54
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
55
55
|
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
56
56
|
const PARSE_BLOCKS = [
|
|
57
|
-
[LATIN_RE$
|
|
58
|
-
[ANSI_RE$
|
|
59
|
-
[CONTROL_RE$
|
|
60
|
-
[TAB_RE$
|
|
61
|
-
[EMOJI_RE$
|
|
57
|
+
[LATIN_RE$1, REGULAR_WIDTH],
|
|
58
|
+
[ANSI_RE$1, ANSI_WIDTH],
|
|
59
|
+
[CONTROL_RE$1, CONTROL_WIDTH],
|
|
60
|
+
[TAB_RE$1, TAB_WIDTH],
|
|
61
|
+
[EMOJI_RE$1, EMOJI_WIDTH],
|
|
62
62
|
[CJKT_WIDE_RE$1, WIDE_WIDTH]
|
|
63
63
|
];
|
|
64
64
|
let indexPrev = 0;
|
|
@@ -76,9 +76,9 @@ const getStringTruncatedWidth$2 = (input, truncationOptions = {}, widthOptions =
|
|
|
76
76
|
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
77
77
|
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
78
78
|
lengthExtra = 0;
|
|
79
|
-
for (const char of unmatched.replaceAll(MODIFIER_RE$
|
|
79
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE$1, "")) {
|
|
80
80
|
const codePoint = char.codePointAt(0) || 0;
|
|
81
|
-
if (isFullWidth$
|
|
81
|
+
if (isFullWidth$1(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
|
|
82
82
|
else if (isWideNotCJKTNotEmoji$1(codePoint)) widthExtra = WIDE_WIDTH;
|
|
83
83
|
else widthExtra = REGULAR_WIDTH;
|
|
84
84
|
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
@@ -96,7 +96,7 @@ const getStringTruncatedWidth$2 = (input, truncationOptions = {}, widthOptions =
|
|
|
96
96
|
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
|
|
97
97
|
BLOCK_RE.lastIndex = index;
|
|
98
98
|
if (BLOCK_RE.test(input)) {
|
|
99
|
-
lengthExtra = BLOCK_RE === CJKT_WIDE_RE$1 ? getCodePointsLength$1(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE$
|
|
99
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE$1 ? getCodePointsLength$1(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE$1 ? 1 : BLOCK_RE.lastIndex - index;
|
|
100
100
|
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
101
101
|
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
102
102
|
if (width + widthExtra > LIMIT) {
|
|
@@ -121,18 +121,18 @@ const getStringTruncatedWidth$2 = (input, truncationOptions = {}, widthOptions =
|
|
|
121
121
|
};
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region ../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
124
|
-
const NO_TRUNCATION$
|
|
124
|
+
const NO_TRUNCATION$2 = {
|
|
125
125
|
limit: Infinity,
|
|
126
126
|
ellipsis: "",
|
|
127
127
|
ellipsisWidth: 0
|
|
128
128
|
};
|
|
129
|
-
const fastStringWidth$
|
|
130
|
-
return getStringTruncatedWidth$
|
|
129
|
+
const fastStringWidth$1 = (input, options = {}) => {
|
|
130
|
+
return getStringTruncatedWidth$1(input, NO_TRUNCATION$2, options).width;
|
|
131
131
|
};
|
|
132
132
|
//#endregion
|
|
133
133
|
//#region ../../node_modules/.pnpm/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js
|
|
134
|
-
const ESC$
|
|
135
|
-
const CSI$
|
|
134
|
+
const ESC$2 = "\x1B";
|
|
135
|
+
const CSI$2 = "";
|
|
136
136
|
const END_CODE$1 = 39;
|
|
137
137
|
const ANSI_ESCAPE_BELL$1 = "\x07";
|
|
138
138
|
const ANSI_CSI$1 = "[";
|
|
@@ -153,26 +153,26 @@ const getClosingCode$1 = (openingCode) => {
|
|
|
153
153
|
if (openingCode === 9) return 29;
|
|
154
154
|
if (openingCode === 0) return 0;
|
|
155
155
|
};
|
|
156
|
-
const wrapAnsiCode$1 = (code) => `${ESC$
|
|
157
|
-
const wrapAnsiHyperlink$1 = (url) => `${ESC$
|
|
156
|
+
const wrapAnsiCode$1 = (code) => `${ESC$2}${ANSI_CSI$1}${code}${ANSI_SGR_TERMINATOR$1}`;
|
|
157
|
+
const wrapAnsiHyperlink$1 = (url) => `${ESC$2}${ANSI_ESCAPE_LINK$1}${url}${ANSI_ESCAPE_BELL$1}`;
|
|
158
158
|
const wrapWord$1 = (rows, word, columns) => {
|
|
159
159
|
const characters = word[Symbol.iterator]();
|
|
160
160
|
let isInsideEscape = false;
|
|
161
161
|
let isInsideLinkEscape = false;
|
|
162
162
|
let lastRow = rows.at(-1);
|
|
163
|
-
let visible = lastRow === void 0 ? 0 : fastStringWidth$
|
|
163
|
+
let visible = lastRow === void 0 ? 0 : fastStringWidth$1(lastRow);
|
|
164
164
|
let currentCharacter = characters.next();
|
|
165
165
|
let nextCharacter = characters.next();
|
|
166
166
|
let rawCharacterIndex = 0;
|
|
167
167
|
while (!currentCharacter.done) {
|
|
168
168
|
const character = currentCharacter.value;
|
|
169
|
-
const characterLength = fastStringWidth$
|
|
169
|
+
const characterLength = fastStringWidth$1(character);
|
|
170
170
|
if (visible + characterLength <= columns) rows[rows.length - 1] += character;
|
|
171
171
|
else {
|
|
172
172
|
rows.push(character);
|
|
173
173
|
visible = 0;
|
|
174
174
|
}
|
|
175
|
-
if (character === ESC$
|
|
175
|
+
if (character === ESC$2 || character === CSI$2) {
|
|
176
176
|
isInsideEscape = true;
|
|
177
177
|
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK$1, rawCharacterIndex + 1);
|
|
178
178
|
}
|
|
@@ -201,7 +201,7 @@ const stringVisibleTrimSpacesRight$1 = (string) => {
|
|
|
201
201
|
const words = string.split(" ");
|
|
202
202
|
let last = words.length;
|
|
203
203
|
while (last) {
|
|
204
|
-
if (fastStringWidth$
|
|
204
|
+
if (fastStringWidth$1(words[last - 1])) break;
|
|
205
205
|
last--;
|
|
206
206
|
}
|
|
207
207
|
if (last === words.length) return string;
|
|
@@ -222,7 +222,7 @@ const exec$1 = (string, columns, options = {}) => {
|
|
|
222
222
|
const trimmed = row.trimStart();
|
|
223
223
|
if (row.length !== trimmed.length) {
|
|
224
224
|
rows[rows.length - 1] = trimmed;
|
|
225
|
-
rowLength = fastStringWidth$
|
|
225
|
+
rowLength = fastStringWidth$1(trimmed);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
if (index !== 0) {
|
|
@@ -235,19 +235,19 @@ const exec$1 = (string, columns, options = {}) => {
|
|
|
235
235
|
rowLength++;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
const wordLength = fastStringWidth$
|
|
238
|
+
const wordLength = fastStringWidth$1(word);
|
|
239
239
|
if (options.hard && wordLength > columns) {
|
|
240
240
|
const remainingColumns = columns - rowLength;
|
|
241
241
|
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
242
242
|
if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
|
|
243
243
|
wrapWord$1(rows, word, columns);
|
|
244
|
-
rowLength = fastStringWidth$
|
|
244
|
+
rowLength = fastStringWidth$1(rows.at(-1) ?? "");
|
|
245
245
|
continue;
|
|
246
246
|
}
|
|
247
247
|
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
248
248
|
if (options.wordWrap === false && rowLength < columns) {
|
|
249
249
|
wrapWord$1(rows, word, columns);
|
|
250
|
-
rowLength = fastStringWidth$
|
|
250
|
+
rowLength = fastStringWidth$1(rows.at(-1) ?? "");
|
|
251
251
|
continue;
|
|
252
252
|
}
|
|
253
253
|
rows.push("");
|
|
@@ -255,7 +255,7 @@ const exec$1 = (string, columns, options = {}) => {
|
|
|
255
255
|
}
|
|
256
256
|
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
257
257
|
wrapWord$1(rows, word, columns);
|
|
258
|
-
rowLength = fastStringWidth$
|
|
258
|
+
rowLength = fastStringWidth$1(rows.at(-1) ?? "");
|
|
259
259
|
continue;
|
|
260
260
|
}
|
|
261
261
|
rows[rows.length - 1] += word;
|
|
@@ -271,7 +271,7 @@ const exec$1 = (string, columns, options = {}) => {
|
|
|
271
271
|
inSurrogate = character >= "\ud800" && character <= "\udbff";
|
|
272
272
|
if (inSurrogate) continue;
|
|
273
273
|
} else inSurrogate = false;
|
|
274
|
-
if (character === ESC$
|
|
274
|
+
if (character === ESC$2 || character === CSI$2) {
|
|
275
275
|
GROUP_REGEX$1.lastIndex = i + 1;
|
|
276
276
|
const groups = GROUP_REGEX$1.exec(preString)?.groups;
|
|
277
277
|
if (groups?.code !== void 0) {
|
|
@@ -853,159 +853,51 @@ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
853
853
|
module.exports.createColors = createColors;
|
|
854
854
|
}));
|
|
855
855
|
//#endregion
|
|
856
|
-
//#region
|
|
856
|
+
//#region ../../node_modules/.pnpm/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js
|
|
857
857
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
858
|
+
const ESC$1 = "\x1B";
|
|
859
|
+
const CSI$1 = `${ESC$1}[`;
|
|
860
|
+
const cursor = {
|
|
861
|
+
to(x, y) {
|
|
862
|
+
if (!y) return `${CSI$1}${x + 1}G`;
|
|
863
|
+
return `${CSI$1}${y + 1};${x + 1}H`;
|
|
864
|
+
},
|
|
865
|
+
move(x, y) {
|
|
866
|
+
let ret = "";
|
|
867
|
+
if (x < 0) ret += `${CSI$1}${-x}D`;
|
|
868
|
+
else if (x > 0) ret += `${CSI$1}${x}C`;
|
|
869
|
+
if (y < 0) ret += `${CSI$1}${-y}A`;
|
|
870
|
+
else if (y > 0) ret += `${CSI$1}${y}B`;
|
|
871
|
+
return ret;
|
|
872
|
+
},
|
|
873
|
+
up: (count = 1) => `${CSI$1}${count}A`,
|
|
874
|
+
down: (count = 1) => `${CSI$1}${count}B`,
|
|
875
|
+
forward: (count = 1) => `${CSI$1}${count}C`,
|
|
876
|
+
backward: (count = 1) => `${CSI$1}${count}D`,
|
|
877
|
+
nextLine: (count = 1) => `${CSI$1}E`.repeat(count),
|
|
878
|
+
prevLine: (count = 1) => `${CSI$1}F`.repeat(count),
|
|
879
|
+
left: `${CSI$1}G`,
|
|
880
|
+
hide: `${CSI$1}?25l`,
|
|
881
|
+
show: `${CSI$1}?25h`,
|
|
882
|
+
save: `${ESC$1}7`,
|
|
883
|
+
restore: `${ESC$1}8`
|
|
876
884
|
};
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
let indexPrev = 0;
|
|
890
|
-
let index = 0;
|
|
891
|
-
let length = input.length;
|
|
892
|
-
let lengthExtra = 0;
|
|
893
|
-
let truncationEnabled = false;
|
|
894
|
-
let truncationIndex = length;
|
|
895
|
-
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
896
|
-
let unmatchedStart = 0;
|
|
897
|
-
let unmatchedEnd = 0;
|
|
898
|
-
let width = 0;
|
|
899
|
-
let widthExtra = 0;
|
|
900
|
-
outer: while (true) {
|
|
901
|
-
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
902
|
-
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
903
|
-
lengthExtra = 0;
|
|
904
|
-
for (const char of unmatched.replaceAll(MODIFIER_RE$1, "")) {
|
|
905
|
-
const codePoint = char.codePointAt(0) || 0;
|
|
906
|
-
if (isFullWidth$1(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
|
|
907
|
-
else if (isWide(codePoint)) widthExtra = WIDE_WIDTH;
|
|
908
|
-
else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) widthExtra = AMBIGUOUS_WIDTH;
|
|
909
|
-
else widthExtra = REGULAR_WIDTH;
|
|
910
|
-
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
911
|
-
if (width + widthExtra > LIMIT) {
|
|
912
|
-
truncationEnabled = true;
|
|
913
|
-
break outer;
|
|
914
|
-
}
|
|
915
|
-
lengthExtra += char.length;
|
|
916
|
-
width += widthExtra;
|
|
917
|
-
}
|
|
918
|
-
unmatchedStart = unmatchedEnd = 0;
|
|
919
|
-
}
|
|
920
|
-
if (index >= length) break;
|
|
921
|
-
LATIN_RE$1.lastIndex = index;
|
|
922
|
-
if (LATIN_RE$1.test(input)) {
|
|
923
|
-
lengthExtra = LATIN_RE$1.lastIndex - index;
|
|
924
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
925
|
-
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
926
|
-
if (width + widthExtra > LIMIT) {
|
|
927
|
-
truncationEnabled = true;
|
|
928
|
-
break;
|
|
929
|
-
}
|
|
930
|
-
width += widthExtra;
|
|
931
|
-
unmatchedStart = indexPrev;
|
|
932
|
-
unmatchedEnd = index;
|
|
933
|
-
index = indexPrev = LATIN_RE$1.lastIndex;
|
|
934
|
-
continue;
|
|
935
|
-
}
|
|
936
|
-
ANSI_RE$1.lastIndex = index;
|
|
937
|
-
if (ANSI_RE$1.test(input)) {
|
|
938
|
-
if (width + ANSI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
|
|
939
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
940
|
-
truncationEnabled = true;
|
|
941
|
-
break;
|
|
942
|
-
}
|
|
943
|
-
width += ANSI_WIDTH;
|
|
944
|
-
unmatchedStart = indexPrev;
|
|
945
|
-
unmatchedEnd = index;
|
|
946
|
-
index = indexPrev = ANSI_RE$1.lastIndex;
|
|
947
|
-
continue;
|
|
948
|
-
}
|
|
949
|
-
CONTROL_RE$1.lastIndex = index;
|
|
950
|
-
if (CONTROL_RE$1.test(input)) {
|
|
951
|
-
lengthExtra = CONTROL_RE$1.lastIndex - index;
|
|
952
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
953
|
-
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
954
|
-
if (width + widthExtra > LIMIT) {
|
|
955
|
-
truncationEnabled = true;
|
|
956
|
-
break;
|
|
957
|
-
}
|
|
958
|
-
width += widthExtra;
|
|
959
|
-
unmatchedStart = indexPrev;
|
|
960
|
-
unmatchedEnd = index;
|
|
961
|
-
index = indexPrev = CONTROL_RE$1.lastIndex;
|
|
962
|
-
continue;
|
|
963
|
-
}
|
|
964
|
-
TAB_RE$1.lastIndex = index;
|
|
965
|
-
if (TAB_RE$1.test(input)) {
|
|
966
|
-
lengthExtra = TAB_RE$1.lastIndex - index;
|
|
967
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
968
|
-
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
969
|
-
if (width + widthExtra > LIMIT) {
|
|
970
|
-
truncationEnabled = true;
|
|
971
|
-
break;
|
|
972
|
-
}
|
|
973
|
-
width += widthExtra;
|
|
974
|
-
unmatchedStart = indexPrev;
|
|
975
|
-
unmatchedEnd = index;
|
|
976
|
-
index = indexPrev = TAB_RE$1.lastIndex;
|
|
977
|
-
continue;
|
|
978
|
-
}
|
|
979
|
-
EMOJI_RE$1.lastIndex = index;
|
|
980
|
-
if (EMOJI_RE$1.test(input)) {
|
|
981
|
-
if (width + EMOJI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
|
|
982
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
983
|
-
truncationEnabled = true;
|
|
984
|
-
break;
|
|
985
|
-
}
|
|
986
|
-
width += EMOJI_WIDTH;
|
|
987
|
-
unmatchedStart = indexPrev;
|
|
988
|
-
unmatchedEnd = index;
|
|
989
|
-
index = indexPrev = EMOJI_RE$1.lastIndex;
|
|
990
|
-
continue;
|
|
991
|
-
}
|
|
992
|
-
index += 1;
|
|
885
|
+
const erase = {
|
|
886
|
+
screen: `${CSI$1}2J`,
|
|
887
|
+
up: (count = 1) => `${CSI$1}1J`.repeat(count),
|
|
888
|
+
down: (count = 1) => `${CSI$1}J`.repeat(count),
|
|
889
|
+
line: `${CSI$1}2K`,
|
|
890
|
+
lineEnd: `${CSI$1}K`,
|
|
891
|
+
lineStart: `${CSI$1}1K`,
|
|
892
|
+
lines(count) {
|
|
893
|
+
let clear = "";
|
|
894
|
+
for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
895
|
+
if (count) clear += cursor.left;
|
|
896
|
+
return clear;
|
|
993
897
|
}
|
|
994
|
-
return {
|
|
995
|
-
width: truncationEnabled ? truncationLimit : width,
|
|
996
|
-
index: truncationEnabled ? truncationIndex : length,
|
|
997
|
-
truncated: truncationEnabled,
|
|
998
|
-
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
999
|
-
};
|
|
1000
|
-
};
|
|
1001
|
-
const NO_TRUNCATION$2 = {
|
|
1002
|
-
limit: Infinity,
|
|
1003
|
-
ellipsis: "",
|
|
1004
|
-
ellipsisWidth: 0
|
|
1005
|
-
};
|
|
1006
|
-
const fastStringWidth$1 = (input, options = {}) => {
|
|
1007
|
-
return getStringTruncatedWidth$1(input, NO_TRUNCATION$2, options).width;
|
|
1008
898
|
};
|
|
899
|
+
//#endregion
|
|
900
|
+
//#region ../prompts/dist/index.mjs
|
|
1009
901
|
const getCodePointsLength = (() => {
|
|
1010
902
|
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
1011
903
|
return (input) => {
|
|
@@ -1281,13 +1173,15 @@ function wrapAnsi(string, columns, options) {
|
|
|
1281
1173
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
1282
1174
|
}
|
|
1283
1175
|
function isUnicodeSupported() {
|
|
1284
|
-
|
|
1285
|
-
|
|
1176
|
+
const { env } = process$1;
|
|
1177
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
1178
|
+
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
1179
|
+
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1286
1180
|
}
|
|
1287
1181
|
updateSettings({ withGuide: false });
|
|
1288
1182
|
/** Wrap using visible columns rather than the length of ANSI escape sequences. */
|
|
1289
1183
|
const wrapTextWithPrefix = (output, text, prefix, startPrefix = prefix) => {
|
|
1290
|
-
return wrapAnsi(text, Math.max(1, getColumns(output ?? process.stdout) - Math.max(fastStringWidth
|
|
1184
|
+
return wrapAnsi(text, Math.max(1, getColumns(output ?? process.stdout) - Math.max(fastStringWidth(prefix), fastStringWidth(startPrefix))), {
|
|
1291
1185
|
hard: true,
|
|
1292
1186
|
trim: false
|
|
1293
1187
|
}).split("\n").map((line, index) => `${index === 0 ? startPrefix : prefix}${line}`).join("\n");
|
|
@@ -1299,8 +1193,8 @@ const promptTitle = (message, state, opts) => {
|
|
|
1299
1193
|
return `${hasGuide ? `${import_picocolors.default.gray(S_BAR)}\n` : ""}${wrapTextWithPrefix(opts.output, message, hasGuide ? `${symbolBar(state)} ` : " ", `${symbol(state)} `)}\n`;
|
|
1300
1194
|
};
|
|
1301
1195
|
const optionText = (output, marker, label, format, suffix = "") => {
|
|
1302
|
-
const continuation = " ".repeat(fastStringWidth
|
|
1303
|
-
const width = Math.max(1, getColumns(output ?? process.stdout) - 2 - fastStringWidth
|
|
1196
|
+
const continuation = " ".repeat(fastStringWidth(marker));
|
|
1197
|
+
const width = Math.max(1, getColumns(output ?? process.stdout) - 2 - fastStringWidth(marker));
|
|
1304
1198
|
const [first, ...rest] = label.split("\n");
|
|
1305
1199
|
return wrapAnsi([format(first) + suffix, ...rest.map(format)].join("\n"), width, {
|
|
1306
1200
|
hard: true,
|
|
@@ -1759,9 +1653,9 @@ const spinner = ({ indicator = "dots", onCancel, output = process.stdout, cancel
|
|
|
1759
1653
|
hard: true,
|
|
1760
1654
|
trim: false
|
|
1761
1655
|
}).split("\n");
|
|
1762
|
-
if (prevLines.length > 1) output.write(
|
|
1763
|
-
output.write(
|
|
1764
|
-
output.write(
|
|
1656
|
+
if (prevLines.length > 1) output.write(cursor.up(prevLines.length - 1));
|
|
1657
|
+
output.write(cursor.to(0));
|
|
1658
|
+
output.write(erase.down());
|
|
1765
1659
|
};
|
|
1766
1660
|
const hasGuide = getGuide(opts);
|
|
1767
1661
|
const startLoop = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as resolveUniversalViteConfig } from "./resolve-vite-config-
|
|
1
|
+
export { a as resolveUniversalViteConfig } from "./resolve-vite-config-BVr1SUNg.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as VITE_CONFIG_FILES } from "./constants-
|
|
2
|
-
import { u as withConfigMetadataResolution } from "./define-config-
|
|
1
|
+
import { l as VITE_CONFIG_FILES } from "./constants-DR55DpRm.js";
|
|
2
|
+
import { u as withConfigMetadataResolution } from "./define-config-CvE5pHqB.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
//#region src/resolve-vite-config.ts
|
|
@@ -6,7 +6,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
11
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
12
|
key = keys[i];
|
package/dist/staged/bin.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-
|
|
1
|
+
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-kJ_i4yPo.js";
|
|
2
2
|
import { i as log, n as errorMsg, o as printHeader } from "../terminal-MKGAuy-p.js";
|
|
3
|
-
import { o as resolveViteConfig } from "../resolve-vite-config-
|
|
3
|
+
import { o as resolveViteConfig } from "../resolve-vite-config-BVr1SUNg.js";
|
|
4
4
|
import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import path, { basename, delimiter, dirname, normalize, resolve } from "node:path";
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
8
|
import { parseStagedArgs } from "../../binding/index.js";
|
|
9
|
-
import util, { format, formatWithOptions, inspect, promisify } from "node:util";
|
|
9
|
+
import util, { format, formatWithOptions, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
10
10
|
import { closeSync, constants, openSync, readSync, statSync } from "node:fs";
|
|
11
11
|
import { cwd } from "node:process";
|
|
12
12
|
import l__default from "node:readline";
|
|
@@ -4099,7 +4099,7 @@ const jsonParse = async (filename) => {
|
|
|
4099
4099
|
const yamlParse = async (filename) => {
|
|
4100
4100
|
const isPackageFile = PACKAGE_YAML_FILES.includes(path.basename(filename));
|
|
4101
4101
|
try {
|
|
4102
|
-
const [YAML, content] = await Promise.all([import("../dist-
|
|
4102
|
+
const [YAML, content] = await Promise.all([import("../dist-Dhu07wmN.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)), readFile(filename)]);
|
|
4103
4103
|
const yaml = YAML.parse(content);
|
|
4104
4104
|
return isPackageFile ? yaml[CONFIG_NAME] : yaml;
|
|
4105
4105
|
} catch (error) {
|
|
@@ -4589,6 +4589,34 @@ const lintStaged = async (options = {}, logger = console) => {
|
|
|
4589
4589
|
}
|
|
4590
4590
|
};
|
|
4591
4591
|
//#endregion
|
|
4592
|
+
//#region src/staged/logger.ts
|
|
4593
|
+
const workflowSuccessMessages = /* @__PURE__ */ new Set([
|
|
4594
|
+
"✔ Done preparing lint-staged!",
|
|
4595
|
+
"✔ Done running tasks for staged files!",
|
|
4596
|
+
"✔ Done running tasks for changed files!",
|
|
4597
|
+
"✔ Done staging changes from tasks!",
|
|
4598
|
+
"✔ Done hiding unstaged changes to partially staged files!",
|
|
4599
|
+
"✔ Done restoring untracked files!",
|
|
4600
|
+
"✔ Done cleaning up temporary files!"
|
|
4601
|
+
]);
|
|
4602
|
+
function isWorkflowProgress(message) {
|
|
4603
|
+
const text = stripVTControlCharacters(message);
|
|
4604
|
+
if (text.includes("\n")) return false;
|
|
4605
|
+
return text === "" || text.startsWith("⋯ ") || text.startsWith(" ") || workflowSuccessMessages.has(text) || /^✔ Done backing up original state \([\da-f]+\)!$/.test(text);
|
|
4606
|
+
}
|
|
4607
|
+
function createStagedLogger(logger = {
|
|
4608
|
+
...console,
|
|
4609
|
+
log
|
|
4610
|
+
}) {
|
|
4611
|
+
return {
|
|
4612
|
+
...logger,
|
|
4613
|
+
log(message, ...args) {
|
|
4614
|
+
if (typeof message === "string" && args.length === 0 && isWorkflowProgress(message)) return;
|
|
4615
|
+
logger.log(message, ...args);
|
|
4616
|
+
}
|
|
4617
|
+
};
|
|
4618
|
+
}
|
|
4619
|
+
//#endregion
|
|
4592
4620
|
//#region src/staged/bin.ts
|
|
4593
4621
|
const args = unwrapCliParseOutcome(parseStagedArgs(process.argv.slice(3)));
|
|
4594
4622
|
const options = {};
|
|
@@ -4626,7 +4654,7 @@ if (args.cwd != null) options.cwd = args.cwd;
|
|
|
4626
4654
|
if (args.diff != null) options.diff = args.diff;
|
|
4627
4655
|
if (args.diffFilter != null) options.diffFilter = args.diffFilter;
|
|
4628
4656
|
if (args.concurrent != null) options.concurrent = args.concurrent;
|
|
4629
|
-
const success = await lintStaged(options);
|
|
4657
|
+
const success = await lintStaged(options, options.debug || options.quiet ? void 0 : createStagedLogger());
|
|
4630
4658
|
process.exit(success ? 0 : 1);
|
|
4631
4659
|
//#endregion
|
|
4632
4660
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as modify, l as parse$1, o as applyEdits, t as detectFormattingOptions } from "../json-JP24qHUF.js";
|
|
2
2
|
import { n as isAlignableVitestEcosystemPackage } from "../vitest-ecosystem-BU0AqZq-.js";
|
|
3
3
|
import { i as normalizeRange, t as extractOverrideTargetName } from "../package-overrides-D1RcXSFl.js";
|
|
4
|
-
import { t as require_dist } from "../dist-
|
|
4
|
+
import { t as require_dist } from "../dist-DIpm7mot.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fsPromises from "node:fs/promises";
|
|
7
7
|
import { Buffer } from "node:buffer";
|
|
@@ -412,6 +412,7 @@ function hide(inst, key, value) {
|
|
|
412
412
|
return own(inst, key, value, false);
|
|
413
413
|
}
|
|
414
414
|
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
415
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
415
416
|
function derived(computes, table) {
|
|
416
417
|
for (const key in computes) {
|
|
417
418
|
const compute = computes[key];
|
|
@@ -563,6 +564,7 @@ function newError(Definition) {
|
|
|
563
564
|
}
|
|
564
565
|
return new Definition();
|
|
565
566
|
}
|
|
567
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
566
568
|
function $constructor(name, initializer, proto, params) {
|
|
567
569
|
const zodProto = {};
|
|
568
570
|
function Internals(def) {
|
|
@@ -693,8 +695,7 @@ const initializer$1 = (inst, def) => {
|
|
|
693
695
|
});
|
|
694
696
|
}
|
|
695
697
|
};
|
|
696
|
-
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
697
|
-
$constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
698
|
+
const $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer$1);
|
|
698
699
|
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
699
700
|
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
700
701
|
* "__proto__" would hit the setter instead of creating a key. */
|