vite-plus 0.2.8 → 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 (74) hide show
  1. package/AGENTS.md +7 -0
  2. package/README.md +9 -3
  3. package/binding/index.cjs +54 -54
  4. package/binding/index.d.cts +7 -3
  5. package/dist/{agent-CI79DuSy.js → agent-DQU8uS6P.js} +4 -188
  6. package/dist/bin.js +288 -278
  7. package/dist/config/bin.js +27 -15
  8. package/dist/{constants-BppDcRc1.js → constants-CG513DRa.js} +10 -2
  9. package/dist/create/bin.js +178 -204
  10. package/dist/{define-config-DPnHe1Mx.js → define-config-CV4bQG_8.js} +3 -3
  11. package/dist/{define-config-CEm_MtvJ.cjs → define-config-DyNLA_f0.cjs} +1 -1
  12. package/dist/define-config.cjs +1 -1
  13. package/dist/define-config.js +1 -1
  14. package/dist/{dist-CSQWHI6y.js → dist-BDYZP12R.js} +193 -149
  15. package/dist/dist-Dqv1-Clg.js +3 -0
  16. package/dist/{editor-CGWdbLgD.js → editor-g4PosU99.js} +188 -108
  17. package/dist/hooks/bin.d.ts +1 -0
  18. package/dist/hooks/bin.js +130 -0
  19. package/dist/hooks-pNCBWtFT.js +570 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/{json-BU88uu6o.js → json-qlK6UH0r.js} +38 -32
  23. package/dist/migration/bin.js +15 -18
  24. package/dist/{oxlint-plugin-config-BHOzlwMw.js → oxlint-plugin-config-BEZ9IUf7.js} +1 -1
  25. package/dist/oxlint-plugin.js +1 -1
  26. package/dist/pack-bin.js +1 -1
  27. package/dist/{package-hV-77cBb.js → package-B4T8RGMG.js} +2 -2
  28. package/dist/{prompts-DYap08te.js → prompts-CHz_98bJ.js} +142 -50
  29. package/dist/{resolve-vite-config-EWXclqvV.js → resolve-vite-config-Dmeyeyj-.js} +2 -9
  30. package/dist/staged/bin.js +224 -206
  31. package/dist/{terminal-CrqqK8WT.js → terminal-Bz-ps6rJ.js} +33 -3
  32. package/dist/test/browser/providers/playwright/context.d.ts +1 -1
  33. package/dist/test/browser/providers/playwright.d.ts +6 -6
  34. package/dist/test/browser/providers/preview/context.d.ts +1 -1
  35. package/dist/test/browser/providers/preview.d.ts +4 -4
  36. package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
  37. package/dist/test/browser/providers/webdriverio.d.ts +6 -6
  38. package/dist/test/browser-playwright/context.d.ts +1 -1
  39. package/dist/test/browser-playwright.d.ts +6 -6
  40. package/dist/test/browser-preview/context.d.ts +1 -1
  41. package/dist/test/browser-preview.d.ts +4 -4
  42. package/dist/test/browser-webdriverio/context.d.ts +1 -1
  43. package/dist/test/browser-webdriverio.d.ts +6 -6
  44. package/dist/test/context.d.ts +3 -3
  45. package/dist/test/locators.d.ts +1 -1
  46. package/dist/toolchain.d.ts +25 -0
  47. package/dist/toolchain.js +194 -0
  48. package/dist/toolchain.json +193 -0
  49. package/dist/{tsconfig-CVUKLfL8.js → tsconfig-7v_BHagU.js} +3 -3
  50. package/dist/tsgolint-path.js +1 -1
  51. package/dist/version.js +4 -4
  52. package/dist/versions.d.ts +3 -3
  53. package/dist/versions.js +6 -6
  54. package/docs/guide/ci.md +37 -4
  55. package/docs/guide/commit-hooks.md +87 -14
  56. package/docs/guide/create.md +7 -4
  57. package/docs/guide/fmt.md +2 -2
  58. package/docs/guide/github-actions-cache.md +5 -1
  59. package/docs/guide/ide-integration.md +61 -2
  60. package/docs/guide/index.md +3 -1
  61. package/docs/guide/install.md +25 -0
  62. package/docs/guide/installer-env-vars.md +12 -1
  63. package/docs/guide/lint.md +3 -1
  64. package/docs/guide/migrate.md +39 -2
  65. package/docs/guide/monorepo.md +4 -4
  66. package/docs/guide/troubleshooting.md +12 -4
  67. package/docs/guide/upgrade.md +27 -4
  68. package/docs/package.json +1 -1
  69. package/docs/pnpm-workspace.yaml +7 -0
  70. package/docs/vite.config.ts +3 -0
  71. package/package.json +18 -14
  72. package/rules/vite-tools.yml +0 -7
  73. package/dist/dist-DT25H9pj.js +0 -3
  74. package/dist/{tsgolint-path-eMZT-oea.js → tsgolint-path-CbDReEOx.js} +1 -1
@@ -1,9 +1,10 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-CMFfr-1z.js";
2
- import { a as printHeader, c as renderCliDoc, n as errorMsg, r as log } from "../terminal-CrqqK8WT.js";
3
- import { a as resolveViteConfig } from "../resolve-vite-config-EWXclqvV.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
5
  import { createRequire } from "node:module";
6
6
  import path, { basename, delimiter, dirname, normalize, resolve } from "node:path";
7
+ import { pathToFileURL } from "node:url";
7
8
  import { formatWithOptions, inspect, promisify } from "node:util";
8
9
  import { closeSync, constants, openSync, readSync, statSync } from "node:fs";
9
10
  import { EOL } from "node:os";
@@ -11,7 +12,6 @@ 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
15
  import fsPromises, { constants as constants$2 } from "node:fs/promises";
16
16
  import { PassThrough, Writable } from "node:stream";
17
17
  import { exec, spawn } from "node:child_process";
@@ -117,201 +117,212 @@ const createDebug = (name) => {
117
117
  };
118
118
  };
119
119
  //#endregion
120
- //#region ../../node_modules/.pnpm/tinyexec@1.2.4/node_modules/tinyexec/dist/main.mjs
121
- const h = /^path$/i;
122
- 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 = {
123
123
  key: "PATH",
124
124
  value: ""
125
125
  };
126
- function _(e) {
127
- for (const t in e) {
128
- if (!Object.prototype.hasOwnProperty.call(e, t) || !h.test(t)) continue;
129
- const n = e[t];
130
- 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;
131
131
  return {
132
- key: t,
133
- value: n
132
+ key,
133
+ value
134
134
  };
135
135
  }
136
- return g;
136
+ return defaultEnvPathInfo;
137
137
  }
138
- function v(e, t) {
139
- const n = t.value.split(delimiter);
140
- const r = [];
141
- let o = e;
142
- let c;
138
+ function addNodeBinToPath(cwd, path) {
139
+ const parts = path.value.split(delimiter);
140
+ const nodeBinPaths = [];
141
+ let currentPath = cwd;
142
+ let lastPath;
143
143
  do {
144
- r.push(resolve(o, "node_modules", ".bin"));
145
- c = o;
146
- o = dirname(o);
147
- } while (o !== c);
148
- r.push(dirname(process.execPath));
149
- 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);
150
150
  return {
151
- key: t.key,
152
- value: l
151
+ key: path.key,
152
+ value: newPath
153
153
  };
154
154
  }
155
- function y(e, t, n = true) {
156
- const r = {
155
+ function computeEnv(cwd, env, nodePath = true) {
156
+ const envWithDefault = {
157
157
  ...process.env,
158
- ...t
158
+ ...env
159
159
  };
160
- if (!n) return r;
161
- const i = v(e, _(r));
162
- r[i.key] = i.value;
163
- return r;
160
+ if (!nodePath) return envWithDefault;
161
+ const envPathInfo = addNodeBinToPath(cwd, getPathFromEnv(envWithDefault));
162
+ envWithDefault[envPathInfo.key] = envPathInfo.value;
163
+ return envWithDefault;
164
164
  }
165
- const b = (e) => {
166
- let t = e.length;
167
- const n = new PassThrough();
168
- const r = () => {
169
- 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();
170
170
  };
171
- for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
172
- return n;
171
+ for (const stream of streams) pipeline(stream, combined, { end: false }).then(maybeEmitEnd).catch(maybeEmitEnd);
172
+ return combined;
173
173
  };
174
- const x = /([()\][%!^"`<>&|;, *?])/g;
175
- const S = /^#!\s*(.+)/;
176
- const C = /\.(?:com|exe)$/i;
177
- const w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
178
- const T = process.platform === "win32";
179
- 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 = [
180
180
  ".EXE",
181
181
  ".CMD",
182
182
  ".BAT",
183
183
  ".COM"
184
184
  ];
185
+ const noPathExt = [""];
185
186
  /**
186
187
  * Normalizes the command and arguments to work cross-platform.
187
188
  * On Windows, this basically handles things like shebangs, calling
188
189
  * `node_modules/.bin` commands, and escaping meta characters.
189
190
  * On other platforms, it just returns the command and arguments as-is.
190
191
  */
191
- function D(e, t = [], n = {}) {
192
- if (n.shell === true || !T) return {
193
- command: e,
194
- args: t,
195
- options: n
192
+ function normalizeSpawnCommand(command, args = [], options = {}) {
193
+ if (options.shell === true || !isWindows$1) return {
194
+ command,
195
+ args,
196
+ options
196
197
  };
197
- let i = O(e, n);
198
- let a = null;
199
- if (i !== null) {
200
- const e = 150;
201
- const t = Buffer.alloc(e);
202
- 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;
203
204
  try {
204
- n = openSync(i, "r");
205
- readSync(n, t, 0, e, 0);
205
+ fd = openSync(file, "r");
206
+ readSync(fd, buffer, 0, size, 0);
206
207
  } catch {} finally {
207
- if (n !== null) closeSync(n);
208
+ if (fd !== null) closeSync(fd);
208
209
  }
209
- const o = t.toString().match(S);
210
- if (o !== null) {
211
- const e = o[1].trim();
212
- const t = e.indexOf(" ");
213
- const n = t !== -1 ? e.slice(0, t) : e;
214
- const i = t !== -1 ? e.slice(t + 1) : "";
215
- const s = basename(n);
216
- 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;
217
218
  }
218
219
  }
219
- if (a !== null && i !== null) {
220
- t = [i, ...t];
221
- e = a;
222
- i = O(e, n);
223
- }
224
- if (i === null || !C.test(i)) {
225
- const r = i !== null && w.test(i);
226
- e = normalize(e);
227
- e = e.replace(x, "^$1");
228
- t = t.map((e) => {
229
- e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
230
- e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
231
- e = `"${e}"`;
232
- e = e.replace(x, "^$1");
233
- if (r) e = e.replace(x, "^$1");
234
- 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;
235
236
  });
236
- t = [
237
+ args = [
237
238
  "/d",
238
239
  "/s",
239
240
  "/c",
240
- `"${[e, ...t].join(" ")}"`
241
+ `"${[command, ...args].join(" ")}"`
241
242
  ];
242
- e = n.env?.comspec ?? "cmd.exe";
243
- n = {
244
- ...n,
243
+ command = options.env?.comspec ?? "cmd.exe";
244
+ options = {
245
+ ...options,
245
246
  windowsVerbatimArguments: true
246
247
  };
247
248
  }
248
249
  return {
249
- command: e,
250
- args: t,
251
- options: n
250
+ command,
251
+ args,
252
+ options
252
253
  };
253
254
  }
254
255
  /**
255
256
  * Resolves the command to an absolute path if possible.
256
257
  * Handles things like traversing PATH and adding extensions from PATHEXT
257
258
  */
258
- function O(e, t) {
259
- const r = (t.cwd ?? cwd()).toString();
260
- const a = t.env ?? process.env;
261
- const o = _(a).value;
262
- const c = e.includes("/") || e.includes("\\") ? [""] : [r, ...o.split(delimiter)];
263
- const l = a.PATHEXT ? a.PATHEXT.split(delimiter) : E;
264
- if (e.includes(".") && l[0] !== "") l.unshift("");
265
- for (const t of c) {
266
- const n = resolve(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
267
- for (const e of l) {
268
- 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;
269
270
  try {
270
- if (statSync(t).isFile()) return t;
271
+ if (statSync(destWithExt).isFile()) return destWithExt;
271
272
  } catch {}
272
273
  }
273
274
  }
274
275
  return null;
275
276
  }
276
- var k = class extends Error {
277
+ var NonZeroExitError = class extends Error {
277
278
  result;
278
279
  output;
279
- get exitCode() {
280
- if (this.result.exitCode !== null) return this.result.exitCode;
281
- }
282
- constructor(e, t) {
283
- super(`Process exited with non-zero status (${e.exitCode})`);
284
- this.result = e;
285
- 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
+ });
286
297
  }
287
298
  };
288
- const j = {
299
+ const defaultOptions = {
289
300
  timeout: void 0,
290
301
  persist: false
291
302
  };
292
- const N = { windowsHide: true };
293
- function P(e) {
294
- const t = new AbortController();
295
- for (const n of e) {
296
- if (n.aborted) {
297
- t.abort();
298
- 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;
299
310
  }
300
- const e = () => {
301
- t.abort(n.reason);
311
+ const onAbort = () => {
312
+ controller.abort(signal.reason);
302
313
  };
303
- n.addEventListener("abort", e, { signal: t.signal });
314
+ signal.addEventListener("abort", onAbort, { signal: controller.signal });
304
315
  }
305
- return t.signal;
316
+ return controller.signal;
306
317
  }
307
- async function F(e) {
308
- let t = "";
318
+ async function readStream(stream) {
319
+ let output = "";
309
320
  try {
310
- for await (const n of e) t += n.toString();
321
+ for await (const chunk of stream) output += chunk.toString();
311
322
  } catch {}
312
- return t;
323
+ return output;
313
324
  }
314
- var I = class {
325
+ var ExecProcess = class {
315
326
  _process;
316
327
  _aborted = false;
317
328
  _options;
@@ -329,19 +340,22 @@ var I = class {
329
340
  get exitCode() {
330
341
  if (this._process && this._process.exitCode !== null) return this._process.exitCode;
331
342
  }
332
- constructor(e, t, n) {
343
+ get signalCode() {
344
+ return this._process?.signalCode ?? null;
345
+ }
346
+ constructor(command, args, options) {
333
347
  this._options = {
334
- ...j,
335
- ...n
348
+ ...defaultOptions,
349
+ ...options
336
350
  };
337
- this._command = e;
338
- this._args = t ?? [];
339
- this._processClosed = new Promise((e) => {
340
- this._resolveClose = e;
351
+ this._command = command;
352
+ this._args = args ?? [];
353
+ this._processClosed = new Promise((resolve) => {
354
+ this._resolveClose = resolve;
341
355
  });
342
356
  }
343
- kill(e) {
344
- return this._process?.kill(e) === true;
357
+ kill(signal) {
358
+ return this._process?.kill(signal) === true;
345
359
  }
346
360
  get aborted() {
347
361
  return this._aborted;
@@ -349,99 +363,99 @@ var I = class {
349
363
  get killed() {
350
364
  return this._process?.killed === true;
351
365
  }
352
- pipe(e, t, n) {
353
- return z(e, t, {
354
- ...n,
366
+ pipe(command, args, options) {
367
+ return exec$1(command, args, {
368
+ ...options,
355
369
  stdin: this
356
370
  });
357
371
  }
358
372
  async *[Symbol.asyncIterator]() {
359
- const e = this._process;
360
- if (!e) return;
361
- const t = [];
362
- if (this._streamErr) t.push(this._streamErr);
363
- if (this._streamOut) t.push(this._streamOut);
364
- const n = b(t);
365
- const r = l__default.createInterface({ input: n });
366
- 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();
367
381
  await this._processClosed;
368
- e.removeAllListeners();
382
+ proc.removeAllListeners();
369
383
  if (this._thrownError) throw this._thrownError;
370
- 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);
371
385
  }
372
386
  async _waitForOutput() {
373
- const e = this._process;
374
- if (!e) throw new Error("No process was started");
375
- 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) : ""]);
376
390
  await this._processClosed;
377
- const { stdin: r } = this._options;
378
- if (r && typeof r !== "string") await r;
379
- e.removeAllListeners();
391
+ const { stdin } = this._options;
392
+ if (stdin && typeof stdin !== "string") await stdin;
393
+ proc.removeAllListeners();
380
394
  if (this._thrownError) throw this._thrownError;
381
- const i = {
382
- stderr: n,
383
- stdout: t,
395
+ const result = {
396
+ stderr,
397
+ stdout,
384
398
  exitCode: this.exitCode
385
399
  };
386
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this, i);
387
- 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;
388
402
  }
389
- then(e, t) {
390
- return this._waitForOutput().then(e, t);
403
+ then(onfulfilled, onrejected) {
404
+ return this._waitForOutput().then(onfulfilled, onrejected);
391
405
  }
392
406
  _streamOut;
393
407
  _streamErr;
394
408
  spawn() {
395
- const t = cwd();
396
- const r = this._options;
397
- const i = {
398
- ...N,
399
- ...r.nodeOptions
409
+ const cwd$1 = cwd();
410
+ const options = this._options;
411
+ const nodeOptions = {
412
+ ...defaultNodeOptions,
413
+ ...options.nodeOptions
400
414
  };
401
- const a = [];
415
+ const signals = [];
402
416
  this._resetState();
403
- if (r.timeout !== void 0) a.push(AbortSignal.timeout(r.timeout));
404
- if (r.signal !== void 0) a.push(r.signal);
405
- if (r.persist === true) i.detached = true;
406
- if (a.length > 0) i.signal = P(a);
407
- i.env = y(t, i.env, r.nodePath);
408
- const o = D(this._command, this._args, i);
409
- const s = spawn(o.command, o.args, o.options);
410
- if (s.stderr) this._streamErr = s.stderr;
411
- if (s.stdout) this._streamOut = s.stdout;
412
- this._process = s;
413
- s.once("error", this._onError);
414
- s.once("close", this._onClose);
415
- if (s.stdin) {
416
- const { stdin: e } = r;
417
- if (typeof e === "string") s.stdin.end(e);
418
- 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);
419
433
  }
420
434
  }
421
435
  _resetState() {
422
436
  this._aborted = false;
423
- this._processClosed = new Promise((e) => {
424
- this._resolveClose = e;
437
+ this._processClosed = new Promise((resolve) => {
438
+ this._resolveClose = resolve;
425
439
  });
426
440
  this._thrownError = void 0;
427
441
  }
428
- _onError = (e) => {
429
- 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")) {
430
444
  this._aborted = true;
431
445
  return;
432
446
  }
433
- this._thrownError = e;
447
+ this._thrownError = err;
434
448
  };
435
449
  _onClose = () => {
436
450
  if (this._resolveClose) this._resolveClose();
437
451
  };
438
452
  };
439
- const R = (e, t, n) => {
440
- const r = new I(e, t, n);
441
- r.spawn();
442
- return r;
453
+ const x = (command, args, userOptions) => {
454
+ const proc = new ExecProcess(command, args, userOptions);
455
+ proc.spawn();
456
+ return proc;
443
457
  };
444
- const z = R;
458
+ const exec$1 = x;
445
459
  //#endregion
446
460
  //#region ../../node_modules/.pnpm/lint-staged@16.4.0/node_modules/lint-staged/lib/execGit.js
447
461
  const debugLog$15 = createDebug("lint-staged:execGit");
@@ -456,7 +470,7 @@ const NO_SUBMODULE_RECURSE = ["-c", "submodule.recurse=false"];
456
470
  /** @type {(cmd: string[], options?: { cwd?: string }) => Promise<string>} */
457
471
  const execGit = async (cmd, options) => {
458
472
  debugLog$15("Running git command:", cmd);
459
- const result = z("git", [...NO_SUBMODULE_RECURSE, ...cmd], { nodeOptions: {
473
+ const result = exec$1("git", [...NO_SUBMODULE_RECURSE, ...cmd], { nodeOptions: {
460
474
  cwd: options?.cwd,
461
475
  stdio: ["ignore"]
462
476
  } });
@@ -3886,10 +3900,12 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3886
3900
  }
3887
3901
  return esc ? m : `\\${m}`;
3888
3902
  });
3889
- if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
3890
- else output = output.replace(/\\+/g, (m) => {
3891
- return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
3892
- });
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
+ }
3893
3909
  if (output === input && opts.contains === true) {
3894
3910
  state.output = input;
3895
3911
  return state;
@@ -4660,8 +4676,10 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4660
4676
  output = format ? format(input) : input;
4661
4677
  match = output === glob;
4662
4678
  }
4663
- if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
4664
- 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
+ }
4665
4683
  return {
4666
4684
  isMatch: Boolean(match),
4667
4685
  match,
@@ -5101,7 +5119,7 @@ const getSpawnedTask = ({ abortController, color, command, continueOnError = fal
5101
5119
  debugLog$12("Tinyexec options:", tinyExecOptions);
5102
5120
  /** @param {ReturnType<typeof getInitialState>} ctx context */
5103
5121
  return async (ctx = getInitialState()) => {
5104
- const result = z(cmd, isFn ? args : args.concat(files), tinyExecOptions);
5122
+ const result = exec$1(cmd, isFn ? args : args.concat(files), tinyExecOptions);
5105
5123
  const taskFailed = () => result.exitCode > 0 || result.process?.signalCode;
5106
5124
  /** @type {keyof typeof Signal | undefined} */
5107
5125
  let signal;
@@ -5942,7 +5960,7 @@ const jsonParse = async (filename) => {
5942
5960
  const yamlParse = async (filename) => {
5943
5961
  const isPackageFile = PACKAGE_YAML_FILES.includes(path.basename(filename));
5944
5962
  try {
5945
- const [YAML, content] = await Promise.all([import("../dist-DT25H9pj.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)]);
5946
5964
  const yaml = YAML.parse(content);
5947
5965
  return isPackageFile ? yaml[CONFIG_NAME] : yaml;
5948
5966
  } catch (error) {