UNPKG

vercel

Version:

The command-line interface for Vercel

1,639 lines (1,628 loc) • 334 kB
import { createRequire as __createRequire } from 'node:module'; import { fileURLToPath as __fileURLToPath } from 'node:url'; import { dirname as __dirname_ } from 'node:path'; const require = __createRequire(import.meta.url); const __filename = __fileURLToPath(import.meta.url); const __dirname = __dirname_(__filename); import { require_semver } from "./chunk-IB5L4LKZ.js"; import { require_execa } from "./chunk-N733ZD4W.js"; import { VERCEL_DIR, readJSONFile, require_dist as require_dist2, require_dist3, require_lib, require_minimatch, require_pluralize } from "./chunk-X775BOSL.js"; import { CantParseJSONFile, cmd, code } from "./chunk-UGXBNJMO.js"; import { output_manager_default, require_dist } from "./chunk-ZQKJVHXY.js"; import { __commonJS, __export, __require, __toESM } from "./chunk-TZ2YI2VH.js"; // ../../node_modules/.pnpm/builtins@1.0.3/node_modules/builtins/builtins.json var require_builtins = __commonJS({ "../../node_modules/.pnpm/builtins@1.0.3/node_modules/builtins/builtins.json"(exports, module) { module.exports = [ "assert", "buffer", "child_process", "cluster", "console", "constants", "crypto", "dgram", "dns", "domain", "events", "fs", "http", "https", "module", "net", "os", "path", "process", "punycode", "querystring", "readline", "repl", "stream", "string_decoder", "timers", "tls", "tty", "url", "util", "v8", "vm", "zlib" ]; } }); // ../../node_modules/.pnpm/validate-npm-package-name@3.0.0/node_modules/validate-npm-package-name/index.js var require_validate_npm_package_name = __commonJS({ "../../node_modules/.pnpm/validate-npm-package-name@3.0.0/node_modules/validate-npm-package-name/index.js"(exports, module) { "use strict"; var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"); var builtins = require_builtins(); var blacklist = [ "node_modules", "favicon.ico" ]; var validate = module.exports = function(name) { var warnings = []; var errors = []; if (name === null) { errors.push("name cannot be null"); return done(warnings, errors); } if (name === void 0) { errors.push("name cannot be undefined"); return done(warnings, errors); } if (typeof name !== "string") { errors.push("name must be a string"); return done(warnings, errors); } if (!name.length) { errors.push("name length must be greater than zero"); } if (name.match(/^\./)) { errors.push("name cannot start with a period"); } if (name.match(/^_/)) { errors.push("name cannot start with an underscore"); } if (name.trim() !== name) { errors.push("name cannot contain leading or trailing spaces"); } blacklist.forEach(function(blacklistedName) { if (name.toLowerCase() === blacklistedName) { errors.push(blacklistedName + " is a blacklisted name"); } }); builtins.forEach(function(builtin) { if (name.toLowerCase() === builtin) { warnings.push(builtin + " is a core module name"); } }); if (name.length > 214) { warnings.push("name can no longer contain more than 214 characters"); } if (name.toLowerCase() !== name) { warnings.push("name can no longer contain capital letters"); } if (/[~'!()*]/.test(name.split("/").slice(-1)[0])) { warnings.push(`name can no longer contain special characters ("~'!()*")`); } if (encodeURIComponent(name) !== name) { var nameMatch = name.match(scopedPackagePattern); if (nameMatch) { var user = nameMatch[1]; var pkg = nameMatch[2]; if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) { return done(warnings, errors); } } errors.push("name can only contain URL-friendly characters"); } return done(warnings, errors); }; validate.scopedPackagePattern = scopedPackagePattern; var done = function(warnings, errors) { var result = { validForNewPackages: errors.length === 0 && warnings.length === 0, validForOldPackages: errors.length === 0, warnings, errors }; if (!result.warnings.length) delete result.warnings; if (!result.errors.length) delete result.errors; return result; }; } }); // ../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host-info.js var require_git_host_info = __commonJS({ "../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host-info.js"(exports, module) { "use strict"; var gitHosts = module.exports = { github: { // First two are insecure and generally shouldn't be used any more, but // they are still supported. "protocols": ["git", "http", "git+ssh", "git+https", "ssh", "https"], "domain": "github.com", "treepath": "tree", "filetemplate": "https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}", "bugstemplate": "https://{domain}/{user}/{project}/issues", "gittemplate": "git://{auth@}{domain}/{user}/{project}.git{#committish}", "tarballtemplate": "https://codeload.{domain}/{user}/{project}/tar.gz/{committish}" }, bitbucket: { "protocols": ["git+ssh", "git+https", "ssh", "https"], "domain": "bitbucket.org", "treepath": "src", "tarballtemplate": "https://{domain}/{user}/{project}/get/{committish}.tar.gz" }, gitlab: { "protocols": ["git+ssh", "git+https", "ssh", "https"], "domain": "gitlab.com", "treepath": "tree", "bugstemplate": "https://{domain}/{user}/{project}/issues", "httpstemplate": "git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}", "tarballtemplate": "https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}", "pathmatch": /^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/ }, gist: { "protocols": ["git", "git+ssh", "git+https", "ssh", "https"], "domain": "gist.github.com", "pathmatch": /^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/, "filetemplate": "https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}", "bugstemplate": "https://{domain}/{project}", "gittemplate": "git://{domain}/{project}.git{#committish}", "sshtemplate": "git@{domain}:/{project}.git{#committish}", "sshurltemplate": "git+ssh://git@{domain}/{project}.git{#committish}", "browsetemplate": "https://{domain}/{project}{/committish}", "browsefiletemplate": "https://{domain}/{project}{/committish}{#path}", "docstemplate": "https://{domain}/{project}{/committish}", "httpstemplate": "git+https://{domain}/{project}.git{#committish}", "shortcuttemplate": "{type}:{project}{#committish}", "pathtemplate": "{project}{#committish}", "tarballtemplate": "https://codeload.github.com/gist/{project}/tar.gz/{committish}", "hashformat": function(fragment) { return "file-" + formatHashFragment(fragment); } } }; var gitHostDefaults = { "sshtemplate": "git@{domain}:{user}/{project}.git{#committish}", "sshurltemplate": "git+ssh://git@{domain}/{user}/{project}.git{#committish}", "browsetemplate": "https://{domain}/{user}/{project}{/tree/committish}", "browsefiletemplate": "https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}", "docstemplate": "https://{domain}/{user}/{project}{/tree/committish}#readme", "httpstemplate": "git+https://{auth@}{domain}/{user}/{project}.git{#committish}", "filetemplate": "https://{domain}/{user}/{project}/raw/{committish}/{path}", "shortcuttemplate": "{type}:{user}/{project}{#committish}", "pathtemplate": "{user}/{project}{#committish}", "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/, "hashformat": formatHashFragment }; Object.keys(gitHosts).forEach(function(name) { Object.keys(gitHostDefaults).forEach(function(key) { if (gitHosts[name][key]) return; gitHosts[name][key] = gitHostDefaults[key]; }); gitHosts[name].protocols_re = RegExp("^(" + gitHosts[name].protocols.map(function(protocol) { return protocol.replace(/([\\+*{}()[\]$^|])/g, "\\$1"); }).join("|") + "):$"); }); function formatHashFragment(fragment) { return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, "").replace(/\W+/g, "-"); } } }); // ../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host.js var require_git_host = __commonJS({ "../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host.js"(exports, module) { "use strict"; var gitHosts = require_git_host_info(); var extend = Object.assign || function _extend(target, source) { if (source === null || typeof source !== "object") return target; var keys = Object.keys(source); var i = keys.length; while (i--) { target[keys[i]] = source[keys[i]]; } return target; }; module.exports = GitHost; function GitHost(type, user, auth, project, committish, defaultRepresentation, opts) { var gitHostInfo = this; gitHostInfo.type = type; Object.keys(gitHosts[type]).forEach(function(key) { gitHostInfo[key] = gitHosts[type][key]; }); gitHostInfo.user = user; gitHostInfo.auth = auth; gitHostInfo.project = project; gitHostInfo.committish = committish; gitHostInfo.default = defaultRepresentation; gitHostInfo.opts = opts || {}; } GitHost.prototype.hash = function() { return this.committish ? "#" + this.committish : ""; }; GitHost.prototype._fill = function(template, opts) { if (!template) return; var vars = extend({}, opts); vars.path = vars.path ? vars.path.replace(/^[/]+/g, "") : ""; opts = extend(extend({}, this.opts), opts); var self = this; Object.keys(this).forEach(function(key) { if (self[key] != null && vars[key] == null) vars[key] = self[key]; }); var rawAuth = vars.auth; var rawcommittish = vars.committish; var rawFragment = vars.fragment; var rawPath = vars.path; var rawProject = vars.project; Object.keys(vars).forEach(function(key) { var value = vars[key]; if ((key === "path" || key === "project") && typeof value === "string") { vars[key] = value.split("/").map(function(pathComponent) { return encodeURIComponent(pathComponent); }).join("/"); } else { vars[key] = encodeURIComponent(value); } }); vars["auth@"] = rawAuth ? rawAuth + "@" : ""; vars["#fragment"] = rawFragment ? "#" + this.hashformat(rawFragment) : ""; vars.fragment = vars.fragment ? vars.fragment : ""; vars["#path"] = rawPath ? "#" + this.hashformat(rawPath) : ""; vars["/path"] = vars.path ? "/" + vars.path : ""; vars.projectPath = rawProject.split("/").map(encodeURIComponent).join("/"); if (opts.noCommittish) { vars["#committish"] = ""; vars["/tree/committish"] = ""; vars["/committish"] = ""; vars.committish = ""; } else { vars["#committish"] = rawcommittish ? "#" + rawcommittish : ""; vars["/tree/committish"] = vars.committish ? "/" + vars.treepath + "/" + vars.committish : ""; vars["/committish"] = vars.committish ? "/" + vars.committish : ""; vars.committish = vars.committish || "master"; } var res = template; Object.keys(vars).forEach(function(key) { res = res.replace(new RegExp("[{]" + key + "[}]", "g"), vars[key]); }); if (opts.noGitPlus) { return res.replace(/^git[+]/, ""); } else { return res; } }; GitHost.prototype.ssh = function(opts) { return this._fill(this.sshtemplate, opts); }; GitHost.prototype.sshurl = function(opts) { return this._fill(this.sshurltemplate, opts); }; GitHost.prototype.browse = function(P, F, opts) { if (typeof P === "string") { if (typeof F !== "string") { opts = F; F = null; } return this._fill(this.browsefiletemplate, extend({ fragment: F, path: P }, opts)); } else { return this._fill(this.browsetemplate, P); } }; GitHost.prototype.docs = function(opts) { return this._fill(this.docstemplate, opts); }; GitHost.prototype.bugs = function(opts) { return this._fill(this.bugstemplate, opts); }; GitHost.prototype.https = function(opts) { return this._fill(this.httpstemplate, opts); }; GitHost.prototype.git = function(opts) { return this._fill(this.gittemplate, opts); }; GitHost.prototype.shortcut = function(opts) { return this._fill(this.shortcuttemplate, opts); }; GitHost.prototype.path = function(opts) { return this._fill(this.pathtemplate, opts); }; GitHost.prototype.tarball = function(opts_) { var opts = extend({}, opts_, { noCommittish: false }); return this._fill(this.tarballtemplate, opts); }; GitHost.prototype.file = function(P, opts) { return this._fill(this.filetemplate, extend({ path: P }, opts)); }; GitHost.prototype.getDefaultRepresentation = function() { return this.default; }; GitHost.prototype.toString = function(opts) { if (this.default && typeof this[this.default] === "function") return this[this.default](opts); return this.sshurl(opts); }; } }); // ../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/index.js var require_hosted_git_info = __commonJS({ "../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/index.js"(exports, module) { "use strict"; var url = __require("url"); var gitHosts = require_git_host_info(); var GitHost = module.exports = require_git_host(); var protocolToRepresentationMap = { "git+ssh:": "sshurl", "git+https:": "https", "ssh:": "sshurl", "git:": "git" }; function protocolToRepresentation(protocol) { return protocolToRepresentationMap[protocol] || protocol.slice(0, -1); } var authProtocols = { "git:": true, "https:": true, "git+https:": true, "http:": true, "git+http:": true }; var cache = {}; module.exports.fromUrl = function(giturl, opts) { if (typeof giturl !== "string") return; var key = giturl + JSON.stringify(opts || {}); if (!(key in cache)) { cache[key] = fromUrl(giturl, opts); } return cache[key]; }; function fromUrl(giturl, opts) { if (giturl == null || giturl === "") return; var url2 = fixupUnqualifiedGist( isGitHubShorthand(giturl) ? "github:" + giturl : giturl ); var parsed = parseGitUrl(url2); var shortcutMatch = url2.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/); var matches = Object.keys(gitHosts).map(function(gitHostName) { try { var gitHostInfo = gitHosts[gitHostName]; var auth = null; if (parsed.auth && authProtocols[parsed.protocol]) { auth = parsed.auth; } var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null; var user = null; var project = null; var defaultRepresentation = null; if (shortcutMatch && shortcutMatch[1] === gitHostName) { user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]); project = decodeURIComponent(shortcutMatch[3].replace(/\.git$/, "")); defaultRepresentation = "shortcut"; } else { if (parsed.host && parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, "") !== gitHostInfo.domain) return; if (!gitHostInfo.protocols_re.test(parsed.protocol)) return; if (!parsed.path) return; var pathmatch = gitHostInfo.pathmatch; var matched = parsed.path.match(pathmatch); if (!matched) return; if (matched[1] !== null && matched[1] !== void 0) { user = decodeURIComponent(matched[1].replace(/^:/, "")); } project = decodeURIComponent(matched[2]); defaultRepresentation = protocolToRepresentation(parsed.protocol); } return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts); } catch (ex) { if (ex instanceof URIError) { } else throw ex; } }).filter(function(gitHostInfo) { return gitHostInfo; }); if (matches.length !== 1) return; return matches[0]; } function isGitHubShorthand(arg) { return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg); } function fixupUnqualifiedGist(giturl) { var parsed = url.parse(giturl); if (parsed.protocol === "gist:" && parsed.host && !parsed.path) { return parsed.protocol + "/" + parsed.host; } else { return giturl; } } function parseGitUrl(giturl) { var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/); if (!matched) { var legacy = url.parse(giturl); if (legacy.auth && typeof url.URL === "function") { var authmatch = giturl.match(/[^@]+@[^:/]+/); if (authmatch) { var whatwg = new url.URL(authmatch[0]); legacy.auth = whatwg.username || ""; if (whatwg.password) legacy.auth += ":" + whatwg.password; } } return legacy; } return { protocol: "git+ssh:", slashes: true, auth: matched[1], host: matched[2], port: null, hostname: matched[2], hash: matched[4], search: null, query: null, pathname: "/" + matched[3], path: "/" + matched[3], href: "git+ssh://" + matched[1] + "@" + matched[2] + "/" + matched[3] + (matched[4] || "") }; } } }); // ../../node_modules/.pnpm/os-tmpdir@1.0.2/node_modules/os-tmpdir/index.js var require_os_tmpdir = __commonJS({ "../../node_modules/.pnpm/os-tmpdir@1.0.2/node_modules/os-tmpdir/index.js"(exports, module) { "use strict"; var isWindows = process.platform === "win32"; var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; module.exports = function() { var path2; if (isWindows) { path2 = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + "\\temp"; } else { path2 = process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp"; } if (trailingSlashRe.test(path2)) { path2 = path2.slice(0, -1); } return path2; }; } }); // ../../node_modules/.pnpm/os-homedir@1.0.2/node_modules/os-homedir/index.js var require_os_homedir = __commonJS({ "../../node_modules/.pnpm/os-homedir@1.0.2/node_modules/os-homedir/index.js"(exports, module) { "use strict"; var os = __require("os"); function homedir() { var env = process.env; var home = env.HOME; var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; if (process.platform === "win32") { return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; } if (process.platform === "darwin") { return home || (user ? "/Users/" + user : null); } if (process.platform === "linux") { return home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null); } return home || null; } module.exports = typeof os.homedir === "function" ? os.homedir : homedir; } }); // ../../node_modules/.pnpm/osenv@0.1.5/node_modules/osenv/osenv.js var require_osenv = __commonJS({ "../../node_modules/.pnpm/osenv@0.1.5/node_modules/osenv/osenv.js"(exports) { var isWindows = process.platform === "win32"; var path2 = __require("path"); var exec = __require("child_process").exec; var osTmpdir = require_os_tmpdir(); var osHomedir = require_os_homedir(); function memo(key, lookup, fallback) { var fell = false; var falling = false; exports[key] = function(cb) { var val = lookup(); if (!val && !fell && !falling && fallback) { fell = true; falling = true; exec(fallback, function(er, output, stderr) { falling = false; if (er) return; val = output.trim(); }); } exports[key] = function(cb2) { if (cb2) process.nextTick(cb2.bind(null, null, val)); return val; }; if (cb && !falling) process.nextTick(cb.bind(null, null, val)); return val; }; } memo("user", function() { return isWindows ? process.env.USERDOMAIN + "\\" + process.env.USERNAME : process.env.USER; }, "whoami"); memo("prompt", function() { return isWindows ? process.env.PROMPT : process.env.PS1; }); memo("hostname", function() { return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME; }, "hostname"); memo("tmpdir", function() { return osTmpdir(); }); memo("home", function() { return osHomedir(); }); memo("path", function() { return (process.env.PATH || process.env.Path || process.env.path).split(isWindows ? ";" : ":"); }); memo("editor", function() { return process.env.EDITOR || process.env.VISUAL || (isWindows ? "notepad.exe" : "vi"); }); memo("shell", function() { return isWindows ? process.env.ComSpec || "cmd" : process.env.SHELL || "bash"; }); } }); // ../../node_modules/.pnpm/npm-package-arg@6.1.0/node_modules/npm-package-arg/npa.js var require_npa = __commonJS({ "../../node_modules/.pnpm/npm-package-arg@6.1.0/node_modules/npm-package-arg/npa.js"(exports, module) { "use strict"; module.exports = npa2; module.exports.resolve = resolve3; module.exports.Result = Result; var url; var HostedGit; var semver; var path2; var validatePackageName; var osenv; var isWindows = process.platform === "win32" || global.FAKE_WINDOWS; var hasSlashes = isWindows ? /\\|[/]/ : /[/]/; var isURL = /^(?:git[+])?[a-z]+:/i; var isFilename = /[.](?:tgz|tar.gz|tar)$/i; function npa2(arg, where) { let name; let spec; if (typeof arg === "object") { if (arg instanceof Result && (!where || where === arg.where)) { return arg; } else if (arg.name && arg.rawSpec) { return npa2.resolve(arg.name, arg.rawSpec, where || arg.where); } else { return npa2(arg.raw, where || arg.where); } } const nameEndsAt = arg[0] === "@" ? arg.slice(1).indexOf("@") + 1 : arg.indexOf("@"); const namePart = nameEndsAt > 0 ? arg.slice(0, nameEndsAt) : arg; if (isURL.test(arg)) { spec = arg; } else if (namePart[0] !== "@" && (hasSlashes.test(namePart) || isFilename.test(namePart))) { spec = arg; } else if (nameEndsAt > 0) { name = namePart; spec = arg.slice(nameEndsAt + 1); } else { if (!validatePackageName) validatePackageName = require_validate_npm_package_name(); const valid = validatePackageName(arg); if (valid.validForOldPackages) { name = arg; } else { spec = arg; } } return resolve3(name, spec, where, arg); } var isFilespec = isWindows ? /^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/ : /^(?:[.]|~[/]|[/]|[a-zA-Z]:)/; function resolve3(name, spec, where, arg) { const res = new Result({ raw: arg, name, rawSpec: spec, fromArgument: arg != null }); if (name) res.setName(name); if (spec && (isFilespec.test(spec) || /^file:/i.test(spec))) { return fromFile(res, where); } else if (spec && /^npm:/i.test(spec)) { return fromAlias(res, where); } if (!HostedGit) HostedGit = require_hosted_git_info(); const hosted = HostedGit.fromUrl(spec, { noGitPlus: true, noCommittish: true }); if (hosted) { return fromHostedGit(res, hosted); } else if (spec && isURL.test(spec)) { return fromURL(res); } else if (spec && (hasSlashes.test(spec) || isFilename.test(spec))) { return fromFile(res, where); } else { return fromRegistry(res); } } function invalidPackageName(name, valid) { const err = new Error(`Invalid package name "${name}": ${valid.errors.join("; ")}`); err.code = "EINVALIDPACKAGENAME"; return err; } function invalidTagName(name) { const err = new Error(`Invalid tag name "${name}": Tags may not have any characters that encodeURIComponent encodes.`); err.code = "EINVALIDTAGNAME"; return err; } function Result(opts) { this.type = opts.type; this.registry = opts.registry; this.where = opts.where; if (opts.raw == null) { this.raw = opts.name ? opts.name + "@" + opts.rawSpec : opts.rawSpec; } else { this.raw = opts.raw; } this.name = void 0; this.escapedName = void 0; this.scope = void 0; this.rawSpec = opts.rawSpec == null ? "" : opts.rawSpec; this.saveSpec = opts.saveSpec; this.fetchSpec = opts.fetchSpec; if (opts.name) this.setName(opts.name); this.gitRange = opts.gitRange; this.gitCommittish = opts.gitCommittish; this.hosted = opts.hosted; } Result.prototype = {}; Result.prototype.setName = function(name) { if (!validatePackageName) validatePackageName = require_validate_npm_package_name(); const valid = validatePackageName(name); if (!valid.validForOldPackages) { throw invalidPackageName(name, valid); } this.name = name; this.scope = name[0] === "@" ? name.slice(0, name.indexOf("/")) : void 0; this.escapedName = name.replace("/", "%2f"); return this; }; Result.prototype.toString = function() { const full = []; if (this.name != null && this.name !== "") full.push(this.name); const spec = this.saveSpec || this.fetchSpec || this.rawSpec; if (spec != null && spec !== "") full.push(spec); return full.length ? full.join("@") : this.raw; }; Result.prototype.toJSON = function() { const result = Object.assign({}, this); delete result.hosted; return result; }; function setGitCommittish(res, committish) { if (committish != null && committish.length >= 7 && committish.slice(0, 7) === "semver:") { res.gitRange = decodeURIComponent(committish.slice(7)); res.gitCommittish = null; } else { res.gitCommittish = committish === "" ? null : committish; } return res; } var isAbsolutePath = /^[/]|^[A-Za-z]:/; function resolvePath(where, spec) { if (isAbsolutePath.test(spec)) return spec; if (!path2) path2 = __require("path"); return path2.resolve(where, spec); } function isAbsolute(dir) { if (dir[0] === "/") return true; if (/^[A-Za-z]:/.test(dir)) return true; return false; } function fromFile(res, where) { if (!where) where = process.cwd(); res.type = isFilename.test(res.rawSpec) ? "file" : "directory"; res.where = where; const spec = res.rawSpec.replace(/\\/g, "/").replace(/^file:[/]*([A-Za-z]:)/, "$1").replace(/^file:(?:[/]*([~./]))?/, "$1"); if (/^~[/]/.test(spec)) { if (!osenv) osenv = require_osenv(); res.fetchSpec = resolvePath(osenv.home(), spec.slice(2)); res.saveSpec = "file:" + spec; } else { res.fetchSpec = resolvePath(where, spec); if (isAbsolute(spec)) { res.saveSpec = "file:" + spec; } else { if (!path2) path2 = __require("path"); res.saveSpec = "file:" + path2.relative(where, res.fetchSpec); } } return res; } function fromHostedGit(res, hosted) { res.type = "git"; res.hosted = hosted; res.saveSpec = hosted.toString({ noGitPlus: false, noCommittish: false }); res.fetchSpec = hosted.getDefaultRepresentation() === "shortcut" ? null : hosted.toString(); return setGitCommittish(res, hosted.committish); } function unsupportedURLType(protocol, spec) { const err = new Error(`Unsupported URL Type "${protocol}": ${spec}`); err.code = "EUNSUPPORTEDPROTOCOL"; return err; } function matchGitScp(spec) { const matched = spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i); return matched && !matched[1].match(/:[0-9]+\/?.*$/i) && { fetchSpec: matched[1], gitCommittish: matched[2] == null ? null : matched[2] }; } function fromURL(res) { if (!url) url = __require("url"); const urlparse = url.parse(res.rawSpec); res.saveSpec = res.rawSpec; switch (urlparse.protocol) { case "git:": case "git+http:": case "git+https:": case "git+rsync:": case "git+ftp:": case "git+file:": case "git+ssh:": res.type = "git"; const match = urlparse.protocol === "git+ssh:" && matchGitScp(res.rawSpec); if (match) { setGitCommittish(res, match.gitCommittish); res.fetchSpec = match.fetchSpec; } else { setGitCommittish(res, urlparse.hash != null ? urlparse.hash.slice(1) : ""); urlparse.protocol = urlparse.protocol.replace(/^git[+]/, ""); delete urlparse.hash; res.fetchSpec = url.format(urlparse); } break; case "http:": case "https:": res.type = "remote"; res.fetchSpec = res.saveSpec; break; default: throw unsupportedURLType(urlparse.protocol, res.rawSpec); } return res; } function fromAlias(res, where) { const subSpec = npa2(res.rawSpec.substr(4), where); if (subSpec.type === "alias") { throw new Error("nested aliases not supported"); } if (!subSpec.registry) { throw new Error("aliases only work for registry deps"); } res.subSpec = subSpec; res.registry = true; res.type = "alias"; res.saveSpec = null; res.fetchSpec = null; return res; } function fromRegistry(res) { res.registry = true; const spec = res.rawSpec === "" ? "latest" : res.rawSpec; res.saveSpec = null; res.fetchSpec = spec; if (!semver) semver = require_semver(); const version2 = semver.valid(spec, true); const range = semver.validRange(spec, true); if (version2) { res.type = "version"; } else if (range) { res.type = "range"; } else { if (encodeURIComponent(spec) !== spec) { throw invalidTagName(spec); } res.type = "tag"; } return res; } } }); // ../../node_modules/.pnpm/mime-db@1.40.0/node_modules/mime-db/db.json var require_db = __commonJS({ "../../node_modules/.pnpm/mime-db@1.40.0/node_modules/mime-db/db.json"(exports, module) { module.exports = { "application/1d-interleaved-parityfec": { source: "iana" }, "application/3gpdash-qoe-report+xml": { source: "iana", compressible: true }, "application/3gpp-ims+xml": { source: "iana", compressible: true }, "application/a2l": { source: "iana" }, "application/activemessage": { source: "iana" }, "application/activity+json": { source: "iana", compressible: true }, "application/alto-costmap+json": { source: "iana", compressible: true }, "application/alto-costmapfilter+json": { source: "iana", compressible: true }, "application/alto-directory+json": { source: "iana", compressible: true }, "application/alto-endpointcost+json": { source: "iana", compressible: true }, "application/alto-endpointcostparams+json": { source: "iana", compressible: true }, "application/alto-endpointprop+json": { source: "iana", compressible: true }, "application/alto-endpointpropparams+json": { source: "iana", compressible: true }, "application/alto-error+json": { source: "iana", compressible: true }, "application/alto-networkmap+json": { source: "iana", compressible: true }, "application/alto-networkmapfilter+json": { source: "iana", compressible: true }, "application/aml": { source: "iana" }, "application/andrew-inset": { source: "iana", extensions: ["ez"] }, "application/applefile": { source: "iana" }, "application/applixware": { source: "apache", extensions: ["aw"] }, "application/atf": { source: "iana" }, "application/atfx": { source: "iana" }, "application/atom+xml": { source: "iana", compressible: true, extensions: ["atom"] }, "application/atomcat+xml": { source: "iana", compressible: true, extensions: ["atomcat"] }, "application/atomdeleted+xml": { source: "iana", compressible: true }, "application/atomicmail": { source: "iana" }, "application/atomsvc+xml": { source: "iana", compressible: true, extensions: ["atomsvc"] }, "application/atsc-dwd+xml": { source: "iana", compressible: true }, "application/atsc-held+xml": { source: "iana", compressible: true }, "application/atsc-rsat+xml": { source: "iana", compressible: true }, "application/atxml": { source: "iana" }, "application/auth-policy+xml": { source: "iana", compressible: true }, "application/bacnet-xdd+zip": { source: "iana", compressible: false }, "application/batch-smtp": { source: "iana" }, "application/bdoc": { compressible: false, extensions: ["bdoc"] }, "application/beep+xml": { source: "iana", compressible: true }, "application/calendar+json": { source: "iana", compressible: true }, "application/calendar+xml": { source: "iana", compressible: true }, "application/call-completion": { source: "iana" }, "application/cals-1840": { source: "iana" }, "application/cbor": { source: "iana" }, "application/cccex": { source: "iana" }, "application/ccmp+xml": { source: "iana", compressible: true }, "application/ccxml+xml": { source: "iana", compressible: true, extensions: ["ccxml"] }, "application/cdfx+xml": { source: "iana", compressible: true }, "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] }, "application/cdmi-container": { source: "iana", extensions: ["cdmic"] }, "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] }, "application/cdmi-object": { source: "iana", extensions: ["cdmio"] }, "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] }, "application/cdni": { source: "iana" }, "application/cea": { source: "iana" }, "application/cea-2018+xml": { source: "iana", compressible: true }, "application/cellml+xml": { source: "iana", compressible: true }, "application/cfw": { source: "iana" }, "application/clue_info+xml": { source: "iana", compressible: true }, "application/cms": { source: "iana" }, "application/cnrp+xml": { source: "iana", compressible: true }, "application/coap-group+json": { source: "iana", compressible: true }, "application/coap-payload": { source: "iana" }, "application/commonground": { source: "iana" }, "application/conference-info+xml": { source: "iana", compressible: true }, "application/cose": { source: "iana" }, "application/cose-key": { source: "iana" }, "application/cose-key-set": { source: "iana" }, "application/cpl+xml": { source: "iana", compressible: true }, "application/csrattrs": { source: "iana" }, "application/csta+xml": { source: "iana", compressible: true }, "application/cstadata+xml": { source: "iana", compressible: true }, "application/csvm+json": { source: "iana", compressible: true }, "application/cu-seeme": { source: "apache", extensions: ["cu"] }, "application/cwt": { source: "iana" }, "application/cybercash": { source: "iana" }, "application/dart": { compressible: true }, "application/dash+xml": { source: "iana", compressible: true, extensions: ["mpd"] }, "application/dashdelta": { source: "iana" }, "application/davmount+xml": { source: "iana", compressible: true, extensions: ["davmount"] }, "application/dca-rft": { source: "iana" }, "application/dcd": { source: "iana" }, "application/dec-dx": { source: "iana" }, "application/dialog-info+xml": { source: "iana", compressible: true }, "application/dicom": { source: "iana" }, "application/dicom+json": { source: "iana", compressible: true }, "application/dicom+xml": { source: "iana", compressible: true }, "application/dii": { source: "iana" }, "application/dit": { source: "iana" }, "application/dns": { source: "iana" }, "application/dns+json": { source: "iana", compressible: true }, "application/dns-message": { source: "iana" }, "application/docbook+xml": { source: "apache", compressible: true, extensions: ["dbk"] }, "application/dskpp+xml": { source: "iana", compressible: true }, "application/dssc+der": { source: "iana", extensions: ["dssc"] }, "application/dssc+xml": { source: "iana", compressible: true, extensions: ["xdssc"] }, "application/dvcs": { source: "iana" }, "application/ecmascript": { source: "iana", compressible: true, extensions: ["ecma", "es"] }, "application/edi-consent": { source: "iana" }, "application/edi-x12": { source: "iana", compressible: false }, "application/edifact": { source: "iana", compressible: false }, "application/efi": { source: "iana" }, "application/emergencycalldata.comment+xml": { source: "iana", compressible: true }, "application/emergencycalldata.control+xml": { source: "iana", compressible: true }, "application/emergencycalldata.deviceinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.ecall.msd": { source: "iana" }, "application/emergencycalldata.providerinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.serviceinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.subscriberinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.veds+xml": { source: "iana", compressible: true }, "application/emma+xml": { source: "iana", compressible: true, extensions: ["emma"] }, "application/emotionml+xml": { source: "iana", compressible: true }, "application/encaprtp": { source: "iana" }, "application/epp+xml": { source: "iana", compressible: true }, "application/epub+zip": { source: "iana", compressible: false, extensions: ["epub"] }, "application/eshop": { source: "iana" }, "application/exi": { source: "iana", extensions: ["exi"] }, "application/expect-ct-report+json": { source: "iana", compressible: true }, "application/fastinfoset": { source: "iana" }, "application/fastsoap": { source: "iana" }, "application/fdt+xml": { source: "iana", compressible: true }, "application/fhir+json": { source: "iana", compressible: true }, "application/fhir+xml": { source: "iana", compressible: true }, "application/fido.trusted-apps+json": { compressible: true }, "application/fits": { source: "iana" }, "application/font-sfnt": { source: "iana" }, "application/font-tdpfr": { source: "iana", extensions: ["pfr"] }, "application/font-woff": { source: "iana", compressible: false }, "application/framework-attributes+xml": { source: "iana", compressible: true }, "application/geo+json": { source: "iana", compressible: true, extensions: ["geojson"] }, "application/geo+json-seq": { source: "iana" }, "application/geopackage+sqlite3": { source: "iana" }, "application/geoxacml+xml": { source: "iana", compressible: true }, "application/gltf-buffer": { source: "iana" }, "application/gml+xml": { source: "iana", compressible: true, extensions: ["gml"] }, "application/gpx+xml": { source: "apache", compressible: true, extensions: ["gpx"] }, "application/gxf": { source: "apache", extensions: ["gxf"] }, "application/gzip": { source: "iana", compressible: false, extensions: ["gz"] }, "application/h224": { source: "iana" }, "application/held+xml": { source: "iana", compressible: true }, "application/hjson": { extensions: ["hjson"] }, "application/http": { source: "iana" }, "application/hyperstudio": { source: "iana", extensions: ["stk"] }, "application/ibe-key-request+xml": { source: "iana", compressible: true }, "application/ibe-pkg-reply+xml": { source: "iana", compressible: true }, "application/ibe-pp-data": { source: "iana" }, "application/iges": { source: "iana" }, "application/im-iscomposing+xml": { source: "iana", compressible: true }, "application/index": { source: "iana" }, "application/index.cmd": { source: "iana" }, "application/index.obj": { source: "iana" }, "application/index.response": { source: "iana" }, "application/index.vnd": { source: "iana" }, "application/inkml+xml": { source: "iana", compressible: true, extensions: ["ink", "inkml"] }, "application/iotp": { source: "iana" }, "application/ipfix": { source: "iana", extensions: ["ipfix"] }, "application/ipp": { source: "iana" }, "application/isup": { source: "iana" }, "application/its+xml": { source: "iana", compressible: true }, "application/java-archive": { source: "apache", compressible: false, extensions: ["jar", "war", "ear"] }, "application/java-serialized-object": { source: "apache", compressible: false, extensions: ["ser"] }, "application/java-vm": { source: "apache", compressible: false, extensions: ["class"] }, "application/javascript": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["js", "mjs"] }, "application/jf2feed+json": { source: "iana", compressible: true }, "application/jose": { source: "iana" }, "application/jose+json": { source: "iana", compressible: true }, "application/jrd+json": { source: "iana", compressible: true }, "application/json": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["json", "map"] }, "application/json-patch+json": { source: "iana", compressible: true }, "application/json-seq": { source: "iana" }, "application/json5": { extensions: ["json5"] }, "application/jsonml+json": { source: "apache", compressible: true, extensions: ["jsonml"] }, "application/jwk+json": { source: "iana", compressible: true }, "application/jwk-set+json": { source: "iana", compressible: true }, "application/jwt": { source: "iana" }, "application/kpml-request+xml": { source: "iana", compressible: true }, "application/kpml-response+xml": { source: "iana", compressible: true }, "application/ld+json": { source: "iana", compressible: true, extensions: ["jsonld"] }, "application/lgr+xml": { source: "iana", compressible: true }, "application/link-format": { source: "iana" }, "application/load-control+xml": { source: "iana", compressible: true }, "application/lost+xml": { source: "iana", compressible: true, extensions: ["lostxml"] }, "application/lostsync+xml": { source: "iana", compressible: true }, "application/lxf": { source: "iana" }, "application/mac-binhex40": { source: "iana", extensions: ["hqx"] }, "application/mac-compactpro": { source: "apache", extensions: ["cpt"] }, "application/macwriteii": { source: "iana" }, "application/mads+xml": { source: "iana", compressible: true, extensions: ["mads"] }, "application/manifest+json": { charset: "UTF-8", compressible: true, extensions: ["webmanifest"] }, "application/marc": { source: "iana", extensions: ["mrc"] }, "application/marcxml+xml": { source: "iana", compressible: true, extensions: ["mrcx"] }, "application/mathematica": { source: "iana", extensions: ["ma", "nb", "mb"] }, "application/mathml+xml": { source: "iana", compressible: true, extensions: ["mathml"] }, "application/mathml-content+xml": { source: "iana", compressible: true }, "application/mathml-presentation+xml": { source: "iana", compressible: true }, "application/mbms-associated-procedure-description+xml": { source: "iana", compressible: true }, "application/mbms-deregister+xml": { source: "iana", compressible: true }, "application/mbms-envelope+xml": {