@prisma/client-generator-js 6.6.0-dev.111 → 6.6.0-dev.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2166,6 +2166,1968 @@ var require_lib = __commonJS({
2166
2166
  }
2167
2167
  });
2168
2168
 
2169
+ // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
2170
+ var require_windows = __commonJS({
2171
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
2172
+ "use strict";
2173
+ module.exports = isexe;
2174
+ isexe.sync = sync;
2175
+ var fs3 = __require("fs");
2176
+ function checkPathExt(path7, options) {
2177
+ var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
2178
+ if (!pathext) {
2179
+ return true;
2180
+ }
2181
+ pathext = pathext.split(";");
2182
+ if (pathext.indexOf("") !== -1) {
2183
+ return true;
2184
+ }
2185
+ for (var i = 0; i < pathext.length; i++) {
2186
+ var p = pathext[i].toLowerCase();
2187
+ if (p && path7.substr(-p.length).toLowerCase() === p) {
2188
+ return true;
2189
+ }
2190
+ }
2191
+ return false;
2192
+ }
2193
+ function checkStat(stat, path7, options) {
2194
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
2195
+ return false;
2196
+ }
2197
+ return checkPathExt(path7, options);
2198
+ }
2199
+ function isexe(path7, options, cb) {
2200
+ fs3.stat(path7, function(er, stat) {
2201
+ cb(er, er ? false : checkStat(stat, path7, options));
2202
+ });
2203
+ }
2204
+ function sync(path7, options) {
2205
+ return checkStat(fs3.statSync(path7), path7, options);
2206
+ }
2207
+ }
2208
+ });
2209
+
2210
+ // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
2211
+ var require_mode = __commonJS({
2212
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
2213
+ "use strict";
2214
+ module.exports = isexe;
2215
+ isexe.sync = sync;
2216
+ var fs3 = __require("fs");
2217
+ function isexe(path7, options, cb) {
2218
+ fs3.stat(path7, function(er, stat) {
2219
+ cb(er, er ? false : checkStat(stat, options));
2220
+ });
2221
+ }
2222
+ function sync(path7, options) {
2223
+ return checkStat(fs3.statSync(path7), options);
2224
+ }
2225
+ function checkStat(stat, options) {
2226
+ return stat.isFile() && checkMode(stat, options);
2227
+ }
2228
+ function checkMode(stat, options) {
2229
+ var mod = stat.mode;
2230
+ var uid = stat.uid;
2231
+ var gid = stat.gid;
2232
+ var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
2233
+ var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
2234
+ var u = parseInt("100", 8);
2235
+ var g = parseInt("010", 8);
2236
+ var o = parseInt("001", 8);
2237
+ var ug = u | g;
2238
+ var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
2239
+ return ret;
2240
+ }
2241
+ }
2242
+ });
2243
+
2244
+ // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
2245
+ var require_isexe = __commonJS({
2246
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
2247
+ "use strict";
2248
+ var fs3 = __require("fs");
2249
+ var core;
2250
+ if (process.platform === "win32" || global.TESTING_WINDOWS) {
2251
+ core = require_windows();
2252
+ } else {
2253
+ core = require_mode();
2254
+ }
2255
+ module.exports = isexe;
2256
+ isexe.sync = sync;
2257
+ function isexe(path7, options, cb) {
2258
+ if (typeof options === "function") {
2259
+ cb = options;
2260
+ options = {};
2261
+ }
2262
+ if (!cb) {
2263
+ if (typeof Promise !== "function") {
2264
+ throw new TypeError("callback not provided");
2265
+ }
2266
+ return new Promise(function(resolve, reject) {
2267
+ isexe(path7, options || {}, function(er, is) {
2268
+ if (er) {
2269
+ reject(er);
2270
+ } else {
2271
+ resolve(is);
2272
+ }
2273
+ });
2274
+ });
2275
+ }
2276
+ core(path7, options || {}, function(er, is) {
2277
+ if (er) {
2278
+ if (er.code === "EACCES" || options && options.ignoreErrors) {
2279
+ er = null;
2280
+ is = false;
2281
+ }
2282
+ }
2283
+ cb(er, is);
2284
+ });
2285
+ }
2286
+ function sync(path7, options) {
2287
+ try {
2288
+ return core.sync(path7, options || {});
2289
+ } catch (er) {
2290
+ if (options && options.ignoreErrors || er.code === "EACCES") {
2291
+ return false;
2292
+ } else {
2293
+ throw er;
2294
+ }
2295
+ }
2296
+ }
2297
+ }
2298
+ });
2299
+
2300
+ // ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
2301
+ var require_which = __commonJS({
2302
+ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
2303
+ "use strict";
2304
+ var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
2305
+ var path7 = __require("path");
2306
+ var COLON = isWindows ? ";" : ":";
2307
+ var isexe = require_isexe();
2308
+ var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
2309
+ var getPathInfo = (cmd, opt) => {
2310
+ const colon = opt.colon || COLON;
2311
+ const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
2312
+ // windows always checks the cwd first
2313
+ ...isWindows ? [process.cwd()] : [],
2314
+ ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
2315
+ "").split(colon)
2316
+ ];
2317
+ const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
2318
+ const pathExt = isWindows ? pathExtExe.split(colon) : [""];
2319
+ if (isWindows) {
2320
+ if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
2321
+ pathExt.unshift("");
2322
+ }
2323
+ return {
2324
+ pathEnv,
2325
+ pathExt,
2326
+ pathExtExe
2327
+ };
2328
+ };
2329
+ var which = (cmd, opt, cb) => {
2330
+ if (typeof opt === "function") {
2331
+ cb = opt;
2332
+ opt = {};
2333
+ }
2334
+ if (!opt)
2335
+ opt = {};
2336
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
2337
+ const found = [];
2338
+ const step = (i) => new Promise((resolve, reject) => {
2339
+ if (i === pathEnv.length)
2340
+ return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
2341
+ const ppRaw = pathEnv[i];
2342
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2343
+ const pCmd = path7.join(pathPart, cmd);
2344
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2345
+ resolve(subStep(p, i, 0));
2346
+ });
2347
+ const subStep = (p, i, ii) => new Promise((resolve, reject) => {
2348
+ if (ii === pathExt.length)
2349
+ return resolve(step(i + 1));
2350
+ const ext = pathExt[ii];
2351
+ isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
2352
+ if (!er && is) {
2353
+ if (opt.all)
2354
+ found.push(p + ext);
2355
+ else
2356
+ return resolve(p + ext);
2357
+ }
2358
+ return resolve(subStep(p, i, ii + 1));
2359
+ });
2360
+ });
2361
+ return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
2362
+ };
2363
+ var whichSync = (cmd, opt) => {
2364
+ opt = opt || {};
2365
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
2366
+ const found = [];
2367
+ for (let i = 0; i < pathEnv.length; i++) {
2368
+ const ppRaw = pathEnv[i];
2369
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2370
+ const pCmd = path7.join(pathPart, cmd);
2371
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2372
+ for (let j = 0; j < pathExt.length; j++) {
2373
+ const cur = p + pathExt[j];
2374
+ try {
2375
+ const is = isexe.sync(cur, { pathExt: pathExtExe });
2376
+ if (is) {
2377
+ if (opt.all)
2378
+ found.push(cur);
2379
+ else
2380
+ return cur;
2381
+ }
2382
+ } catch (ex) {
2383
+ }
2384
+ }
2385
+ }
2386
+ if (opt.all && found.length)
2387
+ return found;
2388
+ if (opt.nothrow)
2389
+ return null;
2390
+ throw getNotFoundError(cmd);
2391
+ };
2392
+ module.exports = which;
2393
+ which.sync = whichSync;
2394
+ }
2395
+ });
2396
+
2397
+ // ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
2398
+ var require_path_key = __commonJS({
2399
+ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module) {
2400
+ "use strict";
2401
+ var pathKey = (options = {}) => {
2402
+ const environment = options.env || process.env;
2403
+ const platform = options.platform || process.platform;
2404
+ if (platform !== "win32") {
2405
+ return "PATH";
2406
+ }
2407
+ return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
2408
+ };
2409
+ module.exports = pathKey;
2410
+ module.exports.default = pathKey;
2411
+ }
2412
+ });
2413
+
2414
+ // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js
2415
+ var require_resolveCommand = __commonJS({
2416
+ "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
2417
+ "use strict";
2418
+ var path7 = __require("path");
2419
+ var which = require_which();
2420
+ var getPathKey = require_path_key();
2421
+ function resolveCommandAttempt(parsed, withoutPathExt) {
2422
+ const env = parsed.options.env || process.env;
2423
+ const cwd = process.cwd();
2424
+ const hasCustomCwd = parsed.options.cwd != null;
2425
+ const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
2426
+ if (shouldSwitchCwd) {
2427
+ try {
2428
+ process.chdir(parsed.options.cwd);
2429
+ } catch (err) {
2430
+ }
2431
+ }
2432
+ let resolved;
2433
+ try {
2434
+ resolved = which.sync(parsed.command, {
2435
+ path: env[getPathKey({ env })],
2436
+ pathExt: withoutPathExt ? path7.delimiter : void 0
2437
+ });
2438
+ } catch (e) {
2439
+ } finally {
2440
+ if (shouldSwitchCwd) {
2441
+ process.chdir(cwd);
2442
+ }
2443
+ }
2444
+ if (resolved) {
2445
+ resolved = path7.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
2446
+ }
2447
+ return resolved;
2448
+ }
2449
+ function resolveCommand(parsed) {
2450
+ return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
2451
+ }
2452
+ module.exports = resolveCommand;
2453
+ }
2454
+ });
2455
+
2456
+ // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js
2457
+ var require_escape = __commonJS({
2458
+ "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
2459
+ "use strict";
2460
+ var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
2461
+ function escapeCommand(arg) {
2462
+ arg = arg.replace(metaCharsRegExp, "^$1");
2463
+ return arg;
2464
+ }
2465
+ function escapeArgument(arg, doubleEscapeMetaChars) {
2466
+ arg = `${arg}`;
2467
+ arg = arg.replace(/(\\*)"/g, '$1$1\\"');
2468
+ arg = arg.replace(/(\\*)$/, "$1$1");
2469
+ arg = `"${arg}"`;
2470
+ arg = arg.replace(metaCharsRegExp, "^$1");
2471
+ if (doubleEscapeMetaChars) {
2472
+ arg = arg.replace(metaCharsRegExp, "^$1");
2473
+ }
2474
+ return arg;
2475
+ }
2476
+ module.exports.command = escapeCommand;
2477
+ module.exports.argument = escapeArgument;
2478
+ }
2479
+ });
2480
+
2481
+ // ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
2482
+ var require_shebang_regex = __commonJS({
2483
+ "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module) {
2484
+ "use strict";
2485
+ module.exports = /^#!(.*)/;
2486
+ }
2487
+ });
2488
+
2489
+ // ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
2490
+ var require_shebang_command = __commonJS({
2491
+ "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module) {
2492
+ "use strict";
2493
+ var shebangRegex = require_shebang_regex();
2494
+ module.exports = (string = "") => {
2495
+ const match2 = string.match(shebangRegex);
2496
+ if (!match2) {
2497
+ return null;
2498
+ }
2499
+ const [path7, argument] = match2[0].replace(/#! ?/, "").split(" ");
2500
+ const binary = path7.split("/").pop();
2501
+ if (binary === "env") {
2502
+ return argument;
2503
+ }
2504
+ return argument ? `${binary} ${argument}` : binary;
2505
+ };
2506
+ }
2507
+ });
2508
+
2509
+ // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js
2510
+ var require_readShebang = __commonJS({
2511
+ "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
2512
+ "use strict";
2513
+ var fs3 = __require("fs");
2514
+ var shebangCommand = require_shebang_command();
2515
+ function readShebang(command) {
2516
+ const size = 150;
2517
+ const buffer = Buffer.alloc(size);
2518
+ let fd;
2519
+ try {
2520
+ fd = fs3.openSync(command, "r");
2521
+ fs3.readSync(fd, buffer, 0, size, 0);
2522
+ fs3.closeSync(fd);
2523
+ } catch (e) {
2524
+ }
2525
+ return shebangCommand(buffer.toString());
2526
+ }
2527
+ module.exports = readShebang;
2528
+ }
2529
+ });
2530
+
2531
+ // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js
2532
+ var require_parse = __commonJS({
2533
+ "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js"(exports, module) {
2534
+ "use strict";
2535
+ var path7 = __require("path");
2536
+ var resolveCommand = require_resolveCommand();
2537
+ var escape = require_escape();
2538
+ var readShebang = require_readShebang();
2539
+ var isWin = process.platform === "win32";
2540
+ var isExecutableRegExp = /\.(?:com|exe)$/i;
2541
+ var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
2542
+ function detectShebang(parsed) {
2543
+ parsed.file = resolveCommand(parsed);
2544
+ const shebang = parsed.file && readShebang(parsed.file);
2545
+ if (shebang) {
2546
+ parsed.args.unshift(parsed.file);
2547
+ parsed.command = shebang;
2548
+ return resolveCommand(parsed);
2549
+ }
2550
+ return parsed.file;
2551
+ }
2552
+ function parseNonShell(parsed) {
2553
+ if (!isWin) {
2554
+ return parsed;
2555
+ }
2556
+ const commandFile = detectShebang(parsed);
2557
+ const needsShell = !isExecutableRegExp.test(commandFile);
2558
+ if (parsed.options.forceShell || needsShell) {
2559
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
2560
+ parsed.command = path7.normalize(parsed.command);
2561
+ parsed.command = escape.command(parsed.command);
2562
+ parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
2563
+ const shellCommand = [parsed.command].concat(parsed.args).join(" ");
2564
+ parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
2565
+ parsed.command = process.env.comspec || "cmd.exe";
2566
+ parsed.options.windowsVerbatimArguments = true;
2567
+ }
2568
+ return parsed;
2569
+ }
2570
+ function parse(command, args, options) {
2571
+ if (args && !Array.isArray(args)) {
2572
+ options = args;
2573
+ args = null;
2574
+ }
2575
+ args = args ? args.slice(0) : [];
2576
+ options = Object.assign({}, options);
2577
+ const parsed = {
2578
+ command,
2579
+ args,
2580
+ options,
2581
+ file: void 0,
2582
+ original: {
2583
+ command,
2584
+ args
2585
+ }
2586
+ };
2587
+ return options.shell ? parsed : parseNonShell(parsed);
2588
+ }
2589
+ module.exports = parse;
2590
+ }
2591
+ });
2592
+
2593
+ // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js
2594
+ var require_enoent = __commonJS({
2595
+ "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js"(exports, module) {
2596
+ "use strict";
2597
+ var isWin = process.platform === "win32";
2598
+ function notFoundError(original, syscall) {
2599
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
2600
+ code: "ENOENT",
2601
+ errno: "ENOENT",
2602
+ syscall: `${syscall} ${original.command}`,
2603
+ path: original.command,
2604
+ spawnargs: original.args
2605
+ });
2606
+ }
2607
+ function hookChildProcess(cp, parsed) {
2608
+ if (!isWin) {
2609
+ return;
2610
+ }
2611
+ const originalEmit = cp.emit;
2612
+ cp.emit = function(name, arg1) {
2613
+ if (name === "exit") {
2614
+ const err = verifyENOENT(arg1, parsed, "spawn");
2615
+ if (err) {
2616
+ return originalEmit.call(cp, "error", err);
2617
+ }
2618
+ }
2619
+ return originalEmit.apply(cp, arguments);
2620
+ };
2621
+ }
2622
+ function verifyENOENT(status, parsed) {
2623
+ if (isWin && status === 1 && !parsed.file) {
2624
+ return notFoundError(parsed.original, "spawn");
2625
+ }
2626
+ return null;
2627
+ }
2628
+ function verifyENOENTSync(status, parsed) {
2629
+ if (isWin && status === 1 && !parsed.file) {
2630
+ return notFoundError(parsed.original, "spawnSync");
2631
+ }
2632
+ return null;
2633
+ }
2634
+ module.exports = {
2635
+ hookChildProcess,
2636
+ verifyENOENT,
2637
+ verifyENOENTSync,
2638
+ notFoundError
2639
+ };
2640
+ }
2641
+ });
2642
+
2643
+ // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js
2644
+ var require_cross_spawn = __commonJS({
2645
+ "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports, module) {
2646
+ "use strict";
2647
+ var cp = __require("child_process");
2648
+ var parse = require_parse();
2649
+ var enoent = require_enoent();
2650
+ function spawn(command, args, options) {
2651
+ const parsed = parse(command, args, options);
2652
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
2653
+ enoent.hookChildProcess(spawned, parsed);
2654
+ return spawned;
2655
+ }
2656
+ function spawnSync(command, args, options) {
2657
+ const parsed = parse(command, args, options);
2658
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
2659
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
2660
+ return result;
2661
+ }
2662
+ module.exports = spawn;
2663
+ module.exports.spawn = spawn;
2664
+ module.exports.sync = spawnSync;
2665
+ module.exports._parse = parse;
2666
+ module.exports._enoent = enoent;
2667
+ }
2668
+ });
2669
+
2670
+ // ../../node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js
2671
+ var require_strip_final_newline = __commonJS({
2672
+ "../../node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js"(exports, module) {
2673
+ "use strict";
2674
+ module.exports = (input) => {
2675
+ const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
2676
+ const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
2677
+ if (input[input.length - 1] === LF) {
2678
+ input = input.slice(0, input.length - 1);
2679
+ }
2680
+ if (input[input.length - 1] === CR) {
2681
+ input = input.slice(0, input.length - 1);
2682
+ }
2683
+ return input;
2684
+ };
2685
+ }
2686
+ });
2687
+
2688
+ // ../../node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js
2689
+ var require_npm_run_path = __commonJS({
2690
+ "../../node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js"(exports, module) {
2691
+ "use strict";
2692
+ var path7 = __require("path");
2693
+ var pathKey = require_path_key();
2694
+ var npmRunPath = (options) => {
2695
+ options = {
2696
+ cwd: process.cwd(),
2697
+ path: process.env[pathKey()],
2698
+ execPath: process.execPath,
2699
+ ...options
2700
+ };
2701
+ let previous;
2702
+ let cwdPath = path7.resolve(options.cwd);
2703
+ const result = [];
2704
+ while (previous !== cwdPath) {
2705
+ result.push(path7.join(cwdPath, "node_modules/.bin"));
2706
+ previous = cwdPath;
2707
+ cwdPath = path7.resolve(cwdPath, "..");
2708
+ }
2709
+ const execPathDir = path7.resolve(options.cwd, options.execPath, "..");
2710
+ result.push(execPathDir);
2711
+ return result.concat(options.path).join(path7.delimiter);
2712
+ };
2713
+ module.exports = npmRunPath;
2714
+ module.exports.default = npmRunPath;
2715
+ module.exports.env = (options) => {
2716
+ options = {
2717
+ env: process.env,
2718
+ ...options
2719
+ };
2720
+ const env = { ...options.env };
2721
+ const path8 = pathKey({ env });
2722
+ options.path = env[path8];
2723
+ env[path8] = module.exports(options);
2724
+ return env;
2725
+ };
2726
+ }
2727
+ });
2728
+
2729
+ // ../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js
2730
+ var require_mimic_fn = __commonJS({
2731
+ "../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports, module) {
2732
+ "use strict";
2733
+ var mimicFn = (to, from) => {
2734
+ for (const prop of Reflect.ownKeys(from)) {
2735
+ Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
2736
+ }
2737
+ return to;
2738
+ };
2739
+ module.exports = mimicFn;
2740
+ module.exports.default = mimicFn;
2741
+ }
2742
+ });
2743
+
2744
+ // ../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js
2745
+ var require_onetime = __commonJS({
2746
+ "../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports, module) {
2747
+ "use strict";
2748
+ var mimicFn = require_mimic_fn();
2749
+ var calledFunctions = /* @__PURE__ */ new WeakMap();
2750
+ var onetime = (function_, options = {}) => {
2751
+ if (typeof function_ !== "function") {
2752
+ throw new TypeError("Expected a function");
2753
+ }
2754
+ let returnValue;
2755
+ let callCount = 0;
2756
+ const functionName = function_.displayName || function_.name || "<anonymous>";
2757
+ const onetime2 = function(...arguments_) {
2758
+ calledFunctions.set(onetime2, ++callCount);
2759
+ if (callCount === 1) {
2760
+ returnValue = function_.apply(this, arguments_);
2761
+ function_ = null;
2762
+ } else if (options.throw === true) {
2763
+ throw new Error(`Function \`${functionName}\` can only be called once`);
2764
+ }
2765
+ return returnValue;
2766
+ };
2767
+ mimicFn(onetime2, function_);
2768
+ calledFunctions.set(onetime2, callCount);
2769
+ return onetime2;
2770
+ };
2771
+ module.exports = onetime;
2772
+ module.exports.default = onetime;
2773
+ module.exports.callCount = (function_) => {
2774
+ if (!calledFunctions.has(function_)) {
2775
+ throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
2776
+ }
2777
+ return calledFunctions.get(function_);
2778
+ };
2779
+ }
2780
+ });
2781
+
2782
+ // ../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js
2783
+ var require_core = __commonJS({
2784
+ "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js"(exports) {
2785
+ "use strict";
2786
+ Object.defineProperty(exports, "__esModule", { value: true });
2787
+ exports.SIGNALS = void 0;
2788
+ var SIGNALS = [
2789
+ {
2790
+ name: "SIGHUP",
2791
+ number: 1,
2792
+ action: "terminate",
2793
+ description: "Terminal closed",
2794
+ standard: "posix"
2795
+ },
2796
+ {
2797
+ name: "SIGINT",
2798
+ number: 2,
2799
+ action: "terminate",
2800
+ description: "User interruption with CTRL-C",
2801
+ standard: "ansi"
2802
+ },
2803
+ {
2804
+ name: "SIGQUIT",
2805
+ number: 3,
2806
+ action: "core",
2807
+ description: "User interruption with CTRL-\\",
2808
+ standard: "posix"
2809
+ },
2810
+ {
2811
+ name: "SIGILL",
2812
+ number: 4,
2813
+ action: "core",
2814
+ description: "Invalid machine instruction",
2815
+ standard: "ansi"
2816
+ },
2817
+ {
2818
+ name: "SIGTRAP",
2819
+ number: 5,
2820
+ action: "core",
2821
+ description: "Debugger breakpoint",
2822
+ standard: "posix"
2823
+ },
2824
+ {
2825
+ name: "SIGABRT",
2826
+ number: 6,
2827
+ action: "core",
2828
+ description: "Aborted",
2829
+ standard: "ansi"
2830
+ },
2831
+ {
2832
+ name: "SIGIOT",
2833
+ number: 6,
2834
+ action: "core",
2835
+ description: "Aborted",
2836
+ standard: "bsd"
2837
+ },
2838
+ {
2839
+ name: "SIGBUS",
2840
+ number: 7,
2841
+ action: "core",
2842
+ description: "Bus error due to misaligned, non-existing address or paging error",
2843
+ standard: "bsd"
2844
+ },
2845
+ {
2846
+ name: "SIGEMT",
2847
+ number: 7,
2848
+ action: "terminate",
2849
+ description: "Command should be emulated but is not implemented",
2850
+ standard: "other"
2851
+ },
2852
+ {
2853
+ name: "SIGFPE",
2854
+ number: 8,
2855
+ action: "core",
2856
+ description: "Floating point arithmetic error",
2857
+ standard: "ansi"
2858
+ },
2859
+ {
2860
+ name: "SIGKILL",
2861
+ number: 9,
2862
+ action: "terminate",
2863
+ description: "Forced termination",
2864
+ standard: "posix",
2865
+ forced: true
2866
+ },
2867
+ {
2868
+ name: "SIGUSR1",
2869
+ number: 10,
2870
+ action: "terminate",
2871
+ description: "Application-specific signal",
2872
+ standard: "posix"
2873
+ },
2874
+ {
2875
+ name: "SIGSEGV",
2876
+ number: 11,
2877
+ action: "core",
2878
+ description: "Segmentation fault",
2879
+ standard: "ansi"
2880
+ },
2881
+ {
2882
+ name: "SIGUSR2",
2883
+ number: 12,
2884
+ action: "terminate",
2885
+ description: "Application-specific signal",
2886
+ standard: "posix"
2887
+ },
2888
+ {
2889
+ name: "SIGPIPE",
2890
+ number: 13,
2891
+ action: "terminate",
2892
+ description: "Broken pipe or socket",
2893
+ standard: "posix"
2894
+ },
2895
+ {
2896
+ name: "SIGALRM",
2897
+ number: 14,
2898
+ action: "terminate",
2899
+ description: "Timeout or timer",
2900
+ standard: "posix"
2901
+ },
2902
+ {
2903
+ name: "SIGTERM",
2904
+ number: 15,
2905
+ action: "terminate",
2906
+ description: "Termination",
2907
+ standard: "ansi"
2908
+ },
2909
+ {
2910
+ name: "SIGSTKFLT",
2911
+ number: 16,
2912
+ action: "terminate",
2913
+ description: "Stack is empty or overflowed",
2914
+ standard: "other"
2915
+ },
2916
+ {
2917
+ name: "SIGCHLD",
2918
+ number: 17,
2919
+ action: "ignore",
2920
+ description: "Child process terminated, paused or unpaused",
2921
+ standard: "posix"
2922
+ },
2923
+ {
2924
+ name: "SIGCLD",
2925
+ number: 17,
2926
+ action: "ignore",
2927
+ description: "Child process terminated, paused or unpaused",
2928
+ standard: "other"
2929
+ },
2930
+ {
2931
+ name: "SIGCONT",
2932
+ number: 18,
2933
+ action: "unpause",
2934
+ description: "Unpaused",
2935
+ standard: "posix",
2936
+ forced: true
2937
+ },
2938
+ {
2939
+ name: "SIGSTOP",
2940
+ number: 19,
2941
+ action: "pause",
2942
+ description: "Paused",
2943
+ standard: "posix",
2944
+ forced: true
2945
+ },
2946
+ {
2947
+ name: "SIGTSTP",
2948
+ number: 20,
2949
+ action: "pause",
2950
+ description: 'Paused using CTRL-Z or "suspend"',
2951
+ standard: "posix"
2952
+ },
2953
+ {
2954
+ name: "SIGTTIN",
2955
+ number: 21,
2956
+ action: "pause",
2957
+ description: "Background process cannot read terminal input",
2958
+ standard: "posix"
2959
+ },
2960
+ {
2961
+ name: "SIGBREAK",
2962
+ number: 21,
2963
+ action: "terminate",
2964
+ description: "User interruption with CTRL-BREAK",
2965
+ standard: "other"
2966
+ },
2967
+ {
2968
+ name: "SIGTTOU",
2969
+ number: 22,
2970
+ action: "pause",
2971
+ description: "Background process cannot write to terminal output",
2972
+ standard: "posix"
2973
+ },
2974
+ {
2975
+ name: "SIGURG",
2976
+ number: 23,
2977
+ action: "ignore",
2978
+ description: "Socket received out-of-band data",
2979
+ standard: "bsd"
2980
+ },
2981
+ {
2982
+ name: "SIGXCPU",
2983
+ number: 24,
2984
+ action: "core",
2985
+ description: "Process timed out",
2986
+ standard: "bsd"
2987
+ },
2988
+ {
2989
+ name: "SIGXFSZ",
2990
+ number: 25,
2991
+ action: "core",
2992
+ description: "File too big",
2993
+ standard: "bsd"
2994
+ },
2995
+ {
2996
+ name: "SIGVTALRM",
2997
+ number: 26,
2998
+ action: "terminate",
2999
+ description: "Timeout or timer",
3000
+ standard: "bsd"
3001
+ },
3002
+ {
3003
+ name: "SIGPROF",
3004
+ number: 27,
3005
+ action: "terminate",
3006
+ description: "Timeout or timer",
3007
+ standard: "bsd"
3008
+ },
3009
+ {
3010
+ name: "SIGWINCH",
3011
+ number: 28,
3012
+ action: "ignore",
3013
+ description: "Terminal window size changed",
3014
+ standard: "bsd"
3015
+ },
3016
+ {
3017
+ name: "SIGIO",
3018
+ number: 29,
3019
+ action: "terminate",
3020
+ description: "I/O is available",
3021
+ standard: "other"
3022
+ },
3023
+ {
3024
+ name: "SIGPOLL",
3025
+ number: 29,
3026
+ action: "terminate",
3027
+ description: "Watched event",
3028
+ standard: "other"
3029
+ },
3030
+ {
3031
+ name: "SIGINFO",
3032
+ number: 29,
3033
+ action: "ignore",
3034
+ description: "Request for process information",
3035
+ standard: "other"
3036
+ },
3037
+ {
3038
+ name: "SIGPWR",
3039
+ number: 30,
3040
+ action: "terminate",
3041
+ description: "Device running out of power",
3042
+ standard: "systemv"
3043
+ },
3044
+ {
3045
+ name: "SIGSYS",
3046
+ number: 31,
3047
+ action: "core",
3048
+ description: "Invalid system call",
3049
+ standard: "other"
3050
+ },
3051
+ {
3052
+ name: "SIGUNUSED",
3053
+ number: 31,
3054
+ action: "terminate",
3055
+ description: "Invalid system call",
3056
+ standard: "other"
3057
+ }
3058
+ ];
3059
+ exports.SIGNALS = SIGNALS;
3060
+ }
3061
+ });
3062
+
3063
+ // ../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js
3064
+ var require_realtime = __commonJS({
3065
+ "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js"(exports) {
3066
+ "use strict";
3067
+ Object.defineProperty(exports, "__esModule", { value: true });
3068
+ exports.SIGRTMAX = exports.getRealtimeSignals = void 0;
3069
+ var getRealtimeSignals = function() {
3070
+ const length = SIGRTMAX - SIGRTMIN + 1;
3071
+ return Array.from({ length }, getRealtimeSignal);
3072
+ };
3073
+ exports.getRealtimeSignals = getRealtimeSignals;
3074
+ var getRealtimeSignal = function(value, index) {
3075
+ return {
3076
+ name: `SIGRT${index + 1}`,
3077
+ number: SIGRTMIN + index,
3078
+ action: "terminate",
3079
+ description: "Application-specific signal (realtime)",
3080
+ standard: "posix"
3081
+ };
3082
+ };
3083
+ var SIGRTMIN = 34;
3084
+ var SIGRTMAX = 64;
3085
+ exports.SIGRTMAX = SIGRTMAX;
3086
+ }
3087
+ });
3088
+
3089
+ // ../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js
3090
+ var require_signals = __commonJS({
3091
+ "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js"(exports) {
3092
+ "use strict";
3093
+ Object.defineProperty(exports, "__esModule", { value: true });
3094
+ exports.getSignals = void 0;
3095
+ var _os = __require("os");
3096
+ var _core = require_core();
3097
+ var _realtime = require_realtime();
3098
+ var getSignals = function() {
3099
+ const realtimeSignals = (0, _realtime.getRealtimeSignals)();
3100
+ const signals = [..._core.SIGNALS, ...realtimeSignals].map(normalizeSignal);
3101
+ return signals;
3102
+ };
3103
+ exports.getSignals = getSignals;
3104
+ var normalizeSignal = function({
3105
+ name,
3106
+ number: defaultNumber,
3107
+ description,
3108
+ action,
3109
+ forced = false,
3110
+ standard
3111
+ }) {
3112
+ const {
3113
+ signals: { [name]: constantSignal }
3114
+ } = _os.constants;
3115
+ const supported = constantSignal !== void 0;
3116
+ const number = supported ? constantSignal : defaultNumber;
3117
+ return { name, number, description, supported, action, forced, standard };
3118
+ };
3119
+ }
3120
+ });
3121
+
3122
+ // ../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js
3123
+ var require_main = __commonJS({
3124
+ "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js"(exports) {
3125
+ "use strict";
3126
+ Object.defineProperty(exports, "__esModule", { value: true });
3127
+ exports.signalsByNumber = exports.signalsByName = void 0;
3128
+ var _os = __require("os");
3129
+ var _signals = require_signals();
3130
+ var _realtime = require_realtime();
3131
+ var getSignalsByName = function() {
3132
+ const signals = (0, _signals.getSignals)();
3133
+ return signals.reduce(getSignalByName, {});
3134
+ };
3135
+ var getSignalByName = function(signalByNameMemo, { name, number, description, supported, action, forced, standard }) {
3136
+ return {
3137
+ ...signalByNameMemo,
3138
+ [name]: { name, number, description, supported, action, forced, standard }
3139
+ };
3140
+ };
3141
+ var signalsByName = getSignalsByName();
3142
+ exports.signalsByName = signalsByName;
3143
+ var getSignalsByNumber = function() {
3144
+ const signals = (0, _signals.getSignals)();
3145
+ const length = _realtime.SIGRTMAX + 1;
3146
+ const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals));
3147
+ return Object.assign({}, ...signalsA);
3148
+ };
3149
+ var getSignalByNumber = function(number, signals) {
3150
+ const signal = findSignalByNumber(number, signals);
3151
+ if (signal === void 0) {
3152
+ return {};
3153
+ }
3154
+ const { name, description, supported, action, forced, standard } = signal;
3155
+ return {
3156
+ [number]: {
3157
+ name,
3158
+ number,
3159
+ description,
3160
+ supported,
3161
+ action,
3162
+ forced,
3163
+ standard
3164
+ }
3165
+ };
3166
+ };
3167
+ var findSignalByNumber = function(number, signals) {
3168
+ const signal = signals.find(({ name }) => _os.constants.signals[name] === number);
3169
+ if (signal !== void 0) {
3170
+ return signal;
3171
+ }
3172
+ return signals.find((signalA) => signalA.number === number);
3173
+ };
3174
+ var signalsByNumber = getSignalsByNumber();
3175
+ exports.signalsByNumber = signalsByNumber;
3176
+ }
3177
+ });
3178
+
3179
+ // ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js
3180
+ var require_error = __commonJS({
3181
+ "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js"(exports, module) {
3182
+ "use strict";
3183
+ var { signalsByName } = require_main();
3184
+ var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
3185
+ if (timedOut) {
3186
+ return `timed out after ${timeout} milliseconds`;
3187
+ }
3188
+ if (isCanceled) {
3189
+ return "was canceled";
3190
+ }
3191
+ if (errorCode !== void 0) {
3192
+ return `failed with ${errorCode}`;
3193
+ }
3194
+ if (signal !== void 0) {
3195
+ return `was killed with ${signal} (${signalDescription})`;
3196
+ }
3197
+ if (exitCode !== void 0) {
3198
+ return `failed with exit code ${exitCode}`;
3199
+ }
3200
+ return "failed";
3201
+ };
3202
+ var makeError = ({
3203
+ stdout,
3204
+ stderr,
3205
+ all,
3206
+ error,
3207
+ signal,
3208
+ exitCode,
3209
+ command,
3210
+ escapedCommand,
3211
+ timedOut,
3212
+ isCanceled,
3213
+ killed,
3214
+ parsed: { options: { timeout } }
3215
+ }) => {
3216
+ exitCode = exitCode === null ? void 0 : exitCode;
3217
+ signal = signal === null ? void 0 : signal;
3218
+ const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
3219
+ const errorCode = error && error.code;
3220
+ const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
3221
+ const execaMessage = `Command ${prefix}: ${command}`;
3222
+ const isError = Object.prototype.toString.call(error) === "[object Error]";
3223
+ const shortMessage = isError ? `${execaMessage}
3224
+ ${error.message}` : execaMessage;
3225
+ const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
3226
+ if (isError) {
3227
+ error.originalMessage = error.message;
3228
+ error.message = message;
3229
+ } else {
3230
+ error = new Error(message);
3231
+ }
3232
+ error.shortMessage = shortMessage;
3233
+ error.command = command;
3234
+ error.escapedCommand = escapedCommand;
3235
+ error.exitCode = exitCode;
3236
+ error.signal = signal;
3237
+ error.signalDescription = signalDescription;
3238
+ error.stdout = stdout;
3239
+ error.stderr = stderr;
3240
+ if (all !== void 0) {
3241
+ error.all = all;
3242
+ }
3243
+ if ("bufferedData" in error) {
3244
+ delete error.bufferedData;
3245
+ }
3246
+ error.failed = true;
3247
+ error.timedOut = Boolean(timedOut);
3248
+ error.isCanceled = isCanceled;
3249
+ error.killed = killed && !timedOut;
3250
+ return error;
3251
+ };
3252
+ module.exports = makeError;
3253
+ }
3254
+ });
3255
+
3256
+ // ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js
3257
+ var require_stdio = __commonJS({
3258
+ "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js"(exports, module) {
3259
+ "use strict";
3260
+ var aliases = ["stdin", "stdout", "stderr"];
3261
+ var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
3262
+ var normalizeStdio = (options) => {
3263
+ if (!options) {
3264
+ return;
3265
+ }
3266
+ const { stdio } = options;
3267
+ if (stdio === void 0) {
3268
+ return aliases.map((alias) => options[alias]);
3269
+ }
3270
+ if (hasAlias(options)) {
3271
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
3272
+ }
3273
+ if (typeof stdio === "string") {
3274
+ return stdio;
3275
+ }
3276
+ if (!Array.isArray(stdio)) {
3277
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
3278
+ }
3279
+ const length = Math.max(stdio.length, aliases.length);
3280
+ return Array.from({ length }, (value, index) => stdio[index]);
3281
+ };
3282
+ module.exports = normalizeStdio;
3283
+ module.exports.node = (options) => {
3284
+ const stdio = normalizeStdio(options);
3285
+ if (stdio === "ipc") {
3286
+ return "ipc";
3287
+ }
3288
+ if (stdio === void 0 || typeof stdio === "string") {
3289
+ return [stdio, stdio, stdio, "ipc"];
3290
+ }
3291
+ if (stdio.includes("ipc")) {
3292
+ return stdio;
3293
+ }
3294
+ return [...stdio, "ipc"];
3295
+ };
3296
+ }
3297
+ });
3298
+
3299
+ // ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js
3300
+ var require_signals2 = __commonJS({
3301
+ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports, module) {
3302
+ "use strict";
3303
+ module.exports = [
3304
+ "SIGABRT",
3305
+ "SIGALRM",
3306
+ "SIGHUP",
3307
+ "SIGINT",
3308
+ "SIGTERM"
3309
+ ];
3310
+ if (process.platform !== "win32") {
3311
+ module.exports.push(
3312
+ "SIGVTALRM",
3313
+ "SIGXCPU",
3314
+ "SIGXFSZ",
3315
+ "SIGUSR2",
3316
+ "SIGTRAP",
3317
+ "SIGSYS",
3318
+ "SIGQUIT",
3319
+ "SIGIOT"
3320
+ // should detect profiler and enable/disable accordingly.
3321
+ // see #21
3322
+ // 'SIGPROF'
3323
+ );
3324
+ }
3325
+ if (process.platform === "linux") {
3326
+ module.exports.push(
3327
+ "SIGIO",
3328
+ "SIGPOLL",
3329
+ "SIGPWR",
3330
+ "SIGSTKFLT",
3331
+ "SIGUNUSED"
3332
+ );
3333
+ }
3334
+ }
3335
+ });
3336
+
3337
+ // ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
3338
+ var require_signal_exit = __commonJS({
3339
+ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports, module) {
3340
+ "use strict";
3341
+ var process2 = global.process;
3342
+ var processOk = function(process3) {
3343
+ 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";
3344
+ };
3345
+ if (!processOk(process2)) {
3346
+ module.exports = function() {
3347
+ return function() {
3348
+ };
3349
+ };
3350
+ } else {
3351
+ assert = __require("assert");
3352
+ signals = require_signals2();
3353
+ isWin = /^win/i.test(process2.platform);
3354
+ EE = __require("events");
3355
+ if (typeof EE !== "function") {
3356
+ EE = EE.EventEmitter;
3357
+ }
3358
+ if (process2.__signal_exit_emitter__) {
3359
+ emitter = process2.__signal_exit_emitter__;
3360
+ } else {
3361
+ emitter = process2.__signal_exit_emitter__ = new EE();
3362
+ emitter.count = 0;
3363
+ emitter.emitted = {};
3364
+ }
3365
+ if (!emitter.infinite) {
3366
+ emitter.setMaxListeners(Infinity);
3367
+ emitter.infinite = true;
3368
+ }
3369
+ module.exports = function(cb, opts) {
3370
+ if (!processOk(global.process)) {
3371
+ return function() {
3372
+ };
3373
+ }
3374
+ assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
3375
+ if (loaded === false) {
3376
+ load();
3377
+ }
3378
+ var ev = "exit";
3379
+ if (opts && opts.alwaysLast) {
3380
+ ev = "afterexit";
3381
+ }
3382
+ var remove = function() {
3383
+ emitter.removeListener(ev, cb);
3384
+ if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
3385
+ unload();
3386
+ }
3387
+ };
3388
+ emitter.on(ev, cb);
3389
+ return remove;
3390
+ };
3391
+ unload = function unload2() {
3392
+ if (!loaded || !processOk(global.process)) {
3393
+ return;
3394
+ }
3395
+ loaded = false;
3396
+ signals.forEach(function(sig) {
3397
+ try {
3398
+ process2.removeListener(sig, sigListeners[sig]);
3399
+ } catch (er) {
3400
+ }
3401
+ });
3402
+ process2.emit = originalProcessEmit;
3403
+ process2.reallyExit = originalProcessReallyExit;
3404
+ emitter.count -= 1;
3405
+ };
3406
+ module.exports.unload = unload;
3407
+ emit = function emit2(event, code, signal) {
3408
+ if (emitter.emitted[event]) {
3409
+ return;
3410
+ }
3411
+ emitter.emitted[event] = true;
3412
+ emitter.emit(event, code, signal);
3413
+ };
3414
+ sigListeners = {};
3415
+ signals.forEach(function(sig) {
3416
+ sigListeners[sig] = function listener() {
3417
+ if (!processOk(global.process)) {
3418
+ return;
3419
+ }
3420
+ var listeners = process2.listeners(sig);
3421
+ if (listeners.length === emitter.count) {
3422
+ unload();
3423
+ emit("exit", null, sig);
3424
+ emit("afterexit", null, sig);
3425
+ if (isWin && sig === "SIGHUP") {
3426
+ sig = "SIGINT";
3427
+ }
3428
+ process2.kill(process2.pid, sig);
3429
+ }
3430
+ };
3431
+ });
3432
+ module.exports.signals = function() {
3433
+ return signals;
3434
+ };
3435
+ loaded = false;
3436
+ load = function load2() {
3437
+ if (loaded || !processOk(global.process)) {
3438
+ return;
3439
+ }
3440
+ loaded = true;
3441
+ emitter.count += 1;
3442
+ signals = signals.filter(function(sig) {
3443
+ try {
3444
+ process2.on(sig, sigListeners[sig]);
3445
+ return true;
3446
+ } catch (er) {
3447
+ return false;
3448
+ }
3449
+ });
3450
+ process2.emit = processEmit;
3451
+ process2.reallyExit = processReallyExit;
3452
+ };
3453
+ module.exports.load = load;
3454
+ originalProcessReallyExit = process2.reallyExit;
3455
+ processReallyExit = function processReallyExit2(code) {
3456
+ if (!processOk(global.process)) {
3457
+ return;
3458
+ }
3459
+ process2.exitCode = code || /* istanbul ignore next */
3460
+ 0;
3461
+ emit("exit", process2.exitCode, null);
3462
+ emit("afterexit", process2.exitCode, null);
3463
+ originalProcessReallyExit.call(process2, process2.exitCode);
3464
+ };
3465
+ originalProcessEmit = process2.emit;
3466
+ processEmit = function processEmit2(ev, arg) {
3467
+ if (ev === "exit" && processOk(global.process)) {
3468
+ if (arg !== void 0) {
3469
+ process2.exitCode = arg;
3470
+ }
3471
+ var ret = originalProcessEmit.apply(this, arguments);
3472
+ emit("exit", process2.exitCode, null);
3473
+ emit("afterexit", process2.exitCode, null);
3474
+ return ret;
3475
+ } else {
3476
+ return originalProcessEmit.apply(this, arguments);
3477
+ }
3478
+ };
3479
+ }
3480
+ var assert;
3481
+ var signals;
3482
+ var isWin;
3483
+ var EE;
3484
+ var emitter;
3485
+ var unload;
3486
+ var emit;
3487
+ var sigListeners;
3488
+ var loaded;
3489
+ var load;
3490
+ var originalProcessReallyExit;
3491
+ var processReallyExit;
3492
+ var originalProcessEmit;
3493
+ var processEmit;
3494
+ }
3495
+ });
3496
+
3497
+ // ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js
3498
+ var require_kill = __commonJS({
3499
+ "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js"(exports, module) {
3500
+ "use strict";
3501
+ var os = __require("os");
3502
+ var onExit = require_signal_exit();
3503
+ var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
3504
+ var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
3505
+ const killResult = kill(signal);
3506
+ setKillTimeout(kill, signal, options, killResult);
3507
+ return killResult;
3508
+ };
3509
+ var setKillTimeout = (kill, signal, options, killResult) => {
3510
+ if (!shouldForceKill(signal, options, killResult)) {
3511
+ return;
3512
+ }
3513
+ const timeout = getForceKillAfterTimeout(options);
3514
+ const t = setTimeout(() => {
3515
+ kill("SIGKILL");
3516
+ }, timeout);
3517
+ if (t.unref) {
3518
+ t.unref();
3519
+ }
3520
+ };
3521
+ var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => {
3522
+ return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
3523
+ };
3524
+ var isSigterm = (signal) => {
3525
+ return signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
3526
+ };
3527
+ var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
3528
+ if (forceKillAfterTimeout === true) {
3529
+ return DEFAULT_FORCE_KILL_TIMEOUT;
3530
+ }
3531
+ if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
3532
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
3533
+ }
3534
+ return forceKillAfterTimeout;
3535
+ };
3536
+ var spawnedCancel = (spawned, context) => {
3537
+ const killResult = spawned.kill();
3538
+ if (killResult) {
3539
+ context.isCanceled = true;
3540
+ }
3541
+ };
3542
+ var timeoutKill = (spawned, signal, reject) => {
3543
+ spawned.kill(signal);
3544
+ reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
3545
+ };
3546
+ var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
3547
+ if (timeout === 0 || timeout === void 0) {
3548
+ return spawnedPromise;
3549
+ }
3550
+ let timeoutId;
3551
+ const timeoutPromise = new Promise((resolve, reject) => {
3552
+ timeoutId = setTimeout(() => {
3553
+ timeoutKill(spawned, killSignal, reject);
3554
+ }, timeout);
3555
+ });
3556
+ const safeSpawnedPromise = spawnedPromise.finally(() => {
3557
+ clearTimeout(timeoutId);
3558
+ });
3559
+ return Promise.race([timeoutPromise, safeSpawnedPromise]);
3560
+ };
3561
+ var validateTimeout = ({ timeout }) => {
3562
+ if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
3563
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
3564
+ }
3565
+ };
3566
+ var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
3567
+ if (!cleanup || detached) {
3568
+ return timedPromise;
3569
+ }
3570
+ const removeExitHandler = onExit(() => {
3571
+ spawned.kill();
3572
+ });
3573
+ return timedPromise.finally(() => {
3574
+ removeExitHandler();
3575
+ });
3576
+ };
3577
+ module.exports = {
3578
+ spawnedKill,
3579
+ spawnedCancel,
3580
+ setupTimeout,
3581
+ validateTimeout,
3582
+ setExitHandler
3583
+ };
3584
+ }
3585
+ });
3586
+
3587
+ // ../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js
3588
+ var require_is_stream = __commonJS({
3589
+ "../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js"(exports, module) {
3590
+ "use strict";
3591
+ var isStream = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
3592
+ isStream.writable = (stream) => isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
3593
+ isStream.readable = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object";
3594
+ isStream.duplex = (stream) => isStream.writable(stream) && isStream.readable(stream);
3595
+ isStream.transform = (stream) => isStream.duplex(stream) && typeof stream._transform === "function";
3596
+ module.exports = isStream;
3597
+ }
3598
+ });
3599
+
3600
+ // ../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js
3601
+ var require_buffer_stream = __commonJS({
3602
+ "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js"(exports, module) {
3603
+ "use strict";
3604
+ var { PassThrough: PassThroughStream } = __require("stream");
3605
+ module.exports = (options) => {
3606
+ options = { ...options };
3607
+ const { array: array5 } = options;
3608
+ let { encoding } = options;
3609
+ const isBuffer = encoding === "buffer";
3610
+ let objectMode = false;
3611
+ if (array5) {
3612
+ objectMode = !(encoding || isBuffer);
3613
+ } else {
3614
+ encoding = encoding || "utf8";
3615
+ }
3616
+ if (isBuffer) {
3617
+ encoding = null;
3618
+ }
3619
+ const stream = new PassThroughStream({ objectMode });
3620
+ if (encoding) {
3621
+ stream.setEncoding(encoding);
3622
+ }
3623
+ let length = 0;
3624
+ const chunks = [];
3625
+ stream.on("data", (chunk) => {
3626
+ chunks.push(chunk);
3627
+ if (objectMode) {
3628
+ length = chunks.length;
3629
+ } else {
3630
+ length += chunk.length;
3631
+ }
3632
+ });
3633
+ stream.getBufferedValue = () => {
3634
+ if (array5) {
3635
+ return chunks;
3636
+ }
3637
+ return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
3638
+ };
3639
+ stream.getBufferedLength = () => length;
3640
+ return stream;
3641
+ };
3642
+ }
3643
+ });
3644
+
3645
+ // ../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js
3646
+ var require_get_stream = __commonJS({
3647
+ "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js"(exports, module) {
3648
+ "use strict";
3649
+ var { constants: BufferConstants } = __require("buffer");
3650
+ var stream = __require("stream");
3651
+ var { promisify } = __require("util");
3652
+ var bufferStream = require_buffer_stream();
3653
+ var streamPipelinePromisified = promisify(stream.pipeline);
3654
+ var MaxBufferError = class extends Error {
3655
+ constructor() {
3656
+ super("maxBuffer exceeded");
3657
+ this.name = "MaxBufferError";
3658
+ }
3659
+ };
3660
+ async function getStream(inputStream, options) {
3661
+ if (!inputStream) {
3662
+ throw new Error("Expected a stream");
3663
+ }
3664
+ options = {
3665
+ maxBuffer: Infinity,
3666
+ ...options
3667
+ };
3668
+ const { maxBuffer } = options;
3669
+ const stream2 = bufferStream(options);
3670
+ await new Promise((resolve, reject) => {
3671
+ const rejectPromise = (error) => {
3672
+ if (error && stream2.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
3673
+ error.bufferedData = stream2.getBufferedValue();
3674
+ }
3675
+ reject(error);
3676
+ };
3677
+ (async () => {
3678
+ try {
3679
+ await streamPipelinePromisified(inputStream, stream2);
3680
+ resolve();
3681
+ } catch (error) {
3682
+ rejectPromise(error);
3683
+ }
3684
+ })();
3685
+ stream2.on("data", () => {
3686
+ if (stream2.getBufferedLength() > maxBuffer) {
3687
+ rejectPromise(new MaxBufferError());
3688
+ }
3689
+ });
3690
+ });
3691
+ return stream2.getBufferedValue();
3692
+ }
3693
+ module.exports = getStream;
3694
+ module.exports.buffer = (stream2, options) => getStream(stream2, { ...options, encoding: "buffer" });
3695
+ module.exports.array = (stream2, options) => getStream(stream2, { ...options, array: true });
3696
+ module.exports.MaxBufferError = MaxBufferError;
3697
+ }
3698
+ });
3699
+
3700
+ // ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
3701
+ var require_merge_stream = __commonJS({
3702
+ "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module) {
3703
+ "use strict";
3704
+ var { PassThrough } = __require("stream");
3705
+ module.exports = function() {
3706
+ var sources = [];
3707
+ var output = new PassThrough({ objectMode: true });
3708
+ output.setMaxListeners(0);
3709
+ output.add = add;
3710
+ output.isEmpty = isEmpty;
3711
+ output.on("unpipe", remove);
3712
+ Array.prototype.slice.call(arguments).forEach(add);
3713
+ return output;
3714
+ function add(source) {
3715
+ if (Array.isArray(source)) {
3716
+ source.forEach(add);
3717
+ return this;
3718
+ }
3719
+ sources.push(source);
3720
+ source.once("end", remove.bind(null, source));
3721
+ source.once("error", output.emit.bind(output, "error"));
3722
+ source.pipe(output, { end: false });
3723
+ return this;
3724
+ }
3725
+ function isEmpty() {
3726
+ return sources.length == 0;
3727
+ }
3728
+ function remove(source) {
3729
+ sources = sources.filter(function(it) {
3730
+ return it !== source;
3731
+ });
3732
+ if (!sources.length && output.readable) {
3733
+ output.end();
3734
+ }
3735
+ }
3736
+ };
3737
+ }
3738
+ });
3739
+
3740
+ // ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js
3741
+ var require_stream = __commonJS({
3742
+ "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js"(exports, module) {
3743
+ "use strict";
3744
+ var isStream = require_is_stream();
3745
+ var getStream = require_get_stream();
3746
+ var mergeStream = require_merge_stream();
3747
+ var handleInput = (spawned, input) => {
3748
+ if (input === void 0 || spawned.stdin === void 0) {
3749
+ return;
3750
+ }
3751
+ if (isStream(input)) {
3752
+ input.pipe(spawned.stdin);
3753
+ } else {
3754
+ spawned.stdin.end(input);
3755
+ }
3756
+ };
3757
+ var makeAllStream = (spawned, { all }) => {
3758
+ if (!all || !spawned.stdout && !spawned.stderr) {
3759
+ return;
3760
+ }
3761
+ const mixed = mergeStream();
3762
+ if (spawned.stdout) {
3763
+ mixed.add(spawned.stdout);
3764
+ }
3765
+ if (spawned.stderr) {
3766
+ mixed.add(spawned.stderr);
3767
+ }
3768
+ return mixed;
3769
+ };
3770
+ var getBufferedData = async (stream, streamPromise) => {
3771
+ if (!stream) {
3772
+ return;
3773
+ }
3774
+ stream.destroy();
3775
+ try {
3776
+ return await streamPromise;
3777
+ } catch (error) {
3778
+ return error.bufferedData;
3779
+ }
3780
+ };
3781
+ var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
3782
+ if (!stream || !buffer) {
3783
+ return;
3784
+ }
3785
+ if (encoding) {
3786
+ return getStream(stream, { encoding, maxBuffer });
3787
+ }
3788
+ return getStream.buffer(stream, { maxBuffer });
3789
+ };
3790
+ var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
3791
+ const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
3792
+ const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
3793
+ const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
3794
+ try {
3795
+ return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
3796
+ } catch (error) {
3797
+ return Promise.all([
3798
+ { error, signal: error.signal, timedOut: error.timedOut },
3799
+ getBufferedData(stdout, stdoutPromise),
3800
+ getBufferedData(stderr, stderrPromise),
3801
+ getBufferedData(all, allPromise)
3802
+ ]);
3803
+ }
3804
+ };
3805
+ var validateInputSync = ({ input }) => {
3806
+ if (isStream(input)) {
3807
+ throw new TypeError("The `input` option cannot be a stream in sync mode");
3808
+ }
3809
+ };
3810
+ module.exports = {
3811
+ handleInput,
3812
+ makeAllStream,
3813
+ getSpawnedResult,
3814
+ validateInputSync
3815
+ };
3816
+ }
3817
+ });
3818
+
3819
+ // ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js
3820
+ var require_promise = __commonJS({
3821
+ "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js"(exports, module) {
3822
+ "use strict";
3823
+ var nativePromisePrototype = (async () => {
3824
+ })().constructor.prototype;
3825
+ var descriptors = ["then", "catch", "finally"].map((property11) => [
3826
+ property11,
3827
+ Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property11)
3828
+ ]);
3829
+ var mergePromise = (spawned, promise2) => {
3830
+ for (const [property11, descriptor] of descriptors) {
3831
+ const value = typeof promise2 === "function" ? (...args) => Reflect.apply(descriptor.value, promise2(), args) : descriptor.value.bind(promise2);
3832
+ Reflect.defineProperty(spawned, property11, { ...descriptor, value });
3833
+ }
3834
+ return spawned;
3835
+ };
3836
+ var getSpawnedPromise = (spawned) => {
3837
+ return new Promise((resolve, reject) => {
3838
+ spawned.on("exit", (exitCode, signal) => {
3839
+ resolve({ exitCode, signal });
3840
+ });
3841
+ spawned.on("error", (error) => {
3842
+ reject(error);
3843
+ });
3844
+ if (spawned.stdin) {
3845
+ spawned.stdin.on("error", (error) => {
3846
+ reject(error);
3847
+ });
3848
+ }
3849
+ });
3850
+ };
3851
+ module.exports = {
3852
+ mergePromise,
3853
+ getSpawnedPromise
3854
+ };
3855
+ }
3856
+ });
3857
+
3858
+ // ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js
3859
+ var require_command = __commonJS({
3860
+ "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js"(exports, module) {
3861
+ "use strict";
3862
+ var normalizeArgs = (file4, args = []) => {
3863
+ if (!Array.isArray(args)) {
3864
+ return [file4];
3865
+ }
3866
+ return [file4, ...args];
3867
+ };
3868
+ var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
3869
+ var DOUBLE_QUOTES_REGEXP = /"/g;
3870
+ var escapeArg = (arg) => {
3871
+ if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
3872
+ return arg;
3873
+ }
3874
+ return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`;
3875
+ };
3876
+ var joinCommand = (file4, args) => {
3877
+ return normalizeArgs(file4, args).join(" ");
3878
+ };
3879
+ var getEscapedCommand = (file4, args) => {
3880
+ return normalizeArgs(file4, args).map((arg) => escapeArg(arg)).join(" ");
3881
+ };
3882
+ var SPACES_REGEXP = / +/g;
3883
+ var parseCommand = (command) => {
3884
+ const tokens = [];
3885
+ for (const token of command.trim().split(SPACES_REGEXP)) {
3886
+ const previousToken = tokens[tokens.length - 1];
3887
+ if (previousToken && previousToken.endsWith("\\")) {
3888
+ tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
3889
+ } else {
3890
+ tokens.push(token);
3891
+ }
3892
+ }
3893
+ return tokens;
3894
+ };
3895
+ module.exports = {
3896
+ joinCommand,
3897
+ getEscapedCommand,
3898
+ parseCommand
3899
+ };
3900
+ }
3901
+ });
3902
+
3903
+ // ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js
3904
+ var require_execa = __commonJS({
3905
+ "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js"(exports, module) {
3906
+ "use strict";
3907
+ var path7 = __require("path");
3908
+ var childProcess = __require("child_process");
3909
+ var crossSpawn = require_cross_spawn();
3910
+ var stripFinalNewline = require_strip_final_newline();
3911
+ var npmRunPath = require_npm_run_path();
3912
+ var onetime = require_onetime();
3913
+ var makeError = require_error();
3914
+ var normalizeStdio = require_stdio();
3915
+ var { spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler } = require_kill();
3916
+ var { handleInput, getSpawnedResult, makeAllStream, validateInputSync } = require_stream();
3917
+ var { mergePromise, getSpawnedPromise } = require_promise();
3918
+ var { joinCommand, parseCommand, getEscapedCommand } = require_command();
3919
+ var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
3920
+ var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
3921
+ const env = extendEnv ? { ...process.env, ...envOption } : envOption;
3922
+ if (preferLocal) {
3923
+ return npmRunPath.env({ env, cwd: localDir, execPath });
3924
+ }
3925
+ return env;
3926
+ };
3927
+ var handleArguments = (file4, args, options = {}) => {
3928
+ const parsed = crossSpawn._parse(file4, args, options);
3929
+ file4 = parsed.command;
3930
+ args = parsed.args;
3931
+ options = parsed.options;
3932
+ options = {
3933
+ maxBuffer: DEFAULT_MAX_BUFFER,
3934
+ buffer: true,
3935
+ stripFinalNewline: true,
3936
+ extendEnv: true,
3937
+ preferLocal: false,
3938
+ localDir: options.cwd || process.cwd(),
3939
+ execPath: process.execPath,
3940
+ encoding: "utf8",
3941
+ reject: true,
3942
+ cleanup: true,
3943
+ all: false,
3944
+ windowsHide: true,
3945
+ ...options
3946
+ };
3947
+ options.env = getEnv(options);
3948
+ options.stdio = normalizeStdio(options);
3949
+ if (process.platform === "win32" && path7.basename(file4, ".exe") === "cmd") {
3950
+ args.unshift("/q");
3951
+ }
3952
+ return { file: file4, args, options, parsed };
3953
+ };
3954
+ var handleOutput = (options, value, error) => {
3955
+ if (typeof value !== "string" && !Buffer.isBuffer(value)) {
3956
+ return error === void 0 ? void 0 : "";
3957
+ }
3958
+ if (options.stripFinalNewline) {
3959
+ return stripFinalNewline(value);
3960
+ }
3961
+ return value;
3962
+ };
3963
+ var execa2 = (file4, args, options) => {
3964
+ const parsed = handleArguments(file4, args, options);
3965
+ const command = joinCommand(file4, args);
3966
+ const escapedCommand = getEscapedCommand(file4, args);
3967
+ validateTimeout(parsed.options);
3968
+ let spawned;
3969
+ try {
3970
+ spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
3971
+ } catch (error) {
3972
+ const dummySpawned = new childProcess.ChildProcess();
3973
+ const errorPromise = Promise.reject(makeError({
3974
+ error,
3975
+ stdout: "",
3976
+ stderr: "",
3977
+ all: "",
3978
+ command,
3979
+ escapedCommand,
3980
+ parsed,
3981
+ timedOut: false,
3982
+ isCanceled: false,
3983
+ killed: false
3984
+ }));
3985
+ return mergePromise(dummySpawned, errorPromise);
3986
+ }
3987
+ const spawnedPromise = getSpawnedPromise(spawned);
3988
+ const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
3989
+ const processDone = setExitHandler(spawned, parsed.options, timedPromise);
3990
+ const context = { isCanceled: false };
3991
+ spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
3992
+ spawned.cancel = spawnedCancel.bind(null, spawned, context);
3993
+ const handlePromise = async () => {
3994
+ const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
3995
+ const stdout = handleOutput(parsed.options, stdoutResult);
3996
+ const stderr = handleOutput(parsed.options, stderrResult);
3997
+ const all = handleOutput(parsed.options, allResult);
3998
+ if (error || exitCode !== 0 || signal !== null) {
3999
+ const returnedError = makeError({
4000
+ error,
4001
+ exitCode,
4002
+ signal,
4003
+ stdout,
4004
+ stderr,
4005
+ all,
4006
+ command,
4007
+ escapedCommand,
4008
+ parsed,
4009
+ timedOut,
4010
+ isCanceled: context.isCanceled,
4011
+ killed: spawned.killed
4012
+ });
4013
+ if (!parsed.options.reject) {
4014
+ return returnedError;
4015
+ }
4016
+ throw returnedError;
4017
+ }
4018
+ return {
4019
+ command,
4020
+ escapedCommand,
4021
+ exitCode: 0,
4022
+ stdout,
4023
+ stderr,
4024
+ all,
4025
+ failed: false,
4026
+ timedOut: false,
4027
+ isCanceled: false,
4028
+ killed: false
4029
+ };
4030
+ };
4031
+ const handlePromiseOnce = onetime(handlePromise);
4032
+ handleInput(spawned, parsed.options.input);
4033
+ spawned.all = makeAllStream(spawned, parsed.options);
4034
+ return mergePromise(spawned, handlePromiseOnce);
4035
+ };
4036
+ module.exports = execa2;
4037
+ module.exports.sync = (file4, args, options) => {
4038
+ const parsed = handleArguments(file4, args, options);
4039
+ const command = joinCommand(file4, args);
4040
+ const escapedCommand = getEscapedCommand(file4, args);
4041
+ validateInputSync(parsed.options);
4042
+ let result;
4043
+ try {
4044
+ result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);
4045
+ } catch (error) {
4046
+ throw makeError({
4047
+ error,
4048
+ stdout: "",
4049
+ stderr: "",
4050
+ all: "",
4051
+ command,
4052
+ escapedCommand,
4053
+ parsed,
4054
+ timedOut: false,
4055
+ isCanceled: false,
4056
+ killed: false
4057
+ });
4058
+ }
4059
+ const stdout = handleOutput(parsed.options, result.stdout, result.error);
4060
+ const stderr = handleOutput(parsed.options, result.stderr, result.error);
4061
+ if (result.error || result.status !== 0 || result.signal !== null) {
4062
+ const error = makeError({
4063
+ stdout,
4064
+ stderr,
4065
+ error: result.error,
4066
+ signal: result.signal,
4067
+ exitCode: result.status,
4068
+ command,
4069
+ escapedCommand,
4070
+ parsed,
4071
+ timedOut: result.error && result.error.code === "ETIMEDOUT",
4072
+ isCanceled: false,
4073
+ killed: result.signal !== null
4074
+ });
4075
+ if (!parsed.options.reject) {
4076
+ return error;
4077
+ }
4078
+ throw error;
4079
+ }
4080
+ return {
4081
+ command,
4082
+ escapedCommand,
4083
+ exitCode: 0,
4084
+ stdout,
4085
+ stderr,
4086
+ failed: false,
4087
+ timedOut: false,
4088
+ isCanceled: false,
4089
+ killed: false
4090
+ };
4091
+ };
4092
+ module.exports.command = (command, options) => {
4093
+ const [file4, ...args] = parseCommand(command);
4094
+ return execa2(file4, args, options);
4095
+ };
4096
+ module.exports.commandSync = (command, options) => {
4097
+ const [file4, ...args] = parseCommand(command);
4098
+ return execa2.sync(file4, args, options);
4099
+ };
4100
+ module.exports.node = (scriptPath, args, options = {}) => {
4101
+ if (args && !Array.isArray(args) && typeof args === "object") {
4102
+ options = args;
4103
+ args = [];
4104
+ }
4105
+ const stdio = normalizeStdio.node(options);
4106
+ const defaultExecArgv = process.execArgv.filter((arg) => !arg.startsWith("--inspect"));
4107
+ const {
4108
+ nodePath = process.execPath,
4109
+ nodeOptions = defaultExecArgv
4110
+ } = options;
4111
+ return execa2(
4112
+ nodePath,
4113
+ [
4114
+ ...nodeOptions,
4115
+ scriptPath,
4116
+ ...Array.isArray(args) ? args : []
4117
+ ],
4118
+ {
4119
+ ...options,
4120
+ stdin: void 0,
4121
+ stdout: void 0,
4122
+ stderr: void 0,
4123
+ stdio,
4124
+ shell: false
4125
+ }
4126
+ );
4127
+ };
4128
+ }
4129
+ });
4130
+
2169
4131
  // src/externalToInternalDmmf.ts
2170
4132
  import { capitalize, lowerCase } from "@prisma/client-common";
2171
4133
  import pluralize from "pluralize";
@@ -7161,14 +9123,15 @@ import { ClientEngineType as ClientEngineType4, getClientEngineType as getClient
7161
9123
  import { match } from "ts-pattern";
7162
9124
 
7163
9125
  // package.json
7164
- var version = "6.6.0-dev.111";
9126
+ var version = "6.6.0-dev.112";
7165
9127
 
7166
9128
  // src/resolvePrismaClient.ts
9129
+ var import_execa = __toESM(require_execa());
7167
9130
  import fs2 from "node:fs/promises";
7168
9131
  import path4 from "node:path";
7169
9132
  import { detect, getCommand } from "@antfu/ni";
7170
9133
  import { Debug as Debug2 } from "@prisma/debug";
7171
- import { resolvePkg } from "@prisma/internals";
9134
+ import { longestCommonPathPrefix, resolvePkg } from "@prisma/internals";
7172
9135
  var debug2 = Debug2("prisma:generator");
7173
9136
  async function resolvePrismaClient(baseDir) {
7174
9137
  const prismaClientDir = await findPrismaClientDir(baseDir);
@@ -7183,6 +9146,73 @@ Please try to install it with ${bold(
7183
9146
  }
7184
9147
  return prismaClientDir;
7185
9148
  }
9149
+ async function resolveOrInstallPrismaClient(baseDir, version2) {
9150
+ let prismaClientDir = await findPrismaClientDir(baseDir);
9151
+ debug2("baseDir", baseDir);
9152
+ if (prismaClientDir) {
9153
+ return prismaClientDir;
9154
+ }
9155
+ let projectRoot = longestCommonPathPrefix(baseDir, process.cwd());
9156
+ debug2("projectRoot", projectRoot);
9157
+ const warningTag = `${bold("Warning:")} ${dim("[Prisma auto-install on generate]")}`;
9158
+ if (projectRoot === void 0) {
9159
+ console.warn(
9160
+ yellow(
9161
+ `${warningTag} The Prisma schema directory ${bold(baseDir)} and the current working directory ${bold(
9162
+ process.cwd()
9163
+ )} have no common ancestor. The Prisma schema directory will be used as the project root.`
9164
+ )
9165
+ );
9166
+ projectRoot = baseDir;
9167
+ }
9168
+ try {
9169
+ await fs2.stat(path4.join(projectRoot, "package.json"));
9170
+ } catch (err) {
9171
+ if (err.code === "ENOENT") {
9172
+ console.warn(
9173
+ yellow(
9174
+ `${warningTag} Prisma could not find a ${bold("package.json")} file in the inferred project root ${bold(
9175
+ projectRoot
9176
+ )}. During the next step, when an auto-install of Prisma package(s) will be attempted, it will then be created by your package manager on the appropriate level if necessary.`
9177
+ )
9178
+ );
9179
+ } else {
9180
+ throw err;
9181
+ }
9182
+ }
9183
+ const prismaCliDir = await resolvePkg("prisma", { basedir: baseDir });
9184
+ if (process.platform === "win32" && await isYarnUsed(baseDir)) {
9185
+ const hasCli = (s) => prismaCliDir !== void 0 ? s : "";
9186
+ const missingCli = (s) => prismaCliDir === void 0 ? s : "";
9187
+ throw new Error(
9188
+ `Could not resolve ${missingCli(`${bold("prisma")} and `)}${bold(
9189
+ "@prisma/client"
9190
+ )} in the current project. Please install ${hasCli("it")}${missingCli("them")} with ${missingCli(
9191
+ `${bold(green(`${await getPackageCmd(baseDir, "add", "prisma", "-D")}`))} and `
9192
+ )}${bold(green(`${await getPackageCmd(baseDir, "add", "@prisma/client")}`))}, and rerun ${bold(
9193
+ await getPackageCmd(baseDir, "execute", "prisma generate")
9194
+ )} \u{1F64F}.`
9195
+ );
9196
+ }
9197
+ if (!prismaCliDir) {
9198
+ await runPackageCmd(projectRoot, "add", `prisma@${version2}`, "-D", "--silent");
9199
+ }
9200
+ await runPackageCmd(projectRoot, "add", `@prisma/client@${version2}`, "--silent");
9201
+ prismaClientDir = await findPrismaClientDir(path4.join(".", baseDir));
9202
+ if (!prismaClientDir) {
9203
+ throw new Error(
9204
+ `Could not resolve @prisma/client despite the installation that we just tried.
9205
+ Please try to install it by hand with ${bold(
9206
+ green(`${await getPackageCmd(baseDir, "add", "@prisma/client")}`)
9207
+ )} and rerun ${bold(await getPackageCmd(baseDir, "execute", "prisma generate"))} \u{1F64F}.`
9208
+ );
9209
+ }
9210
+ console.info(
9211
+ `
9212
+ \u2714 Installed the ${bold(green("@prisma/client"))} and ${bold(green("prisma"))} packages in your project`
9213
+ );
9214
+ return prismaClientDir;
9215
+ }
7186
9216
  async function findPrismaClientDir(baseDir) {
7187
9217
  const resolveOpts = { basedir: baseDir, preserveSymlinks: true };
7188
9218
  const cliDir = await resolvePkg("prisma", resolveOpts);
@@ -7197,20 +9227,38 @@ async function findPrismaClientDir(baseDir) {
7197
9227
  return resolvedClientDir;
7198
9228
  }
7199
9229
  async function getPackageCmd(cwd, cmd, ...args) {
7200
- const agent = await detect({ autoInstall: false, cwd, programmatic: true });
9230
+ const agent = await detect({ cwd, autoInstall: false, programmatic: true });
7201
9231
  return getCommand(agent ?? "npm", cmd, args);
7202
9232
  }
9233
+ async function isYarnUsed(baseDir) {
9234
+ const agent = await detect({ cwd: baseDir, autoInstall: false, programmatic: true });
9235
+ return agent === "yarn" || agent === "yarn@berry";
9236
+ }
9237
+ async function runPackageCmd(cwd, cmd, ...args) {
9238
+ await import_execa.default.command(await getPackageCmd(cwd, cmd, ...args), {
9239
+ // we skip this because we are already in the generator
9240
+ env: { PRISMA_SKIP_POSTINSTALL_GENERATE: "true" },
9241
+ stdio: "inherit",
9242
+ cwd
9243
+ });
9244
+ }
7203
9245
 
7204
9246
  // src/generator.ts
7205
9247
  var debug3 = Debug3("prisma:client:generator");
7206
9248
  var MISSING_CUSTOM_OUTPUT_PATH_WARNING = `${yellow("Warning:")} You did not specify an output path for your \`generator\` in schema.prisma. This behavior is deprecated and will no longer be supported in Prisma 7.0.0. To learn more visit https://pris.ly/cli/output-path`;
7207
9249
  var PrismaClientJsGenerator = class {
7208
9250
  name = "prisma-client-js";
7209
- #shouldResolvePrismaClient = true;
9251
+ #shouldResolvePrismaClient;
9252
+ #shouldInstallMissingPackages;
7210
9253
  #runtimePath;
7211
9254
  #cachedPrismaClientPath;
7212
- constructor({ shouldResolvePrismaClient = true, runtimePath } = {}) {
9255
+ constructor({
9256
+ shouldResolvePrismaClient = true,
9257
+ shouldInstallMissingPackages = true,
9258
+ runtimePath
9259
+ } = {}) {
7213
9260
  this.#shouldResolvePrismaClient = shouldResolvePrismaClient;
9261
+ this.#shouldInstallMissingPackages = shouldInstallMissingPackages;
7214
9262
  this.#runtimePath = runtimePath;
7215
9263
  }
7216
9264
  async getManifest(config) {
@@ -7254,7 +9302,7 @@ var PrismaClientJsGenerator = class {
7254
9302
  if (this.#cachedPrismaClientPath) {
7255
9303
  return this.#cachedPrismaClientPath;
7256
9304
  }
7257
- this.#cachedPrismaClientPath = await resolvePrismaClient(path5.dirname(config.sourceFilePath));
9305
+ this.#cachedPrismaClientPath = await this.#resolveOrInstallPrismaClient(path5.dirname(config.sourceFilePath));
7258
9306
  return this.#cachedPrismaClientPath;
7259
9307
  }
7260
9308
  async #getRuntimePath(config) {
@@ -7264,6 +9312,13 @@ var PrismaClientJsGenerator = class {
7264
9312
  this.#runtimePath = path5.join(await this.#getPrismaClientPath(config), "runtime");
7265
9313
  return this.#runtimePath;
7266
9314
  }
9315
+ async #resolveOrInstallPrismaClient(baseDir) {
9316
+ if (this.#shouldInstallMissingPackages && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
9317
+ return await resolveOrInstallPrismaClient(baseDir, version);
9318
+ } else {
9319
+ return await resolvePrismaClient(baseDir);
9320
+ }
9321
+ }
7267
9322
  };
7268
9323
 
7269
9324
  // src/utils/types/dmmfToTypes.ts