@builder.io/qwik
Version:
An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.
1,473 lines (1,451 loc) • 13.1 MB
JavaScript
/**
* @license
* @builder.io/qwik/cli 1.11.0
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
*/
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
var require_src = __commonJS({
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports2, module2) {
"use strict";
var ESC = "\x1B";
var CSI = `${ESC}[`;
var beep = "\x07";
var cursor = {
to(x3, y3) {
if (!y3)
return `${CSI}${x3 + 1}G`;
return `${CSI}${y3 + 1};${x3 + 1}H`;
},
move(x3, y3) {
let ret = "";
if (x3 < 0)
ret += `${CSI}${-x3}D`;
else if (x3 > 0)
ret += `${CSI}${x3}C`;
if (y3 < 0)
ret += `${CSI}${-y3}A`;
else if (y3 > 0)
ret += `${CSI}${y3}B`;
return ret;
},
up: (count = 1) => `${CSI}${count}A`,
down: (count = 1) => `${CSI}${count}B`,
forward: (count = 1) => `${CSI}${count}C`,
backward: (count = 1) => `${CSI}${count}D`,
nextLine: (count = 1) => `${CSI}E`.repeat(count),
prevLine: (count = 1) => `${CSI}F`.repeat(count),
left: `${CSI}G`,
hide: `${CSI}?25l`,
show: `${CSI}?25h`,
save: `${ESC}7`,
restore: `${ESC}8`
};
var scroll = {
up: (count = 1) => `${CSI}S`.repeat(count),
down: (count = 1) => `${CSI}T`.repeat(count)
};
var erase = {
screen: `${CSI}2J`,
up: (count = 1) => `${CSI}1J`.repeat(count),
down: (count = 1) => `${CSI}J`.repeat(count),
line: `${CSI}2K`,
lineEnd: `${CSI}K`,
lineStart: `${CSI}1K`,
lines(count) {
let clear = "";
for (let i = 0; i < count; i++)
clear += this.line + (i < count - 1 ? cursor.up() : "");
if (count)
clear += cursor.left;
return clear;
}
};
module2.exports = { cursor, scroll, erase, beep };
}
});
// node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js
var require_picocolors = __commonJS({
"node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
var argv = process.argv || [];
var env = process.env;
var isColorSupported = !("NO_COLOR" in env || argv.includes("--no-color")) && ("FORCE_COLOR" in env || argv.includes("--color") || process.platform === "win32" || require != null && require("tty").isatty(1) && env.TERM !== "dumb" || "CI" in env);
var formatter = (open, close, replace = open) => (input) => {
let string = "" + input;
let index = string.indexOf(close, open.length);
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
};
var replaceClose = (string, close, replace, index) => {
let result = "";
let cursor = 0;
do {
result += string.substring(cursor, index) + replace;
cursor = index + close.length;
index = string.indexOf(close, cursor);
} while (~index);
return result + string.substring(cursor);
};
var createColors = (enabled = isColorSupported) => {
let init2 = enabled ? formatter : () => String;
return {
isColorSupported: enabled,
reset: init2("\x1B[0m", "\x1B[0m"),
bold: init2("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
dim: init2("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
italic: init2("\x1B[3m", "\x1B[23m"),
underline: init2("\x1B[4m", "\x1B[24m"),
inverse: init2("\x1B[7m", "\x1B[27m"),
hidden: init2("\x1B[8m", "\x1B[28m"),
strikethrough: init2("\x1B[9m", "\x1B[29m"),
black: init2("\x1B[30m", "\x1B[39m"),
red: init2("\x1B[31m", "\x1B[39m"),
green: init2("\x1B[32m", "\x1B[39m"),
yellow: init2("\x1B[33m", "\x1B[39m"),
blue: init2("\x1B[34m", "\x1B[39m"),
magenta: init2("\x1B[35m", "\x1B[39m"),
cyan: init2("\x1B[36m", "\x1B[39m"),
white: init2("\x1B[37m", "\x1B[39m"),
gray: init2("\x1B[90m", "\x1B[39m"),
bgBlack: init2("\x1B[40m", "\x1B[49m"),
bgRed: init2("\x1B[41m", "\x1B[49m"),
bgGreen: init2("\x1B[42m", "\x1B[49m"),
bgYellow: init2("\x1B[43m", "\x1B[49m"),
bgBlue: init2("\x1B[44m", "\x1B[49m"),
bgMagenta: init2("\x1B[45m", "\x1B[49m"),
bgCyan: init2("\x1B[46m", "\x1B[49m"),
bgWhite: init2("\x1B[47m", "\x1B[49m")
};
};
module2.exports = createColors();
module2.exports.createColors = createColors;
}
});
// node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js
var require_which_pm_runs = __commonJS({
"node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js"(exports2, module2) {
"use strict";
module2.exports = function() {
if (!process.env.npm_config_user_agent) {
return void 0;
}
return pmFromUserAgent(process.env.npm_config_user_agent);
};
function pmFromUserAgent(userAgent) {
const pmSpec = userAgent.split(" ")[0];
const separatorPos = pmSpec.lastIndexOf("/");
const name = pmSpec.substring(0, separatorPos);
return {
name: name === "npminstall" ? "cnpm" : name,
version: pmSpec.substring(separatorPos + 1)
};
}
}
});
// node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
var require_windows = __commonJS({
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports2, module2) {
module2.exports = isexe;
isexe.sync = sync;
var fs8 = require("fs");
function checkPathExt(path3, 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 = 0; i < pathext.length; i++) {
var p = pathext[i].toLowerCase();
if (p && path3.substr(-p.length).toLowerCase() === p) {
return true;
}
}
return false;
}
function checkStat(stat, path3, options) {
if (!stat.isSymbolicLink() && !stat.isFile()) {
return false;
}
return checkPathExt(path3, options);
}
function isexe(path3, options, cb) {
fs8.stat(path3, function(er, stat) {
cb(er, er ? false : checkStat(stat, path3, options));
});
}
function sync(path3, options) {
return checkStat(fs8.statSync(path3), path3, options);
}
}
});
// node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
var require_mode = __commonJS({
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports2, module2) {
module2.exports = isexe;
isexe.sync = sync;
var fs8 = require("fs");
function isexe(path3, options, cb) {
fs8.stat(path3, function(er, stat) {
cb(er, er ? false : checkStat(stat, options));
});
}
function sync(path3, options) {
return checkStat(fs8.statSync(path3), 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 = parseInt("100", 8);
var g2 = parseInt("010", 8);
var o2 = parseInt("001", 8);
var ug = u | g2;
var ret = mod & o2 || mod & g2 && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
return ret;
}
}
});
// node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
var require_isexe = __commonJS({
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports2, module2) {
var fs8 = require("fs");
var core;
if (process.platform === "win32" || global.TESTING_WINDOWS) {
core = require_windows();
} else {
core = require_mode();
}
module2.exports = isexe;
isexe.sync = sync;
function isexe(path3, 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(resolve2, reject) {
isexe(path3, options || {}, function(er, is) {
if (er) {
reject(er);
} else {
resolve2(is);
}
});
});
}
core(path3, options || {}, function(er, is) {
if (er) {
if (er.code === "EACCES" || options && options.ignoreErrors) {
er = null;
is = false;
}
}
cb(er, is);
});
}
function sync(path3, options) {
try {
return core.sync(path3, options || {});
} catch (er) {
if (options && options.ignoreErrors || er.code === "EACCES") {
return false;
} else {
throw er;
}
}
}
}
});
// node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
var require_which = __commonJS({
"node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
var path3 = require("path");
var COLON = isWindows ? ";" : ":";
var isexe = require_isexe();
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
var getPathInfo = (cmd, opt) => {
const colon = opt.colon || COLON;
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
// windows always checks the cwd first
...isWindows ? [process.cwd()] : [],
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
"").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
};
};
var which = (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) => new Promise((resolve2, reject) => {
if (i === pathEnv.length)
return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
const ppRaw = pathEnv[i];
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
const pCmd = path3.join(pathPart, cmd);
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
resolve2(subStep(p, i, 0));
});
const subStep = (p, i, ii) => new Promise((resolve2, reject) => {
if (ii === pathExt.length)
return resolve2(step(i + 1));
const ext = pathExt[ii];
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
if (!er && is) {
if (opt.all)
found.push(p + ext);
else
return resolve2(p + ext);
}
return resolve2(subStep(p, i, ii + 1));
});
});
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
};
var whichSync = (cmd, opt) => {
opt = opt || {};
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
const found = [];
for (let i = 0; i < pathEnv.length; i++) {
const ppRaw = pathEnv[i];
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
const pCmd = path3.join(pathPart, cmd);
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
for (let j2 = 0; j2 < pathExt.length; j2++) {
const cur = p + pathExt[j2];
try {
const is = isexe.sync(cur, { pathExt: pathExtExe });
if (is) {
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);
};
module2.exports = which;
which.sync = whichSync;
}
});
// node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
var require_path_key = __commonJS({
"node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports2, module2) {
"use strict";
var pathKey2 = (options = {}) => {
const environment = options.env || process.env;
const platform = options.platform || process.platform;
if (platform !== "win32") {
return "PATH";
}
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
};
module2.exports = pathKey2;
module2.exports.default = pathKey2;
}
});
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js
var require_resolveCommand = __commonJS({
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
"use strict";
var path3 = require("path");
var which = require_which();
var 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 ? path3.delimiter : void 0
});
} catch (e2) {
} finally {
if (shouldSwitchCwd) {
process.chdir(cwd);
}
}
if (resolved) {
resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
}
return resolved;
}
function resolveCommand(parsed) {
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
}
module2.exports = resolveCommand;
}
});
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js
var require_escape = __commonJS({
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
"use strict";
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
function escapeCommand(arg) {
arg = arg.replace(metaCharsRegExp, "^$1");
return arg;
}
function escapeArgument(arg, doubleEscapeMetaChars) {
arg = `${arg}`;
arg = arg.replace(/(\\*)"/g, '$1$1\\"');
arg = arg.replace(/(\\*)$/, "$1$1");
arg = `"${arg}"`;
arg = arg.replace(metaCharsRegExp, "^$1");
if (doubleEscapeMetaChars) {
arg = arg.replace(metaCharsRegExp, "^$1");
}
return arg;
}
module2.exports.command = escapeCommand;
module2.exports.argument = escapeArgument;
}
});
// node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
var require_shebang_regex = __commonJS({
"node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module2) {
"use strict";
module2.exports = /^#!(.*)/;
}
});
// node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
var require_shebang_command = __commonJS({
"node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module2) {
"use strict";
var shebangRegex = require_shebang_regex();
module2.exports = (string = "") => {
const match = string.match(shebangRegex);
if (!match) {
return null;
}
const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
const binary = path3.split("/").pop();
if (binary === "env") {
return argument;
}
return argument ? `${binary} ${argument}` : binary;
};
}
});
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js
var require_readShebang = __commonJS({
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
"use strict";
var fs8 = require("fs");
var shebangCommand = require_shebang_command();
function readShebang(command) {
const size = 150;
const buffer = Buffer.alloc(size);
let fd;
try {
fd = fs8.openSync(command, "r");
fs8.readSync(fd, buffer, 0, size, 0);
fs8.closeSync(fd);
} catch (e2) {
}
return shebangCommand(buffer.toString());
}
module2.exports = readShebang;
}
});
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js
var require_parse = __commonJS({
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
"use strict";
var path3 = require("path");
var resolveCommand = require_resolveCommand();
var escape = require_escape();
var readShebang = require_readShebang();
var isWin = process.platform === "win32";
var isExecutableRegExp = /\.(?:com|exe)$/i;
var 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) {
return parsed;
}
const commandFile = detectShebang(parsed);
const needsShell = !isExecutableRegExp.test(commandFile);
if (parsed.options.forceShell || needsShell) {
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
parsed.command = path3.normalize(parsed.command);
parsed.command = escape.command(parsed.command);
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
parsed.command = process.env.comspec || "cmd.exe";
parsed.options.windowsVerbatimArguments = true;
}
return parsed;
}
function parse(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);
}
module2.exports = parse;
}
});
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js
var require_enoent = __commonJS({
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
"use strict";
var isWin = process.platform === "win32";
function notFoundError(original, syscall) {
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
code: "ENOENT",
errno: "ENOENT",
syscall: `${syscall} ${original.command}`,
path: original.command,
spawnargs: original.args
});
}
function hookChildProcess(cp, parsed) {
if (!isWin) {
return;
}
const originalEmit = cp.emit;
cp.emit = function(name, arg1) {
if (name === "exit") {
const err = verifyENOENT(arg1, parsed, "spawn");
if (err) {
return originalEmit.call(cp, "error", err);
}
}
return originalEmit.apply(cp, 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;
}
module2.exports = {
hookChildProcess,
verifyENOENT,
verifyENOENTSync,
notFoundError
};
}
});
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js
var require_cross_spawn = __commonJS({
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports2, module2) {
"use strict";
var cp = require("child_process");
var parse = require_parse();
var enoent = require_enoent();
function spawn2(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(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;
}
module2.exports = spawn2;
module2.exports.spawn = spawn2;
module2.exports.sync = spawnSync;
module2.exports._parse = parse;
module2.exports._enoent = enoent;
}
});
// node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
var require_merge_stream = __commonJS({
"node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports2, module2) {
"use strict";
var { PassThrough } = require("stream");
module2.exports = function() {
var sources = [];
var output = new PassThrough({ objectMode: true });
output.setMaxListeners(0);
output.add = add;
output.isEmpty = isEmpty;
output.on("unpipe", remove);
Array.prototype.slice.call(arguments).forEach(add);
return output;
function add(source) {
if (Array.isArray(source)) {
source.forEach(add);
return this;
}
sources.push(source);
source.once("end", remove.bind(null, source));
source.once("error", output.emit.bind(output, "error"));
source.pipe(output, { end: false });
return this;
}
function isEmpty() {
return sources.length == 0;
}
function remove(source) {
sources = sources.filter(function(it) {
return it !== source;
});
if (!sources.length && output.readable) {
output.end();
}
}
};
}
});
// node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js
var require_ignore = __commonJS({
"node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js"(exports2, module2) {
function makeArray(subject) {
return Array.isArray(subject) ? subject : [subject];
}
var EMPTY = "";
var SPACE = " ";
var ESCAPE = "\\";
var REGEX_TEST_BLANK_LINE = /^\s+$/;
var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
var REGEX_SPLITALL_CRLF = /\r?\n/g;
var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
var SLASH = "/";
var TMP_KEY_IGNORE = "node-ignore";
if (typeof Symbol !== "undefined") {
TMP_KEY_IGNORE = Symbol.for("node-ignore");
}
var KEY_IGNORE = TMP_KEY_IGNORE;
var define = (object, key, value) => Object.defineProperty(object, key, { value });
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
var RETURN_FALSE = () => false;
var sanitizeRange = (range) => range.replace(
REGEX_REGEXP_RANGE,
(match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
);
var cleanRangeBackSlash = (slashes) => {
const { length } = slashes;
return slashes.slice(0, length - length % 2);
};
var REPLACERS = [
[
// remove BOM
// TODO:
// Other similar zero-width characters?
/^\uFEFF/,
() => EMPTY
],
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
[
// (a\ ) -> (a )
// (a ) -> (a)
// (a \ ) -> (a )
/\\?\s+$/,
(match) => match.indexOf("\\") === 0 ? SPACE : EMPTY
],
// replace (\ ) with ' '
[
/\\\s/g,
() => SPACE
],
// Escape metacharacters
// which is written down by users but means special for regular expressions.
// > There are 12 characters with special meanings:
// > - the backslash \,
// > - the caret ^,
// > - the dollar sign $,
// > - the period or dot .,
// > - the vertical bar or pipe symbol |,
// > - the question mark ?,
// > - the asterisk or star *,
// > - the plus sign +,
// > - the opening parenthesis (,
// > - the closing parenthesis ),
// > - and the opening square bracket [,
// > - the opening curly brace {,
// > These special characters are often called "metacharacters".
[
/[\\$.|*+(){^]/g,
(match) => `\\${match}`
],
[
// > a question mark (?) matches a single character
/(?!\\)\?/g,
() => "[^/]"
],
// leading slash
[
// > A leading slash matches the beginning of the pathname.
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
// A leading slash matches the beginning of the pathname
/^\//,
() => "^"
],
// replace special metacharacter slash after the leading slash
[
/\//g,
() => "\\/"
],
[
// > A leading "**" followed by a slash means match in all directories.
// > For example, "**/foo" matches file or directory "foo" anywhere,
// > the same as pattern "foo".
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
// > under directory "foo".
// Notice that the '*'s have been replaced as '\\*'
/^\^*\\\*\\\*\\\//,
// '**/foo' <-> 'foo'
() => "^(?:.*\\/)?"
],
// starting
[
// there will be no leading '/'
// (which has been replaced by section "leading slash")
// If starts with '**', adding a '^' to the regular expression also works
/^(?=[^^])/,
function startingReplacer() {
return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
}
],
// two globstars
[
// Use lookahead assertions so that we could match more than one `'/**'`
/\\\/\\\*\\\*(?=\\\/|$)/g,
// Zero, one or several directories
// should not use '*', or it will be replaced by the next replacer
// Check if it is not the last `'/**'`
(_3, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
],
// normal intermediate wildcards
[
// Never replace escaped '*'
// ignore rule '\*' will match the path '*'
// 'abc.*/' -> go
// 'abc.*' -> skip this rule,
// coz trailing single wildcard will be handed by [trailing wildcard]
/(^|[^\\]+)(\\\*)+(?=.+)/g,
// '*.js' matches '.js'
// '*.js' doesn't match 'abc'
(_3, p1, p2) => {
const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
return p1 + unescaped;
}
],
[
// unescape, revert step 3 except for back slash
// For example, if a user escape a '\\*',
// after step 3, the result will be '\\\\\\*'
/\\\\\\(?=[$.|*+(){^])/g,
() => ESCAPE
],
[
// '\\\\' -> '\\'
/\\\\/g,
() => ESCAPE
],
[
// > The range notation, e.g. [a-zA-Z],
// > can be used to match one of the characters in a range.
// `\` is escaped by step 3
/(\\)?\[([^\]/]*?)(\\*)($|\])/g,
(match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
],
// ending
[
// 'js' will not match 'js.'
// 'ab' will not match 'abc'
/(?:[^*])$/,
// WTF!
// https://git-scm.com/docs/gitignore
// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
// which re-fixes #24, #38
// > If there is a separator at the end of the pattern then the pattern
// > will only match directories, otherwise the pattern can match both
// > files and directories.
// 'js*' will not match 'a.js'
// 'js/' will not match 'a.js'
// 'js' will match 'a.js' and 'a.js/'
(match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
],
// trailing wildcard
[
/(\^|\\\/)?\\\*$/,
(_3, p1) => {
const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
return `${prefix}(?=$|\\/$)`;
}
]
];
var regexCache = /* @__PURE__ */ Object.create(null);
var makeRegex = (pattern, ignoreCase) => {
let source = regexCache[pattern];
if (!source) {
source = REPLACERS.reduce(
(prev, current) => prev.replace(current[0], current[1].bind(pattern)),
pattern
);
regexCache[pattern] = source;
}
return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
};
var isString2 = (subject) => typeof subject === "string";
var checkPattern = (pattern) => pattern && isString2(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
var IgnoreRule = class {
constructor(origin, pattern, negative, regex) {
this.origin = origin;
this.pattern = pattern;
this.negative = negative;
this.regex = regex;
}
};
var createRule = (pattern, ignoreCase) => {
const origin = pattern;
let negative = false;
if (pattern.indexOf("!") === 0) {
negative = true;
pattern = pattern.substr(1);
}
pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
const regex = makeRegex(pattern, ignoreCase);
return new IgnoreRule(
origin,
pattern,
negative,
regex
);
};
var throwError = (message, Ctor) => {
throw new Ctor(message);
};
var checkPath = (path3, originalPath, doThrow) => {
if (!isString2(path3)) {
return doThrow(
`path must be a string, but got \`${originalPath}\``,
TypeError
);
}
if (!path3) {
return doThrow(`path must not be empty`, TypeError);
}
if (checkPath.isNotRelative(path3)) {
const r2 = "`path.relative()`d";
return doThrow(
`path should be a ${r2} string, but got "${originalPath}"`,
RangeError
);
}
return true;
};
var isNotRelative = (path3) => REGEX_TEST_INVALID_PATH.test(path3);
checkPath.isNotRelative = isNotRelative;
checkPath.convert = (p) => p;
var Ignore = class {
constructor({
ignorecase = true,
ignoreCase = ignorecase,
allowRelativePaths = false
} = {}) {
define(this, KEY_IGNORE, true);
this._rules = [];
this._ignoreCase = ignoreCase;
this._allowRelativePaths = allowRelativePaths;
this._initCache();
}
_initCache() {
this._ignoreCache = /* @__PURE__ */ Object.create(null);
this._testCache = /* @__PURE__ */ Object.create(null);
}
_addPattern(pattern) {
if (pattern && pattern[KEY_IGNORE]) {
this._rules = this._rules.concat(pattern._rules);
this._added = true;
return;
}
if (checkPattern(pattern)) {
const rule = createRule(pattern, this._ignoreCase);
this._added = true;
this._rules.push(rule);
}
}
// @param {Array<string> | string | Ignore} pattern
add(pattern) {
this._added = false;
makeArray(
isString2(pattern) ? splitPattern(pattern) : pattern
).forEach(this._addPattern, this);
if (this._added) {
this._initCache();
}
return this;
}
// legacy
addPattern(pattern) {
return this.add(pattern);
}
// | ignored : unignored
// negative | 0:0 | 0:1 | 1:0 | 1:1
// -------- | ------- | ------- | ------- | --------
// 0 | TEST | TEST | SKIP | X
// 1 | TESTIF | SKIP | TEST | X
// - SKIP: always skip
// - TEST: always test
// - TESTIF: only test if checkUnignored
// - X: that never happen
// @param {boolean} whether should check if the path is unignored,
// setting `checkUnignored` to `false` could reduce additional
// path matching.
// @returns {TestResult} true if a file is ignored
_testOne(path3, checkUnignored) {
let ignored = false;
let unignored = false;
this._rules.forEach((rule) => {
const { negative } = rule;
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
return;
}
const matched = rule.regex.test(path3);
if (matched) {
ignored = !negative;
unignored = negative;
}
});
return {
ignored,
unignored
};
}
// @returns {TestResult}
_test(originalPath, cache, checkUnignored, slices) {
const path3 = originalPath && checkPath.convert(originalPath);
checkPath(
path3,
originalPath,
this._allowRelativePaths ? RETURN_FALSE : throwError
);
return this._t(path3, cache, checkUnignored, slices);
}
_t(path3, cache, checkUnignored, slices) {
if (path3 in cache) {
return cache[path3];
}
if (!slices) {
slices = path3.split(SLASH);
}
slices.pop();
if (!slices.length) {
return cache[path3] = this._testOne(path3, checkUnignored);
}
const parent = this._t(
slices.join(SLASH) + SLASH,
cache,
checkUnignored,
slices
);
return cache[path3] = parent.ignored ? parent : this._testOne(path3, checkUnignored);
}
ignores(path3) {
return this._test(path3, this._ignoreCache, false).ignored;
}
createFilter() {
return (path3) => !this.ignores(path3);
}
filter(paths) {
return makeArray(paths).filter(this.createFilter());
}
// @returns {TestResult}
test(path3) {
return this._test(path3, this._testCache, true);
}
};
var factory = (options) => new Ignore(options);
var isPathValid = (path3) => checkPath(path3 && checkPath.convert(path3), path3, RETURN_FALSE);
factory.isPathValid = isPathValid;
factory.default = factory;
module2.exports = factory;
if (
// Detect `process` so that it can run in browsers.
typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
) {
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
checkPath.convert = makePosix;
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
checkPath.isNotRelative = (path3) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path3) || isNotRelative(path3);
}
}
});
// node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js
var require_base64 = __commonJS({
"node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(exports2) {
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
exports2.encode = function(number) {
if (0 <= number && number < intToCharMap.length) {
return intToCharMap[number];
}
throw new TypeError("Must be between 0 and 63: " + number);
};
exports2.decode = function(charCode) {
var bigA = 65;
var bigZ = 90;
var littleA = 97;
var littleZ = 122;
var zero = 48;
var nine = 57;
var plus = 43;
var slash = 47;
var littleOffset = 26;
var numberOffset = 52;
if (bigA <= charCode && charCode <= bigZ) {
return charCode - bigA;
}
if (littleA <= charCode && charCode <= littleZ) {
return charCode - littleA + littleOffset;
}
if (zero <= charCode && charCode <= nine) {
return charCode - zero + numberOffset;
}
if (charCode == plus) {
return 62;
}
if (charCode == slash) {
return 63;
}
return -1;
};
}
});
// node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js
var require_base64_vlq = __commonJS({
"node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(exports2) {
var base64 = require_base64();
var VLQ_BASE_SHIFT = 5;
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
var VLQ_BASE_MASK = VLQ_BASE - 1;
var VLQ_CONTINUATION_BIT = VLQ_BASE;
function toVLQSigned(aValue) {
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
}
function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative ? -shifted : shifted;
}
exports2.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
var vlq = toVLQSigned(aValue);
do {
digit = vlq & VLQ_BASE_MASK;
vlq >>>= VLQ_BASE_SHIFT;
if (vlq > 0) {
digit |= VLQ_CONTINUATION_BIT;
}
encoded += base64.encode(digit);
} while (vlq > 0);
return encoded;
};
exports2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
var strLen = aStr.length;
var result = 0;
var shift = 0;
var continuation, digit;
do {
if (aIndex >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
}
digit = base64.decode(aStr.charCodeAt(aIndex++));
if (digit === -1) {
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
}
continuation = !!(digit & VLQ_CONTINUATION_BIT);
digit &= VLQ_BASE_MASK;
result = result + (digit << shift);
shift += VLQ_BASE_SHIFT;
} while (continuation);
aOutParam.value = fromVLQSigned(result);
aOutParam.rest = aIndex;
};
}
});
// node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js
var require_util = __commonJS({
"node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js"(exports2) {
function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports2.getArg = getArg;
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;
function urlParse(aUrl) {
var match = aUrl.match(urlRegexp);
if (!match) {
return null;
}
return {
scheme: match[1],
auth: match[2],
host: match[3],
port: match[4],
path: match[5]
};
}
exports2.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = "";
if (aParsedUrl.scheme) {
url += aParsedUrl.scheme + ":";
}
url += "//";
if (aParsedUrl.auth) {
url += aParsedUrl.auth + "@";
}
if (aParsedUrl.host) {
url += aParsedUrl.host;
}
if (aParsedUrl.port) {
url += ":" + aParsedUrl.port;
}
if (aParsedUrl.path) {
url += aParsedUrl.path;
}
return url;
}
exports2.urlGenerate = urlGenerate;
function normalize(aPath) {
var path3 = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
return aPath;
}
path3 = url.path;
}
var isAbsolute = exports2.isAbsolute(path3);
var parts = path3.split(/\/+/);
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
part = parts[i];
if (part === ".") {
parts.splice(i, 1);
} else if (part === "..") {
up++;
} else if (up > 0) {
if (part === "") {
parts.splice(i + 1, up);
up = 0;
} else {
parts.splice(i, 2);
up--;
}
}
}
path3 = parts.join("/");
if (path3 === "") {
path3 = isAbsolute ? "/" : ".";
}
if (url) {
url.path = path3;
return urlGenerate(url);
}
return path3;
}
exports2.normalize = normalize;
function join9(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
if (aPath === "") {
aPath = ".";
}
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || "/";
}
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
aRootUrl.host = aPath;
return urlGenerate(aRootUrl);
}
var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
if (aRootUrl) {
aRootUrl.path = joined;
return urlGenerate(aRootUrl);
}
return joined;
}
exports2.join = join9;
exports2.isAbsolute = function(aPath) {
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
};
function relative3(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
aRoot = aRoot.replace(/\/$/, "");
var level = 0;
while (aPath.indexOf(aRoot + "/") !== 0) {
var index = aRoot.lastIndexOf("/");
if (index < 0) {
return aPath;
}
aRoot = aRoot.slice(0, index);
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
return aPath;
}
++level;
}
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports2.relative = relative3;
var supportsNullProto = function() {
var obj = /* @__PURE__ */ Object.create(null);
return !("__proto__" in obj);
}();
function identity2(s2) {
return s2;
}
function toSetString(aStr) {
if (isProtoString(aStr)) {
return "$" + aStr;
}
return aStr;
}
exports2.toSetString = supportsNullProto ? identity2 : toSetString;
function fromSetString(aStr) {
if (isProtoString(aStr)) {
return aStr.slice(1);
}
return aStr;
}
exports2.fromSetString = supportsNullProto ? identity2 : fromSetString;
function isProtoString(s2) {
if (!s2) {
return false;
}
var length = s2.length;
if (length < 9) {
return false;
}
if (s2.charCodeAt(length - 1) !== 95 || s2.charCodeAt(length - 2) !== 95 || s2.charCodeAt(length - 3) !== 111 || s2.charCodeAt(length - 4) !== 116 || s2.charCodeAt(length - 5) !== 111 || s2.charCodeAt(length - 6) !== 114 || s2.charCodeAt(length - 7) !== 112 || s2.charCodeAt(length - 8) !== 95 || s2.charCodeAt(length - 9) !== 95) {
return false;
}
for (var i = length - 10; i >= 0; i--) {
if (s2.charCodeAt(i) !== 36) {
return false;
}
}
return true;
}
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports2.compareByOriginalPositions = compareByOriginalPositions;
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports2.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
function strcmp(aStr1, aStr2) {
if (aStr1 === aStr2) {
return 0;
}
if (aStr1 === null) {
return 1;
}
if (aStr2 === null) {
return -1;
}
if (aStr1 > aStr2) {
return 1;
}
return -1;
}
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports2.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
function parseSourceMapInput(str) {
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
}
exports2.parseSourceMapInput = parseSourceMapInput;
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
sourceURL = sourceURL || "";
if (sourceRoot) {
if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
sourceRoot += "/";
}
sourceURL = sourceRoot + sourceURL;