wxt 0.17.2-alpha4 → 0.17.2-alpha6
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/bin/wxt-publish-extension.cjs +7 -0
- package/dist/{chunk-C57BR3TX.js → chunk-P4NUXKML.js} +8 -14
- package/dist/cli.js +11 -25
- package/dist/{index-Du5Xv5e8.d.ts → index-V1QWdhdh.d.cts} +1 -1
- package/dist/{index-Du5Xv5e8.d.cts → index-V1QWdhdh.d.ts} +1 -1
- package/dist/index.cjs +100 -2497
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -8
- package/dist/storage.js +0 -2
- package/dist/testing.cjs +2 -1
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +1 -2
- package/package.json +7 -12
- package/dist/chunk-VBXJIVYU.js +0 -38
- package/dist/execa-4F7CCWCA.js +0 -2191
package/dist/index.cjs
CHANGED
|
@@ -5,2412 +5,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
-
mod
|
|
33
|
-
));
|
|
34
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
-
|
|
36
|
-
// node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
|
|
37
|
-
var require_windows = __commonJS({
|
|
38
|
-
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) {
|
|
39
|
-
"use strict";
|
|
40
|
-
module2.exports = isexe;
|
|
41
|
-
isexe.sync = sync;
|
|
42
|
-
var fs16 = require("fs");
|
|
43
|
-
function checkPathExt(path11, options) {
|
|
44
|
-
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
45
|
-
if (!pathext) {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
pathext = pathext.split(";");
|
|
49
|
-
if (pathext.indexOf("") !== -1) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
for (var i = 0; i < pathext.length; i++) {
|
|
53
|
-
var p = pathext[i].toLowerCase();
|
|
54
|
-
if (p && path11.substr(-p.length).toLowerCase() === p) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
function checkStat(stat, path11, options) {
|
|
61
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
return checkPathExt(path11, options);
|
|
65
|
-
}
|
|
66
|
-
function isexe(path11, options, cb) {
|
|
67
|
-
fs16.stat(path11, function(er, stat) {
|
|
68
|
-
cb(er, er ? false : checkStat(stat, path11, options));
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function sync(path11, options) {
|
|
72
|
-
return checkStat(fs16.statSync(path11), path11, options);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
|
|
78
|
-
var require_mode = __commonJS({
|
|
79
|
-
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module2) {
|
|
80
|
-
"use strict";
|
|
81
|
-
module2.exports = isexe;
|
|
82
|
-
isexe.sync = sync;
|
|
83
|
-
var fs16 = require("fs");
|
|
84
|
-
function isexe(path11, options, cb) {
|
|
85
|
-
fs16.stat(path11, function(er, stat) {
|
|
86
|
-
cb(er, er ? false : checkStat(stat, options));
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function sync(path11, options) {
|
|
90
|
-
return checkStat(fs16.statSync(path11), options);
|
|
91
|
-
}
|
|
92
|
-
function checkStat(stat, options) {
|
|
93
|
-
return stat.isFile() && checkMode(stat, options);
|
|
94
|
-
}
|
|
95
|
-
function checkMode(stat, options) {
|
|
96
|
-
var mod = stat.mode;
|
|
97
|
-
var uid = stat.uid;
|
|
98
|
-
var gid = stat.gid;
|
|
99
|
-
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
100
|
-
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
101
|
-
var u = parseInt("100", 8);
|
|
102
|
-
var g = parseInt("010", 8);
|
|
103
|
-
var o = parseInt("001", 8);
|
|
104
|
-
var ug = u | g;
|
|
105
|
-
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
106
|
-
return ret;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
|
|
112
|
-
var require_isexe = __commonJS({
|
|
113
|
-
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module2) {
|
|
114
|
-
"use strict";
|
|
115
|
-
var fs16 = require("fs");
|
|
116
|
-
var core;
|
|
117
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
118
|
-
core = require_windows();
|
|
119
|
-
} else {
|
|
120
|
-
core = require_mode();
|
|
121
|
-
}
|
|
122
|
-
module2.exports = isexe;
|
|
123
|
-
isexe.sync = sync;
|
|
124
|
-
function isexe(path11, options, cb) {
|
|
125
|
-
if (typeof options === "function") {
|
|
126
|
-
cb = options;
|
|
127
|
-
options = {};
|
|
128
|
-
}
|
|
129
|
-
if (!cb) {
|
|
130
|
-
if (typeof Promise !== "function") {
|
|
131
|
-
throw new TypeError("callback not provided");
|
|
132
|
-
}
|
|
133
|
-
return new Promise(function(resolve14, reject) {
|
|
134
|
-
isexe(path11, options || {}, function(er, is) {
|
|
135
|
-
if (er) {
|
|
136
|
-
reject(er);
|
|
137
|
-
} else {
|
|
138
|
-
resolve14(is);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
core(path11, options || {}, function(er, is) {
|
|
144
|
-
if (er) {
|
|
145
|
-
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
146
|
-
er = null;
|
|
147
|
-
is = false;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
cb(er, is);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
function sync(path11, options) {
|
|
154
|
-
try {
|
|
155
|
-
return core.sync(path11, options || {});
|
|
156
|
-
} catch (er) {
|
|
157
|
-
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
158
|
-
return false;
|
|
159
|
-
} else {
|
|
160
|
-
throw er;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
// node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
168
|
-
var require_which = __commonJS({
|
|
169
|
-
"node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module2) {
|
|
170
|
-
"use strict";
|
|
171
|
-
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
172
|
-
var path11 = require("path");
|
|
173
|
-
var COLON = isWindows ? ";" : ":";
|
|
174
|
-
var isexe = require_isexe();
|
|
175
|
-
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
176
|
-
var getPathInfo = (cmd, opt) => {
|
|
177
|
-
const colon = opt.colon || COLON;
|
|
178
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
179
|
-
// windows always checks the cwd first
|
|
180
|
-
...isWindows ? [process.cwd()] : [],
|
|
181
|
-
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
182
|
-
"").split(colon)
|
|
183
|
-
];
|
|
184
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
185
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
186
|
-
if (isWindows) {
|
|
187
|
-
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
188
|
-
pathExt.unshift("");
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
pathEnv,
|
|
192
|
-
pathExt,
|
|
193
|
-
pathExtExe
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
var which = (cmd, opt, cb) => {
|
|
197
|
-
if (typeof opt === "function") {
|
|
198
|
-
cb = opt;
|
|
199
|
-
opt = {};
|
|
200
|
-
}
|
|
201
|
-
if (!opt)
|
|
202
|
-
opt = {};
|
|
203
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
204
|
-
const found = [];
|
|
205
|
-
const step = (i) => new Promise((resolve14, reject) => {
|
|
206
|
-
if (i === pathEnv.length)
|
|
207
|
-
return opt.all && found.length ? resolve14(found) : reject(getNotFoundError(cmd));
|
|
208
|
-
const ppRaw = pathEnv[i];
|
|
209
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
210
|
-
const pCmd = path11.join(pathPart, cmd);
|
|
211
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
212
|
-
resolve14(subStep(p, i, 0));
|
|
213
|
-
});
|
|
214
|
-
const subStep = (p, i, ii) => new Promise((resolve14, reject) => {
|
|
215
|
-
if (ii === pathExt.length)
|
|
216
|
-
return resolve14(step(i + 1));
|
|
217
|
-
const ext = pathExt[ii];
|
|
218
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
219
|
-
if (!er && is) {
|
|
220
|
-
if (opt.all)
|
|
221
|
-
found.push(p + ext);
|
|
222
|
-
else
|
|
223
|
-
return resolve14(p + ext);
|
|
224
|
-
}
|
|
225
|
-
return resolve14(subStep(p, i, ii + 1));
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
229
|
-
};
|
|
230
|
-
var whichSync = (cmd, opt) => {
|
|
231
|
-
opt = opt || {};
|
|
232
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
233
|
-
const found = [];
|
|
234
|
-
for (let i = 0; i < pathEnv.length; i++) {
|
|
235
|
-
const ppRaw = pathEnv[i];
|
|
236
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
237
|
-
const pCmd = path11.join(pathPart, cmd);
|
|
238
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
239
|
-
for (let j = 0; j < pathExt.length; j++) {
|
|
240
|
-
const cur = p + pathExt[j];
|
|
241
|
-
try {
|
|
242
|
-
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
243
|
-
if (is) {
|
|
244
|
-
if (opt.all)
|
|
245
|
-
found.push(cur);
|
|
246
|
-
else
|
|
247
|
-
return cur;
|
|
248
|
-
}
|
|
249
|
-
} catch (ex) {
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (opt.all && found.length)
|
|
254
|
-
return found;
|
|
255
|
-
if (opt.nothrow)
|
|
256
|
-
return null;
|
|
257
|
-
throw getNotFoundError(cmd);
|
|
258
|
-
};
|
|
259
|
-
module2.exports = which;
|
|
260
|
-
which.sync = whichSync;
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
// node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
|
|
265
|
-
var require_path_key = __commonJS({
|
|
266
|
-
"node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module2) {
|
|
267
|
-
"use strict";
|
|
268
|
-
var pathKey2 = (options = {}) => {
|
|
269
|
-
const environment = options.env || process.env;
|
|
270
|
-
const platform = options.platform || process.platform;
|
|
271
|
-
if (platform !== "win32") {
|
|
272
|
-
return "PATH";
|
|
273
|
-
}
|
|
274
|
-
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
275
|
-
};
|
|
276
|
-
module2.exports = pathKey2;
|
|
277
|
-
module2.exports.default = pathKey2;
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
282
|
-
var require_resolveCommand = __commonJS({
|
|
283
|
-
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
|
|
284
|
-
"use strict";
|
|
285
|
-
var path11 = require("path");
|
|
286
|
-
var which = require_which();
|
|
287
|
-
var getPathKey = require_path_key();
|
|
288
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
289
|
-
const env = parsed.options.env || process.env;
|
|
290
|
-
const cwd = process.cwd();
|
|
291
|
-
const hasCustomCwd = parsed.options.cwd != null;
|
|
292
|
-
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
293
|
-
if (shouldSwitchCwd) {
|
|
294
|
-
try {
|
|
295
|
-
process.chdir(parsed.options.cwd);
|
|
296
|
-
} catch (err) {
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
let resolved;
|
|
300
|
-
try {
|
|
301
|
-
resolved = which.sync(parsed.command, {
|
|
302
|
-
path: env[getPathKey({ env })],
|
|
303
|
-
pathExt: withoutPathExt ? path11.delimiter : void 0
|
|
304
|
-
});
|
|
305
|
-
} catch (e) {
|
|
306
|
-
} finally {
|
|
307
|
-
if (shouldSwitchCwd) {
|
|
308
|
-
process.chdir(cwd);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
if (resolved) {
|
|
312
|
-
resolved = path11.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
313
|
-
}
|
|
314
|
-
return resolved;
|
|
315
|
-
}
|
|
316
|
-
function resolveCommand(parsed) {
|
|
317
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
318
|
-
}
|
|
319
|
-
module2.exports = resolveCommand;
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
|
|
323
|
-
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js
|
|
324
|
-
var require_escape = __commonJS({
|
|
325
|
-
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) {
|
|
326
|
-
"use strict";
|
|
327
|
-
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
328
|
-
function escapeCommand(arg) {
|
|
329
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
330
|
-
return arg;
|
|
331
|
-
}
|
|
332
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
333
|
-
arg = `${arg}`;
|
|
334
|
-
arg = arg.replace(/(\\*)"/g, '$1$1\\"');
|
|
335
|
-
arg = arg.replace(/(\\*)$/, "$1$1");
|
|
336
|
-
arg = `"${arg}"`;
|
|
337
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
338
|
-
if (doubleEscapeMetaChars) {
|
|
339
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
340
|
-
}
|
|
341
|
-
return arg;
|
|
342
|
-
}
|
|
343
|
-
module2.exports.command = escapeCommand;
|
|
344
|
-
module2.exports.argument = escapeArgument;
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
// node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
|
|
349
|
-
var require_shebang_regex = __commonJS({
|
|
350
|
-
"node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module2) {
|
|
351
|
-
"use strict";
|
|
352
|
-
module2.exports = /^#!(.*)/;
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
// node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
|
|
357
|
-
var require_shebang_command = __commonJS({
|
|
358
|
-
"node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module2) {
|
|
359
|
-
"use strict";
|
|
360
|
-
var shebangRegex = require_shebang_regex();
|
|
361
|
-
module2.exports = (string = "") => {
|
|
362
|
-
const match = string.match(shebangRegex);
|
|
363
|
-
if (!match) {
|
|
364
|
-
return null;
|
|
365
|
-
}
|
|
366
|
-
const [path11, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
367
|
-
const binary = path11.split("/").pop();
|
|
368
|
-
if (binary === "env") {
|
|
369
|
-
return argument;
|
|
370
|
-
}
|
|
371
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js
|
|
377
|
-
var require_readShebang = __commonJS({
|
|
378
|
-
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
|
|
379
|
-
"use strict";
|
|
380
|
-
var fs16 = require("fs");
|
|
381
|
-
var shebangCommand = require_shebang_command();
|
|
382
|
-
function readShebang(command) {
|
|
383
|
-
const size = 150;
|
|
384
|
-
const buffer = Buffer.alloc(size);
|
|
385
|
-
let fd;
|
|
386
|
-
try {
|
|
387
|
-
fd = fs16.openSync(command, "r");
|
|
388
|
-
fs16.readSync(fd, buffer, 0, size, 0);
|
|
389
|
-
fs16.closeSync(fd);
|
|
390
|
-
} catch (e) {
|
|
391
|
-
}
|
|
392
|
-
return shebangCommand(buffer.toString());
|
|
393
|
-
}
|
|
394
|
-
module2.exports = readShebang;
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js
|
|
399
|
-
var require_parse = __commonJS({
|
|
400
|
-
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
|
|
401
|
-
"use strict";
|
|
402
|
-
var path11 = require("path");
|
|
403
|
-
var resolveCommand = require_resolveCommand();
|
|
404
|
-
var escape = require_escape();
|
|
405
|
-
var readShebang = require_readShebang();
|
|
406
|
-
var isWin = process.platform === "win32";
|
|
407
|
-
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
408
|
-
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
409
|
-
function detectShebang(parsed) {
|
|
410
|
-
parsed.file = resolveCommand(parsed);
|
|
411
|
-
const shebang = parsed.file && readShebang(parsed.file);
|
|
412
|
-
if (shebang) {
|
|
413
|
-
parsed.args.unshift(parsed.file);
|
|
414
|
-
parsed.command = shebang;
|
|
415
|
-
return resolveCommand(parsed);
|
|
416
|
-
}
|
|
417
|
-
return parsed.file;
|
|
418
|
-
}
|
|
419
|
-
function parseNonShell(parsed) {
|
|
420
|
-
if (!isWin) {
|
|
421
|
-
return parsed;
|
|
422
|
-
}
|
|
423
|
-
const commandFile = detectShebang(parsed);
|
|
424
|
-
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
425
|
-
if (parsed.options.forceShell || needsShell) {
|
|
426
|
-
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
427
|
-
parsed.command = path11.normalize(parsed.command);
|
|
428
|
-
parsed.command = escape.command(parsed.command);
|
|
429
|
-
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
430
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
431
|
-
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
432
|
-
parsed.command = process.env.comspec || "cmd.exe";
|
|
433
|
-
parsed.options.windowsVerbatimArguments = true;
|
|
434
|
-
}
|
|
435
|
-
return parsed;
|
|
436
|
-
}
|
|
437
|
-
function parse(command, args, options) {
|
|
438
|
-
if (args && !Array.isArray(args)) {
|
|
439
|
-
options = args;
|
|
440
|
-
args = null;
|
|
441
|
-
}
|
|
442
|
-
args = args ? args.slice(0) : [];
|
|
443
|
-
options = Object.assign({}, options);
|
|
444
|
-
const parsed = {
|
|
445
|
-
command,
|
|
446
|
-
args,
|
|
447
|
-
options,
|
|
448
|
-
file: void 0,
|
|
449
|
-
original: {
|
|
450
|
-
command,
|
|
451
|
-
args
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
return options.shell ? parsed : parseNonShell(parsed);
|
|
455
|
-
}
|
|
456
|
-
module2.exports = parse;
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js
|
|
461
|
-
var require_enoent = __commonJS({
|
|
462
|
-
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
|
|
463
|
-
"use strict";
|
|
464
|
-
var isWin = process.platform === "win32";
|
|
465
|
-
function notFoundError(original, syscall) {
|
|
466
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
467
|
-
code: "ENOENT",
|
|
468
|
-
errno: "ENOENT",
|
|
469
|
-
syscall: `${syscall} ${original.command}`,
|
|
470
|
-
path: original.command,
|
|
471
|
-
spawnargs: original.args
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
function hookChildProcess(cp, parsed) {
|
|
475
|
-
if (!isWin) {
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
const originalEmit = cp.emit;
|
|
479
|
-
cp.emit = function(name, arg1) {
|
|
480
|
-
if (name === "exit") {
|
|
481
|
-
const err = verifyENOENT(arg1, parsed, "spawn");
|
|
482
|
-
if (err) {
|
|
483
|
-
return originalEmit.call(cp, "error", err);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
return originalEmit.apply(cp, arguments);
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
function verifyENOENT(status, parsed) {
|
|
490
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
491
|
-
return notFoundError(parsed.original, "spawn");
|
|
492
|
-
}
|
|
493
|
-
return null;
|
|
494
|
-
}
|
|
495
|
-
function verifyENOENTSync(status, parsed) {
|
|
496
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
497
|
-
return notFoundError(parsed.original, "spawnSync");
|
|
498
|
-
}
|
|
499
|
-
return null;
|
|
500
|
-
}
|
|
501
|
-
module2.exports = {
|
|
502
|
-
hookChildProcess,
|
|
503
|
-
verifyENOENT,
|
|
504
|
-
verifyENOENTSync,
|
|
505
|
-
notFoundError
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
});
|
|
509
|
-
|
|
510
|
-
// node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js
|
|
511
|
-
var require_cross_spawn = __commonJS({
|
|
512
|
-
"node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports, module2) {
|
|
513
|
-
"use strict";
|
|
514
|
-
var cp = require("child_process");
|
|
515
|
-
var parse = require_parse();
|
|
516
|
-
var enoent = require_enoent();
|
|
517
|
-
function spawn(command, args, options) {
|
|
518
|
-
const parsed = parse(command, args, options);
|
|
519
|
-
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
520
|
-
enoent.hookChildProcess(spawned, parsed);
|
|
521
|
-
return spawned;
|
|
522
|
-
}
|
|
523
|
-
function spawnSync(command, args, options) {
|
|
524
|
-
const parsed = parse(command, args, options);
|
|
525
|
-
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
526
|
-
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
527
|
-
return result;
|
|
528
|
-
}
|
|
529
|
-
module2.exports = spawn;
|
|
530
|
-
module2.exports.spawn = spawn;
|
|
531
|
-
module2.exports.sync = spawnSync;
|
|
532
|
-
module2.exports._parse = parse;
|
|
533
|
-
module2.exports._enoent = enoent;
|
|
534
|
-
}
|
|
535
|
-
});
|
|
536
|
-
|
|
537
|
-
// node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
|
|
538
|
-
function stripFinalNewline(input) {
|
|
539
|
-
const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
|
|
540
|
-
const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
|
|
541
|
-
if (input[input.length - 1] === LF) {
|
|
542
|
-
input = input.slice(0, -1);
|
|
543
|
-
}
|
|
544
|
-
if (input[input.length - 1] === CR) {
|
|
545
|
-
input = input.slice(0, -1);
|
|
546
|
-
}
|
|
547
|
-
return input;
|
|
548
|
-
}
|
|
549
|
-
var init_strip_final_newline = __esm({
|
|
550
|
-
"node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js"() {
|
|
551
|
-
"use strict";
|
|
552
|
-
}
|
|
553
|
-
});
|
|
554
|
-
|
|
555
|
-
// node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
556
|
-
function pathKey(options = {}) {
|
|
557
|
-
const {
|
|
558
|
-
env = process.env,
|
|
559
|
-
platform = process.platform
|
|
560
|
-
} = options;
|
|
561
|
-
if (platform !== "win32") {
|
|
562
|
-
return "PATH";
|
|
563
|
-
}
|
|
564
|
-
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
565
|
-
}
|
|
566
|
-
var init_path_key = __esm({
|
|
567
|
-
"node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js"() {
|
|
568
|
-
"use strict";
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
|
|
572
|
-
// node_modules/.pnpm/npm-run-path@5.1.0/node_modules/npm-run-path/index.js
|
|
573
|
-
function npmRunPath(options = {}) {
|
|
574
|
-
const {
|
|
575
|
-
cwd = import_node_process.default.cwd(),
|
|
576
|
-
path: path_ = import_node_process.default.env[pathKey()],
|
|
577
|
-
execPath = import_node_process.default.execPath
|
|
578
|
-
} = options;
|
|
579
|
-
let previous;
|
|
580
|
-
const cwdString = cwd instanceof URL ? import_node_url2.default.fileURLToPath(cwd) : cwd;
|
|
581
|
-
let cwdPath = import_node_path12.default.resolve(cwdString);
|
|
582
|
-
const result = [];
|
|
583
|
-
while (previous !== cwdPath) {
|
|
584
|
-
result.push(import_node_path12.default.join(cwdPath, "node_modules/.bin"));
|
|
585
|
-
previous = cwdPath;
|
|
586
|
-
cwdPath = import_node_path12.default.resolve(cwdPath, "..");
|
|
587
|
-
}
|
|
588
|
-
result.push(import_node_path12.default.resolve(cwdString, execPath, ".."));
|
|
589
|
-
return [...result, path_].join(import_node_path12.default.delimiter);
|
|
590
|
-
}
|
|
591
|
-
function npmRunPathEnv({ env = import_node_process.default.env, ...options } = {}) {
|
|
592
|
-
env = { ...env };
|
|
593
|
-
const path11 = pathKey({ env });
|
|
594
|
-
options.path = env[path11];
|
|
595
|
-
env[path11] = npmRunPath(options);
|
|
596
|
-
return env;
|
|
597
|
-
}
|
|
598
|
-
var import_node_process, import_node_path12, import_node_url2;
|
|
599
|
-
var init_npm_run_path = __esm({
|
|
600
|
-
"node_modules/.pnpm/npm-run-path@5.1.0/node_modules/npm-run-path/index.js"() {
|
|
601
|
-
"use strict";
|
|
602
|
-
import_node_process = __toESM(require("process"), 1);
|
|
603
|
-
import_node_path12 = __toESM(require("path"), 1);
|
|
604
|
-
import_node_url2 = __toESM(require("url"), 1);
|
|
605
|
-
init_path_key();
|
|
606
|
-
}
|
|
607
|
-
});
|
|
608
|
-
|
|
609
|
-
// node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
|
|
610
|
-
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
611
|
-
const { name } = to;
|
|
612
|
-
for (const property of Reflect.ownKeys(from)) {
|
|
613
|
-
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
614
|
-
}
|
|
615
|
-
changePrototype(to, from);
|
|
616
|
-
changeToString(to, from, name);
|
|
617
|
-
return to;
|
|
618
|
-
}
|
|
619
|
-
var copyProperty, canCopyProperty, changePrototype, wrappedToString, toStringDescriptor, toStringName, changeToString;
|
|
620
|
-
var init_mimic_fn = __esm({
|
|
621
|
-
"node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js"() {
|
|
622
|
-
"use strict";
|
|
623
|
-
copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
624
|
-
if (property === "length" || property === "prototype") {
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
if (property === "arguments" || property === "caller") {
|
|
628
|
-
return;
|
|
629
|
-
}
|
|
630
|
-
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
631
|
-
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
632
|
-
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
Object.defineProperty(to, property, fromDescriptor);
|
|
636
|
-
};
|
|
637
|
-
canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
638
|
-
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
639
|
-
};
|
|
640
|
-
changePrototype = (to, from) => {
|
|
641
|
-
const fromPrototype = Object.getPrototypeOf(from);
|
|
642
|
-
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
643
|
-
return;
|
|
644
|
-
}
|
|
645
|
-
Object.setPrototypeOf(to, fromPrototype);
|
|
646
|
-
};
|
|
647
|
-
wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
648
|
-
${fromBody}`;
|
|
649
|
-
toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
650
|
-
toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
651
|
-
changeToString = (to, from, name) => {
|
|
652
|
-
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
653
|
-
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
654
|
-
Object.defineProperty(newToString, "name", toStringName);
|
|
655
|
-
Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
|
|
656
|
-
};
|
|
657
|
-
}
|
|
658
|
-
});
|
|
659
|
-
|
|
660
|
-
// node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
|
|
661
|
-
var calledFunctions, onetime, onetime_default;
|
|
662
|
-
var init_onetime = __esm({
|
|
663
|
-
"node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js"() {
|
|
664
|
-
"use strict";
|
|
665
|
-
init_mimic_fn();
|
|
666
|
-
calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
667
|
-
onetime = (function_, options = {}) => {
|
|
668
|
-
if (typeof function_ !== "function") {
|
|
669
|
-
throw new TypeError("Expected a function");
|
|
670
|
-
}
|
|
671
|
-
let returnValue;
|
|
672
|
-
let callCount = 0;
|
|
673
|
-
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
674
|
-
const onetime2 = function(...arguments_) {
|
|
675
|
-
calledFunctions.set(onetime2, ++callCount);
|
|
676
|
-
if (callCount === 1) {
|
|
677
|
-
returnValue = function_.apply(this, arguments_);
|
|
678
|
-
function_ = null;
|
|
679
|
-
} else if (options.throw === true) {
|
|
680
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
681
|
-
}
|
|
682
|
-
return returnValue;
|
|
683
|
-
};
|
|
684
|
-
mimicFunction(onetime2, function_);
|
|
685
|
-
calledFunctions.set(onetime2, callCount);
|
|
686
|
-
return onetime2;
|
|
687
|
-
};
|
|
688
|
-
onetime.callCount = (function_) => {
|
|
689
|
-
if (!calledFunctions.has(function_)) {
|
|
690
|
-
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
691
|
-
}
|
|
692
|
-
return calledFunctions.get(function_);
|
|
693
|
-
};
|
|
694
|
-
onetime_default = onetime;
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
|
|
698
|
-
// node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js
|
|
699
|
-
var getRealtimeSignals, getRealtimeSignal, SIGRTMIN, SIGRTMAX;
|
|
700
|
-
var init_realtime = __esm({
|
|
701
|
-
"node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js"() {
|
|
702
|
-
"use strict";
|
|
703
|
-
getRealtimeSignals = () => {
|
|
704
|
-
const length = SIGRTMAX - SIGRTMIN + 1;
|
|
705
|
-
return Array.from({ length }, getRealtimeSignal);
|
|
706
|
-
};
|
|
707
|
-
getRealtimeSignal = (value, index) => ({
|
|
708
|
-
name: `SIGRT${index + 1}`,
|
|
709
|
-
number: SIGRTMIN + index,
|
|
710
|
-
action: "terminate",
|
|
711
|
-
description: "Application-specific signal (realtime)",
|
|
712
|
-
standard: "posix"
|
|
713
|
-
});
|
|
714
|
-
SIGRTMIN = 34;
|
|
715
|
-
SIGRTMAX = 64;
|
|
716
|
-
}
|
|
717
|
-
});
|
|
718
|
-
|
|
719
|
-
// node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js
|
|
720
|
-
var SIGNALS;
|
|
721
|
-
var init_core = __esm({
|
|
722
|
-
"node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js"() {
|
|
723
|
-
"use strict";
|
|
724
|
-
SIGNALS = [
|
|
725
|
-
{
|
|
726
|
-
name: "SIGHUP",
|
|
727
|
-
number: 1,
|
|
728
|
-
action: "terminate",
|
|
729
|
-
description: "Terminal closed",
|
|
730
|
-
standard: "posix"
|
|
731
|
-
},
|
|
732
|
-
{
|
|
733
|
-
name: "SIGINT",
|
|
734
|
-
number: 2,
|
|
735
|
-
action: "terminate",
|
|
736
|
-
description: "User interruption with CTRL-C",
|
|
737
|
-
standard: "ansi"
|
|
738
|
-
},
|
|
739
|
-
{
|
|
740
|
-
name: "SIGQUIT",
|
|
741
|
-
number: 3,
|
|
742
|
-
action: "core",
|
|
743
|
-
description: "User interruption with CTRL-\\",
|
|
744
|
-
standard: "posix"
|
|
745
|
-
},
|
|
746
|
-
{
|
|
747
|
-
name: "SIGILL",
|
|
748
|
-
number: 4,
|
|
749
|
-
action: "core",
|
|
750
|
-
description: "Invalid machine instruction",
|
|
751
|
-
standard: "ansi"
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
name: "SIGTRAP",
|
|
755
|
-
number: 5,
|
|
756
|
-
action: "core",
|
|
757
|
-
description: "Debugger breakpoint",
|
|
758
|
-
standard: "posix"
|
|
759
|
-
},
|
|
760
|
-
{
|
|
761
|
-
name: "SIGABRT",
|
|
762
|
-
number: 6,
|
|
763
|
-
action: "core",
|
|
764
|
-
description: "Aborted",
|
|
765
|
-
standard: "ansi"
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
name: "SIGIOT",
|
|
769
|
-
number: 6,
|
|
770
|
-
action: "core",
|
|
771
|
-
description: "Aborted",
|
|
772
|
-
standard: "bsd"
|
|
773
|
-
},
|
|
774
|
-
{
|
|
775
|
-
name: "SIGBUS",
|
|
776
|
-
number: 7,
|
|
777
|
-
action: "core",
|
|
778
|
-
description: "Bus error due to misaligned, non-existing address or paging error",
|
|
779
|
-
standard: "bsd"
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
name: "SIGEMT",
|
|
783
|
-
number: 7,
|
|
784
|
-
action: "terminate",
|
|
785
|
-
description: "Command should be emulated but is not implemented",
|
|
786
|
-
standard: "other"
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
name: "SIGFPE",
|
|
790
|
-
number: 8,
|
|
791
|
-
action: "core",
|
|
792
|
-
description: "Floating point arithmetic error",
|
|
793
|
-
standard: "ansi"
|
|
794
|
-
},
|
|
795
|
-
{
|
|
796
|
-
name: "SIGKILL",
|
|
797
|
-
number: 9,
|
|
798
|
-
action: "terminate",
|
|
799
|
-
description: "Forced termination",
|
|
800
|
-
standard: "posix",
|
|
801
|
-
forced: true
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
name: "SIGUSR1",
|
|
805
|
-
number: 10,
|
|
806
|
-
action: "terminate",
|
|
807
|
-
description: "Application-specific signal",
|
|
808
|
-
standard: "posix"
|
|
809
|
-
},
|
|
810
|
-
{
|
|
811
|
-
name: "SIGSEGV",
|
|
812
|
-
number: 11,
|
|
813
|
-
action: "core",
|
|
814
|
-
description: "Segmentation fault",
|
|
815
|
-
standard: "ansi"
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
name: "SIGUSR2",
|
|
819
|
-
number: 12,
|
|
820
|
-
action: "terminate",
|
|
821
|
-
description: "Application-specific signal",
|
|
822
|
-
standard: "posix"
|
|
823
|
-
},
|
|
824
|
-
{
|
|
825
|
-
name: "SIGPIPE",
|
|
826
|
-
number: 13,
|
|
827
|
-
action: "terminate",
|
|
828
|
-
description: "Broken pipe or socket",
|
|
829
|
-
standard: "posix"
|
|
830
|
-
},
|
|
831
|
-
{
|
|
832
|
-
name: "SIGALRM",
|
|
833
|
-
number: 14,
|
|
834
|
-
action: "terminate",
|
|
835
|
-
description: "Timeout or timer",
|
|
836
|
-
standard: "posix"
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
name: "SIGTERM",
|
|
840
|
-
number: 15,
|
|
841
|
-
action: "terminate",
|
|
842
|
-
description: "Termination",
|
|
843
|
-
standard: "ansi"
|
|
844
|
-
},
|
|
845
|
-
{
|
|
846
|
-
name: "SIGSTKFLT",
|
|
847
|
-
number: 16,
|
|
848
|
-
action: "terminate",
|
|
849
|
-
description: "Stack is empty or overflowed",
|
|
850
|
-
standard: "other"
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
name: "SIGCHLD",
|
|
854
|
-
number: 17,
|
|
855
|
-
action: "ignore",
|
|
856
|
-
description: "Child process terminated, paused or unpaused",
|
|
857
|
-
standard: "posix"
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
name: "SIGCLD",
|
|
861
|
-
number: 17,
|
|
862
|
-
action: "ignore",
|
|
863
|
-
description: "Child process terminated, paused or unpaused",
|
|
864
|
-
standard: "other"
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
name: "SIGCONT",
|
|
868
|
-
number: 18,
|
|
869
|
-
action: "unpause",
|
|
870
|
-
description: "Unpaused",
|
|
871
|
-
standard: "posix",
|
|
872
|
-
forced: true
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
name: "SIGSTOP",
|
|
876
|
-
number: 19,
|
|
877
|
-
action: "pause",
|
|
878
|
-
description: "Paused",
|
|
879
|
-
standard: "posix",
|
|
880
|
-
forced: true
|
|
881
|
-
},
|
|
882
|
-
{
|
|
883
|
-
name: "SIGTSTP",
|
|
884
|
-
number: 20,
|
|
885
|
-
action: "pause",
|
|
886
|
-
description: 'Paused using CTRL-Z or "suspend"',
|
|
887
|
-
standard: "posix"
|
|
888
|
-
},
|
|
889
|
-
{
|
|
890
|
-
name: "SIGTTIN",
|
|
891
|
-
number: 21,
|
|
892
|
-
action: "pause",
|
|
893
|
-
description: "Background process cannot read terminal input",
|
|
894
|
-
standard: "posix"
|
|
895
|
-
},
|
|
896
|
-
{
|
|
897
|
-
name: "SIGBREAK",
|
|
898
|
-
number: 21,
|
|
899
|
-
action: "terminate",
|
|
900
|
-
description: "User interruption with CTRL-BREAK",
|
|
901
|
-
standard: "other"
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
name: "SIGTTOU",
|
|
905
|
-
number: 22,
|
|
906
|
-
action: "pause",
|
|
907
|
-
description: "Background process cannot write to terminal output",
|
|
908
|
-
standard: "posix"
|
|
909
|
-
},
|
|
910
|
-
{
|
|
911
|
-
name: "SIGURG",
|
|
912
|
-
number: 23,
|
|
913
|
-
action: "ignore",
|
|
914
|
-
description: "Socket received out-of-band data",
|
|
915
|
-
standard: "bsd"
|
|
916
|
-
},
|
|
917
|
-
{
|
|
918
|
-
name: "SIGXCPU",
|
|
919
|
-
number: 24,
|
|
920
|
-
action: "core",
|
|
921
|
-
description: "Process timed out",
|
|
922
|
-
standard: "bsd"
|
|
923
|
-
},
|
|
924
|
-
{
|
|
925
|
-
name: "SIGXFSZ",
|
|
926
|
-
number: 25,
|
|
927
|
-
action: "core",
|
|
928
|
-
description: "File too big",
|
|
929
|
-
standard: "bsd"
|
|
930
|
-
},
|
|
931
|
-
{
|
|
932
|
-
name: "SIGVTALRM",
|
|
933
|
-
number: 26,
|
|
934
|
-
action: "terminate",
|
|
935
|
-
description: "Timeout or timer",
|
|
936
|
-
standard: "bsd"
|
|
937
|
-
},
|
|
938
|
-
{
|
|
939
|
-
name: "SIGPROF",
|
|
940
|
-
number: 27,
|
|
941
|
-
action: "terminate",
|
|
942
|
-
description: "Timeout or timer",
|
|
943
|
-
standard: "bsd"
|
|
944
|
-
},
|
|
945
|
-
{
|
|
946
|
-
name: "SIGWINCH",
|
|
947
|
-
number: 28,
|
|
948
|
-
action: "ignore",
|
|
949
|
-
description: "Terminal window size changed",
|
|
950
|
-
standard: "bsd"
|
|
951
|
-
},
|
|
952
|
-
{
|
|
953
|
-
name: "SIGIO",
|
|
954
|
-
number: 29,
|
|
955
|
-
action: "terminate",
|
|
956
|
-
description: "I/O is available",
|
|
957
|
-
standard: "other"
|
|
958
|
-
},
|
|
959
|
-
{
|
|
960
|
-
name: "SIGPOLL",
|
|
961
|
-
number: 29,
|
|
962
|
-
action: "terminate",
|
|
963
|
-
description: "Watched event",
|
|
964
|
-
standard: "other"
|
|
965
|
-
},
|
|
966
|
-
{
|
|
967
|
-
name: "SIGINFO",
|
|
968
|
-
number: 29,
|
|
969
|
-
action: "ignore",
|
|
970
|
-
description: "Request for process information",
|
|
971
|
-
standard: "other"
|
|
972
|
-
},
|
|
973
|
-
{
|
|
974
|
-
name: "SIGPWR",
|
|
975
|
-
number: 30,
|
|
976
|
-
action: "terminate",
|
|
977
|
-
description: "Device running out of power",
|
|
978
|
-
standard: "systemv"
|
|
979
|
-
},
|
|
980
|
-
{
|
|
981
|
-
name: "SIGSYS",
|
|
982
|
-
number: 31,
|
|
983
|
-
action: "core",
|
|
984
|
-
description: "Invalid system call",
|
|
985
|
-
standard: "other"
|
|
986
|
-
},
|
|
987
|
-
{
|
|
988
|
-
name: "SIGUNUSED",
|
|
989
|
-
number: 31,
|
|
990
|
-
action: "terminate",
|
|
991
|
-
description: "Invalid system call",
|
|
992
|
-
standard: "other"
|
|
993
|
-
}
|
|
994
|
-
];
|
|
995
|
-
}
|
|
996
|
-
});
|
|
997
|
-
|
|
998
|
-
// node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
|
|
999
|
-
var import_node_os, getSignals, normalizeSignal;
|
|
1000
|
-
var init_signals = __esm({
|
|
1001
|
-
"node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js"() {
|
|
1002
|
-
"use strict";
|
|
1003
|
-
import_node_os = require("os");
|
|
1004
|
-
init_core();
|
|
1005
|
-
init_realtime();
|
|
1006
|
-
getSignals = () => {
|
|
1007
|
-
const realtimeSignals = getRealtimeSignals();
|
|
1008
|
-
const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
1009
|
-
return signals2;
|
|
1010
|
-
};
|
|
1011
|
-
normalizeSignal = ({
|
|
1012
|
-
name,
|
|
1013
|
-
number: defaultNumber,
|
|
1014
|
-
description,
|
|
1015
|
-
action,
|
|
1016
|
-
forced = false,
|
|
1017
|
-
standard
|
|
1018
|
-
}) => {
|
|
1019
|
-
const {
|
|
1020
|
-
signals: { [name]: constantSignal }
|
|
1021
|
-
} = import_node_os.constants;
|
|
1022
|
-
const supported = constantSignal !== void 0;
|
|
1023
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
1024
|
-
return { name, number, description, supported, action, forced, standard };
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
});
|
|
1028
|
-
|
|
1029
|
-
// node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
|
|
1030
|
-
var import_node_os2, getSignalsByName, getSignalByName, signalsByName, getSignalsByNumber, getSignalByNumber, findSignalByNumber, signalsByNumber;
|
|
1031
|
-
var init_main = __esm({
|
|
1032
|
-
"node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js"() {
|
|
1033
|
-
"use strict";
|
|
1034
|
-
import_node_os2 = require("os");
|
|
1035
|
-
init_realtime();
|
|
1036
|
-
init_signals();
|
|
1037
|
-
getSignalsByName = () => {
|
|
1038
|
-
const signals2 = getSignals();
|
|
1039
|
-
return Object.fromEntries(signals2.map(getSignalByName));
|
|
1040
|
-
};
|
|
1041
|
-
getSignalByName = ({
|
|
1042
|
-
name,
|
|
1043
|
-
number,
|
|
1044
|
-
description,
|
|
1045
|
-
supported,
|
|
1046
|
-
action,
|
|
1047
|
-
forced,
|
|
1048
|
-
standard
|
|
1049
|
-
}) => [name, { name, number, description, supported, action, forced, standard }];
|
|
1050
|
-
signalsByName = getSignalsByName();
|
|
1051
|
-
getSignalsByNumber = () => {
|
|
1052
|
-
const signals2 = getSignals();
|
|
1053
|
-
const length = SIGRTMAX + 1;
|
|
1054
|
-
const signalsA = Array.from(
|
|
1055
|
-
{ length },
|
|
1056
|
-
(value, number) => getSignalByNumber(number, signals2)
|
|
1057
|
-
);
|
|
1058
|
-
return Object.assign({}, ...signalsA);
|
|
1059
|
-
};
|
|
1060
|
-
getSignalByNumber = (number, signals2) => {
|
|
1061
|
-
const signal = findSignalByNumber(number, signals2);
|
|
1062
|
-
if (signal === void 0) {
|
|
1063
|
-
return {};
|
|
1064
|
-
}
|
|
1065
|
-
const { name, description, supported, action, forced, standard } = signal;
|
|
1066
|
-
return {
|
|
1067
|
-
[number]: {
|
|
1068
|
-
name,
|
|
1069
|
-
number,
|
|
1070
|
-
description,
|
|
1071
|
-
supported,
|
|
1072
|
-
action,
|
|
1073
|
-
forced,
|
|
1074
|
-
standard
|
|
1075
|
-
}
|
|
1076
|
-
};
|
|
1077
|
-
};
|
|
1078
|
-
findSignalByNumber = (number, signals2) => {
|
|
1079
|
-
const signal = signals2.find(({ name }) => import_node_os2.constants.signals[name] === number);
|
|
1080
|
-
if (signal !== void 0) {
|
|
1081
|
-
return signal;
|
|
1082
|
-
}
|
|
1083
|
-
return signals2.find((signalA) => signalA.number === number);
|
|
1084
|
-
};
|
|
1085
|
-
signalsByNumber = getSignalsByNumber();
|
|
1086
|
-
}
|
|
1087
|
-
});
|
|
1088
|
-
|
|
1089
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
|
|
1090
|
-
var import_node_process2, getErrorPrefix, makeError;
|
|
1091
|
-
var init_error = __esm({
|
|
1092
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js"() {
|
|
1093
|
-
"use strict";
|
|
1094
|
-
import_node_process2 = __toESM(require("process"), 1);
|
|
1095
|
-
init_main();
|
|
1096
|
-
getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
|
|
1097
|
-
if (timedOut) {
|
|
1098
|
-
return `timed out after ${timeout} milliseconds`;
|
|
1099
|
-
}
|
|
1100
|
-
if (isCanceled) {
|
|
1101
|
-
return "was canceled";
|
|
1102
|
-
}
|
|
1103
|
-
if (errorCode !== void 0) {
|
|
1104
|
-
return `failed with ${errorCode}`;
|
|
1105
|
-
}
|
|
1106
|
-
if (signal !== void 0) {
|
|
1107
|
-
return `was killed with ${signal} (${signalDescription})`;
|
|
1108
|
-
}
|
|
1109
|
-
if (exitCode !== void 0) {
|
|
1110
|
-
return `failed with exit code ${exitCode}`;
|
|
1111
|
-
}
|
|
1112
|
-
return "failed";
|
|
1113
|
-
};
|
|
1114
|
-
makeError = ({
|
|
1115
|
-
stdout,
|
|
1116
|
-
stderr,
|
|
1117
|
-
all,
|
|
1118
|
-
error,
|
|
1119
|
-
signal,
|
|
1120
|
-
exitCode,
|
|
1121
|
-
command,
|
|
1122
|
-
escapedCommand,
|
|
1123
|
-
timedOut,
|
|
1124
|
-
isCanceled,
|
|
1125
|
-
killed,
|
|
1126
|
-
parsed: { options: { timeout, cwd = import_node_process2.default.cwd() } }
|
|
1127
|
-
}) => {
|
|
1128
|
-
exitCode = exitCode === null ? void 0 : exitCode;
|
|
1129
|
-
signal = signal === null ? void 0 : signal;
|
|
1130
|
-
const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
|
|
1131
|
-
const errorCode = error && error.code;
|
|
1132
|
-
const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
|
|
1133
|
-
const execaMessage = `Command ${prefix}: ${command}`;
|
|
1134
|
-
const isError = Object.prototype.toString.call(error) === "[object Error]";
|
|
1135
|
-
const shortMessage = isError ? `${execaMessage}
|
|
1136
|
-
${error.message}` : execaMessage;
|
|
1137
|
-
const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
|
|
1138
|
-
if (isError) {
|
|
1139
|
-
error.originalMessage = error.message;
|
|
1140
|
-
error.message = message;
|
|
1141
|
-
} else {
|
|
1142
|
-
error = new Error(message);
|
|
1143
|
-
}
|
|
1144
|
-
error.shortMessage = shortMessage;
|
|
1145
|
-
error.command = command;
|
|
1146
|
-
error.escapedCommand = escapedCommand;
|
|
1147
|
-
error.exitCode = exitCode;
|
|
1148
|
-
error.signal = signal;
|
|
1149
|
-
error.signalDescription = signalDescription;
|
|
1150
|
-
error.stdout = stdout;
|
|
1151
|
-
error.stderr = stderr;
|
|
1152
|
-
error.cwd = cwd;
|
|
1153
|
-
if (all !== void 0) {
|
|
1154
|
-
error.all = all;
|
|
1155
|
-
}
|
|
1156
|
-
if ("bufferedData" in error) {
|
|
1157
|
-
delete error.bufferedData;
|
|
1158
|
-
}
|
|
1159
|
-
error.failed = true;
|
|
1160
|
-
error.timedOut = Boolean(timedOut);
|
|
1161
|
-
error.isCanceled = isCanceled;
|
|
1162
|
-
error.killed = killed && !timedOut;
|
|
1163
|
-
return error;
|
|
1164
|
-
};
|
|
1165
|
-
}
|
|
1166
|
-
});
|
|
1167
|
-
|
|
1168
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js
|
|
1169
|
-
var aliases, hasAlias, normalizeStdio, normalizeStdioNode;
|
|
1170
|
-
var init_stdio = __esm({
|
|
1171
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js"() {
|
|
1172
|
-
"use strict";
|
|
1173
|
-
aliases = ["stdin", "stdout", "stderr"];
|
|
1174
|
-
hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
|
|
1175
|
-
normalizeStdio = (options) => {
|
|
1176
|
-
if (!options) {
|
|
1177
|
-
return;
|
|
1178
|
-
}
|
|
1179
|
-
const { stdio } = options;
|
|
1180
|
-
if (stdio === void 0) {
|
|
1181
|
-
return aliases.map((alias) => options[alias]);
|
|
1182
|
-
}
|
|
1183
|
-
if (hasAlias(options)) {
|
|
1184
|
-
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
|
|
1185
|
-
}
|
|
1186
|
-
if (typeof stdio === "string") {
|
|
1187
|
-
return stdio;
|
|
1188
|
-
}
|
|
1189
|
-
if (!Array.isArray(stdio)) {
|
|
1190
|
-
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
1191
|
-
}
|
|
1192
|
-
const length = Math.max(stdio.length, aliases.length);
|
|
1193
|
-
return Array.from({ length }, (value, index) => stdio[index]);
|
|
1194
|
-
};
|
|
1195
|
-
normalizeStdioNode = (options) => {
|
|
1196
|
-
const stdio = normalizeStdio(options);
|
|
1197
|
-
if (stdio === "ipc") {
|
|
1198
|
-
return "ipc";
|
|
1199
|
-
}
|
|
1200
|
-
if (stdio === void 0 || typeof stdio === "string") {
|
|
1201
|
-
return [stdio, stdio, stdio, "ipc"];
|
|
1202
|
-
}
|
|
1203
|
-
if (stdio.includes("ipc")) {
|
|
1204
|
-
return stdio;
|
|
1205
|
-
}
|
|
1206
|
-
return [...stdio, "ipc"];
|
|
1207
|
-
};
|
|
1208
|
-
}
|
|
1209
|
-
});
|
|
1210
|
-
|
|
1211
|
-
// node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
1212
|
-
var signals;
|
|
1213
|
-
var init_signals2 = __esm({
|
|
1214
|
-
"node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js"() {
|
|
1215
|
-
"use strict";
|
|
1216
|
-
signals = [];
|
|
1217
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1218
|
-
if (process.platform !== "win32") {
|
|
1219
|
-
signals.push(
|
|
1220
|
-
"SIGALRM",
|
|
1221
|
-
"SIGABRT",
|
|
1222
|
-
"SIGVTALRM",
|
|
1223
|
-
"SIGXCPU",
|
|
1224
|
-
"SIGXFSZ",
|
|
1225
|
-
"SIGUSR2",
|
|
1226
|
-
"SIGTRAP",
|
|
1227
|
-
"SIGSYS",
|
|
1228
|
-
"SIGQUIT",
|
|
1229
|
-
"SIGIOT"
|
|
1230
|
-
// should detect profiler and enable/disable accordingly.
|
|
1231
|
-
// see #21
|
|
1232
|
-
// 'SIGPROF'
|
|
1233
|
-
);
|
|
1234
|
-
}
|
|
1235
|
-
if (process.platform === "linux") {
|
|
1236
|
-
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
});
|
|
1240
|
-
|
|
1241
|
-
// node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
1242
|
-
var processOk, kExitEmitter, global2, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process4, onExit, load, unload;
|
|
1243
|
-
var init_mjs = __esm({
|
|
1244
|
-
"node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
|
|
1245
|
-
"use strict";
|
|
1246
|
-
init_signals2();
|
|
1247
|
-
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";
|
|
1248
|
-
kExitEmitter = Symbol.for("signal-exit emitter");
|
|
1249
|
-
global2 = globalThis;
|
|
1250
|
-
ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1251
|
-
Emitter = class {
|
|
1252
|
-
emitted = {
|
|
1253
|
-
afterExit: false,
|
|
1254
|
-
exit: false
|
|
1255
|
-
};
|
|
1256
|
-
listeners = {
|
|
1257
|
-
afterExit: [],
|
|
1258
|
-
exit: []
|
|
1259
|
-
};
|
|
1260
|
-
count = 0;
|
|
1261
|
-
id = Math.random();
|
|
1262
|
-
constructor() {
|
|
1263
|
-
if (global2[kExitEmitter]) {
|
|
1264
|
-
return global2[kExitEmitter];
|
|
1265
|
-
}
|
|
1266
|
-
ObjectDefineProperty(global2, kExitEmitter, {
|
|
1267
|
-
value: this,
|
|
1268
|
-
writable: false,
|
|
1269
|
-
enumerable: false,
|
|
1270
|
-
configurable: false
|
|
1271
|
-
});
|
|
1272
|
-
}
|
|
1273
|
-
on(ev, fn) {
|
|
1274
|
-
this.listeners[ev].push(fn);
|
|
1275
|
-
}
|
|
1276
|
-
removeListener(ev, fn) {
|
|
1277
|
-
const list = this.listeners[ev];
|
|
1278
|
-
const i = list.indexOf(fn);
|
|
1279
|
-
if (i === -1) {
|
|
1280
|
-
return;
|
|
1281
|
-
}
|
|
1282
|
-
if (i === 0 && list.length === 1) {
|
|
1283
|
-
list.length = 0;
|
|
1284
|
-
} else {
|
|
1285
|
-
list.splice(i, 1);
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
emit(ev, code, signal) {
|
|
1289
|
-
if (this.emitted[ev]) {
|
|
1290
|
-
return false;
|
|
1291
|
-
}
|
|
1292
|
-
this.emitted[ev] = true;
|
|
1293
|
-
let ret = false;
|
|
1294
|
-
for (const fn of this.listeners[ev]) {
|
|
1295
|
-
ret = fn(code, signal) === true || ret;
|
|
1296
|
-
}
|
|
1297
|
-
if (ev === "exit") {
|
|
1298
|
-
ret = this.emit("afterExit", code, signal) || ret;
|
|
1299
|
-
}
|
|
1300
|
-
return ret;
|
|
1301
|
-
}
|
|
1302
|
-
};
|
|
1303
|
-
SignalExitBase = class {
|
|
1304
|
-
};
|
|
1305
|
-
signalExitWrap = (handler) => {
|
|
1306
|
-
return {
|
|
1307
|
-
onExit(cb, opts) {
|
|
1308
|
-
return handler.onExit(cb, opts);
|
|
1309
|
-
},
|
|
1310
|
-
load() {
|
|
1311
|
-
return handler.load();
|
|
1312
|
-
},
|
|
1313
|
-
unload() {
|
|
1314
|
-
return handler.unload();
|
|
1315
|
-
}
|
|
1316
|
-
};
|
|
1317
|
-
};
|
|
1318
|
-
SignalExitFallback = class extends SignalExitBase {
|
|
1319
|
-
onExit() {
|
|
1320
|
-
return () => {
|
|
1321
|
-
};
|
|
1322
|
-
}
|
|
1323
|
-
load() {
|
|
1324
|
-
}
|
|
1325
|
-
unload() {
|
|
1326
|
-
}
|
|
1327
|
-
};
|
|
1328
|
-
SignalExit = class extends SignalExitBase {
|
|
1329
|
-
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
1330
|
-
// so use a supported signal instead
|
|
1331
|
-
/* c8 ignore start */
|
|
1332
|
-
#hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1333
|
-
/* c8 ignore stop */
|
|
1334
|
-
#emitter = new Emitter();
|
|
1335
|
-
#process;
|
|
1336
|
-
#originalProcessEmit;
|
|
1337
|
-
#originalProcessReallyExit;
|
|
1338
|
-
#sigListeners = {};
|
|
1339
|
-
#loaded = false;
|
|
1340
|
-
constructor(process7) {
|
|
1341
|
-
super();
|
|
1342
|
-
this.#process = process7;
|
|
1343
|
-
this.#sigListeners = {};
|
|
1344
|
-
for (const sig of signals) {
|
|
1345
|
-
this.#sigListeners[sig] = () => {
|
|
1346
|
-
const listeners = this.#process.listeners(sig);
|
|
1347
|
-
let { count } = this.#emitter;
|
|
1348
|
-
const p = process7;
|
|
1349
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
1350
|
-
count += p.__signal_exit_emitter__.count;
|
|
1351
|
-
}
|
|
1352
|
-
if (listeners.length === count) {
|
|
1353
|
-
this.unload();
|
|
1354
|
-
const ret = this.#emitter.emit("exit", null, sig);
|
|
1355
|
-
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1356
|
-
if (!ret)
|
|
1357
|
-
process7.kill(process7.pid, s);
|
|
1358
|
-
}
|
|
1359
|
-
};
|
|
1360
|
-
}
|
|
1361
|
-
this.#originalProcessReallyExit = process7.reallyExit;
|
|
1362
|
-
this.#originalProcessEmit = process7.emit;
|
|
1363
|
-
}
|
|
1364
|
-
onExit(cb, opts) {
|
|
1365
|
-
if (!processOk(this.#process)) {
|
|
1366
|
-
return () => {
|
|
1367
|
-
};
|
|
1368
|
-
}
|
|
1369
|
-
if (this.#loaded === false) {
|
|
1370
|
-
this.load();
|
|
1371
|
-
}
|
|
1372
|
-
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1373
|
-
this.#emitter.on(ev, cb);
|
|
1374
|
-
return () => {
|
|
1375
|
-
this.#emitter.removeListener(ev, cb);
|
|
1376
|
-
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
1377
|
-
this.unload();
|
|
1378
|
-
}
|
|
1379
|
-
};
|
|
1380
|
-
}
|
|
1381
|
-
load() {
|
|
1382
|
-
if (this.#loaded) {
|
|
1383
|
-
return;
|
|
1384
|
-
}
|
|
1385
|
-
this.#loaded = true;
|
|
1386
|
-
this.#emitter.count += 1;
|
|
1387
|
-
for (const sig of signals) {
|
|
1388
|
-
try {
|
|
1389
|
-
const fn = this.#sigListeners[sig];
|
|
1390
|
-
if (fn)
|
|
1391
|
-
this.#process.on(sig, fn);
|
|
1392
|
-
} catch (_) {
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
this.#process.emit = (ev, ...a) => {
|
|
1396
|
-
return this.#processEmit(ev, ...a);
|
|
1397
|
-
};
|
|
1398
|
-
this.#process.reallyExit = (code) => {
|
|
1399
|
-
return this.#processReallyExit(code);
|
|
1400
|
-
};
|
|
1401
|
-
}
|
|
1402
|
-
unload() {
|
|
1403
|
-
if (!this.#loaded) {
|
|
1404
|
-
return;
|
|
1405
|
-
}
|
|
1406
|
-
this.#loaded = false;
|
|
1407
|
-
signals.forEach((sig) => {
|
|
1408
|
-
const listener = this.#sigListeners[sig];
|
|
1409
|
-
if (!listener) {
|
|
1410
|
-
throw new Error("Listener not defined for signal: " + sig);
|
|
1411
|
-
}
|
|
1412
|
-
try {
|
|
1413
|
-
this.#process.removeListener(sig, listener);
|
|
1414
|
-
} catch (_) {
|
|
1415
|
-
}
|
|
1416
|
-
});
|
|
1417
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
1418
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1419
|
-
this.#emitter.count -= 1;
|
|
1420
|
-
}
|
|
1421
|
-
#processReallyExit(code) {
|
|
1422
|
-
if (!processOk(this.#process)) {
|
|
1423
|
-
return 0;
|
|
1424
|
-
}
|
|
1425
|
-
this.#process.exitCode = code || 0;
|
|
1426
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1427
|
-
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
1428
|
-
}
|
|
1429
|
-
#processEmit(ev, ...args) {
|
|
1430
|
-
const og = this.#originalProcessEmit;
|
|
1431
|
-
if (ev === "exit" && processOk(this.#process)) {
|
|
1432
|
-
if (typeof args[0] === "number") {
|
|
1433
|
-
this.#process.exitCode = args[0];
|
|
1434
|
-
}
|
|
1435
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
1436
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1437
|
-
return ret;
|
|
1438
|
-
} else {
|
|
1439
|
-
return og.call(this.#process, ev, ...args);
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
};
|
|
1443
|
-
process4 = globalThis.process;
|
|
1444
|
-
({
|
|
1445
|
-
onExit: (
|
|
1446
|
-
/**
|
|
1447
|
-
* Called when the process is exiting, whether via signal, explicit
|
|
1448
|
-
* exit, or running out of stuff to do.
|
|
1449
|
-
*
|
|
1450
|
-
* If the global process object is not suitable for instrumentation,
|
|
1451
|
-
* then this will be a no-op.
|
|
1452
|
-
*
|
|
1453
|
-
* Returns a function that may be used to unload signal-exit.
|
|
1454
|
-
*/
|
|
1455
|
-
onExit
|
|
1456
|
-
),
|
|
1457
|
-
load: (
|
|
1458
|
-
/**
|
|
1459
|
-
* Load the listeners. Likely you never need to call this, unless
|
|
1460
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
1461
|
-
* Mostly exposed for the benefit of testing.
|
|
1462
|
-
*
|
|
1463
|
-
* @internal
|
|
1464
|
-
*/
|
|
1465
|
-
load
|
|
1466
|
-
),
|
|
1467
|
-
unload: (
|
|
1468
|
-
/**
|
|
1469
|
-
* Unload the listeners. Likely you never need to call this, unless
|
|
1470
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
1471
|
-
* Mostly exposed for the benefit of testing.
|
|
1472
|
-
*
|
|
1473
|
-
* @internal
|
|
1474
|
-
*/
|
|
1475
|
-
unload
|
|
1476
|
-
)
|
|
1477
|
-
} = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback()));
|
|
1478
|
-
}
|
|
1479
|
-
});
|
|
1480
|
-
|
|
1481
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
|
|
1482
|
-
var import_node_os3, DEFAULT_FORCE_KILL_TIMEOUT, spawnedKill, setKillTimeout, shouldForceKill, isSigterm, getForceKillAfterTimeout, spawnedCancel, timeoutKill, setupTimeout, validateTimeout, setExitHandler;
|
|
1483
|
-
var init_kill = __esm({
|
|
1484
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js"() {
|
|
1485
|
-
"use strict";
|
|
1486
|
-
import_node_os3 = __toESM(require("os"), 1);
|
|
1487
|
-
init_mjs();
|
|
1488
|
-
DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
1489
|
-
spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
1490
|
-
const killResult = kill(signal);
|
|
1491
|
-
setKillTimeout(kill, signal, options, killResult);
|
|
1492
|
-
return killResult;
|
|
1493
|
-
};
|
|
1494
|
-
setKillTimeout = (kill, signal, options, killResult) => {
|
|
1495
|
-
if (!shouldForceKill(signal, options, killResult)) {
|
|
1496
|
-
return;
|
|
1497
|
-
}
|
|
1498
|
-
const timeout = getForceKillAfterTimeout(options);
|
|
1499
|
-
const t = setTimeout(() => {
|
|
1500
|
-
kill("SIGKILL");
|
|
1501
|
-
}, timeout);
|
|
1502
|
-
if (t.unref) {
|
|
1503
|
-
t.unref();
|
|
1504
|
-
}
|
|
1505
|
-
};
|
|
1506
|
-
shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
1507
|
-
isSigterm = (signal) => signal === import_node_os3.default.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
|
|
1508
|
-
getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
|
|
1509
|
-
if (forceKillAfterTimeout === true) {
|
|
1510
|
-
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
1511
|
-
}
|
|
1512
|
-
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
|
|
1513
|
-
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
1514
|
-
}
|
|
1515
|
-
return forceKillAfterTimeout;
|
|
1516
|
-
};
|
|
1517
|
-
spawnedCancel = (spawned, context) => {
|
|
1518
|
-
const killResult = spawned.kill();
|
|
1519
|
-
if (killResult) {
|
|
1520
|
-
context.isCanceled = true;
|
|
1521
|
-
}
|
|
1522
|
-
};
|
|
1523
|
-
timeoutKill = (spawned, signal, reject) => {
|
|
1524
|
-
spawned.kill(signal);
|
|
1525
|
-
reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
|
|
1526
|
-
};
|
|
1527
|
-
setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
|
|
1528
|
-
if (timeout === 0 || timeout === void 0) {
|
|
1529
|
-
return spawnedPromise;
|
|
1530
|
-
}
|
|
1531
|
-
let timeoutId;
|
|
1532
|
-
const timeoutPromise = new Promise((resolve14, reject) => {
|
|
1533
|
-
timeoutId = setTimeout(() => {
|
|
1534
|
-
timeoutKill(spawned, killSignal, reject);
|
|
1535
|
-
}, timeout);
|
|
1536
|
-
});
|
|
1537
|
-
const safeSpawnedPromise = spawnedPromise.finally(() => {
|
|
1538
|
-
clearTimeout(timeoutId);
|
|
1539
|
-
});
|
|
1540
|
-
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
1541
|
-
};
|
|
1542
|
-
validateTimeout = ({ timeout }) => {
|
|
1543
|
-
if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
|
|
1544
|
-
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
1545
|
-
}
|
|
1546
|
-
};
|
|
1547
|
-
setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
1548
|
-
if (!cleanup || detached) {
|
|
1549
|
-
return timedPromise;
|
|
1550
|
-
}
|
|
1551
|
-
const removeExitHandler = onExit(() => {
|
|
1552
|
-
spawned.kill();
|
|
1553
|
-
});
|
|
1554
|
-
return timedPromise.finally(() => {
|
|
1555
|
-
removeExitHandler();
|
|
1556
|
-
});
|
|
1557
|
-
};
|
|
1558
|
-
}
|
|
1559
|
-
});
|
|
1560
|
-
|
|
1561
|
-
// node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
|
|
1562
|
-
function isStream(stream) {
|
|
1563
|
-
return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
1564
|
-
}
|
|
1565
|
-
function isWritableStream(stream) {
|
|
1566
|
-
return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
1567
|
-
}
|
|
1568
|
-
var init_is_stream = __esm({
|
|
1569
|
-
"node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js"() {
|
|
1570
|
-
"use strict";
|
|
1571
|
-
}
|
|
1572
|
-
});
|
|
1573
|
-
|
|
1574
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
|
|
1575
|
-
var import_node_fs, import_node_child_process, isExecaChildProcess, pipeToTarget, addPipeMethods;
|
|
1576
|
-
var init_pipe = __esm({
|
|
1577
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js"() {
|
|
1578
|
-
"use strict";
|
|
1579
|
-
import_node_fs = require("fs");
|
|
1580
|
-
import_node_child_process = require("child_process");
|
|
1581
|
-
init_is_stream();
|
|
1582
|
-
isExecaChildProcess = (target) => target instanceof import_node_child_process.ChildProcess && typeof target.then === "function";
|
|
1583
|
-
pipeToTarget = (spawned, streamName, target) => {
|
|
1584
|
-
if (typeof target === "string") {
|
|
1585
|
-
spawned[streamName].pipe((0, import_node_fs.createWriteStream)(target));
|
|
1586
|
-
return spawned;
|
|
1587
|
-
}
|
|
1588
|
-
if (isWritableStream(target)) {
|
|
1589
|
-
spawned[streamName].pipe(target);
|
|
1590
|
-
return spawned;
|
|
1591
|
-
}
|
|
1592
|
-
if (!isExecaChildProcess(target)) {
|
|
1593
|
-
throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
|
|
1594
|
-
}
|
|
1595
|
-
if (!isWritableStream(target.stdin)) {
|
|
1596
|
-
throw new TypeError("The target child process's stdin must be available.");
|
|
1597
|
-
}
|
|
1598
|
-
spawned[streamName].pipe(target.stdin);
|
|
1599
|
-
return target;
|
|
1600
|
-
};
|
|
1601
|
-
addPipeMethods = (spawned) => {
|
|
1602
|
-
if (spawned.stdout !== null) {
|
|
1603
|
-
spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
|
|
1604
|
-
}
|
|
1605
|
-
if (spawned.stderr !== null) {
|
|
1606
|
-
spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
|
|
1607
|
-
}
|
|
1608
|
-
if (spawned.all !== void 0) {
|
|
1609
|
-
spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
|
|
1610
|
-
}
|
|
1611
|
-
};
|
|
1612
|
-
}
|
|
1613
|
-
});
|
|
1614
|
-
|
|
1615
|
-
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js
|
|
1616
|
-
var getStreamContents, appendFinalChunk, appendChunk, addNewChunk, isAsyncIterable, getChunkType, objectToString, MaxBufferError;
|
|
1617
|
-
var init_contents = __esm({
|
|
1618
|
-
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js"() {
|
|
1619
|
-
"use strict";
|
|
1620
|
-
getStreamContents = async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
|
|
1621
|
-
if (!isAsyncIterable(stream)) {
|
|
1622
|
-
throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
1623
|
-
}
|
|
1624
|
-
const state = init();
|
|
1625
|
-
state.length = 0;
|
|
1626
|
-
try {
|
|
1627
|
-
for await (const chunk of stream) {
|
|
1628
|
-
const chunkType = getChunkType(chunk);
|
|
1629
|
-
const convertedChunk = convertChunk[chunkType](chunk, state);
|
|
1630
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1631
|
-
}
|
|
1632
|
-
appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
|
|
1633
|
-
return finalize(state);
|
|
1634
|
-
} catch (error) {
|
|
1635
|
-
error.bufferedData = finalize(state);
|
|
1636
|
-
throw error;
|
|
1637
|
-
}
|
|
1638
|
-
};
|
|
1639
|
-
appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
|
|
1640
|
-
const convertedChunk = getFinalChunk(state);
|
|
1641
|
-
if (convertedChunk !== void 0) {
|
|
1642
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1643
|
-
}
|
|
1644
|
-
};
|
|
1645
|
-
appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
|
|
1646
|
-
const chunkSize = getSize(convertedChunk);
|
|
1647
|
-
const newLength = state.length + chunkSize;
|
|
1648
|
-
if (newLength <= maxBuffer) {
|
|
1649
|
-
addNewChunk(convertedChunk, state, addChunk, newLength);
|
|
1650
|
-
return;
|
|
1651
|
-
}
|
|
1652
|
-
const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
|
|
1653
|
-
if (truncatedChunk !== void 0) {
|
|
1654
|
-
addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
|
|
1655
|
-
}
|
|
1656
|
-
throw new MaxBufferError();
|
|
1657
|
-
};
|
|
1658
|
-
addNewChunk = (convertedChunk, state, addChunk, newLength) => {
|
|
1659
|
-
state.contents = addChunk(convertedChunk, state, newLength);
|
|
1660
|
-
state.length = newLength;
|
|
1661
|
-
};
|
|
1662
|
-
isAsyncIterable = (stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function";
|
|
1663
|
-
getChunkType = (chunk) => {
|
|
1664
|
-
const typeOfChunk = typeof chunk;
|
|
1665
|
-
if (typeOfChunk === "string") {
|
|
1666
|
-
return "string";
|
|
1667
|
-
}
|
|
1668
|
-
if (typeOfChunk !== "object" || chunk === null) {
|
|
1669
|
-
return "others";
|
|
1670
|
-
}
|
|
1671
|
-
if (globalThis.Buffer?.isBuffer(chunk)) {
|
|
1672
|
-
return "buffer";
|
|
1673
|
-
}
|
|
1674
|
-
const prototypeName = objectToString.call(chunk);
|
|
1675
|
-
if (prototypeName === "[object ArrayBuffer]") {
|
|
1676
|
-
return "arrayBuffer";
|
|
1677
|
-
}
|
|
1678
|
-
if (prototypeName === "[object DataView]") {
|
|
1679
|
-
return "dataView";
|
|
1680
|
-
}
|
|
1681
|
-
if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
|
|
1682
|
-
return "typedArray";
|
|
1683
|
-
}
|
|
1684
|
-
return "others";
|
|
1685
|
-
};
|
|
1686
|
-
({ toString: objectToString } = Object.prototype);
|
|
1687
|
-
MaxBufferError = class extends Error {
|
|
1688
|
-
name = "MaxBufferError";
|
|
1689
|
-
constructor() {
|
|
1690
|
-
super("maxBuffer exceeded");
|
|
1691
|
-
}
|
|
1692
|
-
};
|
|
1693
|
-
}
|
|
1694
|
-
});
|
|
1695
|
-
|
|
1696
|
-
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js
|
|
1697
|
-
var identity, noop, getContentsProp, throwObjectStream, getLengthProp;
|
|
1698
|
-
var init_utils = __esm({
|
|
1699
|
-
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js"() {
|
|
1700
|
-
"use strict";
|
|
1701
|
-
identity = (value) => value;
|
|
1702
|
-
noop = () => void 0;
|
|
1703
|
-
getContentsProp = ({ contents }) => contents;
|
|
1704
|
-
throwObjectStream = (chunk) => {
|
|
1705
|
-
throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
|
|
1706
|
-
};
|
|
1707
|
-
getLengthProp = (convertedChunk) => convertedChunk.length;
|
|
1708
|
-
}
|
|
1709
|
-
});
|
|
1710
|
-
|
|
1711
|
-
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.js
|
|
1712
|
-
var init_array = __esm({
|
|
1713
|
-
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.js"() {
|
|
1714
|
-
"use strict";
|
|
1715
|
-
init_contents();
|
|
1716
|
-
init_utils();
|
|
1717
|
-
}
|
|
1718
|
-
});
|
|
1719
|
-
|
|
1720
|
-
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js
|
|
1721
|
-
async function getStreamAsArrayBuffer(stream, options) {
|
|
1722
|
-
return getStreamContents(stream, arrayBufferMethods, options);
|
|
1723
|
-
}
|
|
1724
|
-
var initArrayBuffer, useTextEncoder, textEncoder, useUint8Array, useUint8ArrayWithOffset, truncateArrayBufferChunk, addArrayBufferChunk, resizeArrayBufferSlow, resizeArrayBuffer, getNewContentsLength, SCALE_FACTOR, finalizeArrayBuffer, hasArrayBufferResize, arrayBufferMethods;
|
|
1725
|
-
var init_array_buffer = __esm({
|
|
1726
|
-
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js"() {
|
|
1727
|
-
"use strict";
|
|
1728
|
-
init_contents();
|
|
1729
|
-
init_utils();
|
|
1730
|
-
initArrayBuffer = () => ({ contents: new ArrayBuffer(0) });
|
|
1731
|
-
useTextEncoder = (chunk) => textEncoder.encode(chunk);
|
|
1732
|
-
textEncoder = new TextEncoder();
|
|
1733
|
-
useUint8Array = (chunk) => new Uint8Array(chunk);
|
|
1734
|
-
useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
1735
|
-
truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
1736
|
-
addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
|
|
1737
|
-
const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
|
|
1738
|
-
new Uint8Array(newContents).set(convertedChunk, previousLength);
|
|
1739
|
-
return newContents;
|
|
1740
|
-
};
|
|
1741
|
-
resizeArrayBufferSlow = (contents, length) => {
|
|
1742
|
-
if (length <= contents.byteLength) {
|
|
1743
|
-
return contents;
|
|
1744
|
-
}
|
|
1745
|
-
const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
|
|
1746
|
-
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
1747
|
-
return arrayBuffer;
|
|
1748
|
-
};
|
|
1749
|
-
resizeArrayBuffer = (contents, length) => {
|
|
1750
|
-
if (length <= contents.maxByteLength) {
|
|
1751
|
-
contents.resize(length);
|
|
1752
|
-
return contents;
|
|
1753
|
-
}
|
|
1754
|
-
const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
|
|
1755
|
-
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
1756
|
-
return arrayBuffer;
|
|
1757
|
-
};
|
|
1758
|
-
getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));
|
|
1759
|
-
SCALE_FACTOR = 2;
|
|
1760
|
-
finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length);
|
|
1761
|
-
hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype;
|
|
1762
|
-
arrayBufferMethods = {
|
|
1763
|
-
init: initArrayBuffer,
|
|
1764
|
-
convertChunk: {
|
|
1765
|
-
string: useTextEncoder,
|
|
1766
|
-
buffer: useUint8Array,
|
|
1767
|
-
arrayBuffer: useUint8Array,
|
|
1768
|
-
dataView: useUint8ArrayWithOffset,
|
|
1769
|
-
typedArray: useUint8ArrayWithOffset,
|
|
1770
|
-
others: throwObjectStream
|
|
1771
|
-
},
|
|
1772
|
-
getSize: getLengthProp,
|
|
1773
|
-
truncateChunk: truncateArrayBufferChunk,
|
|
1774
|
-
addChunk: addArrayBufferChunk,
|
|
1775
|
-
getFinalChunk: noop,
|
|
1776
|
-
finalize: finalizeArrayBuffer
|
|
1777
|
-
};
|
|
1778
|
-
}
|
|
1779
|
-
});
|
|
1780
|
-
|
|
1781
|
-
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js
|
|
1782
|
-
async function getStreamAsBuffer(stream, options) {
|
|
1783
|
-
if (!("Buffer" in globalThis)) {
|
|
1784
|
-
throw new Error("getStreamAsBuffer() is only supported in Node.js");
|
|
1785
|
-
}
|
|
1786
|
-
try {
|
|
1787
|
-
return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
|
|
1788
|
-
} catch (error) {
|
|
1789
|
-
if (error.bufferedData !== void 0) {
|
|
1790
|
-
error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
|
|
1791
|
-
}
|
|
1792
|
-
throw error;
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
var arrayBufferToNodeBuffer;
|
|
1796
|
-
var init_buffer = __esm({
|
|
1797
|
-
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js"() {
|
|
1798
|
-
"use strict";
|
|
1799
|
-
init_array_buffer();
|
|
1800
|
-
arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
|
|
1801
|
-
}
|
|
1802
|
-
});
|
|
1803
|
-
|
|
1804
|
-
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js
|
|
1805
|
-
async function getStreamAsString(stream, options) {
|
|
1806
|
-
return getStreamContents(stream, stringMethods, options);
|
|
1807
|
-
}
|
|
1808
|
-
var initString, useTextDecoder, addStringChunk, truncateStringChunk, getFinalStringChunk, stringMethods;
|
|
1809
|
-
var init_string = __esm({
|
|
1810
|
-
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js"() {
|
|
1811
|
-
"use strict";
|
|
1812
|
-
init_contents();
|
|
1813
|
-
init_utils();
|
|
1814
|
-
initString = () => ({ contents: "", textDecoder: new TextDecoder() });
|
|
1815
|
-
useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true });
|
|
1816
|
-
addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk;
|
|
1817
|
-
truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
1818
|
-
getFinalStringChunk = ({ textDecoder }) => {
|
|
1819
|
-
const finalChunk = textDecoder.decode();
|
|
1820
|
-
return finalChunk === "" ? void 0 : finalChunk;
|
|
1821
|
-
};
|
|
1822
|
-
stringMethods = {
|
|
1823
|
-
init: initString,
|
|
1824
|
-
convertChunk: {
|
|
1825
|
-
string: identity,
|
|
1826
|
-
buffer: useTextDecoder,
|
|
1827
|
-
arrayBuffer: useTextDecoder,
|
|
1828
|
-
dataView: useTextDecoder,
|
|
1829
|
-
typedArray: useTextDecoder,
|
|
1830
|
-
others: throwObjectStream
|
|
1831
|
-
},
|
|
1832
|
-
getSize: getLengthProp,
|
|
1833
|
-
truncateChunk: truncateStringChunk,
|
|
1834
|
-
addChunk: addStringChunk,
|
|
1835
|
-
getFinalChunk: getFinalStringChunk,
|
|
1836
|
-
finalize: getContentsProp
|
|
1837
|
-
};
|
|
1838
|
-
}
|
|
1839
|
-
});
|
|
1840
|
-
|
|
1841
|
-
// node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.js
|
|
1842
|
-
var init_source = __esm({
|
|
1843
|
-
"node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.js"() {
|
|
1844
|
-
"use strict";
|
|
1845
|
-
init_array();
|
|
1846
|
-
init_array_buffer();
|
|
1847
|
-
init_buffer();
|
|
1848
|
-
init_string();
|
|
1849
|
-
init_contents();
|
|
1850
|
-
}
|
|
1851
|
-
});
|
|
1852
|
-
|
|
1853
|
-
// node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
|
|
1854
|
-
var require_merge_stream = __commonJS({
|
|
1855
|
-
"node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module2) {
|
|
1856
|
-
"use strict";
|
|
1857
|
-
var { PassThrough } = require("stream");
|
|
1858
|
-
module2.exports = function() {
|
|
1859
|
-
var sources = [];
|
|
1860
|
-
var output = new PassThrough({ objectMode: true });
|
|
1861
|
-
output.setMaxListeners(0);
|
|
1862
|
-
output.add = add;
|
|
1863
|
-
output.isEmpty = isEmpty;
|
|
1864
|
-
output.on("unpipe", remove);
|
|
1865
|
-
Array.prototype.slice.call(arguments).forEach(add);
|
|
1866
|
-
return output;
|
|
1867
|
-
function add(source) {
|
|
1868
|
-
if (Array.isArray(source)) {
|
|
1869
|
-
source.forEach(add);
|
|
1870
|
-
return this;
|
|
1871
|
-
}
|
|
1872
|
-
sources.push(source);
|
|
1873
|
-
source.once("end", remove.bind(null, source));
|
|
1874
|
-
source.once("error", output.emit.bind(output, "error"));
|
|
1875
|
-
source.pipe(output, { end: false });
|
|
1876
|
-
return this;
|
|
1877
|
-
}
|
|
1878
|
-
function isEmpty() {
|
|
1879
|
-
return sources.length == 0;
|
|
1880
|
-
}
|
|
1881
|
-
function remove(source) {
|
|
1882
|
-
sources = sources.filter(function(it) {
|
|
1883
|
-
return it !== source;
|
|
1884
|
-
});
|
|
1885
|
-
if (!sources.length && output.readable) {
|
|
1886
|
-
output.end();
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
};
|
|
1890
|
-
}
|
|
1891
|
-
});
|
|
1892
|
-
|
|
1893
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
|
|
1894
|
-
var import_node_fs2, import_promises, import_merge_stream, validateInputOptions, getInputSync, handleInputSync, getInput, handleInput, makeAllStream, getBufferedData, getStreamPromise, applyEncoding, getSpawnedResult;
|
|
1895
|
-
var init_stream = __esm({
|
|
1896
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js"() {
|
|
1897
|
-
"use strict";
|
|
1898
|
-
import_node_fs2 = require("fs");
|
|
1899
|
-
import_promises = require("timers/promises");
|
|
1900
|
-
init_is_stream();
|
|
1901
|
-
init_source();
|
|
1902
|
-
import_merge_stream = __toESM(require_merge_stream(), 1);
|
|
1903
|
-
validateInputOptions = (input) => {
|
|
1904
|
-
if (input !== void 0) {
|
|
1905
|
-
throw new TypeError("The `input` and `inputFile` options cannot be both set.");
|
|
1906
|
-
}
|
|
1907
|
-
};
|
|
1908
|
-
getInputSync = ({ input, inputFile }) => {
|
|
1909
|
-
if (typeof inputFile !== "string") {
|
|
1910
|
-
return input;
|
|
1911
|
-
}
|
|
1912
|
-
validateInputOptions(input);
|
|
1913
|
-
return (0, import_node_fs2.readFileSync)(inputFile);
|
|
1914
|
-
};
|
|
1915
|
-
handleInputSync = (options) => {
|
|
1916
|
-
const input = getInputSync(options);
|
|
1917
|
-
if (isStream(input)) {
|
|
1918
|
-
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
1919
|
-
}
|
|
1920
|
-
return input;
|
|
1921
|
-
};
|
|
1922
|
-
getInput = ({ input, inputFile }) => {
|
|
1923
|
-
if (typeof inputFile !== "string") {
|
|
1924
|
-
return input;
|
|
1925
|
-
}
|
|
1926
|
-
validateInputOptions(input);
|
|
1927
|
-
return (0, import_node_fs2.createReadStream)(inputFile);
|
|
1928
|
-
};
|
|
1929
|
-
handleInput = (spawned, options) => {
|
|
1930
|
-
const input = getInput(options);
|
|
1931
|
-
if (input === void 0) {
|
|
1932
|
-
return;
|
|
1933
|
-
}
|
|
1934
|
-
if (isStream(input)) {
|
|
1935
|
-
input.pipe(spawned.stdin);
|
|
1936
|
-
} else {
|
|
1937
|
-
spawned.stdin.end(input);
|
|
1938
|
-
}
|
|
1939
|
-
};
|
|
1940
|
-
makeAllStream = (spawned, { all }) => {
|
|
1941
|
-
if (!all || !spawned.stdout && !spawned.stderr) {
|
|
1942
|
-
return;
|
|
1943
|
-
}
|
|
1944
|
-
const mixed = (0, import_merge_stream.default)();
|
|
1945
|
-
if (spawned.stdout) {
|
|
1946
|
-
mixed.add(spawned.stdout);
|
|
1947
|
-
}
|
|
1948
|
-
if (spawned.stderr) {
|
|
1949
|
-
mixed.add(spawned.stderr);
|
|
1950
|
-
}
|
|
1951
|
-
return mixed;
|
|
1952
|
-
};
|
|
1953
|
-
getBufferedData = async (stream, streamPromise) => {
|
|
1954
|
-
if (!stream || streamPromise === void 0) {
|
|
1955
|
-
return;
|
|
1956
|
-
}
|
|
1957
|
-
await (0, import_promises.setTimeout)(0);
|
|
1958
|
-
stream.destroy();
|
|
1959
|
-
try {
|
|
1960
|
-
return await streamPromise;
|
|
1961
|
-
} catch (error) {
|
|
1962
|
-
return error.bufferedData;
|
|
1963
|
-
}
|
|
1964
|
-
};
|
|
1965
|
-
getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
|
|
1966
|
-
if (!stream || !buffer) {
|
|
1967
|
-
return;
|
|
1968
|
-
}
|
|
1969
|
-
if (encoding === "utf8" || encoding === "utf-8") {
|
|
1970
|
-
return getStreamAsString(stream, { maxBuffer });
|
|
1971
|
-
}
|
|
1972
|
-
if (encoding === null || encoding === "buffer") {
|
|
1973
|
-
return getStreamAsBuffer(stream, { maxBuffer });
|
|
1974
|
-
}
|
|
1975
|
-
return applyEncoding(stream, maxBuffer, encoding);
|
|
1976
|
-
};
|
|
1977
|
-
applyEncoding = async (stream, maxBuffer, encoding) => {
|
|
1978
|
-
const buffer = await getStreamAsBuffer(stream, { maxBuffer });
|
|
1979
|
-
return buffer.toString(encoding);
|
|
1980
|
-
};
|
|
1981
|
-
getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
1982
|
-
const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
|
|
1983
|
-
const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
|
|
1984
|
-
const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
|
|
1985
|
-
try {
|
|
1986
|
-
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
1987
|
-
} catch (error) {
|
|
1988
|
-
return Promise.all([
|
|
1989
|
-
{ error, signal: error.signal, timedOut: error.timedOut },
|
|
1990
|
-
getBufferedData(stdout, stdoutPromise),
|
|
1991
|
-
getBufferedData(stderr, stderrPromise),
|
|
1992
|
-
getBufferedData(all, allPromise)
|
|
1993
|
-
]);
|
|
1994
|
-
}
|
|
1995
|
-
};
|
|
1996
|
-
}
|
|
1997
|
-
});
|
|
1998
|
-
|
|
1999
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js
|
|
2000
|
-
var nativePromisePrototype, descriptors, mergePromise, getSpawnedPromise;
|
|
2001
|
-
var init_promise = __esm({
|
|
2002
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js"() {
|
|
2003
|
-
"use strict";
|
|
2004
|
-
nativePromisePrototype = (async () => {
|
|
2005
|
-
})().constructor.prototype;
|
|
2006
|
-
descriptors = ["then", "catch", "finally"].map((property) => [
|
|
2007
|
-
property,
|
|
2008
|
-
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
2009
|
-
]);
|
|
2010
|
-
mergePromise = (spawned, promise) => {
|
|
2011
|
-
for (const [property, descriptor] of descriptors) {
|
|
2012
|
-
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
2013
|
-
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
2014
|
-
}
|
|
2015
|
-
};
|
|
2016
|
-
getSpawnedPromise = (spawned) => new Promise((resolve14, reject) => {
|
|
2017
|
-
spawned.on("exit", (exitCode, signal) => {
|
|
2018
|
-
resolve14({ exitCode, signal });
|
|
2019
|
-
});
|
|
2020
|
-
spawned.on("error", (error) => {
|
|
2021
|
-
reject(error);
|
|
2022
|
-
});
|
|
2023
|
-
if (spawned.stdin) {
|
|
2024
|
-
spawned.stdin.on("error", (error) => {
|
|
2025
|
-
reject(error);
|
|
2026
|
-
});
|
|
2027
|
-
}
|
|
2028
|
-
});
|
|
2029
|
-
}
|
|
2030
|
-
});
|
|
2031
|
-
|
|
2032
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js
|
|
2033
|
-
var import_node_buffer, import_node_child_process2, normalizeArgs, NO_ESCAPE_REGEXP, escapeArg, joinCommand, getEscapedCommand, SPACES_REGEXP, parseCommand, parseExpression, concatTokens, parseTemplate, parseTemplates;
|
|
2034
|
-
var init_command = __esm({
|
|
2035
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js"() {
|
|
2036
|
-
"use strict";
|
|
2037
|
-
import_node_buffer = require("buffer");
|
|
2038
|
-
import_node_child_process2 = require("child_process");
|
|
2039
|
-
normalizeArgs = (file, args = []) => {
|
|
2040
|
-
if (!Array.isArray(args)) {
|
|
2041
|
-
return [file];
|
|
2042
|
-
}
|
|
2043
|
-
return [file, ...args];
|
|
2044
|
-
};
|
|
2045
|
-
NO_ESCAPE_REGEXP = /^[\w.-]+$/;
|
|
2046
|
-
escapeArg = (arg) => {
|
|
2047
|
-
if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
|
|
2048
|
-
return arg;
|
|
2049
|
-
}
|
|
2050
|
-
return `"${arg.replaceAll('"', '\\"')}"`;
|
|
2051
|
-
};
|
|
2052
|
-
joinCommand = (file, args) => normalizeArgs(file, args).join(" ");
|
|
2053
|
-
getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" ");
|
|
2054
|
-
SPACES_REGEXP = / +/g;
|
|
2055
|
-
parseCommand = (command) => {
|
|
2056
|
-
const tokens = [];
|
|
2057
|
-
for (const token of command.trim().split(SPACES_REGEXP)) {
|
|
2058
|
-
const previousToken = tokens.at(-1);
|
|
2059
|
-
if (previousToken && previousToken.endsWith("\\")) {
|
|
2060
|
-
tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
|
|
2061
|
-
} else {
|
|
2062
|
-
tokens.push(token);
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
return tokens;
|
|
2066
|
-
};
|
|
2067
|
-
parseExpression = (expression) => {
|
|
2068
|
-
const typeOfExpression = typeof expression;
|
|
2069
|
-
if (typeOfExpression === "string") {
|
|
2070
|
-
return expression;
|
|
2071
|
-
}
|
|
2072
|
-
if (typeOfExpression === "number") {
|
|
2073
|
-
return String(expression);
|
|
2074
|
-
}
|
|
2075
|
-
if (typeOfExpression === "object" && expression !== null && !(expression instanceof import_node_child_process2.ChildProcess) && "stdout" in expression) {
|
|
2076
|
-
const typeOfStdout = typeof expression.stdout;
|
|
2077
|
-
if (typeOfStdout === "string") {
|
|
2078
|
-
return expression.stdout;
|
|
2079
|
-
}
|
|
2080
|
-
if (import_node_buffer.Buffer.isBuffer(expression.stdout)) {
|
|
2081
|
-
return expression.stdout.toString();
|
|
2082
|
-
}
|
|
2083
|
-
throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
|
|
2084
|
-
}
|
|
2085
|
-
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
2086
|
-
};
|
|
2087
|
-
concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
|
|
2088
|
-
...tokens.slice(0, -1),
|
|
2089
|
-
`${tokens.at(-1)}${nextTokens[0]}`,
|
|
2090
|
-
...nextTokens.slice(1)
|
|
2091
|
-
];
|
|
2092
|
-
parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
2093
|
-
const templateString = template ?? templates.raw[index];
|
|
2094
|
-
const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
|
|
2095
|
-
const newTokens = concatTokens(
|
|
2096
|
-
tokens,
|
|
2097
|
-
templateTokens,
|
|
2098
|
-
templateString.startsWith(" ")
|
|
2099
|
-
);
|
|
2100
|
-
if (index === expressions.length) {
|
|
2101
|
-
return newTokens;
|
|
2102
|
-
}
|
|
2103
|
-
const expression = expressions[index];
|
|
2104
|
-
const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
|
|
2105
|
-
return concatTokens(
|
|
2106
|
-
newTokens,
|
|
2107
|
-
expressionTokens,
|
|
2108
|
-
templateString.endsWith(" ")
|
|
2109
|
-
);
|
|
2110
|
-
};
|
|
2111
|
-
parseTemplates = (templates, expressions) => {
|
|
2112
|
-
let tokens = [];
|
|
2113
|
-
for (const [index, template] of templates.entries()) {
|
|
2114
|
-
tokens = parseTemplate({ templates, expressions, tokens, index, template });
|
|
2115
|
-
}
|
|
2116
|
-
return tokens;
|
|
2117
|
-
};
|
|
2118
|
-
}
|
|
2119
|
-
});
|
|
2120
|
-
|
|
2121
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js
|
|
2122
|
-
var import_node_util, import_node_process3, verboseDefault, padField, getTimestamp, logCommand;
|
|
2123
|
-
var init_verbose = __esm({
|
|
2124
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js"() {
|
|
2125
|
-
"use strict";
|
|
2126
|
-
import_node_util = require("util");
|
|
2127
|
-
import_node_process3 = __toESM(require("process"), 1);
|
|
2128
|
-
verboseDefault = (0, import_node_util.debuglog)("execa").enabled;
|
|
2129
|
-
padField = (field, padding) => String(field).padStart(padding, "0");
|
|
2130
|
-
getTimestamp = () => {
|
|
2131
|
-
const date = /* @__PURE__ */ new Date();
|
|
2132
|
-
return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
|
|
2133
|
-
};
|
|
2134
|
-
logCommand = (escapedCommand, { verbose }) => {
|
|
2135
|
-
if (!verbose) {
|
|
2136
|
-
return;
|
|
2137
|
-
}
|
|
2138
|
-
import_node_process3.default.stderr.write(`[${getTimestamp()}] ${escapedCommand}
|
|
2139
|
-
`);
|
|
2140
|
-
};
|
|
2141
|
-
}
|
|
2142
|
-
});
|
|
2143
|
-
|
|
2144
|
-
// node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
|
|
2145
|
-
var execa_exports = {};
|
|
2146
|
-
__export(execa_exports, {
|
|
2147
|
-
$: () => $,
|
|
2148
|
-
execa: () => execa,
|
|
2149
|
-
execaCommand: () => execaCommand,
|
|
2150
|
-
execaCommandSync: () => execaCommandSync,
|
|
2151
|
-
execaNode: () => execaNode,
|
|
2152
|
-
execaSync: () => execaSync
|
|
2153
|
-
});
|
|
2154
|
-
function execa(file, args, options) {
|
|
2155
|
-
const parsed = handleArguments(file, args, options);
|
|
2156
|
-
const command = joinCommand(file, args);
|
|
2157
|
-
const escapedCommand = getEscapedCommand(file, args);
|
|
2158
|
-
logCommand(escapedCommand, parsed.options);
|
|
2159
|
-
validateTimeout(parsed.options);
|
|
2160
|
-
let spawned;
|
|
2161
|
-
try {
|
|
2162
|
-
spawned = import_node_child_process3.default.spawn(parsed.file, parsed.args, parsed.options);
|
|
2163
|
-
} catch (error) {
|
|
2164
|
-
const dummySpawned = new import_node_child_process3.default.ChildProcess();
|
|
2165
|
-
const errorPromise = Promise.reject(makeError({
|
|
2166
|
-
error,
|
|
2167
|
-
stdout: "",
|
|
2168
|
-
stderr: "",
|
|
2169
|
-
all: "",
|
|
2170
|
-
command,
|
|
2171
|
-
escapedCommand,
|
|
2172
|
-
parsed,
|
|
2173
|
-
timedOut: false,
|
|
2174
|
-
isCanceled: false,
|
|
2175
|
-
killed: false
|
|
2176
|
-
}));
|
|
2177
|
-
mergePromise(dummySpawned, errorPromise);
|
|
2178
|
-
return dummySpawned;
|
|
2179
|
-
}
|
|
2180
|
-
const spawnedPromise = getSpawnedPromise(spawned);
|
|
2181
|
-
const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
|
|
2182
|
-
const processDone = setExitHandler(spawned, parsed.options, timedPromise);
|
|
2183
|
-
const context = { isCanceled: false };
|
|
2184
|
-
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
|
|
2185
|
-
spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
|
2186
|
-
const handlePromise = async () => {
|
|
2187
|
-
const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
|
|
2188
|
-
const stdout = handleOutput(parsed.options, stdoutResult);
|
|
2189
|
-
const stderr = handleOutput(parsed.options, stderrResult);
|
|
2190
|
-
const all = handleOutput(parsed.options, allResult);
|
|
2191
|
-
if (error || exitCode !== 0 || signal !== null) {
|
|
2192
|
-
const returnedError = makeError({
|
|
2193
|
-
error,
|
|
2194
|
-
exitCode,
|
|
2195
|
-
signal,
|
|
2196
|
-
stdout,
|
|
2197
|
-
stderr,
|
|
2198
|
-
all,
|
|
2199
|
-
command,
|
|
2200
|
-
escapedCommand,
|
|
2201
|
-
parsed,
|
|
2202
|
-
timedOut,
|
|
2203
|
-
isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
|
|
2204
|
-
killed: spawned.killed
|
|
2205
|
-
});
|
|
2206
|
-
if (!parsed.options.reject) {
|
|
2207
|
-
return returnedError;
|
|
2208
|
-
}
|
|
2209
|
-
throw returnedError;
|
|
2210
|
-
}
|
|
2211
|
-
return {
|
|
2212
|
-
command,
|
|
2213
|
-
escapedCommand,
|
|
2214
|
-
exitCode: 0,
|
|
2215
|
-
stdout,
|
|
2216
|
-
stderr,
|
|
2217
|
-
all,
|
|
2218
|
-
failed: false,
|
|
2219
|
-
timedOut: false,
|
|
2220
|
-
isCanceled: false,
|
|
2221
|
-
killed: false
|
|
2222
|
-
};
|
|
2223
|
-
};
|
|
2224
|
-
const handlePromiseOnce = onetime_default(handlePromise);
|
|
2225
|
-
handleInput(spawned, parsed.options);
|
|
2226
|
-
spawned.all = makeAllStream(spawned, parsed.options);
|
|
2227
|
-
addPipeMethods(spawned);
|
|
2228
|
-
mergePromise(spawned, handlePromiseOnce);
|
|
2229
|
-
return spawned;
|
|
2230
|
-
}
|
|
2231
|
-
function execaSync(file, args, options) {
|
|
2232
|
-
const parsed = handleArguments(file, args, options);
|
|
2233
|
-
const command = joinCommand(file, args);
|
|
2234
|
-
const escapedCommand = getEscapedCommand(file, args);
|
|
2235
|
-
logCommand(escapedCommand, parsed.options);
|
|
2236
|
-
const input = handleInputSync(parsed.options);
|
|
2237
|
-
let result;
|
|
2238
|
-
try {
|
|
2239
|
-
result = import_node_child_process3.default.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
|
|
2240
|
-
} catch (error) {
|
|
2241
|
-
throw makeError({
|
|
2242
|
-
error,
|
|
2243
|
-
stdout: "",
|
|
2244
|
-
stderr: "",
|
|
2245
|
-
all: "",
|
|
2246
|
-
command,
|
|
2247
|
-
escapedCommand,
|
|
2248
|
-
parsed,
|
|
2249
|
-
timedOut: false,
|
|
2250
|
-
isCanceled: false,
|
|
2251
|
-
killed: false
|
|
2252
|
-
});
|
|
2253
|
-
}
|
|
2254
|
-
const stdout = handleOutput(parsed.options, result.stdout, result.error);
|
|
2255
|
-
const stderr = handleOutput(parsed.options, result.stderr, result.error);
|
|
2256
|
-
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
2257
|
-
const error = makeError({
|
|
2258
|
-
stdout,
|
|
2259
|
-
stderr,
|
|
2260
|
-
error: result.error,
|
|
2261
|
-
signal: result.signal,
|
|
2262
|
-
exitCode: result.status,
|
|
2263
|
-
command,
|
|
2264
|
-
escapedCommand,
|
|
2265
|
-
parsed,
|
|
2266
|
-
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
2267
|
-
isCanceled: false,
|
|
2268
|
-
killed: result.signal !== null
|
|
2269
|
-
});
|
|
2270
|
-
if (!parsed.options.reject) {
|
|
2271
|
-
return error;
|
|
2272
|
-
}
|
|
2273
|
-
throw error;
|
|
2274
|
-
}
|
|
2275
|
-
return {
|
|
2276
|
-
command,
|
|
2277
|
-
escapedCommand,
|
|
2278
|
-
exitCode: 0,
|
|
2279
|
-
stdout,
|
|
2280
|
-
stderr,
|
|
2281
|
-
failed: false,
|
|
2282
|
-
timedOut: false,
|
|
2283
|
-
isCanceled: false,
|
|
2284
|
-
killed: false
|
|
2285
|
-
};
|
|
2286
|
-
}
|
|
2287
|
-
function create$(options) {
|
|
2288
|
-
function $2(templatesOrOptions, ...expressions) {
|
|
2289
|
-
if (!Array.isArray(templatesOrOptions)) {
|
|
2290
|
-
return create$({ ...options, ...templatesOrOptions });
|
|
2291
|
-
}
|
|
2292
|
-
const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
|
|
2293
|
-
return execa(file, args, normalizeScriptOptions(options));
|
|
2294
|
-
}
|
|
2295
|
-
$2.sync = (templates, ...expressions) => {
|
|
2296
|
-
if (!Array.isArray(templates)) {
|
|
2297
|
-
throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
|
|
2298
|
-
}
|
|
2299
|
-
const [file, ...args] = parseTemplates(templates, expressions);
|
|
2300
|
-
return execaSync(file, args, normalizeScriptOptions(options));
|
|
2301
|
-
};
|
|
2302
|
-
return $2;
|
|
2303
|
-
}
|
|
2304
|
-
function execaCommand(command, options) {
|
|
2305
|
-
const [file, ...args] = parseCommand(command);
|
|
2306
|
-
return execa(file, args, options);
|
|
2307
|
-
}
|
|
2308
|
-
function execaCommandSync(command, options) {
|
|
2309
|
-
const [file, ...args] = parseCommand(command);
|
|
2310
|
-
return execaSync(file, args, options);
|
|
2311
|
-
}
|
|
2312
|
-
function execaNode(scriptPath, args, options = {}) {
|
|
2313
|
-
if (args && !Array.isArray(args) && typeof args === "object") {
|
|
2314
|
-
options = args;
|
|
2315
|
-
args = [];
|
|
2316
|
-
}
|
|
2317
|
-
const stdio = normalizeStdioNode(options);
|
|
2318
|
-
const defaultExecArgv = import_node_process4.default.execArgv.filter((arg) => !arg.startsWith("--inspect"));
|
|
2319
|
-
const {
|
|
2320
|
-
nodePath = import_node_process4.default.execPath,
|
|
2321
|
-
nodeOptions = defaultExecArgv
|
|
2322
|
-
} = options;
|
|
2323
|
-
return execa(
|
|
2324
|
-
nodePath,
|
|
2325
|
-
[
|
|
2326
|
-
...nodeOptions,
|
|
2327
|
-
scriptPath,
|
|
2328
|
-
...Array.isArray(args) ? args : []
|
|
2329
|
-
],
|
|
2330
|
-
{
|
|
2331
|
-
...options,
|
|
2332
|
-
stdin: void 0,
|
|
2333
|
-
stdout: void 0,
|
|
2334
|
-
stderr: void 0,
|
|
2335
|
-
stdio,
|
|
2336
|
-
shell: false
|
|
2337
|
-
}
|
|
2338
|
-
);
|
|
2339
|
-
}
|
|
2340
|
-
var import_node_buffer2, import_node_path13, import_node_child_process3, import_node_process4, import_cross_spawn, DEFAULT_MAX_BUFFER, getEnv, handleArguments, handleOutput, normalizeScriptStdin, normalizeScriptOptions, $;
|
|
2341
|
-
var init_execa = __esm({
|
|
2342
|
-
"node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js"() {
|
|
2343
|
-
"use strict";
|
|
2344
|
-
import_node_buffer2 = require("buffer");
|
|
2345
|
-
import_node_path13 = __toESM(require("path"), 1);
|
|
2346
|
-
import_node_child_process3 = __toESM(require("child_process"), 1);
|
|
2347
|
-
import_node_process4 = __toESM(require("process"), 1);
|
|
2348
|
-
import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
2349
|
-
init_strip_final_newline();
|
|
2350
|
-
init_npm_run_path();
|
|
2351
|
-
init_onetime();
|
|
2352
|
-
init_error();
|
|
2353
|
-
init_stdio();
|
|
2354
|
-
init_kill();
|
|
2355
|
-
init_pipe();
|
|
2356
|
-
init_stream();
|
|
2357
|
-
init_promise();
|
|
2358
|
-
init_command();
|
|
2359
|
-
init_verbose();
|
|
2360
|
-
DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
2361
|
-
getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
2362
|
-
const env = extendEnv ? { ...import_node_process4.default.env, ...envOption } : envOption;
|
|
2363
|
-
if (preferLocal) {
|
|
2364
|
-
return npmRunPathEnv({ env, cwd: localDir, execPath });
|
|
2365
|
-
}
|
|
2366
|
-
return env;
|
|
2367
|
-
};
|
|
2368
|
-
handleArguments = (file, args, options = {}) => {
|
|
2369
|
-
const parsed = import_cross_spawn.default._parse(file, args, options);
|
|
2370
|
-
file = parsed.command;
|
|
2371
|
-
args = parsed.args;
|
|
2372
|
-
options = parsed.options;
|
|
2373
|
-
options = {
|
|
2374
|
-
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
2375
|
-
buffer: true,
|
|
2376
|
-
stripFinalNewline: true,
|
|
2377
|
-
extendEnv: true,
|
|
2378
|
-
preferLocal: false,
|
|
2379
|
-
localDir: options.cwd || import_node_process4.default.cwd(),
|
|
2380
|
-
execPath: import_node_process4.default.execPath,
|
|
2381
|
-
encoding: "utf8",
|
|
2382
|
-
reject: true,
|
|
2383
|
-
cleanup: true,
|
|
2384
|
-
all: false,
|
|
2385
|
-
windowsHide: true,
|
|
2386
|
-
verbose: verboseDefault,
|
|
2387
|
-
...options
|
|
2388
|
-
};
|
|
2389
|
-
options.env = getEnv(options);
|
|
2390
|
-
options.stdio = normalizeStdio(options);
|
|
2391
|
-
if (import_node_process4.default.platform === "win32" && import_node_path13.default.basename(file, ".exe") === "cmd") {
|
|
2392
|
-
args.unshift("/q");
|
|
2393
|
-
}
|
|
2394
|
-
return { file, args, options, parsed };
|
|
2395
|
-
};
|
|
2396
|
-
handleOutput = (options, value, error) => {
|
|
2397
|
-
if (typeof value !== "string" && !import_node_buffer2.Buffer.isBuffer(value)) {
|
|
2398
|
-
return error === void 0 ? void 0 : "";
|
|
2399
|
-
}
|
|
2400
|
-
if (options.stripFinalNewline) {
|
|
2401
|
-
return stripFinalNewline(value);
|
|
2402
|
-
}
|
|
2403
|
-
return value;
|
|
2404
|
-
};
|
|
2405
|
-
normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {};
|
|
2406
|
-
normalizeScriptOptions = (options = {}) => ({
|
|
2407
|
-
preferLocal: true,
|
|
2408
|
-
...normalizeScriptStdin(options),
|
|
2409
|
-
...options
|
|
2410
|
-
});
|
|
2411
|
-
$ = create$();
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
2412
17
|
}
|
|
2413
|
-
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
2414
29
|
|
|
2415
30
|
// src/index.ts
|
|
2416
31
|
var src_exports = {};
|
|
@@ -2434,11 +49,11 @@ var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
|
2434
49
|
// src/core/utils/paths.ts
|
|
2435
50
|
var import_node_path = __toESM(require("path"), 1);
|
|
2436
51
|
var import_normalize_path = __toESM(require("normalize-path"), 1);
|
|
2437
|
-
function normalizePath(
|
|
2438
|
-
return (0, import_normalize_path.default)(
|
|
52
|
+
function normalizePath(path9) {
|
|
53
|
+
return (0, import_normalize_path.default)(path9);
|
|
2439
54
|
}
|
|
2440
|
-
function unnormalizePath(
|
|
2441
|
-
return import_node_path.default.normalize(
|
|
55
|
+
function unnormalizePath(path9) {
|
|
56
|
+
return import_node_path.default.normalize(path9);
|
|
2442
57
|
}
|
|
2443
58
|
var CSS_EXTENSIONS = ["css", "scss", "sass", "less", "styl", "stylus"];
|
|
2444
59
|
var CSS_EXTENSIONS_PATTERN = `+(${CSS_EXTENSIONS.join("|")})`;
|
|
@@ -3177,7 +792,7 @@ async function writePathsDeclarationFile(entrypoints) {
|
|
|
3177
792
|
wxt.config.outDir,
|
|
3178
793
|
isHtmlEntrypoint(entry) ? ".html" : ".js"
|
|
3179
794
|
)
|
|
3180
|
-
).concat(await getPublicFiles()).map(normalizePath).map((
|
|
795
|
+
).concat(await getPublicFiles()).map(normalizePath).map((path9) => ` | "/${path9}"`).sort().join("\n");
|
|
3181
796
|
const template = `// Generated by wxt
|
|
3182
797
|
import "wxt/browser";
|
|
3183
798
|
|
|
@@ -3259,7 +874,7 @@ async function writeGlobalsDeclarationFile() {
|
|
|
3259
874
|
"// Generated by wxt",
|
|
3260
875
|
"export {}",
|
|
3261
876
|
"interface ImportMetaEnv {",
|
|
3262
|
-
...globals2.map((
|
|
877
|
+
...globals2.map((global) => ` readonly ${global.name}: ${global.type};`),
|
|
3263
878
|
"}",
|
|
3264
879
|
"interface ImportMeta {",
|
|
3265
880
|
" readonly env: ImportMetaEnv",
|
|
@@ -3285,7 +900,7 @@ async function writeMainDeclarationFile(references) {
|
|
|
3285
900
|
}
|
|
3286
901
|
async function writeTsConfigFile(mainReference) {
|
|
3287
902
|
const dir = wxt.config.wxtDir;
|
|
3288
|
-
const getTsconfigPath = (
|
|
903
|
+
const getTsconfigPath = (path9) => normalizePath((0, import_path3.relative)(dir, path9));
|
|
3289
904
|
const paths = Object.entries(wxt.config.alias).flatMap(([alias, absolutePath]) => {
|
|
3290
905
|
const aliasPath = getTsconfigPath(absolutePath);
|
|
3291
906
|
return [
|
|
@@ -3330,14 +945,14 @@ function createFsCache(wxtDir) {
|
|
|
3330
945
|
const getPath = (key) => (0, import_path4.resolve)(wxtDir, "cache", encodeURIComponent(key));
|
|
3331
946
|
return {
|
|
3332
947
|
async set(key, value) {
|
|
3333
|
-
const
|
|
3334
|
-
await (0, import_fs_extra5.ensureDir)((0, import_path4.dirname)(
|
|
3335
|
-
await writeFileIfDifferent(
|
|
948
|
+
const path9 = getPath(key);
|
|
949
|
+
await (0, import_fs_extra5.ensureDir)((0, import_path4.dirname)(path9));
|
|
950
|
+
await writeFileIfDifferent(path9, value);
|
|
3336
951
|
},
|
|
3337
952
|
async get(key) {
|
|
3338
|
-
const
|
|
953
|
+
const path9 = getPath(key);
|
|
3339
954
|
try {
|
|
3340
|
-
return await import_fs_extra5.default.readFile(
|
|
955
|
+
return await import_fs_extra5.default.readFile(path9, "utf-8");
|
|
3341
956
|
} catch {
|
|
3342
957
|
return void 0;
|
|
3343
958
|
}
|
|
@@ -3400,8 +1015,8 @@ function devHtmlPrerender(config) {
|
|
|
3400
1015
|
return;
|
|
3401
1016
|
const originalUrl = `${server.origin}${ctx.path}`;
|
|
3402
1017
|
const name = getEntrypointName(config.entrypointsDir, ctx.filename);
|
|
3403
|
-
const
|
|
3404
|
-
const serverHtml = await server.transformHtml(
|
|
1018
|
+
const url = `${server.origin}/${name}.html`;
|
|
1019
|
+
const serverHtml = await server.transformHtml(url, html, originalUrl);
|
|
3405
1020
|
const { document } = (0, import_linkedom2.parseHTML)(serverHtml);
|
|
3406
1021
|
const reactRefreshScript = Array.from(
|
|
3407
1022
|
document.querySelectorAll("script[type=module]")
|
|
@@ -3471,13 +1086,13 @@ function pointToDevServer(config, server, id, document, querySelector, attr) {
|
|
|
3471
1086
|
(0, import_node_path4.relative)(config.root, resolvedAbsolutePath)
|
|
3472
1087
|
);
|
|
3473
1088
|
if (relativePath.startsWith(".")) {
|
|
3474
|
-
let
|
|
3475
|
-
if (!
|
|
3476
|
-
|
|
3477
|
-
element.setAttribute(attr, `${server.origin}/@fs${
|
|
1089
|
+
let path9 = normalizePath(resolvedAbsolutePath);
|
|
1090
|
+
if (!path9.startsWith("/"))
|
|
1091
|
+
path9 = "/" + path9;
|
|
1092
|
+
element.setAttribute(attr, `${server.origin}/@fs${path9}`);
|
|
3478
1093
|
} else {
|
|
3479
|
-
const
|
|
3480
|
-
element.setAttribute(attr,
|
|
1094
|
+
const url = new URL(relativePath, server.origin);
|
|
1095
|
+
element.setAttribute(attr, url.href);
|
|
3481
1096
|
}
|
|
3482
1097
|
}
|
|
3483
1098
|
});
|
|
@@ -3548,24 +1163,24 @@ async function isOnline() {
|
|
|
3548
1163
|
const offline = await isOffline();
|
|
3549
1164
|
return !offline;
|
|
3550
1165
|
}
|
|
3551
|
-
async function fetchCached(
|
|
1166
|
+
async function fetchCached(url, config) {
|
|
3552
1167
|
let content = "";
|
|
3553
1168
|
if (await isOnline()) {
|
|
3554
|
-
const res = await fetch(
|
|
1169
|
+
const res = await fetch(url);
|
|
3555
1170
|
if (res.status < 300) {
|
|
3556
1171
|
content = await res.text();
|
|
3557
|
-
await config.fsCache.set(
|
|
1172
|
+
await config.fsCache.set(url, content);
|
|
3558
1173
|
} else {
|
|
3559
1174
|
config.logger.debug(
|
|
3560
|
-
`Failed to download "${
|
|
1175
|
+
`Failed to download "${url}", falling back to cache...`
|
|
3561
1176
|
);
|
|
3562
1177
|
}
|
|
3563
1178
|
}
|
|
3564
1179
|
if (!content)
|
|
3565
|
-
content = await config.fsCache.get(
|
|
1180
|
+
content = await config.fsCache.get(url) ?? "";
|
|
3566
1181
|
if (!content)
|
|
3567
1182
|
throw Error(
|
|
3568
|
-
`Offline and "${
|
|
1183
|
+
`Offline and "${url}" has not been cached. Try again when online.`
|
|
3569
1184
|
);
|
|
3570
1185
|
return content;
|
|
3571
1186
|
}
|
|
@@ -3581,8 +1196,8 @@ function download(config) {
|
|
|
3581
1196
|
async load(id) {
|
|
3582
1197
|
if (!id.startsWith("\0url:"))
|
|
3583
1198
|
return;
|
|
3584
|
-
const
|
|
3585
|
-
return await fetchCached(
|
|
1199
|
+
const url = id.replace("\0url:", "");
|
|
1200
|
+
return await fetchCached(url, config);
|
|
3586
1201
|
}
|
|
3587
1202
|
};
|
|
3588
1203
|
}
|
|
@@ -3770,7 +1385,7 @@ function cssEntrypoints(entrypoint, config) {
|
|
|
3770
1385
|
}
|
|
3771
1386
|
|
|
3772
1387
|
// src/core/builders/vite/plugins/bundleAnalysis.ts
|
|
3773
|
-
var import_rollup_plugin_visualizer = require("rollup-plugin-visualizer");
|
|
1388
|
+
var import_rollup_plugin_visualizer = require("@aklinker1/rollup-plugin-visualizer");
|
|
3774
1389
|
var import_node_path6 = __toESM(require("path"), 1);
|
|
3775
1390
|
var increment = 0;
|
|
3776
1391
|
function bundleAnalysis(config) {
|
|
@@ -3789,8 +1404,8 @@ function globals(config) {
|
|
|
3789
1404
|
name: "wxt:globals",
|
|
3790
1405
|
config() {
|
|
3791
1406
|
const define = {};
|
|
3792
|
-
for (const
|
|
3793
|
-
define[`import.meta.env.${
|
|
1407
|
+
for (const global of getGlobals(config)) {
|
|
1408
|
+
define[`import.meta.env.${global.name}`] = JSON.stringify(global.value);
|
|
3794
1409
|
}
|
|
3795
1410
|
return {
|
|
3796
1411
|
define
|
|
@@ -3833,8 +1448,8 @@ function entrypointGroupGlobals(entrypointGroup) {
|
|
|
3833
1448
|
config() {
|
|
3834
1449
|
const define = {};
|
|
3835
1450
|
let name = Array.isArray(entrypointGroup) ? "html" : entrypointGroup.name;
|
|
3836
|
-
for (const
|
|
3837
|
-
define[`import.meta.env.${
|
|
1451
|
+
for (const global of getEntrypointGlobals(name)) {
|
|
1452
|
+
define[`import.meta.env.${global.name}`] = JSON.stringify(global.value);
|
|
3838
1453
|
}
|
|
3839
1454
|
return {
|
|
3840
1455
|
define
|
|
@@ -4411,16 +2026,16 @@ ${noImports}`;
|
|
|
4411
2026
|
var import_esbuild = require("esbuild");
|
|
4412
2027
|
var import_node_url = require("url");
|
|
4413
2028
|
var import_meta = {};
|
|
4414
|
-
async function importEntrypointFile(
|
|
4415
|
-
wxt.logger.debug("Loading file metadata:",
|
|
4416
|
-
const normalPath = normalizePath(
|
|
2029
|
+
async function importEntrypointFile(path9) {
|
|
2030
|
+
wxt.logger.debug("Loading file metadata:", path9);
|
|
2031
|
+
const normalPath = normalizePath(path9);
|
|
4417
2032
|
const unimport2 = (0, import_unimport3.createUnimport)({
|
|
4418
2033
|
...wxt.config.imports,
|
|
4419
2034
|
// Only allow specific imports, not all from the project
|
|
4420
2035
|
dirs: []
|
|
4421
2036
|
});
|
|
4422
2037
|
await unimport2.init();
|
|
4423
|
-
const text = await import_fs_extra9.default.readFile(
|
|
2038
|
+
const text = await import_fs_extra9.default.readFile(path9, "utf-8");
|
|
4424
2039
|
const textNoImports = removeProjectImportStatements(text);
|
|
4425
2040
|
const { code } = await unimport2.injectImports(textNoImports);
|
|
4426
2041
|
wxt.logger.debug(
|
|
@@ -4463,10 +2078,10 @@ async function importEntrypointFile(path11) {
|
|
|
4463
2078
|
}
|
|
4464
2079
|
);
|
|
4465
2080
|
try {
|
|
4466
|
-
const res = await jiti(
|
|
2081
|
+
const res = await jiti(path9);
|
|
4467
2082
|
return res.default;
|
|
4468
2083
|
} catch (err) {
|
|
4469
|
-
const filePath = (0, import_node_path10.relative)(wxt.config.root,
|
|
2084
|
+
const filePath = (0, import_node_path10.relative)(wxt.config.root, path9);
|
|
4470
2085
|
if (err instanceof ReferenceError) {
|
|
4471
2086
|
const variableName = err.message.replace(" is not defined", "");
|
|
4472
2087
|
throw Error(
|
|
@@ -4608,7 +2223,7 @@ function getChunkSortWeight(filename) {
|
|
|
4608
2223
|
var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
4609
2224
|
|
|
4610
2225
|
// package.json
|
|
4611
|
-
var version = "0.17.2-
|
|
2226
|
+
var version = "0.17.2-alpha6";
|
|
4612
2227
|
|
|
4613
2228
|
// src/core/utils/log/printHeader.ts
|
|
4614
2229
|
var import_consola2 = require("consola");
|
|
@@ -5218,7 +2833,7 @@ async function rebuild(allEntrypoints, entrypointGroups, existingOutput = {
|
|
|
5218
2833
|
}
|
|
5219
2834
|
|
|
5220
2835
|
// src/core/utils/building/internal-build.ts
|
|
5221
|
-
var
|
|
2836
|
+
var import_node_path12 = require("path");
|
|
5222
2837
|
|
|
5223
2838
|
// src/core/utils/validation.ts
|
|
5224
2839
|
function validateEntrypoints(entrypoints) {
|
|
@@ -5281,6 +2896,7 @@ var ValidationError = class extends Error {
|
|
|
5281
2896
|
|
|
5282
2897
|
// src/core/utils/building/internal-build.ts
|
|
5283
2898
|
var import_consola3 = __toESM(require("consola"), 1);
|
|
2899
|
+
var import_rollup_plugin_visualizer2 = require("@aklinker1/rollup-plugin-visualizer");
|
|
5284
2900
|
async function internalBuild() {
|
|
5285
2901
|
await wxt.hooks.callHook("build:before", wxt);
|
|
5286
2902
|
const verb = wxt.config.command === "serve" ? "Pre-rendering" : "Building";
|
|
@@ -5318,7 +2934,7 @@ async function internalBuild() {
|
|
|
5318
2934
|
}
|
|
5319
2935
|
if (wxt.config.analysis.enabled) {
|
|
5320
2936
|
await combineAnalysisStats();
|
|
5321
|
-
const statsPath = (0,
|
|
2937
|
+
const statsPath = (0, import_node_path12.relative)(wxt.config.root, wxt.config.analysis.outputFile);
|
|
5322
2938
|
wxt.logger.info(
|
|
5323
2939
|
`Analysis complete:
|
|
5324
2940
|
${import_picocolors5.default.gray("\u2514\u2500")} ${import_picocolors5.default.yellow(statsPath)}`
|
|
@@ -5332,18 +2948,11 @@ async function combineAnalysisStats() {
|
|
|
5332
2948
|
absolute: true
|
|
5333
2949
|
});
|
|
5334
2950
|
const absolutePaths = unixFiles.map(unnormalizePath);
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
"--template",
|
|
5341
|
-
wxt.config.analysis.template,
|
|
5342
|
-
"--filename",
|
|
5343
|
-
wxt.config.analysis.outputFile
|
|
5344
|
-
],
|
|
5345
|
-
{ cwd: wxt.config.root, stdio: "inherit" }
|
|
5346
|
-
);
|
|
2951
|
+
await (0, import_rollup_plugin_visualizer2.mergeJsonOutputs)({
|
|
2952
|
+
inputs: absolutePaths,
|
|
2953
|
+
template: wxt.config.analysis.template,
|
|
2954
|
+
filename: wxt.config.analysis.outputFile
|
|
2955
|
+
});
|
|
5347
2956
|
if (!wxt.config.analysis.keepArtifacts) {
|
|
5348
2957
|
await Promise.all(absolutePaths.map((statsFile) => import_fs_extra12.default.remove(statsFile)));
|
|
5349
2958
|
}
|
|
@@ -5364,7 +2973,7 @@ function printValidationResults({
|
|
|
5364
2973
|
return map;
|
|
5365
2974
|
}, /* @__PURE__ */ new Map());
|
|
5366
2975
|
Array.from(entrypointErrors.entries()).forEach(([entrypoint, errors2]) => {
|
|
5367
|
-
import_consola3.default.log((0,
|
|
2976
|
+
import_consola3.default.log((0, import_node_path12.relative)(cwd, entrypoint.inputPath));
|
|
5368
2977
|
console.log();
|
|
5369
2978
|
errors2.forEach((err) => {
|
|
5370
2979
|
const type = err.type === "error" ? import_picocolors5.default.red("ERROR") : import_picocolors5.default.yellow("WARN");
|
|
@@ -5376,19 +2985,13 @@ function printValidationResults({
|
|
|
5376
2985
|
}
|
|
5377
2986
|
|
|
5378
2987
|
// src/core/build.ts
|
|
5379
|
-
var import_nypm = require("nypm");
|
|
5380
2988
|
async function build(config) {
|
|
5381
2989
|
await registerWxt("build", config);
|
|
5382
|
-
if (wxt.config.analysis.enabled) {
|
|
5383
|
-
await (0, import_nypm.ensureDependencyInstalled)("rollup-plugin-visualizer", {
|
|
5384
|
-
dev: true
|
|
5385
|
-
});
|
|
5386
|
-
}
|
|
5387
2990
|
return await internalBuild();
|
|
5388
2991
|
}
|
|
5389
2992
|
|
|
5390
2993
|
// src/core/clean.ts
|
|
5391
|
-
var
|
|
2994
|
+
var import_node_path13 = __toESM(require("path"), 1);
|
|
5392
2995
|
var import_fast_glob4 = __toESM(require("fast-glob"), 1);
|
|
5393
2996
|
var import_fs_extra13 = __toESM(require("fs-extra"), 1);
|
|
5394
2997
|
var import_consola4 = require("consola");
|
|
@@ -5403,7 +3006,7 @@ async function clean(root = process.cwd()) {
|
|
|
5403
3006
|
];
|
|
5404
3007
|
import_consola4.consola.debug("Looking for:", tempDirs.map(import_picocolors6.default.cyan).join(", "));
|
|
5405
3008
|
const directories = await (0, import_fast_glob4.default)(tempDirs, {
|
|
5406
|
-
cwd:
|
|
3009
|
+
cwd: import_node_path13.default.resolve(root),
|
|
5407
3010
|
absolute: true,
|
|
5408
3011
|
onlyDirectories: true,
|
|
5409
3012
|
deep: 2
|
|
@@ -5414,11 +3017,11 @@ async function clean(root = process.cwd()) {
|
|
|
5414
3017
|
}
|
|
5415
3018
|
import_consola4.consola.debug(
|
|
5416
3019
|
"Found:",
|
|
5417
|
-
directories.map((dir) => import_picocolors6.default.cyan(
|
|
3020
|
+
directories.map((dir) => import_picocolors6.default.cyan(import_node_path13.default.relative(root, dir))).join(", ")
|
|
5418
3021
|
);
|
|
5419
3022
|
for (const directory of directories) {
|
|
5420
3023
|
await import_fs_extra13.default.rm(directory, { force: true, recursive: true });
|
|
5421
|
-
import_consola4.consola.debug("Deleted " + import_picocolors6.default.cyan(
|
|
3024
|
+
import_consola4.consola.debug("Deleted " + import_picocolors6.default.cyan(import_node_path13.default.relative(root, directory)));
|
|
5422
3025
|
}
|
|
5423
3026
|
}
|
|
5424
3027
|
|
|
@@ -5433,12 +3036,12 @@ function defineRunnerConfig(config) {
|
|
|
5433
3036
|
}
|
|
5434
3037
|
|
|
5435
3038
|
// src/core/runners/wsl.ts
|
|
5436
|
-
var
|
|
3039
|
+
var import_node_path14 = require("path");
|
|
5437
3040
|
function createWslRunner() {
|
|
5438
3041
|
return {
|
|
5439
3042
|
async openBrowser() {
|
|
5440
3043
|
wxt.logger.warn(
|
|
5441
|
-
`Cannot open browser when using WSL. Load "${(0,
|
|
3044
|
+
`Cannot open browser when using WSL. Load "${(0, import_node_path14.relative)(
|
|
5442
3045
|
process.cwd(),
|
|
5443
3046
|
wxt.config.outDir
|
|
5444
3047
|
)}" as an unpacked extension manually`
|
|
@@ -5526,12 +3129,12 @@ var DEFAULT_CHROMIUM_PREFS = {
|
|
|
5526
3129
|
};
|
|
5527
3130
|
|
|
5528
3131
|
// src/core/runners/safari.ts
|
|
5529
|
-
var
|
|
3132
|
+
var import_node_path15 = require("path");
|
|
5530
3133
|
function createSafariRunner() {
|
|
5531
3134
|
return {
|
|
5532
3135
|
async openBrowser() {
|
|
5533
3136
|
wxt.logger.warn(
|
|
5534
|
-
`Cannot Safari using web-ext. Load "${(0,
|
|
3137
|
+
`Cannot Safari using web-ext. Load "${(0, import_node_path15.relative)(
|
|
5535
3138
|
process.cwd(),
|
|
5536
3139
|
wxt.config.outDir
|
|
5537
3140
|
)}" as an unpacked extension manually`
|
|
@@ -5543,12 +3146,12 @@ function createSafariRunner() {
|
|
|
5543
3146
|
}
|
|
5544
3147
|
|
|
5545
3148
|
// src/core/runners/manual.ts
|
|
5546
|
-
var
|
|
3149
|
+
var import_node_path16 = require("path");
|
|
5547
3150
|
function createManualRunner() {
|
|
5548
3151
|
return {
|
|
5549
3152
|
async openBrowser() {
|
|
5550
3153
|
wxt.logger.info(
|
|
5551
|
-
`Load "${(0,
|
|
3154
|
+
`Load "${(0, import_node_path16.relative)(
|
|
5552
3155
|
process.cwd(),
|
|
5553
3156
|
wxt.config.outDir
|
|
5554
3157
|
)}" as an unpacked extension manually`
|
|
@@ -5580,7 +3183,7 @@ async function createExtensionRunner() {
|
|
|
5580
3183
|
var import_consola5 = require("consola");
|
|
5581
3184
|
var import_async_mutex = require("async-mutex");
|
|
5582
3185
|
var import_picocolors7 = __toESM(require("picocolors"), 1);
|
|
5583
|
-
var
|
|
3186
|
+
var import_node_path17 = require("path");
|
|
5584
3187
|
async function createServer(inlineConfig) {
|
|
5585
3188
|
const port = await getPort();
|
|
5586
3189
|
const hostname = "localhost";
|
|
@@ -5626,14 +3229,14 @@ async function createServer(inlineConfig) {
|
|
|
5626
3229
|
await closeAndRecreateRunner();
|
|
5627
3230
|
await buildAndOpenBrowser();
|
|
5628
3231
|
},
|
|
5629
|
-
transformHtml(
|
|
5630
|
-
return builderServer.transformHtml(
|
|
3232
|
+
transformHtml(url, html, originalUrl) {
|
|
3233
|
+
return builderServer.transformHtml(url, html, originalUrl);
|
|
5631
3234
|
},
|
|
5632
3235
|
reloadContentScript(payload) {
|
|
5633
3236
|
server.ws.send("wxt:reload-content-script", payload);
|
|
5634
3237
|
},
|
|
5635
|
-
reloadPage(
|
|
5636
|
-
server.ws.send("wxt:reload-page",
|
|
3238
|
+
reloadPage(path9) {
|
|
3239
|
+
server.ws.send("wxt:reload-page", path9);
|
|
5637
3240
|
},
|
|
5638
3241
|
reloadExtension() {
|
|
5639
3242
|
server.ws.send("wxt:reload-extension");
|
|
@@ -5664,11 +3267,11 @@ async function getPort() {
|
|
|
5664
3267
|
function createFileReloader(server) {
|
|
5665
3268
|
const fileChangedMutex = new import_async_mutex.Mutex();
|
|
5666
3269
|
const changeQueue = [];
|
|
5667
|
-
return async (event,
|
|
3270
|
+
return async (event, path9) => {
|
|
5668
3271
|
await wxt.reloadConfig();
|
|
5669
|
-
if (
|
|
3272
|
+
if (path9.startsWith(wxt.config.outBaseDir))
|
|
5670
3273
|
return;
|
|
5671
|
-
changeQueue.push([event,
|
|
3274
|
+
changeQueue.push([event, path9]);
|
|
5672
3275
|
await fileChangedMutex.runExclusive(async () => {
|
|
5673
3276
|
if (server.currentOutput == null)
|
|
5674
3277
|
return;
|
|
@@ -5689,7 +3292,7 @@ function createFileReloader(server) {
|
|
|
5689
3292
|
return;
|
|
5690
3293
|
}
|
|
5691
3294
|
wxt.logger.info(
|
|
5692
|
-
`Changed: ${Array.from(new Set(fileChanges)).map((file) => import_picocolors7.default.dim((0,
|
|
3295
|
+
`Changed: ${Array.from(new Set(fileChanges)).map((file) => import_picocolors7.default.dim((0, import_node_path17.relative)(wxt.config.root, file))).join(", ")}`
|
|
5693
3296
|
);
|
|
5694
3297
|
const allEntrypoints = await findEntrypoints();
|
|
5695
3298
|
const { output: newOutput } = await rebuild(
|
|
@@ -5747,8 +3350,8 @@ function reloadContentScripts(steps, server) {
|
|
|
5747
3350
|
function reloadHtmlPages(groups, server) {
|
|
5748
3351
|
const htmlEntries = groups.flat().filter(isHtmlEntrypoint);
|
|
5749
3352
|
htmlEntries.forEach((entry) => {
|
|
5750
|
-
const
|
|
5751
|
-
server.reloadPage(
|
|
3353
|
+
const path9 = getEntrypointBundlePath(entry, wxt.config.outDir, ".html");
|
|
3354
|
+
server.reloadPage(path9);
|
|
5752
3355
|
});
|
|
5753
3356
|
return {
|
|
5754
3357
|
reloadedNames: htmlEntries.map((entry) => entry.name)
|
|
@@ -5779,7 +3382,7 @@ var import_prompts = __toESM(require("prompts"), 1);
|
|
|
5779
3382
|
var import_consola6 = require("consola");
|
|
5780
3383
|
var import_giget = require("giget");
|
|
5781
3384
|
var import_fs_extra14 = __toESM(require("fs-extra"), 1);
|
|
5782
|
-
var
|
|
3385
|
+
var import_node_path18 = __toESM(require("path"), 1);
|
|
5783
3386
|
var import_picocolors8 = __toESM(require("picocolors"), 1);
|
|
5784
3387
|
async function initialize(options) {
|
|
5785
3388
|
import_consola6.consola.info("Initalizing new project");
|
|
@@ -5827,7 +3430,7 @@ async function initialize(options) {
|
|
|
5827
3430
|
input.template ??= defaultTemplate;
|
|
5828
3431
|
input.packageManager ??= options.packageManager;
|
|
5829
3432
|
await cloneProject(input);
|
|
5830
|
-
const cdPath =
|
|
3433
|
+
const cdPath = import_node_path18.default.relative(process.cwd(), import_node_path18.default.resolve(input.directory));
|
|
5831
3434
|
console.log();
|
|
5832
3435
|
import_consola6.consola.log(
|
|
5833
3436
|
`\u2728 WXT project created with the ${TEMPLATE_COLORS[input.template.name]?.(input.template.name) ?? input.template.name} template.`
|
|
@@ -5871,8 +3474,8 @@ async function cloneProject({
|
|
|
5871
3474
|
force: true
|
|
5872
3475
|
});
|
|
5873
3476
|
await import_fs_extra14.default.move(
|
|
5874
|
-
|
|
5875
|
-
|
|
3477
|
+
import_node_path18.default.join(directory, "_gitignore"),
|
|
3478
|
+
import_node_path18.default.join(directory, ".gitignore")
|
|
5876
3479
|
).catch(
|
|
5877
3480
|
(err) => import_consola6.consola.warn("Failed to move _gitignore to .gitignore:", err)
|
|
5878
3481
|
);
|
|
@@ -5905,7 +3508,7 @@ async function prepare(config) {
|
|
|
5905
3508
|
|
|
5906
3509
|
// src/core/zip.ts
|
|
5907
3510
|
var import_zip_dir = __toESM(require("zip-dir"), 1);
|
|
5908
|
-
var
|
|
3511
|
+
var import_node_path19 = require("path");
|
|
5909
3512
|
var import_fs_extra15 = __toESM(require("fs-extra"), 1);
|
|
5910
3513
|
var import_minimatch2 = require("minimatch");
|
|
5911
3514
|
async function zip(config) {
|
|
@@ -5915,7 +3518,7 @@ async function zip(config) {
|
|
|
5915
3518
|
wxt.logger.info("Zipping extension...");
|
|
5916
3519
|
const zipFiles = [];
|
|
5917
3520
|
const projectName = wxt.config.zip.name ?? kebabCaseAlphanumeric(
|
|
5918
|
-
(await getPackageJson())?.name || (0,
|
|
3521
|
+
(await getPackageJson())?.name || (0, import_node_path19.dirname)(process.cwd())
|
|
5919
3522
|
);
|
|
5920
3523
|
const applyTemplate = (template) => template.replaceAll("{{name}}", projectName).replaceAll("{{browser}}", wxt.config.browser).replaceAll(
|
|
5921
3524
|
"{{version}}",
|
|
@@ -5923,18 +3526,18 @@ async function zip(config) {
|
|
|
5923
3526
|
).replaceAll("{{manifestVersion}}", `mv${wxt.config.manifestVersion}`);
|
|
5924
3527
|
await import_fs_extra15.default.ensureDir(wxt.config.outBaseDir);
|
|
5925
3528
|
const outZipFilename = applyTemplate(wxt.config.zip.artifactTemplate);
|
|
5926
|
-
const outZipPath = (0,
|
|
3529
|
+
const outZipPath = (0, import_node_path19.resolve)(wxt.config.outBaseDir, outZipFilename);
|
|
5927
3530
|
await (0, import_zip_dir.default)(wxt.config.outDir, {
|
|
5928
3531
|
saveTo: outZipPath
|
|
5929
3532
|
});
|
|
5930
3533
|
zipFiles.push(outZipPath);
|
|
5931
3534
|
if (wxt.config.browser === "firefox") {
|
|
5932
3535
|
const sourcesZipFilename = applyTemplate(wxt.config.zip.sourcesTemplate);
|
|
5933
|
-
const sourcesZipPath = (0,
|
|
3536
|
+
const sourcesZipPath = (0, import_node_path19.resolve)(wxt.config.outBaseDir, sourcesZipFilename);
|
|
5934
3537
|
await (0, import_zip_dir.default)(wxt.config.zip.sourcesRoot, {
|
|
5935
3538
|
saveTo: sourcesZipPath,
|
|
5936
|
-
filter(
|
|
5937
|
-
const relativePath = (0,
|
|
3539
|
+
filter(path9) {
|
|
3540
|
+
const relativePath = (0, import_node_path19.relative)(wxt.config.zip.sourcesRoot, path9);
|
|
5938
3541
|
return wxt.config.zip.includeSources.some(
|
|
5939
3542
|
(pattern) => (0, import_minimatch2.minimatch)(relativePath, pattern)
|
|
5940
3543
|
) || !wxt.config.zip.excludeSources.some(
|