@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.
- package/LICENSE +30 -1
- package/dist/rolldown/cli.mjs +14 -10
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +2 -2
- package/dist/rolldown/experimental-index.mjs +8 -8
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +1 -1
- package/dist/rolldown/index.mjs +4 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +1 -1
- package/dist/rolldown/plugins-index.d.mts +2 -2
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/binding-CKyeQZen.mjs +673 -0
- package/dist/rolldown/shared/{bindingify-input-options-B03y7DfJ.mjs → bindingify-input-options-44iPAymO.mjs} +6 -10
- package/dist/rolldown/shared/{constructors-COwFYQna.mjs → constructors-6Zc-JFd7.mjs} +1 -1
- package/dist/rolldown/shared/{constructors-ALilxAii.d.mts → constructors-XaIbWpwJ.d.mts} +1 -1
- package/dist/rolldown/shared/{create-bundler-option-B-tSTZRt.mjs → create-bundler-option-e1FU0w0P.mjs} +3 -3
- package/dist/rolldown/shared/{define-config-DSMNXceb.d.mts → define-config-DVsXPNaU.d.mts} +0 -4
- package/dist/rolldown/shared/{error-nLggAzpQ.mjs → error-BzLGqhSQ.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-O4G7NVNA.mjs → load-config-C6QXSnoS.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-Cj-DgIV1.mjs → normalize-string-or-regex-DYjJ67tj.mjs} +1 -1
- package/dist/rolldown/shared/{parse-CQfUbVuN.mjs → parse-uDDyc1el.mjs} +2 -2
- package/dist/rolldown/shared/{resolve-tsconfig-CE3HNSOK.mjs → resolve-tsconfig-Bcd82vVT.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-qV_fUwyM.mjs → rolldown-CCbQNGZt.mjs} +4 -4
- package/dist/rolldown/shared/{watch-BNIsji74.mjs → watch-vuOCmvFs.mjs} +5 -5
- package/dist/rolldown/utils-index.d.mts +1 -1
- package/dist/rolldown/utils-index.mjs +15 -13
- package/dist/tsdown/{build-D_enfyvD-X5SFXZZc.js → build-D_enfyvD-Dg1eKRD4.js} +20 -16
- package/dist/tsdown/{debug-CKcBYQLP-avlAPNcV.js → debug-CKcBYQLP-C3NhYhrk.js} +3 -3
- package/dist/tsdown/{detect-DGhJGEqb-CGd2brAW.js → detect-DGhJGEqb-6CTf16BW.js} +1 -1
- package/dist/tsdown/{dist-BZO8q3c0.js → dist-DyXLnzyh.js} +4 -4
- package/dist/tsdown/index-types.d.ts +3 -3
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/internal-DKworeK4.js +3 -0
- package/dist/tsdown/{main-Jz_9T-KA.js → main-DiierkER.js} +210 -196
- package/dist/tsdown/npm_entry_picomatch.cjs +10 -6
- package/dist/tsdown/npm_entry_tree-kill.cjs +4 -2
- package/dist/tsdown/{resolver-cwLsPb2o-BqQjnCbF.js → resolver-cwLsPb2o-Dk4xdAGE.js} +2 -2
- package/dist/tsdown/run.js +6 -6
- package/dist/tsdown/{src-D5keKqGd.js → src-drVPfX63.js} +1 -1
- package/dist/tsdown/{target-Bab3CUeB-CERZYTwS.js → target-Bab3CUeB-DQ0pKhCv.js} +5 -5
- package/dist/tsdown/{tsc-DmzrnJwy.js → tsc-JnMl2z7d.js} +3 -3
- package/dist/tsdown/tsdown-css.js +4 -4
- package/dist/tsdown/tsdown-exe.js +4 -4
- package/dist/vite/client/bundledDevClient.mjs +330 -14
- package/dist/vite/client/client.mjs +20 -14
- package/dist/vite/node/chunks/build.js +51 -45
- package/dist/vite/node/chunks/dist.js +36 -29
- package/dist/vite/node/chunks/dist2.js +193 -149
- package/dist/vite/node/chunks/node.js +931 -793
- package/dist/vite/node/chunks/postcss-import.js +10 -9
- package/dist/vite/node/index.d.ts +7 -5
- package/dist/vite/node/module-runner.js +23 -17
- package/package.json +26 -20
- package/dist/rolldown/shared/binding-DwUQWZOo.mjs +0 -662
- 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_@
|
|
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.
|
|
522
|
-
const
|
|
523
|
-
const
|
|
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
|
|
528
|
-
for (const
|
|
529
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
530
|
-
const
|
|
531
|
-
if (!
|
|
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
|
|
534
|
-
value
|
|
533
|
+
key,
|
|
534
|
+
value
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
|
-
return
|
|
537
|
+
return defaultEnvPathInfo;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
540
|
-
const
|
|
541
|
-
const
|
|
542
|
-
let
|
|
543
|
-
let
|
|
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
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
} while (
|
|
549
|
-
|
|
550
|
-
const
|
|
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:
|
|
553
|
-
value:
|
|
552
|
+
key: path.key,
|
|
553
|
+
value: newPath
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
const
|
|
556
|
+
function computeEnv(cwd, env, nodePath = true) {
|
|
557
|
+
const envWithDefault = {
|
|
558
558
|
...process.env,
|
|
559
|
-
...
|
|
559
|
+
...env
|
|
560
560
|
};
|
|
561
|
-
if (!
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
return
|
|
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
|
|
567
|
-
let
|
|
568
|
-
const
|
|
569
|
-
const
|
|
570
|
-
if (--
|
|
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
|
|
573
|
-
return
|
|
572
|
+
for (const stream of streams) pipeline(stream, combined, { end: false }).then(maybeEmitEnd).catch(maybeEmitEnd);
|
|
573
|
+
return combined;
|
|
574
574
|
};
|
|
575
|
-
const
|
|
576
|
-
const
|
|
577
|
-
const
|
|
578
|
-
const
|
|
579
|
-
const
|
|
580
|
-
const
|
|
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
|
|
593
|
-
if (
|
|
594
|
-
command
|
|
595
|
-
args
|
|
596
|
-
options
|
|
593
|
+
function normalizeSpawnCommand(command, args = [], options = {}) {
|
|
594
|
+
if (options.shell === true || !isWindows) return {
|
|
595
|
+
command,
|
|
596
|
+
args,
|
|
597
|
+
options
|
|
597
598
|
};
|
|
598
|
-
let
|
|
599
|
-
let
|
|
600
|
-
if (
|
|
601
|
-
const
|
|
602
|
-
const
|
|
603
|
-
let
|
|
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
|
-
|
|
606
|
-
readSync(
|
|
606
|
+
fd = openSync(file, "r");
|
|
607
|
+
readSync(fd, buffer, 0, size, 0);
|
|
607
608
|
} catch {} finally {
|
|
608
|
-
if (
|
|
609
|
+
if (fd !== null) closeSync(fd);
|
|
609
610
|
}
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
612
|
-
const
|
|
613
|
-
const
|
|
614
|
-
const
|
|
615
|
-
const
|
|
616
|
-
const
|
|
617
|
-
|
|
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 (
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
621
|
+
if (shebang !== null && file !== null) {
|
|
622
|
+
args = [file, ...args];
|
|
623
|
+
command = shebang;
|
|
624
|
+
file = resolveCommand(command, options);
|
|
624
625
|
}
|
|
625
|
-
if (
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
if (
|
|
635
|
-
return
|
|
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
|
-
|
|
638
|
+
args = [
|
|
638
639
|
"/d",
|
|
639
640
|
"/s",
|
|
640
641
|
"/c",
|
|
641
|
-
`"${[
|
|
642
|
+
`"${[command, ...args].join(" ")}"`
|
|
642
643
|
];
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
...
|
|
644
|
+
command = options.env?.comspec ?? "cmd.exe";
|
|
645
|
+
options = {
|
|
646
|
+
...options,
|
|
646
647
|
windowsVerbatimArguments: true
|
|
647
648
|
};
|
|
648
649
|
}
|
|
649
650
|
return {
|
|
650
|
-
command
|
|
651
|
-
args
|
|
652
|
-
options
|
|
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
|
|
660
|
-
const
|
|
661
|
-
const
|
|
662
|
-
const
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
if (
|
|
666
|
-
for (const
|
|
667
|
-
const
|
|
668
|
-
for (const
|
|
669
|
-
const
|
|
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(
|
|
672
|
+
if (statSync(destWithExt).isFile()) return destWithExt;
|
|
672
673
|
} catch {}
|
|
673
674
|
}
|
|
674
675
|
}
|
|
675
676
|
return null;
|
|
676
677
|
}
|
|
677
|
-
var
|
|
678
|
+
var NonZeroExitError = class extends Error {
|
|
678
679
|
result;
|
|
679
680
|
output;
|
|
680
|
-
|
|
681
|
-
|
|
681
|
+
exitCode;
|
|
682
|
+
get signalCode() {
|
|
683
|
+
return this.result.signalCode;
|
|
682
684
|
}
|
|
683
|
-
constructor(
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
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
|
|
700
|
+
const defaultOptions = {
|
|
690
701
|
timeout: void 0,
|
|
691
702
|
persist: false
|
|
692
703
|
};
|
|
693
|
-
const
|
|
694
|
-
function
|
|
695
|
-
const
|
|
696
|
-
for (const
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
return
|
|
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
|
|
702
|
-
|
|
712
|
+
const onAbort = () => {
|
|
713
|
+
controller.abort(signal.reason);
|
|
703
714
|
};
|
|
704
|
-
|
|
715
|
+
signal.addEventListener("abort", onAbort, { signal: controller.signal });
|
|
705
716
|
}
|
|
706
|
-
return
|
|
717
|
+
return controller.signal;
|
|
707
718
|
}
|
|
708
|
-
async function
|
|
709
|
-
let
|
|
719
|
+
async function readStream(stream) {
|
|
720
|
+
let output = "";
|
|
710
721
|
try {
|
|
711
|
-
for await (const
|
|
722
|
+
for await (const chunk of stream) output += chunk.toString();
|
|
712
723
|
} catch {}
|
|
713
|
-
return
|
|
724
|
+
return output;
|
|
714
725
|
}
|
|
715
|
-
var
|
|
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
|
-
|
|
744
|
+
get signalCode() {
|
|
745
|
+
return this._process?.signalCode ?? null;
|
|
746
|
+
}
|
|
747
|
+
constructor(command, args, options) {
|
|
734
748
|
this._options = {
|
|
735
|
-
...
|
|
736
|
-
...
|
|
749
|
+
...defaultOptions,
|
|
750
|
+
...options
|
|
737
751
|
};
|
|
738
|
-
this._command =
|
|
739
|
-
this._args =
|
|
740
|
-
this._processClosed = new Promise((
|
|
741
|
-
this._resolveClose =
|
|
752
|
+
this._command = command;
|
|
753
|
+
this._args = args ?? [];
|
|
754
|
+
this._processClosed = new Promise((resolve) => {
|
|
755
|
+
this._resolveClose = resolve;
|
|
742
756
|
});
|
|
743
757
|
}
|
|
744
|
-
kill(
|
|
745
|
-
return this._process?.kill(
|
|
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(
|
|
754
|
-
return
|
|
755
|
-
...
|
|
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
|
|
761
|
-
if (!
|
|
762
|
-
const
|
|
763
|
-
if (this._streamErr)
|
|
764
|
-
if (this._streamOut)
|
|
765
|
-
const
|
|
766
|
-
const
|
|
767
|
-
for await (const
|
|
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
|
-
|
|
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
|
|
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
|
|
775
|
-
if (!
|
|
776
|
-
const [
|
|
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
|
|
779
|
-
if (
|
|
780
|
-
|
|
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
|
|
783
|
-
stderr
|
|
784
|
-
stdout
|
|
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
|
|
788
|
-
return
|
|
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(
|
|
791
|
-
return this._waitForOutput().then(
|
|
804
|
+
then(onfulfilled, onrejected) {
|
|
805
|
+
return this._waitForOutput().then(onfulfilled, onrejected);
|
|
792
806
|
}
|
|
793
807
|
_streamOut;
|
|
794
808
|
_streamErr;
|
|
795
809
|
spawn() {
|
|
796
|
-
const
|
|
797
|
-
const
|
|
798
|
-
const
|
|
799
|
-
...
|
|
800
|
-
...
|
|
810
|
+
const cwd$1 = cwd();
|
|
811
|
+
const options = this._options;
|
|
812
|
+
const nodeOptions = {
|
|
813
|
+
...defaultNodeOptions,
|
|
814
|
+
...options.nodeOptions
|
|
801
815
|
};
|
|
802
|
-
const
|
|
816
|
+
const signals = [];
|
|
803
817
|
this._resetState();
|
|
804
|
-
if (
|
|
805
|
-
if (
|
|
806
|
-
if (
|
|
807
|
-
if (
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
const
|
|
811
|
-
if (
|
|
812
|
-
if (
|
|
813
|
-
this._process =
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
if (
|
|
817
|
-
const { stdin
|
|
818
|
-
if (typeof
|
|
819
|
-
else
|
|
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((
|
|
825
|
-
this._resolveClose =
|
|
838
|
+
this._processClosed = new Promise((resolve) => {
|
|
839
|
+
this._resolveClose = resolve;
|
|
826
840
|
});
|
|
827
841
|
this._thrownError = void 0;
|
|
828
842
|
}
|
|
829
|
-
_onError = (
|
|
830
|
-
if (
|
|
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 =
|
|
848
|
+
this._thrownError = err;
|
|
835
849
|
};
|
|
836
850
|
_onClose = () => {
|
|
837
851
|
if (this._resolveClose) this._resolveClose();
|
|
838
852
|
};
|
|
839
853
|
};
|
|
840
|
-
const
|
|
841
|
-
const
|
|
842
|
-
|
|
843
|
-
return
|
|
854
|
+
const x = (command, args, userOptions) => {
|
|
855
|
+
const proc = new ExecProcess(command, args, userOptions);
|
|
856
|
+
proc.spawn();
|
|
857
|
+
return proc;
|
|
844
858
|
};
|
|
845
|
-
const
|
|
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,
|
|
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)
|
|
937
|
-
|
|
938
|
-
|
|
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)
|
|
1711
|
-
|
|
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))
|
|
13
|
-
|
|
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-
|
|
2
|
-
import { t as requireTS } from "./dist-
|
|
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");
|