vite-plus 0.2.7 → 0.2.9

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.
Files changed (89) hide show
  1. package/AGENTS.md +7 -0
  2. package/LICENSE +5 -1
  3. package/README.md +9 -3
  4. package/bin/vpr +3 -2
  5. package/binding/index.cjs +193 -80
  6. package/binding/index.d.cts +106 -11
  7. package/dist/agent-DQU8uS6P.js +416 -0
  8. package/dist/bin.js +1388 -23
  9. package/dist/{cli-truncate-BVOlIIPy.js → cli-truncate-Bg3RDXpi.js} +0 -2
  10. package/dist/client/bundledDevClient.mjs +1 -0
  11. package/dist/config/bin.js +32 -133
  12. package/dist/{constants-BsuzPowC.js → constants-CG513DRa.js} +10 -2
  13. package/dist/create/bin.js +255 -268
  14. package/dist/{define-config-C2KfLHpC.js → define-config-CV4bQG_8.js} +3 -3
  15. package/dist/{define-config-eLQH9us2.d.ts → define-config-DWoAkNdp.d.ts} +16 -0
  16. package/dist/{define-config-DLh9fE95.cjs → define-config-DyNLA_f0.cjs} +1 -1
  17. package/dist/define-config.cjs +1 -1
  18. package/dist/define-config.d.ts +1 -1
  19. package/dist/define-config.js +1 -1
  20. package/dist/{dist-CKz3vcoG.js → dist-BDYZP12R.js} +196 -157
  21. package/dist/dist-Dqv1-Clg.js +3 -0
  22. package/dist/{agent-CPwWJ4qf.js → editor-g4PosU99.js} +819 -628
  23. package/dist/hooks/bin.d.ts +1 -0
  24. package/dist/hooks/bin.js +130 -0
  25. package/dist/hooks-pNCBWtFT.js +570 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/{json-DiRs8ceZ.js → json-qlK6UH0r.js} +40 -38
  30. package/dist/migration/bin.js +65 -58
  31. package/dist/{oxlint-plugin-config-Bxgc4cwF.js → oxlint-plugin-config-BEZ9IUf7.js} +1 -1
  32. package/dist/oxlint-plugin.js +1 -1
  33. package/dist/pack-bin.js +1 -1
  34. package/dist/{package-Ds3uThLb.js → package-B4T8RGMG.js} +2 -2
  35. package/dist/{tsconfig-Jia2vgMG.js → prompts-CHz_98bJ.js} +169 -219
  36. package/dist/{resolve-vite-config-BiuLZnn8.js → resolve-vite-config-Dmeyeyj-.js} +2 -9
  37. package/dist/{rolldown-runtime-C7HZzL1F.js → rolldown-runtime-CMFfr-1z.js} +1 -1
  38. package/dist/staged/bin.js +241 -226
  39. package/dist/terminal-Bz-ps6rJ.js +128 -0
  40. package/dist/test/browser/providers/playwright/context.d.ts +1 -1
  41. package/dist/test/browser/providers/playwright.d.ts +6 -6
  42. package/dist/test/browser/providers/preview/context.d.ts +1 -1
  43. package/dist/test/browser/providers/preview.d.ts +4 -4
  44. package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
  45. package/dist/test/browser/providers/webdriverio.d.ts +6 -6
  46. package/dist/test/browser-playwright/context.d.ts +1 -1
  47. package/dist/test/browser-playwright.d.ts +6 -6
  48. package/dist/test/browser-preview/context.d.ts +1 -1
  49. package/dist/test/browser-preview.d.ts +4 -4
  50. package/dist/test/browser-webdriverio/context.d.ts +1 -1
  51. package/dist/test/browser-webdriverio.d.ts +6 -6
  52. package/dist/test/context.d.ts +3 -3
  53. package/dist/test/locators.d.ts +1 -1
  54. package/dist/toolchain.d.ts +25 -0
  55. package/dist/toolchain.js +194 -0
  56. package/dist/toolchain.json +193 -0
  57. package/dist/tsconfig-7v_BHagU.js +151 -0
  58. package/dist/{tsgolint-path-B-yOos8p.js → tsgolint-path-CbDReEOx.js} +5 -3
  59. package/dist/tsgolint-path.js +1 -1
  60. package/dist/version.js +6 -6
  61. package/dist/versions.d.ts +3 -3
  62. package/dist/versions.js +6 -6
  63. package/docs/config/index.md +13 -0
  64. package/docs/config/staged.md +2 -1
  65. package/docs/guide/ci.md +37 -4
  66. package/docs/guide/commit-hooks.md +112 -21
  67. package/docs/guide/create.md +7 -4
  68. package/docs/guide/env.md +8 -4
  69. package/docs/guide/fmt.md +2 -2
  70. package/docs/guide/github-actions-cache.md +5 -1
  71. package/docs/guide/ide-integration.md +61 -2
  72. package/docs/guide/index.md +4 -2
  73. package/docs/guide/install.md +27 -0
  74. package/docs/guide/installer-env-vars.md +14 -3
  75. package/docs/guide/lint.md +3 -1
  76. package/docs/guide/migrate.md +49 -4
  77. package/docs/guide/monorepo.md +98 -10
  78. package/docs/guide/troubleshooting.md +12 -3
  79. package/docs/guide/upgrade.md +27 -4
  80. package/docs/package.json +1 -1
  81. package/docs/pnpm-workspace.yaml +7 -0
  82. package/docs/vite.config.ts +3 -0
  83. package/package.json +21 -23
  84. package/rules/vite-tools.yml +0 -7
  85. package/dist/dist-CtM2JRbM.js +0 -3
  86. package/dist/editor-BbT1lTNc.js +0 -675
  87. package/dist/help-YP84FSEz.js +0 -61
  88. package/dist/terminal-uTv0ZaMr.js +0 -33
  89. package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
@@ -1,19 +1,18 @@
1
- import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-C7HZzL1F.js";
2
- import { a as printHeader, n as errorMsg, r as log } from "../terminal-uTv0ZaMr.js";
3
- import { a as resolveViteConfig } from "../resolve-vite-config-BiuLZnn8.js";
1
+ import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-CMFfr-1z.js";
2
+ import { i as log, l as renderCliDoc, n as errorMsg, o as printHeader } from "../terminal-Bz-ps6rJ.js";
3
+ import { a as resolveViteConfig } from "../resolve-vite-config-Dmeyeyj-.js";
4
4
  import { t as lib_default } from "../lib-L3DWSRQp.js";
5
- import { t as renderCliDoc } from "../help-YP84FSEz.js";
6
5
  import { createRequire } from "node:module";
7
6
  import path, { basename, delimiter, dirname, normalize, resolve } from "node:path";
8
- import { closeSync, constants, openSync, readSync, statSync } from "node:fs";
7
+ import { pathToFileURL } from "node:url";
9
8
  import { formatWithOptions, inspect, promisify } from "node:util";
9
+ import { closeSync, constants, openSync, readSync, statSync } from "node:fs";
10
+ import { EOL } from "node:os";
10
11
  import { cwd } from "node:process";
11
12
  import l__default from "node:readline";
12
13
  import nodeTty from "node:tty";
13
14
  import crypto from "node:crypto";
14
- import { pathToFileURL } from "node:url";
15
- import { EOL } from "node:os";
16
- import fsPromises, { constants as constants$1 } from "node:fs/promises";
15
+ import fsPromises, { constants as constants$2 } from "node:fs/promises";
17
16
  import { PassThrough, Writable } from "node:stream";
18
17
  import { exec, spawn } from "node:child_process";
19
18
  import { pipeline } from "node:stream/promises";
@@ -118,201 +117,212 @@ const createDebug = (name) => {
118
117
  };
119
118
  };
120
119
  //#endregion
121
- //#region ../../node_modules/.pnpm/tinyexec@1.2.4/node_modules/tinyexec/dist/main.mjs
122
- const h = /^path$/i;
123
- const g = {
120
+ //#region ../../node_modules/.pnpm/tinyexec@1.3.0/node_modules/tinyexec/dist/main.mjs
121
+ const isPathLikePattern = /^path$/i;
122
+ const defaultEnvPathInfo = {
124
123
  key: "PATH",
125
124
  value: ""
126
125
  };
127
- function _(e) {
128
- for (const t in e) {
129
- if (!Object.prototype.hasOwnProperty.call(e, t) || !h.test(t)) continue;
130
- const n = e[t];
131
- if (!n) return g;
126
+ function getPathFromEnv(env) {
127
+ for (const key in env) {
128
+ if (!Object.prototype.hasOwnProperty.call(env, key) || !isPathLikePattern.test(key)) continue;
129
+ const value = env[key];
130
+ if (!value) return defaultEnvPathInfo;
132
131
  return {
133
- key: t,
134
- value: n
132
+ key,
133
+ value
135
134
  };
136
135
  }
137
- return g;
136
+ return defaultEnvPathInfo;
138
137
  }
139
- function v(e, t) {
140
- const n = t.value.split(delimiter);
141
- const r = [];
142
- let o = e;
143
- let c;
138
+ function addNodeBinToPath(cwd, path) {
139
+ const parts = path.value.split(delimiter);
140
+ const nodeBinPaths = [];
141
+ let currentPath = cwd;
142
+ let lastPath;
144
143
  do {
145
- r.push(resolve(o, "node_modules", ".bin"));
146
- c = o;
147
- o = dirname(o);
148
- } while (o !== c);
149
- r.push(dirname(process.execPath));
150
- const l = r.concat(n).join(delimiter);
144
+ nodeBinPaths.push(resolve(currentPath, "node_modules", ".bin"));
145
+ lastPath = currentPath;
146
+ currentPath = dirname(currentPath);
147
+ } while (currentPath !== lastPath);
148
+ nodeBinPaths.push(dirname(process.execPath));
149
+ const newPath = nodeBinPaths.concat(parts).join(delimiter);
151
150
  return {
152
- key: t.key,
153
- value: l
151
+ key: path.key,
152
+ value: newPath
154
153
  };
155
154
  }
156
- function y(e, t, n = true) {
157
- const r = {
155
+ function computeEnv(cwd, env, nodePath = true) {
156
+ const envWithDefault = {
158
157
  ...process.env,
159
- ...t
158
+ ...env
160
159
  };
161
- if (!n) return r;
162
- const i = v(e, _(r));
163
- r[i.key] = i.value;
164
- return r;
160
+ if (!nodePath) return envWithDefault;
161
+ const envPathInfo = addNodeBinToPath(cwd, getPathFromEnv(envWithDefault));
162
+ envWithDefault[envPathInfo.key] = envPathInfo.value;
163
+ return envWithDefault;
165
164
  }
166
- const b = (e) => {
167
- let t = e.length;
168
- const n = new PassThrough();
169
- const r = () => {
170
- if (--t === 0) n.end();
165
+ const combineStreams = (streams) => {
166
+ let streamCount = streams.length;
167
+ const combined = new PassThrough();
168
+ const maybeEmitEnd = () => {
169
+ if (--streamCount === 0) combined.end();
171
170
  };
172
- for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
173
- return n;
171
+ for (const stream of streams) pipeline(stream, combined, { end: false }).then(maybeEmitEnd).catch(maybeEmitEnd);
172
+ return combined;
174
173
  };
175
- const x = /([()\][%!^"`<>&|;, *?])/g;
176
- const S = /^#!\s*(.+)/;
177
- const C = /\.(?:com|exe)$/i;
178
- const w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
179
- const T = process.platform === "win32";
180
- const E = [
174
+ const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
175
+ const shebangRegExp = /^#!\s*(.+)/;
176
+ const isWindowsExecutableRegExp = /\.(?:com|exe)$/i;
177
+ const isNodeModulesCmdRegExp = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
178
+ const isWindows$1 = process.platform === "win32";
179
+ const defaultPathExt = [
181
180
  ".EXE",
182
181
  ".CMD",
183
182
  ".BAT",
184
183
  ".COM"
185
184
  ];
185
+ const noPathExt = [""];
186
186
  /**
187
187
  * Normalizes the command and arguments to work cross-platform.
188
188
  * On Windows, this basically handles things like shebangs, calling
189
189
  * `node_modules/.bin` commands, and escaping meta characters.
190
190
  * On other platforms, it just returns the command and arguments as-is.
191
191
  */
192
- function D(e, t = [], n = {}) {
193
- if (n.shell === true || !T) return {
194
- command: e,
195
- args: t,
196
- options: n
192
+ function normalizeSpawnCommand(command, args = [], options = {}) {
193
+ if (options.shell === true || !isWindows$1) return {
194
+ command,
195
+ args,
196
+ options
197
197
  };
198
- let i = O(e, n);
199
- let a = null;
200
- if (i !== null) {
201
- const e = 150;
202
- const t = Buffer.alloc(e);
203
- let n = null;
198
+ let file = resolveCommand(command, options);
199
+ let shebang = null;
200
+ if (file !== null) {
201
+ const size = 150;
202
+ const buffer = Buffer.alloc(size);
203
+ let fd = null;
204
204
  try {
205
- n = openSync(i, "r");
206
- readSync(n, t, 0, e, 0);
205
+ fd = openSync(file, "r");
206
+ readSync(fd, buffer, 0, size, 0);
207
207
  } catch {} finally {
208
- if (n !== null) closeSync(n);
208
+ if (fd !== null) closeSync(fd);
209
209
  }
210
- const o = t.toString().match(S);
211
- if (o !== null) {
212
- const e = o[1].trim();
213
- const t = e.indexOf(" ");
214
- const n = t !== -1 ? e.slice(0, t) : e;
215
- const i = t !== -1 ? e.slice(t + 1) : "";
216
- const s = basename(n);
217
- a = s === "env" ? i || null : s;
210
+ const match = buffer.toString().match(shebangRegExp);
211
+ if (match !== null) {
212
+ const line = match[1].trim();
213
+ const separatorIndex = line.indexOf(" ");
214
+ const path = separatorIndex !== -1 ? line.slice(0, separatorIndex) : line;
215
+ const argument = separatorIndex !== -1 ? line.slice(separatorIndex + 1) : "";
216
+ const binary = basename(path);
217
+ shebang = binary === "env" ? argument || null : binary;
218
218
  }
219
219
  }
220
- if (a !== null && i !== null) {
221
- t = [i, ...t];
222
- e = a;
223
- i = O(e, n);
224
- }
225
- if (i === null || !C.test(i)) {
226
- const r = i !== null && w.test(i);
227
- e = normalize(e);
228
- e = e.replace(x, "^$1");
229
- t = t.map((e) => {
230
- e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
231
- e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
232
- e = `"${e}"`;
233
- e = e.replace(x, "^$1");
234
- if (r) e = e.replace(x, "^$1");
235
- return e;
220
+ if (shebang !== null && file !== null) {
221
+ args = [file, ...args];
222
+ command = shebang;
223
+ file = resolveCommand(command, options);
224
+ }
225
+ if (file === null || !isWindowsExecutableRegExp.test(file)) {
226
+ const needsDoubleEscapeMetaChars = file !== null && isNodeModulesCmdRegExp.test(file);
227
+ command = normalize(command);
228
+ command = command.replace(metaCharsRegExp, "^$1");
229
+ args = args.map((arg) => {
230
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
231
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
232
+ arg = `"${arg}"`;
233
+ arg = arg.replace(metaCharsRegExp, "^$1");
234
+ if (needsDoubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, "^$1");
235
+ return arg;
236
236
  });
237
- t = [
237
+ args = [
238
238
  "/d",
239
239
  "/s",
240
240
  "/c",
241
- `"${[e, ...t].join(" ")}"`
241
+ `"${[command, ...args].join(" ")}"`
242
242
  ];
243
- e = n.env?.comspec ?? "cmd.exe";
244
- n = {
245
- ...n,
243
+ command = options.env?.comspec ?? "cmd.exe";
244
+ options = {
245
+ ...options,
246
246
  windowsVerbatimArguments: true
247
247
  };
248
248
  }
249
249
  return {
250
- command: e,
251
- args: t,
252
- options: n
250
+ command,
251
+ args,
252
+ options
253
253
  };
254
254
  }
255
255
  /**
256
256
  * Resolves the command to an absolute path if possible.
257
257
  * Handles things like traversing PATH and adding extensions from PATHEXT
258
258
  */
259
- function O(e, t) {
260
- const r = (t.cwd ?? cwd()).toString();
261
- const a = t.env ?? process.env;
262
- const o = _(a).value;
263
- const c = e.includes("/") || e.includes("\\") ? [""] : [r, ...o.split(delimiter)];
264
- const l = a.PATHEXT ? a.PATHEXT.split(delimiter) : E;
265
- if (e.includes(".") && l[0] !== "") l.unshift("");
266
- for (const t of c) {
267
- const n = resolve(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
268
- for (const e of l) {
269
- const t = n + e;
259
+ function resolveCommand(command, options) {
260
+ const cwd$3 = (options.cwd ?? cwd()).toString();
261
+ const env = options.env ?? process.env;
262
+ const PATH = getPathFromEnv(env).value;
263
+ const pathEnv = command.includes("/") || command.includes("\\") ? [""] : [cwd$3, ...PATH.split(delimiter)];
264
+ let pathExt = env.PATHEXT ? env.PATHEXT.split(delimiter) : defaultPathExt;
265
+ if (command.includes(".") && pathExt[0] !== "") pathExt = ["", ...pathExt];
266
+ for (const extensions of [pathExt, noPathExt]) for (const path of pathEnv) {
267
+ const dest = resolve(cwd$3, path.startsWith("\"") && path.endsWith("\"") && path.length > 1 ? path.slice(1, -1) : path, command);
268
+ for (const ext of extensions) {
269
+ const destWithExt = dest + ext;
270
270
  try {
271
- if (statSync(t).isFile()) return t;
271
+ if (statSync(destWithExt).isFile()) return destWithExt;
272
272
  } catch {}
273
273
  }
274
274
  }
275
275
  return null;
276
276
  }
277
- var k = class extends Error {
277
+ var NonZeroExitError = class extends Error {
278
278
  result;
279
279
  output;
280
- get exitCode() {
281
- if (this.result.exitCode !== null) return this.result.exitCode;
282
- }
283
- constructor(e, t) {
284
- super(`Process exited with non-zero status (${e.exitCode})`);
285
- this.result = e;
286
- this.output = t;
280
+ exitCode;
281
+ get signalCode() {
282
+ return this.result.signalCode;
283
+ }
284
+ constructor(result, output, command, args) {
285
+ let target = "The process";
286
+ if (command) target = `The command \`${args?.length ? `${command} ${args.map((a) => /[ "'`()]/.test(a) ? JSON.stringify(a) : a).join(" ")}` : command}\``;
287
+ const exitCode = result.exitCode ?? 1;
288
+ super(result.signalCode !== null ? `${target} was killed by the signal ${result.signalCode}` : `${target} exited with a non-zero status (${exitCode})`);
289
+ this.result = result;
290
+ this.output = output;
291
+ this.exitCode = exitCode;
292
+ Object.defineProperty(this, "result", {
293
+ enumerable: false,
294
+ writable: false,
295
+ configurable: false
296
+ });
287
297
  }
288
298
  };
289
- const j = {
299
+ const defaultOptions = {
290
300
  timeout: void 0,
291
301
  persist: false
292
302
  };
293
- const N = { windowsHide: true };
294
- function P(e) {
295
- const t = new AbortController();
296
- for (const n of e) {
297
- if (n.aborted) {
298
- t.abort();
299
- return n;
303
+ const defaultNodeOptions = { windowsHide: true };
304
+ function combineSignals(signals) {
305
+ const controller = new AbortController();
306
+ for (const signal of signals) {
307
+ if (signal.aborted) {
308
+ controller.abort();
309
+ return signal;
300
310
  }
301
- const e = () => {
302
- t.abort(n.reason);
311
+ const onAbort = () => {
312
+ controller.abort(signal.reason);
303
313
  };
304
- n.addEventListener("abort", e, { signal: t.signal });
314
+ signal.addEventListener("abort", onAbort, { signal: controller.signal });
305
315
  }
306
- return t.signal;
316
+ return controller.signal;
307
317
  }
308
- async function F(e) {
309
- let t = "";
318
+ async function readStream(stream) {
319
+ let output = "";
310
320
  try {
311
- for await (const n of e) t += n.toString();
321
+ for await (const chunk of stream) output += chunk.toString();
312
322
  } catch {}
313
- return t;
323
+ return output;
314
324
  }
315
- var I = class {
325
+ var ExecProcess = class {
316
326
  _process;
317
327
  _aborted = false;
318
328
  _options;
@@ -330,19 +340,22 @@ var I = class {
330
340
  get exitCode() {
331
341
  if (this._process && this._process.exitCode !== null) return this._process.exitCode;
332
342
  }
333
- constructor(e, t, n) {
343
+ get signalCode() {
344
+ return this._process?.signalCode ?? null;
345
+ }
346
+ constructor(command, args, options) {
334
347
  this._options = {
335
- ...j,
336
- ...n
348
+ ...defaultOptions,
349
+ ...options
337
350
  };
338
- this._command = e;
339
- this._args = t ?? [];
340
- this._processClosed = new Promise((e) => {
341
- this._resolveClose = e;
351
+ this._command = command;
352
+ this._args = args ?? [];
353
+ this._processClosed = new Promise((resolve) => {
354
+ this._resolveClose = resolve;
342
355
  });
343
356
  }
344
- kill(e) {
345
- return this._process?.kill(e) === true;
357
+ kill(signal) {
358
+ return this._process?.kill(signal) === true;
346
359
  }
347
360
  get aborted() {
348
361
  return this._aborted;
@@ -350,99 +363,99 @@ var I = class {
350
363
  get killed() {
351
364
  return this._process?.killed === true;
352
365
  }
353
- pipe(e, t, n) {
354
- return z(e, t, {
355
- ...n,
366
+ pipe(command, args, options) {
367
+ return exec$1(command, args, {
368
+ ...options,
356
369
  stdin: this
357
370
  });
358
371
  }
359
372
  async *[Symbol.asyncIterator]() {
360
- const e = this._process;
361
- if (!e) return;
362
- const t = [];
363
- if (this._streamErr) t.push(this._streamErr);
364
- if (this._streamOut) t.push(this._streamOut);
365
- const n = b(t);
366
- const r = l__default.createInterface({ input: n });
367
- for await (const e of r) yield e.toString();
373
+ const proc = this._process;
374
+ if (!proc) return;
375
+ const streams = [];
376
+ if (this._streamErr) streams.push(this._streamErr);
377
+ if (this._streamOut) streams.push(this._streamOut);
378
+ const streamCombined = combineStreams(streams);
379
+ const rl = l__default.createInterface({ input: streamCombined });
380
+ for await (const chunk of rl) yield chunk.toString();
368
381
  await this._processClosed;
369
- e.removeAllListeners();
382
+ proc.removeAllListeners();
370
383
  if (this._thrownError) throw this._thrownError;
371
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this);
384
+ if (this._options?.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, void 0, this._command, this._args);
372
385
  }
373
386
  async _waitForOutput() {
374
- const e = this._process;
375
- if (!e) throw new Error("No process was started");
376
- const [t, n] = await Promise.all([this._streamOut ? F(this._streamOut) : "", this._streamErr ? F(this._streamErr) : ""]);
387
+ const proc = this._process;
388
+ if (!proc) throw new Error("No process was started");
389
+ const [stdout, stderr] = await Promise.all([this._streamOut ? readStream(this._streamOut) : "", this._streamErr ? readStream(this._streamErr) : ""]);
377
390
  await this._processClosed;
378
- const { stdin: r } = this._options;
379
- if (r && typeof r !== "string") await r;
380
- e.removeAllListeners();
391
+ const { stdin } = this._options;
392
+ if (stdin && typeof stdin !== "string") await stdin;
393
+ proc.removeAllListeners();
381
394
  if (this._thrownError) throw this._thrownError;
382
- const i = {
383
- stderr: n,
384
- stdout: t,
395
+ const result = {
396
+ stderr,
397
+ stdout,
385
398
  exitCode: this.exitCode
386
399
  };
387
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this, i);
388
- return i;
400
+ if (this._options.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, result, this._command, this._args);
401
+ return result;
389
402
  }
390
- then(e, t) {
391
- return this._waitForOutput().then(e, t);
403
+ then(onfulfilled, onrejected) {
404
+ return this._waitForOutput().then(onfulfilled, onrejected);
392
405
  }
393
406
  _streamOut;
394
407
  _streamErr;
395
408
  spawn() {
396
- const t = cwd();
397
- const r = this._options;
398
- const i = {
399
- ...N,
400
- ...r.nodeOptions
409
+ const cwd$1 = cwd();
410
+ const options = this._options;
411
+ const nodeOptions = {
412
+ ...defaultNodeOptions,
413
+ ...options.nodeOptions
401
414
  };
402
- const a = [];
415
+ const signals = [];
403
416
  this._resetState();
404
- if (r.timeout !== void 0) a.push(AbortSignal.timeout(r.timeout));
405
- if (r.signal !== void 0) a.push(r.signal);
406
- if (r.persist === true) i.detached = true;
407
- if (a.length > 0) i.signal = P(a);
408
- i.env = y(t, i.env, r.nodePath);
409
- const o = D(this._command, this._args, i);
410
- const s = spawn(o.command, o.args, o.options);
411
- if (s.stderr) this._streamErr = s.stderr;
412
- if (s.stdout) this._streamOut = s.stdout;
413
- this._process = s;
414
- s.once("error", this._onError);
415
- s.once("close", this._onClose);
416
- if (s.stdin) {
417
- const { stdin: e } = r;
418
- if (typeof e === "string") s.stdin.end(e);
419
- else e?.process?.stdout?.pipe(s.stdin);
417
+ if (options.timeout !== void 0) signals.push(AbortSignal.timeout(options.timeout));
418
+ if (options.signal !== void 0) signals.push(options.signal);
419
+ if (options.persist === true) nodeOptions.detached = true;
420
+ if (signals.length > 0) nodeOptions.signal = combineSignals(signals);
421
+ nodeOptions.env = computeEnv(cwd$1, nodeOptions.env, options.nodePath);
422
+ const crossResult = normalizeSpawnCommand(this._command, this._args, nodeOptions);
423
+ const handle = spawn(crossResult.command, crossResult.args, crossResult.options);
424
+ if (handle.stderr) this._streamErr = handle.stderr;
425
+ if (handle.stdout) this._streamOut = handle.stdout;
426
+ this._process = handle;
427
+ handle.once("error", this._onError);
428
+ handle.once("close", this._onClose);
429
+ if (handle.stdin) {
430
+ const { stdin } = options;
431
+ if (typeof stdin === "string") handle.stdin.end(stdin);
432
+ else stdin?.process?.stdout?.pipe(handle.stdin);
420
433
  }
421
434
  }
422
435
  _resetState() {
423
436
  this._aborted = false;
424
- this._processClosed = new Promise((e) => {
425
- this._resolveClose = e;
437
+ this._processClosed = new Promise((resolve) => {
438
+ this._resolveClose = resolve;
426
439
  });
427
440
  this._thrownError = void 0;
428
441
  }
429
- _onError = (e) => {
430
- if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
442
+ _onError = (err) => {
443
+ if (err.name === "AbortError" && (!(err.cause instanceof Error) || err.cause.name !== "TimeoutError")) {
431
444
  this._aborted = true;
432
445
  return;
433
446
  }
434
- this._thrownError = e;
447
+ this._thrownError = err;
435
448
  };
436
449
  _onClose = () => {
437
450
  if (this._resolveClose) this._resolveClose();
438
451
  };
439
452
  };
440
- const R = (e, t, n) => {
441
- const r = new I(e, t, n);
442
- r.spawn();
443
- return r;
453
+ const x = (command, args, userOptions) => {
454
+ const proc = new ExecProcess(command, args, userOptions);
455
+ proc.spawn();
456
+ return proc;
444
457
  };
445
- const z = R;
458
+ const exec$1 = x;
446
459
  //#endregion
447
460
  //#region ../../node_modules/.pnpm/lint-staged@16.4.0/node_modules/lint-staged/lib/execGit.js
448
461
  const debugLog$15 = createDebug("lint-staged:execGit");
@@ -457,7 +470,7 @@ const NO_SUBMODULE_RECURSE = ["-c", "submodule.recurse=false"];
457
470
  /** @type {(cmd: string[], options?: { cwd?: string }) => Promise<string>} */
458
471
  const execGit = async (cmd, options) => {
459
472
  debugLog$15("Running git command:", cmd);
460
- const result = z("git", [...NO_SUBMODULE_RECURSE, ...cmd], { nodeOptions: {
473
+ const result = exec$1("git", [...NO_SUBMODULE_RECURSE, ...cmd], { nodeOptions: {
461
474
  cwd: options?.cwd,
462
475
  stdio: ["ignore"]
463
476
  } });
@@ -1545,8 +1558,8 @@ var DefaultRenderer = class DefaultRenderer {
1545
1558
  this.logger.options.color = this.options.color;
1546
1559
  }
1547
1560
  async render() {
1548
- const { createLogUpdate } = await import("../log-update-DHZRyJ2m.js");
1549
- const { default: truncate } = await import("../cli-truncate-BVOlIIPy.js");
1561
+ const { createLogUpdate } = await import("../log-update-CoW8Z4Dl.js");
1562
+ const { default: truncate } = await import("../cli-truncate-Bg3RDXpi.js");
1550
1563
  const { default: wrap } = await import("../wrap-ansi-DUi52C6W.js");
1551
1564
  this.updater = createLogUpdate(this.logger.process.stdout);
1552
1565
  this.truncate = truncate;
@@ -1753,9 +1766,7 @@ var DefaultRenderer = class DefaultRenderer {
1753
1766
  });
1754
1767
  task.on(ListrTaskEventType.STATE, (state) => {
1755
1768
  switch (state) {
1756
- case ListrTaskState.RETRY || ListrTaskState.ROLLING_BACK:
1757
- this.buffer.bottom.delete(task.id);
1758
- break;
1769
+ case ListrTaskState.RETRY || ListrTaskState.ROLLING_BACK: this.buffer.bottom.delete(task.id);
1759
1770
  }
1760
1771
  });
1761
1772
  } else if (this.shouldOutputToOutputBar(task) && !this.buffer.output.has(task.id)) {
@@ -1765,9 +1776,7 @@ var DefaultRenderer = class DefaultRenderer {
1765
1776
  });
1766
1777
  task.on(ListrTaskEventType.STATE, (state) => {
1767
1778
  switch (state) {
1768
- case ListrTaskState.RETRY || ListrTaskState.ROLLING_BACK:
1769
- this.buffer.output.delete(task.id);
1770
- break;
1779
+ case ListrTaskState.RETRY || ListrTaskState.ROLLING_BACK: this.buffer.output.delete(task.id);
1771
1780
  }
1772
1781
  });
1773
1782
  }
@@ -3012,7 +3021,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3012
3021
  };
3013
3022
  module.exports = {
3014
3023
  DEFAULT_MAX_EXTGLOB_RECURSION,
3015
- MAX_LENGTH: 1024 * 64,
3024
+ MAX_LENGTH: 65536,
3016
3025
  POSIX_REGEX_SOURCE: {
3017
3026
  __proto__: null,
3018
3027
  alnum: "a-zA-Z0-9",
@@ -3891,10 +3900,12 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3891
3900
  }
3892
3901
  return esc ? m : `\\${m}`;
3893
3902
  });
3894
- if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
3895
- else output = output.replace(/\\+/g, (m) => {
3896
- return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
3897
- });
3903
+ if (backslashes === true) {
3904
+ if (opts.unescape === true) output = output.replace(/\\/g, "");
3905
+ else output = output.replace(/\\+/g, (m) => {
3906
+ return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
3907
+ });
3908
+ }
3898
3909
  if (output === input && opts.contains === true) {
3899
3910
  state.output = input;
3900
3911
  return state;
@@ -4665,8 +4676,10 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4665
4676
  output = format ? format(input) : input;
4666
4677
  match = output === glob;
4667
4678
  }
4668
- if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
4669
- else match = regex.exec(output);
4679
+ if (match === false || opts.capture === true) {
4680
+ if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
4681
+ else match = regex.exec(output);
4682
+ }
4670
4683
  return {
4671
4684
  isMatch: Boolean(match),
4672
4685
  match,
@@ -4898,13 +4911,14 @@ const generateTasks = ({ config, cwd = process.cwd(), files, relative = false })
4898
4911
  }));
4899
4912
  return Object.entries(config).map(([pattern, commands]) => {
4900
4913
  const isParentDirPattern = pattern.startsWith("../");
4914
+ const includedFiles = relativeFiles.filter((file) => {
4915
+ if (isParentDirPattern) return true;
4916
+ return !file.filepath.startsWith("..") && !path.isAbsolute(file.filepath);
4917
+ });
4901
4918
  const task = {
4902
4919
  pattern,
4903
4920
  commands,
4904
- fileList: matchFiles(relativeFiles.filter((file) => {
4905
- if (isParentDirPattern) return true;
4906
- return !file.filepath.startsWith("..") && !path.isAbsolute(file.filepath);
4907
- }), pattern, cwd).map((file) => ({
4921
+ fileList: matchFiles(includedFiles, pattern, cwd).map((file) => ({
4908
4922
  filepath: normalizePath(relative ? file.filepath : path.resolve(cwd, file.filepath)),
4909
4923
  status: file.status
4910
4924
  }))
@@ -5105,7 +5119,7 @@ const getSpawnedTask = ({ abortController, color, command, continueOnError = fal
5105
5119
  debugLog$12("Tinyexec options:", tinyExecOptions);
5106
5120
  /** @param {ReturnType<typeof getInitialState>} ctx context */
5107
5121
  return async (ctx = getInitialState()) => {
5108
- const result = z(cmd, isFn ? args : args.concat(files), tinyExecOptions);
5122
+ const result = exec$1(cmd, isFn ? args : args.concat(files), tinyExecOptions);
5109
5123
  const taskFailed = () => result.exitCode > 0 || result.process?.signalCode;
5110
5124
  /** @type {keyof typeof Signal | undefined} */
5111
5125
  let signal;
@@ -5946,7 +5960,7 @@ const jsonParse = async (filename) => {
5946
5960
  const yamlParse = async (filename) => {
5947
5961
  const isPackageFile = PACKAGE_YAML_FILES.includes(path.basename(filename));
5948
5962
  try {
5949
- const [YAML, content] = await Promise.all([import("../dist-CtM2JRbM.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)), readFile(filename)]);
5963
+ const [YAML, content] = await Promise.all([import("../dist-Dqv1-Clg.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)), readFile(filename)]);
5950
5964
  const yaml = YAML.parse(content);
5951
5965
  return isPackageFile ? yaml[CONFIG_NAME] : yaml;
5952
5966
  } catch (error) {
@@ -6206,7 +6220,7 @@ const listConfigFilesFromFs = async ({ cwd }) => {
6206
6220
  debugLog$3("Listing possible configs from filesystem starting from \"%s\"...", cwd);
6207
6221
  const possibleConfigFiles = (await Promise.allSettled(CONFIG_FILE_NAMES.map(async (f) => {
6208
6222
  const filepath = path.join(cwd, f);
6209
- await fsPromises.access(filepath, constants$1.F_OK);
6223
+ await fsPromises.access(filepath, constants$2.F_OK);
6210
6224
  return filepath;
6211
6225
  }))).flatMap((r) => r.status === "fulfilled" ? [normalizePath(r.value)] : []);
6212
6226
  if (possibleConfigFiles.length > 0) {
@@ -6752,7 +6766,8 @@ if (args.help) {
6752
6766
  try {
6753
6767
  stagedConfig = (await resolveViteConfig(args.cwd ?? process.cwd())).staged;
6754
6768
  } catch (err) {
6755
- log(`Failed to load vite.config: ${err instanceof Error ? err.message : String(err)}`);
6769
+ const message = err instanceof Error ? err.message : String(err);
6770
+ log(`Failed to load vite.config: ${message}`);
6756
6771
  process.exit(1);
6757
6772
  }
6758
6773
  if (stagedConfig) options.config = stagedConfig;