@prisma/internals 6.1.0-dev.3 → 6.1.0-dev.30

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 (68) hide show
  1. package/dist/{chunk-H3T4L34H.js → chunk-25RJ7YTB.js} +88 -83
  2. package/dist/{chunk-S4LINK5Y.js → chunk-2XRDQCIA.js} +5 -5
  3. package/dist/{chunk-HMGEWJDY.js → chunk-3BND5XB4.js} +232 -47
  4. package/dist/{chunk-JMZHUHCC.js → chunk-3DMEILBC.js} +13 -13
  5. package/dist/{chunk-X4K6SW2Y.js → chunk-433BZNLO.js} +13 -13
  6. package/dist/{chunk-D4MCOTL5.js → chunk-5XRQ7ONW.js} +5 -5
  7. package/dist/{chunk-I4467NNA.js → chunk-CXEMRKV4.js} +6 -6
  8. package/dist/{chunk-G7LL2H2O.js → chunk-EKBX4J6O.js} +7 -7
  9. package/dist/{chunk-2CHJ6JM2.js → chunk-FUWQQ4OU.js} +5 -5
  10. package/dist/{chunk-HM5POBB4.js → chunk-HANOM7ZO.js} +5 -5
  11. package/dist/{chunk-LEGPENYH.js → chunk-IMVWKJU5.js} +7 -7
  12. package/dist/{chunk-UIGFAS6M.js → chunk-IS6LGFUU.js} +14 -41
  13. package/dist/{chunk-6VXLRSIV.js → chunk-JB56QOGN.js} +13 -13
  14. package/dist/{chunk-GWBZ6Z6W.js → chunk-JXYVKREJ.js} +5 -5
  15. package/dist/{chunk-ZW637L2K.js → chunk-LEHBZGS4.js} +5 -5
  16. package/dist/{chunk-J4MA2JIK.js → chunk-N6K7M2HZ.js} +5 -5
  17. package/dist/{chunk-LVDENBX2.js → chunk-OBNSXASV.js} +5 -5
  18. package/dist/{chunk-WCWDW6XL.js → chunk-PQ4POE2Y.js} +36 -807
  19. package/dist/{chunk-7CXYD5ZJ.js → chunk-Q3MLJQAZ.js} +5 -5
  20. package/dist/{chunk-RQPDQSHK.js → chunk-QIVUAERL.js} +777 -4
  21. package/dist/{chunk-FPHZVRV4.js → chunk-QJZIYUVB.js} +5 -5
  22. package/dist/{chunk-SLBBRUQS.js → chunk-QTXYAZFX.js} +5 -5
  23. package/dist/{chunk-4RWCRJYD.js → chunk-TFSZCVKC.js} +5 -5
  24. package/dist/{chunk-HPF5G47V.js → chunk-UPIULDLZ.js} +5 -5
  25. package/dist/{chunk-ZADYZQO7.js → chunk-VJ46C5V4.js} +15 -15
  26. package/dist/{chunk-SODELJQA.js → chunk-VX7QGUBY.js} +14 -14
  27. package/dist/{chunk-HU3TYMTP.js → chunk-YNI2SMXZ.js} +5 -5
  28. package/dist/{chunk-26SJISVZ.js → chunk-YO2HQMQH.js} +6 -6
  29. package/dist/{chunk-EWWCVGRX.js → chunk-YOC6F62R.js} +5 -5
  30. package/dist/{chunk-UFRXTLJ3.js → chunk-YWSWNTSV.js} +14 -14
  31. package/dist/{chunk-UGN2IMJV.js → chunk-Z2BJHHA4.js} +36 -807
  32. package/dist/{chunk-XAL6KTHD.js → chunk-ZEJUQ43B.js} +14 -41
  33. package/dist/{chunk-W64BQ3QW.js → chunk-ZKQX4HDV.js} +15 -15
  34. package/dist/cli/checkUnsupportedDataProxy.js +25 -25
  35. package/dist/cli/getSchema.js +30 -30
  36. package/dist/cli/hashes.js +25 -25
  37. package/dist/engine-commands/errorHelpers.js +4 -4
  38. package/dist/engine-commands/formatSchema.js +24 -24
  39. package/dist/engine-commands/getConfig.js +12 -12
  40. package/dist/engine-commands/getDmmf.js +9 -9
  41. package/dist/engine-commands/getEngineVersion.js +8 -8
  42. package/dist/engine-commands/getEnginesMetaInfo.js +10 -10
  43. package/dist/engine-commands/index.js +35 -35
  44. package/dist/engine-commands/lintSchema.js +8 -8
  45. package/dist/engine-commands/mergeSchemas.js +9 -9
  46. package/dist/engine-commands/queryEngineCommons.js +6 -6
  47. package/dist/engine-commands/validate.js +9 -9
  48. package/dist/get-generators/generatorResolvers/generatorResolvers.js +24 -24
  49. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +24 -24
  50. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +25 -25
  51. package/dist/get-generators/getGenerators.js +27 -27
  52. package/dist/get-generators/utils/getBinaryPathsByVersion.js +3 -3
  53. package/dist/index.js +65 -65
  54. package/dist/resolveBinary.js +7 -7
  55. package/dist/schemaEngineCommands.js +8 -8
  56. package/dist/sendPanic.js +24 -24
  57. package/dist/tracing/types.d.ts +26 -16
  58. package/dist/utils/cloudflareD1.js +3 -3
  59. package/dist/utils/getEnvPaths.js +24 -24
  60. package/dist/utils/getGitHubIssueUrl.js +4 -4
  61. package/dist/utils/getVersionFromPackageJson.js +3 -3
  62. package/dist/utils/handleEngineLoadingErrors.js +3 -3
  63. package/dist/utils/handlePanic.js +24 -24
  64. package/dist/utils/load.js +4 -4
  65. package/dist/utils/loadEnvFile.js +24 -24
  66. package/dist/utils/tryLoadEnvs.js +5 -5
  67. package/dist/wasm.js +4 -4
  68. package/package.json +10 -10
@@ -16,11 +16,12 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_RQPDQSHK_exports = {};
20
- __export(chunk_RQPDQSHK_exports, {
19
+ var chunk_QIVUAERL_exports = {};
20
+ __export(chunk_QIVUAERL_exports, {
21
+ require_graceful_fs: () => require_graceful_fs2,
21
22
  require_lib: () => require_lib
22
23
  });
23
- module.exports = __toCommonJS(chunk_RQPDQSHK_exports);
24
+ module.exports = __toCommonJS(chunk_QIVUAERL_exports);
24
25
  var import_chunk_H4J2FN2W = require("./chunk-H4J2FN2W.js");
25
26
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
26
27
  var require_universalify = (0, import_chunk_WWAWV7DQ.__commonJS)({
@@ -1100,6 +1101,778 @@ var require_ensure = (0, import_chunk_WWAWV7DQ.__commonJS)({
1100
1101
  };
1101
1102
  }
1102
1103
  });
1104
+ var require_polyfills = (0, import_chunk_WWAWV7DQ.__commonJS)({
1105
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module2) {
1106
+ "use strict";
1107
+ var constants = (0, import_chunk_WWAWV7DQ.__require)("constants");
1108
+ var origCwd = process.cwd;
1109
+ var cwd = null;
1110
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
1111
+ process.cwd = function() {
1112
+ if (!cwd)
1113
+ cwd = origCwd.call(process);
1114
+ return cwd;
1115
+ };
1116
+ try {
1117
+ process.cwd();
1118
+ } catch (er) {
1119
+ }
1120
+ if (typeof process.chdir === "function") {
1121
+ chdir = process.chdir;
1122
+ process.chdir = function(d) {
1123
+ cwd = null;
1124
+ chdir.call(process, d);
1125
+ };
1126
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
1127
+ }
1128
+ var chdir;
1129
+ module2.exports = patch;
1130
+ function patch(fs) {
1131
+ if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
1132
+ patchLchmod(fs);
1133
+ }
1134
+ if (!fs.lutimes) {
1135
+ patchLutimes(fs);
1136
+ }
1137
+ fs.chown = chownFix(fs.chown);
1138
+ fs.fchown = chownFix(fs.fchown);
1139
+ fs.lchown = chownFix(fs.lchown);
1140
+ fs.chmod = chmodFix(fs.chmod);
1141
+ fs.fchmod = chmodFix(fs.fchmod);
1142
+ fs.lchmod = chmodFix(fs.lchmod);
1143
+ fs.chownSync = chownFixSync(fs.chownSync);
1144
+ fs.fchownSync = chownFixSync(fs.fchownSync);
1145
+ fs.lchownSync = chownFixSync(fs.lchownSync);
1146
+ fs.chmodSync = chmodFixSync(fs.chmodSync);
1147
+ fs.fchmodSync = chmodFixSync(fs.fchmodSync);
1148
+ fs.lchmodSync = chmodFixSync(fs.lchmodSync);
1149
+ fs.stat = statFix(fs.stat);
1150
+ fs.fstat = statFix(fs.fstat);
1151
+ fs.lstat = statFix(fs.lstat);
1152
+ fs.statSync = statFixSync(fs.statSync);
1153
+ fs.fstatSync = statFixSync(fs.fstatSync);
1154
+ fs.lstatSync = statFixSync(fs.lstatSync);
1155
+ if (fs.chmod && !fs.lchmod) {
1156
+ fs.lchmod = function(path, mode, cb) {
1157
+ if (cb) process.nextTick(cb);
1158
+ };
1159
+ fs.lchmodSync = function() {
1160
+ };
1161
+ }
1162
+ if (fs.chown && !fs.lchown) {
1163
+ fs.lchown = function(path, uid, gid, cb) {
1164
+ if (cb) process.nextTick(cb);
1165
+ };
1166
+ fs.lchownSync = function() {
1167
+ };
1168
+ }
1169
+ if (platform === "win32") {
1170
+ fs.rename = typeof fs.rename !== "function" ? fs.rename : function(fs$rename) {
1171
+ function rename(from, to, cb) {
1172
+ var start = Date.now();
1173
+ var backoff = 0;
1174
+ fs$rename(from, to, function CB(er) {
1175
+ if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
1176
+ setTimeout(function() {
1177
+ fs.stat(to, function(stater, st) {
1178
+ if (stater && stater.code === "ENOENT")
1179
+ fs$rename(from, to, CB);
1180
+ else
1181
+ cb(er);
1182
+ });
1183
+ }, backoff);
1184
+ if (backoff < 100)
1185
+ backoff += 10;
1186
+ return;
1187
+ }
1188
+ if (cb) cb(er);
1189
+ });
1190
+ }
1191
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
1192
+ return rename;
1193
+ }(fs.rename);
1194
+ }
1195
+ fs.read = typeof fs.read !== "function" ? fs.read : function(fs$read) {
1196
+ function read(fd, buffer, offset, length, position, callback_) {
1197
+ var callback;
1198
+ if (callback_ && typeof callback_ === "function") {
1199
+ var eagCounter = 0;
1200
+ callback = function(er, _, __) {
1201
+ if (er && er.code === "EAGAIN" && eagCounter < 10) {
1202
+ eagCounter++;
1203
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback);
1204
+ }
1205
+ callback_.apply(this, arguments);
1206
+ };
1207
+ }
1208
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback);
1209
+ }
1210
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
1211
+ return read;
1212
+ }(fs.read);
1213
+ fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : /* @__PURE__ */ function(fs$readSync) {
1214
+ return function(fd, buffer, offset, length, position) {
1215
+ var eagCounter = 0;
1216
+ while (true) {
1217
+ try {
1218
+ return fs$readSync.call(fs, fd, buffer, offset, length, position);
1219
+ } catch (er) {
1220
+ if (er.code === "EAGAIN" && eagCounter < 10) {
1221
+ eagCounter++;
1222
+ continue;
1223
+ }
1224
+ throw er;
1225
+ }
1226
+ }
1227
+ };
1228
+ }(fs.readSync);
1229
+ function patchLchmod(fs2) {
1230
+ fs2.lchmod = function(path, mode, callback) {
1231
+ fs2.open(
1232
+ path,
1233
+ constants.O_WRONLY | constants.O_SYMLINK,
1234
+ mode,
1235
+ function(err, fd) {
1236
+ if (err) {
1237
+ if (callback) callback(err);
1238
+ return;
1239
+ }
1240
+ fs2.fchmod(fd, mode, function(err2) {
1241
+ fs2.close(fd, function(err22) {
1242
+ if (callback) callback(err2 || err22);
1243
+ });
1244
+ });
1245
+ }
1246
+ );
1247
+ };
1248
+ fs2.lchmodSync = function(path, mode) {
1249
+ var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
1250
+ var threw = true;
1251
+ var ret;
1252
+ try {
1253
+ ret = fs2.fchmodSync(fd, mode);
1254
+ threw = false;
1255
+ } finally {
1256
+ if (threw) {
1257
+ try {
1258
+ fs2.closeSync(fd);
1259
+ } catch (er) {
1260
+ }
1261
+ } else {
1262
+ fs2.closeSync(fd);
1263
+ }
1264
+ }
1265
+ return ret;
1266
+ };
1267
+ }
1268
+ function patchLutimes(fs2) {
1269
+ if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
1270
+ fs2.lutimes = function(path, at, mt, cb) {
1271
+ fs2.open(path, constants.O_SYMLINK, function(er, fd) {
1272
+ if (er) {
1273
+ if (cb) cb(er);
1274
+ return;
1275
+ }
1276
+ fs2.futimes(fd, at, mt, function(er2) {
1277
+ fs2.close(fd, function(er22) {
1278
+ if (cb) cb(er2 || er22);
1279
+ });
1280
+ });
1281
+ });
1282
+ };
1283
+ fs2.lutimesSync = function(path, at, mt) {
1284
+ var fd = fs2.openSync(path, constants.O_SYMLINK);
1285
+ var ret;
1286
+ var threw = true;
1287
+ try {
1288
+ ret = fs2.futimesSync(fd, at, mt);
1289
+ threw = false;
1290
+ } finally {
1291
+ if (threw) {
1292
+ try {
1293
+ fs2.closeSync(fd);
1294
+ } catch (er) {
1295
+ }
1296
+ } else {
1297
+ fs2.closeSync(fd);
1298
+ }
1299
+ }
1300
+ return ret;
1301
+ };
1302
+ } else if (fs2.futimes) {
1303
+ fs2.lutimes = function(_a, _b, _c, cb) {
1304
+ if (cb) process.nextTick(cb);
1305
+ };
1306
+ fs2.lutimesSync = function() {
1307
+ };
1308
+ }
1309
+ }
1310
+ function chmodFix(orig) {
1311
+ if (!orig) return orig;
1312
+ return function(target, mode, cb) {
1313
+ return orig.call(fs, target, mode, function(er) {
1314
+ if (chownErOk(er)) er = null;
1315
+ if (cb) cb.apply(this, arguments);
1316
+ });
1317
+ };
1318
+ }
1319
+ function chmodFixSync(orig) {
1320
+ if (!orig) return orig;
1321
+ return function(target, mode) {
1322
+ try {
1323
+ return orig.call(fs, target, mode);
1324
+ } catch (er) {
1325
+ if (!chownErOk(er)) throw er;
1326
+ }
1327
+ };
1328
+ }
1329
+ function chownFix(orig) {
1330
+ if (!orig) return orig;
1331
+ return function(target, uid, gid, cb) {
1332
+ return orig.call(fs, target, uid, gid, function(er) {
1333
+ if (chownErOk(er)) er = null;
1334
+ if (cb) cb.apply(this, arguments);
1335
+ });
1336
+ };
1337
+ }
1338
+ function chownFixSync(orig) {
1339
+ if (!orig) return orig;
1340
+ return function(target, uid, gid) {
1341
+ try {
1342
+ return orig.call(fs, target, uid, gid);
1343
+ } catch (er) {
1344
+ if (!chownErOk(er)) throw er;
1345
+ }
1346
+ };
1347
+ }
1348
+ function statFix(orig) {
1349
+ if (!orig) return orig;
1350
+ return function(target, options, cb) {
1351
+ if (typeof options === "function") {
1352
+ cb = options;
1353
+ options = null;
1354
+ }
1355
+ function callback(er, stats) {
1356
+ if (stats) {
1357
+ if (stats.uid < 0) stats.uid += 4294967296;
1358
+ if (stats.gid < 0) stats.gid += 4294967296;
1359
+ }
1360
+ if (cb) cb.apply(this, arguments);
1361
+ }
1362
+ return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
1363
+ };
1364
+ }
1365
+ function statFixSync(orig) {
1366
+ if (!orig) return orig;
1367
+ return function(target, options) {
1368
+ var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
1369
+ if (stats) {
1370
+ if (stats.uid < 0) stats.uid += 4294967296;
1371
+ if (stats.gid < 0) stats.gid += 4294967296;
1372
+ }
1373
+ return stats;
1374
+ };
1375
+ }
1376
+ function chownErOk(er) {
1377
+ if (!er)
1378
+ return true;
1379
+ if (er.code === "ENOSYS")
1380
+ return true;
1381
+ var nonroot = !process.getuid || process.getuid() !== 0;
1382
+ if (nonroot) {
1383
+ if (er.code === "EINVAL" || er.code === "EPERM")
1384
+ return true;
1385
+ }
1386
+ return false;
1387
+ }
1388
+ }
1389
+ }
1390
+ });
1391
+ var require_legacy_streams = (0, import_chunk_WWAWV7DQ.__commonJS)({
1392
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
1393
+ "use strict";
1394
+ var Stream = (0, import_chunk_WWAWV7DQ.__require)("stream").Stream;
1395
+ module2.exports = legacy;
1396
+ function legacy(fs) {
1397
+ return {
1398
+ ReadStream,
1399
+ WriteStream
1400
+ };
1401
+ function ReadStream(path, options) {
1402
+ if (!(this instanceof ReadStream)) return new ReadStream(path, options);
1403
+ Stream.call(this);
1404
+ var self = this;
1405
+ this.path = path;
1406
+ this.fd = null;
1407
+ this.readable = true;
1408
+ this.paused = false;
1409
+ this.flags = "r";
1410
+ this.mode = 438;
1411
+ this.bufferSize = 64 * 1024;
1412
+ options = options || {};
1413
+ var keys = Object.keys(options);
1414
+ for (var index = 0, length = keys.length; index < length; index++) {
1415
+ var key = keys[index];
1416
+ this[key] = options[key];
1417
+ }
1418
+ if (this.encoding) this.setEncoding(this.encoding);
1419
+ if (this.start !== void 0) {
1420
+ if ("number" !== typeof this.start) {
1421
+ throw TypeError("start must be a Number");
1422
+ }
1423
+ if (this.end === void 0) {
1424
+ this.end = Infinity;
1425
+ } else if ("number" !== typeof this.end) {
1426
+ throw TypeError("end must be a Number");
1427
+ }
1428
+ if (this.start > this.end) {
1429
+ throw new Error("start must be <= end");
1430
+ }
1431
+ this.pos = this.start;
1432
+ }
1433
+ if (this.fd !== null) {
1434
+ process.nextTick(function() {
1435
+ self._read();
1436
+ });
1437
+ return;
1438
+ }
1439
+ fs.open(this.path, this.flags, this.mode, function(err, fd) {
1440
+ if (err) {
1441
+ self.emit("error", err);
1442
+ self.readable = false;
1443
+ return;
1444
+ }
1445
+ self.fd = fd;
1446
+ self.emit("open", fd);
1447
+ self._read();
1448
+ });
1449
+ }
1450
+ function WriteStream(path, options) {
1451
+ if (!(this instanceof WriteStream)) return new WriteStream(path, options);
1452
+ Stream.call(this);
1453
+ this.path = path;
1454
+ this.fd = null;
1455
+ this.writable = true;
1456
+ this.flags = "w";
1457
+ this.encoding = "binary";
1458
+ this.mode = 438;
1459
+ this.bytesWritten = 0;
1460
+ options = options || {};
1461
+ var keys = Object.keys(options);
1462
+ for (var index = 0, length = keys.length; index < length; index++) {
1463
+ var key = keys[index];
1464
+ this[key] = options[key];
1465
+ }
1466
+ if (this.start !== void 0) {
1467
+ if ("number" !== typeof this.start) {
1468
+ throw TypeError("start must be a Number");
1469
+ }
1470
+ if (this.start < 0) {
1471
+ throw new Error("start must be >= zero");
1472
+ }
1473
+ this.pos = this.start;
1474
+ }
1475
+ this.busy = false;
1476
+ this._queue = [];
1477
+ if (this.fd === null) {
1478
+ this._open = fs.open;
1479
+ this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
1480
+ this.flush();
1481
+ }
1482
+ }
1483
+ }
1484
+ }
1485
+ });
1486
+ var require_clone = (0, import_chunk_WWAWV7DQ.__commonJS)({
1487
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module2) {
1488
+ "use strict";
1489
+ module2.exports = clone;
1490
+ var getPrototypeOf = Object.getPrototypeOf || function(obj) {
1491
+ return obj.__proto__;
1492
+ };
1493
+ function clone(obj) {
1494
+ if (obj === null || typeof obj !== "object")
1495
+ return obj;
1496
+ if (obj instanceof Object)
1497
+ var copy = { __proto__: getPrototypeOf(obj) };
1498
+ else
1499
+ var copy = /* @__PURE__ */ Object.create(null);
1500
+ Object.getOwnPropertyNames(obj).forEach(function(key) {
1501
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
1502
+ });
1503
+ return copy;
1504
+ }
1505
+ }
1506
+ });
1507
+ var require_graceful_fs2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
1508
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
1509
+ "use strict";
1510
+ var fs = (0, import_chunk_WWAWV7DQ.__require)("fs");
1511
+ var polyfills = require_polyfills();
1512
+ var legacy = require_legacy_streams();
1513
+ var clone = require_clone();
1514
+ var util = (0, import_chunk_WWAWV7DQ.__require)("util");
1515
+ var gracefulQueue;
1516
+ var previousSymbol;
1517
+ if (typeof Symbol === "function" && typeof Symbol.for === "function") {
1518
+ gracefulQueue = Symbol.for("graceful-fs.queue");
1519
+ previousSymbol = Symbol.for("graceful-fs.previous");
1520
+ } else {
1521
+ gracefulQueue = "___graceful-fs.queue";
1522
+ previousSymbol = "___graceful-fs.previous";
1523
+ }
1524
+ function noop() {
1525
+ }
1526
+ function publishQueue(context, queue2) {
1527
+ Object.defineProperty(context, gracefulQueue, {
1528
+ get: function() {
1529
+ return queue2;
1530
+ }
1531
+ });
1532
+ }
1533
+ var debug = noop;
1534
+ if (util.debuglog)
1535
+ debug = util.debuglog("gfs4");
1536
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
1537
+ debug = function() {
1538
+ var m = util.format.apply(util, arguments);
1539
+ m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
1540
+ console.error(m);
1541
+ };
1542
+ if (!fs[gracefulQueue]) {
1543
+ queue = global[gracefulQueue] || [];
1544
+ publishQueue(fs, queue);
1545
+ fs.close = function(fs$close) {
1546
+ function close(fd, cb) {
1547
+ return fs$close.call(fs, fd, function(err) {
1548
+ if (!err) {
1549
+ resetQueue();
1550
+ }
1551
+ if (typeof cb === "function")
1552
+ cb.apply(this, arguments);
1553
+ });
1554
+ }
1555
+ Object.defineProperty(close, previousSymbol, {
1556
+ value: fs$close
1557
+ });
1558
+ return close;
1559
+ }(fs.close);
1560
+ fs.closeSync = function(fs$closeSync) {
1561
+ function closeSync(fd) {
1562
+ fs$closeSync.apply(fs, arguments);
1563
+ resetQueue();
1564
+ }
1565
+ Object.defineProperty(closeSync, previousSymbol, {
1566
+ value: fs$closeSync
1567
+ });
1568
+ return closeSync;
1569
+ }(fs.closeSync);
1570
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
1571
+ process.on("exit", function() {
1572
+ debug(fs[gracefulQueue]);
1573
+ (0, import_chunk_WWAWV7DQ.__require)("assert").equal(fs[gracefulQueue].length, 0);
1574
+ });
1575
+ }
1576
+ }
1577
+ var queue;
1578
+ if (!global[gracefulQueue]) {
1579
+ publishQueue(global, fs[gracefulQueue]);
1580
+ }
1581
+ module2.exports = patch(clone(fs));
1582
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
1583
+ module2.exports = patch(fs);
1584
+ fs.__patched = true;
1585
+ }
1586
+ function patch(fs2) {
1587
+ polyfills(fs2);
1588
+ fs2.gracefulify = patch;
1589
+ fs2.createReadStream = createReadStream;
1590
+ fs2.createWriteStream = createWriteStream;
1591
+ var fs$readFile = fs2.readFile;
1592
+ fs2.readFile = readFile;
1593
+ function readFile(path, options, cb) {
1594
+ if (typeof options === "function")
1595
+ cb = options, options = null;
1596
+ return go$readFile(path, options, cb);
1597
+ function go$readFile(path2, options2, cb2, startTime) {
1598
+ return fs$readFile(path2, options2, function(err) {
1599
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1600
+ enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]);
1601
+ else {
1602
+ if (typeof cb2 === "function")
1603
+ cb2.apply(this, arguments);
1604
+ }
1605
+ });
1606
+ }
1607
+ }
1608
+ var fs$writeFile = fs2.writeFile;
1609
+ fs2.writeFile = writeFile;
1610
+ function writeFile(path, data, options, cb) {
1611
+ if (typeof options === "function")
1612
+ cb = options, options = null;
1613
+ return go$writeFile(path, data, options, cb);
1614
+ function go$writeFile(path2, data2, options2, cb2, startTime) {
1615
+ return fs$writeFile(path2, data2, options2, function(err) {
1616
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1617
+ enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
1618
+ else {
1619
+ if (typeof cb2 === "function")
1620
+ cb2.apply(this, arguments);
1621
+ }
1622
+ });
1623
+ }
1624
+ }
1625
+ var fs$appendFile = fs2.appendFile;
1626
+ if (fs$appendFile)
1627
+ fs2.appendFile = appendFile;
1628
+ function appendFile(path, data, options, cb) {
1629
+ if (typeof options === "function")
1630
+ cb = options, options = null;
1631
+ return go$appendFile(path, data, options, cb);
1632
+ function go$appendFile(path2, data2, options2, cb2, startTime) {
1633
+ return fs$appendFile(path2, data2, options2, function(err) {
1634
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1635
+ enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
1636
+ else {
1637
+ if (typeof cb2 === "function")
1638
+ cb2.apply(this, arguments);
1639
+ }
1640
+ });
1641
+ }
1642
+ }
1643
+ var fs$copyFile = fs2.copyFile;
1644
+ if (fs$copyFile)
1645
+ fs2.copyFile = copyFile;
1646
+ function copyFile(src, dest, flags, cb) {
1647
+ if (typeof flags === "function") {
1648
+ cb = flags;
1649
+ flags = 0;
1650
+ }
1651
+ return go$copyFile(src, dest, flags, cb);
1652
+ function go$copyFile(src2, dest2, flags2, cb2, startTime) {
1653
+ return fs$copyFile(src2, dest2, flags2, function(err) {
1654
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1655
+ enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
1656
+ else {
1657
+ if (typeof cb2 === "function")
1658
+ cb2.apply(this, arguments);
1659
+ }
1660
+ });
1661
+ }
1662
+ }
1663
+ var fs$readdir = fs2.readdir;
1664
+ fs2.readdir = readdir;
1665
+ var noReaddirOptionVersions = /^v[0-5]\./;
1666
+ function readdir(path, options, cb) {
1667
+ if (typeof options === "function")
1668
+ cb = options, options = null;
1669
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) {
1670
+ return fs$readdir(path2, fs$readdirCallback(
1671
+ path2,
1672
+ options2,
1673
+ cb2,
1674
+ startTime
1675
+ ));
1676
+ } : function go$readdir2(path2, options2, cb2, startTime) {
1677
+ return fs$readdir(path2, options2, fs$readdirCallback(
1678
+ path2,
1679
+ options2,
1680
+ cb2,
1681
+ startTime
1682
+ ));
1683
+ };
1684
+ return go$readdir(path, options, cb);
1685
+ function fs$readdirCallback(path2, options2, cb2, startTime) {
1686
+ return function(err, files) {
1687
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1688
+ enqueue([
1689
+ go$readdir,
1690
+ [path2, options2, cb2],
1691
+ err,
1692
+ startTime || Date.now(),
1693
+ Date.now()
1694
+ ]);
1695
+ else {
1696
+ if (files && files.sort)
1697
+ files.sort();
1698
+ if (typeof cb2 === "function")
1699
+ cb2.call(this, err, files);
1700
+ }
1701
+ };
1702
+ }
1703
+ }
1704
+ if (process.version.substr(0, 4) === "v0.8") {
1705
+ var legStreams = legacy(fs2);
1706
+ ReadStream = legStreams.ReadStream;
1707
+ WriteStream = legStreams.WriteStream;
1708
+ }
1709
+ var fs$ReadStream = fs2.ReadStream;
1710
+ if (fs$ReadStream) {
1711
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype);
1712
+ ReadStream.prototype.open = ReadStream$open;
1713
+ }
1714
+ var fs$WriteStream = fs2.WriteStream;
1715
+ if (fs$WriteStream) {
1716
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype);
1717
+ WriteStream.prototype.open = WriteStream$open;
1718
+ }
1719
+ Object.defineProperty(fs2, "ReadStream", {
1720
+ get: function() {
1721
+ return ReadStream;
1722
+ },
1723
+ set: function(val) {
1724
+ ReadStream = val;
1725
+ },
1726
+ enumerable: true,
1727
+ configurable: true
1728
+ });
1729
+ Object.defineProperty(fs2, "WriteStream", {
1730
+ get: function() {
1731
+ return WriteStream;
1732
+ },
1733
+ set: function(val) {
1734
+ WriteStream = val;
1735
+ },
1736
+ enumerable: true,
1737
+ configurable: true
1738
+ });
1739
+ var FileReadStream = ReadStream;
1740
+ Object.defineProperty(fs2, "FileReadStream", {
1741
+ get: function() {
1742
+ return FileReadStream;
1743
+ },
1744
+ set: function(val) {
1745
+ FileReadStream = val;
1746
+ },
1747
+ enumerable: true,
1748
+ configurable: true
1749
+ });
1750
+ var FileWriteStream = WriteStream;
1751
+ Object.defineProperty(fs2, "FileWriteStream", {
1752
+ get: function() {
1753
+ return FileWriteStream;
1754
+ },
1755
+ set: function(val) {
1756
+ FileWriteStream = val;
1757
+ },
1758
+ enumerable: true,
1759
+ configurable: true
1760
+ });
1761
+ function ReadStream(path, options) {
1762
+ if (this instanceof ReadStream)
1763
+ return fs$ReadStream.apply(this, arguments), this;
1764
+ else
1765
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
1766
+ }
1767
+ function ReadStream$open() {
1768
+ var that = this;
1769
+ open(that.path, that.flags, that.mode, function(err, fd) {
1770
+ if (err) {
1771
+ if (that.autoClose)
1772
+ that.destroy();
1773
+ that.emit("error", err);
1774
+ } else {
1775
+ that.fd = fd;
1776
+ that.emit("open", fd);
1777
+ that.read();
1778
+ }
1779
+ });
1780
+ }
1781
+ function WriteStream(path, options) {
1782
+ if (this instanceof WriteStream)
1783
+ return fs$WriteStream.apply(this, arguments), this;
1784
+ else
1785
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
1786
+ }
1787
+ function WriteStream$open() {
1788
+ var that = this;
1789
+ open(that.path, that.flags, that.mode, function(err, fd) {
1790
+ if (err) {
1791
+ that.destroy();
1792
+ that.emit("error", err);
1793
+ } else {
1794
+ that.fd = fd;
1795
+ that.emit("open", fd);
1796
+ }
1797
+ });
1798
+ }
1799
+ function createReadStream(path, options) {
1800
+ return new fs2.ReadStream(path, options);
1801
+ }
1802
+ function createWriteStream(path, options) {
1803
+ return new fs2.WriteStream(path, options);
1804
+ }
1805
+ var fs$open = fs2.open;
1806
+ fs2.open = open;
1807
+ function open(path, flags, mode, cb) {
1808
+ if (typeof mode === "function")
1809
+ cb = mode, mode = null;
1810
+ return go$open(path, flags, mode, cb);
1811
+ function go$open(path2, flags2, mode2, cb2, startTime) {
1812
+ return fs$open(path2, flags2, mode2, function(err, fd) {
1813
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1814
+ enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
1815
+ else {
1816
+ if (typeof cb2 === "function")
1817
+ cb2.apply(this, arguments);
1818
+ }
1819
+ });
1820
+ }
1821
+ }
1822
+ return fs2;
1823
+ }
1824
+ function enqueue(elem) {
1825
+ debug("ENQUEUE", elem[0].name, elem[1]);
1826
+ fs[gracefulQueue].push(elem);
1827
+ retry();
1828
+ }
1829
+ var retryTimer;
1830
+ function resetQueue() {
1831
+ var now = Date.now();
1832
+ for (var i = 0; i < fs[gracefulQueue].length; ++i) {
1833
+ if (fs[gracefulQueue][i].length > 2) {
1834
+ fs[gracefulQueue][i][3] = now;
1835
+ fs[gracefulQueue][i][4] = now;
1836
+ }
1837
+ }
1838
+ retry();
1839
+ }
1840
+ function retry() {
1841
+ clearTimeout(retryTimer);
1842
+ retryTimer = void 0;
1843
+ if (fs[gracefulQueue].length === 0)
1844
+ return;
1845
+ var elem = fs[gracefulQueue].shift();
1846
+ var fn = elem[0];
1847
+ var args = elem[1];
1848
+ var err = elem[2];
1849
+ var startTime = elem[3];
1850
+ var lastTime = elem[4];
1851
+ if (startTime === void 0) {
1852
+ debug("RETRY", fn.name, args);
1853
+ fn.apply(null, args);
1854
+ } else if (Date.now() - startTime >= 6e4) {
1855
+ debug("TIMEOUT", fn.name, args);
1856
+ var cb = args.pop();
1857
+ if (typeof cb === "function")
1858
+ cb.call(null, err);
1859
+ } else {
1860
+ var sinceAttempt = Date.now() - lastTime;
1861
+ var sinceStart = Math.max(lastTime - startTime, 1);
1862
+ var desiredDelay = Math.min(sinceStart * 1.2, 100);
1863
+ if (sinceAttempt >= desiredDelay) {
1864
+ debug("RETRY", fn.name, args);
1865
+ fn.apply(null, args.concat([startTime]));
1866
+ } else {
1867
+ fs[gracefulQueue].push(elem);
1868
+ }
1869
+ }
1870
+ if (retryTimer === void 0) {
1871
+ retryTimer = setTimeout(retry, 0);
1872
+ }
1873
+ }
1874
+ }
1875
+ });
1103
1876
  var require_utils2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
1104
1877
  "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module2) {
1105
1878
  "use strict";
@@ -1120,7 +1893,7 @@ var require_jsonfile = (0, import_chunk_WWAWV7DQ.__commonJS)({
1120
1893
  "use strict";
1121
1894
  var _fs;
1122
1895
  try {
1123
- _fs = (0, import_chunk_H4J2FN2W.require_graceful_fs)();
1896
+ _fs = require_graceful_fs2();
1124
1897
  } catch (_) {
1125
1898
  _fs = (0, import_chunk_WWAWV7DQ.__require)("fs");
1126
1899
  }