@voidzero-dev/vite-plus-core 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 (58) hide show
  1. package/LICENSE +30 -1
  2. package/dist/rolldown/cli.mjs +14 -10
  3. package/dist/rolldown/config.d.mts +1 -1
  4. package/dist/rolldown/config.mjs +2 -2
  5. package/dist/rolldown/experimental-index.d.mts +2 -2
  6. package/dist/rolldown/experimental-index.mjs +8 -8
  7. package/dist/rolldown/filter-index.d.mts +1 -1
  8. package/dist/rolldown/index.d.mts +1 -1
  9. package/dist/rolldown/index.mjs +4 -4
  10. package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
  11. package/dist/rolldown/parallel-plugin.d.mts +1 -1
  12. package/dist/rolldown/parse-ast-index.mjs +1 -1
  13. package/dist/rolldown/plugins-index.d.mts +2 -2
  14. package/dist/rolldown/plugins-index.mjs +2 -2
  15. package/dist/rolldown/shared/binding-CKyeQZen.mjs +673 -0
  16. package/dist/rolldown/shared/{bindingify-input-options-B03y7DfJ.mjs → bindingify-input-options-44iPAymO.mjs} +6 -10
  17. package/dist/rolldown/shared/{constructors-COwFYQna.mjs → constructors-6Zc-JFd7.mjs} +1 -1
  18. package/dist/rolldown/shared/{constructors-ALilxAii.d.mts → constructors-XaIbWpwJ.d.mts} +1 -1
  19. package/dist/rolldown/shared/{create-bundler-option-B-tSTZRt.mjs → create-bundler-option-e1FU0w0P.mjs} +3 -3
  20. package/dist/rolldown/shared/{define-config-DSMNXceb.d.mts → define-config-DVsXPNaU.d.mts} +0 -4
  21. package/dist/rolldown/shared/{error-nLggAzpQ.mjs → error-BzLGqhSQ.mjs} +1 -1
  22. package/dist/rolldown/shared/{load-config-O4G7NVNA.mjs → load-config-C6QXSnoS.mjs} +1 -1
  23. package/dist/rolldown/shared/{normalize-string-or-regex-Cj-DgIV1.mjs → normalize-string-or-regex-DYjJ67tj.mjs} +1 -1
  24. package/dist/rolldown/shared/{parse-CQfUbVuN.mjs → parse-uDDyc1el.mjs} +2 -2
  25. package/dist/rolldown/shared/{resolve-tsconfig-CE3HNSOK.mjs → resolve-tsconfig-Bcd82vVT.mjs} +2 -2
  26. package/dist/rolldown/shared/{rolldown-qV_fUwyM.mjs → rolldown-CCbQNGZt.mjs} +4 -4
  27. package/dist/rolldown/shared/{watch-BNIsji74.mjs → watch-vuOCmvFs.mjs} +5 -5
  28. package/dist/rolldown/utils-index.d.mts +1 -1
  29. package/dist/rolldown/utils-index.mjs +15 -13
  30. package/dist/tsdown/{build-D_enfyvD-X5SFXZZc.js → build-D_enfyvD-Dg1eKRD4.js} +20 -16
  31. package/dist/tsdown/{debug-CKcBYQLP-avlAPNcV.js → debug-CKcBYQLP-C3NhYhrk.js} +3 -3
  32. package/dist/tsdown/{detect-DGhJGEqb-CGd2brAW.js → detect-DGhJGEqb-6CTf16BW.js} +1 -1
  33. package/dist/tsdown/{dist-BZO8q3c0.js → dist-DyXLnzyh.js} +4 -4
  34. package/dist/tsdown/index-types.d.ts +3 -3
  35. package/dist/tsdown/index.js +4 -4
  36. package/dist/tsdown/internal-DKworeK4.js +3 -0
  37. package/dist/tsdown/{main-Jz_9T-KA.js → main-DiierkER.js} +210 -196
  38. package/dist/tsdown/npm_entry_picomatch.cjs +10 -6
  39. package/dist/tsdown/npm_entry_tree-kill.cjs +4 -2
  40. package/dist/tsdown/{resolver-cwLsPb2o-BqQjnCbF.js → resolver-cwLsPb2o-Dk4xdAGE.js} +2 -2
  41. package/dist/tsdown/run.js +6 -6
  42. package/dist/tsdown/{src-D5keKqGd.js → src-drVPfX63.js} +1 -1
  43. package/dist/tsdown/{target-Bab3CUeB-CERZYTwS.js → target-Bab3CUeB-DQ0pKhCv.js} +5 -5
  44. package/dist/tsdown/{tsc-DmzrnJwy.js → tsc-JnMl2z7d.js} +3 -3
  45. package/dist/tsdown/tsdown-css.js +4 -4
  46. package/dist/tsdown/tsdown-exe.js +4 -4
  47. package/dist/vite/client/bundledDevClient.mjs +330 -14
  48. package/dist/vite/client/client.mjs +20 -14
  49. package/dist/vite/node/chunks/build.js +51 -45
  50. package/dist/vite/node/chunks/dist.js +36 -29
  51. package/dist/vite/node/chunks/dist2.js +193 -149
  52. package/dist/vite/node/chunks/node.js +931 -793
  53. package/dist/vite/node/chunks/postcss-import.js +10 -9
  54. package/dist/vite/node/index.d.ts +7 -5
  55. package/dist/vite/node/module-runner.js +23 -17
  56. package/package.json +26 -20
  57. package/dist/rolldown/shared/binding-DwUQWZOo.mjs +0 -662
  58. package/dist/tsdown/internal-DyaNxVWW.js +0 -3
@@ -41,7 +41,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
41
41
  }) : target, mod));
42
42
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
43
43
  //#endregion
44
- //#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@t_3f66331a323f6503c9462b3ef80883b8/node_modules/tsdown/dist/general-BbZk8B18.mjs
44
+ //#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@t_8361ec2a4d03114085b1954a2fc42e35/node_modules/tsdown/dist/general-BbZk8B18.mjs
45
45
  const picomatch = createRequire(import.meta.url)("./npm_entry_picomatch.cjs");
46
46
  function toArray(val, defaultValue) {
47
47
  if (Array.isArray(val)) return val;
@@ -476,7 +476,7 @@ function formatArgs(diff, args) {
476
476
  function log(...args) {
477
477
  process.stderr.write(`${formatWithOptions(this.inspectOpts, ...args)}\n`);
478
478
  }
479
- const defaultOptions = {
479
+ const defaultOptions$1 = {
480
480
  useColors: useColors(),
481
481
  formatArgs,
482
482
  formatters: {
@@ -502,7 +502,7 @@ const defaultOptions = {
502
502
  function createDebug(namespace, options) {
503
503
  var _ref;
504
504
  const color = (_ref = options && options.color) !== null && _ref !== void 0 ? _ref : selectColor(colors, namespace);
505
- return createDebug$1(namespace, Object.assign(defaultOptions, { color }, options));
505
+ return createDebug$1(namespace, Object.assign(defaultOptions$1, { color }, options));
506
506
  }
507
507
  function save(namespaces) {
508
508
  if (namespaces) env.DEBUG = namespaces;
@@ -518,201 +518,212 @@ function enable(namespaces) {
518
518
  }
519
519
  enable$1(env.DEBUG || "");
520
520
  //#endregion
521
- //#region ../../node_modules/.pnpm/tinyexec@1.2.4/node_modules/tinyexec/dist/main.mjs
522
- const h = /^path$/i;
523
- const g = {
521
+ //#region ../../node_modules/.pnpm/tinyexec@1.3.0/node_modules/tinyexec/dist/main.mjs
522
+ const isPathLikePattern = /^path$/i;
523
+ const defaultEnvPathInfo = {
524
524
  key: "PATH",
525
525
  value: ""
526
526
  };
527
- function _(e) {
528
- for (const t in e) {
529
- if (!Object.prototype.hasOwnProperty.call(e, t) || !h.test(t)) continue;
530
- const n = e[t];
531
- if (!n) return g;
527
+ function getPathFromEnv(env) {
528
+ for (const key in env) {
529
+ if (!Object.prototype.hasOwnProperty.call(env, key) || !isPathLikePattern.test(key)) continue;
530
+ const value = env[key];
531
+ if (!value) return defaultEnvPathInfo;
532
532
  return {
533
- key: t,
534
- value: n
533
+ key,
534
+ value
535
535
  };
536
536
  }
537
- return g;
537
+ return defaultEnvPathInfo;
538
538
  }
539
- function v(e, t) {
540
- const n = t.value.split(delimiter);
541
- const r = [];
542
- let o = e;
543
- let c;
539
+ function addNodeBinToPath(cwd, path) {
540
+ const parts = path.value.split(delimiter);
541
+ const nodeBinPaths = [];
542
+ let currentPath = cwd;
543
+ let lastPath;
544
544
  do {
545
- r.push(resolve(o, "node_modules", ".bin"));
546
- c = o;
547
- o = dirname(o);
548
- } while (o !== c);
549
- r.push(dirname(process.execPath));
550
- const l = r.concat(n).join(delimiter);
545
+ nodeBinPaths.push(resolve(currentPath, "node_modules", ".bin"));
546
+ lastPath = currentPath;
547
+ currentPath = dirname(currentPath);
548
+ } while (currentPath !== lastPath);
549
+ nodeBinPaths.push(dirname(process.execPath));
550
+ const newPath = nodeBinPaths.concat(parts).join(delimiter);
551
551
  return {
552
- key: t.key,
553
- value: l
552
+ key: path.key,
553
+ value: newPath
554
554
  };
555
555
  }
556
- function y(e, t, n = true) {
557
- const r = {
556
+ function computeEnv(cwd, env, nodePath = true) {
557
+ const envWithDefault = {
558
558
  ...process.env,
559
- ...t
559
+ ...env
560
560
  };
561
- if (!n) return r;
562
- const i = v(e, _(r));
563
- r[i.key] = i.value;
564
- return r;
561
+ if (!nodePath) return envWithDefault;
562
+ const envPathInfo = addNodeBinToPath(cwd, getPathFromEnv(envWithDefault));
563
+ envWithDefault[envPathInfo.key] = envPathInfo.value;
564
+ return envWithDefault;
565
565
  }
566
- const b = (e) => {
567
- let t = e.length;
568
- const n = new PassThrough();
569
- const r = () => {
570
- if (--t === 0) n.end();
566
+ const combineStreams = (streams) => {
567
+ let streamCount = streams.length;
568
+ const combined = new PassThrough();
569
+ const maybeEmitEnd = () => {
570
+ if (--streamCount === 0) combined.end();
571
571
  };
572
- for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
573
- return n;
572
+ for (const stream of streams) pipeline(stream, combined, { end: false }).then(maybeEmitEnd).catch(maybeEmitEnd);
573
+ return combined;
574
574
  };
575
- const x = /([()\][%!^"`<>&|;, *?])/g;
576
- const S = /^#!\s*(.+)/;
577
- const C = /\.(?:com|exe)$/i;
578
- const w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
579
- const T = process.platform === "win32";
580
- const E = [
575
+ const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
576
+ const shebangRegExp = /^#!\s*(.+)/;
577
+ const isWindowsExecutableRegExp = /\.(?:com|exe)$/i;
578
+ const isNodeModulesCmdRegExp = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
579
+ const isWindows = process.platform === "win32";
580
+ const defaultPathExt = [
581
581
  ".EXE",
582
582
  ".CMD",
583
583
  ".BAT",
584
584
  ".COM"
585
585
  ];
586
+ const noPathExt = [""];
586
587
  /**
587
588
  * Normalizes the command and arguments to work cross-platform.
588
589
  * On Windows, this basically handles things like shebangs, calling
589
590
  * `node_modules/.bin` commands, and escaping meta characters.
590
591
  * On other platforms, it just returns the command and arguments as-is.
591
592
  */
592
- function D(e, t = [], n = {}) {
593
- if (n.shell === true || !T) return {
594
- command: e,
595
- args: t,
596
- options: n
593
+ function normalizeSpawnCommand(command, args = [], options = {}) {
594
+ if (options.shell === true || !isWindows) return {
595
+ command,
596
+ args,
597
+ options
597
598
  };
598
- let i = O(e, n);
599
- let a = null;
600
- if (i !== null) {
601
- const e = 150;
602
- const t = Buffer.alloc(e);
603
- let n = null;
599
+ let file = resolveCommand(command, options);
600
+ let shebang = null;
601
+ if (file !== null) {
602
+ const size = 150;
603
+ const buffer = Buffer.alloc(size);
604
+ let fd = null;
604
605
  try {
605
- n = openSync(i, "r");
606
- readSync(n, t, 0, e, 0);
606
+ fd = openSync(file, "r");
607
+ readSync(fd, buffer, 0, size, 0);
607
608
  } catch {} finally {
608
- if (n !== null) closeSync(n);
609
+ if (fd !== null) closeSync(fd);
609
610
  }
610
- const o = t.toString().match(S);
611
- if (o !== null) {
612
- const e = o[1].trim();
613
- const t = e.indexOf(" ");
614
- const n = t !== -1 ? e.slice(0, t) : e;
615
- const i = t !== -1 ? e.slice(t + 1) : "";
616
- const s = basename(n);
617
- a = s === "env" ? i || null : s;
611
+ const match = buffer.toString().match(shebangRegExp);
612
+ if (match !== null) {
613
+ const line = match[1].trim();
614
+ const separatorIndex = line.indexOf(" ");
615
+ const path = separatorIndex !== -1 ? line.slice(0, separatorIndex) : line;
616
+ const argument = separatorIndex !== -1 ? line.slice(separatorIndex + 1) : "";
617
+ const binary = basename(path);
618
+ shebang = binary === "env" ? argument || null : binary;
618
619
  }
619
620
  }
620
- if (a !== null && i !== null) {
621
- t = [i, ...t];
622
- e = a;
623
- i = O(e, n);
621
+ if (shebang !== null && file !== null) {
622
+ args = [file, ...args];
623
+ command = shebang;
624
+ file = resolveCommand(command, options);
624
625
  }
625
- if (i === null || !C.test(i)) {
626
- const r = i !== null && w.test(i);
627
- e = normalize(e);
628
- e = e.replace(x, "^$1");
629
- t = t.map((e) => {
630
- e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
631
- e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
632
- e = `"${e}"`;
633
- e = e.replace(x, "^$1");
634
- if (r) e = e.replace(x, "^$1");
635
- return e;
626
+ if (file === null || !isWindowsExecutableRegExp.test(file)) {
627
+ const needsDoubleEscapeMetaChars = file !== null && isNodeModulesCmdRegExp.test(file);
628
+ command = normalize(command);
629
+ command = command.replace(metaCharsRegExp, "^$1");
630
+ args = args.map((arg) => {
631
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
632
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
633
+ arg = `"${arg}"`;
634
+ arg = arg.replace(metaCharsRegExp, "^$1");
635
+ if (needsDoubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, "^$1");
636
+ return arg;
636
637
  });
637
- t = [
638
+ args = [
638
639
  "/d",
639
640
  "/s",
640
641
  "/c",
641
- `"${[e, ...t].join(" ")}"`
642
+ `"${[command, ...args].join(" ")}"`
642
643
  ];
643
- e = n.env?.comspec ?? "cmd.exe";
644
- n = {
645
- ...n,
644
+ command = options.env?.comspec ?? "cmd.exe";
645
+ options = {
646
+ ...options,
646
647
  windowsVerbatimArguments: true
647
648
  };
648
649
  }
649
650
  return {
650
- command: e,
651
- args: t,
652
- options: n
651
+ command,
652
+ args,
653
+ options
653
654
  };
654
655
  }
655
656
  /**
656
657
  * Resolves the command to an absolute path if possible.
657
658
  * Handles things like traversing PATH and adding extensions from PATHEXT
658
659
  */
659
- function O(e, t) {
660
- const r = (t.cwd ?? cwd()).toString();
661
- const a = t.env ?? process.env;
662
- const o = _(a).value;
663
- const c = e.includes("/") || e.includes("\\") ? [""] : [r, ...o.split(delimiter)];
664
- const l = a.PATHEXT ? a.PATHEXT.split(delimiter) : E;
665
- if (e.includes(".") && l[0] !== "") l.unshift("");
666
- for (const t of c) {
667
- const n = resolve(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
668
- for (const e of l) {
669
- const t = n + e;
660
+ function resolveCommand(command, options) {
661
+ const cwd$3 = (options.cwd ?? cwd()).toString();
662
+ const env = options.env ?? process.env;
663
+ const PATH = getPathFromEnv(env).value;
664
+ const pathEnv = command.includes("/") || command.includes("\\") ? [""] : [cwd$3, ...PATH.split(delimiter)];
665
+ let pathExt = env.PATHEXT ? env.PATHEXT.split(delimiter) : defaultPathExt;
666
+ if (command.includes(".") && pathExt[0] !== "") pathExt = ["", ...pathExt];
667
+ for (const extensions of [pathExt, noPathExt]) for (const path of pathEnv) {
668
+ const dest = resolve(cwd$3, path.startsWith("\"") && path.endsWith("\"") && path.length > 1 ? path.slice(1, -1) : path, command);
669
+ for (const ext of extensions) {
670
+ const destWithExt = dest + ext;
670
671
  try {
671
- if (statSync(t).isFile()) return t;
672
+ if (statSync(destWithExt).isFile()) return destWithExt;
672
673
  } catch {}
673
674
  }
674
675
  }
675
676
  return null;
676
677
  }
677
- var k = class extends Error {
678
+ var NonZeroExitError = class extends Error {
678
679
  result;
679
680
  output;
680
- get exitCode() {
681
- if (this.result.exitCode !== null) return this.result.exitCode;
681
+ exitCode;
682
+ get signalCode() {
683
+ return this.result.signalCode;
682
684
  }
683
- constructor(e, t) {
684
- super(`Process exited with non-zero status (${e.exitCode})`);
685
- this.result = e;
686
- this.output = t;
685
+ constructor(result, output, command, args) {
686
+ let target = "The process";
687
+ if (command) target = `The command \`${args?.length ? `${command} ${args.map((a) => /[ "'`()]/.test(a) ? JSON.stringify(a) : a).join(" ")}` : command}\``;
688
+ const exitCode = result.exitCode ?? 1;
689
+ super(result.signalCode !== null ? `${target} was killed by the signal ${result.signalCode}` : `${target} exited with a non-zero status (${exitCode})`);
690
+ this.result = result;
691
+ this.output = output;
692
+ this.exitCode = exitCode;
693
+ Object.defineProperty(this, "result", {
694
+ enumerable: false,
695
+ writable: false,
696
+ configurable: false
697
+ });
687
698
  }
688
699
  };
689
- const j = {
700
+ const defaultOptions = {
690
701
  timeout: void 0,
691
702
  persist: false
692
703
  };
693
- const N = { windowsHide: true };
694
- function P(e) {
695
- const t = new AbortController();
696
- for (const n of e) {
697
- if (n.aborted) {
698
- t.abort();
699
- return n;
704
+ const defaultNodeOptions = { windowsHide: true };
705
+ function combineSignals(signals) {
706
+ const controller = new AbortController();
707
+ for (const signal of signals) {
708
+ if (signal.aborted) {
709
+ controller.abort();
710
+ return signal;
700
711
  }
701
- const e = () => {
702
- t.abort(n.reason);
712
+ const onAbort = () => {
713
+ controller.abort(signal.reason);
703
714
  };
704
- n.addEventListener("abort", e, { signal: t.signal });
715
+ signal.addEventListener("abort", onAbort, { signal: controller.signal });
705
716
  }
706
- return t.signal;
717
+ return controller.signal;
707
718
  }
708
- async function F(e) {
709
- let t = "";
719
+ async function readStream(stream) {
720
+ let output = "";
710
721
  try {
711
- for await (const n of e) t += n.toString();
722
+ for await (const chunk of stream) output += chunk.toString();
712
723
  } catch {}
713
- return t;
724
+ return output;
714
725
  }
715
- var I = class {
726
+ var ExecProcess = class {
716
727
  _process;
717
728
  _aborted = false;
718
729
  _options;
@@ -730,19 +741,22 @@ var I = class {
730
741
  get exitCode() {
731
742
  if (this._process && this._process.exitCode !== null) return this._process.exitCode;
732
743
  }
733
- constructor(e, t, n) {
744
+ get signalCode() {
745
+ return this._process?.signalCode ?? null;
746
+ }
747
+ constructor(command, args, options) {
734
748
  this._options = {
735
- ...j,
736
- ...n
749
+ ...defaultOptions,
750
+ ...options
737
751
  };
738
- this._command = e;
739
- this._args = t ?? [];
740
- this._processClosed = new Promise((e) => {
741
- this._resolveClose = e;
752
+ this._command = command;
753
+ this._args = args ?? [];
754
+ this._processClosed = new Promise((resolve) => {
755
+ this._resolveClose = resolve;
742
756
  });
743
757
  }
744
- kill(e) {
745
- return this._process?.kill(e) === true;
758
+ kill(signal) {
759
+ return this._process?.kill(signal) === true;
746
760
  }
747
761
  get aborted() {
748
762
  return this._aborted;
@@ -750,98 +764,98 @@ var I = class {
750
764
  get killed() {
751
765
  return this._process?.killed === true;
752
766
  }
753
- pipe(e, t, n) {
754
- return z(e, t, {
755
- ...n,
767
+ pipe(command, args, options) {
768
+ return exec(command, args, {
769
+ ...options,
756
770
  stdin: this
757
771
  });
758
772
  }
759
773
  async *[Symbol.asyncIterator]() {
760
- const e = this._process;
761
- if (!e) return;
762
- const t = [];
763
- if (this._streamErr) t.push(this._streamErr);
764
- if (this._streamOut) t.push(this._streamOut);
765
- const n = b(t);
766
- const r = readline.createInterface({ input: n });
767
- for await (const e of r) yield e.toString();
774
+ const proc = this._process;
775
+ if (!proc) return;
776
+ const streams = [];
777
+ if (this._streamErr) streams.push(this._streamErr);
778
+ if (this._streamOut) streams.push(this._streamOut);
779
+ const streamCombined = combineStreams(streams);
780
+ const rl = readline.createInterface({ input: streamCombined });
781
+ for await (const chunk of rl) yield chunk.toString();
768
782
  await this._processClosed;
769
- e.removeAllListeners();
783
+ proc.removeAllListeners();
770
784
  if (this._thrownError) throw this._thrownError;
771
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this);
785
+ if (this._options?.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, void 0, this._command, this._args);
772
786
  }
773
787
  async _waitForOutput() {
774
- const e = this._process;
775
- if (!e) throw new Error("No process was started");
776
- const [t, n] = await Promise.all([this._streamOut ? F(this._streamOut) : "", this._streamErr ? F(this._streamErr) : ""]);
788
+ const proc = this._process;
789
+ if (!proc) throw new Error("No process was started");
790
+ const [stdout, stderr] = await Promise.all([this._streamOut ? readStream(this._streamOut) : "", this._streamErr ? readStream(this._streamErr) : ""]);
777
791
  await this._processClosed;
778
- const { stdin: r } = this._options;
779
- if (r && typeof r !== "string") await r;
780
- e.removeAllListeners();
792
+ const { stdin } = this._options;
793
+ if (stdin && typeof stdin !== "string") await stdin;
794
+ proc.removeAllListeners();
781
795
  if (this._thrownError) throw this._thrownError;
782
- const i = {
783
- stderr: n,
784
- stdout: t,
796
+ const result = {
797
+ stderr,
798
+ stdout,
785
799
  exitCode: this.exitCode
786
800
  };
787
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this, i);
788
- return i;
801
+ if (this._options.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, result, this._command, this._args);
802
+ return result;
789
803
  }
790
- then(e, t) {
791
- return this._waitForOutput().then(e, t);
804
+ then(onfulfilled, onrejected) {
805
+ return this._waitForOutput().then(onfulfilled, onrejected);
792
806
  }
793
807
  _streamOut;
794
808
  _streamErr;
795
809
  spawn() {
796
- const t = cwd();
797
- const r = this._options;
798
- const i = {
799
- ...N,
800
- ...r.nodeOptions
810
+ const cwd$1 = cwd();
811
+ const options = this._options;
812
+ const nodeOptions = {
813
+ ...defaultNodeOptions,
814
+ ...options.nodeOptions
801
815
  };
802
- const a = [];
816
+ const signals = [];
803
817
  this._resetState();
804
- if (r.timeout !== void 0) a.push(AbortSignal.timeout(r.timeout));
805
- if (r.signal !== void 0) a.push(r.signal);
806
- if (r.persist === true) i.detached = true;
807
- if (a.length > 0) i.signal = P(a);
808
- i.env = y(t, i.env, r.nodePath);
809
- const o = D(this._command, this._args, i);
810
- const s = spawn(o.command, o.args, o.options);
811
- if (s.stderr) this._streamErr = s.stderr;
812
- if (s.stdout) this._streamOut = s.stdout;
813
- this._process = s;
814
- s.once("error", this._onError);
815
- s.once("close", this._onClose);
816
- if (s.stdin) {
817
- const { stdin: e } = r;
818
- if (typeof e === "string") s.stdin.end(e);
819
- else e?.process?.stdout?.pipe(s.stdin);
818
+ if (options.timeout !== void 0) signals.push(AbortSignal.timeout(options.timeout));
819
+ if (options.signal !== void 0) signals.push(options.signal);
820
+ if (options.persist === true) nodeOptions.detached = true;
821
+ if (signals.length > 0) nodeOptions.signal = combineSignals(signals);
822
+ nodeOptions.env = computeEnv(cwd$1, nodeOptions.env, options.nodePath);
823
+ const crossResult = normalizeSpawnCommand(this._command, this._args, nodeOptions);
824
+ const handle = spawn(crossResult.command, crossResult.args, crossResult.options);
825
+ if (handle.stderr) this._streamErr = handle.stderr;
826
+ if (handle.stdout) this._streamOut = handle.stdout;
827
+ this._process = handle;
828
+ handle.once("error", this._onError);
829
+ handle.once("close", this._onClose);
830
+ if (handle.stdin) {
831
+ const { stdin } = options;
832
+ if (typeof stdin === "string") handle.stdin.end(stdin);
833
+ else stdin?.process?.stdout?.pipe(handle.stdin);
820
834
  }
821
835
  }
822
836
  _resetState() {
823
837
  this._aborted = false;
824
- this._processClosed = new Promise((e) => {
825
- this._resolveClose = e;
838
+ this._processClosed = new Promise((resolve) => {
839
+ this._resolveClose = resolve;
826
840
  });
827
841
  this._thrownError = void 0;
828
842
  }
829
- _onError = (e) => {
830
- if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
843
+ _onError = (err) => {
844
+ if (err.name === "AbortError" && (!(err.cause instanceof Error) || err.cause.name !== "TimeoutError")) {
831
845
  this._aborted = true;
832
846
  return;
833
847
  }
834
- this._thrownError = e;
848
+ this._thrownError = err;
835
849
  };
836
850
  _onClose = () => {
837
851
  if (this._resolveClose) this._resolveClose();
838
852
  };
839
853
  };
840
- const R = (e, t, n) => {
841
- const r = new I(e, t, n);
842
- r.spawn();
843
- return r;
854
+ const x = (command, args, userOptions) => {
855
+ const proc = new ExecProcess(command, args, userOptions);
856
+ proc.spawn();
857
+ return proc;
844
858
  };
845
- const z = R;
859
+ const exec = x;
846
860
  //#endregion
847
- export { __toESM as A, resolveComma as C, __commonJSMin as D, toArray as E, __exportAll as O, pkgExists as S, slash as T, createConcurrencyExecutor as _, namespaces as a, matchPattern as b, blue as c, green as d, hex as f, yellow as g, underline as h, enable as i, __require as k, bold as l, rgb as m, z as n, bgRed as o, red as p, createDebug as r, bgYellow as s, R as t, dim as u, debounce as v, resolveRegex as w, noop as x, importWithError as y };
861
+ export { __toESM as A, resolveComma as C, __commonJSMin as D, toArray as E, __exportAll as O, pkgExists as S, slash as T, createConcurrencyExecutor as _, namespaces as a, matchPattern as b, blue as c, green as d, hex as f, yellow as g, underline as h, enable as i, __require as k, bold as l, rgb as m, x as n, bgRed as o, red as p, createDebug as r, bgYellow as s, exec as t, dim as u, debounce as v, resolveRegex as w, noop as x, importWithError as y };
@@ -933,10 +933,12 @@ var require_parse = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exp
933
933
  }
934
934
  return esc ? m : `\\${m}`;
935
935
  });
936
- if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
937
- else output = output.replace(/\\+/g, (m) => {
938
- return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
939
- });
936
+ if (backslashes === true) {
937
+ if (opts.unescape === true) output = output.replace(/\\/g, "");
938
+ else output = output.replace(/\\+/g, (m) => {
939
+ return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
940
+ });
941
+ }
940
942
  if (output === input && opts.contains === true) {
941
943
  state.output = input;
942
944
  return state;
@@ -1707,8 +1709,10 @@ var require_picomatch$1 = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin
1707
1709
  output = format ? format(input) : input;
1708
1710
  match = output === glob;
1709
1711
  }
1710
- if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
1711
- else match = regex.exec(output);
1712
+ if (match === false || opts.capture === true) {
1713
+ if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
1714
+ else match = regex.exec(output);
1715
+ }
1712
1716
  return {
1713
1717
  isMatch: Boolean(match),
1714
1718
  match,
@@ -9,8 +9,10 @@ var require_tree_kill = /* @__PURE__ */ require("./npm_cjs_chunk_rolldown-runtim
9
9
  signal = void 0;
10
10
  }
11
11
  pid = parseInt(pid);
12
- if (Number.isNaN(pid)) if (callback) return callback(/* @__PURE__ */ new Error("pid must be a number"));
13
- else throw new Error("pid must be a number");
12
+ if (Number.isNaN(pid)) {
13
+ if (callback) return callback(/* @__PURE__ */ new Error("pid must be a number"));
14
+ else throw new Error("pid must be a number");
15
+ }
14
16
  var tree = {};
15
17
  var pidsToProcess = {};
16
18
  tree[pid] = [];
@@ -1,5 +1,5 @@
1
- import { r as createDebug } from "./main-Jz_9T-KA.js";
2
- import { t as requireTS } from "./dist-BZO8q3c0.js";
1
+ import { r as createDebug } from "./main-DiierkER.js";
2
+ import { t as requireTS } from "./dist-DyXLnzyh.js";
3
3
  import path from "node:path";
4
4
  //#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@typescript+native-preview@7.0.0-dev.20260605.1_oxc-resolve_19173df252fb1b72b750fe1e656588b8/node_modules/rolldown-plugin-dts/dist/resolver-cwLsPb2o.mjs
5
5
  const debug = createDebug("rolldown-plugin-dts:tsc-resolver");