Update package dependencies and remove unused files from node_modules
This commit is contained in:
126
node_modules/esbuild/lib/main.js
generated
vendored
126
node_modules/esbuild/lib/main.js
generated
vendored
@@ -218,31 +218,25 @@ function writeUInt32LE(buffer, value, offset) {
|
||||
var quote = JSON.stringify;
|
||||
var buildLogLevelDefault = "warning";
|
||||
var transformLogLevelDefault = "silent";
|
||||
function validateAndJoinStringArray(values, what) {
|
||||
const toJoin = [];
|
||||
for (const value of values) {
|
||||
validateStringValue(value, what);
|
||||
if (value.indexOf(",") >= 0) throw new Error(`Invalid ${what}: ${value}`);
|
||||
toJoin.push(value);
|
||||
}
|
||||
return toJoin.join(",");
|
||||
function validateTarget(target) {
|
||||
validateStringValue(target, "target");
|
||||
if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`);
|
||||
return target;
|
||||
}
|
||||
var canBeAnything = () => null;
|
||||
var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean";
|
||||
var mustBeString = (value) => typeof value === "string" ? null : "a string";
|
||||
var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object";
|
||||
var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer";
|
||||
var mustBeValidPortNumber = (value) => typeof value === "number" && value === (value | 0) && value >= 0 && value <= 65535 ? null : "a valid port number";
|
||||
var mustBeFunction = (value) => typeof value === "function" ? null : "a function";
|
||||
var mustBeArray = (value) => Array.isArray(value) ? null : "an array";
|
||||
var mustBeArrayOfStrings = (value) => Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "an array of strings";
|
||||
var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object";
|
||||
var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object";
|
||||
var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module";
|
||||
var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null";
|
||||
var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean";
|
||||
var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object";
|
||||
var mustBeStringOrArrayOfStrings = (value) => typeof value === "string" || Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "a string or an array of strings";
|
||||
var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array";
|
||||
var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array";
|
||||
var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL";
|
||||
function getFlag(object, keys, key, mustBeFn) {
|
||||
@@ -306,7 +300,7 @@ function pushCommonFlags(flags, options, keys) {
|
||||
let legalComments = getFlag(options, keys, "legalComments", mustBeString);
|
||||
let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString);
|
||||
let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean);
|
||||
let target = getFlag(options, keys, "target", mustBeStringOrArrayOfStrings);
|
||||
let target = getFlag(options, keys, "target", mustBeStringOrArray);
|
||||
let format = getFlag(options, keys, "format", mustBeString);
|
||||
let globalName = getFlag(options, keys, "globalName", mustBeString);
|
||||
let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp);
|
||||
@@ -317,8 +311,8 @@ function pushCommonFlags(flags, options, keys) {
|
||||
let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean);
|
||||
let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean);
|
||||
let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger);
|
||||
let drop = getFlag(options, keys, "drop", mustBeArrayOfStrings);
|
||||
let dropLabels = getFlag(options, keys, "dropLabels", mustBeArrayOfStrings);
|
||||
let drop = getFlag(options, keys, "drop", mustBeArray);
|
||||
let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray);
|
||||
let charset = getFlag(options, keys, "charset", mustBeString);
|
||||
let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean);
|
||||
let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean);
|
||||
@@ -331,14 +325,17 @@ function pushCommonFlags(flags, options, keys) {
|
||||
let define = getFlag(options, keys, "define", mustBeObject);
|
||||
let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
|
||||
let supported = getFlag(options, keys, "supported", mustBeObject);
|
||||
let pure = getFlag(options, keys, "pure", mustBeArrayOfStrings);
|
||||
let pure = getFlag(options, keys, "pure", mustBeArray);
|
||||
let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
|
||||
let platform = getFlag(options, keys, "platform", mustBeString);
|
||||
let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject);
|
||||
if (legalComments) flags.push(`--legal-comments=${legalComments}`);
|
||||
if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`);
|
||||
if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`);
|
||||
if (target) flags.push(`--target=${validateAndJoinStringArray(Array.isArray(target) ? target : [target], "target")}`);
|
||||
if (target) {
|
||||
if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`);
|
||||
else flags.push(`--target=${validateTarget(target)}`);
|
||||
}
|
||||
if (format) flags.push(`--format=${format}`);
|
||||
if (globalName) flags.push(`--global-name=${globalName}`);
|
||||
if (platform) flags.push(`--platform=${platform}`);
|
||||
@@ -352,9 +349,9 @@ function pushCommonFlags(flags, options, keys) {
|
||||
if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`);
|
||||
if (ignoreAnnotations) flags.push(`--ignore-annotations`);
|
||||
if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`);
|
||||
if (dropLabels) flags.push(`--drop-labels=${validateAndJoinStringArray(dropLabels, "drop label")}`);
|
||||
if (mangleProps) flags.push(`--mangle-props=${jsRegExpToGoRegExp(mangleProps)}`);
|
||||
if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`);
|
||||
if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`);
|
||||
if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`);
|
||||
if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`);
|
||||
if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`);
|
||||
if (jsx) flags.push(`--jsx=${jsx}`);
|
||||
if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`);
|
||||
@@ -403,11 +400,11 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
||||
let outdir = getFlag(options, keys, "outdir", mustBeString);
|
||||
let outbase = getFlag(options, keys, "outbase", mustBeString);
|
||||
let tsconfig = getFlag(options, keys, "tsconfig", mustBeString);
|
||||
let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArrayOfStrings);
|
||||
let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArrayOfStrings);
|
||||
let mainFields = getFlag(options, keys, "mainFields", mustBeArrayOfStrings);
|
||||
let conditions = getFlag(options, keys, "conditions", mustBeArrayOfStrings);
|
||||
let external = getFlag(options, keys, "external", mustBeArrayOfStrings);
|
||||
let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray);
|
||||
let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray);
|
||||
let mainFields = getFlag(options, keys, "mainFields", mustBeArray);
|
||||
let conditions = getFlag(options, keys, "conditions", mustBeArray);
|
||||
let external = getFlag(options, keys, "external", mustBeArray);
|
||||
let packages = getFlag(options, keys, "packages", mustBeString);
|
||||
let alias = getFlag(options, keys, "alias", mustBeObject);
|
||||
let loader = getFlag(options, keys, "loader", mustBeObject);
|
||||
@@ -416,7 +413,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
||||
let entryNames = getFlag(options, keys, "entryNames", mustBeString);
|
||||
let chunkNames = getFlag(options, keys, "chunkNames", mustBeString);
|
||||
let assetNames = getFlag(options, keys, "assetNames", mustBeString);
|
||||
let inject = getFlag(options, keys, "inject", mustBeArrayOfStrings);
|
||||
let inject = getFlag(options, keys, "inject", mustBeArray);
|
||||
let banner = getFlag(options, keys, "banner", mustBeObject);
|
||||
let footer = getFlag(options, keys, "footer", mustBeObject);
|
||||
let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints);
|
||||
@@ -438,13 +435,37 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
||||
if (outbase) flags.push(`--outbase=${outbase}`);
|
||||
if (tsconfig) flags.push(`--tsconfig=${tsconfig}`);
|
||||
if (packages) flags.push(`--packages=${packages}`);
|
||||
if (resolveExtensions) flags.push(`--resolve-extensions=${validateAndJoinStringArray(resolveExtensions, "resolve extension")}`);
|
||||
if (resolveExtensions) {
|
||||
let values = [];
|
||||
for (let value of resolveExtensions) {
|
||||
validateStringValue(value, "resolve extension");
|
||||
if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`);
|
||||
values.push(value);
|
||||
}
|
||||
flags.push(`--resolve-extensions=${values.join(",")}`);
|
||||
}
|
||||
if (publicPath) flags.push(`--public-path=${publicPath}`);
|
||||
if (entryNames) flags.push(`--entry-names=${entryNames}`);
|
||||
if (chunkNames) flags.push(`--chunk-names=${chunkNames}`);
|
||||
if (assetNames) flags.push(`--asset-names=${assetNames}`);
|
||||
if (mainFields) flags.push(`--main-fields=${validateAndJoinStringArray(mainFields, "main field")}`);
|
||||
if (conditions) flags.push(`--conditions=${validateAndJoinStringArray(conditions, "condition")}`);
|
||||
if (mainFields) {
|
||||
let values = [];
|
||||
for (let value of mainFields) {
|
||||
validateStringValue(value, "main field");
|
||||
if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`);
|
||||
values.push(value);
|
||||
}
|
||||
flags.push(`--main-fields=${values.join(",")}`);
|
||||
}
|
||||
if (conditions) {
|
||||
let values = [];
|
||||
for (let value of conditions) {
|
||||
validateStringValue(value, "condition");
|
||||
if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`);
|
||||
values.push(value);
|
||||
}
|
||||
flags.push(`--conditions=${values.join(",")}`);
|
||||
}
|
||||
if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`);
|
||||
if (alias) {
|
||||
for (let old in alias) {
|
||||
@@ -641,8 +662,8 @@ function createChannel(streamIn) {
|
||||
if (isFirstPacket) {
|
||||
isFirstPacket = false;
|
||||
let binaryVersion = String.fromCharCode(...bytes);
|
||||
if (binaryVersion !== "0.25.4") {
|
||||
throw new Error(`Cannot start service: Host version "${"0.25.4"}" does not match binary version ${quote(binaryVersion)}`);
|
||||
if (binaryVersion !== "0.21.5") {
|
||||
throw new Error(`Cannot start service: Host version "${"0.21.5"}" does not match binary version ${quote(binaryVersion)}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -997,13 +1018,12 @@ function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs,
|
||||
serve: (options2 = {}) => new Promise((resolve, reject) => {
|
||||
if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
|
||||
const keys = {};
|
||||
const port = getFlag(options2, keys, "port", mustBeValidPortNumber);
|
||||
const port = getFlag(options2, keys, "port", mustBeInteger);
|
||||
const host = getFlag(options2, keys, "host", mustBeString);
|
||||
const servedir = getFlag(options2, keys, "servedir", mustBeString);
|
||||
const keyfile = getFlag(options2, keys, "keyfile", mustBeString);
|
||||
const certfile = getFlag(options2, keys, "certfile", mustBeString);
|
||||
const fallback = getFlag(options2, keys, "fallback", mustBeString);
|
||||
const cors = getFlag(options2, keys, "cors", mustBeObject);
|
||||
const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction);
|
||||
checkForInvalidFlags(options2, keys, `in serve() call`);
|
||||
const request2 = {
|
||||
@@ -1017,13 +1037,6 @@ function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs,
|
||||
if (keyfile !== void 0) request2.keyfile = keyfile;
|
||||
if (certfile !== void 0) request2.certfile = certfile;
|
||||
if (fallback !== void 0) request2.fallback = fallback;
|
||||
if (cors) {
|
||||
const corsKeys = {};
|
||||
const origin = getFlag(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings);
|
||||
checkForInvalidFlags(cors, corsKeys, `on "cors" object`);
|
||||
if (Array.isArray(origin)) request2.corsOrigin = origin;
|
||||
else if (origin !== void 0) request2.corsOrigin = [origin];
|
||||
}
|
||||
sendRequest(refs, request2, (error2, response2) => {
|
||||
if (error2) return reject(new Error(error2));
|
||||
if (onRequest) {
|
||||
@@ -1159,7 +1172,7 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
|
||||
if (filter == null) throw new Error(`onResolve() call is missing a filter`);
|
||||
let id = nextCallbackID++;
|
||||
onResolveCallbacks[id] = { name, callback, note: registeredNote };
|
||||
plugin.onResolve.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" });
|
||||
plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" });
|
||||
},
|
||||
onLoad(options, callback) {
|
||||
let registeredText = `This error came from the "onLoad" callback registered here:`;
|
||||
@@ -1171,7 +1184,7 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
|
||||
if (filter == null) throw new Error(`onLoad() call is missing a filter`);
|
||||
let id = nextCallbackID++;
|
||||
onLoadCallbacks[id] = { name, callback, note: registeredNote };
|
||||
plugin.onLoad.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" });
|
||||
plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" });
|
||||
},
|
||||
onDispose(callback) {
|
||||
onDisposeCallbacks.push(callback);
|
||||
@@ -1185,7 +1198,6 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
|
||||
}
|
||||
}
|
||||
requestCallbacks["on-start"] = async (id, request) => {
|
||||
details.clear();
|
||||
let response = { errors: [], warnings: [] };
|
||||
await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => {
|
||||
try {
|
||||
@@ -1231,8 +1243,8 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
|
||||
let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
|
||||
let errors = getFlag(result, keys, "errors", mustBeArray);
|
||||
let warnings = getFlag(result, keys, "warnings", mustBeArray);
|
||||
let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings);
|
||||
let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings);
|
||||
let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray);
|
||||
let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray);
|
||||
checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`);
|
||||
response.id = id2;
|
||||
if (pluginName != null) response.pluginName = pluginName;
|
||||
@@ -1277,8 +1289,8 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
|
||||
let loader = getFlag(result, keys, "loader", mustBeString);
|
||||
let errors = getFlag(result, keys, "errors", mustBeArray);
|
||||
let warnings = getFlag(result, keys, "warnings", mustBeArray);
|
||||
let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings);
|
||||
let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings);
|
||||
let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray);
|
||||
let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray);
|
||||
checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`);
|
||||
response.id = id2;
|
||||
if (pluginName != null) response.pluginName = pluginName;
|
||||
@@ -1359,9 +1371,6 @@ function createObjectStash() {
|
||||
const map = /* @__PURE__ */ new Map();
|
||||
let nextID = 0;
|
||||
return {
|
||||
clear() {
|
||||
map.clear();
|
||||
},
|
||||
load(id) {
|
||||
return map.get(id);
|
||||
},
|
||||
@@ -1582,11 +1591,6 @@ function convertOutputFiles({ path: path3, contents, hash }) {
|
||||
}
|
||||
};
|
||||
}
|
||||
function jsRegExpToGoRegExp(regexp) {
|
||||
let result = regexp.source;
|
||||
if (regexp.flags) result = `(?${regexp.flags})${result}`;
|
||||
return result;
|
||||
}
|
||||
|
||||
// lib/npm/node-platform.ts
|
||||
var fs = require("fs");
|
||||
@@ -1617,9 +1621,7 @@ var knownUnixlikePackages = {
|
||||
"linux s390x BE": "@esbuild/linux-s390x",
|
||||
"linux x64 LE": "@esbuild/linux-x64",
|
||||
"linux loong64 LE": "@esbuild/linux-loong64",
|
||||
"netbsd arm64 LE": "@esbuild/netbsd-arm64",
|
||||
"netbsd x64 LE": "@esbuild/netbsd-x64",
|
||||
"openbsd arm64 LE": "@esbuild/openbsd-arm64",
|
||||
"openbsd x64 LE": "@esbuild/openbsd-x64",
|
||||
"sunos x64 LE": "@esbuild/sunos-x64"
|
||||
};
|
||||
@@ -1765,7 +1767,7 @@ for your current platform.`);
|
||||
"node_modules",
|
||||
".cache",
|
||||
"esbuild",
|
||||
`pnpapi-${pkg.replace("/", "-")}-${"0.25.4"}-${path.basename(subpath)}`
|
||||
`pnpapi-${pkg.replace("/", "-")}-${"0.21.5"}-${path.basename(subpath)}`
|
||||
);
|
||||
if (!fs.existsSync(binTargetPath)) {
|
||||
fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
|
||||
@@ -1800,7 +1802,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
||||
}
|
||||
}
|
||||
var _a;
|
||||
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.4";
|
||||
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.21.5";
|
||||
var esbuildCommandAndArgs = () => {
|
||||
if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
||||
throw new Error(
|
||||
@@ -1867,7 +1869,7 @@ var fsAsync = {
|
||||
}
|
||||
}
|
||||
};
|
||||
var version = "0.25.4";
|
||||
var version = "0.21.5";
|
||||
var build = (options) => ensureServiceIsRunning().build(options);
|
||||
var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
|
||||
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
||||
@@ -1970,7 +1972,7 @@ var stopService;
|
||||
var ensureServiceIsRunning = () => {
|
||||
if (longLivedService) return longLivedService;
|
||||
let [command, args] = esbuildCommandAndArgs();
|
||||
let child = child_process.spawn(command, args.concat(`--service=${"0.25.4"}`, "--ping"), {
|
||||
let child = child_process.spawn(command, args.concat(`--service=${"0.21.5"}`, "--ping"), {
|
||||
windowsHide: true,
|
||||
stdio: ["pipe", "pipe", "inherit"],
|
||||
cwd: defaultWD
|
||||
@@ -2074,7 +2076,7 @@ var runServiceSync = (callback) => {
|
||||
esbuild: node_exports
|
||||
});
|
||||
callback(service);
|
||||
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.4"}`), {
|
||||
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.21.5"}`), {
|
||||
cwd: defaultWD,
|
||||
windowsHide: true,
|
||||
input: stdin,
|
||||
@@ -2094,7 +2096,7 @@ var workerThreadService = null;
|
||||
var startWorkerThreadService = (worker_threads2) => {
|
||||
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
||||
let worker = new worker_threads2.Worker(__filename, {
|
||||
workerData: { workerPort, defaultWD, esbuildVersion: "0.25.4" },
|
||||
workerData: { workerPort, defaultWD, esbuildVersion: "0.21.5" },
|
||||
transferList: [workerPort],
|
||||
// From node's documentation: https://nodejs.org/api/worker_threads.html
|
||||
//
|
||||
|
Reference in New Issue
Block a user