This commit is contained in:
TiclemFR
2024-01-20 23:14:52 +01:00
parent a068f54957
commit 031f7071e6
881 changed files with 241469 additions and 247870 deletions

37
node_modules/esbuild/lib/main.js generated vendored
View File

@@ -39,6 +39,7 @@ __export(node_exports, {
formatMessages: () => formatMessages,
formatMessagesSync: () => formatMessagesSync,
initialize: () => initialize,
stop: () => stop,
transform: () => transform,
transformSync: () => transformSync,
version: () => version
@@ -746,8 +747,8 @@ function createChannel(streamIn) {
if (isFirstPacket) {
isFirstPacket = false;
let binaryVersion = String.fromCharCode(...bytes);
if (binaryVersion !== "0.19.10") {
throw new Error(`Cannot start service: Host version "${"0.19.10"}" does not match binary version ${quote(binaryVersion)}`);
if (binaryVersion !== "0.19.11") {
throw new Error(`Cannot start service: Host version "${"0.19.11"}" does not match binary version ${quote(binaryVersion)}`);
}
return;
}
@@ -1940,7 +1941,7 @@ for your current platform.`);
"node_modules",
".cache",
"esbuild",
`pnpapi-${pkg.replace("/", "-")}-${"0.19.10"}-${path.basename(subpath)}`
`pnpapi-${pkg.replace("/", "-")}-${"0.19.11"}-${path.basename(subpath)}`
);
if (!fs.existsSync(binTargetPath)) {
fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1975,7 +1976,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.19.10";
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.19.11";
var esbuildCommandAndArgs = () => {
if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
throw new Error(
@@ -2042,7 +2043,7 @@ var fsAsync = {
}
}
};
var version = "0.19.10";
var version = "0.19.11";
var build = (options) => ensureServiceIsRunning().build(options);
var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2131,6 +2132,12 @@ var analyzeMetafileSync = (metafile, options) => {
}));
return result;
};
var stop = () => {
if (stopService)
stopService();
if (workerThreadService)
workerThreadService.stop();
};
var initializeWasCalled = false;
var initialize = (options) => {
options = validateInitializeOptions(options || {});
@@ -2148,11 +2155,12 @@ var initialize = (options) => {
};
var defaultWD = process.cwd();
var longLivedService;
var stopService;
var ensureServiceIsRunning = () => {
if (longLivedService)
return longLivedService;
let [command, args] = esbuildCommandAndArgs();
let child = child_process.spawn(command, args.concat(`--service=${"0.19.10"}`, "--ping"), {
let child = child_process.spawn(command, args.concat(`--service=${"0.19.11"}`, "--ping"), {
windowsHide: true,
stdio: ["pipe", "pipe", "inherit"],
cwd: defaultWD
@@ -2175,6 +2183,14 @@ var ensureServiceIsRunning = () => {
const stdout = child.stdout;
stdout.on("data", readFromStdout);
stdout.on("end", afterClose);
stopService = () => {
stdin.destroy();
stdout.destroy();
child.kill();
initializeWasCalled = false;
longLivedService = void 0;
stopService = void 0;
};
let refCount = 0;
child.unref();
if (stdin.unref) {
@@ -2252,7 +2268,7 @@ var runServiceSync = (callback) => {
esbuild: node_exports
});
callback(service);
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.19.10"}`), {
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.19.11"}`), {
cwd: defaultWD,
windowsHide: true,
input: stdin,
@@ -2272,7 +2288,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.19.10" },
workerData: { workerPort, defaultWD, esbuildVersion: "0.19.11" },
transferList: [workerPort],
// From node's documentation: https://nodejs.org/api/worker_threads.html
//
@@ -2338,6 +2354,10 @@ error: ${text}`);
},
analyzeMetafileSync(metafile, options) {
return runCallSync("analyzeMetafile", [metafile, options]);
},
stop() {
worker.terminate();
workerThreadService = null;
}
};
};
@@ -2408,6 +2428,7 @@ var node_default = node_exports;
formatMessages,
formatMessagesSync,
initialize,
stop,
transform,
transformSync,
version