@prisma/migrate 6.17.0-integration-feat-orm-1074-package-dev-export.1 → 6.17.0-integration-feat-mapped-enums.2

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.
Files changed (37) hide show
  1. package/dist/Migrate.js +4 -3
  2. package/dist/bin.js +28 -27
  3. package/dist/{chunk-F3JIZWIS.js → chunk-3BC6W7CG.js} +13 -13
  4. package/dist/chunk-3WDCTXHL.js +270 -0
  5. package/dist/{chunk-U62JTEME.js → chunk-4GL5WXCD.js} +5 -5
  6. package/dist/{chunk-YEUENY2G.js → chunk-6OQEB4QQ.js} +5 -5
  7. package/dist/{chunk-R2YKCEAN.js → chunk-7E5C5GNE.js} +5 -5
  8. package/dist/{chunk-IKB544RB.js → chunk-CWXY4DCV.js} +8 -21
  9. package/dist/{chunk-DYXEUKV3.js → chunk-D4TRX77Y.js} +6 -6
  10. package/dist/{chunk-YQ6GTOKJ.js → chunk-NI5KWETZ.js} +8 -8
  11. package/dist/{chunk-RNQEWSLQ.js → chunk-NL3WCYT3.js} +6 -6
  12. package/dist/{chunk-BKW5AGJV.js → chunk-NXWNFR5U.js} +5 -5
  13. package/dist/chunk-PHXLQVPT.js +1890 -0
  14. package/dist/{chunk-WXE3X4AN.js → chunk-R7B3TZ5A.js} +5 -5
  15. package/dist/{chunk-G56DQP5E.js → chunk-UPOG7SD7.js} +5 -5
  16. package/dist/{chunk-QF5OMSPA.js → chunk-USJF4W7L.js} +5 -5
  17. package/dist/{chunk-IINN7QUV.js → chunk-VU5BLQUI.js} +8 -8
  18. package/dist/{chunk-URKH6SE2.js → chunk-VV4M6AN7.js} +5 -251
  19. package/dist/{chunk-B64PYCYC.js → chunk-ZYGQLUWA.js} +8 -8
  20. package/dist/commands/DbExecute.js +5 -4
  21. package/dist/commands/DbPull.js +6 -5
  22. package/dist/commands/DbPush.js +5 -4
  23. package/dist/commands/DbSeed.js +4 -3
  24. package/dist/commands/MigrateDeploy.js +5 -4
  25. package/dist/commands/MigrateDev.js +6 -5
  26. package/dist/commands/MigrateDiff.js +5 -4
  27. package/dist/commands/MigrateReset.js +6 -5
  28. package/dist/commands/MigrateResolve.js +5 -4
  29. package/dist/commands/MigrateStatus.js +5 -4
  30. package/dist/index.js +30 -29
  31. package/dist/utils/getDatabaseVersionSafe.js +5 -4
  32. package/dist/utils/introspectSql.js +5 -4
  33. package/dist/utils/seed.js +4 -3
  34. package/dist/utils/setupMysql.js +2527 -1451
  35. package/dist/utils/spinner.js +4 -3
  36. package/package.json +12 -14
  37. package/dist/chunk-HFXUQT52.js +0 -1982
@@ -1,1982 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_HFXUQT52_exports = {};
30
- __export(chunk_HFXUQT52_exports, {
31
- executeSeedCommand: () => executeSeedCommand,
32
- getSeedCommandFromPackageJson: () => getSeedCommandFromPackageJson
33
- });
34
- module.exports = __toCommonJS(chunk_HFXUQT52_exports);
35
- var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
36
- var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
37
- var import_node_path = __toESM(require("node:path"));
38
- var import_config = require("@prisma/config");
39
- var import_debug = __toESM(require("@prisma/debug"));
40
- var require_windows = (0, import_chunk_2ESYSVXG.__commonJS)({
41
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) {
42
- "use strict";
43
- module2.exports = isexe;
44
- isexe.sync = sync;
45
- var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
46
- function checkPathExt(path2, options) {
47
- var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
48
- if (!pathext) {
49
- return true;
50
- }
51
- pathext = pathext.split(";");
52
- if (pathext.indexOf("") !== -1) {
53
- return true;
54
- }
55
- for (var i = 0; i < pathext.length; i++) {
56
- var p = pathext[i].toLowerCase();
57
- if (p && path2.substr(-p.length).toLowerCase() === p) {
58
- return true;
59
- }
60
- }
61
- return false;
62
- }
63
- function checkStat(stat, path2, options) {
64
- if (!stat.isSymbolicLink() && !stat.isFile()) {
65
- return false;
66
- }
67
- return checkPathExt(path2, options);
68
- }
69
- function isexe(path2, options, cb) {
70
- fs.stat(path2, function(er, stat) {
71
- cb(er, er ? false : checkStat(stat, path2, options));
72
- });
73
- }
74
- function sync(path2, options) {
75
- return checkStat(fs.statSync(path2), path2, options);
76
- }
77
- }
78
- });
79
- var require_mode = (0, import_chunk_2ESYSVXG.__commonJS)({
80
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module2) {
81
- "use strict";
82
- module2.exports = isexe;
83
- isexe.sync = sync;
84
- var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
85
- function isexe(path2, options, cb) {
86
- fs.stat(path2, function(er, stat) {
87
- cb(er, er ? false : checkStat(stat, options));
88
- });
89
- }
90
- function sync(path2, options) {
91
- return checkStat(fs.statSync(path2), options);
92
- }
93
- function checkStat(stat, options) {
94
- return stat.isFile() && checkMode(stat, options);
95
- }
96
- function checkMode(stat, options) {
97
- var mod = stat.mode;
98
- var uid = stat.uid;
99
- var gid = stat.gid;
100
- var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
101
- var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
102
- var u = parseInt("100", 8);
103
- var g = parseInt("010", 8);
104
- var o = parseInt("001", 8);
105
- var ug = u | g;
106
- var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
107
- return ret;
108
- }
109
- }
110
- });
111
- var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
112
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module2) {
113
- "use strict";
114
- var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
115
- var core;
116
- if (process.platform === "win32" || global.TESTING_WINDOWS) {
117
- core = require_windows();
118
- } else {
119
- core = require_mode();
120
- }
121
- module2.exports = isexe;
122
- isexe.sync = sync;
123
- function isexe(path2, options, cb) {
124
- if (typeof options === "function") {
125
- cb = options;
126
- options = {};
127
- }
128
- if (!cb) {
129
- if (typeof Promise !== "function") {
130
- throw new TypeError("callback not provided");
131
- }
132
- return new Promise(function(resolve, reject) {
133
- isexe(path2, options || {}, function(er, is) {
134
- if (er) {
135
- reject(er);
136
- } else {
137
- resolve(is);
138
- }
139
- });
140
- });
141
- }
142
- core(path2, options || {}, function(er, is) {
143
- if (er) {
144
- if (er.code === "EACCES" || options && options.ignoreErrors) {
145
- er = null;
146
- is = false;
147
- }
148
- }
149
- cb(er, is);
150
- });
151
- }
152
- function sync(path2, options) {
153
- try {
154
- return core.sync(path2, options || {});
155
- } catch (er) {
156
- if (options && options.ignoreErrors || er.code === "EACCES") {
157
- return false;
158
- } else {
159
- throw er;
160
- }
161
- }
162
- }
163
- }
164
- });
165
- var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
166
- "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module2) {
167
- "use strict";
168
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
169
- var path2 = (0, import_chunk_2ESYSVXG.__require)("path");
170
- var COLON = isWindows ? ";" : ":";
171
- var isexe = require_isexe();
172
- var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
173
- var getPathInfo = (cmd, opt) => {
174
- const colon = opt.colon || COLON;
175
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
176
- // windows always checks the cwd first
177
- ...isWindows ? [process.cwd()] : [],
178
- ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
179
- "").split(colon)
180
- ];
181
- const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
182
- const pathExt = isWindows ? pathExtExe.split(colon) : [""];
183
- if (isWindows) {
184
- if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
185
- pathExt.unshift("");
186
- }
187
- return {
188
- pathEnv,
189
- pathExt,
190
- pathExtExe
191
- };
192
- };
193
- var which = (cmd, opt, cb) => {
194
- if (typeof opt === "function") {
195
- cb = opt;
196
- opt = {};
197
- }
198
- if (!opt)
199
- opt = {};
200
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
201
- const found = [];
202
- const step = (i) => new Promise((resolve, reject) => {
203
- if (i === pathEnv.length)
204
- return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
205
- const ppRaw = pathEnv[i];
206
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
207
- const pCmd = path2.join(pathPart, cmd);
208
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
209
- resolve(subStep(p, i, 0));
210
- });
211
- const subStep = (p, i, ii) => new Promise((resolve, reject) => {
212
- if (ii === pathExt.length)
213
- return resolve(step(i + 1));
214
- const ext = pathExt[ii];
215
- isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
216
- if (!er && is) {
217
- if (opt.all)
218
- found.push(p + ext);
219
- else
220
- return resolve(p + ext);
221
- }
222
- return resolve(subStep(p, i, ii + 1));
223
- });
224
- });
225
- return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
226
- };
227
- var whichSync = (cmd, opt) => {
228
- opt = opt || {};
229
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
230
- const found = [];
231
- for (let i = 0; i < pathEnv.length; i++) {
232
- const ppRaw = pathEnv[i];
233
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
234
- const pCmd = path2.join(pathPart, cmd);
235
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
236
- for (let j = 0; j < pathExt.length; j++) {
237
- const cur = p + pathExt[j];
238
- try {
239
- const is = isexe.sync(cur, { pathExt: pathExtExe });
240
- if (is) {
241
- if (opt.all)
242
- found.push(cur);
243
- else
244
- return cur;
245
- }
246
- } catch (ex) {
247
- }
248
- }
249
- }
250
- if (opt.all && found.length)
251
- return found;
252
- if (opt.nothrow)
253
- return null;
254
- throw getNotFoundError(cmd);
255
- };
256
- module2.exports = which;
257
- which.sync = whichSync;
258
- }
259
- });
260
- var require_path_key = (0, import_chunk_2ESYSVXG.__commonJS)({
261
- "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module2) {
262
- "use strict";
263
- var pathKey = (options = {}) => {
264
- const environment = options.env || process.env;
265
- const platform = options.platform || process.platform;
266
- if (platform !== "win32") {
267
- return "PATH";
268
- }
269
- return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
270
- };
271
- module2.exports = pathKey;
272
- module2.exports.default = pathKey;
273
- }
274
- });
275
- var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
276
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
277
- "use strict";
278
- var path2 = (0, import_chunk_2ESYSVXG.__require)("path");
279
- var which = require_which();
280
- var getPathKey = require_path_key();
281
- function resolveCommandAttempt(parsed, withoutPathExt) {
282
- const env = parsed.options.env || process.env;
283
- const cwd = process.cwd();
284
- const hasCustomCwd = parsed.options.cwd != null;
285
- const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
286
- if (shouldSwitchCwd) {
287
- try {
288
- process.chdir(parsed.options.cwd);
289
- } catch (err) {
290
- }
291
- }
292
- let resolved;
293
- try {
294
- resolved = which.sync(parsed.command, {
295
- path: env[getPathKey({ env })],
296
- pathExt: withoutPathExt ? path2.delimiter : void 0
297
- });
298
- } catch (e) {
299
- } finally {
300
- if (shouldSwitchCwd) {
301
- process.chdir(cwd);
302
- }
303
- }
304
- if (resolved) {
305
- resolved = path2.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
306
- }
307
- return resolved;
308
- }
309
- function resolveCommand(parsed) {
310
- return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
311
- }
312
- module2.exports = resolveCommand;
313
- }
314
- });
315
- var require_escape = (0, import_chunk_2ESYSVXG.__commonJS)({
316
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) {
317
- "use strict";
318
- var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
319
- function escapeCommand(arg) {
320
- arg = arg.replace(metaCharsRegExp, "^$1");
321
- return arg;
322
- }
323
- function escapeArgument(arg, doubleEscapeMetaChars) {
324
- arg = `${arg}`;
325
- arg = arg.replace(/(\\*)"/g, '$1$1\\"');
326
- arg = arg.replace(/(\\*)$/, "$1$1");
327
- arg = `"${arg}"`;
328
- arg = arg.replace(metaCharsRegExp, "^$1");
329
- if (doubleEscapeMetaChars) {
330
- arg = arg.replace(metaCharsRegExp, "^$1");
331
- }
332
- return arg;
333
- }
334
- module2.exports.command = escapeCommand;
335
- module2.exports.argument = escapeArgument;
336
- }
337
- });
338
- var require_shebang_regex = (0, import_chunk_2ESYSVXG.__commonJS)({
339
- "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module2) {
340
- "use strict";
341
- module2.exports = /^#!(.*)/;
342
- }
343
- });
344
- var require_shebang_command = (0, import_chunk_2ESYSVXG.__commonJS)({
345
- "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module2) {
346
- "use strict";
347
- var shebangRegex = require_shebang_regex();
348
- module2.exports = (string = "") => {
349
- const match = string.match(shebangRegex);
350
- if (!match) {
351
- return null;
352
- }
353
- const [path2, argument] = match[0].replace(/#! ?/, "").split(" ");
354
- const binary = path2.split("/").pop();
355
- if (binary === "env") {
356
- return argument;
357
- }
358
- return argument ? `${binary} ${argument}` : binary;
359
- };
360
- }
361
- });
362
- var require_readShebang = (0, import_chunk_2ESYSVXG.__commonJS)({
363
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
364
- "use strict";
365
- var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
366
- var shebangCommand = require_shebang_command();
367
- function readShebang(command) {
368
- const size = 150;
369
- const buffer = Buffer.alloc(size);
370
- let fd;
371
- try {
372
- fd = fs.openSync(command, "r");
373
- fs.readSync(fd, buffer, 0, size, 0);
374
- fs.closeSync(fd);
375
- } catch (e) {
376
- }
377
- return shebangCommand(buffer.toString());
378
- }
379
- module2.exports = readShebang;
380
- }
381
- });
382
- var require_parse = (0, import_chunk_2ESYSVXG.__commonJS)({
383
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
384
- "use strict";
385
- var path2 = (0, import_chunk_2ESYSVXG.__require)("path");
386
- var resolveCommand = require_resolveCommand();
387
- var escape = require_escape();
388
- var readShebang = require_readShebang();
389
- var isWin = process.platform === "win32";
390
- var isExecutableRegExp = /\.(?:com|exe)$/i;
391
- var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
392
- function detectShebang(parsed) {
393
- parsed.file = resolveCommand(parsed);
394
- const shebang = parsed.file && readShebang(parsed.file);
395
- if (shebang) {
396
- parsed.args.unshift(parsed.file);
397
- parsed.command = shebang;
398
- return resolveCommand(parsed);
399
- }
400
- return parsed.file;
401
- }
402
- function parseNonShell(parsed) {
403
- if (!isWin) {
404
- return parsed;
405
- }
406
- const commandFile = detectShebang(parsed);
407
- const needsShell = !isExecutableRegExp.test(commandFile);
408
- if (parsed.options.forceShell || needsShell) {
409
- const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
410
- parsed.command = path2.normalize(parsed.command);
411
- parsed.command = escape.command(parsed.command);
412
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
413
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
414
- parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
415
- parsed.command = process.env.comspec || "cmd.exe";
416
- parsed.options.windowsVerbatimArguments = true;
417
- }
418
- return parsed;
419
- }
420
- function parse(command, args, options) {
421
- if (args && !Array.isArray(args)) {
422
- options = args;
423
- args = null;
424
- }
425
- args = args ? args.slice(0) : [];
426
- options = Object.assign({}, options);
427
- const parsed = {
428
- command,
429
- args,
430
- options,
431
- file: void 0,
432
- original: {
433
- command,
434
- args
435
- }
436
- };
437
- return options.shell ? parsed : parseNonShell(parsed);
438
- }
439
- module2.exports = parse;
440
- }
441
- });
442
- var require_enoent = (0, import_chunk_2ESYSVXG.__commonJS)({
443
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
444
- "use strict";
445
- var isWin = process.platform === "win32";
446
- function notFoundError(original, syscall) {
447
- return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
448
- code: "ENOENT",
449
- errno: "ENOENT",
450
- syscall: `${syscall} ${original.command}`,
451
- path: original.command,
452
- spawnargs: original.args
453
- });
454
- }
455
- function hookChildProcess(cp, parsed) {
456
- if (!isWin) {
457
- return;
458
- }
459
- const originalEmit = cp.emit;
460
- cp.emit = function(name, arg1) {
461
- if (name === "exit") {
462
- const err = verifyENOENT(arg1, parsed, "spawn");
463
- if (err) {
464
- return originalEmit.call(cp, "error", err);
465
- }
466
- }
467
- return originalEmit.apply(cp, arguments);
468
- };
469
- }
470
- function verifyENOENT(status, parsed) {
471
- if (isWin && status === 1 && !parsed.file) {
472
- return notFoundError(parsed.original, "spawn");
473
- }
474
- return null;
475
- }
476
- function verifyENOENTSync(status, parsed) {
477
- if (isWin && status === 1 && !parsed.file) {
478
- return notFoundError(parsed.original, "spawnSync");
479
- }
480
- return null;
481
- }
482
- module2.exports = {
483
- hookChildProcess,
484
- verifyENOENT,
485
- verifyENOENTSync,
486
- notFoundError
487
- };
488
- }
489
- });
490
- var require_cross_spawn = (0, import_chunk_2ESYSVXG.__commonJS)({
491
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports, module2) {
492
- "use strict";
493
- var cp = (0, import_chunk_2ESYSVXG.__require)("child_process");
494
- var parse = require_parse();
495
- var enoent = require_enoent();
496
- function spawn(command, args, options) {
497
- const parsed = parse(command, args, options);
498
- const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
499
- enoent.hookChildProcess(spawned, parsed);
500
- return spawned;
501
- }
502
- function spawnSync(command, args, options) {
503
- const parsed = parse(command, args, options);
504
- const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
505
- result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
506
- return result;
507
- }
508
- module2.exports = spawn;
509
- module2.exports.spawn = spawn;
510
- module2.exports.sync = spawnSync;
511
- module2.exports._parse = parse;
512
- module2.exports._enoent = enoent;
513
- }
514
- });
515
- var require_strip_final_newline = (0, import_chunk_2ESYSVXG.__commonJS)({
516
- "../../node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js"(exports, module2) {
517
- "use strict";
518
- module2.exports = (input) => {
519
- const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
520
- const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
521
- if (input[input.length - 1] === LF) {
522
- input = input.slice(0, input.length - 1);
523
- }
524
- if (input[input.length - 1] === CR) {
525
- input = input.slice(0, input.length - 1);
526
- }
527
- return input;
528
- };
529
- }
530
- });
531
- var require_npm_run_path = (0, import_chunk_2ESYSVXG.__commonJS)({
532
- "../../node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js"(exports, module2) {
533
- "use strict";
534
- var path2 = (0, import_chunk_2ESYSVXG.__require)("path");
535
- var pathKey = require_path_key();
536
- var npmRunPath = (options) => {
537
- options = {
538
- cwd: process.cwd(),
539
- path: process.env[pathKey()],
540
- execPath: process.execPath,
541
- ...options
542
- };
543
- let previous;
544
- let cwdPath = path2.resolve(options.cwd);
545
- const result = [];
546
- while (previous !== cwdPath) {
547
- result.push(path2.join(cwdPath, "node_modules/.bin"));
548
- previous = cwdPath;
549
- cwdPath = path2.resolve(cwdPath, "..");
550
- }
551
- const execPathDir = path2.resolve(options.cwd, options.execPath, "..");
552
- result.push(execPathDir);
553
- return result.concat(options.path).join(path2.delimiter);
554
- };
555
- module2.exports = npmRunPath;
556
- module2.exports.default = npmRunPath;
557
- module2.exports.env = (options) => {
558
- options = {
559
- env: process.env,
560
- ...options
561
- };
562
- const env = { ...options.env };
563
- const path3 = pathKey({ env });
564
- options.path = env[path3];
565
- env[path3] = module2.exports(options);
566
- return env;
567
- };
568
- }
569
- });
570
- var require_mimic_fn = (0, import_chunk_2ESYSVXG.__commonJS)({
571
- "../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports, module2) {
572
- "use strict";
573
- var mimicFn = (to, from) => {
574
- for (const prop of Reflect.ownKeys(from)) {
575
- Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
576
- }
577
- return to;
578
- };
579
- module2.exports = mimicFn;
580
- module2.exports.default = mimicFn;
581
- }
582
- });
583
- var require_onetime = (0, import_chunk_2ESYSVXG.__commonJS)({
584
- "../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports, module2) {
585
- "use strict";
586
- var mimicFn = require_mimic_fn();
587
- var calledFunctions = /* @__PURE__ */ new WeakMap();
588
- var onetime = (function_, options = {}) => {
589
- if (typeof function_ !== "function") {
590
- throw new TypeError("Expected a function");
591
- }
592
- let returnValue;
593
- let callCount = 0;
594
- const functionName = function_.displayName || function_.name || "<anonymous>";
595
- const onetime2 = function(...arguments_) {
596
- calledFunctions.set(onetime2, ++callCount);
597
- if (callCount === 1) {
598
- returnValue = function_.apply(this, arguments_);
599
- function_ = null;
600
- } else if (options.throw === true) {
601
- throw new Error(`Function \`${functionName}\` can only be called once`);
602
- }
603
- return returnValue;
604
- };
605
- mimicFn(onetime2, function_);
606
- calledFunctions.set(onetime2, callCount);
607
- return onetime2;
608
- };
609
- module2.exports = onetime;
610
- module2.exports.default = onetime;
611
- module2.exports.callCount = (function_) => {
612
- if (!calledFunctions.has(function_)) {
613
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
614
- }
615
- return calledFunctions.get(function_);
616
- };
617
- }
618
- });
619
- var require_core = (0, import_chunk_2ESYSVXG.__commonJS)({
620
- "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js"(exports) {
621
- "use strict";
622
- Object.defineProperty(exports, "__esModule", { value: true });
623
- exports.SIGNALS = void 0;
624
- var SIGNALS = [
625
- {
626
- name: "SIGHUP",
627
- number: 1,
628
- action: "terminate",
629
- description: "Terminal closed",
630
- standard: "posix"
631
- },
632
- {
633
- name: "SIGINT",
634
- number: 2,
635
- action: "terminate",
636
- description: "User interruption with CTRL-C",
637
- standard: "ansi"
638
- },
639
- {
640
- name: "SIGQUIT",
641
- number: 3,
642
- action: "core",
643
- description: "User interruption with CTRL-\\",
644
- standard: "posix"
645
- },
646
- {
647
- name: "SIGILL",
648
- number: 4,
649
- action: "core",
650
- description: "Invalid machine instruction",
651
- standard: "ansi"
652
- },
653
- {
654
- name: "SIGTRAP",
655
- number: 5,
656
- action: "core",
657
- description: "Debugger breakpoint",
658
- standard: "posix"
659
- },
660
- {
661
- name: "SIGABRT",
662
- number: 6,
663
- action: "core",
664
- description: "Aborted",
665
- standard: "ansi"
666
- },
667
- {
668
- name: "SIGIOT",
669
- number: 6,
670
- action: "core",
671
- description: "Aborted",
672
- standard: "bsd"
673
- },
674
- {
675
- name: "SIGBUS",
676
- number: 7,
677
- action: "core",
678
- description: "Bus error due to misaligned, non-existing address or paging error",
679
- standard: "bsd"
680
- },
681
- {
682
- name: "SIGEMT",
683
- number: 7,
684
- action: "terminate",
685
- description: "Command should be emulated but is not implemented",
686
- standard: "other"
687
- },
688
- {
689
- name: "SIGFPE",
690
- number: 8,
691
- action: "core",
692
- description: "Floating point arithmetic error",
693
- standard: "ansi"
694
- },
695
- {
696
- name: "SIGKILL",
697
- number: 9,
698
- action: "terminate",
699
- description: "Forced termination",
700
- standard: "posix",
701
- forced: true
702
- },
703
- {
704
- name: "SIGUSR1",
705
- number: 10,
706
- action: "terminate",
707
- description: "Application-specific signal",
708
- standard: "posix"
709
- },
710
- {
711
- name: "SIGSEGV",
712
- number: 11,
713
- action: "core",
714
- description: "Segmentation fault",
715
- standard: "ansi"
716
- },
717
- {
718
- name: "SIGUSR2",
719
- number: 12,
720
- action: "terminate",
721
- description: "Application-specific signal",
722
- standard: "posix"
723
- },
724
- {
725
- name: "SIGPIPE",
726
- number: 13,
727
- action: "terminate",
728
- description: "Broken pipe or socket",
729
- standard: "posix"
730
- },
731
- {
732
- name: "SIGALRM",
733
- number: 14,
734
- action: "terminate",
735
- description: "Timeout or timer",
736
- standard: "posix"
737
- },
738
- {
739
- name: "SIGTERM",
740
- number: 15,
741
- action: "terminate",
742
- description: "Termination",
743
- standard: "ansi"
744
- },
745
- {
746
- name: "SIGSTKFLT",
747
- number: 16,
748
- action: "terminate",
749
- description: "Stack is empty or overflowed",
750
- standard: "other"
751
- },
752
- {
753
- name: "SIGCHLD",
754
- number: 17,
755
- action: "ignore",
756
- description: "Child process terminated, paused or unpaused",
757
- standard: "posix"
758
- },
759
- {
760
- name: "SIGCLD",
761
- number: 17,
762
- action: "ignore",
763
- description: "Child process terminated, paused or unpaused",
764
- standard: "other"
765
- },
766
- {
767
- name: "SIGCONT",
768
- number: 18,
769
- action: "unpause",
770
- description: "Unpaused",
771
- standard: "posix",
772
- forced: true
773
- },
774
- {
775
- name: "SIGSTOP",
776
- number: 19,
777
- action: "pause",
778
- description: "Paused",
779
- standard: "posix",
780
- forced: true
781
- },
782
- {
783
- name: "SIGTSTP",
784
- number: 20,
785
- action: "pause",
786
- description: 'Paused using CTRL-Z or "suspend"',
787
- standard: "posix"
788
- },
789
- {
790
- name: "SIGTTIN",
791
- number: 21,
792
- action: "pause",
793
- description: "Background process cannot read terminal input",
794
- standard: "posix"
795
- },
796
- {
797
- name: "SIGBREAK",
798
- number: 21,
799
- action: "terminate",
800
- description: "User interruption with CTRL-BREAK",
801
- standard: "other"
802
- },
803
- {
804
- name: "SIGTTOU",
805
- number: 22,
806
- action: "pause",
807
- description: "Background process cannot write to terminal output",
808
- standard: "posix"
809
- },
810
- {
811
- name: "SIGURG",
812
- number: 23,
813
- action: "ignore",
814
- description: "Socket received out-of-band data",
815
- standard: "bsd"
816
- },
817
- {
818
- name: "SIGXCPU",
819
- number: 24,
820
- action: "core",
821
- description: "Process timed out",
822
- standard: "bsd"
823
- },
824
- {
825
- name: "SIGXFSZ",
826
- number: 25,
827
- action: "core",
828
- description: "File too big",
829
- standard: "bsd"
830
- },
831
- {
832
- name: "SIGVTALRM",
833
- number: 26,
834
- action: "terminate",
835
- description: "Timeout or timer",
836
- standard: "bsd"
837
- },
838
- {
839
- name: "SIGPROF",
840
- number: 27,
841
- action: "terminate",
842
- description: "Timeout or timer",
843
- standard: "bsd"
844
- },
845
- {
846
- name: "SIGWINCH",
847
- number: 28,
848
- action: "ignore",
849
- description: "Terminal window size changed",
850
- standard: "bsd"
851
- },
852
- {
853
- name: "SIGIO",
854
- number: 29,
855
- action: "terminate",
856
- description: "I/O is available",
857
- standard: "other"
858
- },
859
- {
860
- name: "SIGPOLL",
861
- number: 29,
862
- action: "terminate",
863
- description: "Watched event",
864
- standard: "other"
865
- },
866
- {
867
- name: "SIGINFO",
868
- number: 29,
869
- action: "ignore",
870
- description: "Request for process information",
871
- standard: "other"
872
- },
873
- {
874
- name: "SIGPWR",
875
- number: 30,
876
- action: "terminate",
877
- description: "Device running out of power",
878
- standard: "systemv"
879
- },
880
- {
881
- name: "SIGSYS",
882
- number: 31,
883
- action: "core",
884
- description: "Invalid system call",
885
- standard: "other"
886
- },
887
- {
888
- name: "SIGUNUSED",
889
- number: 31,
890
- action: "terminate",
891
- description: "Invalid system call",
892
- standard: "other"
893
- }
894
- ];
895
- exports.SIGNALS = SIGNALS;
896
- }
897
- });
898
- var require_realtime = (0, import_chunk_2ESYSVXG.__commonJS)({
899
- "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js"(exports) {
900
- "use strict";
901
- Object.defineProperty(exports, "__esModule", { value: true });
902
- exports.SIGRTMAX = exports.getRealtimeSignals = void 0;
903
- var getRealtimeSignals = function() {
904
- const length = SIGRTMAX - SIGRTMIN + 1;
905
- return Array.from({ length }, getRealtimeSignal);
906
- };
907
- exports.getRealtimeSignals = getRealtimeSignals;
908
- var getRealtimeSignal = function(value, index) {
909
- return {
910
- name: `SIGRT${index + 1}`,
911
- number: SIGRTMIN + index,
912
- action: "terminate",
913
- description: "Application-specific signal (realtime)",
914
- standard: "posix"
915
- };
916
- };
917
- var SIGRTMIN = 34;
918
- var SIGRTMAX = 64;
919
- exports.SIGRTMAX = SIGRTMAX;
920
- }
921
- });
922
- var require_signals = (0, import_chunk_2ESYSVXG.__commonJS)({
923
- "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js"(exports) {
924
- "use strict";
925
- Object.defineProperty(exports, "__esModule", { value: true });
926
- exports.getSignals = void 0;
927
- var _os = (0, import_chunk_2ESYSVXG.__require)("os");
928
- var _core = require_core();
929
- var _realtime = require_realtime();
930
- var getSignals = function() {
931
- const realtimeSignals = (0, _realtime.getRealtimeSignals)();
932
- const signals = [..._core.SIGNALS, ...realtimeSignals].map(normalizeSignal);
933
- return signals;
934
- };
935
- exports.getSignals = getSignals;
936
- var normalizeSignal = function({
937
- name,
938
- number: defaultNumber,
939
- description,
940
- action,
941
- forced = false,
942
- standard
943
- }) {
944
- const {
945
- signals: { [name]: constantSignal }
946
- } = _os.constants;
947
- const supported = constantSignal !== void 0;
948
- const number = supported ? constantSignal : defaultNumber;
949
- return { name, number, description, supported, action, forced, standard };
950
- };
951
- }
952
- });
953
- var require_main = (0, import_chunk_2ESYSVXG.__commonJS)({
954
- "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js"(exports) {
955
- "use strict";
956
- Object.defineProperty(exports, "__esModule", { value: true });
957
- exports.signalsByNumber = exports.signalsByName = void 0;
958
- var _os = (0, import_chunk_2ESYSVXG.__require)("os");
959
- var _signals = require_signals();
960
- var _realtime = require_realtime();
961
- var getSignalsByName = function() {
962
- const signals = (0, _signals.getSignals)();
963
- return signals.reduce(getSignalByName, {});
964
- };
965
- var getSignalByName = function(signalByNameMemo, { name, number, description, supported, action, forced, standard }) {
966
- return {
967
- ...signalByNameMemo,
968
- [name]: { name, number, description, supported, action, forced, standard }
969
- };
970
- };
971
- var signalsByName = getSignalsByName();
972
- exports.signalsByName = signalsByName;
973
- var getSignalsByNumber = function() {
974
- const signals = (0, _signals.getSignals)();
975
- const length = _realtime.SIGRTMAX + 1;
976
- const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals));
977
- return Object.assign({}, ...signalsA);
978
- };
979
- var getSignalByNumber = function(number, signals) {
980
- const signal = findSignalByNumber(number, signals);
981
- if (signal === void 0) {
982
- return {};
983
- }
984
- const { name, description, supported, action, forced, standard } = signal;
985
- return {
986
- [number]: {
987
- name,
988
- number,
989
- description,
990
- supported,
991
- action,
992
- forced,
993
- standard
994
- }
995
- };
996
- };
997
- var findSignalByNumber = function(number, signals) {
998
- const signal = signals.find(({ name }) => _os.constants.signals[name] === number);
999
- if (signal !== void 0) {
1000
- return signal;
1001
- }
1002
- return signals.find((signalA) => signalA.number === number);
1003
- };
1004
- var signalsByNumber = getSignalsByNumber();
1005
- exports.signalsByNumber = signalsByNumber;
1006
- }
1007
- });
1008
- var require_error = (0, import_chunk_2ESYSVXG.__commonJS)({
1009
- "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js"(exports, module2) {
1010
- "use strict";
1011
- var { signalsByName } = require_main();
1012
- var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
1013
- if (timedOut) {
1014
- return `timed out after ${timeout} milliseconds`;
1015
- }
1016
- if (isCanceled) {
1017
- return "was canceled";
1018
- }
1019
- if (errorCode !== void 0) {
1020
- return `failed with ${errorCode}`;
1021
- }
1022
- if (signal !== void 0) {
1023
- return `was killed with ${signal} (${signalDescription})`;
1024
- }
1025
- if (exitCode !== void 0) {
1026
- return `failed with exit code ${exitCode}`;
1027
- }
1028
- return "failed";
1029
- };
1030
- var makeError = ({
1031
- stdout,
1032
- stderr,
1033
- all,
1034
- error,
1035
- signal,
1036
- exitCode,
1037
- command,
1038
- escapedCommand,
1039
- timedOut,
1040
- isCanceled,
1041
- killed,
1042
- parsed: { options: { timeout } }
1043
- }) => {
1044
- exitCode = exitCode === null ? void 0 : exitCode;
1045
- signal = signal === null ? void 0 : signal;
1046
- const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
1047
- const errorCode = error && error.code;
1048
- const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
1049
- const execaMessage = `Command ${prefix}: ${command}`;
1050
- const isError = Object.prototype.toString.call(error) === "[object Error]";
1051
- const shortMessage = isError ? `${execaMessage}
1052
- ${error.message}` : execaMessage;
1053
- const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
1054
- if (isError) {
1055
- error.originalMessage = error.message;
1056
- error.message = message;
1057
- } else {
1058
- error = new Error(message);
1059
- }
1060
- error.shortMessage = shortMessage;
1061
- error.command = command;
1062
- error.escapedCommand = escapedCommand;
1063
- error.exitCode = exitCode;
1064
- error.signal = signal;
1065
- error.signalDescription = signalDescription;
1066
- error.stdout = stdout;
1067
- error.stderr = stderr;
1068
- if (all !== void 0) {
1069
- error.all = all;
1070
- }
1071
- if ("bufferedData" in error) {
1072
- delete error.bufferedData;
1073
- }
1074
- error.failed = true;
1075
- error.timedOut = Boolean(timedOut);
1076
- error.isCanceled = isCanceled;
1077
- error.killed = killed && !timedOut;
1078
- return error;
1079
- };
1080
- module2.exports = makeError;
1081
- }
1082
- });
1083
- var require_stdio = (0, import_chunk_2ESYSVXG.__commonJS)({
1084
- "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js"(exports, module2) {
1085
- "use strict";
1086
- var aliases = ["stdin", "stdout", "stderr"];
1087
- var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
1088
- var normalizeStdio = (options) => {
1089
- if (!options) {
1090
- return;
1091
- }
1092
- const { stdio } = options;
1093
- if (stdio === void 0) {
1094
- return aliases.map((alias) => options[alias]);
1095
- }
1096
- if (hasAlias(options)) {
1097
- throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
1098
- }
1099
- if (typeof stdio === "string") {
1100
- return stdio;
1101
- }
1102
- if (!Array.isArray(stdio)) {
1103
- throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
1104
- }
1105
- const length = Math.max(stdio.length, aliases.length);
1106
- return Array.from({ length }, (value, index) => stdio[index]);
1107
- };
1108
- module2.exports = normalizeStdio;
1109
- module2.exports.node = (options) => {
1110
- const stdio = normalizeStdio(options);
1111
- if (stdio === "ipc") {
1112
- return "ipc";
1113
- }
1114
- if (stdio === void 0 || typeof stdio === "string") {
1115
- return [stdio, stdio, stdio, "ipc"];
1116
- }
1117
- if (stdio.includes("ipc")) {
1118
- return stdio;
1119
- }
1120
- return [...stdio, "ipc"];
1121
- };
1122
- }
1123
- });
1124
- var require_signals2 = (0, import_chunk_2ESYSVXG.__commonJS)({
1125
- "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports, module2) {
1126
- "use strict";
1127
- module2.exports = [
1128
- "SIGABRT",
1129
- "SIGALRM",
1130
- "SIGHUP",
1131
- "SIGINT",
1132
- "SIGTERM"
1133
- ];
1134
- if (process.platform !== "win32") {
1135
- module2.exports.push(
1136
- "SIGVTALRM",
1137
- "SIGXCPU",
1138
- "SIGXFSZ",
1139
- "SIGUSR2",
1140
- "SIGTRAP",
1141
- "SIGSYS",
1142
- "SIGQUIT",
1143
- "SIGIOT"
1144
- // should detect profiler and enable/disable accordingly.
1145
- // see #21
1146
- // 'SIGPROF'
1147
- );
1148
- }
1149
- if (process.platform === "linux") {
1150
- module2.exports.push(
1151
- "SIGIO",
1152
- "SIGPOLL",
1153
- "SIGPWR",
1154
- "SIGSTKFLT",
1155
- "SIGUNUSED"
1156
- );
1157
- }
1158
- }
1159
- });
1160
- var require_signal_exit = (0, import_chunk_2ESYSVXG.__commonJS)({
1161
- "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports, module2) {
1162
- "use strict";
1163
- var process2 = global.process;
1164
- var processOk = function(process3) {
1165
- return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
1166
- };
1167
- if (!processOk(process2)) {
1168
- module2.exports = function() {
1169
- return function() {
1170
- };
1171
- };
1172
- } else {
1173
- assert = (0, import_chunk_2ESYSVXG.__require)("assert");
1174
- signals = require_signals2();
1175
- isWin = /^win/i.test(process2.platform);
1176
- EE = (0, import_chunk_2ESYSVXG.__require)("events");
1177
- if (typeof EE !== "function") {
1178
- EE = EE.EventEmitter;
1179
- }
1180
- if (process2.__signal_exit_emitter__) {
1181
- emitter = process2.__signal_exit_emitter__;
1182
- } else {
1183
- emitter = process2.__signal_exit_emitter__ = new EE();
1184
- emitter.count = 0;
1185
- emitter.emitted = {};
1186
- }
1187
- if (!emitter.infinite) {
1188
- emitter.setMaxListeners(Infinity);
1189
- emitter.infinite = true;
1190
- }
1191
- module2.exports = function(cb, opts) {
1192
- if (!processOk(global.process)) {
1193
- return function() {
1194
- };
1195
- }
1196
- assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
1197
- if (loaded === false) {
1198
- load();
1199
- }
1200
- var ev = "exit";
1201
- if (opts && opts.alwaysLast) {
1202
- ev = "afterexit";
1203
- }
1204
- var remove = function() {
1205
- emitter.removeListener(ev, cb);
1206
- if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
1207
- unload();
1208
- }
1209
- };
1210
- emitter.on(ev, cb);
1211
- return remove;
1212
- };
1213
- unload = function unload2() {
1214
- if (!loaded || !processOk(global.process)) {
1215
- return;
1216
- }
1217
- loaded = false;
1218
- signals.forEach(function(sig) {
1219
- try {
1220
- process2.removeListener(sig, sigListeners[sig]);
1221
- } catch (er) {
1222
- }
1223
- });
1224
- process2.emit = originalProcessEmit;
1225
- process2.reallyExit = originalProcessReallyExit;
1226
- emitter.count -= 1;
1227
- };
1228
- module2.exports.unload = unload;
1229
- emit = function emit2(event, code, signal) {
1230
- if (emitter.emitted[event]) {
1231
- return;
1232
- }
1233
- emitter.emitted[event] = true;
1234
- emitter.emit(event, code, signal);
1235
- };
1236
- sigListeners = {};
1237
- signals.forEach(function(sig) {
1238
- sigListeners[sig] = function listener() {
1239
- if (!processOk(global.process)) {
1240
- return;
1241
- }
1242
- var listeners = process2.listeners(sig);
1243
- if (listeners.length === emitter.count) {
1244
- unload();
1245
- emit("exit", null, sig);
1246
- emit("afterexit", null, sig);
1247
- if (isWin && sig === "SIGHUP") {
1248
- sig = "SIGINT";
1249
- }
1250
- process2.kill(process2.pid, sig);
1251
- }
1252
- };
1253
- });
1254
- module2.exports.signals = function() {
1255
- return signals;
1256
- };
1257
- loaded = false;
1258
- load = function load2() {
1259
- if (loaded || !processOk(global.process)) {
1260
- return;
1261
- }
1262
- loaded = true;
1263
- emitter.count += 1;
1264
- signals = signals.filter(function(sig) {
1265
- try {
1266
- process2.on(sig, sigListeners[sig]);
1267
- return true;
1268
- } catch (er) {
1269
- return false;
1270
- }
1271
- });
1272
- process2.emit = processEmit;
1273
- process2.reallyExit = processReallyExit;
1274
- };
1275
- module2.exports.load = load;
1276
- originalProcessReallyExit = process2.reallyExit;
1277
- processReallyExit = function processReallyExit2(code) {
1278
- if (!processOk(global.process)) {
1279
- return;
1280
- }
1281
- process2.exitCode = code || /* istanbul ignore next */
1282
- 0;
1283
- emit("exit", process2.exitCode, null);
1284
- emit("afterexit", process2.exitCode, null);
1285
- originalProcessReallyExit.call(process2, process2.exitCode);
1286
- };
1287
- originalProcessEmit = process2.emit;
1288
- processEmit = function processEmit2(ev, arg) {
1289
- if (ev === "exit" && processOk(global.process)) {
1290
- if (arg !== void 0) {
1291
- process2.exitCode = arg;
1292
- }
1293
- var ret = originalProcessEmit.apply(this, arguments);
1294
- emit("exit", process2.exitCode, null);
1295
- emit("afterexit", process2.exitCode, null);
1296
- return ret;
1297
- } else {
1298
- return originalProcessEmit.apply(this, arguments);
1299
- }
1300
- };
1301
- }
1302
- var assert;
1303
- var signals;
1304
- var isWin;
1305
- var EE;
1306
- var emitter;
1307
- var unload;
1308
- var emit;
1309
- var sigListeners;
1310
- var loaded;
1311
- var load;
1312
- var originalProcessReallyExit;
1313
- var processReallyExit;
1314
- var originalProcessEmit;
1315
- var processEmit;
1316
- }
1317
- });
1318
- var require_kill = (0, import_chunk_2ESYSVXG.__commonJS)({
1319
- "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js"(exports, module2) {
1320
- "use strict";
1321
- var os = (0, import_chunk_2ESYSVXG.__require)("os");
1322
- var onExit = require_signal_exit();
1323
- var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
1324
- var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
1325
- const killResult = kill(signal);
1326
- setKillTimeout(kill, signal, options, killResult);
1327
- return killResult;
1328
- };
1329
- var setKillTimeout = (kill, signal, options, killResult) => {
1330
- if (!shouldForceKill(signal, options, killResult)) {
1331
- return;
1332
- }
1333
- const timeout = getForceKillAfterTimeout(options);
1334
- const t = setTimeout(() => {
1335
- kill("SIGKILL");
1336
- }, timeout);
1337
- if (t.unref) {
1338
- t.unref();
1339
- }
1340
- };
1341
- var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => {
1342
- return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
1343
- };
1344
- var isSigterm = (signal) => {
1345
- return signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
1346
- };
1347
- var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
1348
- if (forceKillAfterTimeout === true) {
1349
- return DEFAULT_FORCE_KILL_TIMEOUT;
1350
- }
1351
- if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
1352
- throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
1353
- }
1354
- return forceKillAfterTimeout;
1355
- };
1356
- var spawnedCancel = (spawned, context) => {
1357
- const killResult = spawned.kill();
1358
- if (killResult) {
1359
- context.isCanceled = true;
1360
- }
1361
- };
1362
- var timeoutKill = (spawned, signal, reject) => {
1363
- spawned.kill(signal);
1364
- reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
1365
- };
1366
- var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
1367
- if (timeout === 0 || timeout === void 0) {
1368
- return spawnedPromise;
1369
- }
1370
- let timeoutId;
1371
- const timeoutPromise = new Promise((resolve, reject) => {
1372
- timeoutId = setTimeout(() => {
1373
- timeoutKill(spawned, killSignal, reject);
1374
- }, timeout);
1375
- });
1376
- const safeSpawnedPromise = spawnedPromise.finally(() => {
1377
- clearTimeout(timeoutId);
1378
- });
1379
- return Promise.race([timeoutPromise, safeSpawnedPromise]);
1380
- };
1381
- var validateTimeout = ({ timeout }) => {
1382
- if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
1383
- throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
1384
- }
1385
- };
1386
- var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
1387
- if (!cleanup || detached) {
1388
- return timedPromise;
1389
- }
1390
- const removeExitHandler = onExit(() => {
1391
- spawned.kill();
1392
- });
1393
- return timedPromise.finally(() => {
1394
- removeExitHandler();
1395
- });
1396
- };
1397
- module2.exports = {
1398
- spawnedKill,
1399
- spawnedCancel,
1400
- setupTimeout,
1401
- validateTimeout,
1402
- setExitHandler
1403
- };
1404
- }
1405
- });
1406
- var require_is_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
1407
- "../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js"(exports, module2) {
1408
- "use strict";
1409
- var isStream = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
1410
- isStream.writable = (stream) => isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
1411
- isStream.readable = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object";
1412
- isStream.duplex = (stream) => isStream.writable(stream) && isStream.readable(stream);
1413
- isStream.transform = (stream) => isStream.duplex(stream) && typeof stream._transform === "function";
1414
- module2.exports = isStream;
1415
- }
1416
- });
1417
- var require_buffer_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
1418
- "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js"(exports, module2) {
1419
- "use strict";
1420
- var { PassThrough: PassThroughStream } = (0, import_chunk_2ESYSVXG.__require)("stream");
1421
- module2.exports = (options) => {
1422
- options = { ...options };
1423
- const { array } = options;
1424
- let { encoding } = options;
1425
- const isBuffer = encoding === "buffer";
1426
- let objectMode = false;
1427
- if (array) {
1428
- objectMode = !(encoding || isBuffer);
1429
- } else {
1430
- encoding = encoding || "utf8";
1431
- }
1432
- if (isBuffer) {
1433
- encoding = null;
1434
- }
1435
- const stream = new PassThroughStream({ objectMode });
1436
- if (encoding) {
1437
- stream.setEncoding(encoding);
1438
- }
1439
- let length = 0;
1440
- const chunks = [];
1441
- stream.on("data", (chunk) => {
1442
- chunks.push(chunk);
1443
- if (objectMode) {
1444
- length = chunks.length;
1445
- } else {
1446
- length += chunk.length;
1447
- }
1448
- });
1449
- stream.getBufferedValue = () => {
1450
- if (array) {
1451
- return chunks;
1452
- }
1453
- return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
1454
- };
1455
- stream.getBufferedLength = () => length;
1456
- return stream;
1457
- };
1458
- }
1459
- });
1460
- var require_get_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
1461
- "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js"(exports, module2) {
1462
- "use strict";
1463
- var { constants: BufferConstants } = (0, import_chunk_2ESYSVXG.__require)("buffer");
1464
- var stream = (0, import_chunk_2ESYSVXG.__require)("stream");
1465
- var { promisify } = (0, import_chunk_2ESYSVXG.__require)("util");
1466
- var bufferStream = require_buffer_stream();
1467
- var streamPipelinePromisified = promisify(stream.pipeline);
1468
- var MaxBufferError = class extends Error {
1469
- constructor() {
1470
- super("maxBuffer exceeded");
1471
- this.name = "MaxBufferError";
1472
- }
1473
- };
1474
- async function getStream(inputStream, options) {
1475
- if (!inputStream) {
1476
- throw new Error("Expected a stream");
1477
- }
1478
- options = {
1479
- maxBuffer: Infinity,
1480
- ...options
1481
- };
1482
- const { maxBuffer } = options;
1483
- const stream2 = bufferStream(options);
1484
- await new Promise((resolve, reject) => {
1485
- const rejectPromise = (error) => {
1486
- if (error && stream2.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
1487
- error.bufferedData = stream2.getBufferedValue();
1488
- }
1489
- reject(error);
1490
- };
1491
- (async () => {
1492
- try {
1493
- await streamPipelinePromisified(inputStream, stream2);
1494
- resolve();
1495
- } catch (error) {
1496
- rejectPromise(error);
1497
- }
1498
- })();
1499
- stream2.on("data", () => {
1500
- if (stream2.getBufferedLength() > maxBuffer) {
1501
- rejectPromise(new MaxBufferError());
1502
- }
1503
- });
1504
- });
1505
- return stream2.getBufferedValue();
1506
- }
1507
- module2.exports = getStream;
1508
- module2.exports.buffer = (stream2, options) => getStream(stream2, { ...options, encoding: "buffer" });
1509
- module2.exports.array = (stream2, options) => getStream(stream2, { ...options, array: true });
1510
- module2.exports.MaxBufferError = MaxBufferError;
1511
- }
1512
- });
1513
- var require_merge_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
1514
- "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module2) {
1515
- "use strict";
1516
- var { PassThrough } = (0, import_chunk_2ESYSVXG.__require)("stream");
1517
- module2.exports = function() {
1518
- var sources = [];
1519
- var output = new PassThrough({ objectMode: true });
1520
- output.setMaxListeners(0);
1521
- output.add = add;
1522
- output.isEmpty = isEmpty;
1523
- output.on("unpipe", remove);
1524
- Array.prototype.slice.call(arguments).forEach(add);
1525
- return output;
1526
- function add(source) {
1527
- if (Array.isArray(source)) {
1528
- source.forEach(add);
1529
- return this;
1530
- }
1531
- sources.push(source);
1532
- source.once("end", remove.bind(null, source));
1533
- source.once("error", output.emit.bind(output, "error"));
1534
- source.pipe(output, { end: false });
1535
- return this;
1536
- }
1537
- function isEmpty() {
1538
- return sources.length == 0;
1539
- }
1540
- function remove(source) {
1541
- sources = sources.filter(function(it) {
1542
- return it !== source;
1543
- });
1544
- if (!sources.length && output.readable) {
1545
- output.end();
1546
- }
1547
- }
1548
- };
1549
- }
1550
- });
1551
- var require_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
1552
- "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js"(exports, module2) {
1553
- "use strict";
1554
- var isStream = require_is_stream();
1555
- var getStream = require_get_stream();
1556
- var mergeStream = require_merge_stream();
1557
- var handleInput = (spawned, input) => {
1558
- if (input === void 0 || spawned.stdin === void 0) {
1559
- return;
1560
- }
1561
- if (isStream(input)) {
1562
- input.pipe(spawned.stdin);
1563
- } else {
1564
- spawned.stdin.end(input);
1565
- }
1566
- };
1567
- var makeAllStream = (spawned, { all }) => {
1568
- if (!all || !spawned.stdout && !spawned.stderr) {
1569
- return;
1570
- }
1571
- const mixed = mergeStream();
1572
- if (spawned.stdout) {
1573
- mixed.add(spawned.stdout);
1574
- }
1575
- if (spawned.stderr) {
1576
- mixed.add(spawned.stderr);
1577
- }
1578
- return mixed;
1579
- };
1580
- var getBufferedData = async (stream, streamPromise) => {
1581
- if (!stream) {
1582
- return;
1583
- }
1584
- stream.destroy();
1585
- try {
1586
- return await streamPromise;
1587
- } catch (error) {
1588
- return error.bufferedData;
1589
- }
1590
- };
1591
- var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
1592
- if (!stream || !buffer) {
1593
- return;
1594
- }
1595
- if (encoding) {
1596
- return getStream(stream, { encoding, maxBuffer });
1597
- }
1598
- return getStream.buffer(stream, { maxBuffer });
1599
- };
1600
- var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
1601
- const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
1602
- const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
1603
- const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
1604
- try {
1605
- return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
1606
- } catch (error) {
1607
- return Promise.all([
1608
- { error, signal: error.signal, timedOut: error.timedOut },
1609
- getBufferedData(stdout, stdoutPromise),
1610
- getBufferedData(stderr, stderrPromise),
1611
- getBufferedData(all, allPromise)
1612
- ]);
1613
- }
1614
- };
1615
- var validateInputSync = ({ input }) => {
1616
- if (isStream(input)) {
1617
- throw new TypeError("The `input` option cannot be a stream in sync mode");
1618
- }
1619
- };
1620
- module2.exports = {
1621
- handleInput,
1622
- makeAllStream,
1623
- getSpawnedResult,
1624
- validateInputSync
1625
- };
1626
- }
1627
- });
1628
- var require_promise = (0, import_chunk_2ESYSVXG.__commonJS)({
1629
- "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js"(exports, module2) {
1630
- "use strict";
1631
- var nativePromisePrototype = (async () => {
1632
- })().constructor.prototype;
1633
- var descriptors = ["then", "catch", "finally"].map((property) => [
1634
- property,
1635
- Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
1636
- ]);
1637
- var mergePromise = (spawned, promise) => {
1638
- for (const [property, descriptor] of descriptors) {
1639
- const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
1640
- Reflect.defineProperty(spawned, property, { ...descriptor, value });
1641
- }
1642
- return spawned;
1643
- };
1644
- var getSpawnedPromise = (spawned) => {
1645
- return new Promise((resolve, reject) => {
1646
- spawned.on("exit", (exitCode, signal) => {
1647
- resolve({ exitCode, signal });
1648
- });
1649
- spawned.on("error", (error) => {
1650
- reject(error);
1651
- });
1652
- if (spawned.stdin) {
1653
- spawned.stdin.on("error", (error) => {
1654
- reject(error);
1655
- });
1656
- }
1657
- });
1658
- };
1659
- module2.exports = {
1660
- mergePromise,
1661
- getSpawnedPromise
1662
- };
1663
- }
1664
- });
1665
- var require_command = (0, import_chunk_2ESYSVXG.__commonJS)({
1666
- "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js"(exports, module2) {
1667
- "use strict";
1668
- var normalizeArgs = (file, args = []) => {
1669
- if (!Array.isArray(args)) {
1670
- return [file];
1671
- }
1672
- return [file, ...args];
1673
- };
1674
- var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
1675
- var DOUBLE_QUOTES_REGEXP = /"/g;
1676
- var escapeArg = (arg) => {
1677
- if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
1678
- return arg;
1679
- }
1680
- return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`;
1681
- };
1682
- var joinCommand = (file, args) => {
1683
- return normalizeArgs(file, args).join(" ");
1684
- };
1685
- var getEscapedCommand = (file, args) => {
1686
- return normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" ");
1687
- };
1688
- var SPACES_REGEXP = / +/g;
1689
- var parseCommand = (command) => {
1690
- const tokens = [];
1691
- for (const token of command.trim().split(SPACES_REGEXP)) {
1692
- const previousToken = tokens[tokens.length - 1];
1693
- if (previousToken && previousToken.endsWith("\\")) {
1694
- tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
1695
- } else {
1696
- tokens.push(token);
1697
- }
1698
- }
1699
- return tokens;
1700
- };
1701
- module2.exports = {
1702
- joinCommand,
1703
- getEscapedCommand,
1704
- parseCommand
1705
- };
1706
- }
1707
- });
1708
- var require_execa = (0, import_chunk_2ESYSVXG.__commonJS)({
1709
- "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js"(exports, module2) {
1710
- "use strict";
1711
- var path2 = (0, import_chunk_2ESYSVXG.__require)("path");
1712
- var childProcess = (0, import_chunk_2ESYSVXG.__require)("child_process");
1713
- var crossSpawn = require_cross_spawn();
1714
- var stripFinalNewline = require_strip_final_newline();
1715
- var npmRunPath = require_npm_run_path();
1716
- var onetime = require_onetime();
1717
- var makeError = require_error();
1718
- var normalizeStdio = require_stdio();
1719
- var { spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler } = require_kill();
1720
- var { handleInput, getSpawnedResult, makeAllStream, validateInputSync } = require_stream();
1721
- var { mergePromise, getSpawnedPromise } = require_promise();
1722
- var { joinCommand, parseCommand, getEscapedCommand } = require_command();
1723
- var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
1724
- var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
1725
- const env = extendEnv ? { ...process.env, ...envOption } : envOption;
1726
- if (preferLocal) {
1727
- return npmRunPath.env({ env, cwd: localDir, execPath });
1728
- }
1729
- return env;
1730
- };
1731
- var handleArguments = (file, args, options = {}) => {
1732
- const parsed = crossSpawn._parse(file, args, options);
1733
- file = parsed.command;
1734
- args = parsed.args;
1735
- options = parsed.options;
1736
- options = {
1737
- maxBuffer: DEFAULT_MAX_BUFFER,
1738
- buffer: true,
1739
- stripFinalNewline: true,
1740
- extendEnv: true,
1741
- preferLocal: false,
1742
- localDir: options.cwd || process.cwd(),
1743
- execPath: process.execPath,
1744
- encoding: "utf8",
1745
- reject: true,
1746
- cleanup: true,
1747
- all: false,
1748
- windowsHide: true,
1749
- ...options
1750
- };
1751
- options.env = getEnv(options);
1752
- options.stdio = normalizeStdio(options);
1753
- if (process.platform === "win32" && path2.basename(file, ".exe") === "cmd") {
1754
- args.unshift("/q");
1755
- }
1756
- return { file, args, options, parsed };
1757
- };
1758
- var handleOutput = (options, value, error) => {
1759
- if (typeof value !== "string" && !Buffer.isBuffer(value)) {
1760
- return error === void 0 ? void 0 : "";
1761
- }
1762
- if (options.stripFinalNewline) {
1763
- return stripFinalNewline(value);
1764
- }
1765
- return value;
1766
- };
1767
- var execa2 = (file, args, options) => {
1768
- const parsed = handleArguments(file, args, options);
1769
- const command = joinCommand(file, args);
1770
- const escapedCommand = getEscapedCommand(file, args);
1771
- validateTimeout(parsed.options);
1772
- let spawned;
1773
- try {
1774
- spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
1775
- } catch (error) {
1776
- const dummySpawned = new childProcess.ChildProcess();
1777
- const errorPromise = Promise.reject(makeError({
1778
- error,
1779
- stdout: "",
1780
- stderr: "",
1781
- all: "",
1782
- command,
1783
- escapedCommand,
1784
- parsed,
1785
- timedOut: false,
1786
- isCanceled: false,
1787
- killed: false
1788
- }));
1789
- return mergePromise(dummySpawned, errorPromise);
1790
- }
1791
- const spawnedPromise = getSpawnedPromise(spawned);
1792
- const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
1793
- const processDone = setExitHandler(spawned, parsed.options, timedPromise);
1794
- const context = { isCanceled: false };
1795
- spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
1796
- spawned.cancel = spawnedCancel.bind(null, spawned, context);
1797
- const handlePromise = async () => {
1798
- const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
1799
- const stdout = handleOutput(parsed.options, stdoutResult);
1800
- const stderr = handleOutput(parsed.options, stderrResult);
1801
- const all = handleOutput(parsed.options, allResult);
1802
- if (error || exitCode !== 0 || signal !== null) {
1803
- const returnedError = makeError({
1804
- error,
1805
- exitCode,
1806
- signal,
1807
- stdout,
1808
- stderr,
1809
- all,
1810
- command,
1811
- escapedCommand,
1812
- parsed,
1813
- timedOut,
1814
- isCanceled: context.isCanceled,
1815
- killed: spawned.killed
1816
- });
1817
- if (!parsed.options.reject) {
1818
- return returnedError;
1819
- }
1820
- throw returnedError;
1821
- }
1822
- return {
1823
- command,
1824
- escapedCommand,
1825
- exitCode: 0,
1826
- stdout,
1827
- stderr,
1828
- all,
1829
- failed: false,
1830
- timedOut: false,
1831
- isCanceled: false,
1832
- killed: false
1833
- };
1834
- };
1835
- const handlePromiseOnce = onetime(handlePromise);
1836
- handleInput(spawned, parsed.options.input);
1837
- spawned.all = makeAllStream(spawned, parsed.options);
1838
- return mergePromise(spawned, handlePromiseOnce);
1839
- };
1840
- module2.exports = execa2;
1841
- module2.exports.sync = (file, args, options) => {
1842
- const parsed = handleArguments(file, args, options);
1843
- const command = joinCommand(file, args);
1844
- const escapedCommand = getEscapedCommand(file, args);
1845
- validateInputSync(parsed.options);
1846
- let result;
1847
- try {
1848
- result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);
1849
- } catch (error) {
1850
- throw makeError({
1851
- error,
1852
- stdout: "",
1853
- stderr: "",
1854
- all: "",
1855
- command,
1856
- escapedCommand,
1857
- parsed,
1858
- timedOut: false,
1859
- isCanceled: false,
1860
- killed: false
1861
- });
1862
- }
1863
- const stdout = handleOutput(parsed.options, result.stdout, result.error);
1864
- const stderr = handleOutput(parsed.options, result.stderr, result.error);
1865
- if (result.error || result.status !== 0 || result.signal !== null) {
1866
- const error = makeError({
1867
- stdout,
1868
- stderr,
1869
- error: result.error,
1870
- signal: result.signal,
1871
- exitCode: result.status,
1872
- command,
1873
- escapedCommand,
1874
- parsed,
1875
- timedOut: result.error && result.error.code === "ETIMEDOUT",
1876
- isCanceled: false,
1877
- killed: result.signal !== null
1878
- });
1879
- if (!parsed.options.reject) {
1880
- return error;
1881
- }
1882
- throw error;
1883
- }
1884
- return {
1885
- command,
1886
- escapedCommand,
1887
- exitCode: 0,
1888
- stdout,
1889
- stderr,
1890
- failed: false,
1891
- timedOut: false,
1892
- isCanceled: false,
1893
- killed: false
1894
- };
1895
- };
1896
- module2.exports.command = (command, options) => {
1897
- const [file, ...args] = parseCommand(command);
1898
- return execa2(file, args, options);
1899
- };
1900
- module2.exports.commandSync = (command, options) => {
1901
- const [file, ...args] = parseCommand(command);
1902
- return execa2.sync(file, args, options);
1903
- };
1904
- module2.exports.node = (scriptPath, args, options = {}) => {
1905
- if (args && !Array.isArray(args) && typeof args === "object") {
1906
- options = args;
1907
- args = [];
1908
- }
1909
- const stdio = normalizeStdio.node(options);
1910
- const defaultExecArgv = process.execArgv.filter((arg) => !arg.startsWith("--inspect"));
1911
- const {
1912
- nodePath = process.execPath,
1913
- nodeOptions = defaultExecArgv
1914
- } = options;
1915
- return execa2(
1916
- nodePath,
1917
- [
1918
- ...nodeOptions,
1919
- scriptPath,
1920
- ...Array.isArray(args) ? args : []
1921
- ],
1922
- {
1923
- ...options,
1924
- stdin: void 0,
1925
- stdout: void 0,
1926
- stderr: void 0,
1927
- stdio,
1928
- shell: false
1929
- }
1930
- );
1931
- };
1932
- }
1933
- });
1934
- var import_execa = (0, import_chunk_2ESYSVXG.__toESM)(require_execa());
1935
- var debug = (0, import_debug.default)("prisma:migrate:seed");
1936
- async function getSeedCommandFromPackageJson(cwd) {
1937
- const prismaConfig = await (0, import_config.loadConfigFromPackageJson)(cwd);
1938
- debug({ prismaConfig });
1939
- if (!prismaConfig?.config?.seed) {
1940
- return null;
1941
- }
1942
- const seedCommandFromPkgJson = prismaConfig.config.seed;
1943
- if (typeof seedCommandFromPkgJson !== "string") {
1944
- throw new Error(
1945
- `Provided seed command \`${seedCommandFromPkgJson}\` from \`${import_node_path.default.relative(
1946
- cwd,
1947
- prismaConfig.loadedFromFile
1948
- )}\` must be of type string`
1949
- );
1950
- }
1951
- if (!seedCommandFromPkgJson) {
1952
- throw new Error(
1953
- `Provided seed command \`${seedCommandFromPkgJson}\` from \`${import_node_path.default.relative(
1954
- cwd,
1955
- prismaConfig.loadedFromFile
1956
- )}\` cannot be empty`
1957
- );
1958
- }
1959
- return prismaConfig.config.seed;
1960
- }
1961
- async function executeSeedCommand({
1962
- commandFromConfig,
1963
- extraArgs
1964
- }) {
1965
- const command = extraArgs ? `${commandFromConfig} ${extraArgs}` : commandFromConfig;
1966
- process.stdout.write(`Running seed command \`${(0, import_chunk_SKRR5WT4.italic)(command)}\` ...
1967
- `);
1968
- try {
1969
- await import_execa.default.command(command, {
1970
- stdout: "inherit",
1971
- stderr: "inherit"
1972
- });
1973
- } catch (_e) {
1974
- const e = _e;
1975
- debug({ e });
1976
- console.error((0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`
1977
- An error occurred while running the seed command:`)));
1978
- console.error((0, import_chunk_SKRR5WT4.red)(e.stderr || String(e)));
1979
- return false;
1980
- }
1981
- return true;
1982
- }