@rsbuild/core 1.2.3 → 1.2.4

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.
@@ -52,12 +52,12 @@
52
52
  };
53
53
  }
54
54
  },
55
- 1698: (__unused_webpack_module, exports, __nccwpck_require__) => {
55
+ 4297: (__unused_webpack_module, exports, __nccwpck_require__) => {
56
56
  "use strict";
57
57
  Object.defineProperty(exports, "__esModule", { value: true });
58
58
  exports.Dir = void 0;
59
- const util_1 = __nccwpck_require__(7260);
60
- const Dirent_1 = __nccwpck_require__(5817);
59
+ const util_1 = __nccwpck_require__(9483);
60
+ const Dirent_1 = __nccwpck_require__(6912);
61
61
  class Dir {
62
62
  constructor(link, options) {
63
63
  this.link = link;
@@ -178,12 +178,12 @@
178
178
  }
179
179
  exports.Dir = Dir;
180
180
  },
181
- 5817: (__unused_webpack_module, exports, __nccwpck_require__) => {
181
+ 6912: (__unused_webpack_module, exports, __nccwpck_require__) => {
182
182
  "use strict";
183
183
  Object.defineProperty(exports, "__esModule", { value: true });
184
184
  exports.Dirent = void 0;
185
- const constants_1 = __nccwpck_require__(1640);
186
- const encoding_1 = __nccwpck_require__(312);
185
+ const constants_1 = __nccwpck_require__(1895);
186
+ const encoding_1 = __nccwpck_require__(7721);
187
187
  const {
188
188
  S_IFMT,
189
189
  S_IFDIR,
@@ -238,11 +238,11 @@
238
238
  exports.Dirent = Dirent;
239
239
  exports["default"] = Dirent;
240
240
  },
241
- 4146: (__unused_webpack_module, exports, __nccwpck_require__) => {
241
+ 845: (__unused_webpack_module, exports, __nccwpck_require__) => {
242
242
  "use strict";
243
243
  Object.defineProperty(exports, "__esModule", { value: true });
244
244
  exports.Stats = void 0;
245
- const constants_1 = __nccwpck_require__(1640);
245
+ const constants_1 = __nccwpck_require__(1895);
246
246
  const {
247
247
  S_IFMT,
248
248
  S_IFDIR,
@@ -262,7 +262,7 @@
262
262
  : (number) => BigInt(number);
263
263
  stats.uid = getStatNumber(uid);
264
264
  stats.gid = getStatNumber(gid);
265
- stats.rdev = getStatNumber(0);
265
+ stats.rdev = getStatNumber(node.rdev);
266
266
  stats.blksize = getStatNumber(4096);
267
267
  stats.ino = getStatNumber(node.ino);
268
268
  stats.size = getStatNumber(node.getSize());
@@ -316,7 +316,7 @@
316
316
  exports.Stats = Stats;
317
317
  exports["default"] = Stats;
318
318
  },
319
- 1640: (__unused_webpack_module, exports) => {
319
+ 1895: (__unused_webpack_module, exports) => {
320
320
  "use strict";
321
321
  Object.defineProperty(exports, "__esModule", { value: true });
322
322
  exports.constants = void 0;
@@ -370,14 +370,14 @@
370
370
  COPYFILE_FICLONE_FORCE: 4,
371
371
  };
372
372
  },
373
- 312: (__unused_webpack_module, exports, __nccwpck_require__) => {
373
+ 7721: (__unused_webpack_module, exports, __nccwpck_require__) => {
374
374
  "use strict";
375
375
  Object.defineProperty(exports, "__esModule", { value: true });
376
376
  exports.ENCODING_UTF8 = void 0;
377
377
  exports.assertEncoding = assertEncoding;
378
378
  exports.strToEncoding = strToEncoding;
379
- const buffer_1 = __nccwpck_require__(6741);
380
- const errors = __nccwpck_require__(7012);
379
+ const buffer_1 = __nccwpck_require__(3330);
380
+ const errors = __nccwpck_require__(4583);
381
381
  exports.ENCODING_UTF8 = "utf8";
382
382
  function assertEncoding(encoding) {
383
383
  if (encoding && !buffer_1.Buffer.isEncoding(encoding))
@@ -392,17 +392,17 @@
392
392
  return new buffer_1.Buffer(str).toString(encoding);
393
393
  }
394
394
  },
395
- 1025: (module, exports, __nccwpck_require__) => {
395
+ 5590: (module, exports, __nccwpck_require__) => {
396
396
  "use strict";
397
397
  Object.defineProperty(exports, "__esModule", { value: true });
398
398
  exports.memfs = exports.fs = exports.vol = exports.Volume = void 0;
399
399
  exports.createFsFromVolume = createFsFromVolume;
400
- const Stats_1 = __nccwpck_require__(4146);
401
- const Dirent_1 = __nccwpck_require__(5817);
402
- const volume_1 = __nccwpck_require__(4523);
403
- const constants_1 = __nccwpck_require__(1640);
404
- const fsSynchronousApiList_1 = __nccwpck_require__(5778);
405
- const fsCallbackApiList_1 = __nccwpck_require__(1168);
400
+ const Stats_1 = __nccwpck_require__(845);
401
+ const Dirent_1 = __nccwpck_require__(6912);
402
+ const volume_1 = __nccwpck_require__(7682);
403
+ const constants_1 = __nccwpck_require__(1895);
404
+ const fsSynchronousApiList_1 = __nccwpck_require__(9041);
405
+ const fsCallbackApiList_1 = __nccwpck_require__(6417);
406
406
  const { F_OK, R_OK, W_OK, X_OK } = constants_1.constants;
407
407
  exports.Volume = volume_1.Volume;
408
408
  exports.vol = new volume_1.Volume();
@@ -444,7 +444,7 @@
444
444
  );
445
445
  module.exports.semantic = true;
446
446
  },
447
- 6741: (__unused_webpack_module, exports, __nccwpck_require__) => {
447
+ 3330: (__unused_webpack_module, exports, __nccwpck_require__) => {
448
448
  "use strict";
449
449
  Object.defineProperty(exports, "__esModule", { value: true });
450
450
  exports.bufferFrom = exports.bufferAllocUnsafe = exports.Buffer = void 0;
@@ -464,7 +464,7 @@
464
464
  const bufferFrom = buffer_1.Buffer.from || bufferV0P12Ponyfill;
465
465
  exports.bufferFrom = bufferFrom;
466
466
  },
467
- 7012: (__unused_webpack_module, exports, __nccwpck_require__) => {
467
+ 4583: (__unused_webpack_module, exports, __nccwpck_require__) => {
468
468
  "use strict";
469
469
  Object.defineProperty(exports, "__esModule", { value: true });
470
470
  exports.AssertionError =
@@ -743,7 +743,7 @@
743
743
  }
744
744
  }
745
745
  },
746
- 2583: (__unused_webpack_module, exports) => {
746
+ 6934: (__unused_webpack_module, exports) => {
747
747
  "use strict";
748
748
  Object.defineProperty(exports, "__esModule", { value: true });
749
749
  exports.newNotAllowedError =
@@ -799,16 +799,16 @@
799
799
  new DOMException("Permission not granted.", "NotAllowedError");
800
800
  exports.newNotAllowedError = newNotAllowedError;
801
801
  },
802
- 3385: (__unused_webpack_module, exports, __nccwpck_require__) => {
802
+ 540: (__unused_webpack_module, exports, __nccwpck_require__) => {
803
803
  "use strict";
804
804
  Object.defineProperty(exports, "__esModule", { value: true });
805
805
  exports.File = exports.Link = exports.Node = exports.SEP = void 0;
806
- const process_1 = __nccwpck_require__(7412);
807
- const buffer_1 = __nccwpck_require__(6741);
808
- const constants_1 = __nccwpck_require__(1640);
806
+ const process_1 = __nccwpck_require__(4507);
807
+ const buffer_1 = __nccwpck_require__(3330);
808
+ const constants_1 = __nccwpck_require__(1895);
809
809
  const events_1 = __nccwpck_require__(4434);
810
- const Stats_1 = __nccwpck_require__(4146);
811
- const { S_IFMT, S_IFDIR, S_IFREG, S_IFLNK, O_APPEND } =
810
+ const Stats_1 = __nccwpck_require__(845);
811
+ const { S_IFMT, S_IFDIR, S_IFREG, S_IFLNK, S_IFCHR, O_APPEND } =
812
812
  constants_1.constants;
813
813
  const getuid = () => {
814
814
  var _a, _b;
@@ -830,18 +830,16 @@
830
830
  };
831
831
  exports.SEP = "/";
832
832
  class Node extends events_1.EventEmitter {
833
- constructor(ino, perm = 438) {
833
+ constructor(ino, mode = 438) {
834
834
  super();
835
835
  this._uid = getuid();
836
836
  this._gid = getgid();
837
837
  this._atime = new Date();
838
838
  this._mtime = new Date();
839
839
  this._ctime = new Date();
840
- this._perm = 438;
841
- this.mode = S_IFREG;
840
+ this.rdev = 0;
842
841
  this._nlink = 1;
843
- this._perm = perm;
844
- this.mode |= perm;
842
+ this.mode = mode;
845
843
  this.ino = ino;
846
844
  }
847
845
  set ctime(ctime) {
@@ -878,13 +876,13 @@
878
876
  get mtime() {
879
877
  return this._mtime;
880
878
  }
879
+ get perm() {
880
+ return this.mode & ~S_IFMT;
881
+ }
881
882
  set perm(perm) {
882
- this._perm = perm;
883
+ this.mode = (this.mode & S_IFMT) | (perm & ~S_IFMT);
883
884
  this.ctime = new Date();
884
885
  }
885
- get perm() {
886
- return this._perm;
887
- }
888
886
  set nlink(nlink) {
889
887
  this._nlink = nlink;
890
888
  this.ctime = new Date();
@@ -913,16 +911,7 @@
913
911
  return this.buf ? this.buf.length : 0;
914
912
  }
915
913
  setModeProperty(property) {
916
- this.mode = (this.mode & ~S_IFMT) | property;
917
- }
918
- setIsFile() {
919
- this.setModeProperty(S_IFREG);
920
- }
921
- setIsDirectory() {
922
- this.setModeProperty(S_IFDIR);
923
- }
924
- setIsSymlink() {
925
- this.setModeProperty(S_IFLNK);
914
+ this.mode = property;
926
915
  }
927
916
  isFile() {
928
917
  return (this.mode & S_IFMT) === S_IFREG;
@@ -933,9 +922,12 @@
933
922
  isSymlink() {
934
923
  return (this.mode & S_IFMT) === S_IFLNK;
935
924
  }
936
- makeSymlink(steps) {
937
- this.symlink = steps;
938
- this.setIsSymlink();
925
+ isCharacterDevice() {
926
+ return (this.mode & S_IFMT) === S_IFCHR;
927
+ }
928
+ makeSymlink(symlink) {
929
+ this.mode = S_IFLNK | 438;
930
+ this.symlink = symlink;
939
931
  }
940
932
  write(buf, off = 0, len = buf.length, pos = 0) {
941
933
  if (!this.buf) this.buf = (0, buffer_1.bufferAllocUnsafe)(0);
@@ -981,8 +973,7 @@
981
973
  this.touch();
982
974
  }
983
975
  chmod(perm) {
984
- this.perm = perm;
985
- this.mode = (this.mode & ~511) | perm;
976
+ this.mode = (this.mode & S_IFMT) | (perm & ~S_IFMT);
986
977
  this.touch();
987
978
  }
988
979
  chown(uid, gid) {
@@ -1093,7 +1084,7 @@
1093
1084
  getNode() {
1094
1085
  return this.node;
1095
1086
  }
1096
- createChild(name, node = this.vol.createNode()) {
1087
+ createChild(name, node = this.vol.createNode(S_IFREG | 438)) {
1097
1088
  const link = new Link(this.vol, this, name);
1098
1089
  link.setNode(node);
1099
1090
  if (node.isDirectory()) {
@@ -1208,11 +1199,11 @@
1208
1199
  }
1209
1200
  exports.File = File;
1210
1201
  },
1211
- 2296: (__unused_webpack_module, exports, __nccwpck_require__) => {
1202
+ 2407: (__unused_webpack_module, exports, __nccwpck_require__) => {
1212
1203
  "use strict";
1213
1204
  Object.defineProperty(exports, "__esModule", { value: true });
1214
1205
  exports.FileHandle = void 0;
1215
- const util_1 = __nccwpck_require__(7260);
1206
+ const util_1 = __nccwpck_require__(9483);
1216
1207
  class FileHandle {
1217
1208
  constructor(fs, fd) {
1218
1209
  this.fs = fs;
@@ -1237,6 +1228,18 @@
1237
1228
  datasync() {
1238
1229
  return (0, util_1.promisify)(this.fs, "fdatasync")(this.fd);
1239
1230
  }
1231
+ createReadStream(options) {
1232
+ return this.fs.createReadStream(
1233
+ "",
1234
+ Object.assign(Object.assign({}, options), { fd: this }),
1235
+ );
1236
+ }
1237
+ createWriteStream(options) {
1238
+ return this.fs.createWriteStream(
1239
+ "",
1240
+ Object.assign(Object.assign({}, options), { fd: this }),
1241
+ );
1242
+ }
1240
1243
  readableWebStream(options) {
1241
1244
  return new ReadableStream({
1242
1245
  pull: async (controller) => {
@@ -1299,12 +1302,12 @@
1299
1302
  }
1300
1303
  exports.FileHandle = FileHandle;
1301
1304
  },
1302
- 8989: (__unused_webpack_module, exports, __nccwpck_require__) => {
1305
+ 5890: (__unused_webpack_module, exports, __nccwpck_require__) => {
1303
1306
  "use strict";
1304
1307
  Object.defineProperty(exports, "__esModule", { value: true });
1305
1308
  exports.FsPromises = void 0;
1306
- const util_1 = __nccwpck_require__(7260);
1307
- const constants_1 = __nccwpck_require__(1640);
1309
+ const util_1 = __nccwpck_require__(9483);
1310
+ const constants_1 = __nccwpck_require__(1895);
1308
1311
  class FsPromises {
1309
1312
  constructor(fs, FileHandle) {
1310
1313
  this.fs = fs;
@@ -1371,13 +1374,13 @@
1371
1374
  }
1372
1375
  exports.FsPromises = FsPromises;
1373
1376
  },
1374
- 3347: (__unused_webpack_module, exports, __nccwpck_require__) => {
1377
+ 7718: (__unused_webpack_module, exports, __nccwpck_require__) => {
1375
1378
  "use strict";
1376
1379
  Object.defineProperty(exports, "__esModule", { value: true });
1377
1380
  exports.FLAGS = exports.ERRSTR = void 0;
1378
- const constants_1 = __nccwpck_require__(1640);
1381
+ const constants_1 = __nccwpck_require__(1895);
1379
1382
  exports.ERRSTR = {
1380
- PATH_STR: "path must be a string or Buffer",
1383
+ PATH_STR: "path must be a string, Buffer, or Uint8Array",
1381
1384
  FD: "fd must be a file descriptor",
1382
1385
  MODE_INT: "mode must be an int",
1383
1386
  CB: "callback must be a function",
@@ -1424,7 +1427,7 @@
1424
1427
  FLAGS[(FLAGS["xa+"] = FLAGS["ax+"])] = "xa+";
1425
1428
  })(FLAGS || (exports.FLAGS = FLAGS = {}));
1426
1429
  },
1427
- 1168: (__unused_webpack_module, exports) => {
1430
+ 6417: (__unused_webpack_module, exports) => {
1428
1431
  "use strict";
1429
1432
  Object.defineProperty(exports, "__esModule", { value: true });
1430
1433
  exports.fsCallbackApiList = void 0;
@@ -1475,7 +1478,7 @@
1475
1478
  "writeFile",
1476
1479
  ];
1477
1480
  },
1478
- 5778: (__unused_webpack_module, exports) => {
1481
+ 9041: (__unused_webpack_module, exports) => {
1479
1482
  "use strict";
1480
1483
  Object.defineProperty(exports, "__esModule", { value: true });
1481
1484
  exports.fsSynchronousApiList = void 0;
@@ -1521,7 +1524,7 @@
1521
1524
  "writevSync",
1522
1525
  ];
1523
1526
  },
1524
- 5004: (__unused_webpack_module, exports, __nccwpck_require__) => {
1527
+ 1473: (__unused_webpack_module, exports, __nccwpck_require__) => {
1525
1528
  "use strict";
1526
1529
  Object.defineProperty(exports, "__esModule", { value: true });
1527
1530
  exports.getWriteFileOptions =
@@ -1547,9 +1550,9 @@
1547
1550
  exports.getOptions = getOptions;
1548
1551
  exports.optsGenerator = optsGenerator;
1549
1552
  exports.optsAndCbGenerator = optsAndCbGenerator;
1550
- const constants_1 = __nccwpck_require__(3347);
1551
- const encoding_1 = __nccwpck_require__(312);
1552
- const util_1 = __nccwpck_require__(7260);
1553
+ const constants_1 = __nccwpck_require__(7718);
1554
+ const encoding_1 = __nccwpck_require__(7721);
1555
+ const util_1 = __nccwpck_require__(9483);
1553
1556
  const mkdirDefaults = { mode: 511, recursive: false };
1554
1557
  const getMkdirOptions = (options) => {
1555
1558
  if (typeof options === "number")
@@ -1650,7 +1653,7 @@
1650
1653
  };
1651
1654
  exports.getWriteFileOptions = optsGenerator(exports.writeFileDefaults);
1652
1655
  },
1653
- 7260: (__unused_webpack_module, exports, __nccwpck_require__) => {
1656
+ 9483: (__unused_webpack_module, exports, __nccwpck_require__) => {
1654
1657
  "use strict";
1655
1658
  Object.defineProperty(exports, "__esModule", { value: true });
1656
1659
  exports.unixify =
@@ -1673,12 +1676,12 @@
1673
1676
  exports.dataToBuffer = dataToBuffer;
1674
1677
  exports.bufferToEncoding = bufferToEncoding;
1675
1678
  exports.isReadableStream = isReadableStream;
1676
- const constants_1 = __nccwpck_require__(3347);
1677
- const errors = __nccwpck_require__(7012);
1678
- const buffer_1 = __nccwpck_require__(6741);
1679
- const encoding_1 = __nccwpck_require__(312);
1680
- const buffer_2 = __nccwpck_require__(6741);
1681
- const queueMicrotask_1 = __nccwpck_require__(2581);
1679
+ const constants_1 = __nccwpck_require__(7718);
1680
+ const errors = __nccwpck_require__(4583);
1681
+ const buffer_1 = __nccwpck_require__(3330);
1682
+ const encoding_1 = __nccwpck_require__(7721);
1683
+ const buffer_2 = __nccwpck_require__(3330);
1684
+ const queueMicrotask_1 = __nccwpck_require__(676);
1682
1685
  exports.isWin = process.platform === "win32";
1683
1686
  function promisify(fs, fn, getResult = (input) => input) {
1684
1687
  return (...args) =>
@@ -1740,6 +1743,9 @@
1740
1743
  return decodeURIComponent(pathname);
1741
1744
  }
1742
1745
  function pathToFilename(path) {
1746
+ if (path instanceof Uint8Array) {
1747
+ path = (0, buffer_2.bufferFrom)(path);
1748
+ }
1743
1749
  if (typeof path !== "string" && !buffer_1.Buffer.isBuffer(path)) {
1744
1750
  try {
1745
1751
  if (!(path instanceof __nccwpck_require__(7016).URL))
@@ -1971,12 +1977,12 @@
1971
1977
  };
1972
1978
  exports.unixify = unixify;
1973
1979
  },
1974
- 1389: (__unused_webpack_module, exports, __nccwpck_require__) => {
1980
+ 802: (__unused_webpack_module, exports, __nccwpck_require__) => {
1975
1981
  "use strict";
1976
1982
  Object.defineProperty(exports, "__esModule", { value: true });
1977
1983
  exports.toTreeSync = void 0;
1978
1984
  const tree_dump_1 = __nccwpck_require__(1821);
1979
- const util_1 = __nccwpck_require__(2583);
1985
+ const util_1 = __nccwpck_require__(6934);
1980
1986
  const toTreeSync = (fs, opts = {}) => {
1981
1987
  var _a;
1982
1988
  const separator = opts.separator || "/";
@@ -2011,7 +2017,7 @@
2011
2017
  };
2012
2018
  exports.toTreeSync = toTreeSync;
2013
2019
  },
2014
- 7412: (__unused_webpack_module, exports, __nccwpck_require__) => {
2020
+ 4507: (__unused_webpack_module, exports, __nccwpck_require__) => {
2015
2021
  "use strict";
2016
2022
  Object.defineProperty(exports, "__esModule", { value: true });
2017
2023
  exports.createProcess = createProcess;
@@ -2037,7 +2043,7 @@
2037
2043
  }
2038
2044
  exports["default"] = createProcess();
2039
2045
  },
2040
- 2581: (__unused_webpack_module, exports) => {
2046
+ 676: (__unused_webpack_module, exports) => {
2041
2047
  "use strict";
2042
2048
  Object.defineProperty(exports, "__esModule", { value: true });
2043
2049
  exports["default"] =
@@ -2048,7 +2054,7 @@
2048
2054
  .then(() => cb())
2049
2055
  .catch(() => {});
2050
2056
  },
2051
- 8456: (__unused_webpack_module, exports) => {
2057
+ 6285: (__unused_webpack_module, exports) => {
2052
2058
  "use strict";
2053
2059
  Object.defineProperty(exports, "__esModule", { value: true });
2054
2060
  let _setImmediate;
@@ -2062,7 +2068,7 @@
2062
2068
  );
2063
2069
  exports["default"] = _setImmediate;
2064
2070
  },
2065
- 1456: (__unused_webpack_module, exports) => {
2071
+ 1523: (__unused_webpack_module, exports) => {
2066
2072
  "use strict";
2067
2073
  Object.defineProperty(exports, "__esModule", { value: true });
2068
2074
  function setTimeoutUnref(callback, time, args) {
@@ -2076,7 +2082,7 @@
2076
2082
  }
2077
2083
  exports["default"] = setTimeoutUnref;
2078
2084
  },
2079
- 4523: (__unused_webpack_module, exports, __nccwpck_require__) => {
2085
+ 7682: (__unused_webpack_module, exports, __nccwpck_require__) => {
2080
2086
  "use strict";
2081
2087
  Object.defineProperty(exports, "__esModule", { value: true });
2082
2088
  exports.FSWatcher = exports.StatWatcher = exports.Volume = void 0;
@@ -2085,26 +2091,26 @@
2085
2091
  exports.dataToStr = dataToStr;
2086
2092
  exports.toUnixTimestamp = toUnixTimestamp;
2087
2093
  const pathModule = __nccwpck_require__(6928);
2088
- const node_1 = __nccwpck_require__(3385);
2089
- const Stats_1 = __nccwpck_require__(4146);
2090
- const Dirent_1 = __nccwpck_require__(5817);
2091
- const buffer_1 = __nccwpck_require__(6741);
2092
- const setImmediate_1 = __nccwpck_require__(8456);
2093
- const queueMicrotask_1 = __nccwpck_require__(2581);
2094
- const process_1 = __nccwpck_require__(7412);
2095
- const setTimeoutUnref_1 = __nccwpck_require__(1456);
2094
+ const node_1 = __nccwpck_require__(540);
2095
+ const Stats_1 = __nccwpck_require__(845);
2096
+ const Dirent_1 = __nccwpck_require__(6912);
2097
+ const buffer_1 = __nccwpck_require__(3330);
2098
+ const setImmediate_1 = __nccwpck_require__(6285);
2099
+ const queueMicrotask_1 = __nccwpck_require__(676);
2100
+ const process_1 = __nccwpck_require__(4507);
2101
+ const setTimeoutUnref_1 = __nccwpck_require__(1523);
2096
2102
  const stream_1 = __nccwpck_require__(2203);
2097
- const constants_1 = __nccwpck_require__(1640);
2103
+ const constants_1 = __nccwpck_require__(1895);
2098
2104
  const events_1 = __nccwpck_require__(4434);
2099
- const encoding_1 = __nccwpck_require__(312);
2100
- const FileHandle_1 = __nccwpck_require__(2296);
2105
+ const encoding_1 = __nccwpck_require__(7721);
2106
+ const FileHandle_1 = __nccwpck_require__(2407);
2101
2107
  const util = __nccwpck_require__(9023);
2102
- const FsPromises_1 = __nccwpck_require__(8989);
2103
- const print_1 = __nccwpck_require__(1389);
2104
- const constants_2 = __nccwpck_require__(3347);
2105
- const options_1 = __nccwpck_require__(5004);
2106
- const util_1 = __nccwpck_require__(7260);
2107
- const Dir_1 = __nccwpck_require__(1698);
2108
+ const FsPromises_1 = __nccwpck_require__(5890);
2109
+ const print_1 = __nccwpck_require__(802);
2110
+ const constants_2 = __nccwpck_require__(7718);
2111
+ const options_1 = __nccwpck_require__(1473);
2112
+ const util_1 = __nccwpck_require__(9483);
2113
+ const Dir_1 = __nccwpck_require__(4297);
2108
2114
  const resolveCrossPlatform = pathModule.resolve;
2109
2115
  const {
2110
2116
  O_RDONLY,
@@ -2247,7 +2253,7 @@
2247
2253
  props,
2248
2254
  );
2249
2255
  const root = this.createLink();
2250
- root.setNode(this.createNode(true));
2256
+ root.setNode(this.createNode(constants_1.constants.S_IFDIR | 511));
2251
2257
  const self = this;
2252
2258
  this.StatWatcher = class extends StatWatcher {
2253
2259
  constructor() {
@@ -2277,14 +2283,24 @@
2277
2283
  root.getNode().nlink++;
2278
2284
  this.root = root;
2279
2285
  }
2280
- createLink(parent, name, isDirectory = false, perm) {
2286
+ createLink(parent, name, isDirectory = false, mode) {
2281
2287
  if (!parent) {
2282
2288
  return new this.props.Link(this, null, "");
2283
2289
  }
2284
2290
  if (!name) {
2285
2291
  throw new Error("createLink: name cannot be empty");
2286
2292
  }
2287
- return parent.createChild(name, this.createNode(isDirectory, perm));
2293
+ const finalPerm =
2294
+ mode !== null && mode !== void 0 ? mode : isDirectory ? 511 : 438;
2295
+ const hasFileType = mode && mode & constants_1.constants.S_IFMT;
2296
+ const modeType = hasFileType
2297
+ ? mode & constants_1.constants.S_IFMT
2298
+ : isDirectory
2299
+ ? constants_1.constants.S_IFDIR
2300
+ : constants_1.constants.S_IFREG;
2301
+ const finalMode =
2302
+ (finalPerm & ~constants_1.constants.S_IFMT) | modeType;
2303
+ return parent.createChild(name, this.createNode(finalMode));
2288
2304
  }
2289
2305
  deleteLink(link) {
2290
2306
  const parent = link.parent;
@@ -2306,12 +2322,8 @@
2306
2322
  const releasedFd = this.releasedFds.pop();
2307
2323
  return typeof releasedFd === "number" ? releasedFd : Volume.fd--;
2308
2324
  }
2309
- createNode(isDirectory = false, perm) {
2310
- perm !== null && perm !== void 0
2311
- ? perm
2312
- : (perm = isDirectory ? 511 : 438);
2313
- const node = new this.props.Node(this.newInoNumber(), perm);
2314
- if (isDirectory) node.setIsDirectory();
2325
+ createNode(mode) {
2326
+ const node = new this.props.Node(this.newInoNumber(), mode);
2315
2327
  this.inodes[node.ino] = node;
2316
2328
  return node;
2317
2329
  }
@@ -2362,7 +2374,10 @@
2362
2374
  else return null;
2363
2375
  node = curr === null || curr === void 0 ? void 0 : curr.getNode();
2364
2376
  if (resolveSymlinks && node.isSymlink()) {
2365
- steps = node.symlink.concat(steps.slice(i + 1));
2377
+ const resolvedPath = pathModule.isAbsolute(node.symlink)
2378
+ ? node.symlink
2379
+ : join(pathModule.dirname(curr.getPath()), node.symlink);
2380
+ steps = filenameToSteps(resolvedPath).concat(steps.slice(i + 1));
2366
2381
  curr = this.root;
2367
2382
  i = 0;
2368
2383
  continue;
@@ -2513,7 +2528,9 @@
2513
2528
  this.releasedFds = [];
2514
2529
  this.openFiles = 0;
2515
2530
  this.root = this.createLink();
2516
- this.root.setNode(this.createNode(true));
2531
+ this.root.setNode(
2532
+ this.createNode(constants_1.constants.S_IFDIR | 511),
2533
+ );
2517
2534
  }
2518
2535
  mountSync(mountpoint, json) {
2519
2536
  this.fromJSON(json, mountpoint);
@@ -2637,7 +2654,8 @@
2637
2654
  }
2638
2655
  close(fd, callback) {
2639
2656
  (0, util_1.validateFd)(fd);
2640
- this.wrapAsync(this.closeSync, [fd], callback);
2657
+ const file = this.getFileByFdOrThrow(fd, "close");
2658
+ this.wrapAsync(this.closeFile, [file], callback);
2641
2659
  }
2642
2660
  openFileOrGetById(id, flagsNum, modeNum) {
2643
2661
  if (typeof id === "number") {
@@ -3032,7 +3050,7 @@
3032
3050
  pathFilename,
3033
3051
  );
3034
3052
  const symlink = dirLink.createChild(name);
3035
- symlink.getNode().makeSymlink(filenameToSteps(targetFilename));
3053
+ symlink.getNode().makeSymlink(targetFilename);
3036
3054
  return symlink;
3037
3055
  }
3038
3056
  symlinkSync(target, path, type) {
@@ -3053,7 +3071,6 @@
3053
3071
  );
3054
3072
  }
3055
3073
  realpathBase(filename, encoding) {
3056
- debugger;
3057
3074
  const realLink = this.getResolvedLinkOrThrow(filename, "realpath");
3058
3075
  return (0, encoding_1.strToEncoding)(
3059
3076
  realLink.getPath() || "/",
@@ -3326,8 +3343,7 @@
3326
3343
  const node = link.getNode();
3327
3344
  if (!node.isSymlink())
3328
3345
  throw (0, util_1.createError)(EINVAL, "readlink", filename);
3329
- const str = sep + node.symlink.join(sep);
3330
- return (0, encoding_1.strToEncoding)(str, encoding);
3346
+ return (0, encoding_1.strToEncoding)(node.symlink, encoding);
3331
3347
  }
3332
3348
  readlinkSync(path, options) {
3333
3349
  const opts = (0, options_1.getDefaultOpts)(options);
@@ -3471,7 +3487,10 @@
3471
3487
  const node = dir.getNode();
3472
3488
  if (!node.canWrite() || !node.canExecute())
3473
3489
  throw (0, util_1.createError)(EACCES, "mkdir", filename);
3474
- dir.createChild(name, this.createNode(true, modeNum));
3490
+ dir.createChild(
3491
+ name,
3492
+ this.createNode(constants_1.constants.S_IFDIR | modeNum),
3493
+ );
3475
3494
  }
3476
3495
  mkdirpBase(filename, modeNum) {
3477
3496
  let created = false;
@@ -3499,7 +3518,10 @@
3499
3518
  throw (0, util_1.createError)(ENOTDIR, "mkdir", filename);
3500
3519
  }
3501
3520
  created = true;
3502
- curr = curr.createChild(steps[i], this.createNode(true, modeNum));
3521
+ curr = curr.createChild(
3522
+ steps[i],
3523
+ this.createNode(constants_1.constants.S_IFDIR | modeNum),
3524
+ );
3503
3525
  }
3504
3526
  return created ? filename : undefined;
3505
3527
  }
@@ -3838,7 +3860,12 @@
3838
3860
  options.highWaterMark = 64 * 1024;
3839
3861
  stream_1.Readable.call(this, options);
3840
3862
  this.path = (0, util_1.pathToFilename)(path);
3841
- this.fd = options.fd === undefined ? null : options.fd;
3863
+ this.fd =
3864
+ options.fd === undefined
3865
+ ? null
3866
+ : typeof options.fd !== "number"
3867
+ ? options.fd.fd
3868
+ : options.fd;
3842
3869
  this.flags = options.flags === undefined ? "r" : options.flags;
3843
3870
  this.mode = options.mode === undefined ? 438 : options.mode;
3844
3871
  this.start = options.start;
@@ -3961,7 +3988,12 @@
3961
3988
  options = Object.assign({}, (0, options_1.getOptions)(options, {}));
3962
3989
  stream_1.Writable.call(this, options);
3963
3990
  this.path = (0, util_1.pathToFilename)(path);
3964
- this.fd = options.fd === undefined ? null : options.fd;
3991
+ this.fd =
3992
+ options.fd === undefined
3993
+ ? null
3994
+ : typeof options.fd !== "number"
3995
+ ? options.fd.fd
3996
+ : options.fd;
3965
3997
  this.flags = options.flags === undefined ? "w" : options.flags;
3966
3998
  this.mode = options.mode === undefined ? 438 : options.mode;
3967
3999
  this.start = options.start;
@@ -4417,14 +4449,14 @@
4417
4449
  return a.start - b.start;
4418
4450
  }
4419
4451
  },
4420
- 9641: (module, __unused_webpack_exports, __nccwpck_require__) => {
4452
+ 4358: (module, __unused_webpack_exports, __nccwpck_require__) => {
4421
4453
  "use strict";
4422
- const middleware = __nccwpck_require__(3669);
4423
- const getFilenameFromUrl = __nccwpck_require__(9685);
4424
- const setupHooks = __nccwpck_require__(9160);
4425
- const setupWriteToDisk = __nccwpck_require__(4371);
4426
- const setupOutputFileSystem = __nccwpck_require__(4328);
4427
- const ready = __nccwpck_require__(9956);
4454
+ const middleware = __nccwpck_require__(8284);
4455
+ const getFilenameFromUrl = __nccwpck_require__(2756);
4456
+ const setupHooks = __nccwpck_require__(9065);
4457
+ const setupWriteToDisk = __nccwpck_require__(9654);
4458
+ const setupOutputFileSystem = __nccwpck_require__(4359);
4459
+ const ready = __nccwpck_require__(3395);
4428
4460
  const noop = () => {};
4429
4461
  function wdm(compiler, options = {}) {
4430
4462
  const context = {
@@ -4479,14 +4511,14 @@
4479
4511
  }
4480
4512
  module.exports = wdm;
4481
4513
  },
4482
- 3669: (module, __unused_webpack_exports, __nccwpck_require__) => {
4514
+ 8284: (module, __unused_webpack_exports, __nccwpck_require__) => {
4483
4515
  "use strict";
4484
4516
  const mrmime = __nccwpck_require__(8311);
4485
4517
  const onFinishedStream = __nccwpck_require__(21);
4486
- const getFilenameFromUrl = __nccwpck_require__(9685);
4487
- const ready = __nccwpck_require__(9956);
4488
- const parseTokenList = __nccwpck_require__(1219);
4489
- const memorize = __nccwpck_require__(6109);
4518
+ const getFilenameFromUrl = __nccwpck_require__(2756);
4519
+ const ready = __nccwpck_require__(3395);
4520
+ const parseTokenList = __nccwpck_require__(8766);
4521
+ const memorize = __nccwpck_require__(4376);
4490
4522
  async function getEtag(stat) {
4491
4523
  const mtime = stat.mtime.getTime().toString(16);
4492
4524
  const size = stat.size.toString(16);
@@ -4578,7 +4610,7 @@
4578
4610
  return;
4579
4611
  }
4580
4612
  function sendError(status, options) {
4581
- const escapeHtml = __nccwpck_require__(5065);
4613
+ const escapeHtml = __nccwpck_require__(6680);
4582
4614
  const content = statuses[status] || String(status);
4583
4615
  const document = Buffer.from(
4584
4616
  `<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>${escapeHtml(content)}</pre>\n</body>\n</html>`,
@@ -4883,7 +4915,7 @@
4883
4915
  }
4884
4916
  module.exports = wrapper;
4885
4917
  },
4886
- 5065: (module) => {
4918
+ 6680: (module) => {
4887
4919
  "use strict";
4888
4920
  const matchHtmlRegExp = /["'&<>]/;
4889
4921
  function escapeHtml(string) {
@@ -4928,13 +4960,13 @@
4928
4960
  }
4929
4961
  module.exports = escapeHtml;
4930
4962
  },
4931
- 9685: (module, __unused_webpack_exports, __nccwpck_require__) => {
4963
+ 2756: (module, __unused_webpack_exports, __nccwpck_require__) => {
4932
4964
  "use strict";
4933
4965
  const path = __nccwpck_require__(6928);
4934
4966
  const { parse } = __nccwpck_require__(7016);
4935
4967
  const querystring = __nccwpck_require__(3480);
4936
- const getPaths = __nccwpck_require__(8863);
4937
- const memorize = __nccwpck_require__(6109);
4968
+ const getPaths = __nccwpck_require__(3474);
4969
+ const memorize = __nccwpck_require__(4376);
4938
4970
  const memoizedParse = memorize(parse, undefined, (value) => {
4939
4971
  if (value.pathname) {
4940
4972
  value.pathname = decode(value.pathname);
@@ -5017,7 +5049,7 @@
5017
5049
  }
5018
5050
  module.exports = getFilenameFromUrl;
5019
5051
  },
5020
- 8863: (module) => {
5052
+ 3474: (module) => {
5021
5053
  "use strict";
5022
5054
  function getPaths(context) {
5023
5055
  const { stats, options } = context;
@@ -5038,7 +5070,7 @@
5038
5070
  }
5039
5071
  module.exports = getPaths;
5040
5072
  },
5041
- 6109: (module) => {
5073
+ 4376: (module) => {
5042
5074
  "use strict";
5043
5075
  const cacheStore = new WeakMap();
5044
5076
  function memorize(fn, { cache = new Map() } = {}, callback) {
@@ -5060,7 +5092,7 @@
5060
5092
  }
5061
5093
  module.exports = memorize;
5062
5094
  },
5063
- 1219: (module) => {
5095
+ 8766: (module) => {
5064
5096
  "use strict";
5065
5097
  function parseTokenList(str) {
5066
5098
  let end = 0;
@@ -5093,7 +5125,7 @@
5093
5125
  }
5094
5126
  module.exports = parseTokenList;
5095
5127
  },
5096
- 9956: (module) => {
5128
+ 3395: (module) => {
5097
5129
  "use strict";
5098
5130
  function ready(context, callback, req) {
5099
5131
  if (context.state) {
@@ -5108,7 +5140,7 @@
5108
5140
  }
5109
5141
  module.exports = ready;
5110
5142
  },
5111
- 9160: (module) => {
5143
+ 9065: (module) => {
5112
5144
  "use strict";
5113
5145
  function setupHooks(context) {
5114
5146
  function invalid() {
@@ -5140,9 +5172,9 @@
5140
5172
  }
5141
5173
  module.exports = setupHooks;
5142
5174
  },
5143
- 4328: (module, __unused_webpack_exports, __nccwpck_require__) => {
5175
+ 4359: (module, __unused_webpack_exports, __nccwpck_require__) => {
5144
5176
  "use strict";
5145
- const memfs = __nccwpck_require__(1025);
5177
+ const memfs = __nccwpck_require__(5590);
5146
5178
  function setupOutputFileSystem(context) {
5147
5179
  let outputFileSystem;
5148
5180
  if (context.options.writeToDisk !== true) {
@@ -5167,7 +5199,7 @@
5167
5199
  }
5168
5200
  module.exports = setupOutputFileSystem;
5169
5201
  },
5170
- 4371: (module, __unused_webpack_exports, __nccwpck_require__) => {
5202
+ 9654: (module, __unused_webpack_exports, __nccwpck_require__) => {
5171
5203
  "use strict";
5172
5204
  const fs = __nccwpck_require__(9896);
5173
5205
  const path = __nccwpck_require__(6928);
@@ -6153,6 +6185,6 @@
6153
6185
  }
6154
6186
  if (typeof __nccwpck_require__ !== "undefined")
6155
6187
  __nccwpck_require__.ab = __dirname + "/";
6156
- var __webpack_exports__ = __nccwpck_require__(9641);
6188
+ var __webpack_exports__ = __nccwpck_require__(4358);
6157
6189
  module.exports = __webpack_exports__;
6158
6190
  })();