komodo-cli 2.0.4 → 2.0.6
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.
|
@@ -10,2237 +10,41 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
10
10
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
12
|
});
|
|
13
|
-
var
|
|
14
|
-
return
|
|
15
|
-
};
|
|
16
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
-
};
|
|
19
|
-
var __export = (target, all) => {
|
|
20
|
-
for (var name in all)
|
|
21
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
22
|
-
};
|
|
23
|
-
var __copyProps = (to, from, except, desc) => {
|
|
24
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
25
|
-
for (let key of __getOwnPropNames(from))
|
|
26
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
27
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
28
|
-
}
|
|
29
|
-
return to;
|
|
30
|
-
};
|
|
31
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
32
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
33
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
34
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
35
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
36
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
37
|
-
mod
|
|
38
|
-
));
|
|
39
|
-
|
|
40
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js
|
|
41
|
-
import path from "path";
|
|
42
|
-
import { fileURLToPath } from "url";
|
|
43
|
-
var getFilename, getDirname, __dirname;
|
|
44
|
-
var init_esm_shims = __esm({
|
|
45
|
-
"../../node_modules/.pnpm/tsup@8.5.1_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
46
|
-
"use strict";
|
|
47
|
-
getFilename = () => fileURLToPath(import.meta.url);
|
|
48
|
-
getDirname = () => path.dirname(getFilename());
|
|
49
|
-
__dirname = /* @__PURE__ */ getDirname();
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
|
|
54
|
-
var require_windows = __commonJS({
|
|
55
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
|
|
56
|
-
"use strict";
|
|
57
|
-
init_esm_shims();
|
|
58
|
-
module.exports = isexe;
|
|
59
|
-
isexe.sync = sync;
|
|
60
|
-
var fs = __require("fs");
|
|
61
|
-
function checkPathExt(path4, options) {
|
|
62
|
-
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
63
|
-
if (!pathext) {
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
pathext = pathext.split(";");
|
|
67
|
-
if (pathext.indexOf("") !== -1) {
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
for (var i = 0; i < pathext.length; i++) {
|
|
71
|
-
var p = pathext[i].toLowerCase();
|
|
72
|
-
if (p && path4.substr(-p.length).toLowerCase() === p) {
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
function checkStat(stat, path4, options) {
|
|
79
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
return checkPathExt(path4, options);
|
|
83
|
-
}
|
|
84
|
-
function isexe(path4, options, cb) {
|
|
85
|
-
fs.stat(path4, function(er, stat) {
|
|
86
|
-
cb(er, er ? false : checkStat(stat, path4, options));
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function sync(path4, options) {
|
|
90
|
-
return checkStat(fs.statSync(path4), path4, options);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
|
|
96
|
-
var require_mode = __commonJS({
|
|
97
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
|
|
98
|
-
"use strict";
|
|
99
|
-
init_esm_shims();
|
|
100
|
-
module.exports = isexe;
|
|
101
|
-
isexe.sync = sync;
|
|
102
|
-
var fs = __require("fs");
|
|
103
|
-
function isexe(path4, options, cb) {
|
|
104
|
-
fs.stat(path4, function(er, stat) {
|
|
105
|
-
cb(er, er ? false : checkStat(stat, options));
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
function sync(path4, options) {
|
|
109
|
-
return checkStat(fs.statSync(path4), options);
|
|
110
|
-
}
|
|
111
|
-
function checkStat(stat, options) {
|
|
112
|
-
return stat.isFile() && checkMode(stat, options);
|
|
113
|
-
}
|
|
114
|
-
function checkMode(stat, options) {
|
|
115
|
-
var mod = stat.mode;
|
|
116
|
-
var uid = stat.uid;
|
|
117
|
-
var gid = stat.gid;
|
|
118
|
-
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
119
|
-
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
120
|
-
var u = parseInt("100", 8);
|
|
121
|
-
var g = parseInt("010", 8);
|
|
122
|
-
var o = parseInt("001", 8);
|
|
123
|
-
var ug = u | g;
|
|
124
|
-
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
125
|
-
return ret;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
|
|
131
|
-
var require_isexe = __commonJS({
|
|
132
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
|
|
133
|
-
"use strict";
|
|
134
|
-
init_esm_shims();
|
|
135
|
-
var fs = __require("fs");
|
|
136
|
-
var core;
|
|
137
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
138
|
-
core = require_windows();
|
|
139
|
-
} else {
|
|
140
|
-
core = require_mode();
|
|
141
|
-
}
|
|
142
|
-
module.exports = isexe;
|
|
143
|
-
isexe.sync = sync;
|
|
144
|
-
function isexe(path4, options, cb) {
|
|
145
|
-
if (typeof options === "function") {
|
|
146
|
-
cb = options;
|
|
147
|
-
options = {};
|
|
148
|
-
}
|
|
149
|
-
if (!cb) {
|
|
150
|
-
if (typeof Promise !== "function") {
|
|
151
|
-
throw new TypeError("callback not provided");
|
|
152
|
-
}
|
|
153
|
-
return new Promise(function(resolve2, reject) {
|
|
154
|
-
isexe(path4, options || {}, function(er, is) {
|
|
155
|
-
if (er) {
|
|
156
|
-
reject(er);
|
|
157
|
-
} else {
|
|
158
|
-
resolve2(is);
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
core(path4, options || {}, function(er, is) {
|
|
164
|
-
if (er) {
|
|
165
|
-
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
166
|
-
er = null;
|
|
167
|
-
is = false;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
cb(er, is);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
function sync(path4, options) {
|
|
174
|
-
try {
|
|
175
|
-
return core.sync(path4, options || {});
|
|
176
|
-
} catch (er) {
|
|
177
|
-
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
178
|
-
return false;
|
|
179
|
-
} else {
|
|
180
|
-
throw er;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
// ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
188
|
-
var require_which = __commonJS({
|
|
189
|
-
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
|
|
190
|
-
"use strict";
|
|
191
|
-
init_esm_shims();
|
|
192
|
-
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
193
|
-
var path4 = __require("path");
|
|
194
|
-
var COLON = isWindows ? ";" : ":";
|
|
195
|
-
var isexe = require_isexe();
|
|
196
|
-
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
197
|
-
var getPathInfo = (cmd, opt) => {
|
|
198
|
-
const colon = opt.colon || COLON;
|
|
199
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
200
|
-
// windows always checks the cwd first
|
|
201
|
-
...isWindows ? [process.cwd()] : [],
|
|
202
|
-
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
203
|
-
"").split(colon)
|
|
204
|
-
];
|
|
205
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
206
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
207
|
-
if (isWindows) {
|
|
208
|
-
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
209
|
-
pathExt.unshift("");
|
|
210
|
-
}
|
|
211
|
-
return {
|
|
212
|
-
pathEnv,
|
|
213
|
-
pathExt,
|
|
214
|
-
pathExtExe
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
var which = (cmd, opt, cb) => {
|
|
218
|
-
if (typeof opt === "function") {
|
|
219
|
-
cb = opt;
|
|
220
|
-
opt = {};
|
|
221
|
-
}
|
|
222
|
-
if (!opt)
|
|
223
|
-
opt = {};
|
|
224
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
225
|
-
const found = [];
|
|
226
|
-
const step = (i) => new Promise((resolve2, reject) => {
|
|
227
|
-
if (i === pathEnv.length)
|
|
228
|
-
return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
|
|
229
|
-
const ppRaw = pathEnv[i];
|
|
230
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
231
|
-
const pCmd = path4.join(pathPart, cmd);
|
|
232
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
233
|
-
resolve2(subStep(p, i, 0));
|
|
234
|
-
});
|
|
235
|
-
const subStep = (p, i, ii) => new Promise((resolve2, reject) => {
|
|
236
|
-
if (ii === pathExt.length)
|
|
237
|
-
return resolve2(step(i + 1));
|
|
238
|
-
const ext = pathExt[ii];
|
|
239
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
240
|
-
if (!er && is) {
|
|
241
|
-
if (opt.all)
|
|
242
|
-
found.push(p + ext);
|
|
243
|
-
else
|
|
244
|
-
return resolve2(p + ext);
|
|
245
|
-
}
|
|
246
|
-
return resolve2(subStep(p, i, ii + 1));
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
250
|
-
};
|
|
251
|
-
var whichSync = (cmd, opt) => {
|
|
252
|
-
opt = opt || {};
|
|
253
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
254
|
-
const found = [];
|
|
255
|
-
for (let i = 0; i < pathEnv.length; i++) {
|
|
256
|
-
const ppRaw = pathEnv[i];
|
|
257
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
258
|
-
const pCmd = path4.join(pathPart, cmd);
|
|
259
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
260
|
-
for (let j = 0; j < pathExt.length; j++) {
|
|
261
|
-
const cur = p + pathExt[j];
|
|
262
|
-
try {
|
|
263
|
-
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
264
|
-
if (is) {
|
|
265
|
-
if (opt.all)
|
|
266
|
-
found.push(cur);
|
|
267
|
-
else
|
|
268
|
-
return cur;
|
|
269
|
-
}
|
|
270
|
-
} catch (ex) {
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if (opt.all && found.length)
|
|
275
|
-
return found;
|
|
276
|
-
if (opt.nothrow)
|
|
277
|
-
return null;
|
|
278
|
-
throw getNotFoundError(cmd);
|
|
279
|
-
};
|
|
280
|
-
module.exports = which;
|
|
281
|
-
which.sync = whichSync;
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
// ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
|
|
286
|
-
var require_path_key = __commonJS({
|
|
287
|
-
"../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module) {
|
|
288
|
-
"use strict";
|
|
289
|
-
init_esm_shims();
|
|
290
|
-
var pathKey2 = (options = {}) => {
|
|
291
|
-
const environment = options.env || process.env;
|
|
292
|
-
const platform = options.platform || process.platform;
|
|
293
|
-
if (platform !== "win32") {
|
|
294
|
-
return "PATH";
|
|
295
|
-
}
|
|
296
|
-
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
297
|
-
};
|
|
298
|
-
module.exports = pathKey2;
|
|
299
|
-
module.exports.default = pathKey2;
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
304
|
-
var require_resolveCommand = __commonJS({
|
|
305
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
306
|
-
"use strict";
|
|
307
|
-
init_esm_shims();
|
|
308
|
-
var path4 = __require("path");
|
|
309
|
-
var which = require_which();
|
|
310
|
-
var getPathKey = require_path_key();
|
|
311
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
312
|
-
const env = parsed.options.env || process.env;
|
|
313
|
-
const cwd = process.cwd();
|
|
314
|
-
const hasCustomCwd = parsed.options.cwd != null;
|
|
315
|
-
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
316
|
-
if (shouldSwitchCwd) {
|
|
317
|
-
try {
|
|
318
|
-
process.chdir(parsed.options.cwd);
|
|
319
|
-
} catch (err) {
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
let resolved;
|
|
323
|
-
try {
|
|
324
|
-
resolved = which.sync(parsed.command, {
|
|
325
|
-
path: env[getPathKey({ env })],
|
|
326
|
-
pathExt: withoutPathExt ? path4.delimiter : void 0
|
|
327
|
-
});
|
|
328
|
-
} catch (e) {
|
|
329
|
-
} finally {
|
|
330
|
-
if (shouldSwitchCwd) {
|
|
331
|
-
process.chdir(cwd);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
if (resolved) {
|
|
335
|
-
resolved = path4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
336
|
-
}
|
|
337
|
-
return resolved;
|
|
338
|
-
}
|
|
339
|
-
function resolveCommand(parsed) {
|
|
340
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
341
|
-
}
|
|
342
|
-
module.exports = resolveCommand;
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
|
|
347
|
-
var require_escape = __commonJS({
|
|
348
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
|
|
349
|
-
"use strict";
|
|
350
|
-
init_esm_shims();
|
|
351
|
-
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
352
|
-
function escapeCommand(arg) {
|
|
353
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
354
|
-
return arg;
|
|
355
|
-
}
|
|
356
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
357
|
-
arg = `${arg}`;
|
|
358
|
-
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
359
|
-
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
360
|
-
arg = `"${arg}"`;
|
|
361
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
362
|
-
if (doubleEscapeMetaChars) {
|
|
363
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
364
|
-
}
|
|
365
|
-
return arg;
|
|
366
|
-
}
|
|
367
|
-
module.exports.command = escapeCommand;
|
|
368
|
-
module.exports.argument = escapeArgument;
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
// ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
|
|
373
|
-
var require_shebang_regex = __commonJS({
|
|
374
|
-
"../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module) {
|
|
375
|
-
"use strict";
|
|
376
|
-
init_esm_shims();
|
|
377
|
-
module.exports = /^#!(.*)/;
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
// ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
|
|
382
|
-
var require_shebang_command = __commonJS({
|
|
383
|
-
"../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module) {
|
|
384
|
-
"use strict";
|
|
385
|
-
init_esm_shims();
|
|
386
|
-
var shebangRegex = require_shebang_regex();
|
|
387
|
-
module.exports = (string = "") => {
|
|
388
|
-
const match = string.match(shebangRegex);
|
|
389
|
-
if (!match) {
|
|
390
|
-
return null;
|
|
391
|
-
}
|
|
392
|
-
const [path4, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
393
|
-
const binary = path4.split("/").pop();
|
|
394
|
-
if (binary === "env") {
|
|
395
|
-
return argument;
|
|
396
|
-
}
|
|
397
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
403
|
-
var require_readShebang = __commonJS({
|
|
404
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
405
|
-
"use strict";
|
|
406
|
-
init_esm_shims();
|
|
407
|
-
var fs = __require("fs");
|
|
408
|
-
var shebangCommand = require_shebang_command();
|
|
409
|
-
function readShebang(command) {
|
|
410
|
-
const size = 150;
|
|
411
|
-
const buffer = Buffer.alloc(size);
|
|
412
|
-
let fd;
|
|
413
|
-
try {
|
|
414
|
-
fd = fs.openSync(command, "r");
|
|
415
|
-
fs.readSync(fd, buffer, 0, size, 0);
|
|
416
|
-
fs.closeSync(fd);
|
|
417
|
-
} catch (e) {
|
|
418
|
-
}
|
|
419
|
-
return shebangCommand(buffer.toString());
|
|
420
|
-
}
|
|
421
|
-
module.exports = readShebang;
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
426
|
-
var require_parse = __commonJS({
|
|
427
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
428
|
-
"use strict";
|
|
429
|
-
init_esm_shims();
|
|
430
|
-
var path4 = __require("path");
|
|
431
|
-
var resolveCommand = require_resolveCommand();
|
|
432
|
-
var escape = require_escape();
|
|
433
|
-
var readShebang = require_readShebang();
|
|
434
|
-
var isWin = process.platform === "win32";
|
|
435
|
-
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
436
|
-
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
437
|
-
function detectShebang(parsed) {
|
|
438
|
-
parsed.file = resolveCommand(parsed);
|
|
439
|
-
const shebang = parsed.file && readShebang(parsed.file);
|
|
440
|
-
if (shebang) {
|
|
441
|
-
parsed.args.unshift(parsed.file);
|
|
442
|
-
parsed.command = shebang;
|
|
443
|
-
return resolveCommand(parsed);
|
|
444
|
-
}
|
|
445
|
-
return parsed.file;
|
|
446
|
-
}
|
|
447
|
-
function parseNonShell(parsed) {
|
|
448
|
-
if (!isWin) {
|
|
449
|
-
return parsed;
|
|
450
|
-
}
|
|
451
|
-
const commandFile = detectShebang(parsed);
|
|
452
|
-
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
453
|
-
if (parsed.options.forceShell || needsShell) {
|
|
454
|
-
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
455
|
-
parsed.command = path4.normalize(parsed.command);
|
|
456
|
-
parsed.command = escape.command(parsed.command);
|
|
457
|
-
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
458
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
459
|
-
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
460
|
-
parsed.command = process.env.comspec || "cmd.exe";
|
|
461
|
-
parsed.options.windowsVerbatimArguments = true;
|
|
462
|
-
}
|
|
463
|
-
return parsed;
|
|
464
|
-
}
|
|
465
|
-
function parse(command, args, options) {
|
|
466
|
-
if (args && !Array.isArray(args)) {
|
|
467
|
-
options = args;
|
|
468
|
-
args = null;
|
|
469
|
-
}
|
|
470
|
-
args = args ? args.slice(0) : [];
|
|
471
|
-
options = Object.assign({}, options);
|
|
472
|
-
const parsed = {
|
|
473
|
-
command,
|
|
474
|
-
args,
|
|
475
|
-
options,
|
|
476
|
-
file: void 0,
|
|
477
|
-
original: {
|
|
478
|
-
command,
|
|
479
|
-
args
|
|
480
|
-
}
|
|
481
|
-
};
|
|
482
|
-
return options.shell ? parsed : parseNonShell(parsed);
|
|
483
|
-
}
|
|
484
|
-
module.exports = parse;
|
|
485
|
-
}
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
|
|
489
|
-
var require_enoent = __commonJS({
|
|
490
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module) {
|
|
491
|
-
"use strict";
|
|
492
|
-
init_esm_shims();
|
|
493
|
-
var isWin = process.platform === "win32";
|
|
494
|
-
function notFoundError(original, syscall) {
|
|
495
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
496
|
-
code: "ENOENT",
|
|
497
|
-
errno: "ENOENT",
|
|
498
|
-
syscall: `${syscall} ${original.command}`,
|
|
499
|
-
path: original.command,
|
|
500
|
-
spawnargs: original.args
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
function hookChildProcess(cp, parsed) {
|
|
504
|
-
if (!isWin) {
|
|
505
|
-
return;
|
|
506
|
-
}
|
|
507
|
-
const originalEmit = cp.emit;
|
|
508
|
-
cp.emit = function(name, arg1) {
|
|
509
|
-
if (name === "exit") {
|
|
510
|
-
const err = verifyENOENT(arg1, parsed);
|
|
511
|
-
if (err) {
|
|
512
|
-
return originalEmit.call(cp, "error", err);
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
return originalEmit.apply(cp, arguments);
|
|
516
|
-
};
|
|
517
|
-
}
|
|
518
|
-
function verifyENOENT(status, parsed) {
|
|
519
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
520
|
-
return notFoundError(parsed.original, "spawn");
|
|
521
|
-
}
|
|
522
|
-
return null;
|
|
523
|
-
}
|
|
524
|
-
function verifyENOENTSync(status, parsed) {
|
|
525
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
526
|
-
return notFoundError(parsed.original, "spawnSync");
|
|
527
|
-
}
|
|
528
|
-
return null;
|
|
529
|
-
}
|
|
530
|
-
module.exports = {
|
|
531
|
-
hookChildProcess,
|
|
532
|
-
verifyENOENT,
|
|
533
|
-
verifyENOENTSync,
|
|
534
|
-
notFoundError
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
|
|
540
|
-
var require_cross_spawn = __commonJS({
|
|
541
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
|
|
542
|
-
"use strict";
|
|
543
|
-
init_esm_shims();
|
|
544
|
-
var cp = __require("child_process");
|
|
545
|
-
var parse = require_parse();
|
|
546
|
-
var enoent = require_enoent();
|
|
547
|
-
function spawn(command, args, options) {
|
|
548
|
-
const parsed = parse(command, args, options);
|
|
549
|
-
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
550
|
-
enoent.hookChildProcess(spawned, parsed);
|
|
551
|
-
return spawned;
|
|
552
|
-
}
|
|
553
|
-
function spawnSync(command, args, options) {
|
|
554
|
-
const parsed = parse(command, args, options);
|
|
555
|
-
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
556
|
-
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
557
|
-
return result;
|
|
558
|
-
}
|
|
559
|
-
module.exports = spawn;
|
|
560
|
-
module.exports.spawn = spawn;
|
|
561
|
-
module.exports.sync = spawnSync;
|
|
562
|
-
module.exports._parse = parse;
|
|
563
|
-
module.exports._enoent = enoent;
|
|
564
|
-
}
|
|
565
|
-
});
|
|
566
|
-
|
|
567
|
-
// ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
|
|
568
|
-
var require_merge_stream = __commonJS({
|
|
569
|
-
"../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module) {
|
|
570
|
-
"use strict";
|
|
571
|
-
init_esm_shims();
|
|
572
|
-
var { PassThrough } = __require("stream");
|
|
573
|
-
module.exports = function() {
|
|
574
|
-
var sources = [];
|
|
575
|
-
var output = new PassThrough({ objectMode: true });
|
|
576
|
-
output.setMaxListeners(0);
|
|
577
|
-
output.add = add;
|
|
578
|
-
output.isEmpty = isEmpty;
|
|
579
|
-
output.on("unpipe", remove);
|
|
580
|
-
Array.prototype.slice.call(arguments).forEach(add);
|
|
581
|
-
return output;
|
|
582
|
-
function add(source) {
|
|
583
|
-
if (Array.isArray(source)) {
|
|
584
|
-
source.forEach(add);
|
|
585
|
-
return this;
|
|
586
|
-
}
|
|
587
|
-
sources.push(source);
|
|
588
|
-
source.once("end", remove.bind(null, source));
|
|
589
|
-
source.once("error", output.emit.bind(output, "error"));
|
|
590
|
-
source.pipe(output, { end: false });
|
|
591
|
-
return this;
|
|
592
|
-
}
|
|
593
|
-
function isEmpty() {
|
|
594
|
-
return sources.length == 0;
|
|
595
|
-
}
|
|
596
|
-
function remove(source) {
|
|
597
|
-
sources = sources.filter(function(it) {
|
|
598
|
-
return it !== source;
|
|
599
|
-
});
|
|
600
|
-
if (!sources.length && output.readable) {
|
|
601
|
-
output.end();
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
|
|
608
|
-
// ../core/dist/index.js
|
|
609
|
-
init_esm_shims();
|
|
610
|
-
import { randomUUID as randomUUID2 } from "crypto";
|
|
611
|
-
import { mkdir as mkdir3 } from "fs/promises";
|
|
612
|
-
import { existsSync as existsSync3 } from "fs";
|
|
613
|
-
import { resolve } from "path";
|
|
614
|
-
import { execSync } from "child_process";
|
|
615
|
-
import os2 from "os";
|
|
616
|
-
|
|
617
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
|
|
618
|
-
init_esm_shims();
|
|
619
|
-
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
620
|
-
import { Buffer as Buffer3 } from "buffer";
|
|
621
|
-
import path3 from "path";
|
|
622
|
-
import childProcess from "child_process";
|
|
623
|
-
import process6 from "process";
|
|
624
|
-
|
|
625
|
-
// ../../node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
|
|
626
|
-
init_esm_shims();
|
|
627
|
-
function stripFinalNewline(input) {
|
|
628
|
-
const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
|
|
629
|
-
const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
|
|
630
|
-
if (input[input.length - 1] === LF) {
|
|
631
|
-
input = input.slice(0, -1);
|
|
632
|
-
}
|
|
633
|
-
if (input[input.length - 1] === CR) {
|
|
634
|
-
input = input.slice(0, -1);
|
|
635
|
-
}
|
|
636
|
-
return input;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
// ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
|
|
640
|
-
init_esm_shims();
|
|
641
|
-
import process2 from "process";
|
|
642
|
-
import path2 from "path";
|
|
643
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
644
|
-
|
|
645
|
-
// ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
646
|
-
init_esm_shims();
|
|
647
|
-
function pathKey(options = {}) {
|
|
648
|
-
const {
|
|
649
|
-
env = process.env,
|
|
650
|
-
platform = process.platform
|
|
651
|
-
} = options;
|
|
652
|
-
if (platform !== "win32") {
|
|
653
|
-
return "PATH";
|
|
654
|
-
}
|
|
655
|
-
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
// ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
|
|
659
|
-
var npmRunPath = ({
|
|
660
|
-
cwd = process2.cwd(),
|
|
661
|
-
path: pathOption = process2.env[pathKey()],
|
|
662
|
-
preferLocal = true,
|
|
663
|
-
execPath = process2.execPath,
|
|
664
|
-
addExecPath = true
|
|
665
|
-
} = {}) => {
|
|
666
|
-
const cwdString = cwd instanceof URL ? fileURLToPath2(cwd) : cwd;
|
|
667
|
-
const cwdPath = path2.resolve(cwdString);
|
|
668
|
-
const result = [];
|
|
669
|
-
if (preferLocal) {
|
|
670
|
-
applyPreferLocal(result, cwdPath);
|
|
671
|
-
}
|
|
672
|
-
if (addExecPath) {
|
|
673
|
-
applyExecPath(result, execPath, cwdPath);
|
|
674
|
-
}
|
|
675
|
-
return [...result, pathOption].join(path2.delimiter);
|
|
676
|
-
};
|
|
677
|
-
var applyPreferLocal = (result, cwdPath) => {
|
|
678
|
-
let previous;
|
|
679
|
-
while (previous !== cwdPath) {
|
|
680
|
-
result.push(path2.join(cwdPath, "node_modules/.bin"));
|
|
681
|
-
previous = cwdPath;
|
|
682
|
-
cwdPath = path2.resolve(cwdPath, "..");
|
|
683
|
-
}
|
|
684
|
-
};
|
|
685
|
-
var applyExecPath = (result, execPath, cwdPath) => {
|
|
686
|
-
const execPathString = execPath instanceof URL ? fileURLToPath2(execPath) : execPath;
|
|
687
|
-
result.push(path2.resolve(cwdPath, execPathString, ".."));
|
|
688
|
-
};
|
|
689
|
-
var npmRunPathEnv = ({ env = process2.env, ...options } = {}) => {
|
|
690
|
-
env = { ...env };
|
|
691
|
-
const pathName = pathKey({ env });
|
|
692
|
-
options.path = env[pathName];
|
|
693
|
-
env[pathName] = npmRunPath(options);
|
|
694
|
-
return env;
|
|
695
|
-
};
|
|
696
|
-
|
|
697
|
-
// ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
|
|
698
|
-
init_esm_shims();
|
|
699
|
-
|
|
700
|
-
// ../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
|
|
701
|
-
init_esm_shims();
|
|
702
|
-
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
703
|
-
if (property === "length" || property === "prototype") {
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
if (property === "arguments" || property === "caller") {
|
|
707
|
-
return;
|
|
708
|
-
}
|
|
709
|
-
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
710
|
-
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
711
|
-
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
712
|
-
return;
|
|
713
|
-
}
|
|
714
|
-
Object.defineProperty(to, property, fromDescriptor);
|
|
715
|
-
};
|
|
716
|
-
var canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
717
|
-
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
718
|
-
};
|
|
719
|
-
var changePrototype = (to, from) => {
|
|
720
|
-
const fromPrototype = Object.getPrototypeOf(from);
|
|
721
|
-
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
722
|
-
return;
|
|
723
|
-
}
|
|
724
|
-
Object.setPrototypeOf(to, fromPrototype);
|
|
725
|
-
};
|
|
726
|
-
var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
727
|
-
${fromBody}`;
|
|
728
|
-
var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
729
|
-
var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
730
|
-
var changeToString = (to, from, name) => {
|
|
731
|
-
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
732
|
-
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
733
|
-
Object.defineProperty(newToString, "name", toStringName);
|
|
734
|
-
Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
|
|
735
|
-
};
|
|
736
|
-
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
737
|
-
const { name } = to;
|
|
738
|
-
for (const property of Reflect.ownKeys(from)) {
|
|
739
|
-
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
740
|
-
}
|
|
741
|
-
changePrototype(to, from);
|
|
742
|
-
changeToString(to, from, name);
|
|
743
|
-
return to;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
// ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
|
|
747
|
-
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
748
|
-
var onetime = (function_, options = {}) => {
|
|
749
|
-
if (typeof function_ !== "function") {
|
|
750
|
-
throw new TypeError("Expected a function");
|
|
751
|
-
}
|
|
752
|
-
let returnValue;
|
|
753
|
-
let callCount = 0;
|
|
754
|
-
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
755
|
-
const onetime2 = function(...arguments_) {
|
|
756
|
-
calledFunctions.set(onetime2, ++callCount);
|
|
757
|
-
if (callCount === 1) {
|
|
758
|
-
returnValue = function_.apply(this, arguments_);
|
|
759
|
-
function_ = null;
|
|
760
|
-
} else if (options.throw === true) {
|
|
761
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
762
|
-
}
|
|
763
|
-
return returnValue;
|
|
764
|
-
};
|
|
765
|
-
mimicFunction(onetime2, function_);
|
|
766
|
-
calledFunctions.set(onetime2, callCount);
|
|
767
|
-
return onetime2;
|
|
768
|
-
};
|
|
769
|
-
onetime.callCount = (function_) => {
|
|
770
|
-
if (!calledFunctions.has(function_)) {
|
|
771
|
-
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
772
|
-
}
|
|
773
|
-
return calledFunctions.get(function_);
|
|
774
|
-
};
|
|
775
|
-
var onetime_default = onetime;
|
|
776
|
-
|
|
777
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
|
|
778
|
-
init_esm_shims();
|
|
779
|
-
import process3 from "process";
|
|
780
|
-
|
|
781
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
|
|
782
|
-
init_esm_shims();
|
|
783
|
-
import { constants as constants2 } from "os";
|
|
784
|
-
|
|
785
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js
|
|
786
|
-
init_esm_shims();
|
|
787
|
-
var getRealtimeSignals = () => {
|
|
788
|
-
const length = SIGRTMAX - SIGRTMIN + 1;
|
|
789
|
-
return Array.from({ length }, getRealtimeSignal);
|
|
790
|
-
};
|
|
791
|
-
var getRealtimeSignal = (value, index) => ({
|
|
792
|
-
name: `SIGRT${index + 1}`,
|
|
793
|
-
number: SIGRTMIN + index,
|
|
794
|
-
action: "terminate",
|
|
795
|
-
description: "Application-specific signal (realtime)",
|
|
796
|
-
standard: "posix"
|
|
797
|
-
});
|
|
798
|
-
var SIGRTMIN = 34;
|
|
799
|
-
var SIGRTMAX = 64;
|
|
800
|
-
|
|
801
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
|
|
802
|
-
init_esm_shims();
|
|
803
|
-
import { constants } from "os";
|
|
804
|
-
|
|
805
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js
|
|
806
|
-
init_esm_shims();
|
|
807
|
-
var SIGNALS = [
|
|
808
|
-
{
|
|
809
|
-
name: "SIGHUP",
|
|
810
|
-
number: 1,
|
|
811
|
-
action: "terminate",
|
|
812
|
-
description: "Terminal closed",
|
|
813
|
-
standard: "posix"
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
name: "SIGINT",
|
|
817
|
-
number: 2,
|
|
818
|
-
action: "terminate",
|
|
819
|
-
description: "User interruption with CTRL-C",
|
|
820
|
-
standard: "ansi"
|
|
821
|
-
},
|
|
822
|
-
{
|
|
823
|
-
name: "SIGQUIT",
|
|
824
|
-
number: 3,
|
|
825
|
-
action: "core",
|
|
826
|
-
description: "User interruption with CTRL-\\",
|
|
827
|
-
standard: "posix"
|
|
828
|
-
},
|
|
829
|
-
{
|
|
830
|
-
name: "SIGILL",
|
|
831
|
-
number: 4,
|
|
832
|
-
action: "core",
|
|
833
|
-
description: "Invalid machine instruction",
|
|
834
|
-
standard: "ansi"
|
|
835
|
-
},
|
|
836
|
-
{
|
|
837
|
-
name: "SIGTRAP",
|
|
838
|
-
number: 5,
|
|
839
|
-
action: "core",
|
|
840
|
-
description: "Debugger breakpoint",
|
|
841
|
-
standard: "posix"
|
|
842
|
-
},
|
|
843
|
-
{
|
|
844
|
-
name: "SIGABRT",
|
|
845
|
-
number: 6,
|
|
846
|
-
action: "core",
|
|
847
|
-
description: "Aborted",
|
|
848
|
-
standard: "ansi"
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
name: "SIGIOT",
|
|
852
|
-
number: 6,
|
|
853
|
-
action: "core",
|
|
854
|
-
description: "Aborted",
|
|
855
|
-
standard: "bsd"
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
name: "SIGBUS",
|
|
859
|
-
number: 7,
|
|
860
|
-
action: "core",
|
|
861
|
-
description: "Bus error due to misaligned, non-existing address or paging error",
|
|
862
|
-
standard: "bsd"
|
|
863
|
-
},
|
|
864
|
-
{
|
|
865
|
-
name: "SIGEMT",
|
|
866
|
-
number: 7,
|
|
867
|
-
action: "terminate",
|
|
868
|
-
description: "Command should be emulated but is not implemented",
|
|
869
|
-
standard: "other"
|
|
870
|
-
},
|
|
871
|
-
{
|
|
872
|
-
name: "SIGFPE",
|
|
873
|
-
number: 8,
|
|
874
|
-
action: "core",
|
|
875
|
-
description: "Floating point arithmetic error",
|
|
876
|
-
standard: "ansi"
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
name: "SIGKILL",
|
|
880
|
-
number: 9,
|
|
881
|
-
action: "terminate",
|
|
882
|
-
description: "Forced termination",
|
|
883
|
-
standard: "posix",
|
|
884
|
-
forced: true
|
|
885
|
-
},
|
|
886
|
-
{
|
|
887
|
-
name: "SIGUSR1",
|
|
888
|
-
number: 10,
|
|
889
|
-
action: "terminate",
|
|
890
|
-
description: "Application-specific signal",
|
|
891
|
-
standard: "posix"
|
|
892
|
-
},
|
|
893
|
-
{
|
|
894
|
-
name: "SIGSEGV",
|
|
895
|
-
number: 11,
|
|
896
|
-
action: "core",
|
|
897
|
-
description: "Segmentation fault",
|
|
898
|
-
standard: "ansi"
|
|
899
|
-
},
|
|
900
|
-
{
|
|
901
|
-
name: "SIGUSR2",
|
|
902
|
-
number: 12,
|
|
903
|
-
action: "terminate",
|
|
904
|
-
description: "Application-specific signal",
|
|
905
|
-
standard: "posix"
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
name: "SIGPIPE",
|
|
909
|
-
number: 13,
|
|
910
|
-
action: "terminate",
|
|
911
|
-
description: "Broken pipe or socket",
|
|
912
|
-
standard: "posix"
|
|
913
|
-
},
|
|
914
|
-
{
|
|
915
|
-
name: "SIGALRM",
|
|
916
|
-
number: 14,
|
|
917
|
-
action: "terminate",
|
|
918
|
-
description: "Timeout or timer",
|
|
919
|
-
standard: "posix"
|
|
920
|
-
},
|
|
921
|
-
{
|
|
922
|
-
name: "SIGTERM",
|
|
923
|
-
number: 15,
|
|
924
|
-
action: "terminate",
|
|
925
|
-
description: "Termination",
|
|
926
|
-
standard: "ansi"
|
|
927
|
-
},
|
|
928
|
-
{
|
|
929
|
-
name: "SIGSTKFLT",
|
|
930
|
-
number: 16,
|
|
931
|
-
action: "terminate",
|
|
932
|
-
description: "Stack is empty or overflowed",
|
|
933
|
-
standard: "other"
|
|
934
|
-
},
|
|
935
|
-
{
|
|
936
|
-
name: "SIGCHLD",
|
|
937
|
-
number: 17,
|
|
938
|
-
action: "ignore",
|
|
939
|
-
description: "Child process terminated, paused or unpaused",
|
|
940
|
-
standard: "posix"
|
|
941
|
-
},
|
|
942
|
-
{
|
|
943
|
-
name: "SIGCLD",
|
|
944
|
-
number: 17,
|
|
945
|
-
action: "ignore",
|
|
946
|
-
description: "Child process terminated, paused or unpaused",
|
|
947
|
-
standard: "other"
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
name: "SIGCONT",
|
|
951
|
-
number: 18,
|
|
952
|
-
action: "unpause",
|
|
953
|
-
description: "Unpaused",
|
|
954
|
-
standard: "posix",
|
|
955
|
-
forced: true
|
|
956
|
-
},
|
|
957
|
-
{
|
|
958
|
-
name: "SIGSTOP",
|
|
959
|
-
number: 19,
|
|
960
|
-
action: "pause",
|
|
961
|
-
description: "Paused",
|
|
962
|
-
standard: "posix",
|
|
963
|
-
forced: true
|
|
964
|
-
},
|
|
965
|
-
{
|
|
966
|
-
name: "SIGTSTP",
|
|
967
|
-
number: 20,
|
|
968
|
-
action: "pause",
|
|
969
|
-
description: 'Paused using CTRL-Z or "suspend"',
|
|
970
|
-
standard: "posix"
|
|
971
|
-
},
|
|
972
|
-
{
|
|
973
|
-
name: "SIGTTIN",
|
|
974
|
-
number: 21,
|
|
975
|
-
action: "pause",
|
|
976
|
-
description: "Background process cannot read terminal input",
|
|
977
|
-
standard: "posix"
|
|
978
|
-
},
|
|
979
|
-
{
|
|
980
|
-
name: "SIGBREAK",
|
|
981
|
-
number: 21,
|
|
982
|
-
action: "terminate",
|
|
983
|
-
description: "User interruption with CTRL-BREAK",
|
|
984
|
-
standard: "other"
|
|
985
|
-
},
|
|
986
|
-
{
|
|
987
|
-
name: "SIGTTOU",
|
|
988
|
-
number: 22,
|
|
989
|
-
action: "pause",
|
|
990
|
-
description: "Background process cannot write to terminal output",
|
|
991
|
-
standard: "posix"
|
|
992
|
-
},
|
|
993
|
-
{
|
|
994
|
-
name: "SIGURG",
|
|
995
|
-
number: 23,
|
|
996
|
-
action: "ignore",
|
|
997
|
-
description: "Socket received out-of-band data",
|
|
998
|
-
standard: "bsd"
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
name: "SIGXCPU",
|
|
1002
|
-
number: 24,
|
|
1003
|
-
action: "core",
|
|
1004
|
-
description: "Process timed out",
|
|
1005
|
-
standard: "bsd"
|
|
1006
|
-
},
|
|
1007
|
-
{
|
|
1008
|
-
name: "SIGXFSZ",
|
|
1009
|
-
number: 25,
|
|
1010
|
-
action: "core",
|
|
1011
|
-
description: "File too big",
|
|
1012
|
-
standard: "bsd"
|
|
1013
|
-
},
|
|
1014
|
-
{
|
|
1015
|
-
name: "SIGVTALRM",
|
|
1016
|
-
number: 26,
|
|
1017
|
-
action: "terminate",
|
|
1018
|
-
description: "Timeout or timer",
|
|
1019
|
-
standard: "bsd"
|
|
1020
|
-
},
|
|
1021
|
-
{
|
|
1022
|
-
name: "SIGPROF",
|
|
1023
|
-
number: 27,
|
|
1024
|
-
action: "terminate",
|
|
1025
|
-
description: "Timeout or timer",
|
|
1026
|
-
standard: "bsd"
|
|
1027
|
-
},
|
|
1028
|
-
{
|
|
1029
|
-
name: "SIGWINCH",
|
|
1030
|
-
number: 28,
|
|
1031
|
-
action: "ignore",
|
|
1032
|
-
description: "Terminal window size changed",
|
|
1033
|
-
standard: "bsd"
|
|
1034
|
-
},
|
|
1035
|
-
{
|
|
1036
|
-
name: "SIGIO",
|
|
1037
|
-
number: 29,
|
|
1038
|
-
action: "terminate",
|
|
1039
|
-
description: "I/O is available",
|
|
1040
|
-
standard: "other"
|
|
1041
|
-
},
|
|
1042
|
-
{
|
|
1043
|
-
name: "SIGPOLL",
|
|
1044
|
-
number: 29,
|
|
1045
|
-
action: "terminate",
|
|
1046
|
-
description: "Watched event",
|
|
1047
|
-
standard: "other"
|
|
1048
|
-
},
|
|
1049
|
-
{
|
|
1050
|
-
name: "SIGINFO",
|
|
1051
|
-
number: 29,
|
|
1052
|
-
action: "ignore",
|
|
1053
|
-
description: "Request for process information",
|
|
1054
|
-
standard: "other"
|
|
1055
|
-
},
|
|
1056
|
-
{
|
|
1057
|
-
name: "SIGPWR",
|
|
1058
|
-
number: 30,
|
|
1059
|
-
action: "terminate",
|
|
1060
|
-
description: "Device running out of power",
|
|
1061
|
-
standard: "systemv"
|
|
1062
|
-
},
|
|
1063
|
-
{
|
|
1064
|
-
name: "SIGSYS",
|
|
1065
|
-
number: 31,
|
|
1066
|
-
action: "core",
|
|
1067
|
-
description: "Invalid system call",
|
|
1068
|
-
standard: "other"
|
|
1069
|
-
},
|
|
1070
|
-
{
|
|
1071
|
-
name: "SIGUNUSED",
|
|
1072
|
-
number: 31,
|
|
1073
|
-
action: "terminate",
|
|
1074
|
-
description: "Invalid system call",
|
|
1075
|
-
standard: "other"
|
|
1076
|
-
}
|
|
1077
|
-
];
|
|
1078
|
-
|
|
1079
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
|
|
1080
|
-
var getSignals = () => {
|
|
1081
|
-
const realtimeSignals = getRealtimeSignals();
|
|
1082
|
-
const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
1083
|
-
return signals2;
|
|
1084
|
-
};
|
|
1085
|
-
var normalizeSignal = ({
|
|
1086
|
-
name,
|
|
1087
|
-
number: defaultNumber,
|
|
1088
|
-
description,
|
|
1089
|
-
action,
|
|
1090
|
-
forced = false,
|
|
1091
|
-
standard
|
|
1092
|
-
}) => {
|
|
1093
|
-
const {
|
|
1094
|
-
signals: { [name]: constantSignal }
|
|
1095
|
-
} = constants;
|
|
1096
|
-
const supported = constantSignal !== void 0;
|
|
1097
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
1098
|
-
return { name, number, description, supported, action, forced, standard };
|
|
1099
|
-
};
|
|
1100
|
-
|
|
1101
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
|
|
1102
|
-
var getSignalsByName = () => {
|
|
1103
|
-
const signals2 = getSignals();
|
|
1104
|
-
return Object.fromEntries(signals2.map(getSignalByName));
|
|
1105
|
-
};
|
|
1106
|
-
var getSignalByName = ({
|
|
1107
|
-
name,
|
|
1108
|
-
number,
|
|
1109
|
-
description,
|
|
1110
|
-
supported,
|
|
1111
|
-
action,
|
|
1112
|
-
forced,
|
|
1113
|
-
standard
|
|
1114
|
-
}) => [name, { name, number, description, supported, action, forced, standard }];
|
|
1115
|
-
var signalsByName = getSignalsByName();
|
|
1116
|
-
var getSignalsByNumber = () => {
|
|
1117
|
-
const signals2 = getSignals();
|
|
1118
|
-
const length = SIGRTMAX + 1;
|
|
1119
|
-
const signalsA = Array.from(
|
|
1120
|
-
{ length },
|
|
1121
|
-
(value, number) => getSignalByNumber(number, signals2)
|
|
1122
|
-
);
|
|
1123
|
-
return Object.assign({}, ...signalsA);
|
|
1124
|
-
};
|
|
1125
|
-
var getSignalByNumber = (number, signals2) => {
|
|
1126
|
-
const signal = findSignalByNumber(number, signals2);
|
|
1127
|
-
if (signal === void 0) {
|
|
1128
|
-
return {};
|
|
1129
|
-
}
|
|
1130
|
-
const { name, description, supported, action, forced, standard } = signal;
|
|
1131
|
-
return {
|
|
1132
|
-
[number]: {
|
|
1133
|
-
name,
|
|
1134
|
-
number,
|
|
1135
|
-
description,
|
|
1136
|
-
supported,
|
|
1137
|
-
action,
|
|
1138
|
-
forced,
|
|
1139
|
-
standard
|
|
1140
|
-
}
|
|
1141
|
-
};
|
|
1142
|
-
};
|
|
1143
|
-
var findSignalByNumber = (number, signals2) => {
|
|
1144
|
-
const signal = signals2.find(({ name }) => constants2.signals[name] === number);
|
|
1145
|
-
if (signal !== void 0) {
|
|
1146
|
-
return signal;
|
|
1147
|
-
}
|
|
1148
|
-
return signals2.find((signalA) => signalA.number === number);
|
|
1149
|
-
};
|
|
1150
|
-
var signalsByNumber = getSignalsByNumber();
|
|
1151
|
-
|
|
1152
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
|
|
1153
|
-
var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
|
|
1154
|
-
if (timedOut) {
|
|
1155
|
-
return `timed out after ${timeout} milliseconds`;
|
|
1156
|
-
}
|
|
1157
|
-
if (isCanceled) {
|
|
1158
|
-
return "was canceled";
|
|
1159
|
-
}
|
|
1160
|
-
if (errorCode !== void 0) {
|
|
1161
|
-
return `failed with ${errorCode}`;
|
|
1162
|
-
}
|
|
1163
|
-
if (signal !== void 0) {
|
|
1164
|
-
return `was killed with ${signal} (${signalDescription})`;
|
|
1165
|
-
}
|
|
1166
|
-
if (exitCode !== void 0) {
|
|
1167
|
-
return `failed with exit code ${exitCode}`;
|
|
1168
|
-
}
|
|
1169
|
-
return "failed";
|
|
1170
|
-
};
|
|
1171
|
-
var makeError = ({
|
|
1172
|
-
stdout,
|
|
1173
|
-
stderr,
|
|
1174
|
-
all,
|
|
1175
|
-
error,
|
|
1176
|
-
signal,
|
|
1177
|
-
exitCode,
|
|
1178
|
-
command,
|
|
1179
|
-
escapedCommand,
|
|
1180
|
-
timedOut,
|
|
1181
|
-
isCanceled,
|
|
1182
|
-
killed,
|
|
1183
|
-
parsed: { options: { timeout, cwd = process3.cwd() } }
|
|
1184
|
-
}) => {
|
|
1185
|
-
exitCode = exitCode === null ? void 0 : exitCode;
|
|
1186
|
-
signal = signal === null ? void 0 : signal;
|
|
1187
|
-
const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
|
|
1188
|
-
const errorCode = error && error.code;
|
|
1189
|
-
const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
|
|
1190
|
-
const execaMessage = `Command ${prefix}: ${command}`;
|
|
1191
|
-
const isError = Object.prototype.toString.call(error) === "[object Error]";
|
|
1192
|
-
const shortMessage = isError ? `${execaMessage}
|
|
1193
|
-
${error.message}` : execaMessage;
|
|
1194
|
-
const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
|
|
1195
|
-
if (isError) {
|
|
1196
|
-
error.originalMessage = error.message;
|
|
1197
|
-
error.message = message;
|
|
1198
|
-
} else {
|
|
1199
|
-
error = new Error(message);
|
|
1200
|
-
}
|
|
1201
|
-
error.shortMessage = shortMessage;
|
|
1202
|
-
error.command = command;
|
|
1203
|
-
error.escapedCommand = escapedCommand;
|
|
1204
|
-
error.exitCode = exitCode;
|
|
1205
|
-
error.signal = signal;
|
|
1206
|
-
error.signalDescription = signalDescription;
|
|
1207
|
-
error.stdout = stdout;
|
|
1208
|
-
error.stderr = stderr;
|
|
1209
|
-
error.cwd = cwd;
|
|
1210
|
-
if (all !== void 0) {
|
|
1211
|
-
error.all = all;
|
|
1212
|
-
}
|
|
1213
|
-
if ("bufferedData" in error) {
|
|
1214
|
-
delete error.bufferedData;
|
|
1215
|
-
}
|
|
1216
|
-
error.failed = true;
|
|
1217
|
-
error.timedOut = Boolean(timedOut);
|
|
1218
|
-
error.isCanceled = isCanceled;
|
|
1219
|
-
error.killed = killed && !timedOut;
|
|
1220
|
-
return error;
|
|
1221
|
-
};
|
|
1222
|
-
|
|
1223
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js
|
|
1224
|
-
init_esm_shims();
|
|
1225
|
-
var aliases = ["stdin", "stdout", "stderr"];
|
|
1226
|
-
var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
|
|
1227
|
-
var normalizeStdio = (options) => {
|
|
1228
|
-
if (!options) {
|
|
1229
|
-
return;
|
|
1230
|
-
}
|
|
1231
|
-
const { stdio } = options;
|
|
1232
|
-
if (stdio === void 0) {
|
|
1233
|
-
return aliases.map((alias) => options[alias]);
|
|
1234
|
-
}
|
|
1235
|
-
if (hasAlias(options)) {
|
|
1236
|
-
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
|
|
1237
|
-
}
|
|
1238
|
-
if (typeof stdio === "string") {
|
|
1239
|
-
return stdio;
|
|
1240
|
-
}
|
|
1241
|
-
if (!Array.isArray(stdio)) {
|
|
1242
|
-
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
1243
|
-
}
|
|
1244
|
-
const length = Math.max(stdio.length, aliases.length);
|
|
1245
|
-
return Array.from({ length }, (value, index) => stdio[index]);
|
|
1246
|
-
};
|
|
1247
|
-
|
|
1248
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
|
|
1249
|
-
init_esm_shims();
|
|
1250
|
-
import os from "os";
|
|
1251
|
-
|
|
1252
|
-
// ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
1253
|
-
init_esm_shims();
|
|
1254
|
-
|
|
1255
|
-
// ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
1256
|
-
init_esm_shims();
|
|
1257
|
-
var signals = [];
|
|
1258
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1259
|
-
if (process.platform !== "win32") {
|
|
1260
|
-
signals.push(
|
|
1261
|
-
"SIGALRM",
|
|
1262
|
-
"SIGABRT",
|
|
1263
|
-
"SIGVTALRM",
|
|
1264
|
-
"SIGXCPU",
|
|
1265
|
-
"SIGXFSZ",
|
|
1266
|
-
"SIGUSR2",
|
|
1267
|
-
"SIGTRAP",
|
|
1268
|
-
"SIGSYS",
|
|
1269
|
-
"SIGQUIT",
|
|
1270
|
-
"SIGIOT"
|
|
1271
|
-
// should detect profiler and enable/disable accordingly.
|
|
1272
|
-
// see #21
|
|
1273
|
-
// 'SIGPROF'
|
|
1274
|
-
);
|
|
1275
|
-
}
|
|
1276
|
-
if (process.platform === "linux") {
|
|
1277
|
-
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
// ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
1281
|
-
var 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";
|
|
1282
|
-
var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
|
|
1283
|
-
var global2 = globalThis;
|
|
1284
|
-
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1285
|
-
var Emitter = class {
|
|
1286
|
-
emitted = {
|
|
1287
|
-
afterExit: false,
|
|
1288
|
-
exit: false
|
|
1289
|
-
};
|
|
1290
|
-
listeners = {
|
|
1291
|
-
afterExit: [],
|
|
1292
|
-
exit: []
|
|
1293
|
-
};
|
|
1294
|
-
count = 0;
|
|
1295
|
-
id = Math.random();
|
|
1296
|
-
constructor() {
|
|
1297
|
-
if (global2[kExitEmitter]) {
|
|
1298
|
-
return global2[kExitEmitter];
|
|
1299
|
-
}
|
|
1300
|
-
ObjectDefineProperty(global2, kExitEmitter, {
|
|
1301
|
-
value: this,
|
|
1302
|
-
writable: false,
|
|
1303
|
-
enumerable: false,
|
|
1304
|
-
configurable: false
|
|
1305
|
-
});
|
|
1306
|
-
}
|
|
1307
|
-
on(ev, fn) {
|
|
1308
|
-
this.listeners[ev].push(fn);
|
|
1309
|
-
}
|
|
1310
|
-
removeListener(ev, fn) {
|
|
1311
|
-
const list = this.listeners[ev];
|
|
1312
|
-
const i = list.indexOf(fn);
|
|
1313
|
-
if (i === -1) {
|
|
1314
|
-
return;
|
|
1315
|
-
}
|
|
1316
|
-
if (i === 0 && list.length === 1) {
|
|
1317
|
-
list.length = 0;
|
|
1318
|
-
} else {
|
|
1319
|
-
list.splice(i, 1);
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
emit(ev, code, signal) {
|
|
1323
|
-
if (this.emitted[ev]) {
|
|
1324
|
-
return false;
|
|
1325
|
-
}
|
|
1326
|
-
this.emitted[ev] = true;
|
|
1327
|
-
let ret = false;
|
|
1328
|
-
for (const fn of this.listeners[ev]) {
|
|
1329
|
-
ret = fn(code, signal) === true || ret;
|
|
1330
|
-
}
|
|
1331
|
-
if (ev === "exit") {
|
|
1332
|
-
ret = this.emit("afterExit", code, signal) || ret;
|
|
1333
|
-
}
|
|
1334
|
-
return ret;
|
|
1335
|
-
}
|
|
1336
|
-
};
|
|
1337
|
-
var SignalExitBase = class {
|
|
1338
|
-
};
|
|
1339
|
-
var signalExitWrap = (handler) => {
|
|
1340
|
-
return {
|
|
1341
|
-
onExit(cb, opts) {
|
|
1342
|
-
return handler.onExit(cb, opts);
|
|
1343
|
-
},
|
|
1344
|
-
load() {
|
|
1345
|
-
return handler.load();
|
|
1346
|
-
},
|
|
1347
|
-
unload() {
|
|
1348
|
-
return handler.unload();
|
|
1349
|
-
}
|
|
1350
|
-
};
|
|
1351
|
-
};
|
|
1352
|
-
var SignalExitFallback = class extends SignalExitBase {
|
|
1353
|
-
onExit() {
|
|
1354
|
-
return () => {
|
|
1355
|
-
};
|
|
1356
|
-
}
|
|
1357
|
-
load() {
|
|
1358
|
-
}
|
|
1359
|
-
unload() {
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
var SignalExit = class extends SignalExitBase {
|
|
1363
|
-
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
1364
|
-
// so use a supported signal instead
|
|
1365
|
-
/* c8 ignore start */
|
|
1366
|
-
#hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1367
|
-
/* c8 ignore stop */
|
|
1368
|
-
#emitter = new Emitter();
|
|
1369
|
-
#process;
|
|
1370
|
-
#originalProcessEmit;
|
|
1371
|
-
#originalProcessReallyExit;
|
|
1372
|
-
#sigListeners = {};
|
|
1373
|
-
#loaded = false;
|
|
1374
|
-
constructor(process7) {
|
|
1375
|
-
super();
|
|
1376
|
-
this.#process = process7;
|
|
1377
|
-
this.#sigListeners = {};
|
|
1378
|
-
for (const sig of signals) {
|
|
1379
|
-
this.#sigListeners[sig] = () => {
|
|
1380
|
-
const listeners = this.#process.listeners(sig);
|
|
1381
|
-
let { count } = this.#emitter;
|
|
1382
|
-
const p = process7;
|
|
1383
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
1384
|
-
count += p.__signal_exit_emitter__.count;
|
|
1385
|
-
}
|
|
1386
|
-
if (listeners.length === count) {
|
|
1387
|
-
this.unload();
|
|
1388
|
-
const ret = this.#emitter.emit("exit", null, sig);
|
|
1389
|
-
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1390
|
-
if (!ret)
|
|
1391
|
-
process7.kill(process7.pid, s);
|
|
1392
|
-
}
|
|
1393
|
-
};
|
|
1394
|
-
}
|
|
1395
|
-
this.#originalProcessReallyExit = process7.reallyExit;
|
|
1396
|
-
this.#originalProcessEmit = process7.emit;
|
|
1397
|
-
}
|
|
1398
|
-
onExit(cb, opts) {
|
|
1399
|
-
if (!processOk(this.#process)) {
|
|
1400
|
-
return () => {
|
|
1401
|
-
};
|
|
1402
|
-
}
|
|
1403
|
-
if (this.#loaded === false) {
|
|
1404
|
-
this.load();
|
|
1405
|
-
}
|
|
1406
|
-
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1407
|
-
this.#emitter.on(ev, cb);
|
|
1408
|
-
return () => {
|
|
1409
|
-
this.#emitter.removeListener(ev, cb);
|
|
1410
|
-
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
1411
|
-
this.unload();
|
|
1412
|
-
}
|
|
1413
|
-
};
|
|
1414
|
-
}
|
|
1415
|
-
load() {
|
|
1416
|
-
if (this.#loaded) {
|
|
1417
|
-
return;
|
|
1418
|
-
}
|
|
1419
|
-
this.#loaded = true;
|
|
1420
|
-
this.#emitter.count += 1;
|
|
1421
|
-
for (const sig of signals) {
|
|
1422
|
-
try {
|
|
1423
|
-
const fn = this.#sigListeners[sig];
|
|
1424
|
-
if (fn)
|
|
1425
|
-
this.#process.on(sig, fn);
|
|
1426
|
-
} catch (_) {
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
this.#process.emit = (ev, ...a) => {
|
|
1430
|
-
return this.#processEmit(ev, ...a);
|
|
1431
|
-
};
|
|
1432
|
-
this.#process.reallyExit = (code) => {
|
|
1433
|
-
return this.#processReallyExit(code);
|
|
1434
|
-
};
|
|
1435
|
-
}
|
|
1436
|
-
unload() {
|
|
1437
|
-
if (!this.#loaded) {
|
|
1438
|
-
return;
|
|
1439
|
-
}
|
|
1440
|
-
this.#loaded = false;
|
|
1441
|
-
signals.forEach((sig) => {
|
|
1442
|
-
const listener = this.#sigListeners[sig];
|
|
1443
|
-
if (!listener) {
|
|
1444
|
-
throw new Error("Listener not defined for signal: " + sig);
|
|
1445
|
-
}
|
|
1446
|
-
try {
|
|
1447
|
-
this.#process.removeListener(sig, listener);
|
|
1448
|
-
} catch (_) {
|
|
1449
|
-
}
|
|
1450
|
-
});
|
|
1451
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
1452
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1453
|
-
this.#emitter.count -= 1;
|
|
1454
|
-
}
|
|
1455
|
-
#processReallyExit(code) {
|
|
1456
|
-
if (!processOk(this.#process)) {
|
|
1457
|
-
return 0;
|
|
1458
|
-
}
|
|
1459
|
-
this.#process.exitCode = code || 0;
|
|
1460
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1461
|
-
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
1462
|
-
}
|
|
1463
|
-
#processEmit(ev, ...args) {
|
|
1464
|
-
const og = this.#originalProcessEmit;
|
|
1465
|
-
if (ev === "exit" && processOk(this.#process)) {
|
|
1466
|
-
if (typeof args[0] === "number") {
|
|
1467
|
-
this.#process.exitCode = args[0];
|
|
1468
|
-
}
|
|
1469
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
1470
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1471
|
-
return ret;
|
|
1472
|
-
} else {
|
|
1473
|
-
return og.call(this.#process, ev, ...args);
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
};
|
|
1477
|
-
var process4 = globalThis.process;
|
|
1478
|
-
var {
|
|
1479
|
-
/**
|
|
1480
|
-
* Called when the process is exiting, whether via signal, explicit
|
|
1481
|
-
* exit, or running out of stuff to do.
|
|
1482
|
-
*
|
|
1483
|
-
* If the global process object is not suitable for instrumentation,
|
|
1484
|
-
* then this will be a no-op.
|
|
1485
|
-
*
|
|
1486
|
-
* Returns a function that may be used to unload signal-exit.
|
|
1487
|
-
*/
|
|
1488
|
-
onExit,
|
|
1489
|
-
/**
|
|
1490
|
-
* Load the listeners. Likely you never need to call this, unless
|
|
1491
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
1492
|
-
* Mostly exposed for the benefit of testing.
|
|
1493
|
-
*
|
|
1494
|
-
* @internal
|
|
1495
|
-
*/
|
|
1496
|
-
load,
|
|
1497
|
-
/**
|
|
1498
|
-
* Unload the listeners. Likely you never need to call this, unless
|
|
1499
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
1500
|
-
* Mostly exposed for the benefit of testing.
|
|
1501
|
-
*
|
|
1502
|
-
* @internal
|
|
1503
|
-
*/
|
|
1504
|
-
unload
|
|
1505
|
-
} = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
|
|
1506
|
-
|
|
1507
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
|
|
1508
|
-
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
1509
|
-
var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
1510
|
-
const killResult = kill(signal);
|
|
1511
|
-
setKillTimeout(kill, signal, options, killResult);
|
|
1512
|
-
return killResult;
|
|
1513
|
-
};
|
|
1514
|
-
var setKillTimeout = (kill, signal, options, killResult) => {
|
|
1515
|
-
if (!shouldForceKill(signal, options, killResult)) {
|
|
1516
|
-
return;
|
|
1517
|
-
}
|
|
1518
|
-
const timeout = getForceKillAfterTimeout(options);
|
|
1519
|
-
const t = setTimeout(() => {
|
|
1520
|
-
kill("SIGKILL");
|
|
1521
|
-
}, timeout);
|
|
1522
|
-
if (t.unref) {
|
|
1523
|
-
t.unref();
|
|
1524
|
-
}
|
|
1525
|
-
};
|
|
1526
|
-
var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
1527
|
-
var isSigterm = (signal) => signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
|
|
1528
|
-
var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
|
|
1529
|
-
if (forceKillAfterTimeout === true) {
|
|
1530
|
-
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
1531
|
-
}
|
|
1532
|
-
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
|
|
1533
|
-
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
1534
|
-
}
|
|
1535
|
-
return forceKillAfterTimeout;
|
|
1536
|
-
};
|
|
1537
|
-
var spawnedCancel = (spawned, context) => {
|
|
1538
|
-
const killResult = spawned.kill();
|
|
1539
|
-
if (killResult) {
|
|
1540
|
-
context.isCanceled = true;
|
|
1541
|
-
}
|
|
1542
|
-
};
|
|
1543
|
-
var timeoutKill = (spawned, signal, reject) => {
|
|
1544
|
-
spawned.kill(signal);
|
|
1545
|
-
reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
|
|
1546
|
-
};
|
|
1547
|
-
var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
|
|
1548
|
-
if (timeout === 0 || timeout === void 0) {
|
|
1549
|
-
return spawnedPromise;
|
|
1550
|
-
}
|
|
1551
|
-
let timeoutId;
|
|
1552
|
-
const timeoutPromise = new Promise((resolve2, reject) => {
|
|
1553
|
-
timeoutId = setTimeout(() => {
|
|
1554
|
-
timeoutKill(spawned, killSignal, reject);
|
|
1555
|
-
}, timeout);
|
|
1556
|
-
});
|
|
1557
|
-
const safeSpawnedPromise = spawnedPromise.finally(() => {
|
|
1558
|
-
clearTimeout(timeoutId);
|
|
1559
|
-
});
|
|
1560
|
-
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
1561
|
-
};
|
|
1562
|
-
var validateTimeout = ({ timeout }) => {
|
|
1563
|
-
if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
|
|
1564
|
-
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
1565
|
-
}
|
|
1566
|
-
};
|
|
1567
|
-
var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
1568
|
-
if (!cleanup || detached) {
|
|
1569
|
-
return timedPromise;
|
|
1570
|
-
}
|
|
1571
|
-
const removeExitHandler = onExit(() => {
|
|
1572
|
-
spawned.kill();
|
|
1573
|
-
});
|
|
1574
|
-
return timedPromise.finally(() => {
|
|
1575
|
-
removeExitHandler();
|
|
1576
|
-
});
|
|
1577
|
-
};
|
|
1578
|
-
|
|
1579
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
|
|
1580
|
-
init_esm_shims();
|
|
1581
|
-
import { createWriteStream } from "fs";
|
|
1582
|
-
import { ChildProcess } from "child_process";
|
|
1583
|
-
|
|
1584
|
-
// ../../node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
|
|
1585
|
-
init_esm_shims();
|
|
1586
|
-
function isStream(stream) {
|
|
1587
|
-
return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
1588
|
-
}
|
|
1589
|
-
function isWritableStream(stream) {
|
|
1590
|
-
return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
|
|
1594
|
-
var isExecaChildProcess = (target) => target instanceof ChildProcess && typeof target.then === "function";
|
|
1595
|
-
var pipeToTarget = (spawned, streamName, target) => {
|
|
1596
|
-
if (typeof target === "string") {
|
|
1597
|
-
spawned[streamName].pipe(createWriteStream(target));
|
|
1598
|
-
return spawned;
|
|
1599
|
-
}
|
|
1600
|
-
if (isWritableStream(target)) {
|
|
1601
|
-
spawned[streamName].pipe(target);
|
|
1602
|
-
return spawned;
|
|
1603
|
-
}
|
|
1604
|
-
if (!isExecaChildProcess(target)) {
|
|
1605
|
-
throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
|
|
1606
|
-
}
|
|
1607
|
-
if (!isWritableStream(target.stdin)) {
|
|
1608
|
-
throw new TypeError("The target child process's stdin must be available.");
|
|
1609
|
-
}
|
|
1610
|
-
spawned[streamName].pipe(target.stdin);
|
|
1611
|
-
return target;
|
|
1612
|
-
};
|
|
1613
|
-
var addPipeMethods = (spawned) => {
|
|
1614
|
-
if (spawned.stdout !== null) {
|
|
1615
|
-
spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
|
|
1616
|
-
}
|
|
1617
|
-
if (spawned.stderr !== null) {
|
|
1618
|
-
spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
|
|
1619
|
-
}
|
|
1620
|
-
if (spawned.all !== void 0) {
|
|
1621
|
-
spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
|
|
1622
|
-
}
|
|
1623
|
-
};
|
|
1624
|
-
|
|
1625
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
|
|
1626
|
-
init_esm_shims();
|
|
1627
|
-
import { createReadStream, readFileSync } from "fs";
|
|
1628
|
-
import { setTimeout as setTimeout2 } from "timers/promises";
|
|
1629
|
-
|
|
1630
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.js
|
|
1631
|
-
init_esm_shims();
|
|
1632
|
-
|
|
1633
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.js
|
|
1634
|
-
init_esm_shims();
|
|
1635
|
-
|
|
1636
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js
|
|
1637
|
-
init_esm_shims();
|
|
1638
|
-
var getStreamContents = async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
|
|
1639
|
-
if (!isAsyncIterable(stream)) {
|
|
1640
|
-
throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
1641
|
-
}
|
|
1642
|
-
const state = init();
|
|
1643
|
-
state.length = 0;
|
|
1644
|
-
try {
|
|
1645
|
-
for await (const chunk of stream) {
|
|
1646
|
-
const chunkType = getChunkType(chunk);
|
|
1647
|
-
const convertedChunk = convertChunk[chunkType](chunk, state);
|
|
1648
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1649
|
-
}
|
|
1650
|
-
appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
|
|
1651
|
-
return finalize(state);
|
|
1652
|
-
} catch (error) {
|
|
1653
|
-
error.bufferedData = finalize(state);
|
|
1654
|
-
throw error;
|
|
1655
|
-
}
|
|
1656
|
-
};
|
|
1657
|
-
var appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
|
|
1658
|
-
const convertedChunk = getFinalChunk(state);
|
|
1659
|
-
if (convertedChunk !== void 0) {
|
|
1660
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1661
|
-
}
|
|
1662
|
-
};
|
|
1663
|
-
var appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
|
|
1664
|
-
const chunkSize = getSize(convertedChunk);
|
|
1665
|
-
const newLength = state.length + chunkSize;
|
|
1666
|
-
if (newLength <= maxBuffer) {
|
|
1667
|
-
addNewChunk(convertedChunk, state, addChunk, newLength);
|
|
1668
|
-
return;
|
|
1669
|
-
}
|
|
1670
|
-
const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
|
|
1671
|
-
if (truncatedChunk !== void 0) {
|
|
1672
|
-
addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
|
|
1673
|
-
}
|
|
1674
|
-
throw new MaxBufferError();
|
|
1675
|
-
};
|
|
1676
|
-
var addNewChunk = (convertedChunk, state, addChunk, newLength) => {
|
|
1677
|
-
state.contents = addChunk(convertedChunk, state, newLength);
|
|
1678
|
-
state.length = newLength;
|
|
1679
|
-
};
|
|
1680
|
-
var isAsyncIterable = (stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function";
|
|
1681
|
-
var getChunkType = (chunk) => {
|
|
1682
|
-
const typeOfChunk = typeof chunk;
|
|
1683
|
-
if (typeOfChunk === "string") {
|
|
1684
|
-
return "string";
|
|
1685
|
-
}
|
|
1686
|
-
if (typeOfChunk !== "object" || chunk === null) {
|
|
1687
|
-
return "others";
|
|
1688
|
-
}
|
|
1689
|
-
if (globalThis.Buffer?.isBuffer(chunk)) {
|
|
1690
|
-
return "buffer";
|
|
1691
|
-
}
|
|
1692
|
-
const prototypeName = objectToString.call(chunk);
|
|
1693
|
-
if (prototypeName === "[object ArrayBuffer]") {
|
|
1694
|
-
return "arrayBuffer";
|
|
1695
|
-
}
|
|
1696
|
-
if (prototypeName === "[object DataView]") {
|
|
1697
|
-
return "dataView";
|
|
1698
|
-
}
|
|
1699
|
-
if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
|
|
1700
|
-
return "typedArray";
|
|
1701
|
-
}
|
|
1702
|
-
return "others";
|
|
1703
|
-
};
|
|
1704
|
-
var { toString: objectToString } = Object.prototype;
|
|
1705
|
-
var MaxBufferError = class extends Error {
|
|
1706
|
-
name = "MaxBufferError";
|
|
1707
|
-
constructor() {
|
|
1708
|
-
super("maxBuffer exceeded");
|
|
1709
|
-
}
|
|
1710
|
-
};
|
|
1711
|
-
|
|
1712
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js
|
|
1713
|
-
init_esm_shims();
|
|
1714
|
-
var identity = (value) => value;
|
|
1715
|
-
var noop = () => void 0;
|
|
1716
|
-
var getContentsProp = ({ contents }) => contents;
|
|
1717
|
-
var throwObjectStream = (chunk) => {
|
|
1718
|
-
throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
|
|
1719
|
-
};
|
|
1720
|
-
var getLengthProp = (convertedChunk) => convertedChunk.length;
|
|
1721
|
-
|
|
1722
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js
|
|
1723
|
-
init_esm_shims();
|
|
1724
|
-
async function getStreamAsArrayBuffer(stream, options) {
|
|
1725
|
-
return getStreamContents(stream, arrayBufferMethods, options);
|
|
1726
|
-
}
|
|
1727
|
-
var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) });
|
|
1728
|
-
var useTextEncoder = (chunk) => textEncoder.encode(chunk);
|
|
1729
|
-
var textEncoder = new TextEncoder();
|
|
1730
|
-
var useUint8Array = (chunk) => new Uint8Array(chunk);
|
|
1731
|
-
var useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
1732
|
-
var truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
1733
|
-
var addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
|
|
1734
|
-
const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
|
|
1735
|
-
new Uint8Array(newContents).set(convertedChunk, previousLength);
|
|
1736
|
-
return newContents;
|
|
1737
|
-
};
|
|
1738
|
-
var resizeArrayBufferSlow = (contents, length) => {
|
|
1739
|
-
if (length <= contents.byteLength) {
|
|
1740
|
-
return contents;
|
|
1741
|
-
}
|
|
1742
|
-
const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
|
|
1743
|
-
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
1744
|
-
return arrayBuffer;
|
|
1745
|
-
};
|
|
1746
|
-
var resizeArrayBuffer = (contents, length) => {
|
|
1747
|
-
if (length <= contents.maxByteLength) {
|
|
1748
|
-
contents.resize(length);
|
|
1749
|
-
return contents;
|
|
1750
|
-
}
|
|
1751
|
-
const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
|
|
1752
|
-
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
1753
|
-
return arrayBuffer;
|
|
1754
|
-
};
|
|
1755
|
-
var getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));
|
|
1756
|
-
var SCALE_FACTOR = 2;
|
|
1757
|
-
var finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length);
|
|
1758
|
-
var hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype;
|
|
1759
|
-
var arrayBufferMethods = {
|
|
1760
|
-
init: initArrayBuffer,
|
|
1761
|
-
convertChunk: {
|
|
1762
|
-
string: useTextEncoder,
|
|
1763
|
-
buffer: useUint8Array,
|
|
1764
|
-
arrayBuffer: useUint8Array,
|
|
1765
|
-
dataView: useUint8ArrayWithOffset,
|
|
1766
|
-
typedArray: useUint8ArrayWithOffset,
|
|
1767
|
-
others: throwObjectStream
|
|
1768
|
-
},
|
|
1769
|
-
getSize: getLengthProp,
|
|
1770
|
-
truncateChunk: truncateArrayBufferChunk,
|
|
1771
|
-
addChunk: addArrayBufferChunk,
|
|
1772
|
-
getFinalChunk: noop,
|
|
1773
|
-
finalize: finalizeArrayBuffer
|
|
1774
|
-
};
|
|
1775
|
-
|
|
1776
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js
|
|
1777
|
-
init_esm_shims();
|
|
1778
|
-
async function getStreamAsBuffer(stream, options) {
|
|
1779
|
-
if (!("Buffer" in globalThis)) {
|
|
1780
|
-
throw new Error("getStreamAsBuffer() is only supported in Node.js");
|
|
1781
|
-
}
|
|
1782
|
-
try {
|
|
1783
|
-
return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
|
|
1784
|
-
} catch (error) {
|
|
1785
|
-
if (error.bufferedData !== void 0) {
|
|
1786
|
-
error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
|
|
1787
|
-
}
|
|
1788
|
-
throw error;
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
var arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
|
|
1792
|
-
|
|
1793
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js
|
|
1794
|
-
init_esm_shims();
|
|
1795
|
-
async function getStreamAsString(stream, options) {
|
|
1796
|
-
return getStreamContents(stream, stringMethods, options);
|
|
1797
|
-
}
|
|
1798
|
-
var initString = () => ({ contents: "", textDecoder: new TextDecoder() });
|
|
1799
|
-
var useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true });
|
|
1800
|
-
var addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk;
|
|
1801
|
-
var truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
1802
|
-
var getFinalStringChunk = ({ textDecoder }) => {
|
|
1803
|
-
const finalChunk = textDecoder.decode();
|
|
1804
|
-
return finalChunk === "" ? void 0 : finalChunk;
|
|
1805
|
-
};
|
|
1806
|
-
var stringMethods = {
|
|
1807
|
-
init: initString,
|
|
1808
|
-
convertChunk: {
|
|
1809
|
-
string: identity,
|
|
1810
|
-
buffer: useTextDecoder,
|
|
1811
|
-
arrayBuffer: useTextDecoder,
|
|
1812
|
-
dataView: useTextDecoder,
|
|
1813
|
-
typedArray: useTextDecoder,
|
|
1814
|
-
others: throwObjectStream
|
|
1815
|
-
},
|
|
1816
|
-
getSize: getLengthProp,
|
|
1817
|
-
truncateChunk: truncateStringChunk,
|
|
1818
|
-
addChunk: addStringChunk,
|
|
1819
|
-
getFinalChunk: getFinalStringChunk,
|
|
1820
|
-
finalize: getContentsProp
|
|
1821
|
-
};
|
|
1822
|
-
|
|
1823
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
|
|
1824
|
-
var import_merge_stream = __toESM(require_merge_stream(), 1);
|
|
1825
|
-
var validateInputOptions = (input) => {
|
|
1826
|
-
if (input !== void 0) {
|
|
1827
|
-
throw new TypeError("The `input` and `inputFile` options cannot be both set.");
|
|
1828
|
-
}
|
|
1829
|
-
};
|
|
1830
|
-
var getInputSync = ({ input, inputFile }) => {
|
|
1831
|
-
if (typeof inputFile !== "string") {
|
|
1832
|
-
return input;
|
|
1833
|
-
}
|
|
1834
|
-
validateInputOptions(input);
|
|
1835
|
-
return readFileSync(inputFile);
|
|
1836
|
-
};
|
|
1837
|
-
var handleInputSync = (options) => {
|
|
1838
|
-
const input = getInputSync(options);
|
|
1839
|
-
if (isStream(input)) {
|
|
1840
|
-
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
1841
|
-
}
|
|
1842
|
-
return input;
|
|
1843
|
-
};
|
|
1844
|
-
var getInput = ({ input, inputFile }) => {
|
|
1845
|
-
if (typeof inputFile !== "string") {
|
|
1846
|
-
return input;
|
|
1847
|
-
}
|
|
1848
|
-
validateInputOptions(input);
|
|
1849
|
-
return createReadStream(inputFile);
|
|
1850
|
-
};
|
|
1851
|
-
var handleInput = (spawned, options) => {
|
|
1852
|
-
const input = getInput(options);
|
|
1853
|
-
if (input === void 0) {
|
|
1854
|
-
return;
|
|
1855
|
-
}
|
|
1856
|
-
if (isStream(input)) {
|
|
1857
|
-
input.pipe(spawned.stdin);
|
|
1858
|
-
} else {
|
|
1859
|
-
spawned.stdin.end(input);
|
|
1860
|
-
}
|
|
1861
|
-
};
|
|
1862
|
-
var makeAllStream = (spawned, { all }) => {
|
|
1863
|
-
if (!all || !spawned.stdout && !spawned.stderr) {
|
|
1864
|
-
return;
|
|
1865
|
-
}
|
|
1866
|
-
const mixed = (0, import_merge_stream.default)();
|
|
1867
|
-
if (spawned.stdout) {
|
|
1868
|
-
mixed.add(spawned.stdout);
|
|
1869
|
-
}
|
|
1870
|
-
if (spawned.stderr) {
|
|
1871
|
-
mixed.add(spawned.stderr);
|
|
1872
|
-
}
|
|
1873
|
-
return mixed;
|
|
1874
|
-
};
|
|
1875
|
-
var getBufferedData = async (stream, streamPromise) => {
|
|
1876
|
-
if (!stream || streamPromise === void 0) {
|
|
1877
|
-
return;
|
|
1878
|
-
}
|
|
1879
|
-
await setTimeout2(0);
|
|
1880
|
-
stream.destroy();
|
|
1881
|
-
try {
|
|
1882
|
-
return await streamPromise;
|
|
1883
|
-
} catch (error) {
|
|
1884
|
-
return error.bufferedData;
|
|
1885
|
-
}
|
|
1886
|
-
};
|
|
1887
|
-
var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
|
|
1888
|
-
if (!stream || !buffer) {
|
|
1889
|
-
return;
|
|
1890
|
-
}
|
|
1891
|
-
if (encoding === "utf8" || encoding === "utf-8") {
|
|
1892
|
-
return getStreamAsString(stream, { maxBuffer });
|
|
1893
|
-
}
|
|
1894
|
-
if (encoding === null || encoding === "buffer") {
|
|
1895
|
-
return getStreamAsBuffer(stream, { maxBuffer });
|
|
1896
|
-
}
|
|
1897
|
-
return applyEncoding(stream, maxBuffer, encoding);
|
|
1898
|
-
};
|
|
1899
|
-
var applyEncoding = async (stream, maxBuffer, encoding) => {
|
|
1900
|
-
const buffer = await getStreamAsBuffer(stream, { maxBuffer });
|
|
1901
|
-
return buffer.toString(encoding);
|
|
1902
|
-
};
|
|
1903
|
-
var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
1904
|
-
const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
|
|
1905
|
-
const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
|
|
1906
|
-
const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
|
|
1907
|
-
try {
|
|
1908
|
-
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
1909
|
-
} catch (error) {
|
|
1910
|
-
return Promise.all([
|
|
1911
|
-
{ error, signal: error.signal, timedOut: error.timedOut },
|
|
1912
|
-
getBufferedData(stdout, stdoutPromise),
|
|
1913
|
-
getBufferedData(stderr, stderrPromise),
|
|
1914
|
-
getBufferedData(all, allPromise)
|
|
1915
|
-
]);
|
|
1916
|
-
}
|
|
1917
|
-
};
|
|
1918
|
-
|
|
1919
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js
|
|
1920
|
-
init_esm_shims();
|
|
1921
|
-
var nativePromisePrototype = (async () => {
|
|
1922
|
-
})().constructor.prototype;
|
|
1923
|
-
var descriptors = ["then", "catch", "finally"].map((property) => [
|
|
1924
|
-
property,
|
|
1925
|
-
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
1926
|
-
]);
|
|
1927
|
-
var mergePromise = (spawned, promise) => {
|
|
1928
|
-
for (const [property, descriptor] of descriptors) {
|
|
1929
|
-
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
1930
|
-
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
1931
|
-
}
|
|
1932
|
-
};
|
|
1933
|
-
var getSpawnedPromise = (spawned) => new Promise((resolve2, reject) => {
|
|
1934
|
-
spawned.on("exit", (exitCode, signal) => {
|
|
1935
|
-
resolve2({ exitCode, signal });
|
|
1936
|
-
});
|
|
1937
|
-
spawned.on("error", (error) => {
|
|
1938
|
-
reject(error);
|
|
1939
|
-
});
|
|
1940
|
-
if (spawned.stdin) {
|
|
1941
|
-
spawned.stdin.on("error", (error) => {
|
|
1942
|
-
reject(error);
|
|
1943
|
-
});
|
|
1944
|
-
}
|
|
1945
|
-
});
|
|
1946
|
-
|
|
1947
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js
|
|
1948
|
-
init_esm_shims();
|
|
1949
|
-
import { Buffer as Buffer2 } from "buffer";
|
|
1950
|
-
import { ChildProcess as ChildProcess2 } from "child_process";
|
|
1951
|
-
var normalizeArgs = (file, args = []) => {
|
|
1952
|
-
if (!Array.isArray(args)) {
|
|
1953
|
-
return [file];
|
|
1954
|
-
}
|
|
1955
|
-
return [file, ...args];
|
|
1956
|
-
};
|
|
1957
|
-
var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
|
|
1958
|
-
var escapeArg = (arg) => {
|
|
1959
|
-
if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
|
|
1960
|
-
return arg;
|
|
1961
|
-
}
|
|
1962
|
-
return `"${arg.replaceAll('"', '\\"')}"`;
|
|
1963
|
-
};
|
|
1964
|
-
var joinCommand = (file, args) => normalizeArgs(file, args).join(" ");
|
|
1965
|
-
var getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" ");
|
|
1966
|
-
var SPACES_REGEXP = / +/g;
|
|
1967
|
-
var parseExpression = (expression) => {
|
|
1968
|
-
const typeOfExpression = typeof expression;
|
|
1969
|
-
if (typeOfExpression === "string") {
|
|
1970
|
-
return expression;
|
|
1971
|
-
}
|
|
1972
|
-
if (typeOfExpression === "number") {
|
|
1973
|
-
return String(expression);
|
|
1974
|
-
}
|
|
1975
|
-
if (typeOfExpression === "object" && expression !== null && !(expression instanceof ChildProcess2) && "stdout" in expression) {
|
|
1976
|
-
const typeOfStdout = typeof expression.stdout;
|
|
1977
|
-
if (typeOfStdout === "string") {
|
|
1978
|
-
return expression.stdout;
|
|
1979
|
-
}
|
|
1980
|
-
if (Buffer2.isBuffer(expression.stdout)) {
|
|
1981
|
-
return expression.stdout.toString();
|
|
1982
|
-
}
|
|
1983
|
-
throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
|
|
1984
|
-
}
|
|
1985
|
-
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
1986
|
-
};
|
|
1987
|
-
var concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
|
|
1988
|
-
...tokens.slice(0, -1),
|
|
1989
|
-
`${tokens.at(-1)}${nextTokens[0]}`,
|
|
1990
|
-
...nextTokens.slice(1)
|
|
1991
|
-
];
|
|
1992
|
-
var parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
1993
|
-
const templateString = template ?? templates.raw[index];
|
|
1994
|
-
const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
|
|
1995
|
-
const newTokens = concatTokens(
|
|
1996
|
-
tokens,
|
|
1997
|
-
templateTokens,
|
|
1998
|
-
templateString.startsWith(" ")
|
|
1999
|
-
);
|
|
2000
|
-
if (index === expressions.length) {
|
|
2001
|
-
return newTokens;
|
|
2002
|
-
}
|
|
2003
|
-
const expression = expressions[index];
|
|
2004
|
-
const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
|
|
2005
|
-
return concatTokens(
|
|
2006
|
-
newTokens,
|
|
2007
|
-
expressionTokens,
|
|
2008
|
-
templateString.endsWith(" ")
|
|
2009
|
-
);
|
|
2010
|
-
};
|
|
2011
|
-
var parseTemplates = (templates, expressions) => {
|
|
2012
|
-
let tokens = [];
|
|
2013
|
-
for (const [index, template] of templates.entries()) {
|
|
2014
|
-
tokens = parseTemplate({ templates, expressions, tokens, index, template });
|
|
2015
|
-
}
|
|
2016
|
-
return tokens;
|
|
2017
|
-
};
|
|
2018
|
-
|
|
2019
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js
|
|
2020
|
-
init_esm_shims();
|
|
2021
|
-
import { debuglog } from "util";
|
|
2022
|
-
import process5 from "process";
|
|
2023
|
-
var verboseDefault = debuglog("execa").enabled;
|
|
2024
|
-
var padField = (field, padding) => String(field).padStart(padding, "0");
|
|
2025
|
-
var getTimestamp = () => {
|
|
2026
|
-
const date = /* @__PURE__ */ new Date();
|
|
2027
|
-
return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
|
|
2028
|
-
};
|
|
2029
|
-
var logCommand = (escapedCommand, { verbose }) => {
|
|
2030
|
-
if (!verbose) {
|
|
2031
|
-
return;
|
|
2032
|
-
}
|
|
2033
|
-
process5.stderr.write(`[${getTimestamp()}] ${escapedCommand}
|
|
2034
|
-
`);
|
|
2035
|
-
};
|
|
2036
|
-
|
|
2037
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
|
|
2038
|
-
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
2039
|
-
var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
2040
|
-
const env = extendEnv ? { ...process6.env, ...envOption } : envOption;
|
|
2041
|
-
if (preferLocal) {
|
|
2042
|
-
return npmRunPathEnv({ env, cwd: localDir, execPath });
|
|
2043
|
-
}
|
|
2044
|
-
return env;
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
2045
15
|
};
|
|
2046
|
-
var
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
args = parsed.args;
|
|
2050
|
-
options = parsed.options;
|
|
2051
|
-
options = {
|
|
2052
|
-
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
2053
|
-
buffer: true,
|
|
2054
|
-
stripFinalNewline: true,
|
|
2055
|
-
extendEnv: true,
|
|
2056
|
-
preferLocal: false,
|
|
2057
|
-
localDir: options.cwd || process6.cwd(),
|
|
2058
|
-
execPath: process6.execPath,
|
|
2059
|
-
encoding: "utf8",
|
|
2060
|
-
reject: true,
|
|
2061
|
-
cleanup: true,
|
|
2062
|
-
all: false,
|
|
2063
|
-
windowsHide: true,
|
|
2064
|
-
verbose: verboseDefault,
|
|
2065
|
-
...options
|
|
2066
|
-
};
|
|
2067
|
-
options.env = getEnv(options);
|
|
2068
|
-
options.stdio = normalizeStdio(options);
|
|
2069
|
-
if (process6.platform === "win32" && path3.basename(file, ".exe") === "cmd") {
|
|
2070
|
-
args.unshift("/q");
|
|
2071
|
-
}
|
|
2072
|
-
return { file, args, options, parsed };
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
2073
19
|
};
|
|
2074
|
-
var
|
|
2075
|
-
if (typeof
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
return stripFinalNewline(value);
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
2080
25
|
}
|
|
2081
|
-
return
|
|
26
|
+
return to;
|
|
2082
27
|
};
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
|
|
2092
|
-
} catch (error) {
|
|
2093
|
-
const dummySpawned = new childProcess.ChildProcess();
|
|
2094
|
-
const errorPromise = Promise.reject(makeError({
|
|
2095
|
-
error,
|
|
2096
|
-
stdout: "",
|
|
2097
|
-
stderr: "",
|
|
2098
|
-
all: "",
|
|
2099
|
-
command,
|
|
2100
|
-
escapedCommand,
|
|
2101
|
-
parsed,
|
|
2102
|
-
timedOut: false,
|
|
2103
|
-
isCanceled: false,
|
|
2104
|
-
killed: false
|
|
2105
|
-
}));
|
|
2106
|
-
mergePromise(dummySpawned, errorPromise);
|
|
2107
|
-
return dummySpawned;
|
|
2108
|
-
}
|
|
2109
|
-
const spawnedPromise = getSpawnedPromise(spawned);
|
|
2110
|
-
const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
|
|
2111
|
-
const processDone = setExitHandler(spawned, parsed.options, timedPromise);
|
|
2112
|
-
const context = { isCanceled: false };
|
|
2113
|
-
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
|
|
2114
|
-
spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
|
2115
|
-
const handlePromise = async () => {
|
|
2116
|
-
const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
|
|
2117
|
-
const stdout = handleOutput(parsed.options, stdoutResult);
|
|
2118
|
-
const stderr = handleOutput(parsed.options, stderrResult);
|
|
2119
|
-
const all = handleOutput(parsed.options, allResult);
|
|
2120
|
-
if (error || exitCode !== 0 || signal !== null) {
|
|
2121
|
-
const returnedError = makeError({
|
|
2122
|
-
error,
|
|
2123
|
-
exitCode,
|
|
2124
|
-
signal,
|
|
2125
|
-
stdout,
|
|
2126
|
-
stderr,
|
|
2127
|
-
all,
|
|
2128
|
-
command,
|
|
2129
|
-
escapedCommand,
|
|
2130
|
-
parsed,
|
|
2131
|
-
timedOut,
|
|
2132
|
-
isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
|
|
2133
|
-
killed: spawned.killed
|
|
2134
|
-
});
|
|
2135
|
-
if (!parsed.options.reject) {
|
|
2136
|
-
return returnedError;
|
|
2137
|
-
}
|
|
2138
|
-
throw returnedError;
|
|
2139
|
-
}
|
|
2140
|
-
return {
|
|
2141
|
-
command,
|
|
2142
|
-
escapedCommand,
|
|
2143
|
-
exitCode: 0,
|
|
2144
|
-
stdout,
|
|
2145
|
-
stderr,
|
|
2146
|
-
all,
|
|
2147
|
-
failed: false,
|
|
2148
|
-
timedOut: false,
|
|
2149
|
-
isCanceled: false,
|
|
2150
|
-
killed: false
|
|
2151
|
-
};
|
|
2152
|
-
};
|
|
2153
|
-
const handlePromiseOnce = onetime_default(handlePromise);
|
|
2154
|
-
handleInput(spawned, parsed.options);
|
|
2155
|
-
spawned.all = makeAllStream(spawned, parsed.options);
|
|
2156
|
-
addPipeMethods(spawned);
|
|
2157
|
-
mergePromise(spawned, handlePromiseOnce);
|
|
2158
|
-
return spawned;
|
|
2159
|
-
}
|
|
2160
|
-
function execaSync(file, args, options) {
|
|
2161
|
-
const parsed = handleArguments(file, args, options);
|
|
2162
|
-
const command = joinCommand(file, args);
|
|
2163
|
-
const escapedCommand = getEscapedCommand(file, args);
|
|
2164
|
-
logCommand(escapedCommand, parsed.options);
|
|
2165
|
-
const input = handleInputSync(parsed.options);
|
|
2166
|
-
let result;
|
|
2167
|
-
try {
|
|
2168
|
-
result = childProcess.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
|
|
2169
|
-
} catch (error) {
|
|
2170
|
-
throw makeError({
|
|
2171
|
-
error,
|
|
2172
|
-
stdout: "",
|
|
2173
|
-
stderr: "",
|
|
2174
|
-
all: "",
|
|
2175
|
-
command,
|
|
2176
|
-
escapedCommand,
|
|
2177
|
-
parsed,
|
|
2178
|
-
timedOut: false,
|
|
2179
|
-
isCanceled: false,
|
|
2180
|
-
killed: false
|
|
2181
|
-
});
|
|
2182
|
-
}
|
|
2183
|
-
const stdout = handleOutput(parsed.options, result.stdout, result.error);
|
|
2184
|
-
const stderr = handleOutput(parsed.options, result.stderr, result.error);
|
|
2185
|
-
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
2186
|
-
const error = makeError({
|
|
2187
|
-
stdout,
|
|
2188
|
-
stderr,
|
|
2189
|
-
error: result.error,
|
|
2190
|
-
signal: result.signal,
|
|
2191
|
-
exitCode: result.status,
|
|
2192
|
-
command,
|
|
2193
|
-
escapedCommand,
|
|
2194
|
-
parsed,
|
|
2195
|
-
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
2196
|
-
isCanceled: false,
|
|
2197
|
-
killed: result.signal !== null
|
|
2198
|
-
});
|
|
2199
|
-
if (!parsed.options.reject) {
|
|
2200
|
-
return error;
|
|
2201
|
-
}
|
|
2202
|
-
throw error;
|
|
2203
|
-
}
|
|
2204
|
-
return {
|
|
2205
|
-
command,
|
|
2206
|
-
escapedCommand,
|
|
2207
|
-
exitCode: 0,
|
|
2208
|
-
stdout,
|
|
2209
|
-
stderr,
|
|
2210
|
-
failed: false,
|
|
2211
|
-
timedOut: false,
|
|
2212
|
-
isCanceled: false,
|
|
2213
|
-
killed: false
|
|
2214
|
-
};
|
|
2215
|
-
}
|
|
2216
|
-
var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {};
|
|
2217
|
-
var normalizeScriptOptions = (options = {}) => ({
|
|
2218
|
-
preferLocal: true,
|
|
2219
|
-
...normalizeScriptStdin(options),
|
|
2220
|
-
...options
|
|
2221
|
-
});
|
|
2222
|
-
function create$(options) {
|
|
2223
|
-
function $2(templatesOrOptions, ...expressions) {
|
|
2224
|
-
if (!Array.isArray(templatesOrOptions)) {
|
|
2225
|
-
return create$({ ...options, ...templatesOrOptions });
|
|
2226
|
-
}
|
|
2227
|
-
const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
|
|
2228
|
-
return execa(file, args, normalizeScriptOptions(options));
|
|
2229
|
-
}
|
|
2230
|
-
$2.sync = (templates, ...expressions) => {
|
|
2231
|
-
if (!Array.isArray(templates)) {
|
|
2232
|
-
throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
|
|
2233
|
-
}
|
|
2234
|
-
const [file, ...args] = parseTemplates(templates, expressions);
|
|
2235
|
-
return execaSync(file, args, normalizeScriptOptions(options));
|
|
2236
|
-
};
|
|
2237
|
-
return $2;
|
|
2238
|
-
}
|
|
2239
|
-
var $ = create$();
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
2240
36
|
|
|
2241
37
|
// ../core/dist/index.js
|
|
38
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
39
|
+
import { mkdir as mkdir3 } from "fs/promises";
|
|
40
|
+
import { existsSync as existsSync3 } from "fs";
|
|
41
|
+
import { resolve } from "path";
|
|
42
|
+
import { execSync } from "child_process";
|
|
43
|
+
import os from "os";
|
|
44
|
+
import { execa } from "execa";
|
|
2242
45
|
import { writeFile } from "fs/promises";
|
|
2243
46
|
import { join } from "path";
|
|
47
|
+
import { execa as execa2 } from "execa";
|
|
2244
48
|
import { writeFile as writeFile2, readFile as readFile2 } from "fs/promises";
|
|
2245
49
|
import { existsSync } from "fs";
|
|
2246
50
|
import { join as join2 } from "path";
|
|
@@ -2249,9 +53,6 @@ import { mkdir as mkdir2, writeFile as writeFile3, readFile as readFile3 } from
|
|
|
2249
53
|
import { existsSync as existsSync2 } from "fs";
|
|
2250
54
|
import { join as join3 } from "path";
|
|
2251
55
|
|
|
2252
|
-
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js
|
|
2253
|
-
init_esm_shims();
|
|
2254
|
-
|
|
2255
56
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
|
|
2256
57
|
var external_exports = {};
|
|
2257
58
|
__export(external_exports, {
|
|
@@ -2363,19 +164,8 @@ __export(external_exports, {
|
|
|
2363
164
|
util: () => util,
|
|
2364
165
|
void: () => voidType
|
|
2365
166
|
});
|
|
2366
|
-
init_esm_shims();
|
|
2367
|
-
|
|
2368
|
-
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
2369
|
-
init_esm_shims();
|
|
2370
|
-
|
|
2371
|
-
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
2372
|
-
init_esm_shims();
|
|
2373
|
-
|
|
2374
|
-
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
2375
|
-
init_esm_shims();
|
|
2376
167
|
|
|
2377
168
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
2378
|
-
init_esm_shims();
|
|
2379
169
|
var util;
|
|
2380
170
|
(function(util2) {
|
|
2381
171
|
util2.assertEqual = (_) => {
|
|
@@ -2740,10 +530,9 @@ function getErrorMap() {
|
|
|
2740
530
|
}
|
|
2741
531
|
|
|
2742
532
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
2743
|
-
init_esm_shims();
|
|
2744
533
|
var makeIssue = (params) => {
|
|
2745
|
-
const { data, path
|
|
2746
|
-
const fullPath = [...
|
|
534
|
+
const { data, path, errorMaps, issueData } = params;
|
|
535
|
+
const fullPath = [...path, ...issueData.path || []];
|
|
2747
536
|
const fullIssue = {
|
|
2748
537
|
...issueData,
|
|
2749
538
|
path: fullPath
|
|
@@ -2850,11 +639,7 @@ var isDirty = (x) => x.status === "dirty";
|
|
|
2850
639
|
var isValid = (x) => x.status === "valid";
|
|
2851
640
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
2852
641
|
|
|
2853
|
-
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
2854
|
-
init_esm_shims();
|
|
2855
|
-
|
|
2856
642
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
2857
|
-
init_esm_shims();
|
|
2858
643
|
var errorUtil;
|
|
2859
644
|
(function(errorUtil2) {
|
|
2860
645
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
@@ -2863,11 +648,11 @@ var errorUtil;
|
|
|
2863
648
|
|
|
2864
649
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
2865
650
|
var ParseInputLazyPath = class {
|
|
2866
|
-
constructor(parent, value,
|
|
651
|
+
constructor(parent, value, path, key) {
|
|
2867
652
|
this._cachedPath = [];
|
|
2868
653
|
this.parent = parent;
|
|
2869
654
|
this.data = value;
|
|
2870
|
-
this._path =
|
|
655
|
+
this._path = path;
|
|
2871
656
|
this._key = key;
|
|
2872
657
|
}
|
|
2873
658
|
get path() {
|
|
@@ -6310,22 +4095,23 @@ var coerce = {
|
|
|
6310
4095
|
var NEVER = INVALID;
|
|
6311
4096
|
|
|
6312
4097
|
// ../core/dist/index.js
|
|
4098
|
+
import { execa as execa3 } from "execa";
|
|
6313
4099
|
import { existsSync as existsSync4 } from "fs";
|
|
6314
4100
|
import { readFile as readFile4 } from "fs/promises";
|
|
6315
4101
|
import { join as join5 } from "path";
|
|
6316
4102
|
function detectOs() {
|
|
6317
|
-
const platform =
|
|
4103
|
+
const platform = os.platform();
|
|
6318
4104
|
if (platform === "darwin") return "darwin";
|
|
6319
4105
|
if (platform === "win32") return "windows";
|
|
6320
4106
|
return "linux";
|
|
6321
4107
|
}
|
|
6322
4108
|
function detectArch() {
|
|
6323
|
-
const arch =
|
|
4109
|
+
const arch = os.arch();
|
|
6324
4110
|
return arch === "arm64" ? "arm64" : "x64";
|
|
6325
4111
|
}
|
|
6326
4112
|
function detectGpu() {
|
|
6327
|
-
const platform =
|
|
6328
|
-
const arch =
|
|
4113
|
+
const platform = os.platform();
|
|
4114
|
+
const arch = os.arch();
|
|
6329
4115
|
if (platform === "darwin" && arch === "arm64") {
|
|
6330
4116
|
try {
|
|
6331
4117
|
const result = execSync("sysctl -n machdep.cpu.brand_string", {
|
|
@@ -6393,8 +4179,8 @@ function detectHardware() {
|
|
|
6393
4179
|
gpu: gpu.type,
|
|
6394
4180
|
gpuName: gpu.name,
|
|
6395
4181
|
cudaVersion: gpu.cudaVersion,
|
|
6396
|
-
totalMemoryGb: Math.round(
|
|
6397
|
-
cpuCores:
|
|
4182
|
+
totalMemoryGb: Math.round(os.totalmem() / (1024 * 1024 * 1024)),
|
|
4183
|
+
cpuCores: os.cpus().length
|
|
6398
4184
|
};
|
|
6399
4185
|
}
|
|
6400
4186
|
function formatHardwareInfo(info) {
|
|
@@ -6845,22 +4631,22 @@ async function checkPythonInstalled() {
|
|
|
6845
4631
|
}
|
|
6846
4632
|
}
|
|
6847
4633
|
async function createPythonEnvironment(options) {
|
|
6848
|
-
const { name, path
|
|
4634
|
+
const { name, path, pythonVersion } = options;
|
|
6849
4635
|
const hasUv = await checkUvInstalled();
|
|
6850
|
-
const envPath = join(
|
|
4636
|
+
const envPath = join(path, ".venv");
|
|
6851
4637
|
try {
|
|
6852
4638
|
if (hasUv) {
|
|
6853
4639
|
const args = ["venv", envPath];
|
|
6854
4640
|
if (pythonVersion) {
|
|
6855
4641
|
args.push("--python", pythonVersion);
|
|
6856
4642
|
}
|
|
6857
|
-
await execa("uv", args, { cwd:
|
|
4643
|
+
await execa("uv", args, { cwd: path });
|
|
6858
4644
|
} else {
|
|
6859
4645
|
const hasPython = await checkPythonInstalled();
|
|
6860
4646
|
if (!hasPython) {
|
|
6861
4647
|
return { success: false, error: "Python is not installed" };
|
|
6862
4648
|
}
|
|
6863
|
-
await execa("python3", ["-m", "venv", envPath], { cwd:
|
|
4649
|
+
await execa("python3", ["-m", "venv", envPath], { cwd: path });
|
|
6864
4650
|
}
|
|
6865
4651
|
return { success: true };
|
|
6866
4652
|
} catch (error) {
|
|
@@ -6959,21 +4745,21 @@ async function restorePythonEnvironment(envPath, lockfile, onProgress) {
|
|
|
6959
4745
|
};
|
|
6960
4746
|
}
|
|
6961
4747
|
}
|
|
6962
|
-
async function detectPackageManager(
|
|
6963
|
-
if (existsSync(join2(
|
|
6964
|
-
if (existsSync(join2(
|
|
6965
|
-
if (existsSync(join2(
|
|
4748
|
+
async function detectPackageManager(path) {
|
|
4749
|
+
if (existsSync(join2(path, "pnpm-lock.yaml"))) return "pnpm";
|
|
4750
|
+
if (existsSync(join2(path, "yarn.lock"))) return "yarn";
|
|
4751
|
+
if (existsSync(join2(path, "package-lock.json"))) return "npm";
|
|
6966
4752
|
try {
|
|
6967
|
-
await
|
|
4753
|
+
await execa2("pnpm", ["--version"]);
|
|
6968
4754
|
return "pnpm";
|
|
6969
4755
|
} catch {
|
|
6970
4756
|
return "npm";
|
|
6971
4757
|
}
|
|
6972
4758
|
}
|
|
6973
4759
|
async function initNodeEnvironment(options) {
|
|
6974
|
-
const { name, path
|
|
6975
|
-
const packageManager = await detectPackageManager(
|
|
6976
|
-
const packageJsonPath = join2(
|
|
4760
|
+
const { name, path } = options;
|
|
4761
|
+
const packageManager = await detectPackageManager(path);
|
|
4762
|
+
const packageJsonPath = join2(path, "package.json");
|
|
6977
4763
|
if (!existsSync(packageJsonPath)) {
|
|
6978
4764
|
const packageJson = {
|
|
6979
4765
|
name: name.toLowerCase().replace(/\s+/g, "-"),
|
|
@@ -7006,7 +4792,7 @@ async function installNodePackages(envPath, packages, onProgress) {
|
|
|
7006
4792
|
for (const spec of packageSpecs) {
|
|
7007
4793
|
onProgress?.(`Installing ${spec}...`);
|
|
7008
4794
|
const args = packageManager === "yarn" ? ["add", spec] : ["install", spec];
|
|
7009
|
-
await
|
|
4795
|
+
await execa2(packageManager, args, { cwd: envPath });
|
|
7010
4796
|
installedPackages.push(spec);
|
|
7011
4797
|
}
|
|
7012
4798
|
return { success: true, installedPackages };
|
|
@@ -7034,11 +4820,11 @@ async function freezeNodeEnvironment(envPath) {
|
|
|
7034
4820
|
}
|
|
7035
4821
|
if (!existsSync(lockfilePath)) {
|
|
7036
4822
|
if (packageManager === "pnpm") {
|
|
7037
|
-
await
|
|
4823
|
+
await execa2("pnpm", ["install", "--lockfile-only"], { cwd: envPath });
|
|
7038
4824
|
} else if (packageManager === "yarn") {
|
|
7039
|
-
await
|
|
4825
|
+
await execa2("yarn", ["install", "--mode", "update-lockfile"], { cwd: envPath });
|
|
7040
4826
|
} else {
|
|
7041
|
-
await
|
|
4827
|
+
await execa2("npm", ["install", "--package-lock-only"], { cwd: envPath });
|
|
7042
4828
|
}
|
|
7043
4829
|
}
|
|
7044
4830
|
const lockfile = await readFile2(lockfilePath, "utf-8");
|
|
@@ -7067,11 +4853,11 @@ async function restoreNodeEnvironment(envPath, lockfile, onProgress) {
|
|
|
7067
4853
|
await writeFile2(lockfilePath, lockfile);
|
|
7068
4854
|
onProgress?.("Restoring environment from lockfile...");
|
|
7069
4855
|
if (packageManager === "pnpm") {
|
|
7070
|
-
await
|
|
4856
|
+
await execa2("pnpm", ["install", "--frozen-lockfile"], { cwd: envPath });
|
|
7071
4857
|
} else if (packageManager === "yarn") {
|
|
7072
|
-
await
|
|
4858
|
+
await execa2("yarn", ["install", "--immutable"], { cwd: envPath });
|
|
7073
4859
|
} else {
|
|
7074
|
-
await
|
|
4860
|
+
await execa2("npm", ["ci"], { cwd: envPath });
|
|
7075
4861
|
}
|
|
7076
4862
|
return { success: true };
|
|
7077
4863
|
} catch (error) {
|
|
@@ -7361,21 +5147,21 @@ var KNOWN_CONFLICTS = [
|
|
|
7361
5147
|
suggestion: "Use jax.numpy instead of importing both"
|
|
7362
5148
|
}
|
|
7363
5149
|
];
|
|
7364
|
-
async function getInstalledPackages(
|
|
5150
|
+
async function getInstalledPackages(path, runtime) {
|
|
7365
5151
|
if (runtime === "python") {
|
|
7366
|
-
return getPythonPackages(
|
|
5152
|
+
return getPythonPackages(path);
|
|
7367
5153
|
} else {
|
|
7368
|
-
return getNodePackages(
|
|
5154
|
+
return getNodePackages(path);
|
|
7369
5155
|
}
|
|
7370
5156
|
}
|
|
7371
|
-
async function getPythonPackages(
|
|
7372
|
-
const venvPath = join5(
|
|
5157
|
+
async function getPythonPackages(path) {
|
|
5158
|
+
const venvPath = join5(path, ".venv");
|
|
7373
5159
|
if (!existsSync4(venvPath)) {
|
|
7374
5160
|
return [];
|
|
7375
5161
|
}
|
|
7376
5162
|
try {
|
|
7377
5163
|
const pipPath = join5(venvPath, "bin", "pip");
|
|
7378
|
-
const result = await
|
|
5164
|
+
const result = await execa3(pipPath, ["list", "--format=json"], { cwd: path });
|
|
7379
5165
|
const packages = JSON.parse(result.stdout);
|
|
7380
5166
|
return packages.map((pkg) => ({
|
|
7381
5167
|
name: pkg.name,
|
|
@@ -7383,10 +5169,10 @@ async function getPythonPackages(path4) {
|
|
|
7383
5169
|
}));
|
|
7384
5170
|
} catch {
|
|
7385
5171
|
try {
|
|
7386
|
-
const result = await
|
|
5172
|
+
const result = await execa3(
|
|
7387
5173
|
"uv",
|
|
7388
5174
|
["pip", "list", "--format=json", "--python", join5(venvPath, "bin", "python")],
|
|
7389
|
-
{ cwd:
|
|
5175
|
+
{ cwd: path }
|
|
7390
5176
|
);
|
|
7391
5177
|
const packages = JSON.parse(result.stdout);
|
|
7392
5178
|
return packages.map((pkg) => ({
|
|
@@ -7398,8 +5184,8 @@ async function getPythonPackages(path4) {
|
|
|
7398
5184
|
}
|
|
7399
5185
|
}
|
|
7400
5186
|
}
|
|
7401
|
-
async function getNodePackages(
|
|
7402
|
-
const packageJsonPath = join5(
|
|
5187
|
+
async function getNodePackages(path) {
|
|
5188
|
+
const packageJsonPath = join5(path, "package.json");
|
|
7403
5189
|
if (!existsSync4(packageJsonPath)) {
|
|
7404
5190
|
return [];
|
|
7405
5191
|
}
|
|
@@ -7466,8 +5252,6 @@ export {
|
|
|
7466
5252
|
__require,
|
|
7467
5253
|
__commonJS,
|
|
7468
5254
|
__toESM,
|
|
7469
|
-
__dirname,
|
|
7470
|
-
init_esm_shims,
|
|
7471
5255
|
loadState,
|
|
7472
5256
|
Komodo,
|
|
7473
5257
|
getInstalledPackages,
|