@kubb/cli
Version:
Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.
1,316 lines (1,280 loc) • 247 kB
JavaScript
const require_chunk = require('./chunk-DWy1uDak.cjs');
let node_path = require("node:path");
node_path = require_chunk.__toESM(node_path);
let node_process = require("node:process");
node_process = require_chunk.__toESM(node_process);
let __kubb_core = require("@kubb/core");
__kubb_core = require_chunk.__toESM(__kubb_core);
let __kubb_core_logger = require("@kubb/core/logger");
__kubb_core_logger = require_chunk.__toESM(__kubb_core_logger);
let picocolors = require("picocolors");
picocolors = require_chunk.__toESM(picocolors);
let cli_progress = require("cli-progress");
cli_progress = require_chunk.__toESM(cli_progress);
let node_url = require("node:url");
node_url = require_chunk.__toESM(node_url);
let node_child_process = require("node:child_process");
node_child_process = require_chunk.__toESM(node_child_process);
let node_string_decoder = require("node:string_decoder");
node_string_decoder = require_chunk.__toESM(node_string_decoder);
let node_util = require("node:util");
node_util = require_chunk.__toESM(node_util);
let node_tty = require("node:tty");
node_tty = require_chunk.__toESM(node_tty);
let node_timers_promises = require("node:timers/promises");
node_timers_promises = require_chunk.__toESM(node_timers_promises);
let node_os = require("node:os");
node_os = require_chunk.__toESM(node_os);
let node_events = require("node:events");
node_events = require_chunk.__toESM(node_events);
let node_v8 = require("node:v8");
node_v8 = require_chunk.__toESM(node_v8);
let node_fs = require("node:fs");
node_fs = require_chunk.__toESM(node_fs);
let node_stream_promises = require("node:stream/promises");
node_stream_promises = require_chunk.__toESM(node_stream_promises);
let node_stream = require("node:stream");
node_stream = require_chunk.__toESM(node_stream);
let node_buffer = require("node:buffer");
node_buffer = require_chunk.__toESM(node_buffer);
let string_argv = require("string-argv");
string_argv = require_chunk.__toESM(string_argv);
//#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
function isPlainObject(value) {
if (typeof value !== "object" || value === null) return false;
const prototype = Object.getPrototypeOf(value);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
}
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/arguments/file-url.js
const safeNormalizeFileUrl = (file, name) => {
const fileString = normalizeFileUrl(normalizeDenoExecPath(file));
if (typeof fileString !== "string") throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`);
return fileString;
};
const normalizeDenoExecPath = (file) => isDenoExecPath(file) ? file.toString() : file;
const isDenoExecPath = (file) => typeof file !== "string" && file && Object.getPrototypeOf(file) === String.prototype;
const normalizeFileUrl = (file) => file instanceof URL ? (0, node_url.fileURLToPath)(file) : file;
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/methods/parameters.js
const normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
const filePath = safeNormalizeFileUrl(rawFile, "First argument");
const [commandArguments, options] = isPlainObject(rawArguments) ? [[], rawArguments] : [rawArguments, rawOptions];
if (!Array.isArray(commandArguments)) throw new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`);
if (commandArguments.some((commandArgument) => typeof commandArgument === "object" && commandArgument !== null)) throw new TypeError(`Second argument must be an array of strings: ${commandArguments}`);
const normalizedArguments = commandArguments.map(String);
const nullByteArgument = normalizedArguments.find((normalizedArgument) => normalizedArgument.includes("\0"));
if (nullByteArgument !== void 0) throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${nullByteArgument}`);
if (!isPlainObject(options)) throw new TypeError(`Last argument must be an options object: ${options}`);
return [
filePath,
normalizedArguments,
options
];
};
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/utils/uint-array.js
const { toString: objectToString$1 } = Object.prototype;
const isArrayBuffer = (value) => objectToString$1.call(value) === "[object ArrayBuffer]";
const isUint8Array = (value) => objectToString$1.call(value) === "[object Uint8Array]";
const bufferToUint8Array = (buffer) => new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
const textEncoder$1 = new TextEncoder();
const stringToUint8Array = (string) => textEncoder$1.encode(string);
const textDecoder = new TextDecoder();
const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
const joinToString = (uint8ArraysOrStrings, encoding) => {
return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
};
const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
const decoder = new node_string_decoder.StringDecoder(encoding);
const strings = uint8ArraysOrStrings.map((uint8ArrayOrString) => typeof uint8ArrayOrString === "string" ? stringToUint8Array(uint8ArrayOrString) : uint8ArrayOrString).map((uint8Array) => decoder.write(uint8Array));
const finalString = decoder.end();
return finalString === "" ? strings : [...strings, finalString];
};
const joinToUint8Array = (uint8ArraysOrStrings) => {
if (uint8ArraysOrStrings.length === 1 && isUint8Array(uint8ArraysOrStrings[0])) return uint8ArraysOrStrings[0];
return concatUint8Arrays(stringsToUint8Arrays(uint8ArraysOrStrings));
};
const stringsToUint8Arrays = (uint8ArraysOrStrings) => uint8ArraysOrStrings.map((uint8ArrayOrString) => typeof uint8ArrayOrString === "string" ? stringToUint8Array(uint8ArrayOrString) : uint8ArrayOrString);
const concatUint8Arrays = (uint8Arrays) => {
const result = new Uint8Array(getJoinLength(uint8Arrays));
let index = 0;
for (const uint8Array of uint8Arrays) {
result.set(uint8Array, index);
index += uint8Array.length;
}
return result;
};
const getJoinLength = (uint8Arrays) => {
let joinLength = 0;
for (const uint8Array of uint8Arrays) joinLength += uint8Array.length;
return joinLength;
};
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/methods/template.js
const isTemplateString = (templates) => Array.isArray(templates) && Array.isArray(templates.raw);
const parseTemplates = (templates, expressions) => {
let tokens = [];
for (const [index, template] of templates.entries()) tokens = parseTemplate({
templates,
expressions,
tokens,
index,
template
});
if (tokens.length === 0) throw new TypeError("Template script must not be empty");
const [file, ...commandArguments] = tokens;
return [
file,
commandArguments,
{}
];
};
const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
if (template === void 0) throw new TypeError(`Invalid backslash sequence: ${templates.raw[index]}`);
const { nextTokens, leadingWhitespaces, trailingWhitespaces } = splitByWhitespaces(template, templates.raw[index]);
const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
if (index === expressions.length) return newTokens;
const expression = expressions[index];
const expressionTokens = Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)];
return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
};
const splitByWhitespaces = (template, rawTemplate) => {
if (rawTemplate.length === 0) return {
nextTokens: [],
leadingWhitespaces: false,
trailingWhitespaces: false
};
const nextTokens = [];
let templateStart = 0;
const leadingWhitespaces = DELIMITERS.has(rawTemplate[0]);
for (let templateIndex = 0, rawIndex = 0; templateIndex < template.length; templateIndex += 1, rawIndex += 1) {
const rawCharacter = rawTemplate[rawIndex];
if (DELIMITERS.has(rawCharacter)) {
if (templateStart !== templateIndex) nextTokens.push(template.slice(templateStart, templateIndex));
templateStart = templateIndex + 1;
} else if (rawCharacter === "\\") {
const nextRawCharacter = rawTemplate[rawIndex + 1];
if (nextRawCharacter === "\n") {
templateIndex -= 1;
rawIndex += 1;
} else if (nextRawCharacter === "u" && rawTemplate[rawIndex + 2] === "{") rawIndex = rawTemplate.indexOf("}", rawIndex + 3);
else rawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;
}
}
const trailingWhitespaces = templateStart === template.length;
if (!trailingWhitespaces) nextTokens.push(template.slice(templateStart));
return {
nextTokens,
leadingWhitespaces,
trailingWhitespaces
};
};
const DELIMITERS = new Set([
" ",
" ",
"\r",
"\n"
]);
const ESCAPE_LENGTH = {
x: 3,
u: 5
};
const concatTokens = (tokens, nextTokens, isSeparated) => isSeparated || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
...tokens.slice(0, -1),
`${tokens.at(-1)}${nextTokens[0]}`,
...nextTokens.slice(1)
];
const parseExpression = (expression) => {
const typeOfExpression = typeof expression;
if (typeOfExpression === "string") return expression;
if (typeOfExpression === "number") return String(expression);
if (isPlainObject(expression) && ("stdout" in expression || "isMaxBuffer" in expression)) return getSubprocessResult(expression);
if (expression instanceof node_child_process.ChildProcess || Object.prototype.toString.call(expression) === "[object Promise]") throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
};
const getSubprocessResult = ({ stdout }) => {
if (typeof stdout === "string") return stdout;
if (isUint8Array(stdout)) return uint8ArrayToString(stdout);
if (stdout === void 0) throw new TypeError("Missing result.stdout in template expression. This is probably due to the previous subprocess' \"stdout\" option.");
throw new TypeError(`Unexpected "${typeof stdout}" stdout in template expression`);
};
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/utils/standard-stream.js
const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
const STANDARD_STREAMS = [
node_process.default.stdin,
node_process.default.stdout,
node_process.default.stderr
];
const STANDARD_STREAMS_ALIASES = [
"stdin",
"stdout",
"stderr"
];
const getStreamName = (fdNumber) => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/arguments/specific.js
const normalizeFdSpecificOptions = (options) => {
const optionsCopy = { ...options };
for (const optionName of FD_SPECIFIC_OPTIONS) optionsCopy[optionName] = normalizeFdSpecificOption(options, optionName);
return optionsCopy;
};
const normalizeFdSpecificOption = (options, optionName) => {
const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
const optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName);
return addDefaultValue$1(optionArray, optionName);
};
const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
const normalizeOptionObject = (optionValue, optionArray, optionName) => {
for (const fdName of Object.keys(optionValue).sort(compareFdName)) for (const fdNumber of parseFdName(fdName, optionName, optionArray)) optionArray[fdNumber] = optionValue[fdName];
return optionArray;
};
const compareFdName = (fdNameA, fdNameB) => getFdNameOrder(fdNameA) < getFdNameOrder(fdNameB) ? 1 : -1;
const getFdNameOrder = (fdName) => {
if (fdName === "stdout" || fdName === "stderr") return 0;
return fdName === "all" ? 2 : 1;
};
const parseFdName = (fdName, optionName, optionArray) => {
if (fdName === "ipc") return [optionArray.length - 1];
const fdNumber = parseFd(fdName);
if (fdNumber === void 0 || fdNumber === 0) throw new TypeError(`"${optionName}.${fdName}" is invalid.
It must be "${optionName}.stdout", "${optionName}.stderr", "${optionName}.all", "${optionName}.ipc", or "${optionName}.fd3", "${optionName}.fd4" (and so on).`);
if (fdNumber >= optionArray.length) throw new TypeError(`"${optionName}.${fdName}" is invalid: that file descriptor does not exist.
Please set the "stdio" option to ensure that file descriptor exists.`);
return fdNumber === "all" ? [1, 2] : [fdNumber];
};
const parseFd = (fdName) => {
if (fdName === "all") return fdName;
if (STANDARD_STREAMS_ALIASES.includes(fdName)) return STANDARD_STREAMS_ALIASES.indexOf(fdName);
const regexpResult = FD_REGEXP.exec(fdName);
if (regexpResult !== null) return Number(regexpResult[1]);
};
const FD_REGEXP = /^fd(\d+)$/;
const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
const DEFAULT_OPTIONS = {
lines: false,
buffer: true,
maxBuffer: 1e3 * 1e3 * 100,
verbose: (0, node_util.debuglog)("execa").enabled ? "full" : "none",
stripFinalNewline: true
};
const FD_SPECIFIC_OPTIONS = [
"lines",
"buffer",
"maxBuffer",
"verbose",
"stripFinalNewline"
];
const getFdSpecificValue = (optionArray, fdNumber) => fdNumber === "ipc" ? optionArray.at(-1) : optionArray[fdNumber];
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/verbose/values.js
const isVerbose = ({ verbose }, fdNumber) => getFdVerbose(verbose, fdNumber) !== "none";
const isFullVerbose = ({ verbose }, fdNumber) => !["none", "short"].includes(getFdVerbose(verbose, fdNumber));
const getVerboseFunction = ({ verbose }, fdNumber) => {
const fdVerbose = getFdVerbose(verbose, fdNumber);
return isVerboseFunction(fdVerbose) ? fdVerbose : void 0;
};
const getFdVerbose = (verbose, fdNumber) => fdNumber === void 0 ? getFdGenericVerbose(verbose) : getFdSpecificValue(verbose, fdNumber);
const getFdGenericVerbose = (verbose) => verbose.find((fdVerbose) => isVerboseFunction(fdVerbose)) ?? VERBOSE_VALUES.findLast((fdVerbose) => verbose.includes(fdVerbose));
const isVerboseFunction = (fdVerbose) => typeof fdVerbose === "function";
const VERBOSE_VALUES = [
"none",
"short",
"full"
];
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/arguments/escape.js
const joinCommand = (filePath, rawArguments) => {
const fileAndArguments = [filePath, ...rawArguments];
const command = fileAndArguments.join(" ");
const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
return {
command,
escapedCommand
};
};
const escapeLines = (lines) => (0, node_util.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
const escapeControlCharacters = (line) => line.replaceAll(SPECIAL_CHAR_REGEXP, (character) => escapeControlCharacter(character));
const escapeControlCharacter = (character) => {
const commonEscape = COMMON_ESCAPES[character];
if (commonEscape !== void 0) return commonEscape;
const codepoint = character.codePointAt(0);
const codepointHex = codepoint.toString(16);
return codepoint <= ASTRAL_START ? `\\u${codepointHex.padStart(4, "0")}` : `\\U${codepointHex}`;
};
const getSpecialCharRegExp = () => {
try {
return new RegExp("\\p{Separator}|\\p{Other}", "gu");
} catch {
return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g;
}
};
const SPECIAL_CHAR_REGEXP = getSpecialCharRegExp();
const COMMON_ESCAPES = {
" ": " ",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
" ": "\\t"
};
const ASTRAL_START = 65535;
const quoteString = (escapedArgument) => {
if (NO_ESCAPE_REGEXP.test(escapedArgument)) return escapedArgument;
return node_process.platform === "win32" ? `"${escapedArgument.replaceAll("\"", "\"\"")}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
};
const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
//#endregion
//#region ../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
function isUnicodeSupported() {
const { env } = node_process.default;
const { TERM, TERM_PROGRAM } = env;
if (node_process.default.platform !== "win32") return TERM !== "linux";
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
}
//#endregion
//#region ../../node_modules/.pnpm/figures@6.1.0/node_modules/figures/index.js
const common = {
circleQuestionMark: "(?)",
questionMarkPrefix: "(?)",
square: "█",
squareDarkShade: "▓",
squareMediumShade: "▒",
squareLightShade: "░",
squareTop: "▀",
squareBottom: "▄",
squareLeft: "▌",
squareRight: "▐",
squareCenter: "■",
bullet: "●",
dot: "․",
ellipsis: "…",
pointerSmall: "›",
triangleUp: "▲",
triangleUpSmall: "▴",
triangleDown: "▼",
triangleDownSmall: "▾",
triangleLeftSmall: "◂",
triangleRightSmall: "▸",
home: "⌂",
heart: "♥",
musicNote: "♪",
musicNoteBeamed: "♫",
arrowUp: "↑",
arrowDown: "↓",
arrowLeft: "←",
arrowRight: "→",
arrowLeftRight: "↔",
arrowUpDown: "↕",
almostEqual: "≈",
notEqual: "≠",
lessOrEqual: "≤",
greaterOrEqual: "≥",
identical: "≡",
infinity: "∞",
subscriptZero: "₀",
subscriptOne: "₁",
subscriptTwo: "₂",
subscriptThree: "₃",
subscriptFour: "₄",
subscriptFive: "₅",
subscriptSix: "₆",
subscriptSeven: "₇",
subscriptEight: "₈",
subscriptNine: "₉",
oneHalf: "½",
oneThird: "⅓",
oneQuarter: "¼",
oneFifth: "⅕",
oneSixth: "⅙",
oneEighth: "⅛",
twoThirds: "⅔",
twoFifths: "⅖",
threeQuarters: "¾",
threeFifths: "⅗",
threeEighths: "⅜",
fourFifths: "⅘",
fiveSixths: "⅚",
fiveEighths: "⅝",
sevenEighths: "⅞",
line: "─",
lineBold: "━",
lineDouble: "═",
lineDashed0: "┄",
lineDashed1: "┅",
lineDashed2: "┈",
lineDashed3: "┉",
lineDashed4: "╌",
lineDashed5: "╍",
lineDashed6: "╴",
lineDashed7: "╶",
lineDashed8: "╸",
lineDashed9: "╺",
lineDashed10: "╼",
lineDashed11: "╾",
lineDashed12: "−",
lineDashed13: "–",
lineDashed14: "‐",
lineDashed15: "⁃",
lineVertical: "│",
lineVerticalBold: "┃",
lineVerticalDouble: "║",
lineVerticalDashed0: "┆",
lineVerticalDashed1: "┇",
lineVerticalDashed2: "┊",
lineVerticalDashed3: "┋",
lineVerticalDashed4: "╎",
lineVerticalDashed5: "╏",
lineVerticalDashed6: "╵",
lineVerticalDashed7: "╷",
lineVerticalDashed8: "╹",
lineVerticalDashed9: "╻",
lineVerticalDashed10: "╽",
lineVerticalDashed11: "╿",
lineDownLeft: "┐",
lineDownLeftArc: "╮",
lineDownBoldLeftBold: "┓",
lineDownBoldLeft: "┒",
lineDownLeftBold: "┑",
lineDownDoubleLeftDouble: "╗",
lineDownDoubleLeft: "╖",
lineDownLeftDouble: "╕",
lineDownRight: "┌",
lineDownRightArc: "╭",
lineDownBoldRightBold: "┏",
lineDownBoldRight: "┎",
lineDownRightBold: "┍",
lineDownDoubleRightDouble: "╔",
lineDownDoubleRight: "╓",
lineDownRightDouble: "╒",
lineUpLeft: "┘",
lineUpLeftArc: "╯",
lineUpBoldLeftBold: "┛",
lineUpBoldLeft: "┚",
lineUpLeftBold: "┙",
lineUpDoubleLeftDouble: "╝",
lineUpDoubleLeft: "╜",
lineUpLeftDouble: "╛",
lineUpRight: "└",
lineUpRightArc: "╰",
lineUpBoldRightBold: "┗",
lineUpBoldRight: "┖",
lineUpRightBold: "┕",
lineUpDoubleRightDouble: "╚",
lineUpDoubleRight: "╙",
lineUpRightDouble: "╘",
lineUpDownLeft: "┤",
lineUpBoldDownBoldLeftBold: "┫",
lineUpBoldDownBoldLeft: "┨",
lineUpDownLeftBold: "┥",
lineUpBoldDownLeftBold: "┩",
lineUpDownBoldLeftBold: "┪",
lineUpDownBoldLeft: "┧",
lineUpBoldDownLeft: "┦",
lineUpDoubleDownDoubleLeftDouble: "╣",
lineUpDoubleDownDoubleLeft: "╢",
lineUpDownLeftDouble: "╡",
lineUpDownRight: "├",
lineUpBoldDownBoldRightBold: "┣",
lineUpBoldDownBoldRight: "┠",
lineUpDownRightBold: "┝",
lineUpBoldDownRightBold: "┡",
lineUpDownBoldRightBold: "┢",
lineUpDownBoldRight: "┟",
lineUpBoldDownRight: "┞",
lineUpDoubleDownDoubleRightDouble: "╠",
lineUpDoubleDownDoubleRight: "╟",
lineUpDownRightDouble: "╞",
lineDownLeftRight: "┬",
lineDownBoldLeftBoldRightBold: "┳",
lineDownLeftBoldRightBold: "┯",
lineDownBoldLeftRight: "┰",
lineDownBoldLeftBoldRight: "┱",
lineDownBoldLeftRightBold: "┲",
lineDownLeftRightBold: "┮",
lineDownLeftBoldRight: "┭",
lineDownDoubleLeftDoubleRightDouble: "╦",
lineDownDoubleLeftRight: "╥",
lineDownLeftDoubleRightDouble: "╤",
lineUpLeftRight: "┴",
lineUpBoldLeftBoldRightBold: "┻",
lineUpLeftBoldRightBold: "┷",
lineUpBoldLeftRight: "┸",
lineUpBoldLeftBoldRight: "┹",
lineUpBoldLeftRightBold: "┺",
lineUpLeftRightBold: "┶",
lineUpLeftBoldRight: "┵",
lineUpDoubleLeftDoubleRightDouble: "╩",
lineUpDoubleLeftRight: "╨",
lineUpLeftDoubleRightDouble: "╧",
lineUpDownLeftRight: "┼",
lineUpBoldDownBoldLeftBoldRightBold: "╋",
lineUpDownBoldLeftBoldRightBold: "╈",
lineUpBoldDownLeftBoldRightBold: "╇",
lineUpBoldDownBoldLeftRightBold: "╊",
lineUpBoldDownBoldLeftBoldRight: "╉",
lineUpBoldDownLeftRight: "╀",
lineUpDownBoldLeftRight: "╁",
lineUpDownLeftBoldRight: "┽",
lineUpDownLeftRightBold: "┾",
lineUpBoldDownBoldLeftRight: "╂",
lineUpDownLeftBoldRightBold: "┿",
lineUpBoldDownLeftBoldRight: "╃",
lineUpBoldDownLeftRightBold: "╄",
lineUpDownBoldLeftBoldRight: "╅",
lineUpDownBoldLeftRightBold: "╆",
lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
lineUpDoubleDownDoubleLeftRight: "╫",
lineUpDownLeftDoubleRightDouble: "╪",
lineCross: "╳",
lineBackslash: "╲",
lineSlash: "╱"
};
const specialMainSymbols = {
tick: "✔",
info: "ℹ",
warning: "⚠",
cross: "✘",
squareSmall: "◻",
squareSmallFilled: "◼",
circle: "◯",
circleFilled: "◉",
circleDotted: "◌",
circleDouble: "◎",
circleCircle: "ⓞ",
circleCross: "ⓧ",
circlePipe: "Ⓘ",
radioOn: "◉",
radioOff: "◯",
checkboxOn: "☒",
checkboxOff: "☐",
checkboxCircleOn: "ⓧ",
checkboxCircleOff: "Ⓘ",
pointer: "❯",
triangleUpOutline: "△",
triangleLeft: "◀",
triangleRight: "▶",
lozenge: "◆",
lozengeOutline: "◇",
hamburger: "☰",
smiley: "㋡",
mustache: "෴",
star: "★",
play: "▶",
nodejs: "⬢",
oneSeventh: "⅐",
oneNinth: "⅑",
oneTenth: "⅒"
};
const specialFallbackSymbols = {
tick: "√",
info: "i",
warning: "‼",
cross: "×",
squareSmall: "□",
squareSmallFilled: "■",
circle: "( )",
circleFilled: "(*)",
circleDotted: "( )",
circleDouble: "( )",
circleCircle: "(○)",
circleCross: "(×)",
circlePipe: "(│)",
radioOn: "(*)",
radioOff: "( )",
checkboxOn: "[×]",
checkboxOff: "[ ]",
checkboxCircleOn: "(×)",
checkboxCircleOff: "( )",
pointer: ">",
triangleUpOutline: "∆",
triangleLeft: "◄",
triangleRight: "►",
lozenge: "♦",
lozengeOutline: "◊",
hamburger: "≡",
smiley: "☺",
mustache: "┌─┐",
star: "✶",
play: "►",
nodejs: "♦",
oneSeventh: "1/7",
oneNinth: "1/9",
oneTenth: "1/10"
};
const mainSymbols = {
...common,
...specialMainSymbols
};
const fallbackSymbols = {
...common,
...specialFallbackSymbols
};
const shouldUseMain = isUnicodeSupported();
const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
var figures_default = figures;
const replacements = Object.entries(specialMainSymbols);
//#endregion
//#region ../../node_modules/.pnpm/yoctocolors@2.1.2/node_modules/yoctocolors/base.js
const hasColors = node_tty.default?.WriteStream?.prototype?.hasColors?.() ?? false;
const format = (open, close) => {
if (!hasColors) return (input) => input;
const openCode = `\u001B[${open}m`;
const closeCode = `\u001B[${close}m`;
return (input) => {
const string = input + "";
let index = string.indexOf(closeCode);
if (index === -1) return openCode + string + closeCode;
let result = openCode;
let lastIndex = 0;
const replaceCode = (close === 22 ? closeCode : "") + openCode;
while (index !== -1) {
result += string.slice(lastIndex, index) + replaceCode;
lastIndex = index + closeCode.length;
index = string.indexOf(closeCode, lastIndex);
}
result += string.slice(lastIndex) + closeCode;
return result;
};
};
const reset = format(0, 0);
const bold = format(1, 22);
const dim = format(2, 22);
const italic = format(3, 23);
const underline = format(4, 24);
const overline = format(53, 55);
const inverse = format(7, 27);
const hidden = format(8, 28);
const strikethrough = format(9, 29);
const black = format(30, 39);
const red = format(31, 39);
const green = format(32, 39);
const yellow = format(33, 39);
const blue = format(34, 39);
const magenta = format(35, 39);
const cyan = format(36, 39);
const white = format(37, 39);
const gray = format(90, 39);
const bgBlack = format(40, 49);
const bgRed = format(41, 49);
const bgGreen = format(42, 49);
const bgYellow = format(43, 49);
const bgBlue = format(44, 49);
const bgMagenta = format(45, 49);
const bgCyan = format(46, 49);
const bgWhite = format(47, 49);
const bgGray = format(100, 49);
const redBright = format(91, 39);
const greenBright = format(92, 39);
const yellowBright = format(93, 39);
const blueBright = format(94, 39);
const magentaBright = format(95, 39);
const cyanBright = format(96, 39);
const whiteBright = format(97, 39);
const bgRedBright = format(101, 49);
const bgGreenBright = format(102, 49);
const bgYellowBright = format(103, 49);
const bgBlueBright = format(104, 49);
const bgMagentaBright = format(105, 49);
const bgCyanBright = format(106, 49);
const bgWhiteBright = format(107, 49);
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/verbose/default.js
const defaultVerboseFunction = ({ type, message, timestamp, piped, commandId, result: { failed = false } = {}, options: { reject = true } }) => {
const timestampString = serializeTimestamp(timestamp);
const icon = ICONS[type]({
failed,
reject,
piped
});
const color = COLORS[type]({ reject });
return `${gray(`[${timestampString}]`)} ${gray(`[${commandId}]`)} ${color(icon)} ${color(message)}`;
};
const serializeTimestamp = (timestamp) => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`;
const padField = (field, padding) => String(field).padStart(padding, "0");
const getFinalIcon = ({ failed, reject }) => {
if (!failed) return figures_default.tick;
return reject ? figures_default.cross : figures_default.warning;
};
const ICONS = {
command: ({ piped }) => piped ? "|" : "$",
output: () => " ",
ipc: () => "*",
error: getFinalIcon,
duration: getFinalIcon
};
const identity$1 = (string) => string;
const COLORS = {
command: () => bold,
output: () => identity$1,
ipc: () => identity$1,
error: ({ reject }) => reject ? redBright : yellowBright,
duration: () => gray
};
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/verbose/custom.js
const applyVerboseOnLines = (printedLines, verboseInfo, fdNumber) => {
const verboseFunction = getVerboseFunction(verboseInfo, fdNumber);
return printedLines.map(({ verboseLine, verboseObject }) => applyVerboseFunction(verboseLine, verboseObject, verboseFunction)).filter((printedLine) => printedLine !== void 0).map((printedLine) => appendNewline(printedLine)).join("");
};
const applyVerboseFunction = (verboseLine, verboseObject, verboseFunction) => {
if (verboseFunction === void 0) return verboseLine;
const printedLine = verboseFunction(verboseLine, verboseObject);
if (typeof printedLine === "string") return printedLine;
};
const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine : `${printedLine}\n`;
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/verbose/log.js
const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
const verboseObject = getVerboseObject({
type,
result,
verboseInfo
});
const printedLines = getPrintedLines(verboseMessage, verboseObject);
const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
if (finalLines !== "") console.warn(finalLines.slice(0, -1));
};
const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
type,
escapedCommand,
commandId: `${commandId}`,
timestamp: /* @__PURE__ */ new Date(),
piped,
result,
options
});
const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split("\n").map((message) => getPrintedLine({
...verboseObject,
message
}));
const getPrintedLine = (verboseObject) => {
return {
verboseLine: defaultVerboseFunction(verboseObject),
verboseObject
};
};
const serializeVerboseMessage = (message) => {
const messageString = typeof message === "string" ? message : (0, node_util.inspect)(message);
return escapeLines(messageString).replaceAll(" ", " ".repeat(TAB_SIZE));
};
const TAB_SIZE = 2;
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/verbose/start.js
const logCommand = (escapedCommand, verboseInfo) => {
if (!isVerbose(verboseInfo)) return;
verboseLog({
type: "command",
verboseMessage: escapedCommand,
verboseInfo
});
};
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/verbose/info.js
const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
validateVerbose(verbose);
const commandId = getCommandId(verbose);
return {
verbose,
escapedCommand,
commandId,
rawOptions
};
};
const getCommandId = (verbose) => isVerbose({ verbose }) ? COMMAND_ID++ : void 0;
let COMMAND_ID = 0n;
const validateVerbose = (verbose) => {
for (const fdVerbose of verbose) {
if (fdVerbose === false) throw new TypeError("The \"verbose: false\" option was renamed to \"verbose: 'none'\".");
if (fdVerbose === true) throw new TypeError("The \"verbose: true\" option was renamed to \"verbose: 'short'\".");
if (!VERBOSE_VALUES.includes(fdVerbose) && !isVerboseFunction(fdVerbose)) {
const allowedValues = VERBOSE_VALUES.map((allowedValue) => `'${allowedValue}'`).join(", ");
throw new TypeError(`The "verbose" option must not be ${fdVerbose}. Allowed values are: ${allowedValues} or a function.`);
}
}
};
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/return/duration.js
const getStartTime = () => node_process.hrtime.bigint();
const getDurationMs = (startTime) => Number(node_process.hrtime.bigint() - startTime) / 1e6;
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/arguments/command.js
const handleCommand = (filePath, rawArguments, rawOptions) => {
const startTime = getStartTime();
const { command, escapedCommand } = joinCommand(filePath, rawArguments);
const verbose = normalizeFdSpecificOption(rawOptions, "verbose");
const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
logCommand(escapedCommand, verboseInfo);
return {
command,
escapedCommand,
startTime,
verboseInfo
};
};
//#endregion
//#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
var require_windows = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js": ((exports, module) => {
module.exports = isexe$3;
isexe$3.sync = sync$2;
var fs$2 = require("fs");
function checkPathExt(path$10, options) {
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
if (!pathext) return true;
pathext = pathext.split(";");
if (pathext.indexOf("") !== -1) return true;
for (var i$1 = 0; i$1 < pathext.length; i$1++) {
var p = pathext[i$1].toLowerCase();
if (p && path$10.substr(-p.length).toLowerCase() === p) return true;
}
return false;
}
function checkStat$1(stat, path$10, options) {
if (!stat.isSymbolicLink() && !stat.isFile()) return false;
return checkPathExt(path$10, options);
}
function isexe$3(path$10, options, cb) {
fs$2.stat(path$10, function(er, stat) {
cb(er, er ? false : checkStat$1(stat, path$10, options));
});
}
function sync$2(path$10, options) {
return checkStat$1(fs$2.statSync(path$10), path$10, options);
}
}) });
//#endregion
//#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
var require_mode = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js": ((exports, module) => {
module.exports = isexe$2;
isexe$2.sync = sync$1;
var fs$1 = require("fs");
function isexe$2(path$10, options, cb) {
fs$1.stat(path$10, function(er, stat) {
cb(er, er ? false : checkStat(stat, options));
});
}
function sync$1(path$10, options) {
return checkStat(fs$1.statSync(path$10), options);
}
function checkStat(stat, options) {
return stat.isFile() && checkMode(stat, options);
}
function checkMode(stat, options) {
var mod = stat.mode;
var uid = stat.uid;
var gid = stat.gid;
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
var u$1 = parseInt("100", 8);
var g = parseInt("010", 8);
var o$1 = parseInt("001", 8);
var ug = u$1 | g;
return mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
}
}) });
//#endregion
//#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
var require_isexe = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js": ((exports, module) => {
require("fs");
var core;
if (process.platform === "win32" || global.TESTING_WINDOWS) core = require_windows();
else core = require_mode();
module.exports = isexe$1;
isexe$1.sync = sync;
function isexe$1(path$10, options, cb) {
if (typeof options === "function") {
cb = options;
options = {};
}
if (!cb) {
if (typeof Promise !== "function") throw new TypeError("callback not provided");
return new Promise(function(resolve, reject) {
isexe$1(path$10, options || {}, function(er, is) {
if (er) reject(er);
else resolve(is);
});
});
}
core(path$10, options || {}, function(er, is) {
if (er) {
if (er.code === "EACCES" || options && options.ignoreErrors) {
er = null;
is = false;
}
}
cb(er, is);
});
}
function sync(path$10, options) {
try {
return core.sync(path$10, options || {});
} catch (er) {
if (options && options.ignoreErrors || er.code === "EACCES") return false;
else throw er;
}
}
}) });
//#endregion
//#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
var require_which = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js": ((exports, module) => {
const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
const path$9 = require("path");
const COLON = isWindows ? ";" : ":";
const isexe = require_isexe();
const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
const getPathInfo = (cmd, opt) => {
const colon = opt.colon || COLON;
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [...isWindows ? [process.cwd()] : [], ...(opt.path || process.env.PATH || "").split(colon)];
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
if (isWindows) {
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift("");
}
return {
pathEnv,
pathExt,
pathExtExe
};
};
const which$1 = (cmd, opt, cb) => {
if (typeof opt === "function") {
cb = opt;
opt = {};
}
if (!opt) opt = {};
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
const found = [];
const step = (i$1) => new Promise((resolve, reject) => {
if (i$1 === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
const ppRaw = pathEnv[i$1];
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
const pCmd = path$9.join(pathPart, cmd);
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
resolve(subStep(p, i$1, 0));
});
const subStep = (p, i$1, ii) => new Promise((resolve, reject) => {
if (ii === pathExt.length) return resolve(step(i$1 + 1));
const ext = pathExt[ii];
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
if (!er && is) if (opt.all) found.push(p + ext);
else return resolve(p + ext);
return resolve(subStep(p, i$1, ii + 1));
});
});
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
};
const whichSync = (cmd, opt) => {
opt = opt || {};
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
const found = [];
for (let i$1 = 0; i$1 < pathEnv.length; i$1++) {
const ppRaw = pathEnv[i$1];
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
const pCmd = path$9.join(pathPart, cmd);
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
for (let j = 0; j < pathExt.length; j++) {
const cur = p + pathExt[j];
try {
if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
else return cur;
} catch (ex) {}
}
}
if (opt.all && found.length) return found;
if (opt.nothrow) return null;
throw getNotFoundError(cmd);
};
module.exports = which$1;
which$1.sync = whichSync;
}) });
//#endregion
//#region ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
var require_path_key = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
const pathKey$1 = (options = {}) => {
const environment = options.env || process.env;
if ((options.platform || process.platform) !== "win32") return "PATH";
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
};
module.exports = pathKey$1;
module.exports.default = pathKey$1;
}) });
//#endregion
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
var require_resolveCommand = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js": ((exports, module) => {
const path$8 = require("path");
const which = require_which();
const getPathKey = require_path_key();
function resolveCommandAttempt(parsed, withoutPathExt) {
const env = parsed.options.env || process.env;
const cwd = process.cwd();
const hasCustomCwd = parsed.options.cwd != null;
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
if (shouldSwitchCwd) try {
process.chdir(parsed.options.cwd);
} catch (err) {}
let resolved;
try {
resolved = which.sync(parsed.command, {
path: env[getPathKey({ env })],
pathExt: withoutPathExt ? path$8.delimiter : void 0
});
} catch (e) {} finally {
if (shouldSwitchCwd) process.chdir(cwd);
}
if (resolved) resolved = path$8.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
return resolved;
}
function resolveCommand$1(parsed) {
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
}
module.exports = resolveCommand$1;
}) });
//#endregion
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
var require_escape = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js": ((exports, module) => {
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
function escapeCommand(arg) {
arg = arg.replace(metaCharsRegExp, "^$1");
return arg;
}
function escapeArgument(arg, doubleEscapeMetaChars) {
arg = `${arg}`;
arg = arg.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
arg = `"${arg}"`;
arg = arg.replace(metaCharsRegExp, "^$1");
if (doubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, "^$1");
return arg;
}
module.exports.command = escapeCommand;
module.exports.argument = escapeArgument;
}) });
//#endregion
//#region ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
var require_shebang_regex = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js": ((exports, module) => {
module.exports = /^#!(.*)/;
}) });
//#endregion
//#region ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
var require_shebang_command = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js": ((exports, module) => {
const shebangRegex = require_shebang_regex();
module.exports = (string = "") => {
const match = string.match(shebangRegex);
if (!match) return null;
const [path$10, argument] = match[0].replace(/#! ?/, "").split(" ");
const binary = path$10.split("/").pop();
if (binary === "env") return argument;
return argument ? `${binary} ${argument}` : binary;
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
var require_readShebang = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js": ((exports, module) => {
const fs = require("fs");
const shebangCommand = require_shebang_command();
function readShebang$1(command) {
const size = 150;
const buffer = Buffer.alloc(size);
let fd;
try {
fd = fs.openSync(command, "r");
fs.readSync(fd, buffer, 0, size, 0);
fs.closeSync(fd);
} catch (e) {}
return shebangCommand(buffer.toString());
}
module.exports = readShebang$1;
}) });
//#endregion
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
var require_parse = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js": ((exports, module) => {
const path$7 = require("path");
const resolveCommand = require_resolveCommand();
const escape = require_escape();
const readShebang = require_readShebang();
const isWin$1 = process.platform === "win32";
const isExecutableRegExp = /\.(?:com|exe)$/i;
const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
function detectShebang(parsed) {
parsed.file = resolveCommand(parsed);
const shebang = parsed.file && readShebang(parsed.file);
if (shebang) {
parsed.args.unshift(parsed.file);
parsed.command = shebang;
return resolveCommand(parsed);
}
return parsed.file;
}
function parseNonShell(parsed) {
if (!isWin$1) return parsed;
const commandFile = detectShebang(parsed);
const needsShell = !isExecutableRegExp.test(commandFile);
if (parsed.options.forceShell || needsShell) {
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
parsed.command = path$7.normalize(parsed.command);
parsed.command = escape.command(parsed.command);
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
parsed.args = [
"/d",
"/s",
"/c",
`"${[parsed.command].concat(parsed.args).join(" ")}"`
];
parsed.command = process.env.comspec || "cmd.exe";
parsed.options.windowsVerbatimArguments = true;
}
return parsed;
}
function parse$1(command, args, options) {
if (args && !Array.isArray(args)) {
options = args;
args = null;
}
args = args ? args.slice(0) : [];
options = Object.assign({}, options);
const parsed = {
command,
args,
options,
file: void 0,
original: {
command,
args
}
};
return options.shell ? parsed : parseNonShell(parsed);
}
module.exports = parse$1;
}) });
//#endregion
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
var require_enoent = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js": ((exports, module) => {
const isWin = process.platform === "win32";
function notFoundError(original, syscall) {
return Object.assign(/* @__PURE__ */ new Error(`${syscall} ${original.command} ENOENT`), {
code: "ENOENT",
errno: "ENOENT",
syscall: `${syscall} ${original.command}`,
path: original.command,
spawnargs: original.args
});
}
function hookChildProcess(cp$1, parsed) {
if (!isWin) return;
const originalEmit = cp$1.emit;
cp$1.emit = function(name, arg1) {
if (name === "exit") {
const err = verifyENOENT(arg1, parsed);
if (err) return originalEmit.call(cp$1, "error", err);
}
return originalEmit.apply(cp$1, arguments);
};
}
function verifyENOENT(status, parsed) {
if (isWin && status === 1 && !parsed.file) return notFoundError(parsed.original, "spawn");
return null;
}
function verifyENOENTSync(status, parsed) {
if (isWin && status === 1 && !parsed.file) return notFoundError(parsed.original, "spawnSync");
return null;
}
module.exports = {
hookChildProcess,
verifyENOENT,
verifyENOENTSync,
notFoundError
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
var require_cross_spawn = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js": ((exports, module) => {
const cp = require("child_process");
const parse = require_parse();
const enoent = require_enoent();
function spawn$1(command, args, options) {
const parsed = parse(command, args, options);
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
enoent.hookChildProcess(spawned, parsed);
return spawned;
}
function spawnSync$1(command, args, options) {
const parsed = parse(command, args, options);
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
return result;
}
module.exports = spawn$1;
module.exports.spawn = spawn$1;
module.exports.sync = spawnSync$1;
module.exports._parse = parse;
module.exports._enoent = enoent;
}) });
//#endregion
//#region ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
var import_cross_spawn = /* @__PURE__ */ require_chunk.__toESM(require_cross_spawn(), 1);
function pathKey(options = {}) {
const { env = process.env, platform: platform$1 = process.platform } = options;
if (platform$1 !== "win32") return "PATH";
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
}
//#endregion
//#region ../../node_modules/.pnpm/unicorn-magic@0.3.0/node_modules/unicorn-magic/node.js
const execFileOriginal = (0, node_util.promisify)(node_child_process.execFile);
function toPath(urlOrPath) {
return urlOrPath instanceof URL ? (0, node_url.fileURLToPath)(urlOrPath) : urlOrPath;
}
function traversePathUp(startPath) {
return { *[Symbol.iterator]() {
let currentPath = node_path.default.resolve(toPath(startPath));
let previousPath;
while (previousPath !== currentPath) {
yield currentPath;
previousPath = currentPath;
currentPath = node_path.default.resolve(currentPath, "..");
}
} };
}
const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
//#endregion
//#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
const npmRunPath = ({ cwd = node_process.default.cwd(), path: pathOption = node_process.default.env[pathKey()], preferLocal = true, execPath: execPath$1 = node_process.default.execPath, addExecPath = true } = {}) => {
const cwdPath = node_path.default.resolve(toPath(cwd));
const result = [];
const pathParts = pathOption.split(node_path.default.delimiter);
if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
if (addExecPath) applyExecPath(result, pathParts, execPath$1, cwdPath);
return pathOption === "" || pathOption === node_path.default.delimiter ? `${result.join(node_path.default.delimiter)}${pathOption}` : [...result, pathOption].join(node_path.default.delimiter);
};
const applyPreferLocal = (result, pathParts, cwdPath) => {
for (const directory of traversePathUp(cwdPath)) {
const pathPart = node_path.default.join(directory, "node_modules/.bin");
if (!pathParts.includes(pathPart)) result.push(pathPart);
}
};
const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
const pathPart = node_path.default.resolve(cwdPath, toPath(execPath$1), "..");
if (!pathParts.includes(pathPart)) result.push(pathPart);
};
const npmRunPathEnv = ({ env = node_process.default.env,...options } = {}) => {
env = { ...env };
const pathName = pathKey({ env });
options.path = env[pathName];
env[pathName] = npmRunPath(options);
return env;
};
//#endregion
//#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/return/final-error.js
const getFinalError = (originalError, message, isSync) => {
const ErrorClass = isSync ? ExecaSyncError : ExecaError;
const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
return new ErrorClass(message, options);
};
var DiscardedError = class extends Error {};
const setErrorName = (ErrorClass, value) => {
Object.defineProperty(ErrorClass.prototype, "name", {
value,
writable: true,
enum