UNPKG

create-cloudflare

Version:

A CLI for creating and deploying new applications to Cloudflare.

1,393 lines (1,371 loc) • 3.95 MB
#!/usr/bin/env node "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 __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all2) => { for (var name3 in all2) __defProp(target, name3, { get: all2[name3], 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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); 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/ci-info@4.4.0/node_modules/ci-info/vendors.json var require_vendors = __commonJS({ "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports2, module2) { module2.exports = [ { name: "Agola CI", constant: "AGOLA", env: "AGOLA_GIT_REF", pr: "AGOLA_PULL_REQUEST_ID" }, { name: "Alpic", constant: "ALPIC", env: "ALPIC_HOST" }, { name: "Appcircle", constant: "APPCIRCLE", env: "AC_APPCIRCLE", pr: { env: "AC_GIT_PR", ne: "false" } }, { name: "AppVeyor", constant: "APPVEYOR", env: "APPVEYOR", pr: "APPVEYOR_PULL_REQUEST_NUMBER" }, { name: "AWS CodeBuild", constant: "CODEBUILD", env: "CODEBUILD_BUILD_ARN", pr: { env: "CODEBUILD_WEBHOOK_EVENT", any: [ "PULL_REQUEST_CREATED", "PULL_REQUEST_UPDATED", "PULL_REQUEST_REOPENED" ] } }, { name: "Azure Pipelines", constant: "AZURE_PIPELINES", env: "TF_BUILD", pr: { BUILD_REASON: "PullRequest" } }, { name: "Bamboo", constant: "BAMBOO", env: "bamboo_planKey" }, { name: "Bitbucket Pipelines", constant: "BITBUCKET", env: "BITBUCKET_COMMIT", pr: "BITBUCKET_PR_ID" }, { name: "Bitrise", constant: "BITRISE", env: "BITRISE_IO", pr: "BITRISE_PULL_REQUEST" }, { name: "Buddy", constant: "BUDDY", env: "BUDDY_WORKSPACE_ID", pr: "BUDDY_EXECUTION_PULL_REQUEST_ID" }, { name: "Buildkite", constant: "BUILDKITE", env: "BUILDKITE", pr: { env: "BUILDKITE_PULL_REQUEST", ne: "false" } }, { name: "CircleCI", constant: "CIRCLE", env: "CIRCLECI", pr: "CIRCLE_PULL_REQUEST" }, { name: "Cirrus CI", constant: "CIRRUS", env: "CIRRUS_CI", pr: "CIRRUS_PR" }, { name: "Cloudflare Pages", constant: "CLOUDFLARE_PAGES", env: "CF_PAGES" }, { name: "Cloudflare Workers", constant: "CLOUDFLARE_WORKERS", env: "WORKERS_CI" }, { name: "Codefresh", constant: "CODEFRESH", env: "CF_BUILD_ID", pr: { any: [ "CF_PULL_REQUEST_NUMBER", "CF_PULL_REQUEST_ID" ] } }, { name: "Codemagic", constant: "CODEMAGIC", env: "CM_BUILD_ID", pr: "CM_PULL_REQUEST" }, { name: "Codeship", constant: "CODESHIP", env: { CI_NAME: "codeship" } }, { name: "Drone", constant: "DRONE", env: "DRONE", pr: { DRONE_BUILD_EVENT: "pull_request" } }, { name: "dsari", constant: "DSARI", env: "DSARI" }, { name: "Earthly", constant: "EARTHLY", env: "EARTHLY_CI" }, { name: "Expo Application Services", constant: "EAS", env: "EAS_BUILD" }, { name: "Gerrit", constant: "GERRIT", env: "GERRIT_PROJECT" }, { name: "Gitea Actions", constant: "GITEA_ACTIONS", env: "GITEA_ACTIONS" }, { name: "GitHub Actions", constant: "GITHUB_ACTIONS", env: "GITHUB_ACTIONS", pr: { GITHUB_EVENT_NAME: "pull_request" } }, { name: "GitLab CI", constant: "GITLAB", env: "GITLAB_CI", pr: "CI_MERGE_REQUEST_ID" }, { name: "GoCD", constant: "GOCD", env: "GO_PIPELINE_LABEL" }, { name: "Google Cloud Build", constant: "GOOGLE_CLOUD_BUILD", env: "BUILDER_OUTPUT" }, { name: "Harness CI", constant: "HARNESS", env: "HARNESS_BUILD_ID" }, { name: "Heroku", constant: "HEROKU", env: { env: "NODE", includes: "/app/.heroku/node/bin/node" } }, { name: "Hudson", constant: "HUDSON", env: "HUDSON_URL" }, { name: "Jenkins", constant: "JENKINS", env: [ "JENKINS_URL", "BUILD_ID" ], pr: { any: [ "ghprbPullId", "CHANGE_ID" ] } }, { name: "LayerCI", constant: "LAYERCI", env: "LAYERCI", pr: "LAYERCI_PULL_REQUEST" }, { name: "Magnum CI", constant: "MAGNUM", env: "MAGNUM" }, { name: "Netlify CI", constant: "NETLIFY", env: "NETLIFY", pr: { env: "PULL_REQUEST", ne: "false" } }, { name: "Nevercode", constant: "NEVERCODE", env: "NEVERCODE", pr: { env: "NEVERCODE_PULL_REQUEST", ne: "false" } }, { name: "Prow", constant: "PROW", env: "PROW_JOB_ID" }, { name: "ReleaseHub", constant: "RELEASEHUB", env: "RELEASE_BUILD_ID" }, { name: "Render", constant: "RENDER", env: "RENDER", pr: { IS_PULL_REQUEST: "true" } }, { name: "Sail CI", constant: "SAIL", env: "SAILCI", pr: "SAIL_PULL_REQUEST_NUMBER" }, { name: "Screwdriver", constant: "SCREWDRIVER", env: "SCREWDRIVER", pr: { env: "SD_PULL_REQUEST", ne: "false" } }, { name: "Semaphore", constant: "SEMAPHORE", env: "SEMAPHORE", pr: "PULL_REQUEST_NUMBER" }, { name: "Sourcehut", constant: "SOURCEHUT", env: { CI_NAME: "sourcehut" } }, { name: "Strider CD", constant: "STRIDER", env: "STRIDER" }, { name: "TaskCluster", constant: "TASKCLUSTER", env: [ "TASK_ID", "RUN_ID" ] }, { name: "TeamCity", constant: "TEAMCITY", env: "TEAMCITY_VERSION" }, { name: "Travis CI", constant: "TRAVIS", env: "TRAVIS", pr: { env: "TRAVIS_PULL_REQUEST", ne: "false" } }, { name: "Vela", constant: "VELA", env: "VELA", pr: { VELA_PULL_REQUEST: "1" } }, { name: "Vercel", constant: "VERCEL", env: { any: [ "NOW_BUILDER", "VERCEL" ] }, pr: "VERCEL_GIT_PULL_REQUEST_ID" }, { name: "Visual Studio App Center", constant: "APPCENTER", env: "APPCENTER_BUILD_ID" }, { name: "Woodpecker", constant: "WOODPECKER", env: { CI: "woodpecker" }, pr: { CI_BUILD_EVENT: "pull_request" } }, { name: "Xcode Cloud", constant: "XCODE_CLOUD", env: "CI_XCODE_PROJECT", pr: "CI_PULL_REQUEST_NUMBER" }, { name: "Xcode Server", constant: "XCODE_SERVER", env: "XCS" } ]; } }); // ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js var require_ci_info = __commonJS({ "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js"(exports2) { "use strict"; var vendors = require_vendors(); var env3 = process.env; Object.defineProperty(exports2, "_vendors", { value: vendors.map(function(v2) { return v2.constant; }) }); exports2.name = null; exports2.isPR = null; exports2.id = null; if (env3.CI !== "false") { vendors.forEach(function(vendor) { const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]; const isCI = envs.every(function(obj) { return checkEnv(obj); }); exports2[vendor.constant] = isCI; if (!isCI) { return; } exports2.name = vendor.name; exports2.isPR = checkPR(vendor); exports2.id = vendor.constant; }); } exports2.isCI = !!(env3.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false' (env3.BUILD_ID || // Jenkins, Cloudbees env3.BUILD_NUMBER || // Jenkins, TeamCity env3.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers env3.CI_APP_ID || // Appflow env3.CI_BUILD_ID || // Appflow env3.CI_BUILD_NUMBER || // Appflow env3.CI_NAME || // Codeship and others env3.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI env3.RUN_ID || // TaskCluster, dsari exports2.name || false)); function checkEnv(obj) { if (typeof obj === "string") return !!env3[obj]; if ("env" in obj) { return env3[obj.env] && env3[obj.env].includes(obj.includes); } if ("any" in obj) { return obj.any.some(function(k2) { return !!env3[k2]; }); } return Object.keys(obj).every(function(k2) { return env3[k2] === obj[k2]; }); } function checkPR(vendor) { switch (typeof vendor.pr) { case "string": return !!env3[vendor.pr]; case "object": if ("env" in vendor.pr) { if ("any" in vendor.pr) { return vendor.pr.any.some(function(key) { return env3[vendor.pr.env] === key; }); } else { return vendor.pr.env in env3 && env3[vendor.pr.env] !== vendor.pr.ne; } } else if ("any" in vendor.pr) { return vendor.pr.any.some(function(key) { return !!env3[key]; }); } else { return checkEnv(vendor.pr); } default: return null; } } } }); // ../../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 fs5 = require("fs"); function checkPathExt(path5, 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 p2 = pathext[i].toLowerCase(); if (p2 && path5.substr(-p2.length).toLowerCase() === p2) { return true; } } return false; } function checkStat(stat, path5, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false; } return checkPathExt(path5, options); } function isexe(path5, options, cb) { fs5.stat(path5, function(er, stat) { cb(er, er ? false : checkStat(stat, path5, options)); }); } function sync(path5, options) { return checkStat(fs5.statSync(path5), path5, 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 fs5 = require("fs"); function isexe(path5, options, cb) { fs5.stat(path5, function(er, stat) { cb(er, er ? false : checkStat(stat, options)); }); } function sync(path5, options) { return checkStat(fs5.statSync(path5), 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 o = parseInt("001", 8); var ug = u | g2; var ret = mod & o || 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 fs5 = 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(path5, 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(resolve12, reject) { isexe(path5, options || {}, function(er, is) { if (er) { reject(er); } else { resolve12(is); } }); }); } core(path5, options || {}, function(er, is) { if (er) { if (er.code === "EACCES" || options && options.ignoreErrors) { er = null; is = false; } } cb(er, is); }); } function sync(path5, options) { try { return core.sync(path5, 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 isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys"; var path5 = require("path"); var COLON = isWindows2 ? ";" : ":"; 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(/\//) || isWindows2 && cmd.match(/\\/) ? [""] : [ // windows always checks the cwd first ...isWindows2 ? [process.cwd()] : [], ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */ "").split(colon) ]; const pathExtExe = isWindows2 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : ""; const pathExt = isWindows2 ? pathExtExe.split(colon) : [""]; if (isWindows2) { 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((resolve12, reject) => { if (i === pathEnv.length) return opt.all && found.length ? resolve12(found) : reject(getNotFoundError(cmd)); const ppRaw = pathEnv[i]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; const pCmd = path5.join(pathPart, cmd); const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; resolve12(subStep(p2, i, 0)); }); const subStep = (p2, i, ii) => new Promise((resolve12, reject) => { if (ii === pathExt.length) return resolve12(step(i + 1)); const ext = pathExt[ii]; isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => { if (!er && is) { if (opt.all) found.push(p2 + ext); else return resolve12(p2 + ext); } return resolve12(subStep(p2, 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 = path5.join(pathPart, cmd); const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; for (let j2 = 0; j2 < pathExt.length; j2++) { const cur = p2 + 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 pathKey = (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 = pathKey; module2.exports.default = pathKey; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js var require_resolveCommand = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) { "use strict"; var path5 = require("path"); var which = require_which(); var getPathKey = require_path_key(); function resolveCommandAttempt(parsed, withoutPathExt) { const env3 = 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: env3[getPathKey({ env: env3 })], pathExt: withoutPathExt ? path5.delimiter : void 0 }); } catch (e) { } finally { if (shouldSwitchCwd) { process.chdir(cwd); } } if (resolved) { resolved = path5.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.6/node_modules/cross-spawn/lib/util/escape.js var require_escape = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/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(/(?=(\\+?)?)\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; } 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 [path5, argument] = match[0].replace(/#! ?/, "").split(" "); const binary = path5.split("/").pop(); if (binary === "env") { return argument; } return argument ? `${binary} ${argument}` : binary; }; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js var require_readShebang = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) { "use strict"; var fs5 = require("fs"); var shebangCommand = require_shebang_command(); function readShebang(command2) { const size = 150; const buffer = Buffer.alloc(size); let fd; try { fd = fs5.openSync(command2, "r"); fs5.readSync(fd, buffer, 0, size, 0); fs5.closeSync(fd); } catch (e) { } return shebangCommand(buffer.toString()); } module2.exports = readShebang; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js var require_parse = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) { "use strict"; var path5 = 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 = path5.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 parse10(command2, args, options) { if (args && !Array.isArray(args)) { options = args; args = null; } args = args ? args.slice(0) : []; options = Object.assign({}, options); const parsed = { command: command2, args, options, file: void 0, original: { command: command2, args } }; return options.shell ? parsed : parseNonShell(parsed); } module2.exports = parse10; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js var require_enoent = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/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(cp3, parsed) { if (!isWin) { return; } const originalEmit = cp3.emit; cp3.emit = function(name3, arg1) { if (name3 === "exit") { const err = verifyENOENT(arg1, parsed); if (err) { return originalEmit.call(cp3, "error", err); } } return originalEmit.apply(cp3, arguments); }; } function verifyENOENT(status2, parsed) { if (isWin && status2 === 1 && !parsed.file) { return notFoundError(parsed.original, "spawn"); } return null; } function verifyENOENTSync(status2, parsed) { if (isWin && status2 === 1 && !parsed.file) { return notFoundError(parsed.original, "spawnSync"); } return null; } module2.exports = { hookChildProcess, verifyENOENT, verifyENOENTSync, notFoundError }; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js var require_cross_spawn = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) { "use strict"; var cp3 = require("child_process"); var parse10 = require_parse(); var enoent = require_enoent(); function spawn2(command2, args, options) { const parsed = parse10(command2, args, options); const spawned = cp3.spawn(parsed.command, parsed.args, parsed.options); enoent.hookChildProcess(spawned, parsed); return spawned; } function spawnSync(command2, args, options) { const parsed = parse10(command2, args, options); const result = cp3.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 = parse10; module2.exports._enoent = enoent; } }); // ../../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 ESC2 = "\x1B"; var CSI = `${ESC2}[`; var beep = "\x07"; var cursor = { to(x2, y2) { if (!y2) return `${CSI}${x2 + 1}G`; return `${CSI}${y2 + 1};${x2 + 1}H`; }, move(x2, y2) { let ret = ""; if (x2 < 0) ret += `${CSI}${-x2}D`; else if (x2 > 0) ret += `${CSI}${x2}C`; if (y2 < 0) ret += `${CSI}${-y2}A`; else if (y2 > 0) ret += `${CSI}${y2}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: `${ESC2}7`, restore: `${ESC2}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.1.1/node_modules/picocolors/picocolors.js var require_picocolors = __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) { var p2 = process || {}; var argv = p2.argv || []; var env3 = p2.env || {}; var isColorSupported = !(!!env3.NO_COLOR || argv.includes("--no-color")) && (!!env3.FORCE_COLOR || argv.includes("--color") || p2.platform === "win32" || (p2.stdout || {}).isTTY && env3.TERM !== "dumb" || !!env3.CI); var formatter = (open2, close, replace = open2) => (input) => { let string = "" + input, index = string.indexOf(close, open2.length); return ~index ? open2 + replaceClose(string, close, replace, index) + close : open2 + string + close; }; var replaceClose = (string, close, replace, index) => { let result = "", 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 f = enabled ? formatter : () => String; return { isColorSupported: enabled, reset: f("\x1B[0m", "\x1B[0m"), bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"), dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"), italic: f("\x1B[3m", "\x1B[23m"), underline: f("\x1B[4m", "\x1B[24m"), inverse: f("\x1B[7m", "\x1B[27m"), hidden: f("\x1B[8m", "\x1B[28m"), strikethrough: f("\x1B[9m", "\x1B[29m"), black: f("\x1B[30m", "\x1B[39m"), red: f("\x1B[31m", "\x1B[39m"), green: f("\x1B[32m", "\x1B[39m"), yellow: f("\x1B[33m", "\x1B[39m"), blue: f("\x1B[34m", "\x1B[39m"), magenta: f("\x1B[35m", "\x1B[39m"), cyan: f("\x1B[36m", "\x1B[39m"), white: f("\x1B[37m", "\x1B[39m"), gray: f("\x1B[90m", "\x1B[39m"), bgBlack: f("\x1B[40m", "\x1B[49m"), bgRed: f("\x1B[41m", "\x1B[49m"), bgGreen: f("\x1B[42m", "\x1B[49m"), bgYellow: f("\x1B[43m", "\x1B[49m"), bgBlue: f("\x1B[44m", "\x1B[49m"), bgMagenta: f("\x1B[45m", "\x1B[49m"), bgCyan: f("\x1B[46m", "\x1B[49m"), bgWhite: f("\x1B[47m", "\x1B[49m"), blackBright: f("\x1B[90m", "\x1B[39m"), redBright: f("\x1B[91m", "\x1B[39m"), greenBright: f("\x1B[92m", "\x1B[39m"), yellowBright: f("\x1B[93m", "\x1B[39m"), blueBright: f("\x1B[94m", "\x1B[39m"), magentaBright: f("\x1B[95m", "\x1B[39m"), cyanBright: f("\x1B[96m", "\x1B[39m"), whiteBright: f("\x1B[97m", "\x1B[39m"), bgBlackBright: f("\x1B[100m", "\x1B[49m"), bgRedBright: f("\x1B[101m", "\x1B[49m"), bgGreenBright: f("\x1B[102m", "\x1B[49m"), bgYellowBright: f("\x1B[103m", "\x1B[49m"), bgBlueBright: f("\x1B[104m", "\x1B[49m"), bgMagentaBright: f("\x1B[105m", "\x1B[49m"), bgCyanBright: f("\x1B[106m", "\x1B[49m"), bgWhiteBright: f("\x1B[107m", "\x1B[49m") }; }; module2.exports = createColors(); module2.exports.createColors = createColors; } }); // ../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js var require_mimic_fn = __commonJS({ "../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports2, module2) { "use strict"; var mimicFn = (to, from) => { for (const prop of Reflect.ownKeys(from)) { Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); } return to; }; module2.exports = mimicFn; module2.exports.default = mimicFn; } }); // ../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js var require_onetime = __commonJS({ "../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports2, module2) { "use strict"; var mimicFn = require_mimic_fn(); var calledFunctions = /* @__PURE__ */ new WeakMap(); var onetime2 = (function_, options = {}) => { if (typeof function_ !== "function") { throw new TypeError("Expected a function"); } let returnValue; let callCount = 0; const functionName = function_.displayName || function_.name || "<anonymous>"; const onetime3 = function(...arguments_) { calledFunctions.set(onetime3, ++callCount); if (callCount === 1) { returnValue = function_.apply(this, arguments_); function_ = null; } else if (options.throw === true) { throw new Error(`Function \`${functionName}\` can only be called once`); } return returnValue; }; mimicFn(onetime3, function_); calledFunctions.set(onetime3, callCount); return onetime3; }; module2.exports = onetime2; module2.exports.default = onetime2; module2.exports.callCount = (function_) => { if (!calledFunctions.has(function_)) { throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); } return calledFunctions.get(function_); }; } }); // ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js var require_signals = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports2, module2) { module2.exports = [ "SIGABRT", "SIGALRM", "SIGHUP", "SIGINT", "SIGTERM" ]; if (process.platform !== "win32") { module2.exports.push( "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT" // should detect profiler and enable/disable accordingly. // see #21 // 'SIGPROF' ); } if (process.platform === "linux") { module2.exports.push( "SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT", "SIGUNUSED" ); } } }); // ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports2, module2) { var process6 = global.process; var processOk = function(process7) { return process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function"; }; if (!processOk(process6)) { module2.exports = function() { return function() { }; }; } else { assert7 = require("assert"); signals = require_signals(); isWin = /^win/i.test(process6.platform); EE = require("events"); if (typeof EE !== "function") { EE = EE.EventEmitter; } if (process6.__signal_exit_emitter__) { emitter = process6.__signal_exit_emitter__; } else { emitter = process6.__signal_exit_emitter__ = new EE(); emitter.count = 0; emitter.emitted = {}; } if (!emitter.infinite) { emitter.setMaxListeners(Infinity); emitter.infinite = true; } module2.exports = function(cb, opts) { if (!processOk(global.process)) { return function() { }; } assert7.equal(typeof cb, "function", "a callback must be provided for exit handler"); if (loaded === false) { load(); } var ev = "exit"; if (opts && opts.alwaysLast) { ev = "afterexit"; } var remove = function() { emitter.removeListener(ev, cb); if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { unload(); } }; emitter.on(ev, cb); return remove; }; unload = function unload2() { if (!loaded || !processOk(global.process)) { return; } loaded = false; signals.forEach(function(sig) { try { process6.removeListener(sig, sigListeners[sig]); } catch (er) { } }); process6.emit = originalProcessEmit; process6.reallyExit = originalProcessReallyExit; emitter.count -= 1; }; module2.exports.unload = unload; emit = function emit2(event, code, signal) { if (emitter.emitted[event]) { return; } emitter.emitted[event] = true; emitter.emit(event, code, signal); }; sigListeners = {}; signals.forEach(function(sig) { sigListeners[sig] = function listener() { if (!processOk(global.process)) { return; } var listeners = process6.listeners(sig); if (listeners.length === emitter.count) { unload(); emit("exit", null, sig); emit("afterexit", null, sig); if (isWin && sig === "SIGHUP") { sig = "SIGINT"; } process6.kill(process6.pid, sig); } }; }); module2.exports.signals = function() { return signals; }; loaded = false; load = function load2() { if (loaded || !processOk(global.process)) { return; } loaded = true; emitter.count += 1; signals = signals.filter(function(sig) { try { process6.on(sig, sigListeners[sig]); return true; } catch (er) { return false; } }); process6.emit = processEmit; process6.reallyExit = processReallyExit; }; module2.exports.load = load; originalProcessReallyExit = process6.reallyExit; processReallyExit = function processReallyExit2(code) { if (!processOk(global.process)) { return; } process6.exitCode = code || /* istanbul ignore next */ 0; emit("exit", process6.exitCode, null); emit("afterexit", process6.exitCode, null); originalProcessReallyExit.call(process6, process6.exitCode); }; originalProcessEmit = process6.emit; processEmit = function processEmit2(ev, arg) { if (ev === "exit" && processOk(global.process)) { if (arg !== void 0) { process6.exitCode = arg; } var ret = originalProcessEmit.apply(this, arguments); emit("exit", process6.exitCode, null); emit("afterexit", process6.exitCode, null); return ret; } else { return originalProcessEmit.apply(this, arguments); } }; } var assert7; var signals; var isWin; var EE; var emitter; var unload; var emit; var sigListeners; var loaded; var load; var originalProcessReallyExit; var processReallyExit; var originalProcessEmit; var processEmit; } }); // ../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js var require_eastasianwidth = __commonJS({ "../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports2, module2) { var eaw = {}; if ("undefined" == typeof module2) { window.eastasianwidth = eaw; } else { module2.exports = eaw; } eaw.eastAsianWidth = function(character) { var x2 = character.charCodeAt(0); var y2 = character.length == 2 ? character.charCodeAt(1) : 0; var codePoint = x2; if (55296 <= x2 && x2 <= 56319 && (56320 <= y2 && y2 <= 57343)) { x2 &= 1023; y2 &= 1023; codePoint = x2 << 10 | y2; codePoint += 65536; } if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) { return "F"; } if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) { return "H"; } if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) { return "W"; } if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) { return "Na"; } if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756