wxt 0.8.5 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NTYO6B6Y.js → chunk-2M222CNK.js} +23 -3
- package/dist/cli.cjs +512 -291
- package/dist/client.d.ts +87 -41
- package/dist/client.js +105 -65
- package/dist/{execa-WKZHVHC5.js → execa-Z7B33P3C.js} +494 -346
- package/dist/index.cjs +512 -291
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.cjs +20 -0
- package/dist/testing.js +4 -2
- package/package.json +21 -21
package/dist/cli.cjs
CHANGED
|
@@ -694,10 +694,10 @@ var init_onetime = __esm({
|
|
|
694
694
|
}
|
|
695
695
|
});
|
|
696
696
|
|
|
697
|
-
// node_modules/.pnpm/human-signals@
|
|
697
|
+
// node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js
|
|
698
698
|
var getRealtimeSignals, getRealtimeSignal, SIGRTMIN, SIGRTMAX;
|
|
699
699
|
var init_realtime = __esm({
|
|
700
|
-
"node_modules/.pnpm/human-signals@
|
|
700
|
+
"node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js"() {
|
|
701
701
|
"use strict";
|
|
702
702
|
getRealtimeSignals = () => {
|
|
703
703
|
const length = SIGRTMAX - SIGRTMIN + 1;
|
|
@@ -715,10 +715,10 @@ var init_realtime = __esm({
|
|
|
715
715
|
}
|
|
716
716
|
});
|
|
717
717
|
|
|
718
|
-
// node_modules/.pnpm/human-signals@
|
|
718
|
+
// node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js
|
|
719
719
|
var SIGNALS;
|
|
720
720
|
var init_core = __esm({
|
|
721
|
-
"node_modules/.pnpm/human-signals@
|
|
721
|
+
"node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js"() {
|
|
722
722
|
"use strict";
|
|
723
723
|
SIGNALS = [
|
|
724
724
|
{
|
|
@@ -994,18 +994,18 @@ var init_core = __esm({
|
|
|
994
994
|
}
|
|
995
995
|
});
|
|
996
996
|
|
|
997
|
-
// node_modules/.pnpm/human-signals@
|
|
997
|
+
// node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
|
|
998
998
|
var import_node_os, getSignals, normalizeSignal;
|
|
999
999
|
var init_signals = __esm({
|
|
1000
|
-
"node_modules/.pnpm/human-signals@
|
|
1000
|
+
"node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js"() {
|
|
1001
1001
|
"use strict";
|
|
1002
1002
|
import_node_os = require("os");
|
|
1003
1003
|
init_core();
|
|
1004
1004
|
init_realtime();
|
|
1005
1005
|
getSignals = () => {
|
|
1006
1006
|
const realtimeSignals = getRealtimeSignals();
|
|
1007
|
-
const
|
|
1008
|
-
return
|
|
1007
|
+
const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
1008
|
+
return signals2;
|
|
1009
1009
|
};
|
|
1010
1010
|
normalizeSignal = ({
|
|
1011
1011
|
name,
|
|
@@ -1025,17 +1025,17 @@ var init_signals = __esm({
|
|
|
1025
1025
|
}
|
|
1026
1026
|
});
|
|
1027
1027
|
|
|
1028
|
-
// node_modules/.pnpm/human-signals@
|
|
1028
|
+
// node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
|
|
1029
1029
|
var import_node_os2, getSignalsByName, getSignalByName, signalsByName, getSignalsByNumber, getSignalByNumber, findSignalByNumber, signalsByNumber;
|
|
1030
1030
|
var init_main = __esm({
|
|
1031
|
-
"node_modules/.pnpm/human-signals@
|
|
1031
|
+
"node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js"() {
|
|
1032
1032
|
"use strict";
|
|
1033
1033
|
import_node_os2 = require("os");
|
|
1034
1034
|
init_realtime();
|
|
1035
1035
|
init_signals();
|
|
1036
1036
|
getSignalsByName = () => {
|
|
1037
|
-
const
|
|
1038
|
-
return Object.fromEntries(
|
|
1037
|
+
const signals2 = getSignals();
|
|
1038
|
+
return Object.fromEntries(signals2.map(getSignalByName));
|
|
1039
1039
|
};
|
|
1040
1040
|
getSignalByName = ({
|
|
1041
1041
|
name,
|
|
@@ -1048,13 +1048,16 @@ var init_main = __esm({
|
|
|
1048
1048
|
}) => [name, { name, number, description, supported, action, forced, standard }];
|
|
1049
1049
|
signalsByName = getSignalsByName();
|
|
1050
1050
|
getSignalsByNumber = () => {
|
|
1051
|
-
const
|
|
1051
|
+
const signals2 = getSignals();
|
|
1052
1052
|
const length = SIGRTMAX + 1;
|
|
1053
|
-
const signalsA = Array.from(
|
|
1053
|
+
const signalsA = Array.from(
|
|
1054
|
+
{ length },
|
|
1055
|
+
(value, number) => getSignalByNumber(number, signals2)
|
|
1056
|
+
);
|
|
1054
1057
|
return Object.assign({}, ...signalsA);
|
|
1055
1058
|
};
|
|
1056
|
-
getSignalByNumber = (number,
|
|
1057
|
-
const signal = findSignalByNumber(number,
|
|
1059
|
+
getSignalByNumber = (number, signals2) => {
|
|
1060
|
+
const signal = findSignalByNumber(number, signals2);
|
|
1058
1061
|
if (signal === void 0) {
|
|
1059
1062
|
return {};
|
|
1060
1063
|
}
|
|
@@ -1071,21 +1074,21 @@ var init_main = __esm({
|
|
|
1071
1074
|
}
|
|
1072
1075
|
};
|
|
1073
1076
|
};
|
|
1074
|
-
findSignalByNumber = (number,
|
|
1075
|
-
const signal =
|
|
1077
|
+
findSignalByNumber = (number, signals2) => {
|
|
1078
|
+
const signal = signals2.find(({ name }) => import_node_os2.constants.signals[name] === number);
|
|
1076
1079
|
if (signal !== void 0) {
|
|
1077
1080
|
return signal;
|
|
1078
1081
|
}
|
|
1079
|
-
return
|
|
1082
|
+
return signals2.find((signalA) => signalA.number === number);
|
|
1080
1083
|
};
|
|
1081
1084
|
signalsByNumber = getSignalsByNumber();
|
|
1082
1085
|
}
|
|
1083
1086
|
});
|
|
1084
1087
|
|
|
1085
|
-
// node_modules/.pnpm/execa@
|
|
1088
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
|
|
1086
1089
|
var import_node_process2, getErrorPrefix, makeError;
|
|
1087
1090
|
var init_error = __esm({
|
|
1088
|
-
"node_modules/.pnpm/execa@
|
|
1091
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js"() {
|
|
1089
1092
|
"use strict";
|
|
1090
1093
|
import_node_process2 = __toESM(require("process"), 1);
|
|
1091
1094
|
init_main();
|
|
@@ -1161,10 +1164,10 @@ ${error.message}` : execaMessage;
|
|
|
1161
1164
|
}
|
|
1162
1165
|
});
|
|
1163
1166
|
|
|
1164
|
-
// node_modules/.pnpm/execa@
|
|
1167
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js
|
|
1165
1168
|
var aliases, hasAlias, normalizeStdio, normalizeStdioNode;
|
|
1166
1169
|
var init_stdio = __esm({
|
|
1167
|
-
"node_modules/.pnpm/execa@
|
|
1170
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js"() {
|
|
1168
1171
|
"use strict";
|
|
1169
1172
|
aliases = ["stdin", "stdout", "stderr"];
|
|
1170
1173
|
hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
|
|
@@ -1204,19 +1207,17 @@ var init_stdio = __esm({
|
|
|
1204
1207
|
}
|
|
1205
1208
|
});
|
|
1206
1209
|
|
|
1207
|
-
// node_modules/.pnpm/signal-exit@
|
|
1208
|
-
var
|
|
1209
|
-
|
|
1210
|
+
// node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
1211
|
+
var signals;
|
|
1212
|
+
var init_signals2 = __esm({
|
|
1213
|
+
"node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js"() {
|
|
1210
1214
|
"use strict";
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
"SIGALRM",
|
|
1214
|
-
"SIGHUP",
|
|
1215
|
-
"SIGINT",
|
|
1216
|
-
"SIGTERM"
|
|
1217
|
-
];
|
|
1215
|
+
signals = [];
|
|
1216
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1218
1217
|
if (process.platform !== "win32") {
|
|
1219
|
-
|
|
1218
|
+
signals.push(
|
|
1219
|
+
"SIGALRM",
|
|
1220
|
+
"SIGABRT",
|
|
1220
1221
|
"SIGVTALRM",
|
|
1221
1222
|
"SIGXCPU",
|
|
1222
1223
|
"SIGXFSZ",
|
|
@@ -1231,184 +1232,258 @@ var require_signals = __commonJS({
|
|
|
1231
1232
|
);
|
|
1232
1233
|
}
|
|
1233
1234
|
if (process.platform === "linux") {
|
|
1234
|
-
|
|
1235
|
-
"SIGIO",
|
|
1236
|
-
"SIGPOLL",
|
|
1237
|
-
"SIGPWR",
|
|
1238
|
-
"SIGSTKFLT",
|
|
1239
|
-
"SIGUNUSED"
|
|
1240
|
-
);
|
|
1235
|
+
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1241
1236
|
}
|
|
1242
1237
|
}
|
|
1243
1238
|
});
|
|
1244
1239
|
|
|
1245
|
-
// node_modules/.pnpm/signal-exit@
|
|
1246
|
-
var
|
|
1247
|
-
|
|
1240
|
+
// node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
1241
|
+
var processOk, kExitEmitter, global2, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process4, onExit, load, unload;
|
|
1242
|
+
var init_mjs = __esm({
|
|
1243
|
+
"node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
|
|
1248
1244
|
"use strict";
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1245
|
+
init_signals2();
|
|
1246
|
+
processOk = (process7) => !!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";
|
|
1247
|
+
kExitEmitter = Symbol.for("signal-exit emitter");
|
|
1248
|
+
global2 = globalThis;
|
|
1249
|
+
ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1250
|
+
Emitter = class {
|
|
1251
|
+
emitted = {
|
|
1252
|
+
afterExit: false,
|
|
1253
|
+
exit: false
|
|
1254
|
+
};
|
|
1255
|
+
listeners = {
|
|
1256
|
+
afterExit: [],
|
|
1257
|
+
exit: []
|
|
1258
|
+
};
|
|
1259
|
+
count = 0;
|
|
1260
|
+
id = Math.random();
|
|
1261
|
+
constructor() {
|
|
1262
|
+
if (global2[kExitEmitter]) {
|
|
1263
|
+
return global2[kExitEmitter];
|
|
1264
|
+
}
|
|
1265
|
+
ObjectDefineProperty(global2, kExitEmitter, {
|
|
1266
|
+
value: this,
|
|
1267
|
+
writable: false,
|
|
1268
|
+
enumerable: false,
|
|
1269
|
+
configurable: false
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
on(ev, fn) {
|
|
1273
|
+
this.listeners[ev].push(fn);
|
|
1274
|
+
}
|
|
1275
|
+
removeListener(ev, fn) {
|
|
1276
|
+
const list = this.listeners[ev];
|
|
1277
|
+
const i = list.indexOf(fn);
|
|
1278
|
+
if (i === -1) {
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
if (i === 0 && list.length === 1) {
|
|
1282
|
+
list.length = 0;
|
|
1283
|
+
} else {
|
|
1284
|
+
list.splice(i, 1);
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
emit(ev, code, signal) {
|
|
1288
|
+
if (this.emitted[ev]) {
|
|
1289
|
+
return false;
|
|
1290
|
+
}
|
|
1291
|
+
this.emitted[ev] = true;
|
|
1292
|
+
let ret = false;
|
|
1293
|
+
for (const fn of this.listeners[ev]) {
|
|
1294
|
+
ret = fn(code, signal) === true || ret;
|
|
1295
|
+
}
|
|
1296
|
+
if (ev === "exit") {
|
|
1297
|
+
ret = this.emit("afterExit", code, signal) || ret;
|
|
1298
|
+
}
|
|
1299
|
+
return ret;
|
|
1300
|
+
}
|
|
1252
1301
|
};
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1302
|
+
SignalExitBase = class {
|
|
1303
|
+
};
|
|
1304
|
+
signalExitWrap = (handler) => {
|
|
1305
|
+
return {
|
|
1306
|
+
onExit(cb, opts) {
|
|
1307
|
+
return handler.onExit(cb, opts);
|
|
1308
|
+
},
|
|
1309
|
+
load() {
|
|
1310
|
+
return handler.load();
|
|
1311
|
+
},
|
|
1312
|
+
unload() {
|
|
1313
|
+
return handler.unload();
|
|
1314
|
+
}
|
|
1257
1315
|
};
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
if (typeof EE !== "function") {
|
|
1264
|
-
EE = EE.EventEmitter;
|
|
1265
|
-
}
|
|
1266
|
-
if (process6.__signal_exit_emitter__) {
|
|
1267
|
-
emitter = process6.__signal_exit_emitter__;
|
|
1268
|
-
} else {
|
|
1269
|
-
emitter = process6.__signal_exit_emitter__ = new EE();
|
|
1270
|
-
emitter.count = 0;
|
|
1271
|
-
emitter.emitted = {};
|
|
1316
|
+
};
|
|
1317
|
+
SignalExitFallback = class extends SignalExitBase {
|
|
1318
|
+
onExit() {
|
|
1319
|
+
return () => {
|
|
1320
|
+
};
|
|
1272
1321
|
}
|
|
1273
|
-
|
|
1274
|
-
emitter.setMaxListeners(Infinity);
|
|
1275
|
-
emitter.infinite = true;
|
|
1322
|
+
load() {
|
|
1276
1323
|
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1324
|
+
unload() {
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
SignalExit = class extends SignalExitBase {
|
|
1328
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
1329
|
+
// so use a supported signal instead
|
|
1330
|
+
/* c8 ignore start */
|
|
1331
|
+
#hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1332
|
+
/* c8 ignore stop */
|
|
1333
|
+
#emitter = new Emitter();
|
|
1334
|
+
#process;
|
|
1335
|
+
#originalProcessEmit;
|
|
1336
|
+
#originalProcessReallyExit;
|
|
1337
|
+
#sigListeners = {};
|
|
1338
|
+
#loaded = false;
|
|
1339
|
+
constructor(process7) {
|
|
1340
|
+
super();
|
|
1341
|
+
this.#process = process7;
|
|
1342
|
+
this.#sigListeners = {};
|
|
1343
|
+
for (const sig of signals) {
|
|
1344
|
+
this.#sigListeners[sig] = () => {
|
|
1345
|
+
const listeners = this.#process.listeners(sig);
|
|
1346
|
+
let { count } = this.#emitter;
|
|
1347
|
+
const p = process7;
|
|
1348
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
1349
|
+
count += p.__signal_exit_emitter__.count;
|
|
1350
|
+
}
|
|
1351
|
+
if (listeners.length === count) {
|
|
1352
|
+
this.unload();
|
|
1353
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
1354
|
+
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1355
|
+
if (!ret)
|
|
1356
|
+
process7.kill(process7.pid, s);
|
|
1357
|
+
}
|
|
1280
1358
|
};
|
|
1281
1359
|
}
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1360
|
+
this.#originalProcessReallyExit = process7.reallyExit;
|
|
1361
|
+
this.#originalProcessEmit = process7.emit;
|
|
1362
|
+
}
|
|
1363
|
+
onExit(cb, opts) {
|
|
1364
|
+
if (!processOk(this.#process)) {
|
|
1365
|
+
return () => {
|
|
1366
|
+
};
|
|
1285
1367
|
}
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
ev = "afterexit";
|
|
1368
|
+
if (this.#loaded === false) {
|
|
1369
|
+
this.load();
|
|
1289
1370
|
}
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1371
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1372
|
+
this.#emitter.on(ev, cb);
|
|
1373
|
+
return () => {
|
|
1374
|
+
this.#emitter.removeListener(ev, cb);
|
|
1375
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
1376
|
+
this.unload();
|
|
1294
1377
|
}
|
|
1295
1378
|
};
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
unload = function unload2() {
|
|
1300
|
-
if (!loaded || !processOk(global.process)) {
|
|
1379
|
+
}
|
|
1380
|
+
load() {
|
|
1381
|
+
if (this.#loaded) {
|
|
1301
1382
|
return;
|
|
1302
1383
|
}
|
|
1303
|
-
loaded =
|
|
1304
|
-
|
|
1384
|
+
this.#loaded = true;
|
|
1385
|
+
this.#emitter.count += 1;
|
|
1386
|
+
for (const sig of signals) {
|
|
1305
1387
|
try {
|
|
1306
|
-
|
|
1307
|
-
|
|
1388
|
+
const fn = this.#sigListeners[sig];
|
|
1389
|
+
if (fn)
|
|
1390
|
+
this.#process.on(sig, fn);
|
|
1391
|
+
} catch (_) {
|
|
1308
1392
|
}
|
|
1309
|
-
});
|
|
1310
|
-
process6.emit = originalProcessEmit;
|
|
1311
|
-
process6.reallyExit = originalProcessReallyExit;
|
|
1312
|
-
emitter.count -= 1;
|
|
1313
|
-
};
|
|
1314
|
-
module2.exports.unload = unload;
|
|
1315
|
-
emit = function emit2(event, code, signal) {
|
|
1316
|
-
if (emitter.emitted[event]) {
|
|
1317
|
-
return;
|
|
1318
1393
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
};
|
|
1322
|
-
sigListeners = {};
|
|
1323
|
-
signals.forEach(function(sig) {
|
|
1324
|
-
sigListeners[sig] = function listener() {
|
|
1325
|
-
if (!processOk(global.process)) {
|
|
1326
|
-
return;
|
|
1327
|
-
}
|
|
1328
|
-
var listeners = process6.listeners(sig);
|
|
1329
|
-
if (listeners.length === emitter.count) {
|
|
1330
|
-
unload();
|
|
1331
|
-
emit("exit", null, sig);
|
|
1332
|
-
emit("afterexit", null, sig);
|
|
1333
|
-
if (isWin && sig === "SIGHUP") {
|
|
1334
|
-
sig = "SIGINT";
|
|
1335
|
-
}
|
|
1336
|
-
process6.kill(process6.pid, sig);
|
|
1337
|
-
}
|
|
1394
|
+
this.#process.emit = (ev, ...a) => {
|
|
1395
|
+
return this.#processEmit(ev, ...a);
|
|
1338
1396
|
};
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
if (loaded || !processOk(global.process)) {
|
|
1397
|
+
this.#process.reallyExit = (code) => {
|
|
1398
|
+
return this.#processReallyExit(code);
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
unload() {
|
|
1402
|
+
if (!this.#loaded) {
|
|
1346
1403
|
return;
|
|
1347
1404
|
}
|
|
1348
|
-
loaded =
|
|
1349
|
-
|
|
1350
|
-
|
|
1405
|
+
this.#loaded = false;
|
|
1406
|
+
signals.forEach((sig) => {
|
|
1407
|
+
const listener = this.#sigListeners[sig];
|
|
1408
|
+
if (!listener) {
|
|
1409
|
+
throw new Error("Listener not defined for signal: " + sig);
|
|
1410
|
+
}
|
|
1351
1411
|
try {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
} catch (er) {
|
|
1355
|
-
return false;
|
|
1412
|
+
this.#process.removeListener(sig, listener);
|
|
1413
|
+
} catch (_) {
|
|
1356
1414
|
}
|
|
1357
1415
|
});
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
return;
|
|
1416
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
1417
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1418
|
+
this.#emitter.count -= 1;
|
|
1419
|
+
}
|
|
1420
|
+
#processReallyExit(code) {
|
|
1421
|
+
if (!processOk(this.#process)) {
|
|
1422
|
+
return 0;
|
|
1366
1423
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
if (arg !== void 0) {
|
|
1377
|
-
process6.exitCode = arg;
|
|
1424
|
+
this.#process.exitCode = code || 0;
|
|
1425
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1426
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
1427
|
+
}
|
|
1428
|
+
#processEmit(ev, ...args) {
|
|
1429
|
+
const og = this.#originalProcessEmit;
|
|
1430
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
1431
|
+
if (typeof args[0] === "number") {
|
|
1432
|
+
this.#process.exitCode = args[0];
|
|
1378
1433
|
}
|
|
1379
|
-
|
|
1380
|
-
emit("exit",
|
|
1381
|
-
emit("afterexit", process6.exitCode, null);
|
|
1434
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
1435
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1382
1436
|
return ret;
|
|
1383
1437
|
} else {
|
|
1384
|
-
return
|
|
1438
|
+
return og.call(this.#process, ev, ...args);
|
|
1385
1439
|
}
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
process4 = globalThis.process;
|
|
1443
|
+
({
|
|
1444
|
+
onExit: (
|
|
1445
|
+
/**
|
|
1446
|
+
* Called when the process is exiting, whether via signal, explicit
|
|
1447
|
+
* exit, or running out of stuff to do.
|
|
1448
|
+
*
|
|
1449
|
+
* If the global process object is not suitable for instrumentation,
|
|
1450
|
+
* then this will be a no-op.
|
|
1451
|
+
*
|
|
1452
|
+
* Returns a function that may be used to unload signal-exit.
|
|
1453
|
+
*/
|
|
1454
|
+
onExit
|
|
1455
|
+
),
|
|
1456
|
+
load: (
|
|
1457
|
+
/**
|
|
1458
|
+
* Load the listeners. Likely you never need to call this, unless
|
|
1459
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
1460
|
+
* Mostly exposed for the benefit of testing.
|
|
1461
|
+
*
|
|
1462
|
+
* @internal
|
|
1463
|
+
*/
|
|
1464
|
+
load
|
|
1465
|
+
),
|
|
1466
|
+
unload: (
|
|
1467
|
+
/**
|
|
1468
|
+
* Unload the listeners. Likely you never need to call this, unless
|
|
1469
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
1470
|
+
* Mostly exposed for the benefit of testing.
|
|
1471
|
+
*
|
|
1472
|
+
* @internal
|
|
1473
|
+
*/
|
|
1474
|
+
unload
|
|
1475
|
+
)
|
|
1476
|
+
} = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback()));
|
|
1402
1477
|
}
|
|
1403
1478
|
});
|
|
1404
1479
|
|
|
1405
|
-
// node_modules/.pnpm/execa@
|
|
1406
|
-
var import_node_os3,
|
|
1480
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
|
|
1481
|
+
var import_node_os3, DEFAULT_FORCE_KILL_TIMEOUT, spawnedKill, setKillTimeout, shouldForceKill, isSigterm, getForceKillAfterTimeout, spawnedCancel, timeoutKill, setupTimeout, validateTimeout, setExitHandler;
|
|
1407
1482
|
var init_kill = __esm({
|
|
1408
|
-
"node_modules/.pnpm/execa@
|
|
1483
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js"() {
|
|
1409
1484
|
"use strict";
|
|
1410
1485
|
import_node_os3 = __toESM(require("os"), 1);
|
|
1411
|
-
|
|
1486
|
+
init_mjs();
|
|
1412
1487
|
DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
1413
1488
|
spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
1414
1489
|
const killResult = kill(signal);
|
|
@@ -1472,7 +1547,7 @@ var init_kill = __esm({
|
|
|
1472
1547
|
if (!cleanup || detached) {
|
|
1473
1548
|
return timedPromise;
|
|
1474
1549
|
}
|
|
1475
|
-
const removeExitHandler = (
|
|
1550
|
+
const removeExitHandler = onExit(() => {
|
|
1476
1551
|
spawned.kill();
|
|
1477
1552
|
});
|
|
1478
1553
|
return timedPromise.finally(() => {
|
|
@@ -1495,10 +1570,10 @@ var init_is_stream = __esm({
|
|
|
1495
1570
|
}
|
|
1496
1571
|
});
|
|
1497
1572
|
|
|
1498
|
-
// node_modules/.pnpm/execa@
|
|
1573
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
|
|
1499
1574
|
var import_node_fs, import_node_child_process, isExecaChildProcess, pipeToTarget, addPipeMethods;
|
|
1500
1575
|
var init_pipe = __esm({
|
|
1501
|
-
"node_modules/.pnpm/execa@
|
|
1576
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js"() {
|
|
1502
1577
|
"use strict";
|
|
1503
1578
|
import_node_fs = require("fs");
|
|
1504
1579
|
import_node_child_process = require("child_process");
|
|
@@ -1536,103 +1611,241 @@ var init_pipe = __esm({
|
|
|
1536
1611
|
}
|
|
1537
1612
|
});
|
|
1538
1613
|
|
|
1539
|
-
// node_modules/.pnpm/get-stream@
|
|
1540
|
-
var
|
|
1541
|
-
|
|
1614
|
+
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js
|
|
1615
|
+
var getStreamContents, appendFinalChunk, appendChunk, addNewChunk, isAsyncIterable, getChunkType, objectToString, MaxBufferError;
|
|
1616
|
+
var init_contents = __esm({
|
|
1617
|
+
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js"() {
|
|
1542
1618
|
"use strict";
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
const { array } = options;
|
|
1547
|
-
let { encoding } = options;
|
|
1548
|
-
const isBuffer = encoding === "buffer";
|
|
1549
|
-
let objectMode = false;
|
|
1550
|
-
if (array) {
|
|
1551
|
-
objectMode = !(encoding || isBuffer);
|
|
1552
|
-
} else {
|
|
1553
|
-
encoding = encoding || "utf8";
|
|
1619
|
+
getStreamContents = async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
|
|
1620
|
+
if (!isAsyncIterable(stream)) {
|
|
1621
|
+
throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
1554
1622
|
}
|
|
1555
|
-
|
|
1556
|
-
|
|
1623
|
+
const state = init();
|
|
1624
|
+
state.length = 0;
|
|
1625
|
+
try {
|
|
1626
|
+
for await (const chunk of stream) {
|
|
1627
|
+
const chunkType = getChunkType(chunk);
|
|
1628
|
+
const convertedChunk = convertChunk[chunkType](chunk, state);
|
|
1629
|
+
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1630
|
+
}
|
|
1631
|
+
appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
|
|
1632
|
+
return finalize(state);
|
|
1633
|
+
} catch (error) {
|
|
1634
|
+
error.bufferedData = finalize(state);
|
|
1635
|
+
throw error;
|
|
1557
1636
|
}
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1637
|
+
};
|
|
1638
|
+
appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
|
|
1639
|
+
const convertedChunk = getFinalChunk(state);
|
|
1640
|
+
if (convertedChunk !== void 0) {
|
|
1641
|
+
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
|
|
1645
|
+
const chunkSize = getSize(convertedChunk);
|
|
1646
|
+
const newLength = state.length + chunkSize;
|
|
1647
|
+
if (newLength <= maxBuffer) {
|
|
1648
|
+
addNewChunk(convertedChunk, state, addChunk, newLength);
|
|
1649
|
+
return;
|
|
1650
|
+
}
|
|
1651
|
+
const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
|
|
1652
|
+
if (truncatedChunk !== void 0) {
|
|
1653
|
+
addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
|
|
1654
|
+
}
|
|
1655
|
+
throw new MaxBufferError();
|
|
1656
|
+
};
|
|
1657
|
+
addNewChunk = (convertedChunk, state, addChunk, newLength) => {
|
|
1658
|
+
state.contents = addChunk(convertedChunk, state, newLength);
|
|
1659
|
+
state.length = newLength;
|
|
1660
|
+
};
|
|
1661
|
+
isAsyncIterable = (stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function";
|
|
1662
|
+
getChunkType = (chunk) => {
|
|
1663
|
+
const typeOfChunk = typeof chunk;
|
|
1664
|
+
if (typeOfChunk === "string") {
|
|
1665
|
+
return "string";
|
|
1666
|
+
}
|
|
1667
|
+
if (typeOfChunk !== "object" || chunk === null) {
|
|
1668
|
+
return "others";
|
|
1669
|
+
}
|
|
1670
|
+
if (globalThis.Buffer?.isBuffer(chunk)) {
|
|
1671
|
+
return "buffer";
|
|
1672
|
+
}
|
|
1673
|
+
const prototypeName = objectToString.call(chunk);
|
|
1674
|
+
if (prototypeName === "[object ArrayBuffer]") {
|
|
1675
|
+
return "arrayBuffer";
|
|
1676
|
+
}
|
|
1677
|
+
if (prototypeName === "[object DataView]") {
|
|
1678
|
+
return "dataView";
|
|
1679
|
+
}
|
|
1680
|
+
if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
|
|
1681
|
+
return "typedArray";
|
|
1682
|
+
}
|
|
1683
|
+
return "others";
|
|
1684
|
+
};
|
|
1685
|
+
({ toString: objectToString } = Object.prototype);
|
|
1686
|
+
MaxBufferError = class extends Error {
|
|
1687
|
+
name = "MaxBufferError";
|
|
1688
|
+
constructor() {
|
|
1689
|
+
super("maxBuffer exceeded");
|
|
1561
1690
|
}
|
|
1562
|
-
let length = 0;
|
|
1563
|
-
const chunks = [];
|
|
1564
|
-
stream.on("data", (chunk) => {
|
|
1565
|
-
chunks.push(chunk);
|
|
1566
|
-
if (objectMode) {
|
|
1567
|
-
length = chunks.length;
|
|
1568
|
-
} else {
|
|
1569
|
-
length += chunk.length;
|
|
1570
|
-
}
|
|
1571
|
-
});
|
|
1572
|
-
stream.getBufferedValue = () => {
|
|
1573
|
-
if (array) {
|
|
1574
|
-
return chunks;
|
|
1575
|
-
}
|
|
1576
|
-
return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
|
|
1577
|
-
};
|
|
1578
|
-
stream.getBufferedLength = () => length;
|
|
1579
|
-
return stream;
|
|
1580
1691
|
};
|
|
1581
1692
|
}
|
|
1582
1693
|
});
|
|
1583
1694
|
|
|
1584
|
-
// node_modules/.pnpm/get-stream@
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1695
|
+
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js
|
|
1696
|
+
var identity, noop, getContentsProp, throwObjectStream, getLengthProp;
|
|
1697
|
+
var init_utils = __esm({
|
|
1698
|
+
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js"() {
|
|
1587
1699
|
"use strict";
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1700
|
+
identity = (value) => value;
|
|
1701
|
+
noop = () => void 0;
|
|
1702
|
+
getContentsProp = ({ contents }) => contents;
|
|
1703
|
+
throwObjectStream = (chunk) => {
|
|
1704
|
+
throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
|
|
1705
|
+
};
|
|
1706
|
+
getLengthProp = (convertedChunk) => convertedChunk.length;
|
|
1707
|
+
}
|
|
1708
|
+
});
|
|
1709
|
+
|
|
1710
|
+
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.js
|
|
1711
|
+
var init_array = __esm({
|
|
1712
|
+
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.js"() {
|
|
1713
|
+
"use strict";
|
|
1714
|
+
init_contents();
|
|
1715
|
+
init_utils();
|
|
1716
|
+
}
|
|
1717
|
+
});
|
|
1718
|
+
|
|
1719
|
+
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js
|
|
1720
|
+
async function getStreamAsArrayBuffer(stream, options) {
|
|
1721
|
+
return getStreamContents(stream, arrayBufferMethods, options);
|
|
1722
|
+
}
|
|
1723
|
+
var initArrayBuffer, useTextEncoder, textEncoder, useUint8Array, useUint8ArrayWithOffset, truncateArrayBufferChunk, addArrayBufferChunk, resizeArrayBufferSlow, resizeArrayBuffer, getNewContentsLength, SCALE_FACTOR, finalizeArrayBuffer, hasArrayBufferResize, arrayBufferMethods;
|
|
1724
|
+
var init_array_buffer = __esm({
|
|
1725
|
+
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js"() {
|
|
1726
|
+
"use strict";
|
|
1727
|
+
init_contents();
|
|
1728
|
+
init_utils();
|
|
1729
|
+
initArrayBuffer = () => ({ contents: new ArrayBuffer(0) });
|
|
1730
|
+
useTextEncoder = (chunk) => textEncoder.encode(chunk);
|
|
1731
|
+
textEncoder = new TextEncoder();
|
|
1732
|
+
useUint8Array = (chunk) => new Uint8Array(chunk);
|
|
1733
|
+
useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
1734
|
+
truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
1735
|
+
addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
|
|
1736
|
+
const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
|
|
1737
|
+
new Uint8Array(newContents).set(convertedChunk, previousLength);
|
|
1738
|
+
return newContents;
|
|
1739
|
+
};
|
|
1740
|
+
resizeArrayBufferSlow = (contents, length) => {
|
|
1741
|
+
if (length <= contents.byteLength) {
|
|
1742
|
+
return contents;
|
|
1597
1743
|
}
|
|
1744
|
+
const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
|
|
1745
|
+
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
1746
|
+
return arrayBuffer;
|
|
1598
1747
|
};
|
|
1599
|
-
|
|
1600
|
-
if (
|
|
1601
|
-
|
|
1748
|
+
resizeArrayBuffer = (contents, length) => {
|
|
1749
|
+
if (length <= contents.maxByteLength) {
|
|
1750
|
+
contents.resize(length);
|
|
1751
|
+
return contents;
|
|
1602
1752
|
}
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1753
|
+
const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
|
|
1754
|
+
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
1755
|
+
return arrayBuffer;
|
|
1756
|
+
};
|
|
1757
|
+
getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));
|
|
1758
|
+
SCALE_FACTOR = 2;
|
|
1759
|
+
finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length);
|
|
1760
|
+
hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype;
|
|
1761
|
+
arrayBufferMethods = {
|
|
1762
|
+
init: initArrayBuffer,
|
|
1763
|
+
convertChunk: {
|
|
1764
|
+
string: useTextEncoder,
|
|
1765
|
+
buffer: useUint8Array,
|
|
1766
|
+
arrayBuffer: useUint8Array,
|
|
1767
|
+
dataView: useUint8ArrayWithOffset,
|
|
1768
|
+
typedArray: useUint8ArrayWithOffset,
|
|
1769
|
+
others: throwObjectStream
|
|
1770
|
+
},
|
|
1771
|
+
getSize: getLengthProp,
|
|
1772
|
+
truncateChunk: truncateArrayBufferChunk,
|
|
1773
|
+
addChunk: addArrayBufferChunk,
|
|
1774
|
+
getFinalChunk: noop,
|
|
1775
|
+
finalize: finalizeArrayBuffer
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
});
|
|
1779
|
+
|
|
1780
|
+
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js
|
|
1781
|
+
async function getStreamAsBuffer(stream, options) {
|
|
1782
|
+
if (!("Buffer" in globalThis)) {
|
|
1783
|
+
throw new Error("getStreamAsBuffer() is only supported in Node.js");
|
|
1784
|
+
}
|
|
1785
|
+
try {
|
|
1786
|
+
return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
|
|
1787
|
+
} catch (error) {
|
|
1788
|
+
if (error.bufferedData !== void 0) {
|
|
1789
|
+
error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
|
|
1631
1790
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1791
|
+
throw error;
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
var arrayBufferToNodeBuffer;
|
|
1795
|
+
var init_buffer = __esm({
|
|
1796
|
+
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js"() {
|
|
1797
|
+
"use strict";
|
|
1798
|
+
init_array_buffer();
|
|
1799
|
+
arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
|
|
1800
|
+
}
|
|
1801
|
+
});
|
|
1802
|
+
|
|
1803
|
+
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js
|
|
1804
|
+
async function getStreamAsString(stream, options) {
|
|
1805
|
+
return getStreamContents(stream, stringMethods, options);
|
|
1806
|
+
}
|
|
1807
|
+
var initString, useTextDecoder, addStringChunk, truncateStringChunk, getFinalStringChunk, stringMethods;
|
|
1808
|
+
var init_string = __esm({
|
|
1809
|
+
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js"() {
|
|
1810
|
+
"use strict";
|
|
1811
|
+
init_contents();
|
|
1812
|
+
init_utils();
|
|
1813
|
+
initString = () => ({ contents: "", textDecoder: new TextDecoder() });
|
|
1814
|
+
useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true });
|
|
1815
|
+
addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk;
|
|
1816
|
+
truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
1817
|
+
getFinalStringChunk = ({ textDecoder }) => {
|
|
1818
|
+
const finalChunk = textDecoder.decode();
|
|
1819
|
+
return finalChunk === "" ? void 0 : finalChunk;
|
|
1820
|
+
};
|
|
1821
|
+
stringMethods = {
|
|
1822
|
+
init: initString,
|
|
1823
|
+
convertChunk: {
|
|
1824
|
+
string: identity,
|
|
1825
|
+
buffer: useTextDecoder,
|
|
1826
|
+
arrayBuffer: useTextDecoder,
|
|
1827
|
+
dataView: useTextDecoder,
|
|
1828
|
+
typedArray: useTextDecoder,
|
|
1829
|
+
others: throwObjectStream
|
|
1830
|
+
},
|
|
1831
|
+
getSize: getLengthProp,
|
|
1832
|
+
truncateChunk: truncateStringChunk,
|
|
1833
|
+
addChunk: addStringChunk,
|
|
1834
|
+
getFinalChunk: getFinalStringChunk,
|
|
1835
|
+
finalize: getContentsProp
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
});
|
|
1839
|
+
|
|
1840
|
+
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.js
|
|
1841
|
+
var init_source = __esm({
|
|
1842
|
+
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.js"() {
|
|
1843
|
+
"use strict";
|
|
1844
|
+
init_array();
|
|
1845
|
+
init_array_buffer();
|
|
1846
|
+
init_buffer();
|
|
1847
|
+
init_string();
|
|
1848
|
+
init_contents();
|
|
1636
1849
|
}
|
|
1637
1850
|
});
|
|
1638
1851
|
|
|
@@ -1676,14 +1889,15 @@ var require_merge_stream = __commonJS({
|
|
|
1676
1889
|
}
|
|
1677
1890
|
});
|
|
1678
1891
|
|
|
1679
|
-
// node_modules/.pnpm/execa@
|
|
1680
|
-
var import_node_fs2,
|
|
1892
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
|
|
1893
|
+
var import_node_fs2, import_promises, import_merge_stream, validateInputOptions, getInputSync, handleInputSync, getInput, handleInput, makeAllStream, getBufferedData, getStreamPromise, applyEncoding, getSpawnedResult;
|
|
1681
1894
|
var init_stream = __esm({
|
|
1682
|
-
"node_modules/.pnpm/execa@
|
|
1895
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js"() {
|
|
1683
1896
|
"use strict";
|
|
1684
1897
|
import_node_fs2 = require("fs");
|
|
1898
|
+
import_promises = require("timers/promises");
|
|
1685
1899
|
init_is_stream();
|
|
1686
|
-
|
|
1900
|
+
init_source();
|
|
1687
1901
|
import_merge_stream = __toESM(require_merge_stream(), 1);
|
|
1688
1902
|
validateInputOptions = (input) => {
|
|
1689
1903
|
if (input !== void 0) {
|
|
@@ -1739,6 +1953,7 @@ var init_stream = __esm({
|
|
|
1739
1953
|
if (!stream || streamPromise === void 0) {
|
|
1740
1954
|
return;
|
|
1741
1955
|
}
|
|
1956
|
+
await (0, import_promises.setTimeout)(0);
|
|
1742
1957
|
stream.destroy();
|
|
1743
1958
|
try {
|
|
1744
1959
|
return await streamPromise;
|
|
@@ -1750,10 +1965,17 @@ var init_stream = __esm({
|
|
|
1750
1965
|
if (!stream || !buffer) {
|
|
1751
1966
|
return;
|
|
1752
1967
|
}
|
|
1753
|
-
if (encoding) {
|
|
1754
|
-
return (
|
|
1968
|
+
if (encoding === "utf8" || encoding === "utf-8") {
|
|
1969
|
+
return getStreamAsString(stream, { maxBuffer });
|
|
1755
1970
|
}
|
|
1756
|
-
|
|
1971
|
+
if (encoding === null || encoding === "buffer") {
|
|
1972
|
+
return getStreamAsBuffer(stream, { maxBuffer });
|
|
1973
|
+
}
|
|
1974
|
+
return applyEncoding(stream, maxBuffer, encoding);
|
|
1975
|
+
};
|
|
1976
|
+
applyEncoding = async (stream, maxBuffer, encoding) => {
|
|
1977
|
+
const buffer = await getStreamAsBuffer(stream, { maxBuffer });
|
|
1978
|
+
return buffer.toString(encoding);
|
|
1757
1979
|
};
|
|
1758
1980
|
getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
1759
1981
|
const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
|
|
@@ -1773,10 +1995,10 @@ var init_stream = __esm({
|
|
|
1773
1995
|
}
|
|
1774
1996
|
});
|
|
1775
1997
|
|
|
1776
|
-
// node_modules/.pnpm/execa@
|
|
1998
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js
|
|
1777
1999
|
var nativePromisePrototype, descriptors, mergePromise, getSpawnedPromise;
|
|
1778
2000
|
var init_promise = __esm({
|
|
1779
|
-
"node_modules/.pnpm/execa@
|
|
2001
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js"() {
|
|
1780
2002
|
"use strict";
|
|
1781
2003
|
nativePromisePrototype = (/* @__PURE__ */ (async () => {
|
|
1782
2004
|
})()).constructor.prototype;
|
|
@@ -1806,10 +2028,10 @@ var init_promise = __esm({
|
|
|
1806
2028
|
}
|
|
1807
2029
|
});
|
|
1808
2030
|
|
|
1809
|
-
// node_modules/.pnpm/execa@
|
|
1810
|
-
var import_node_buffer, import_node_child_process2, normalizeArgs, NO_ESCAPE_REGEXP,
|
|
2031
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js
|
|
2032
|
+
var import_node_buffer, import_node_child_process2, normalizeArgs, NO_ESCAPE_REGEXP, escapeArg, joinCommand, getEscapedCommand, SPACES_REGEXP, parseCommand, parseExpression, concatTokens, parseTemplate, parseTemplates;
|
|
1811
2033
|
var init_command = __esm({
|
|
1812
|
-
"node_modules/.pnpm/execa@
|
|
2034
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js"() {
|
|
1813
2035
|
"use strict";
|
|
1814
2036
|
import_node_buffer = require("buffer");
|
|
1815
2037
|
import_node_child_process2 = require("child_process");
|
|
@@ -1820,12 +2042,11 @@ var init_command = __esm({
|
|
|
1820
2042
|
return [file, ...args];
|
|
1821
2043
|
};
|
|
1822
2044
|
NO_ESCAPE_REGEXP = /^[\w.-]+$/;
|
|
1823
|
-
DOUBLE_QUOTES_REGEXP = /"/g;
|
|
1824
2045
|
escapeArg = (arg) => {
|
|
1825
2046
|
if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
|
|
1826
2047
|
return arg;
|
|
1827
2048
|
}
|
|
1828
|
-
return `"${arg.
|
|
2049
|
+
return `"${arg.replaceAll('"', '\\"')}"`;
|
|
1829
2050
|
};
|
|
1830
2051
|
joinCommand = (file, args) => normalizeArgs(file, args).join(" ");
|
|
1831
2052
|
getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" ");
|
|
@@ -1833,7 +2054,7 @@ var init_command = __esm({
|
|
|
1833
2054
|
parseCommand = (command) => {
|
|
1834
2055
|
const tokens = [];
|
|
1835
2056
|
for (const token of command.trim().split(SPACES_REGEXP)) {
|
|
1836
|
-
const previousToken = tokens
|
|
2057
|
+
const previousToken = tokens.at(-1);
|
|
1837
2058
|
if (previousToken && previousToken.endsWith("\\")) {
|
|
1838
2059
|
tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
|
|
1839
2060
|
} else {
|
|
@@ -1864,7 +2085,7 @@ var init_command = __esm({
|
|
|
1864
2085
|
};
|
|
1865
2086
|
concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
|
|
1866
2087
|
...tokens.slice(0, -1),
|
|
1867
|
-
`${tokens
|
|
2088
|
+
`${tokens.at(-1)}${nextTokens[0]}`,
|
|
1868
2089
|
...nextTokens.slice(1)
|
|
1869
2090
|
];
|
|
1870
2091
|
parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
@@ -1896,10 +2117,10 @@ var init_command = __esm({
|
|
|
1896
2117
|
}
|
|
1897
2118
|
});
|
|
1898
2119
|
|
|
1899
|
-
// node_modules/.pnpm/execa@
|
|
2120
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js
|
|
1900
2121
|
var import_node_util, import_node_process3, verboseDefault, padField, getTimestamp, logCommand;
|
|
1901
2122
|
var init_verbose = __esm({
|
|
1902
|
-
"node_modules/.pnpm/execa@
|
|
2123
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js"() {
|
|
1903
2124
|
"use strict";
|
|
1904
2125
|
import_node_util = require("util");
|
|
1905
2126
|
import_node_process3 = __toESM(require("process"), 1);
|
|
@@ -1919,7 +2140,7 @@ var init_verbose = __esm({
|
|
|
1919
2140
|
}
|
|
1920
2141
|
});
|
|
1921
2142
|
|
|
1922
|
-
// node_modules/.pnpm/execa@
|
|
2143
|
+
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
|
|
1923
2144
|
var execa_exports = {};
|
|
1924
2145
|
__export(execa_exports, {
|
|
1925
2146
|
$: () => $,
|
|
@@ -2117,7 +2338,7 @@ function execaNode(scriptPath, args, options = {}) {
|
|
|
2117
2338
|
}
|
|
2118
2339
|
var import_node_buffer2, import_node_path11, import_node_child_process3, import_node_process4, import_cross_spawn, DEFAULT_MAX_BUFFER, getEnv, handleArguments, handleOutput, normalizeScriptStdin, normalizeScriptOptions, $;
|
|
2119
2340
|
var init_execa = __esm({
|
|
2120
|
-
"node_modules/.pnpm/execa@
|
|
2341
|
+
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js"() {
|
|
2121
2342
|
"use strict";
|
|
2122
2343
|
import_node_buffer2 = require("buffer");
|
|
2123
2344
|
import_node_path11 = __toESM(require("path"), 1);
|
|
@@ -2194,7 +2415,7 @@ var init_execa = __esm({
|
|
|
2194
2415
|
var import_cac = __toESM(require("cac"), 1);
|
|
2195
2416
|
|
|
2196
2417
|
// package.json
|
|
2197
|
-
var version = "0.8.
|
|
2418
|
+
var version = "0.8.7";
|
|
2198
2419
|
|
|
2199
2420
|
// src/core/utils/building/build-entrypoints.ts
|
|
2200
2421
|
var vite2 = __toESM(require("vite"), 1);
|
|
@@ -2719,8 +2940,8 @@ function globals(config) {
|
|
|
2719
2940
|
name: "wxt:globals",
|
|
2720
2941
|
config() {
|
|
2721
2942
|
const define = {};
|
|
2722
|
-
for (const
|
|
2723
|
-
define[
|
|
2943
|
+
for (const global3 of getGlobals(config)) {
|
|
2944
|
+
define[global3.name] = JSON.stringify(global3.value);
|
|
2724
2945
|
}
|
|
2725
2946
|
return {
|
|
2726
2947
|
define
|
|
@@ -2825,8 +3046,8 @@ async function buildSingleEntrypoint(entrypoint, config) {
|
|
|
2825
3046
|
"process.env.NODE_ENV": JSON.stringify(config.mode)
|
|
2826
3047
|
}
|
|
2827
3048
|
};
|
|
2828
|
-
for (const
|
|
2829
|
-
libMode.define[
|
|
3049
|
+
for (const global3 of getEntrypointGlobals(config, entrypoint.name)) {
|
|
3050
|
+
libMode.define[global3.name] = JSON.stringify(global3.value);
|
|
2830
3051
|
}
|
|
2831
3052
|
const entryConfig = vite2.mergeConfig(
|
|
2832
3053
|
libMode,
|
|
@@ -2859,8 +3080,8 @@ async function buildMultipleEntrypoints(entrypoints, config) {
|
|
|
2859
3080
|
},
|
|
2860
3081
|
define: {}
|
|
2861
3082
|
};
|
|
2862
|
-
for (const
|
|
2863
|
-
multiPage.define[
|
|
3083
|
+
for (const global3 of getEntrypointGlobals(config, "html")) {
|
|
3084
|
+
multiPage.define[global3.name] = JSON.stringify(global3.value);
|
|
2864
3085
|
}
|
|
2865
3086
|
const entryConfig = vite2.mergeConfig(
|
|
2866
3087
|
multiPage,
|
|
@@ -3377,7 +3598,7 @@ async function writePathsDeclarationFile(entrypoints, config) {
|
|
|
3377
3598
|
import "wxt/browser";
|
|
3378
3599
|
|
|
3379
3600
|
declare module "wxt/browser" {
|
|
3380
|
-
type PublicPath =
|
|
3601
|
+
export type PublicPath =
|
|
3381
3602
|
{{ union }}
|
|
3382
3603
|
export interface WxtRuntime extends Runtime.Static {
|
|
3383
3604
|
getURL(path: PublicPath): string;
|
|
@@ -3452,7 +3673,7 @@ async function writeGlobalsDeclarationFile(config) {
|
|
|
3452
3673
|
"// Generated by wxt",
|
|
3453
3674
|
"export {}",
|
|
3454
3675
|
"declare global {",
|
|
3455
|
-
...globals2.map((
|
|
3676
|
+
...globals2.map((global3) => ` const ${global3.name}: ${global3.type};`),
|
|
3456
3677
|
"}"
|
|
3457
3678
|
].join("\n") + "\n"
|
|
3458
3679
|
);
|