weapp-vite 5.2.0 → 5.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,9 +5,9 @@
5
5
 
6
6
  var _chunkOS76JPG2cjs = require('./chunk-OS76JPG2.cjs');
7
7
 
8
- // ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js
8
+ // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
9
9
  var require_debug = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
10
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js"(exports, module) {
10
+ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js"(exports, module) {
11
11
  "use strict";
12
12
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
13
13
  var debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
@@ -16,9 +16,9 @@ var require_debug = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
16
16
  }
17
17
  });
18
18
 
19
- // ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js
19
+ // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js
20
20
  var require_constants = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
21
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js"(exports, module) {
21
+ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js"(exports, module) {
22
22
  "use strict";
23
23
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
24
24
  var SEMVER_SPEC_VERSION = "2.0.0";
@@ -49,9 +49,9 @@ var require_constants = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
49
49
  }
50
50
  });
51
51
 
52
- // ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js
52
+ // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js
53
53
  var require_re = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
54
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js"(exports, module) {
54
+ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js"(exports, module) {
55
55
  "use strict";
56
56
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
57
57
  var {
@@ -138,9 +138,9 @@ var require_re = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
138
138
  }
139
139
  });
140
140
 
141
- // ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js
141
+ // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js
142
142
  var require_parse_options = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
143
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js"(exports, module) {
143
+ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js"(exports, module) {
144
144
  "use strict";
145
145
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
146
146
  var looseOption = Object.freeze({ loose: true });
@@ -158,13 +158,16 @@ var require_parse_options = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
158
158
  }
159
159
  });
160
160
 
161
- // ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js
161
+ // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js
162
162
  var require_identifiers = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
163
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js"(exports, module) {
163
+ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js"(exports, module) {
164
164
  "use strict";
165
165
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
166
166
  var numeric = /^[0-9]+$/;
167
167
  var compareIdentifiers = (a, b) => {
168
+ if (typeof a === "number" && typeof b === "number") {
169
+ return a === b ? 0 : a < b ? -1 : 1;
170
+ }
168
171
  const anum = numeric.test(a);
169
172
  const bnum = numeric.test(b);
170
173
  if (anum && bnum) {
@@ -181,9 +184,9 @@ var require_identifiers = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
181
184
  }
182
185
  });
183
186
 
184
- // ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
187
+ // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js
185
188
  var require_semver = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
186
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports, module) {
189
+ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js"(exports, module) {
187
190
  "use strict";
188
191
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
189
192
  var debug4 = require_debug();
@@ -272,7 +275,25 @@ var require_semver = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
272
275
  if (!(other instanceof _SemVer)) {
273
276
  other = new _SemVer(other, this.options);
274
277
  }
275
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
278
+ if (this.major < other.major) {
279
+ return -1;
280
+ }
281
+ if (this.major > other.major) {
282
+ return 1;
283
+ }
284
+ if (this.minor < other.minor) {
285
+ return -1;
286
+ }
287
+ if (this.minor > other.minor) {
288
+ return 1;
289
+ }
290
+ if (this.patch < other.patch) {
291
+ return -1;
292
+ }
293
+ if (this.patch > other.patch) {
294
+ return 1;
295
+ }
296
+ return 0;
276
297
  }
277
298
  comparePre(other) {
278
299
  if (!(other instanceof _SemVer)) {
@@ -443,9 +464,9 @@ var require_semver = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
443
464
  }
444
465
  });
445
466
 
446
- // ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
467
+ // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js
447
468
  var require_compare = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
448
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js"(exports, module) {
469
+ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js"(exports, module) {
449
470
  "use strict";
450
471
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
451
472
  var SemVer = require_semver();
@@ -454,9 +475,9 @@ var require_compare = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
454
475
  }
455
476
  });
456
477
 
457
- // ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js
478
+ // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js
458
479
  var require_gte = _chunkOS76JPG2cjs.__commonJS.call(void 0, {
459
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js"(exports, module) {
480
+ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js"(exports, module) {
460
481
  "use strict";
461
482
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
462
483
  var compare = require_compare();
@@ -976,6 +997,14 @@ async function findTemplateEntry(filepath) {
976
997
  function isTemplate(filepath) {
977
998
  return templateExtensions.some((ext2) => filepath.endsWith(`.${ext2}`));
978
999
  }
1000
+ async function touch(filename) {
1001
+ const time = /* @__PURE__ */ new Date();
1002
+ try {
1003
+ await _fsextra2.default.utimes(filename, time, time);
1004
+ } catch (e2) {
1005
+ await _fsextra2.default.close(await _fsextra2.default.open(filename, "w"));
1006
+ }
1007
+ }
979
1008
 
980
1009
  // src/utils/json.ts
981
1010
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
@@ -1079,7 +1108,7 @@ async function getProjectConfig(root, options) {
1079
1108
  if (await _fsextra2.default.exists(baseJsonPath)) {
1080
1109
  try {
1081
1110
  baseJson = await _fsextra2.default.readJson(baseJsonPath) || {};
1082
- } catch (e2) {
1111
+ } catch (e3) {
1083
1112
  throw new Error(`\u89E3\u6790 json \u683C\u5F0F\u5931\u8D25, project.config.json \u4E3A\u975E\u6CD5\u7684 json \u683C\u5F0F`);
1084
1113
  }
1085
1114
  } else {
@@ -1089,7 +1118,7 @@ async function getProjectConfig(root, options) {
1089
1118
  if (await _fsextra2.default.exists(privateJsonPath)) {
1090
1119
  try {
1091
1120
  privateJson = await _fsextra2.default.readJson(privateJsonPath) || {};
1092
- } catch (e3) {
1121
+ } catch (e4) {
1093
1122
  throw new Error(`\u89E3\u6790 json \u683C\u5F0F\u5931\u8D25, project.private.config.json \u4E3A\u975E\u6CD5\u7684 json \u683C\u5F0F`);
1094
1123
  }
1095
1124
  }
@@ -2834,7 +2863,7 @@ var ReaddirpStream = class extends _stream.Readable {
2834
2863
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
2835
2864
  const statMethod = opts.lstat ? _promises.lstat : _promises.stat;
2836
2865
  if (wantBigintFsStats) {
2837
- this._stat = (path22) => statMethod(path22, { bigint: true });
2866
+ this._stat = (path25) => statMethod(path25, { bigint: true });
2838
2867
  } else {
2839
2868
  this._stat = statMethod;
2840
2869
  }
@@ -2859,8 +2888,8 @@ var ReaddirpStream = class extends _stream.Readable {
2859
2888
  const par = this.parent;
2860
2889
  const fil = par && par.files;
2861
2890
  if (fil && fil.length > 0) {
2862
- const { path: path22, depth } = par;
2863
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path22));
2891
+ const { path: path25, depth } = par;
2892
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path25));
2864
2893
  const awaited = await Promise.all(slice);
2865
2894
  for (const entry of awaited) {
2866
2895
  if (!entry)
@@ -2900,20 +2929,20 @@ var ReaddirpStream = class extends _stream.Readable {
2900
2929
  this.reading = false;
2901
2930
  }
2902
2931
  }
2903
- async _exploreDir(path22, depth) {
2932
+ async _exploreDir(path25, depth) {
2904
2933
  let files;
2905
2934
  try {
2906
- files = await _promises.readdir.call(void 0, path22, this._rdOptions);
2935
+ files = await _promises.readdir.call(void 0, path25, this._rdOptions);
2907
2936
  } catch (error) {
2908
2937
  this._onError(error);
2909
2938
  }
2910
- return { files, depth, path: path22 };
2939
+ return { files, depth, path: path25 };
2911
2940
  }
2912
- async _formatEntry(dirent, path22) {
2941
+ async _formatEntry(dirent, path25) {
2913
2942
  let entry;
2914
2943
  const basename4 = this._isDirent ? dirent.name : dirent;
2915
2944
  try {
2916
- const fullPath = _path.resolve.call(void 0, _path.join.call(void 0, path22, basename4));
2945
+ const fullPath = _path.resolve.call(void 0, _path.join.call(void 0, path25, basename4));
2917
2946
  entry = { path: _path.relative.call(void 0, this._root, fullPath), fullPath, basename: basename4 };
2918
2947
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
2919
2948
  } catch (err) {
@@ -3314,16 +3343,16 @@ var delFromSet = (main, prop, item) => {
3314
3343
  };
3315
3344
  var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
3316
3345
  var FsWatchInstances = /* @__PURE__ */ new Map();
3317
- function createFsWatchInstance(path22, options, listener, errHandler, emitRaw) {
3346
+ function createFsWatchInstance(path25, options, listener, errHandler, emitRaw) {
3318
3347
  const handleEvent = (rawEvent, evPath) => {
3319
- listener(path22);
3320
- emitRaw(rawEvent, evPath, { watchedPath: path22 });
3321
- if (evPath && path22 !== evPath) {
3322
- fsWatchBroadcast(sysPath.resolve(path22, evPath), KEY_LISTENERS, sysPath.join(path22, evPath));
3348
+ listener(path25);
3349
+ emitRaw(rawEvent, evPath, { watchedPath: path25 });
3350
+ if (evPath && path25 !== evPath) {
3351
+ fsWatchBroadcast(sysPath.resolve(path25, evPath), KEY_LISTENERS, sysPath.join(path25, evPath));
3323
3352
  }
3324
3353
  };
3325
3354
  try {
3326
- return _fs.watch.call(void 0, path22, {
3355
+ return _fs.watch.call(void 0, path25, {
3327
3356
  persistent: options.persistent
3328
3357
  }, handleEvent);
3329
3358
  } catch (error) {
@@ -3339,12 +3368,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
3339
3368
  listener(val1, val2, val3);
3340
3369
  });
3341
3370
  };
3342
- var setFsWatchListener = (path22, fullPath, options, handlers) => {
3371
+ var setFsWatchListener = (path25, fullPath, options, handlers) => {
3343
3372
  const { listener, errHandler, rawEmitter } = handlers;
3344
3373
  let cont = FsWatchInstances.get(fullPath);
3345
3374
  let watcher;
3346
3375
  if (!options.persistent) {
3347
- watcher = createFsWatchInstance(path22, options, listener, errHandler, rawEmitter);
3376
+ watcher = createFsWatchInstance(path25, options, listener, errHandler, rawEmitter);
3348
3377
  if (!watcher)
3349
3378
  return;
3350
3379
  return watcher.close.bind(watcher);
@@ -3355,7 +3384,7 @@ var setFsWatchListener = (path22, fullPath, options, handlers) => {
3355
3384
  addAndConvert(cont, KEY_RAW, rawEmitter);
3356
3385
  } else {
3357
3386
  watcher = createFsWatchInstance(
3358
- path22,
3387
+ path25,
3359
3388
  options,
3360
3389
  fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
3361
3390
  errHandler,
@@ -3370,7 +3399,7 @@ var setFsWatchListener = (path22, fullPath, options, handlers) => {
3370
3399
  cont.watcherUnusable = true;
3371
3400
  if (isWindows && error.code === "EPERM") {
3372
3401
  try {
3373
- const fd = await _promises.open.call(void 0, path22, "r");
3402
+ const fd = await _promises.open.call(void 0, path25, "r");
3374
3403
  await fd.close();
3375
3404
  broadcastErr(error);
3376
3405
  } catch (err) {
@@ -3401,7 +3430,7 @@ var setFsWatchListener = (path22, fullPath, options, handlers) => {
3401
3430
  };
3402
3431
  };
3403
3432
  var FsWatchFileInstances = /* @__PURE__ */ new Map();
3404
- var setFsWatchFileListener = (path22, fullPath, options, handlers) => {
3433
+ var setFsWatchFileListener = (path25, fullPath, options, handlers) => {
3405
3434
  const { listener, rawEmitter } = handlers;
3406
3435
  let cont = FsWatchFileInstances.get(fullPath);
3407
3436
  const copts = cont && cont.options;
@@ -3423,7 +3452,7 @@ var setFsWatchFileListener = (path22, fullPath, options, handlers) => {
3423
3452
  });
3424
3453
  const currmtime = curr.mtimeMs;
3425
3454
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
3426
- foreach(cont.listeners, (listener2) => listener2(path22, curr));
3455
+ foreach(cont.listeners, (listener2) => listener2(path25, curr));
3427
3456
  }
3428
3457
  })
3429
3458
  };
@@ -3451,13 +3480,13 @@ var NodeFsHandler = class {
3451
3480
  * @param listener on fs change
3452
3481
  * @returns closer for the watcher instance
3453
3482
  */
3454
- _watchWithNodeFs(path22, listener) {
3483
+ _watchWithNodeFs(path25, listener) {
3455
3484
  const opts = this.fsw.options;
3456
- const directory = sysPath.dirname(path22);
3457
- const basename4 = sysPath.basename(path22);
3485
+ const directory = sysPath.dirname(path25);
3486
+ const basename4 = sysPath.basename(path25);
3458
3487
  const parent = this.fsw._getWatchedDir(directory);
3459
3488
  parent.add(basename4);
3460
- const absolutePath = sysPath.resolve(path22);
3489
+ const absolutePath = sysPath.resolve(path25);
3461
3490
  const options = {
3462
3491
  persistent: opts.persistent
3463
3492
  };
@@ -3467,12 +3496,12 @@ var NodeFsHandler = class {
3467
3496
  if (opts.usePolling) {
3468
3497
  const enableBin = opts.interval !== opts.binaryInterval;
3469
3498
  options.interval = enableBin && isBinaryPath(basename4) ? opts.binaryInterval : opts.interval;
3470
- closer = setFsWatchFileListener(path22, absolutePath, options, {
3499
+ closer = setFsWatchFileListener(path25, absolutePath, options, {
3471
3500
  listener,
3472
3501
  rawEmitter: this.fsw._emitRaw
3473
3502
  });
3474
3503
  } else {
3475
- closer = setFsWatchListener(path22, absolutePath, options, {
3504
+ closer = setFsWatchListener(path25, absolutePath, options, {
3476
3505
  listener,
3477
3506
  errHandler: this._boundHandleError,
3478
3507
  rawEmitter: this.fsw._emitRaw
@@ -3494,7 +3523,7 @@ var NodeFsHandler = class {
3494
3523
  let prevStats = stats;
3495
3524
  if (parent.has(basename4))
3496
3525
  return;
3497
- const listener = async (path22, newStats) => {
3526
+ const listener = async (path25, newStats) => {
3498
3527
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
3499
3528
  return;
3500
3529
  if (!newStats || newStats.mtimeMs === 0) {
@@ -3508,11 +3537,11 @@ var NodeFsHandler = class {
3508
3537
  this.fsw._emit(EV.CHANGE, file, newStats2);
3509
3538
  }
3510
3539
  if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
3511
- this.fsw._closeFile(path22);
3540
+ this.fsw._closeFile(path25);
3512
3541
  prevStats = newStats2;
3513
3542
  const closer2 = this._watchWithNodeFs(file, listener);
3514
3543
  if (closer2)
3515
- this.fsw._addPathCloser(path22, closer2);
3544
+ this.fsw._addPathCloser(path25, closer2);
3516
3545
  } else {
3517
3546
  prevStats = newStats2;
3518
3547
  }
@@ -3544,7 +3573,7 @@ var NodeFsHandler = class {
3544
3573
  * @param item basename of this item
3545
3574
  * @returns true if no more processing is needed for this entry.
3546
3575
  */
3547
- async _handleSymlink(entry, directory, path22, item) {
3576
+ async _handleSymlink(entry, directory, path25, item) {
3548
3577
  if (this.fsw.closed) {
3549
3578
  return;
3550
3579
  }
@@ -3554,7 +3583,7 @@ var NodeFsHandler = class {
3554
3583
  this.fsw._incrReadyCount();
3555
3584
  let linkPath;
3556
3585
  try {
3557
- linkPath = await _promises.realpath.call(void 0, path22);
3586
+ linkPath = await _promises.realpath.call(void 0, path25);
3558
3587
  } catch (e) {
3559
3588
  this.fsw._emitReady();
3560
3589
  return true;
@@ -3564,12 +3593,12 @@ var NodeFsHandler = class {
3564
3593
  if (dir.has(item)) {
3565
3594
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
3566
3595
  this.fsw._symlinkPaths.set(full, linkPath);
3567
- this.fsw._emit(EV.CHANGE, path22, entry.stats);
3596
+ this.fsw._emit(EV.CHANGE, path25, entry.stats);
3568
3597
  }
3569
3598
  } else {
3570
3599
  dir.add(item);
3571
3600
  this.fsw._symlinkPaths.set(full, linkPath);
3572
- this.fsw._emit(EV.ADD, path22, entry.stats);
3601
+ this.fsw._emit(EV.ADD, path25, entry.stats);
3573
3602
  }
3574
3603
  this.fsw._emitReady();
3575
3604
  return true;
@@ -3598,9 +3627,9 @@ var NodeFsHandler = class {
3598
3627
  return;
3599
3628
  }
3600
3629
  const item = entry.path;
3601
- let path22 = sysPath.join(directory, item);
3630
+ let path25 = sysPath.join(directory, item);
3602
3631
  current2.add(item);
3603
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path22, item)) {
3632
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path25, item)) {
3604
3633
  return;
3605
3634
  }
3606
3635
  if (this.fsw.closed) {
@@ -3609,8 +3638,8 @@ var NodeFsHandler = class {
3609
3638
  }
3610
3639
  if (item === target || !target && !previous.has(item)) {
3611
3640
  this.fsw._incrReadyCount();
3612
- path22 = sysPath.join(dir, sysPath.relative(dir, path22));
3613
- this._addToNodeFs(path22, initialAdd, wh, depth + 1);
3641
+ path25 = sysPath.join(dir, sysPath.relative(dir, path25));
3642
+ this._addToNodeFs(path25, initialAdd, wh, depth + 1);
3614
3643
  }
3615
3644
  }).on(EV.ERROR, this._boundHandleError);
3616
3645
  return new Promise((resolve8, reject) => {
@@ -3679,13 +3708,13 @@ var NodeFsHandler = class {
3679
3708
  * @param depth Child path actually targeted for watch
3680
3709
  * @param target Child path actually targeted for watch
3681
3710
  */
3682
- async _addToNodeFs(path22, initialAdd, priorWh, depth, target) {
3711
+ async _addToNodeFs(path25, initialAdd, priorWh, depth, target) {
3683
3712
  const ready = this.fsw._emitReady;
3684
- if (this.fsw._isIgnored(path22) || this.fsw.closed) {
3713
+ if (this.fsw._isIgnored(path25) || this.fsw.closed) {
3685
3714
  ready();
3686
3715
  return false;
3687
3716
  }
3688
- const wh = this.fsw._getWatchHelpers(path22);
3717
+ const wh = this.fsw._getWatchHelpers(path25);
3689
3718
  if (priorWh) {
3690
3719
  wh.filterPath = (entry) => priorWh.filterPath(entry);
3691
3720
  wh.filterDir = (entry) => priorWh.filterDir(entry);
@@ -3701,8 +3730,8 @@ var NodeFsHandler = class {
3701
3730
  const follow = this.fsw.options.followSymlinks;
3702
3731
  let closer;
3703
3732
  if (stats.isDirectory()) {
3704
- const absPath = sysPath.resolve(path22);
3705
- const targetPath = follow ? await _promises.realpath.call(void 0, path22) : path22;
3733
+ const absPath = sysPath.resolve(path25);
3734
+ const targetPath = follow ? await _promises.realpath.call(void 0, path25) : path25;
3706
3735
  if (this.fsw.closed)
3707
3736
  return;
3708
3737
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -3712,29 +3741,29 @@ var NodeFsHandler = class {
3712
3741
  this.fsw._symlinkPaths.set(absPath, targetPath);
3713
3742
  }
3714
3743
  } else if (stats.isSymbolicLink()) {
3715
- const targetPath = follow ? await _promises.realpath.call(void 0, path22) : path22;
3744
+ const targetPath = follow ? await _promises.realpath.call(void 0, path25) : path25;
3716
3745
  if (this.fsw.closed)
3717
3746
  return;
3718
3747
  const parent = sysPath.dirname(wh.watchPath);
3719
3748
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
3720
3749
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
3721
- closer = await this._handleDir(parent, stats, initialAdd, depth, path22, wh, targetPath);
3750
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path25, wh, targetPath);
3722
3751
  if (this.fsw.closed)
3723
3752
  return;
3724
3753
  if (targetPath !== void 0) {
3725
- this.fsw._symlinkPaths.set(sysPath.resolve(path22), targetPath);
3754
+ this.fsw._symlinkPaths.set(sysPath.resolve(path25), targetPath);
3726
3755
  }
3727
3756
  } else {
3728
3757
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
3729
3758
  }
3730
3759
  ready();
3731
3760
  if (closer)
3732
- this.fsw._addPathCloser(path22, closer);
3761
+ this.fsw._addPathCloser(path25, closer);
3733
3762
  return false;
3734
3763
  } catch (error) {
3735
3764
  if (this.fsw._handleError(error)) {
3736
3765
  ready();
3737
- return path22;
3766
+ return path25;
3738
3767
  }
3739
3768
  }
3740
3769
  }
@@ -3777,26 +3806,26 @@ function createPattern(matcher) {
3777
3806
  }
3778
3807
  return () => false;
3779
3808
  }
3780
- function normalizePath(path22) {
3781
- if (typeof path22 !== "string")
3809
+ function normalizePath(path25) {
3810
+ if (typeof path25 !== "string")
3782
3811
  throw new Error("string expected");
3783
- path22 = sysPath2.normalize(path22);
3784
- path22 = path22.replace(/\\/g, "/");
3812
+ path25 = sysPath2.normalize(path25);
3813
+ path25 = path25.replace(/\\/g, "/");
3785
3814
  let prepend = false;
3786
- if (path22.startsWith("//"))
3815
+ if (path25.startsWith("//"))
3787
3816
  prepend = true;
3788
3817
  const DOUBLE_SLASH_RE2 = /\/\//;
3789
- while (path22.match(DOUBLE_SLASH_RE2))
3790
- path22 = path22.replace(DOUBLE_SLASH_RE2, "/");
3818
+ while (path25.match(DOUBLE_SLASH_RE2))
3819
+ path25 = path25.replace(DOUBLE_SLASH_RE2, "/");
3791
3820
  if (prepend)
3792
- path22 = "/" + path22;
3793
- return path22;
3821
+ path25 = "/" + path25;
3822
+ return path25;
3794
3823
  }
3795
3824
  function matchPatterns(patterns, testString, stats) {
3796
- const path22 = normalizePath(testString);
3825
+ const path25 = normalizePath(testString);
3797
3826
  for (let index = 0; index < patterns.length; index++) {
3798
3827
  const pattern = patterns[index];
3799
- if (pattern(path22, stats)) {
3828
+ if (pattern(path25, stats)) {
3800
3829
  return true;
3801
3830
  }
3802
3831
  }
@@ -3836,19 +3865,19 @@ var toUnix = (string) => {
3836
3865
  }
3837
3866
  return str;
3838
3867
  };
3839
- var normalizePathToUnix = (path22) => toUnix(sysPath2.normalize(toUnix(path22)));
3840
- var normalizeIgnored = (cwd = "") => (path22) => {
3841
- if (typeof path22 === "string") {
3842
- return normalizePathToUnix(sysPath2.isAbsolute(path22) ? path22 : sysPath2.join(cwd, path22));
3868
+ var normalizePathToUnix = (path25) => toUnix(sysPath2.normalize(toUnix(path25)));
3869
+ var normalizeIgnored = (cwd = "") => (path25) => {
3870
+ if (typeof path25 === "string") {
3871
+ return normalizePathToUnix(sysPath2.isAbsolute(path25) ? path25 : sysPath2.join(cwd, path25));
3843
3872
  } else {
3844
- return path22;
3873
+ return path25;
3845
3874
  }
3846
3875
  };
3847
- var getAbsolutePath = (path22, cwd) => {
3848
- if (sysPath2.isAbsolute(path22)) {
3849
- return path22;
3876
+ var getAbsolutePath = (path25, cwd) => {
3877
+ if (sysPath2.isAbsolute(path25)) {
3878
+ return path25;
3850
3879
  }
3851
- return sysPath2.join(cwd, path22);
3880
+ return sysPath2.join(cwd, path25);
3852
3881
  };
3853
3882
  var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
3854
3883
  var DirEntry = class {
@@ -3903,10 +3932,10 @@ var DirEntry = class {
3903
3932
  var STAT_METHOD_F = "stat";
3904
3933
  var STAT_METHOD_L = "lstat";
3905
3934
  var WatchHelper = class {
3906
- constructor(path22, follow, fsw) {
3935
+ constructor(path25, follow, fsw) {
3907
3936
  this.fsw = fsw;
3908
- const watchPath = path22;
3909
- this.path = path22 = path22.replace(REPLACER_RE, "");
3937
+ const watchPath = path25;
3938
+ this.path = path25 = path25.replace(REPLACER_RE, "");
3910
3939
  this.watchPath = watchPath;
3911
3940
  this.fullWatchPath = sysPath2.resolve(watchPath);
3912
3941
  this.dirParts = [];
@@ -4028,20 +4057,20 @@ var FSWatcher = class extends _events2.EventEmitter {
4028
4057
  this._closePromise = void 0;
4029
4058
  let paths = unifyPaths(paths_);
4030
4059
  if (cwd) {
4031
- paths = paths.map((path22) => {
4032
- const absPath = getAbsolutePath(path22, cwd);
4060
+ paths = paths.map((path25) => {
4061
+ const absPath = getAbsolutePath(path25, cwd);
4033
4062
  return absPath;
4034
4063
  });
4035
4064
  }
4036
- paths.forEach((path22) => {
4037
- this._removeIgnoredPath(path22);
4065
+ paths.forEach((path25) => {
4066
+ this._removeIgnoredPath(path25);
4038
4067
  });
4039
4068
  this._userIgnored = void 0;
4040
4069
  if (!this._readyCount)
4041
4070
  this._readyCount = 0;
4042
4071
  this._readyCount += paths.length;
4043
- Promise.all(paths.map(async (path22) => {
4044
- const res = await this._nodeFsHandler._addToNodeFs(path22, !_internal, void 0, 0, _origAdd);
4072
+ Promise.all(paths.map(async (path25) => {
4073
+ const res = await this._nodeFsHandler._addToNodeFs(path25, !_internal, void 0, 0, _origAdd);
4045
4074
  if (res)
4046
4075
  this._emitReady();
4047
4076
  return res;
@@ -4063,17 +4092,17 @@ var FSWatcher = class extends _events2.EventEmitter {
4063
4092
  return this;
4064
4093
  const paths = unifyPaths(paths_);
4065
4094
  const { cwd } = this.options;
4066
- paths.forEach((path22) => {
4067
- if (!sysPath2.isAbsolute(path22) && !this._closers.has(path22)) {
4095
+ paths.forEach((path25) => {
4096
+ if (!sysPath2.isAbsolute(path25) && !this._closers.has(path25)) {
4068
4097
  if (cwd)
4069
- path22 = sysPath2.join(cwd, path22);
4070
- path22 = sysPath2.resolve(path22);
4098
+ path25 = sysPath2.join(cwd, path25);
4099
+ path25 = sysPath2.resolve(path25);
4071
4100
  }
4072
- this._closePath(path22);
4073
- this._addIgnoredPath(path22);
4074
- if (this._watched.has(path22)) {
4101
+ this._closePath(path25);
4102
+ this._addIgnoredPath(path25);
4103
+ if (this._watched.has(path25)) {
4075
4104
  this._addIgnoredPath({
4076
- path: path22,
4105
+ path: path25,
4077
4106
  recursive: true
4078
4107
  });
4079
4108
  }
@@ -4137,38 +4166,38 @@ var FSWatcher = class extends _events2.EventEmitter {
4137
4166
  * @param stats arguments to be passed with event
4138
4167
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
4139
4168
  */
4140
- async _emit(event, path22, stats) {
4169
+ async _emit(event, path25, stats) {
4141
4170
  if (this.closed)
4142
4171
  return;
4143
4172
  const opts = this.options;
4144
4173
  if (isWindows)
4145
- path22 = sysPath2.normalize(path22);
4174
+ path25 = sysPath2.normalize(path25);
4146
4175
  if (opts.cwd)
4147
- path22 = sysPath2.relative(opts.cwd, path22);
4148
- const args = [path22];
4176
+ path25 = sysPath2.relative(opts.cwd, path25);
4177
+ const args = [path25];
4149
4178
  if (stats != null)
4150
4179
  args.push(stats);
4151
4180
  const awf = opts.awaitWriteFinish;
4152
4181
  let pw;
4153
- if (awf && (pw = this._pendingWrites.get(path22))) {
4182
+ if (awf && (pw = this._pendingWrites.get(path25))) {
4154
4183
  pw.lastChange = /* @__PURE__ */ new Date();
4155
4184
  return this;
4156
4185
  }
4157
4186
  if (opts.atomic) {
4158
4187
  if (event === EVENTS.UNLINK) {
4159
- this._pendingUnlinks.set(path22, [event, ...args]);
4188
+ this._pendingUnlinks.set(path25, [event, ...args]);
4160
4189
  setTimeout(() => {
4161
- this._pendingUnlinks.forEach((entry, path23) => {
4190
+ this._pendingUnlinks.forEach((entry, path26) => {
4162
4191
  this.emit(...entry);
4163
4192
  this.emit(EVENTS.ALL, ...entry);
4164
- this._pendingUnlinks.delete(path23);
4193
+ this._pendingUnlinks.delete(path26);
4165
4194
  });
4166
4195
  }, typeof opts.atomic === "number" ? opts.atomic : 100);
4167
4196
  return this;
4168
4197
  }
4169
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path22)) {
4198
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path25)) {
4170
4199
  event = EVENTS.CHANGE;
4171
- this._pendingUnlinks.delete(path22);
4200
+ this._pendingUnlinks.delete(path25);
4172
4201
  }
4173
4202
  }
4174
4203
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
@@ -4186,16 +4215,16 @@ var FSWatcher = class extends _events2.EventEmitter {
4186
4215
  this.emitWithAll(event, args);
4187
4216
  }
4188
4217
  };
4189
- this._awaitWriteFinish(path22, awf.stabilityThreshold, event, awfEmit);
4218
+ this._awaitWriteFinish(path25, awf.stabilityThreshold, event, awfEmit);
4190
4219
  return this;
4191
4220
  }
4192
4221
  if (event === EVENTS.CHANGE) {
4193
- const isThrottled = !this._throttle(EVENTS.CHANGE, path22, 50);
4222
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path25, 50);
4194
4223
  if (isThrottled)
4195
4224
  return this;
4196
4225
  }
4197
4226
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
4198
- const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path22) : path22;
4227
+ const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path25) : path25;
4199
4228
  let stats2;
4200
4229
  try {
4201
4230
  stats2 = await _promises.stat.call(void 0, fullPath);
@@ -4226,23 +4255,23 @@ var FSWatcher = class extends _events2.EventEmitter {
4226
4255
  * @param timeout duration of time to suppress duplicate actions
4227
4256
  * @returns tracking object or false if action should be suppressed
4228
4257
  */
4229
- _throttle(actionType, path22, timeout) {
4258
+ _throttle(actionType, path25, timeout) {
4230
4259
  if (!this._throttled.has(actionType)) {
4231
4260
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
4232
4261
  }
4233
4262
  const action = this._throttled.get(actionType);
4234
4263
  if (!action)
4235
4264
  throw new Error("invalid throttle");
4236
- const actionPath = action.get(path22);
4265
+ const actionPath = action.get(path25);
4237
4266
  if (actionPath) {
4238
4267
  actionPath.count++;
4239
4268
  return false;
4240
4269
  }
4241
4270
  let timeoutObject;
4242
4271
  const clear = () => {
4243
- const item = action.get(path22);
4272
+ const item = action.get(path25);
4244
4273
  const count = item ? item.count : 0;
4245
- action.delete(path22);
4274
+ action.delete(path25);
4246
4275
  clearTimeout(timeoutObject);
4247
4276
  if (item)
4248
4277
  clearTimeout(item.timeoutObject);
@@ -4250,7 +4279,7 @@ var FSWatcher = class extends _events2.EventEmitter {
4250
4279
  };
4251
4280
  timeoutObject = setTimeout(clear, timeout);
4252
4281
  const thr = { timeoutObject, clear, count: 0 };
4253
- action.set(path22, thr);
4282
+ action.set(path25, thr);
4254
4283
  return thr;
4255
4284
  }
4256
4285
  _incrReadyCount() {
@@ -4264,44 +4293,44 @@ var FSWatcher = class extends _events2.EventEmitter {
4264
4293
  * @param event
4265
4294
  * @param awfEmit Callback to be called when ready for event to be emitted.
4266
4295
  */
4267
- _awaitWriteFinish(path22, threshold, event, awfEmit) {
4296
+ _awaitWriteFinish(path25, threshold, event, awfEmit) {
4268
4297
  const awf = this.options.awaitWriteFinish;
4269
4298
  if (typeof awf !== "object")
4270
4299
  return;
4271
4300
  const pollInterval = awf.pollInterval;
4272
4301
  let timeoutHandler;
4273
- let fullPath = path22;
4274
- if (this.options.cwd && !sysPath2.isAbsolute(path22)) {
4275
- fullPath = sysPath2.join(this.options.cwd, path22);
4302
+ let fullPath = path25;
4303
+ if (this.options.cwd && !sysPath2.isAbsolute(path25)) {
4304
+ fullPath = sysPath2.join(this.options.cwd, path25);
4276
4305
  }
4277
4306
  const now = /* @__PURE__ */ new Date();
4278
4307
  const writes = this._pendingWrites;
4279
4308
  function awaitWriteFinishFn(prevStat) {
4280
4309
  _fs.stat.call(void 0, fullPath, (err, curStat) => {
4281
- if (err || !writes.has(path22)) {
4310
+ if (err || !writes.has(path25)) {
4282
4311
  if (err && err.code !== "ENOENT")
4283
4312
  awfEmit(err);
4284
4313
  return;
4285
4314
  }
4286
4315
  const now2 = Number(/* @__PURE__ */ new Date());
4287
4316
  if (prevStat && curStat.size !== prevStat.size) {
4288
- writes.get(path22).lastChange = now2;
4317
+ writes.get(path25).lastChange = now2;
4289
4318
  }
4290
- const pw = writes.get(path22);
4319
+ const pw = writes.get(path25);
4291
4320
  const df = now2 - pw.lastChange;
4292
4321
  if (df >= threshold) {
4293
- writes.delete(path22);
4322
+ writes.delete(path25);
4294
4323
  awfEmit(void 0, curStat);
4295
4324
  } else {
4296
4325
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
4297
4326
  }
4298
4327
  });
4299
4328
  }
4300
- if (!writes.has(path22)) {
4301
- writes.set(path22, {
4329
+ if (!writes.has(path25)) {
4330
+ writes.set(path25, {
4302
4331
  lastChange: now,
4303
4332
  cancelWait: () => {
4304
- writes.delete(path22);
4333
+ writes.delete(path25);
4305
4334
  clearTimeout(timeoutHandler);
4306
4335
  return event;
4307
4336
  }
@@ -4312,8 +4341,8 @@ var FSWatcher = class extends _events2.EventEmitter {
4312
4341
  /**
4313
4342
  * Determines whether user has asked to ignore this path.
4314
4343
  */
4315
- _isIgnored(path22, stats) {
4316
- if (this.options.atomic && DOT_RE.test(path22))
4344
+ _isIgnored(path25, stats) {
4345
+ if (this.options.atomic && DOT_RE.test(path25))
4317
4346
  return true;
4318
4347
  if (!this._userIgnored) {
4319
4348
  const { cwd } = this.options;
@@ -4323,17 +4352,17 @@ var FSWatcher = class extends _events2.EventEmitter {
4323
4352
  const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
4324
4353
  this._userIgnored = anymatch(list, void 0);
4325
4354
  }
4326
- return this._userIgnored(path22, stats);
4355
+ return this._userIgnored(path25, stats);
4327
4356
  }
4328
- _isntIgnored(path22, stat6) {
4329
- return !this._isIgnored(path22, stat6);
4357
+ _isntIgnored(path25, stat6) {
4358
+ return !this._isIgnored(path25, stat6);
4330
4359
  }
4331
4360
  /**
4332
4361
  * Provides a set of common helpers and properties relating to symlink handling.
4333
4362
  * @param path file or directory pattern being watched
4334
4363
  */
4335
- _getWatchHelpers(path22) {
4336
- return new WatchHelper(path22, this.options.followSymlinks, this);
4364
+ _getWatchHelpers(path25) {
4365
+ return new WatchHelper(path25, this.options.followSymlinks, this);
4337
4366
  }
4338
4367
  // Directory helpers
4339
4368
  // -----------------
@@ -4365,63 +4394,63 @@ var FSWatcher = class extends _events2.EventEmitter {
4365
4394
  * @param item base path of item/directory
4366
4395
  */
4367
4396
  _remove(directory, item, isDirectory) {
4368
- const path22 = sysPath2.join(directory, item);
4369
- const fullPath = sysPath2.resolve(path22);
4370
- isDirectory = isDirectory != null ? isDirectory : this._watched.has(path22) || this._watched.has(fullPath);
4371
- if (!this._throttle("remove", path22, 100))
4397
+ const path25 = sysPath2.join(directory, item);
4398
+ const fullPath = sysPath2.resolve(path25);
4399
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path25) || this._watched.has(fullPath);
4400
+ if (!this._throttle("remove", path25, 100))
4372
4401
  return;
4373
4402
  if (!isDirectory && this._watched.size === 1) {
4374
4403
  this.add(directory, item, true);
4375
4404
  }
4376
- const wp = this._getWatchedDir(path22);
4405
+ const wp = this._getWatchedDir(path25);
4377
4406
  const nestedDirectoryChildren = wp.getChildren();
4378
- nestedDirectoryChildren.forEach((nested) => this._remove(path22, nested));
4407
+ nestedDirectoryChildren.forEach((nested) => this._remove(path25, nested));
4379
4408
  const parent = this._getWatchedDir(directory);
4380
4409
  const wasTracked = parent.has(item);
4381
4410
  parent.remove(item);
4382
4411
  if (this._symlinkPaths.has(fullPath)) {
4383
4412
  this._symlinkPaths.delete(fullPath);
4384
4413
  }
4385
- let relPath = path22;
4414
+ let relPath = path25;
4386
4415
  if (this.options.cwd)
4387
- relPath = sysPath2.relative(this.options.cwd, path22);
4416
+ relPath = sysPath2.relative(this.options.cwd, path25);
4388
4417
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
4389
4418
  const event = this._pendingWrites.get(relPath).cancelWait();
4390
4419
  if (event === EVENTS.ADD)
4391
4420
  return;
4392
4421
  }
4393
- this._watched.delete(path22);
4422
+ this._watched.delete(path25);
4394
4423
  this._watched.delete(fullPath);
4395
4424
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
4396
- if (wasTracked && !this._isIgnored(path22))
4397
- this._emit(eventName, path22);
4398
- this._closePath(path22);
4425
+ if (wasTracked && !this._isIgnored(path25))
4426
+ this._emit(eventName, path25);
4427
+ this._closePath(path25);
4399
4428
  }
4400
4429
  /**
4401
4430
  * Closes all watchers for a path
4402
4431
  */
4403
- _closePath(path22) {
4404
- this._closeFile(path22);
4405
- const dir = sysPath2.dirname(path22);
4406
- this._getWatchedDir(dir).remove(sysPath2.basename(path22));
4432
+ _closePath(path25) {
4433
+ this._closeFile(path25);
4434
+ const dir = sysPath2.dirname(path25);
4435
+ this._getWatchedDir(dir).remove(sysPath2.basename(path25));
4407
4436
  }
4408
4437
  /**
4409
4438
  * Closes only file-specific watchers
4410
4439
  */
4411
- _closeFile(path22) {
4412
- const closers = this._closers.get(path22);
4440
+ _closeFile(path25) {
4441
+ const closers = this._closers.get(path25);
4413
4442
  if (!closers)
4414
4443
  return;
4415
4444
  closers.forEach((closer) => closer());
4416
- this._closers.delete(path22);
4445
+ this._closers.delete(path25);
4417
4446
  }
4418
- _addPathCloser(path22, closer) {
4447
+ _addPathCloser(path25, closer) {
4419
4448
  if (!closer)
4420
4449
  return;
4421
- let list = this._closers.get(path22);
4450
+ let list = this._closers.get(path25);
4422
4451
  if (!list) {
4423
4452
  list = [];
4424
- this._closers.set(path22, list);
4453
+ this._closers.set(path25, list);
4425
4454
  }
4426
4455
  list.push(closer);
4427
4456
  }
@@ -6953,12 +6982,12 @@ var PathBase = (_class6 = class {
6953
6982
  /**
6954
6983
  * Get the Path object referenced by the string path, resolved from this Path
6955
6984
  */
6956
- resolve(path22) {
6957
- if (!path22) {
6985
+ resolve(path25) {
6986
+ if (!path25) {
6958
6987
  return this;
6959
6988
  }
6960
- const rootPath = this.getRootString(path22);
6961
- const dir = path22.substring(rootPath.length);
6989
+ const rootPath = this.getRootString(path25);
6990
+ const dir = path25.substring(rootPath.length);
6962
6991
  const dirParts = dir.split(this.splitSep);
6963
6992
  const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
6964
6993
  return result;
@@ -7710,8 +7739,8 @@ var PathWin32 = (_class7 = class _PathWin32 extends PathBase {
7710
7739
  /**
7711
7740
  * @internal
7712
7741
  */
7713
- getRootString(path22) {
7714
- return _path.win32.parse(path22).root;
7742
+ getRootString(path25) {
7743
+ return _path.win32.parse(path25).root;
7715
7744
  }
7716
7745
  /**
7717
7746
  * @internal
@@ -7757,8 +7786,8 @@ var PathPosix = (_class8 = class _PathPosix extends PathBase {
7757
7786
  /**
7758
7787
  * @internal
7759
7788
  */
7760
- getRootString(path22) {
7761
- return path22.startsWith("/") ? "/" : "";
7789
+ getRootString(path25) {
7790
+ return path25.startsWith("/") ? "/" : "";
7762
7791
  }
7763
7792
  /**
7764
7793
  * @internal
@@ -7807,8 +7836,8 @@ var PathScurryBase = class {
7807
7836
  *
7808
7837
  * @internal
7809
7838
  */
7810
- constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs17 = defaultFS } = {}) {
7811
- this.#fs = fsFromOption(fs17);
7839
+ constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs19 = defaultFS } = {}) {
7840
+ this.#fs = fsFromOption(fs19);
7812
7841
  if (cwd instanceof URL || cwd.startsWith("file://")) {
7813
7842
  cwd = _url.fileURLToPath.call(void 0, cwd);
7814
7843
  }
@@ -7847,11 +7876,11 @@ var PathScurryBase = class {
7847
7876
  /**
7848
7877
  * Get the depth of a provided path, string, or the cwd
7849
7878
  */
7850
- depth(path22 = this.cwd) {
7851
- if (typeof path22 === "string") {
7852
- path22 = this.cwd.resolve(path22);
7879
+ depth(path25 = this.cwd) {
7880
+ if (typeof path25 === "string") {
7881
+ path25 = this.cwd.resolve(path25);
7853
7882
  }
7854
- return path22.depth();
7883
+ return path25.depth();
7855
7884
  }
7856
7885
  /**
7857
7886
  * Return the cache of child entries. Exposed so subclasses can create
@@ -8230,7 +8259,7 @@ var PathScurryBase = class {
8230
8259
  const dirs = /* @__PURE__ */ new Set();
8231
8260
  const queue = [entry];
8232
8261
  let processing = 0;
8233
- const process8 = () => {
8262
+ const process9 = () => {
8234
8263
  let paused = false;
8235
8264
  while (!paused) {
8236
8265
  const dir = queue.shift();
@@ -8271,9 +8300,9 @@ var PathScurryBase = class {
8271
8300
  }
8272
8301
  }
8273
8302
  if (paused && !results.flowing) {
8274
- results.once("drain", process8);
8303
+ results.once("drain", process9);
8275
8304
  } else if (!sync2) {
8276
- process8();
8305
+ process9();
8277
8306
  }
8278
8307
  };
8279
8308
  let sync2 = true;
@@ -8281,7 +8310,7 @@ var PathScurryBase = class {
8281
8310
  sync2 = false;
8282
8311
  }
8283
8312
  };
8284
- process8();
8313
+ process9();
8285
8314
  return results;
8286
8315
  }
8287
8316
  streamSync(entry = this.cwd, opts = {}) {
@@ -8299,7 +8328,7 @@ var PathScurryBase = class {
8299
8328
  }
8300
8329
  const queue = [entry];
8301
8330
  let processing = 0;
8302
- const process8 = () => {
8331
+ const process9 = () => {
8303
8332
  let paused = false;
8304
8333
  while (!paused) {
8305
8334
  const dir = queue.shift();
@@ -8333,14 +8362,14 @@ var PathScurryBase = class {
8333
8362
  }
8334
8363
  }
8335
8364
  if (paused && !results.flowing)
8336
- results.once("drain", process8);
8365
+ results.once("drain", process9);
8337
8366
  };
8338
- process8();
8367
+ process9();
8339
8368
  return results;
8340
8369
  }
8341
- chdir(path22 = this.cwd) {
8370
+ chdir(path25 = this.cwd) {
8342
8371
  const oldCwd = this.cwd;
8343
- this.cwd = typeof path22 === "string" ? this.cwd.resolve(path22) : path22;
8372
+ this.cwd = typeof path25 === "string" ? this.cwd.resolve(path25) : path25;
8344
8373
  this.cwd[setAsCwd](oldCwd);
8345
8374
  }
8346
8375
  };
@@ -8366,8 +8395,8 @@ var PathScurryWin32 = (_class9 = class extends PathScurryBase {
8366
8395
  /**
8367
8396
  * @internal
8368
8397
  */
8369
- newRoot(fs17) {
8370
- return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs17 });
8398
+ newRoot(fs19) {
8399
+ return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs19 });
8371
8400
  }
8372
8401
  /**
8373
8402
  * Return true if the provided path string is an absolute path
@@ -8395,8 +8424,8 @@ var PathScurryPosix = (_class10 = class extends PathScurryBase {
8395
8424
  /**
8396
8425
  * @internal
8397
8426
  */
8398
- newRoot(fs17) {
8399
- return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs17 });
8427
+ newRoot(fs19) {
8428
+ return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs19 });
8400
8429
  }
8401
8430
  /**
8402
8431
  * Return true if the provided path string is an absolute path
@@ -8702,8 +8731,8 @@ var MatchRecord = (_class11 = class {constructor() { _class11.prototype.__init28
8702
8731
  }
8703
8732
  // match, absolute, ifdir
8704
8733
  entries() {
8705
- return [...this.store.entries()].map(([path22, n2]) => [
8706
- path22,
8734
+ return [...this.store.entries()].map(([path25, n2]) => [
8735
+ path25,
8707
8736
  !!(n2 & 2),
8708
8737
  !!(n2 & 1)
8709
8738
  ]);
@@ -8908,9 +8937,9 @@ var GlobUtil = (_class14 = class {
8908
8937
 
8909
8938
 
8910
8939
 
8911
- constructor(patterns, path22, opts) {;_class14.prototype.__init32.call(this);_class14.prototype.__init33.call(this);_class14.prototype.__init34.call(this);
8940
+ constructor(patterns, path25, opts) {;_class14.prototype.__init32.call(this);_class14.prototype.__init33.call(this);_class14.prototype.__init34.call(this);
8912
8941
  this.patterns = patterns;
8913
- this.path = path22;
8942
+ this.path = path25;
8914
8943
  this.opts = opts;
8915
8944
  this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
8916
8945
  this.includeChildMatches = opts.includeChildMatches !== false;
@@ -8929,11 +8958,11 @@ var GlobUtil = (_class14 = class {
8929
8958
  });
8930
8959
  }
8931
8960
  }
8932
- #ignored(path22) {
8933
- return this.seen.has(path22) || !!_optionalChain([this, 'access', _125 => _125.#ignore, 'optionalAccess', _126 => _126.ignored, 'optionalCall', _127 => _127(path22)]);
8961
+ #ignored(path25) {
8962
+ return this.seen.has(path25) || !!_optionalChain([this, 'access', _125 => _125.#ignore, 'optionalAccess', _126 => _126.ignored, 'optionalCall', _127 => _127(path25)]);
8934
8963
  }
8935
- #childrenIgnored(path22) {
8936
- return !!_optionalChain([this, 'access', _128 => _128.#ignore, 'optionalAccess', _129 => _129.childrenIgnored, 'optionalCall', _130 => _130(path22)]);
8964
+ #childrenIgnored(path25) {
8965
+ return !!_optionalChain([this, 'access', _128 => _128.#ignore, 'optionalAccess', _129 => _129.childrenIgnored, 'optionalCall', _130 => _130(path25)]);
8937
8966
  }
8938
8967
  // backpressure mechanism
8939
8968
  pause() {
@@ -9148,8 +9177,8 @@ var GlobUtil = (_class14 = class {
9148
9177
  }, _class14);
9149
9178
  var GlobWalker = (_class15 = class extends GlobUtil {
9150
9179
  __init35() {this.matches = /* @__PURE__ */ new Set()}
9151
- constructor(patterns, path22, opts) {
9152
- super(patterns, path22, opts);_class15.prototype.__init35.call(this);;
9180
+ constructor(patterns, path25, opts) {
9181
+ super(patterns, path25, opts);_class15.prototype.__init35.call(this);;
9153
9182
  }
9154
9183
  matchEmit(e) {
9155
9184
  this.matches.add(e);
@@ -9186,8 +9215,8 @@ var GlobWalker = (_class15 = class extends GlobUtil {
9186
9215
  }, _class15);
9187
9216
  var GlobStream = class extends GlobUtil {
9188
9217
 
9189
- constructor(patterns, path22, opts) {
9190
- super(patterns, path22, opts);
9218
+ constructor(patterns, path25, opts) {
9219
+ super(patterns, path25, opts);
9191
9220
  this.results = new Minipass({
9192
9221
  signal: this.signal,
9193
9222
  objectMode: true
@@ -9524,44 +9553,44 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9524
9553
  var platform_default = process.env.__TESTING_RIMRAF_PLATFORM__ || process.platform;
9525
9554
 
9526
9555
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/path-arg.js
9527
- var pathArg = (path22, opt = {}) => {
9528
- const type = typeof path22;
9556
+ var pathArg = (path25, opt = {}) => {
9557
+ const type = typeof path25;
9529
9558
  if (type !== "string") {
9530
- const ctor = path22 && type === "object" && path22.constructor;
9531
- const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? _util.inspect.call(void 0, path22) : `type ${type} ${path22}`;
9559
+ const ctor = path25 && type === "object" && path25.constructor;
9560
+ const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? _util.inspect.call(void 0, path25) : `type ${type} ${path25}`;
9532
9561
  const msg = `The "path" argument must be of type string. Received ${received}`;
9533
9562
  throw Object.assign(new TypeError(msg), {
9534
- path: path22,
9563
+ path: path25,
9535
9564
  code: "ERR_INVALID_ARG_TYPE"
9536
9565
  });
9537
9566
  }
9538
- if (/\0/.test(path22)) {
9567
+ if (/\0/.test(path25)) {
9539
9568
  const msg = "path must be a string without null bytes";
9540
9569
  throw Object.assign(new TypeError(msg), {
9541
- path: path22,
9570
+ path: path25,
9542
9571
  code: "ERR_INVALID_ARG_VALUE"
9543
9572
  });
9544
9573
  }
9545
- path22 = _path.resolve.call(void 0, path22);
9546
- const { root } = _path.parse.call(void 0, path22);
9547
- if (path22 === root && opt.preserveRoot !== false) {
9574
+ path25 = _path.resolve.call(void 0, path25);
9575
+ const { root } = _path.parse.call(void 0, path25);
9576
+ if (path25 === root && opt.preserveRoot !== false) {
9548
9577
  const msg = "refusing to remove root directory without preserveRoot:false";
9549
9578
  throw Object.assign(new Error(msg), {
9550
- path: path22,
9579
+ path: path25,
9551
9580
  code: "ERR_PRESERVE_ROOT"
9552
9581
  });
9553
9582
  }
9554
9583
  if (platform_default === "win32") {
9555
9584
  const badWinChars = /[*|"<>?:]/;
9556
- const { root: root2 } = _path.parse.call(void 0, path22);
9557
- if (badWinChars.test(path22.substring(root2.length))) {
9585
+ const { root: root2 } = _path.parse.call(void 0, path25);
9586
+ if (badWinChars.test(path25.substring(root2.length))) {
9558
9587
  throw Object.assign(new Error("Illegal characters in path."), {
9559
- path: path22,
9588
+ path: path25,
9560
9589
  code: "EINVAL"
9561
9590
  });
9562
9591
  }
9563
9592
  }
9564
- return path22;
9593
+ return path25;
9565
9594
  };
9566
9595
  var path_arg_default = pathArg;
9567
9596
 
@@ -9576,16 +9605,16 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9576
9605
 
9577
9606
 
9578
9607
 
9579
- var readdirSync2 = (path22) => _fs.readdirSync.call(void 0, path22, { withFileTypes: true });
9580
- var chmod = (path22, mode) => new Promise((res, rej) => actualFS.default.chmod(path22, mode, (er, ...d) => er ? rej(er) : res(...d)));
9581
- var mkdir = (path22, options) => new Promise((res, rej) => actualFS.default.mkdir(path22, options, (er, made) => er ? rej(er) : res(made)));
9582
- var readdir4 = (path22) => new Promise((res, rej) => actualFS.default.readdir(path22, { withFileTypes: true }, (er, data2) => er ? rej(er) : res(data2)));
9608
+ var readdirSync2 = (path25) => _fs.readdirSync.call(void 0, path25, { withFileTypes: true });
9609
+ var chmod = (path25, mode) => new Promise((res, rej) => actualFS.default.chmod(path25, mode, (er, ...d) => er ? rej(er) : res(...d)));
9610
+ var mkdir = (path25, options) => new Promise((res, rej) => actualFS.default.mkdir(path25, options, (er, made) => er ? rej(er) : res(made)));
9611
+ var readdir4 = (path25) => new Promise((res, rej) => actualFS.default.readdir(path25, { withFileTypes: true }, (er, data2) => er ? rej(er) : res(data2)));
9583
9612
  var rename = (oldPath, newPath) => new Promise((res, rej) => actualFS.default.rename(oldPath, newPath, (er, ...d) => er ? rej(er) : res(...d)));
9584
- var rm = (path22, options) => new Promise((res, rej) => actualFS.default.rm(path22, options, (er, ...d) => er ? rej(er) : res(...d)));
9585
- var rmdir = (path22) => new Promise((res, rej) => actualFS.default.rmdir(path22, (er, ...d) => er ? rej(er) : res(...d)));
9586
- var stat4 = (path22) => new Promise((res, rej) => actualFS.default.stat(path22, (er, data2) => er ? rej(er) : res(data2)));
9587
- var lstat4 = (path22) => new Promise((res, rej) => actualFS.default.lstat(path22, (er, data2) => er ? rej(er) : res(data2)));
9588
- var unlink = (path22) => new Promise((res, rej) => actualFS.default.unlink(path22, (er, ...d) => er ? rej(er) : res(...d)));
9613
+ var rm = (path25, options) => new Promise((res, rej) => actualFS.default.rm(path25, options, (er, ...d) => er ? rej(er) : res(...d)));
9614
+ var rmdir = (path25) => new Promise((res, rej) => actualFS.default.rmdir(path25, (er, ...d) => er ? rej(er) : res(...d)));
9615
+ var stat4 = (path25) => new Promise((res, rej) => actualFS.default.stat(path25, (er, data2) => er ? rej(er) : res(data2)));
9616
+ var lstat4 = (path25) => new Promise((res, rej) => actualFS.default.lstat(path25, (er, data2) => er ? rej(er) : res(data2)));
9617
+ var unlink = (path25) => new Promise((res, rej) => actualFS.default.unlink(path25, (er, ...d) => er ? rej(er) : res(...d)));
9589
9618
  var promises = {
9590
9619
  chmod,
9591
9620
  mkdir,
@@ -9604,10 +9633,10 @@ var promises = {
9604
9633
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/readdir-or-error.js
9605
9634
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9606
9635
  var { readdir: readdir5 } = promises;
9607
- var readdirOrError = (path22) => readdir5(path22).catch((er) => er);
9608
- var readdirOrErrorSync = (path22) => {
9636
+ var readdirOrError = (path25) => readdir5(path25).catch((er) => er);
9637
+ var readdirOrErrorSync = (path25) => {
9609
9638
  try {
9610
- return readdirSync2(path22);
9639
+ return readdirSync2(path25);
9611
9640
  } catch (er) {
9612
9641
  return er;
9613
9642
  }
@@ -9632,35 +9661,35 @@ var ignoreENOENTSync = (fn) => {
9632
9661
 
9633
9662
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-posix.js
9634
9663
  var { lstat: lstat5, rmdir: rmdir2, unlink: unlink2 } = promises;
9635
- var rimrafPosix = async (path22, opt) => {
9664
+ var rimrafPosix = async (path25, opt) => {
9636
9665
  if (_optionalChain([opt, 'optionalAccess', _164 => _164.signal, 'optionalAccess', _165 => _165.aborted])) {
9637
9666
  throw opt.signal.reason;
9638
9667
  }
9639
9668
  try {
9640
- return await rimrafPosixDir(path22, opt, await lstat5(path22));
9669
+ return await rimrafPosixDir(path25, opt, await lstat5(path25));
9641
9670
  } catch (er) {
9642
9671
  if (_optionalChain([er, 'optionalAccess', _166 => _166.code]) === "ENOENT")
9643
9672
  return true;
9644
9673
  throw er;
9645
9674
  }
9646
9675
  };
9647
- var rimrafPosixSync = (path22, opt) => {
9676
+ var rimrafPosixSync = (path25, opt) => {
9648
9677
  if (_optionalChain([opt, 'optionalAccess', _167 => _167.signal, 'optionalAccess', _168 => _168.aborted])) {
9649
9678
  throw opt.signal.reason;
9650
9679
  }
9651
9680
  try {
9652
- return rimrafPosixDirSync(path22, opt, _fs.lstatSync.call(void 0, path22));
9681
+ return rimrafPosixDirSync(path25, opt, _fs.lstatSync.call(void 0, path25));
9653
9682
  } catch (er) {
9654
9683
  if (_optionalChain([er, 'optionalAccess', _169 => _169.code]) === "ENOENT")
9655
9684
  return true;
9656
9685
  throw er;
9657
9686
  }
9658
9687
  };
9659
- var rimrafPosixDir = async (path22, opt, ent) => {
9688
+ var rimrafPosixDir = async (path25, opt, ent) => {
9660
9689
  if (_optionalChain([opt, 'optionalAccess', _170 => _170.signal, 'optionalAccess', _171 => _171.aborted])) {
9661
9690
  throw opt.signal.reason;
9662
9691
  }
9663
- const entries = ent.isDirectory() ? await readdirOrError(path22) : null;
9692
+ const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
9664
9693
  if (!Array.isArray(entries)) {
9665
9694
  if (entries) {
9666
9695
  if (entries.code === "ENOENT") {
@@ -9670,30 +9699,30 @@ var rimrafPosixDir = async (path22, opt, ent) => {
9670
9699
  throw entries;
9671
9700
  }
9672
9701
  }
9673
- if (opt.filter && !await opt.filter(path22, ent)) {
9702
+ if (opt.filter && !await opt.filter(path25, ent)) {
9674
9703
  return false;
9675
9704
  }
9676
- await ignoreENOENT(unlink2(path22));
9705
+ await ignoreENOENT(unlink2(path25));
9677
9706
  return true;
9678
9707
  }
9679
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(_path.resolve.call(void 0, path22, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
9708
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
9680
9709
  if (!removedAll) {
9681
9710
  return false;
9682
9711
  }
9683
- if (opt.preserveRoot === false && path22 === _path.parse.call(void 0, path22).root) {
9712
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
9684
9713
  return false;
9685
9714
  }
9686
- if (opt.filter && !await opt.filter(path22, ent)) {
9715
+ if (opt.filter && !await opt.filter(path25, ent)) {
9687
9716
  return false;
9688
9717
  }
9689
- await ignoreENOENT(rmdir2(path22));
9718
+ await ignoreENOENT(rmdir2(path25));
9690
9719
  return true;
9691
9720
  };
9692
- var rimrafPosixDirSync = (path22, opt, ent) => {
9721
+ var rimrafPosixDirSync = (path25, opt, ent) => {
9693
9722
  if (_optionalChain([opt, 'optionalAccess', _172 => _172.signal, 'optionalAccess', _173 => _173.aborted])) {
9694
9723
  throw opt.signal.reason;
9695
9724
  }
9696
- const entries = ent.isDirectory() ? readdirOrErrorSync(path22) : null;
9725
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
9697
9726
  if (!Array.isArray(entries)) {
9698
9727
  if (entries) {
9699
9728
  if (entries.code === "ENOENT") {
@@ -9703,27 +9732,27 @@ var rimrafPosixDirSync = (path22, opt, ent) => {
9703
9732
  throw entries;
9704
9733
  }
9705
9734
  }
9706
- if (opt.filter && !opt.filter(path22, ent)) {
9735
+ if (opt.filter && !opt.filter(path25, ent)) {
9707
9736
  return false;
9708
9737
  }
9709
- ignoreENOENTSync(() => _fs.unlinkSync.call(void 0, path22));
9738
+ ignoreENOENTSync(() => _fs.unlinkSync.call(void 0, path25));
9710
9739
  return true;
9711
9740
  }
9712
9741
  let removedAll = true;
9713
9742
  for (const ent2 of entries) {
9714
- const p = _path.resolve.call(void 0, path22, ent2.name);
9743
+ const p = _path.resolve.call(void 0, path25, ent2.name);
9715
9744
  removedAll = rimrafPosixDirSync(p, opt, ent2) && removedAll;
9716
9745
  }
9717
- if (opt.preserveRoot === false && path22 === _path.parse.call(void 0, path22).root) {
9746
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
9718
9747
  return false;
9719
9748
  }
9720
9749
  if (!removedAll) {
9721
9750
  return false;
9722
9751
  }
9723
- if (opt.filter && !opt.filter(path22, ent)) {
9752
+ if (opt.filter && !opt.filter(path25, ent)) {
9724
9753
  return false;
9725
9754
  }
9726
- ignoreENOENTSync(() => _fs.rmdirSync.call(void 0, path22));
9755
+ ignoreENOENTSync(() => _fs.rmdirSync.call(void 0, path25));
9727
9756
  return true;
9728
9757
  };
9729
9758
 
@@ -9734,9 +9763,9 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9734
9763
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/fix-eperm.js
9735
9764
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9736
9765
  var { chmod: chmod2 } = promises;
9737
- var fixEPERM = (fn) => async (path22) => {
9766
+ var fixEPERM = (fn) => async (path25) => {
9738
9767
  try {
9739
- return await fn(path22);
9768
+ return await fn(path25);
9740
9769
  } catch (er) {
9741
9770
  const fer = er;
9742
9771
  if (_optionalChain([fer, 'optionalAccess', _174 => _174.code]) === "ENOENT") {
@@ -9744,7 +9773,7 @@ var fixEPERM = (fn) => async (path22) => {
9744
9773
  }
9745
9774
  if (_optionalChain([fer, 'optionalAccess', _175 => _175.code]) === "EPERM") {
9746
9775
  try {
9747
- await chmod2(path22, 438);
9776
+ await chmod2(path25, 438);
9748
9777
  } catch (er2) {
9749
9778
  const fer2 = er2;
9750
9779
  if (_optionalChain([fer2, 'optionalAccess', _176 => _176.code]) === "ENOENT") {
@@ -9752,14 +9781,14 @@ var fixEPERM = (fn) => async (path22) => {
9752
9781
  }
9753
9782
  throw er;
9754
9783
  }
9755
- return await fn(path22);
9784
+ return await fn(path25);
9756
9785
  }
9757
9786
  throw er;
9758
9787
  }
9759
9788
  };
9760
- var fixEPERMSync = (fn) => (path22) => {
9789
+ var fixEPERMSync = (fn) => (path25) => {
9761
9790
  try {
9762
- return fn(path22);
9791
+ return fn(path25);
9763
9792
  } catch (er) {
9764
9793
  const fer = er;
9765
9794
  if (_optionalChain([fer, 'optionalAccess', _177 => _177.code]) === "ENOENT") {
@@ -9767,7 +9796,7 @@ var fixEPERMSync = (fn) => (path22) => {
9767
9796
  }
9768
9797
  if (_optionalChain([fer, 'optionalAccess', _178 => _178.code]) === "EPERM") {
9769
9798
  try {
9770
- _fs.chmodSync.call(void 0, path22, 438);
9799
+ _fs.chmodSync.call(void 0, path25, 438);
9771
9800
  } catch (er2) {
9772
9801
  const fer2 = er2;
9773
9802
  if (_optionalChain([fer2, 'optionalAccess', _179 => _179.code]) === "ENOENT") {
@@ -9775,7 +9804,7 @@ var fixEPERMSync = (fn) => (path22) => {
9775
9804
  }
9776
9805
  throw er;
9777
9806
  }
9778
- return fn(path22);
9807
+ return fn(path25);
9779
9808
  }
9780
9809
  throw er;
9781
9810
  }
@@ -9788,23 +9817,23 @@ var RATE = 1.2;
9788
9817
  var MAXRETRIES = 10;
9789
9818
  var codes = /* @__PURE__ */ new Set(["EMFILE", "ENFILE", "EBUSY"]);
9790
9819
  var retryBusy = (fn) => {
9791
- const method = async (path22, opt, backoff = 1, total = 0) => {
9820
+ const method = async (path25, opt, backoff = 1, total = 0) => {
9792
9821
  const mbo = opt.maxBackoff || MAXBACKOFF;
9793
9822
  const rate = opt.backoff || RATE;
9794
9823
  const max = opt.maxRetries || MAXRETRIES;
9795
9824
  let retries = 0;
9796
9825
  while (true) {
9797
9826
  try {
9798
- return await fn(path22);
9827
+ return await fn(path25);
9799
9828
  } catch (er) {
9800
9829
  const fer = er;
9801
- if (_optionalChain([fer, 'optionalAccess', _180 => _180.path]) === path22 && _optionalChain([fer, 'optionalAccess', _181 => _181.code]) && codes.has(fer.code)) {
9830
+ if (_optionalChain([fer, 'optionalAccess', _180 => _180.path]) === path25 && _optionalChain([fer, 'optionalAccess', _181 => _181.code]) && codes.has(fer.code)) {
9802
9831
  backoff = Math.ceil(backoff * rate);
9803
9832
  total = backoff + total;
9804
9833
  if (total < mbo) {
9805
9834
  return new Promise((res, rej) => {
9806
9835
  setTimeout(() => {
9807
- method(path22, opt, backoff, total).then(res, rej);
9836
+ method(path25, opt, backoff, total).then(res, rej);
9808
9837
  }, backoff);
9809
9838
  });
9810
9839
  }
@@ -9820,15 +9849,15 @@ var retryBusy = (fn) => {
9820
9849
  return method;
9821
9850
  };
9822
9851
  var retryBusySync = (fn) => {
9823
- const method = (path22, opt) => {
9852
+ const method = (path25, opt) => {
9824
9853
  const max = opt.maxRetries || MAXRETRIES;
9825
9854
  let retries = 0;
9826
9855
  while (true) {
9827
9856
  try {
9828
- return fn(path22);
9857
+ return fn(path25);
9829
9858
  } catch (er) {
9830
9859
  const fer = er;
9831
- if (_optionalChain([fer, 'optionalAccess', _182 => _182.path]) === path22 && _optionalChain([fer, 'optionalAccess', _183 => _183.code]) && codes.has(fer.code) && retries < max) {
9860
+ if (_optionalChain([fer, 'optionalAccess', _182 => _182.path]) === path25 && _optionalChain([fer, 'optionalAccess', _183 => _183.code]) && codes.has(fer.code) && retries < max) {
9832
9861
  retries++;
9833
9862
  continue;
9834
9863
  }
@@ -9848,16 +9877,16 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9848
9877
 
9849
9878
 
9850
9879
  var { stat: stat5 } = promises;
9851
- var isDirSync = (path22) => {
9880
+ var isDirSync = (path25) => {
9852
9881
  try {
9853
- return _fs.statSync.call(void 0, path22).isDirectory();
9882
+ return _fs.statSync.call(void 0, path25).isDirectory();
9854
9883
  } catch (er) {
9855
9884
  return false;
9856
9885
  }
9857
9886
  };
9858
- var isDir = (path22) => stat5(path22).then((st) => st.isDirectory(), () => false);
9859
- var win32DefaultTmp = async (path22) => {
9860
- const { root } = _path.parse.call(void 0, path22);
9887
+ var isDir = (path25) => stat5(path25).then((st) => st.isDirectory(), () => false);
9888
+ var win32DefaultTmp = async (path25) => {
9889
+ const { root } = _path.parse.call(void 0, path25);
9861
9890
  const tmp = _os.tmpdir.call(void 0, );
9862
9891
  const { root: tmpRoot } = _path.parse.call(void 0, tmp);
9863
9892
  if (root.toLowerCase() === tmpRoot.toLowerCase()) {
@@ -9869,8 +9898,8 @@ var win32DefaultTmp = async (path22) => {
9869
9898
  }
9870
9899
  return root;
9871
9900
  };
9872
- var win32DefaultTmpSync = (path22) => {
9873
- const { root } = _path.parse.call(void 0, path22);
9901
+ var win32DefaultTmpSync = (path25) => {
9902
+ const { root } = _path.parse.call(void 0, path25);
9874
9903
  const tmp = _os.tmpdir.call(void 0, );
9875
9904
  const { root: tmpRoot } = _path.parse.call(void 0, tmp);
9876
9905
  if (root.toLowerCase() === tmpRoot.toLowerCase()) {
@@ -9889,10 +9918,10 @@ var defaultTmpSync = platform_default === "win32" ? win32DefaultTmpSync : posixD
9889
9918
 
9890
9919
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-move-remove.js
9891
9920
  var { lstat: lstat6, rename: rename2, unlink: unlink3, rmdir: rmdir3, chmod: chmod3 } = promises;
9892
- var uniqueFilename = (path22) => `.${_path.basename.call(void 0, path22)}.${Math.random()}`;
9893
- var unlinkFixEPERM = async (path22) => unlink3(path22).catch((er) => {
9921
+ var uniqueFilename = (path25) => `.${_path.basename.call(void 0, path25)}.${Math.random()}`;
9922
+ var unlinkFixEPERM = async (path25) => unlink3(path25).catch((er) => {
9894
9923
  if (er.code === "EPERM") {
9895
- return chmod3(path22, 438).then(() => unlink3(path22), (er2) => {
9924
+ return chmod3(path25, 438).then(() => unlink3(path25), (er2) => {
9896
9925
  if (er2.code === "ENOENT") {
9897
9926
  return;
9898
9927
  }
@@ -9903,13 +9932,13 @@ var unlinkFixEPERM = async (path22) => unlink3(path22).catch((er) => {
9903
9932
  }
9904
9933
  throw er;
9905
9934
  });
9906
- var unlinkFixEPERMSync = (path22) => {
9935
+ var unlinkFixEPERMSync = (path25) => {
9907
9936
  try {
9908
- _fs.unlinkSync.call(void 0, path22);
9937
+ _fs.unlinkSync.call(void 0, path25);
9909
9938
  } catch (er) {
9910
9939
  if (_optionalChain([er, 'optionalAccess', _184 => _184.code]) === "EPERM") {
9911
9940
  try {
9912
- return _fs.chmodSync.call(void 0, path22, 438);
9941
+ return _fs.chmodSync.call(void 0, path25, 438);
9913
9942
  } catch (er2) {
9914
9943
  if (_optionalChain([er2, 'optionalAccess', _185 => _185.code]) === "ENOENT") {
9915
9944
  return;
@@ -9922,29 +9951,29 @@ var unlinkFixEPERMSync = (path22) => {
9922
9951
  throw er;
9923
9952
  }
9924
9953
  };
9925
- var rimrafMoveRemove = async (path22, opt) => {
9954
+ var rimrafMoveRemove = async (path25, opt) => {
9926
9955
  if (_optionalChain([opt, 'optionalAccess', _187 => _187.signal, 'optionalAccess', _188 => _188.aborted])) {
9927
9956
  throw opt.signal.reason;
9928
9957
  }
9929
9958
  try {
9930
- return await rimrafMoveRemoveDir(path22, opt, await lstat6(path22));
9959
+ return await rimrafMoveRemoveDir(path25, opt, await lstat6(path25));
9931
9960
  } catch (er) {
9932
9961
  if (_optionalChain([er, 'optionalAccess', _189 => _189.code]) === "ENOENT")
9933
9962
  return true;
9934
9963
  throw er;
9935
9964
  }
9936
9965
  };
9937
- var rimrafMoveRemoveDir = async (path22, opt, ent) => {
9966
+ var rimrafMoveRemoveDir = async (path25, opt, ent) => {
9938
9967
  if (_optionalChain([opt, 'optionalAccess', _190 => _190.signal, 'optionalAccess', _191 => _191.aborted])) {
9939
9968
  throw opt.signal.reason;
9940
9969
  }
9941
9970
  if (!opt.tmp) {
9942
- return rimrafMoveRemoveDir(path22, { ...opt, tmp: await defaultTmp(path22) }, ent);
9971
+ return rimrafMoveRemoveDir(path25, { ...opt, tmp: await defaultTmp(path25) }, ent);
9943
9972
  }
9944
- if (path22 === opt.tmp && _path.parse.call(void 0, path22).root !== path22) {
9973
+ if (path25 === opt.tmp && _path.parse.call(void 0, path25).root !== path25) {
9945
9974
  throw new Error("cannot delete temp directory used for deletion");
9946
9975
  }
9947
- const entries = ent.isDirectory() ? await readdirOrError(path22) : null;
9976
+ const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
9948
9977
  if (!Array.isArray(entries)) {
9949
9978
  if (entries) {
9950
9979
  if (entries.code === "ENOENT") {
@@ -9954,54 +9983,54 @@ var rimrafMoveRemoveDir = async (path22, opt, ent) => {
9954
9983
  throw entries;
9955
9984
  }
9956
9985
  }
9957
- if (opt.filter && !await opt.filter(path22, ent)) {
9986
+ if (opt.filter && !await opt.filter(path25, ent)) {
9958
9987
  return false;
9959
9988
  }
9960
- await ignoreENOENT(tmpUnlink(path22, opt.tmp, unlinkFixEPERM));
9989
+ await ignoreENOENT(tmpUnlink(path25, opt.tmp, unlinkFixEPERM));
9961
9990
  return true;
9962
9991
  }
9963
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(_path.resolve.call(void 0, path22, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
9992
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
9964
9993
  if (!removedAll) {
9965
9994
  return false;
9966
9995
  }
9967
- if (opt.preserveRoot === false && path22 === _path.parse.call(void 0, path22).root) {
9996
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
9968
9997
  return false;
9969
9998
  }
9970
- if (opt.filter && !await opt.filter(path22, ent)) {
9999
+ if (opt.filter && !await opt.filter(path25, ent)) {
9971
10000
  return false;
9972
10001
  }
9973
- await ignoreENOENT(tmpUnlink(path22, opt.tmp, rmdir3));
10002
+ await ignoreENOENT(tmpUnlink(path25, opt.tmp, rmdir3));
9974
10003
  return true;
9975
10004
  };
9976
- var tmpUnlink = async (path22, tmp, rm3) => {
9977
- const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path22));
9978
- await rename2(path22, tmpFile);
10005
+ var tmpUnlink = async (path25, tmp, rm3) => {
10006
+ const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path25));
10007
+ await rename2(path25, tmpFile);
9979
10008
  return await rm3(tmpFile);
9980
10009
  };
9981
- var rimrafMoveRemoveSync = (path22, opt) => {
10010
+ var rimrafMoveRemoveSync = (path25, opt) => {
9982
10011
  if (_optionalChain([opt, 'optionalAccess', _192 => _192.signal, 'optionalAccess', _193 => _193.aborted])) {
9983
10012
  throw opt.signal.reason;
9984
10013
  }
9985
10014
  try {
9986
- return rimrafMoveRemoveDirSync(path22, opt, _fs.lstatSync.call(void 0, path22));
10015
+ return rimrafMoveRemoveDirSync(path25, opt, _fs.lstatSync.call(void 0, path25));
9987
10016
  } catch (er) {
9988
10017
  if (_optionalChain([er, 'optionalAccess', _194 => _194.code]) === "ENOENT")
9989
10018
  return true;
9990
10019
  throw er;
9991
10020
  }
9992
10021
  };
9993
- var rimrafMoveRemoveDirSync = (path22, opt, ent) => {
10022
+ var rimrafMoveRemoveDirSync = (path25, opt, ent) => {
9994
10023
  if (_optionalChain([opt, 'optionalAccess', _195 => _195.signal, 'optionalAccess', _196 => _196.aborted])) {
9995
10024
  throw opt.signal.reason;
9996
10025
  }
9997
10026
  if (!opt.tmp) {
9998
- return rimrafMoveRemoveDirSync(path22, { ...opt, tmp: defaultTmpSync(path22) }, ent);
10027
+ return rimrafMoveRemoveDirSync(path25, { ...opt, tmp: defaultTmpSync(path25) }, ent);
9999
10028
  }
10000
10029
  const tmp = opt.tmp;
10001
- if (path22 === opt.tmp && _path.parse.call(void 0, path22).root !== path22) {
10030
+ if (path25 === opt.tmp && _path.parse.call(void 0, path25).root !== path25) {
10002
10031
  throw new Error("cannot delete temp directory used for deletion");
10003
10032
  }
10004
- const entries = ent.isDirectory() ? readdirOrErrorSync(path22) : null;
10033
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
10005
10034
  if (!Array.isArray(entries)) {
10006
10035
  if (entries) {
10007
10036
  if (entries.code === "ENOENT") {
@@ -10011,32 +10040,32 @@ var rimrafMoveRemoveDirSync = (path22, opt, ent) => {
10011
10040
  throw entries;
10012
10041
  }
10013
10042
  }
10014
- if (opt.filter && !opt.filter(path22, ent)) {
10043
+ if (opt.filter && !opt.filter(path25, ent)) {
10015
10044
  return false;
10016
10045
  }
10017
- ignoreENOENTSync(() => tmpUnlinkSync(path22, tmp, unlinkFixEPERMSync));
10046
+ ignoreENOENTSync(() => tmpUnlinkSync(path25, tmp, unlinkFixEPERMSync));
10018
10047
  return true;
10019
10048
  }
10020
10049
  let removedAll = true;
10021
10050
  for (const ent2 of entries) {
10022
- const p = _path.resolve.call(void 0, path22, ent2.name);
10051
+ const p = _path.resolve.call(void 0, path25, ent2.name);
10023
10052
  removedAll = rimrafMoveRemoveDirSync(p, opt, ent2) && removedAll;
10024
10053
  }
10025
10054
  if (!removedAll) {
10026
10055
  return false;
10027
10056
  }
10028
- if (opt.preserveRoot === false && path22 === _path.parse.call(void 0, path22).root) {
10057
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
10029
10058
  return false;
10030
10059
  }
10031
- if (opt.filter && !opt.filter(path22, ent)) {
10060
+ if (opt.filter && !opt.filter(path25, ent)) {
10032
10061
  return false;
10033
10062
  }
10034
- ignoreENOENTSync(() => tmpUnlinkSync(path22, tmp, _fs.rmdirSync));
10063
+ ignoreENOENTSync(() => tmpUnlinkSync(path25, tmp, _fs.rmdirSync));
10035
10064
  return true;
10036
10065
  };
10037
- var tmpUnlinkSync = (path22, tmp, rmSync2) => {
10038
- const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path22));
10039
- _fs.renameSync.call(void 0, path22, tmpFile);
10066
+ var tmpUnlinkSync = (path25, tmp, rmSync2) => {
10067
+ const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path25));
10068
+ _fs.renameSync.call(void 0, path25, tmpFile);
10040
10069
  return rmSync2(tmpFile);
10041
10070
  };
10042
10071
 
@@ -10046,31 +10075,31 @@ var rimrafWindowsFile = retryBusy(fixEPERM(unlink4));
10046
10075
  var rimrafWindowsFileSync = retryBusySync(fixEPERMSync(_fs.unlinkSync));
10047
10076
  var rimrafWindowsDirRetry = retryBusy(fixEPERM(rmdir4));
10048
10077
  var rimrafWindowsDirRetrySync = retryBusySync(fixEPERMSync(_fs.rmdirSync));
10049
- var rimrafWindowsDirMoveRemoveFallback = async (path22, opt) => {
10078
+ var rimrafWindowsDirMoveRemoveFallback = async (path25, opt) => {
10050
10079
  if (_optionalChain([opt, 'optionalAccess', _197 => _197.signal, 'optionalAccess', _198 => _198.aborted])) {
10051
10080
  throw opt.signal.reason;
10052
10081
  }
10053
10082
  const { filter: filter3, ...options } = opt;
10054
10083
  try {
10055
- return await rimrafWindowsDirRetry(path22, options);
10084
+ return await rimrafWindowsDirRetry(path25, options);
10056
10085
  } catch (er) {
10057
10086
  if (_optionalChain([er, 'optionalAccess', _199 => _199.code]) === "ENOTEMPTY") {
10058
- return await rimrafMoveRemove(path22, options);
10087
+ return await rimrafMoveRemove(path25, options);
10059
10088
  }
10060
10089
  throw er;
10061
10090
  }
10062
10091
  };
10063
- var rimrafWindowsDirMoveRemoveFallbackSync = (path22, opt) => {
10092
+ var rimrafWindowsDirMoveRemoveFallbackSync = (path25, opt) => {
10064
10093
  if (_optionalChain([opt, 'optionalAccess', _200 => _200.signal, 'optionalAccess', _201 => _201.aborted])) {
10065
10094
  throw opt.signal.reason;
10066
10095
  }
10067
10096
  const { filter: filter3, ...options } = opt;
10068
10097
  try {
10069
- return rimrafWindowsDirRetrySync(path22, options);
10098
+ return rimrafWindowsDirRetrySync(path25, options);
10070
10099
  } catch (er) {
10071
10100
  const fer = er;
10072
10101
  if (_optionalChain([fer, 'optionalAccess', _202 => _202.code]) === "ENOTEMPTY") {
10073
- return rimrafMoveRemoveSync(path22, options);
10102
+ return rimrafMoveRemoveSync(path25, options);
10074
10103
  }
10075
10104
  throw er;
10076
10105
  }
@@ -10078,35 +10107,35 @@ var rimrafWindowsDirMoveRemoveFallbackSync = (path22, opt) => {
10078
10107
  var START = Symbol("start");
10079
10108
  var CHILD = Symbol("child");
10080
10109
  var FINISH = Symbol("finish");
10081
- var rimrafWindows = async (path22, opt) => {
10110
+ var rimrafWindows = async (path25, opt) => {
10082
10111
  if (_optionalChain([opt, 'optionalAccess', _203 => _203.signal, 'optionalAccess', _204 => _204.aborted])) {
10083
10112
  throw opt.signal.reason;
10084
10113
  }
10085
10114
  try {
10086
- return await rimrafWindowsDir(path22, opt, await lstat7(path22), START);
10115
+ return await rimrafWindowsDir(path25, opt, await lstat7(path25), START);
10087
10116
  } catch (er) {
10088
10117
  if (_optionalChain([er, 'optionalAccess', _205 => _205.code]) === "ENOENT")
10089
10118
  return true;
10090
10119
  throw er;
10091
10120
  }
10092
10121
  };
10093
- var rimrafWindowsSync = (path22, opt) => {
10122
+ var rimrafWindowsSync = (path25, opt) => {
10094
10123
  if (_optionalChain([opt, 'optionalAccess', _206 => _206.signal, 'optionalAccess', _207 => _207.aborted])) {
10095
10124
  throw opt.signal.reason;
10096
10125
  }
10097
10126
  try {
10098
- return rimrafWindowsDirSync(path22, opt, _fs.lstatSync.call(void 0, path22), START);
10127
+ return rimrafWindowsDirSync(path25, opt, _fs.lstatSync.call(void 0, path25), START);
10099
10128
  } catch (er) {
10100
10129
  if (_optionalChain([er, 'optionalAccess', _208 => _208.code]) === "ENOENT")
10101
10130
  return true;
10102
10131
  throw er;
10103
10132
  }
10104
10133
  };
10105
- var rimrafWindowsDir = async (path22, opt, ent, state = START) => {
10134
+ var rimrafWindowsDir = async (path25, opt, ent, state = START) => {
10106
10135
  if (_optionalChain([opt, 'optionalAccess', _209 => _209.signal, 'optionalAccess', _210 => _210.aborted])) {
10107
10136
  throw opt.signal.reason;
10108
10137
  }
10109
- const entries = ent.isDirectory() ? await readdirOrError(path22) : null;
10138
+ const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
10110
10139
  if (!Array.isArray(entries)) {
10111
10140
  if (entries) {
10112
10141
  if (entries.code === "ENOENT") {
@@ -10116,32 +10145,32 @@ var rimrafWindowsDir = async (path22, opt, ent, state = START) => {
10116
10145
  throw entries;
10117
10146
  }
10118
10147
  }
10119
- if (opt.filter && !await opt.filter(path22, ent)) {
10148
+ if (opt.filter && !await opt.filter(path25, ent)) {
10120
10149
  return false;
10121
10150
  }
10122
- await ignoreENOENT(rimrafWindowsFile(path22, opt));
10151
+ await ignoreENOENT(rimrafWindowsFile(path25, opt));
10123
10152
  return true;
10124
10153
  }
10125
10154
  const s = state === START ? CHILD : state;
10126
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(_path.resolve.call(void 0, path22, ent2.name), opt, ent2, s)))).reduce((a, b) => a && b, true);
10155
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2, s)))).reduce((a, b) => a && b, true);
10127
10156
  if (state === START) {
10128
- return rimrafWindowsDir(path22, opt, ent, FINISH);
10157
+ return rimrafWindowsDir(path25, opt, ent, FINISH);
10129
10158
  } else if (state === FINISH) {
10130
- if (opt.preserveRoot === false && path22 === _path.parse.call(void 0, path22).root) {
10159
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
10131
10160
  return false;
10132
10161
  }
10133
10162
  if (!removedAll) {
10134
10163
  return false;
10135
10164
  }
10136
- if (opt.filter && !await opt.filter(path22, ent)) {
10165
+ if (opt.filter && !await opt.filter(path25, ent)) {
10137
10166
  return false;
10138
10167
  }
10139
- await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path22, opt));
10168
+ await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path25, opt));
10140
10169
  }
10141
10170
  return true;
10142
10171
  };
10143
- var rimrafWindowsDirSync = (path22, opt, ent, state = START) => {
10144
- const entries = ent.isDirectory() ? readdirOrErrorSync(path22) : null;
10172
+ var rimrafWindowsDirSync = (path25, opt, ent, state = START) => {
10173
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
10145
10174
  if (!Array.isArray(entries)) {
10146
10175
  if (entries) {
10147
10176
  if (entries.code === "ENOENT") {
@@ -10151,32 +10180,32 @@ var rimrafWindowsDirSync = (path22, opt, ent, state = START) => {
10151
10180
  throw entries;
10152
10181
  }
10153
10182
  }
10154
- if (opt.filter && !opt.filter(path22, ent)) {
10183
+ if (opt.filter && !opt.filter(path25, ent)) {
10155
10184
  return false;
10156
10185
  }
10157
- ignoreENOENTSync(() => rimrafWindowsFileSync(path22, opt));
10186
+ ignoreENOENTSync(() => rimrafWindowsFileSync(path25, opt));
10158
10187
  return true;
10159
10188
  }
10160
10189
  let removedAll = true;
10161
10190
  for (const ent2 of entries) {
10162
10191
  const s = state === START ? CHILD : state;
10163
- const p = _path.resolve.call(void 0, path22, ent2.name);
10192
+ const p = _path.resolve.call(void 0, path25, ent2.name);
10164
10193
  removedAll = rimrafWindowsDirSync(p, opt, ent2, s) && removedAll;
10165
10194
  }
10166
10195
  if (state === START) {
10167
- return rimrafWindowsDirSync(path22, opt, ent, FINISH);
10196
+ return rimrafWindowsDirSync(path25, opt, ent, FINISH);
10168
10197
  } else if (state === FINISH) {
10169
- if (opt.preserveRoot === false && path22 === _path.parse.call(void 0, path22).root) {
10198
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
10170
10199
  return false;
10171
10200
  }
10172
10201
  if (!removedAll) {
10173
10202
  return false;
10174
10203
  }
10175
- if (opt.filter && !opt.filter(path22, ent)) {
10204
+ if (opt.filter && !opt.filter(path25, ent)) {
10176
10205
  return false;
10177
10206
  }
10178
10207
  ignoreENOENTSync(() => {
10179
- rimrafWindowsDirMoveRemoveFallbackSync(path22, opt);
10208
+ rimrafWindowsDirMoveRemoveFallbackSync(path25, opt);
10180
10209
  });
10181
10210
  }
10182
10211
  return true;
@@ -10189,16 +10218,16 @@ var rimrafManualSync = platform_default === "win32" ? rimrafWindowsSync : rimraf
10189
10218
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-native.js
10190
10219
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
10191
10220
  var { rm: rm2 } = promises;
10192
- var rimrafNative = async (path22, opt) => {
10193
- await rm2(path22, {
10221
+ var rimrafNative = async (path25, opt) => {
10222
+ await rm2(path25, {
10194
10223
  ...opt,
10195
10224
  force: true,
10196
10225
  recursive: true
10197
10226
  });
10198
10227
  return true;
10199
10228
  };
10200
- var rimrafNativeSync = (path22, opt) => {
10201
- _fs.rmSync.call(void 0, path22, {
10229
+ var rimrafNativeSync = (path25, opt) => {
10230
+ _fs.rmSync.call(void 0, path25, {
10202
10231
  ...opt,
10203
10232
  force: true,
10204
10233
  recursive: true
@@ -10216,26 +10245,26 @@ var useNative = !hasNative || platform_default === "win32" ? () => false : (opt)
10216
10245
  var useNativeSync = !hasNative || platform_default === "win32" ? () => false : (opt) => !_optionalChain([opt, 'optionalAccess', _213 => _213.signal]) && !_optionalChain([opt, 'optionalAccess', _214 => _214.filter]);
10217
10246
 
10218
10247
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/index.js
10219
- var wrap = (fn) => async (path22, opt) => {
10248
+ var wrap = (fn) => async (path25, opt) => {
10220
10249
  const options = optArg(opt);
10221
10250
  if (options.glob) {
10222
- path22 = await glob(path22, options.glob);
10251
+ path25 = await glob(path25, options.glob);
10223
10252
  }
10224
- if (Array.isArray(path22)) {
10225
- return !!(await Promise.all(path22.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
10253
+ if (Array.isArray(path25)) {
10254
+ return !!(await Promise.all(path25.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
10226
10255
  } else {
10227
- return !!await fn(path_arg_default(path22, options), options);
10256
+ return !!await fn(path_arg_default(path25, options), options);
10228
10257
  }
10229
10258
  };
10230
- var wrapSync = (fn) => (path22, opt) => {
10259
+ var wrapSync = (fn) => (path25, opt) => {
10231
10260
  const options = optArgSync(opt);
10232
10261
  if (options.glob) {
10233
- path22 = globSync(path22, options.glob);
10262
+ path25 = globSync(path25, options.glob);
10234
10263
  }
10235
- if (Array.isArray(path22)) {
10236
- return !!path22.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
10264
+ if (Array.isArray(path25)) {
10265
+ return !!path25.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
10237
10266
  } else {
10238
- return !!fn(path_arg_default(path22, options), options);
10267
+ return !!fn(path_arg_default(path25, options), options);
10239
10268
  }
10240
10269
  };
10241
10270
  var nativeSync = wrapSync(rimrafNativeSync);
@@ -10250,8 +10279,8 @@ var moveRemoveSync = wrapSync(rimrafMoveRemoveSync);
10250
10279
  var moveRemove = Object.assign(wrap(rimrafMoveRemove), {
10251
10280
  sync: moveRemoveSync
10252
10281
  });
10253
- var rimrafSync = wrapSync((path22, opt) => useNativeSync(opt) ? rimrafNativeSync(path22, opt) : rimrafManualSync(path22, opt));
10254
- var rimraf_ = wrap((path22, opt) => useNative(opt) ? rimrafNative(path22, opt) : rimrafManual(path22, opt));
10282
+ var rimrafSync = wrapSync((path25, opt) => useNativeSync(opt) ? rimrafNativeSync(path25, opt) : rimrafManualSync(path25, opt));
10283
+ var rimraf_ = wrap((path25, opt) => useNative(opt) ? rimrafNative(path25, opt) : rimrafManual(path25, opt));
10255
10284
  var rimraf = Object.assign(rimraf_, {
10256
10285
  rimraf: rimraf_,
10257
10286
  sync: rimrafSync,
@@ -16125,17 +16154,17 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
16125
16154
  if (hasTrailingSlash(input, true)) {
16126
16155
  return input || "/";
16127
16156
  }
16128
- let path22 = input;
16157
+ let path25 = input;
16129
16158
  let fragment = "";
16130
16159
  const fragmentIndex = input.indexOf("#");
16131
16160
  if (fragmentIndex !== -1) {
16132
- path22 = input.slice(0, fragmentIndex);
16161
+ path25 = input.slice(0, fragmentIndex);
16133
16162
  fragment = input.slice(fragmentIndex);
16134
- if (!path22) {
16163
+ if (!path25) {
16135
16164
  return fragment;
16136
16165
  }
16137
16166
  }
16138
- const [s0, ...s] = path22.split("?");
16167
+ const [s0, ...s] = path25.split("?");
16139
16168
  return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
16140
16169
  }
16141
16170
  function isNonEmptyURL(url) {
@@ -16164,8 +16193,8 @@ var _assert = require('assert'); var _assert2 = _interopRequireDefault(_assert);
16164
16193
  var _v8 = require('v8'); var _v82 = _interopRequireDefault(_v8);
16165
16194
 
16166
16195
  var BUILTIN_MODULES = new Set(_module.builtinModules);
16167
- function normalizeSlash(path22) {
16168
- return path22.replace(/\\/g, "/");
16196
+ function normalizeSlash(path25) {
16197
+ return path25.replace(/\\/g, "/");
16169
16198
  }
16170
16199
  var own$1 = {}.hasOwnProperty;
16171
16200
  var classRegExp = /^([A-Z][a-z\d]*)+$/;
@@ -16278,8 +16307,8 @@ codes2.ERR_INVALID_PACKAGE_CONFIG = createError(
16278
16307
  * @param {string} [base]
16279
16308
  * @param {string} [message]
16280
16309
  */
16281
- (path22, base, message) => {
16282
- return `Invalid package config ${path22}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
16310
+ (path25, base, message) => {
16311
+ return `Invalid package config ${path25}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
16283
16312
  },
16284
16313
  Error
16285
16314
  );
@@ -16311,8 +16340,8 @@ codes2.ERR_MODULE_NOT_FOUND = createError(
16311
16340
  * @param {string} base
16312
16341
  * @param {boolean} [exactUrl]
16313
16342
  */
16314
- (path22, base, exactUrl = false) => {
16315
- return `Cannot find ${exactUrl ? "module" : "package"} '${path22}' imported from ${base}`;
16343
+ (path25, base, exactUrl = false) => {
16344
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path25}' imported from ${base}`;
16316
16345
  },
16317
16346
  Error
16318
16347
  );
@@ -16363,8 +16392,8 @@ codes2.ERR_UNKNOWN_FILE_EXTENSION = createError(
16363
16392
  * @param {string} extension
16364
16393
  * @param {string} path
16365
16394
  */
16366
- (extension, path22) => {
16367
- return `Unknown file extension "${extension}" for ${path22}`;
16395
+ (extension, path25) => {
16396
+ return `Unknown file extension "${extension}" for ${path25}`;
16368
16397
  },
16369
16398
  TypeError
16370
16399
  );
@@ -16428,7 +16457,7 @@ function isErrorStackTraceLimitWritable() {
16428
16457
  if (_v82.default.startupSnapshot.isBuildingSnapshot()) {
16429
16458
  return false;
16430
16459
  }
16431
- } catch (e4) {
16460
+ } catch (e5) {
16432
16461
  }
16433
16462
  const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
16434
16463
  if (desc === void 0) {
@@ -16735,10 +16764,10 @@ Default "index" lookups for the main are deprecated for ES modules.`,
16735
16764
  );
16736
16765
  }
16737
16766
  }
16738
- function tryStatSync(path22) {
16767
+ function tryStatSync(path25) {
16739
16768
  try {
16740
- return _fs.statSync.call(void 0, path22);
16741
- } catch (e5) {
16769
+ return _fs.statSync.call(void 0, path25);
16770
+ } catch (e6) {
16742
16771
  }
16743
16772
  }
16744
16773
  function fileExists(url) {
@@ -16878,7 +16907,7 @@ function resolvePackageTargetString(target, subpath, match2, packageJsonUrl, bas
16878
16907
  try {
16879
16908
  new (0, _url.URL)(target);
16880
16909
  isURL = true;
16881
- } catch (e6) {
16910
+ } catch (e7) {
16882
16911
  }
16883
16912
  if (!isURL) {
16884
16913
  const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call(
@@ -17624,7 +17653,7 @@ async function findUp$1(name, {
17624
17653
  if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) {
17625
17654
  return filePath;
17626
17655
  }
17627
- } catch (e7) {
17656
+ } catch (e8) {
17628
17657
  }
17629
17658
  if (directory === stopAt || directory === root) {
17630
17659
  break;
@@ -17648,7 +17677,7 @@ function findUpSync(name, {
17648
17677
  if (type === "file" && _optionalChain([stats, 'optionalAccess', _233 => _233.isFile, 'call', _234 => _234()]) || type === "directory" && _optionalChain([stats, 'optionalAccess', _235 => _235.isDirectory, 'call', _236 => _236()])) {
17649
17678
  return filePath;
17650
17679
  }
17651
- } catch (e8) {
17680
+ } catch (e9) {
17652
17681
  }
17653
17682
  if (directory === stopAt || directory === root) {
17654
17683
  break;
@@ -17656,7 +17685,7 @@ function findUpSync(name, {
17656
17685
  directory = sysPath2.default.dirname(directory);
17657
17686
  }
17658
17687
  }
17659
- function _resolve2(path22, options = {}) {
17688
+ function _resolve2(path25, options = {}) {
17660
17689
  if (options.platform === "auto" || !options.platform)
17661
17690
  options.platform = _process2.default.platform === "win32" ? "win32" : "posix";
17662
17691
  if (_process2.default.versions.pnp) {
@@ -17665,11 +17694,11 @@ function _resolve2(path22, options = {}) {
17665
17694
  paths.push(_process2.default.cwd());
17666
17695
  const targetRequire = _module.createRequire.call(void 0, _chunkOS76JPG2cjs.importMetaUrl);
17667
17696
  try {
17668
- return targetRequire.resolve(path22, { paths });
17669
- } catch (e9) {
17697
+ return targetRequire.resolve(path25, { paths });
17698
+ } catch (e10) {
17670
17699
  }
17671
17700
  }
17672
- const modulePath = resolvePathSync(path22, {
17701
+ const modulePath = resolvePathSync(path25, {
17673
17702
  url: options.paths
17674
17703
  });
17675
17704
  if (options.platform === "win32")
@@ -17679,7 +17708,7 @@ function _resolve2(path22, options = {}) {
17679
17708
  function resolveModule(name, options = {}) {
17680
17709
  try {
17681
17710
  return _resolve2(name, options);
17682
- } catch (e10) {
17711
+ } catch (e11) {
17683
17712
  return void 0;
17684
17713
  }
17685
17714
  }
@@ -17710,7 +17739,7 @@ var getPackageInfoSync = getPackageInfo.sync;
17710
17739
  function resolvePackage(name, options = {}) {
17711
17740
  try {
17712
17741
  return _resolve2(`${name}/package.json`, options);
17713
- } catch (e11) {
17742
+ } catch (e12) {
17714
17743
  }
17715
17744
  try {
17716
17745
  return _resolve2(name, options);
@@ -17740,10 +17769,10 @@ var findUp = quansync2({
17740
17769
  async: findUp$1
17741
17770
  });
17742
17771
  var loadPackageJSON = quansync2(function* (cwd = _process2.default.cwd()) {
17743
- const path22 = yield findUp("package.json", { cwd });
17744
- if (!path22 || !actualFS.default.existsSync(path22))
17772
+ const path25 = yield findUp("package.json", { cwd });
17773
+ if (!path25 || !actualFS.default.existsSync(path25))
17745
17774
  return null;
17746
- return JSON.parse(yield readFile(path22));
17775
+ return JSON.parse(yield readFile(path25));
17747
17776
  });
17748
17777
  var loadPackageJSONSync = loadPackageJSON.sync;
17749
17778
  var isPackageListed = quansync2(function* (name, cwd) {
@@ -17796,11 +17825,11 @@ var INSTALL_METADATA = {
17796
17825
  };
17797
17826
 
17798
17827
  // ../../node_modules/.pnpm/package-manager-detector@1.4.0/node_modules/package-manager-detector/dist/detect.mjs
17799
- async function pathExists(path22, type) {
17828
+ async function pathExists(path25, type) {
17800
17829
  try {
17801
- const stat6 = await _promises2.default.stat(path22);
17830
+ const stat6 = await _promises2.default.stat(path25);
17802
17831
  return type === "file" ? stat6.isFile() : stat6.isDirectory();
17803
- } catch (e12) {
17832
+ } catch (e13) {
17804
17833
  return false;
17805
17834
  }
17806
17835
  }
@@ -17906,7 +17935,7 @@ async function handlePackageManager(filepath, onUnknown) {
17906
17935
  return _nullishCoalesce(_optionalChain([onUnknown, 'optionalCall', _244 => _244(pkg.packageManager)]), () => ( null));
17907
17936
  }
17908
17937
  }
17909
- } catch (e13) {
17938
+ } catch (e14) {
17910
17939
  }
17911
17940
  return null;
17912
17941
  }
@@ -19653,7 +19682,7 @@ function createEntryLoader(options) {
19653
19682
  const jsonEntry = await findJsonEntry(id);
19654
19683
  let jsonPath = jsonEntry.path;
19655
19684
  for (const prediction of jsonEntry.predictions) {
19656
- this.addWatchFile(prediction);
19685
+ await addWatchTarget(this, prediction);
19657
19686
  }
19658
19687
  let json = {};
19659
19688
  if (jsonPath) {
@@ -19733,7 +19762,7 @@ async function collectAppSideFiles(pluginCtx, id, json, jsonService, registerJso
19733
19762
  _pathe2.default.resolve(_pathe2.default.dirname(id), location)
19734
19763
  );
19735
19764
  for (const prediction of predictions) {
19736
- pluginCtx.addWatchFile(prediction);
19765
+ await addWatchTarget(pluginCtx, prediction);
19737
19766
  }
19738
19767
  if (!jsonPath) {
19739
19768
  return;
@@ -19751,7 +19780,7 @@ async function collectAppSideFiles(pluginCtx, id, json, jsonService, registerJso
19751
19780
  async function ensureTemplateScanned(pluginCtx, id, scanTemplateEntry) {
19752
19781
  const { path: templateEntry, predictions } = await findTemplateEntry(id);
19753
19782
  for (const prediction of predictions) {
19754
- pluginCtx.addWatchFile(prediction);
19783
+ await addWatchTarget(pluginCtx, prediction);
19755
19784
  }
19756
19785
  if (!templateEntry) {
19757
19786
  return "";
@@ -19773,13 +19802,23 @@ async function resolveEntries(entries, absoluteSrcRoot) {
19773
19802
  async function prependStyleImports(id, ms) {
19774
19803
  for (const ext2 of supportedCssLangs) {
19775
19804
  const mayBeCssPath = changeFileExtension(id, ext2);
19776
- this.addWatchFile(mayBeCssPath);
19777
- if (await _fsextra2.default.exists(mayBeCssPath)) {
19805
+ const exists = await addWatchTarget(this, mayBeCssPath);
19806
+ if (exists) {
19778
19807
  ms.prepend(`import '${mayBeCssPath}';
19779
19808
  `);
19780
19809
  }
19781
19810
  }
19782
19811
  }
19812
+ async function addWatchTarget(pluginCtx, target) {
19813
+ if (!target || typeof pluginCtx.addWatchFile !== "function") {
19814
+ return false;
19815
+ }
19816
+ const exists = await _fsextra2.default.exists(target);
19817
+ if (exists) {
19818
+ pluginCtx.addWatchFile(target);
19819
+ }
19820
+ return exists;
19821
+ }
19783
19822
 
19784
19823
  // src/plugins/hooks/useLoadEntry/normalizer.ts
19785
19824
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
@@ -19897,6 +19936,88 @@ function collectRequireTokens(ast) {
19897
19936
  };
19898
19937
  }
19899
19938
 
19939
+ // src/plugins/utils/invalidateEntry.ts
19940
+ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
19941
+
19942
+
19943
+
19944
+ var watchedCssExts = new Set(supportedCssLangs.map((ext2) => `.${ext2}`));
19945
+ var configSuffixes = configExtensions.map((ext2) => `.${ext2}`);
19946
+ var sidecarSuffixes = [...configSuffixes, ...watchedCssExts];
19947
+ var supportsRecursiveWatch = _process2.default.platform === "darwin" || _process2.default.platform === "win32";
19948
+ async function invalidateEntryForSidecar(filePath) {
19949
+ const configSuffix = configSuffixes.find((suffix) => filePath.endsWith(suffix));
19950
+ const ext2 = _pathe2.default.extname(filePath);
19951
+ let scriptBasePath;
19952
+ if (configSuffix) {
19953
+ scriptBasePath = filePath.slice(0, -configSuffix.length);
19954
+ } else if (ext2 && watchedCssExts.has(ext2)) {
19955
+ scriptBasePath = filePath.slice(0, -ext2.length);
19956
+ }
19957
+ if (!scriptBasePath) {
19958
+ return;
19959
+ }
19960
+ const { path: scriptPath } = await findJsEntry(scriptBasePath);
19961
+ if (!scriptPath) {
19962
+ return;
19963
+ }
19964
+ await touch(scriptPath);
19965
+ }
19966
+ function ensureSidecarWatcher(ctx, rootDir) {
19967
+ if (!ctx.configService.isDev || !rootDir || _process2.default.env.VITEST === "true" || _process2.default.env.NODE_ENV === "test") {
19968
+ return;
19969
+ }
19970
+ const { sidecarWatcherMap } = ctx.runtimeState.watcher;
19971
+ const absRoot = _pathe2.default.normalize(rootDir);
19972
+ if (!actualFS.default.existsSync(absRoot)) {
19973
+ return;
19974
+ }
19975
+ if (sidecarWatcherMap.has(absRoot)) {
19976
+ return;
19977
+ }
19978
+ const handleSidecarChange = (filePath) => {
19979
+ if (!isSidecarFile(filePath)) {
19980
+ return;
19981
+ }
19982
+ void invalidateEntryForSidecar(filePath);
19983
+ };
19984
+ if (supportsRecursiveWatch) {
19985
+ const watcher2 = actualFS.default.watch(absRoot, { recursive: true }, (_event, filename) => {
19986
+ if (!filename) {
19987
+ return;
19988
+ }
19989
+ const resolved = _pathe2.default.join(absRoot, filename.toString());
19990
+ handleSidecarChange(resolved);
19991
+ });
19992
+ sidecarWatcherMap.set(absRoot, {
19993
+ close: async () => {
19994
+ watcher2.close();
19995
+ }
19996
+ });
19997
+ return;
19998
+ }
19999
+ const patterns = [
20000
+ ...configExtensions.map((ext2) => _pathe2.default.join(absRoot, `**/*.${ext2}`)),
20001
+ ...supportedCssLangs.map((ext2) => _pathe2.default.join(absRoot, `**/*.${ext2}`))
20002
+ ];
20003
+ const watcher = esm_default.watch(patterns, {
20004
+ ignoreInitial: true,
20005
+ persistent: true,
20006
+ awaitWriteFinish: {
20007
+ stabilityThreshold: 100,
20008
+ pollInterval: 20
20009
+ }
20010
+ });
20011
+ watcher.on("add", handleSidecarChange);
20012
+ watcher.on("unlink", handleSidecarChange);
20013
+ sidecarWatcherMap.set(absRoot, {
20014
+ close: () => watcher.close()
20015
+ });
20016
+ }
20017
+ function isSidecarFile(filePath) {
20018
+ return sidecarSuffixes.some((suffix) => filePath.endsWith(suffix));
20019
+ }
20020
+
19900
20021
  // src/plugins/utils/parse.ts
19901
20022
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
19902
20023
  function parseRequest(id) {
@@ -19959,10 +20080,17 @@ function createCoreLifecyclePlugin(state) {
19959
20080
  enforce: "pre",
19960
20081
  buildStart() {
19961
20082
  loadedEntrySet.clear();
20083
+ if (configService.isDev) {
20084
+ const rootDir = subPackageMeta ? _pathe2.default.resolve(configService.absoluteSrcRoot, subPackageMeta.subPackage.root) : configService.absoluteSrcRoot;
20085
+ ensureSidecarWatcher(ctx, rootDir);
20086
+ }
19962
20087
  },
19963
- watchChange(id, change) {
20088
+ async watchChange(id, change) {
19964
20089
  const relativeSrc = configService.relativeAbsoluteSrcRoot(id);
19965
20090
  const relativeCwd = configService.relativeCwd(id);
20091
+ if (change.event === "create" || change.event === "delete") {
20092
+ await invalidateEntryForSidecar(id);
20093
+ }
19966
20094
  if (!subPackageMeta) {
19967
20095
  if (relativeSrc === "app.json" || relativeCwd === "project.config.json" || relativeCwd === "project.private.config.json") {
19968
20096
  scanService.markDirty();
@@ -20662,20 +20790,15 @@ function flatten(groups) {
20662
20790
  }, []);
20663
20791
  }
20664
20792
 
20665
- // src/runtime/configPlugin.ts
20666
- function createConfigService(ctx) {
20667
- const configState = ctx.runtimeState.config;
20668
- configState.packageInfo = getPackageInfoSync("weapp-vite");
20669
- const defineEnv = configState.defineEnv;
20670
- let packageManager = configState.packageManager;
20671
- let options = configState.options;
20672
- const oxcRuntimeInfo = getPackageInfoSync("@oxc-project/runtime");
20673
- const oxcRuntimeHelpersRoot = oxcRuntimeInfo ? _pathe2.default.resolve(oxcRuntimeInfo.rootPath, "src/helpers/esm") : void 0;
20674
- const NULL_BYTE = "\0";
20675
- const OXC_RUNTIME_HELPER_ALIAS = new RegExp(`^(?:${NULL_BYTE})?@oxc-project(?:/|\\+)runtime(?:@[^/]+)?/helpers/(.+)\\.js$`);
20676
- const FALLBACK_HELPER_PREFIX = `${NULL_BYTE}weapp-vite:oxc-helper:`;
20677
- const fallbackHelpers = {
20678
- objectWithoutProperties: `export default function _objectWithoutProperties(source, excluded) {
20793
+ // src/runtime/oxcRuntime.ts
20794
+ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
20795
+
20796
+
20797
+ var NULL_BYTE = "\0";
20798
+ var OXC_RUNTIME_HELPER_ALIAS = new RegExp(`^(?:${NULL_BYTE})?@oxc-project(?:/|\\+)runtime(?:@[^/]+)?/helpers/(.+)\\.js$`);
20799
+ var FALLBACK_HELPER_PREFIX = `${NULL_BYTE}weapp-vite:oxc-helper:`;
20800
+ var fallbackHelpers = {
20801
+ objectWithoutProperties: `export default function _objectWithoutProperties(source, excluded) {
20679
20802
  if (source == null) return {};
20680
20803
  var target = {};
20681
20804
  var sourceKeys = Object.keys(source);
@@ -20697,7 +20820,7 @@ function createConfigService(ctx) {
20697
20820
  }
20698
20821
  return target;
20699
20822
  }`,
20700
- objectSpread2: `function ownKeys(object, enumerableOnly) {
20823
+ objectSpread2: `function ownKeys(object, enumerableOnly) {
20701
20824
  var keys = Object.keys(object);
20702
20825
  if (Object.getOwnPropertySymbols) {
20703
20826
  var symbols = Object.getOwnPropertySymbols(object);
@@ -20730,13 +20853,25 @@ function _objectSpread2(target) {
20730
20853
  return target;
20731
20854
  }
20732
20855
  export default _objectSpread2;`
20856
+ };
20857
+ function getOxcHelperName(id) {
20858
+ OXC_RUNTIME_HELPER_ALIAS.lastIndex = 0;
20859
+ const match2 = OXC_RUNTIME_HELPER_ALIAS.exec(id);
20860
+ return _optionalChain([match2, 'optionalAccess', _293 => _293[1]]);
20861
+ }
20862
+ function createOxcRuntimeSupport() {
20863
+ const oxcRuntimeInfo = getPackageInfoSync("@oxc-project/runtime");
20864
+ const oxcRuntimeHelpersRoot = oxcRuntimeInfo ? _pathe2.default.resolve(oxcRuntimeInfo.rootPath, "src/helpers/esm") : void 0;
20865
+ const alias = {
20866
+ find: OXC_RUNTIME_HELPER_ALIAS,
20867
+ replacement: "@oxc-project/runtime/src/helpers/esm/$1.js"
20733
20868
  };
20734
- function getOxcHelperName(id) {
20735
- OXC_RUNTIME_HELPER_ALIAS.lastIndex = 0;
20736
- const match2 = OXC_RUNTIME_HELPER_ALIAS.exec(id);
20737
- return _optionalChain([match2, 'optionalAccess', _293 => _293[1]]);
20869
+ if (!oxcRuntimeHelpersRoot) {
20870
+ return {
20871
+ alias
20872
+ };
20738
20873
  }
20739
- const rolldownOxcRuntimePlugin = oxcRuntimeHelpersRoot ? {
20874
+ const rolldownPlugin = {
20740
20875
  name: "weapp-vite:rolldown-oxc-runtime",
20741
20876
  resolveId(source) {
20742
20877
  if (source.startsWith(NULL_BYTE)) {
@@ -20746,13 +20881,14 @@ export default _objectSpread2;`
20746
20881
  if (!helperName) {
20747
20882
  return null;
20748
20883
  }
20749
- if (!oxcRuntimeHelpersRoot) {
20884
+ const helpersRoot = oxcRuntimeHelpersRoot;
20885
+ if (!helpersRoot) {
20750
20886
  if (helperName in fallbackHelpers) {
20751
20887
  return `${FALLBACK_HELPER_PREFIX}${helperName}`;
20752
20888
  }
20753
20889
  return null;
20754
20890
  }
20755
- return _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
20891
+ return _pathe2.default.resolve(helpersRoot, `${helperName}.js`);
20756
20892
  },
20757
20893
  async load(id) {
20758
20894
  if (id.startsWith(FALLBACK_HELPER_PREFIX)) {
@@ -20765,12 +20901,10 @@ export default _objectSpread2;`
20765
20901
  }
20766
20902
  const helperName = getOxcHelperName(id);
20767
20903
  if (helperName) {
20768
- if (oxcRuntimeHelpersRoot) {
20769
- const helperPath = id.startsWith(NULL_BYTE) ? _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`) : id;
20770
- if (await _fsextra2.default.pathExists(helperPath)) {
20771
- console.warn("[weapp-vite] resolving oxc helper via Rolldown plugin:", helperName);
20772
- return _fsextra2.default.readFile(helperPath, "utf8");
20773
- }
20904
+ const helperPath = id.startsWith(NULL_BYTE) ? _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`) : id;
20905
+ if (await _fsextra2.default.pathExists(helperPath)) {
20906
+ console.warn("[weapp-vite] resolving oxc helper via Rolldown plugin:", helperName);
20907
+ return _fsextra2.default.readFile(helperPath, "utf8");
20774
20908
  }
20775
20909
  const fallback = fallbackHelpers[helperName];
20776
20910
  if (fallback) {
@@ -20779,7 +20913,81 @@ export default _objectSpread2;`
20779
20913
  }
20780
20914
  return null;
20781
20915
  }
20782
- } : void 0;
20916
+ };
20917
+ const vitePlugin = {
20918
+ name: "weapp-vite:oxc-runtime-helpers",
20919
+ enforce: "pre",
20920
+ resolveId(source) {
20921
+ if (source.startsWith(NULL_BYTE)) {
20922
+ return null;
20923
+ }
20924
+ if (source.includes("@oxc-project/runtime/helpers")) {
20925
+ console.warn("[weapp-vite] resolveId intercepted:", source);
20926
+ }
20927
+ const helperName = getOxcHelperName(source);
20928
+ if (helperName) {
20929
+ return _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
20930
+ }
20931
+ return null;
20932
+ },
20933
+ async load(id) {
20934
+ if (!id.startsWith(NULL_BYTE)) {
20935
+ return null;
20936
+ }
20937
+ const helperName = getOxcHelperName(id);
20938
+ if (!helperName) {
20939
+ return null;
20940
+ }
20941
+ const helperPath = _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
20942
+ console.warn("[weapp-vite] resolving oxc helper via Vite plugin:", helperName);
20943
+ return _fsextra2.default.readFile(helperPath, "utf8");
20944
+ }
20945
+ };
20946
+ return {
20947
+ alias,
20948
+ rolldownPlugin,
20949
+ vitePlugin
20950
+ };
20951
+ }
20952
+
20953
+ // src/runtime/packageAliases.ts
20954
+ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
20955
+
20956
+
20957
+ var SPECIAL_PACKAGE_ALIASES = [
20958
+ {
20959
+ packageName: "class-variance-authority",
20960
+ distEntry: "dist/index.js"
20961
+ }
20962
+ ];
20963
+ function resolveBuiltinPackageAliases() {
20964
+ const aliases = [];
20965
+ for (const { packageName, distEntry } of SPECIAL_PACKAGE_ALIASES) {
20966
+ const info = getPackageInfoSync(packageName);
20967
+ if (!info) {
20968
+ continue;
20969
+ }
20970
+ const resolvedEntry = _pathe2.default.resolve(info.rootPath, distEntry);
20971
+ if (!_fs.existsSync.call(void 0, resolvedEntry)) {
20972
+ continue;
20973
+ }
20974
+ aliases.push({
20975
+ find: packageName,
20976
+ replacement: resolvedEntry
20977
+ });
20978
+ }
20979
+ return aliases;
20980
+ }
20981
+
20982
+ // src/runtime/configPlugin.ts
20983
+ function createConfigService(ctx) {
20984
+ const configState = ctx.runtimeState.config;
20985
+ configState.packageInfo = getPackageInfoSync("weapp-vite");
20986
+ const defineEnv = configState.defineEnv;
20987
+ let packageManager = configState.packageManager;
20988
+ let options = configState.options;
20989
+ const builtinPackageAliases = resolveBuiltinPackageAliases();
20990
+ const oxcRuntimeSupport = createOxcRuntimeSupport();
20783
20991
  function normalizeAliasOptions(alias) {
20784
20992
  if (!alias) {
20785
20993
  return [];
@@ -20793,16 +21001,9 @@ export default _objectSpread2;`
20793
21001
  return { find, replacement };
20794
21002
  });
20795
21003
  }
20796
- function injectOxcRuntimeAlias(config) {
21004
+ function injectBuiltinAliases(config) {
20797
21005
  const resolve8 = _nullishCoalesce(config.resolve, () => ( (config.resolve = {})));
20798
- const aliasEntry = {
20799
- find: OXC_RUNTIME_HELPER_ALIAS,
20800
- replacement: "@oxc-project/runtime/src/helpers/esm/$1.js"
20801
- };
20802
- const cvaAliasEntry = {
20803
- find: "class-variance-authority",
20804
- replacement: "class-variance-authority/dist/index.js"
20805
- };
21006
+ const aliasEntry = oxcRuntimeSupport.alias;
20806
21007
  const aliasArray = normalizeAliasOptions(resolve8.alias);
20807
21008
  const hasAlias = aliasArray.some((entry) => {
20808
21009
  return entry.find instanceof RegExp && entry.find.source === aliasEntry.find.source;
@@ -20810,9 +21011,11 @@ export default _objectSpread2;`
20810
21011
  if (!hasAlias) {
20811
21012
  aliasArray.unshift(aliasEntry);
20812
21013
  }
20813
- const hasCvaAlias = aliasArray.some((entry) => typeof entry.find === "string" && entry.find === cvaAliasEntry.find);
20814
- if (!hasCvaAlias) {
20815
- aliasArray.unshift(cvaAliasEntry);
21014
+ for (const builtinAlias of builtinPackageAliases) {
21015
+ const hasAliasEntry = aliasArray.some((entry) => typeof entry.find === "string" && entry.find === builtinAlias.find);
21016
+ if (!hasAliasEntry) {
21017
+ aliasArray.unshift(builtinAlias);
21018
+ }
20816
21019
  }
20817
21020
  resolve8.alias = aliasArray;
20818
21021
  }
@@ -20886,55 +21089,23 @@ export default _objectSpread2;`
20886
21089
  weapp: getWeappViteConfig()
20887
21090
  }
20888
21091
  );
20889
- if (rolldownOxcRuntimePlugin) {
21092
+ const rolldownPlugin = oxcRuntimeSupport.rolldownPlugin;
21093
+ if (rolldownPlugin) {
20890
21094
  const build3 = _nullishCoalesce(config.build, () => ( (config.build = {})));
20891
21095
  const rdOptions = _nullishCoalesce(build3.rolldownOptions, () => ( (build3.rolldownOptions = {})));
20892
21096
  const rawPlugins = rdOptions.plugins;
20893
21097
  const pluginArray = rawPlugins == null ? [] : Array.isArray(rawPlugins) ? [...rawPlugins] : [rawPlugins];
20894
- const hasPlugin = pluginArray.some((plugin) => {
20895
- if (!plugin || typeof plugin !== "object") {
20896
- return false;
20897
- }
20898
- return "name" in plugin && plugin.name === rolldownOxcRuntimePlugin.name;
20899
- });
21098
+ const hasPlugin = pluginArray.includes(rolldownPlugin);
20900
21099
  if (!hasPlugin) {
20901
- rdOptions.plugins = [rolldownOxcRuntimePlugin, ...pluginArray];
21100
+ rdOptions.plugins = [rolldownPlugin, ...pluginArray];
20902
21101
  } else if (!Array.isArray(rawPlugins)) {
20903
21102
  rdOptions.plugins = pluginArray;
20904
21103
  }
20905
21104
  }
20906
- injectOxcRuntimeAlias(config);
20907
- if (oxcRuntimeHelpersRoot) {
21105
+ injectBuiltinAliases(config);
21106
+ if (oxcRuntimeSupport.vitePlugin) {
20908
21107
  config.plugins ??= [];
20909
- config.plugins.unshift({
20910
- name: "weapp-vite:oxc-runtime-helpers",
20911
- enforce: "pre",
20912
- resolveId(source) {
20913
- if (source.startsWith(NULL_BYTE)) {
20914
- return null;
20915
- }
20916
- if (source.includes("@oxc-project/runtime/helpers")) {
20917
- console.warn("[weapp-vite] resolveId intercepted:", source);
20918
- }
20919
- const helperName = getOxcHelperName(source);
20920
- if (helperName) {
20921
- return _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
20922
- }
20923
- return null;
20924
- },
20925
- async load(id) {
20926
- if (!id.startsWith(NULL_BYTE)) {
20927
- return null;
20928
- }
20929
- const helperName = getOxcHelperName(id);
20930
- if (!helperName) {
20931
- return null;
20932
- }
20933
- const helperPath = _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
20934
- console.warn("[weapp-vite] resolving oxc helper via Vite plugin:", helperName);
20935
- return _fsextra2.default.readFile(helperPath, "utf8");
20936
- }
20937
- });
21108
+ config.plugins.unshift(oxcRuntimeSupport.vitePlugin);
20938
21109
  }
20939
21110
  const platform = _nullishCoalesce(_optionalChain([config, 'access', _297 => _297.weapp, 'optionalAccess', _298 => _298.platform]), () => ( "weapp"));
20940
21111
  const resolvedOutputExtensions = getOutputExtensions(platform);
@@ -21007,7 +21178,7 @@ export default _objectSpread2;`
21007
21178
  }
21008
21179
  }
21009
21180
  );
21010
- injectOxcRuntimeAlias(inline);
21181
+ injectBuiltinAliases(inline);
21011
21182
  return inline;
21012
21183
  }
21013
21184
  const inlineConfig = _shared.defu.call(void 0,
@@ -21024,7 +21195,7 @@ export default _objectSpread2;`
21024
21195
  }
21025
21196
  );
21026
21197
  inlineConfig.logLevel = "info";
21027
- injectOxcRuntimeAlias(inlineConfig);
21198
+ injectBuiltinAliases(inlineConfig);
21028
21199
  return inlineConfig;
21029
21200
  }
21030
21201
  function merge(subPackageMeta, ...configs) {
@@ -21038,9 +21209,10 @@ export default _objectSpread2;`
21038
21209
  return new RegExp(`^${pkg.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}(\\/|$)`);
21039
21210
  }));
21040
21211
  }
21212
+ const rolldownPlugin = oxcRuntimeSupport.rolldownPlugin;
21041
21213
  const rolldownOptions = {
21042
21214
  external,
21043
- plugins: rolldownOxcRuntimePlugin ? [rolldownOxcRuntimePlugin] : void 0
21215
+ plugins: rolldownPlugin ? [rolldownPlugin] : void 0
21044
21216
  };
21045
21217
  if (options.isDev) {
21046
21218
  const inline = _shared.defu.call(void 0,
@@ -21068,7 +21240,7 @@ export default _objectSpread2;`
21068
21240
  }
21069
21241
  }
21070
21242
  );
21071
- injectOxcRuntimeAlias(inline);
21243
+ injectBuiltinAliases(inline);
21072
21244
  return inline;
21073
21245
  }
21074
21246
  const inlineConfig = _shared.defu.call(void 0,
@@ -21093,7 +21265,7 @@ export default _objectSpread2;`
21093
21265
  }
21094
21266
  );
21095
21267
  inlineConfig.logLevel = "info";
21096
- injectOxcRuntimeAlias(inlineConfig);
21268
+ injectBuiltinAliases(inlineConfig);
21097
21269
  const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _306 => _306.subPackage, 'access', _307 => _307.root]);
21098
21270
  options = {
21099
21271
  ...options,
@@ -22383,7 +22555,8 @@ function createRuntimeState() {
22383
22555
  cache: new FileCache()
22384
22556
  },
22385
22557
  watcher: {
22386
- rollupWatcherMap: /* @__PURE__ */ new Map()
22558
+ rollupWatcherMap: /* @__PURE__ */ new Map(),
22559
+ sidecarWatcherMap: /* @__PURE__ */ new Map()
22387
22560
  },
22388
22561
  wxml: {
22389
22562
  depsMap: /* @__PURE__ */ new Map(),
@@ -22591,9 +22764,10 @@ function createScanServicePlugin(ctx) {
22591
22764
  // src/runtime/watcherPlugin.ts
22592
22765
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
22593
22766
  function createWatcherService(ctx) {
22594
- const { rollupWatcherMap } = ctx.runtimeState.watcher;
22767
+ const { rollupWatcherMap, sidecarWatcherMap } = ctx.runtimeState.watcher;
22595
22768
  return {
22596
22769
  rollupWatcherMap,
22770
+ sidecarWatcherMap,
22597
22771
  getRollupWatcher(root = "/") {
22598
22772
  return rollupWatcherMap.get(root);
22599
22773
  },
@@ -22607,6 +22781,11 @@ function createWatcherService(ctx) {
22607
22781
  watcher.close();
22608
22782
  });
22609
22783
  rollupWatcherMap.clear();
22784
+ sidecarWatcherMap.forEach((watcher) => {
22785
+ Promise.resolve(watcher.close()).catch(() => {
22786
+ });
22787
+ });
22788
+ sidecarWatcherMap.clear();
22610
22789
  },
22611
22790
  close(root = "/") {
22612
22791
  const watcher = rollupWatcherMap.get(root);
@@ -22614,6 +22793,12 @@ function createWatcherService(ctx) {
22614
22793
  watcher.close();
22615
22794
  rollupWatcherMap.delete(root);
22616
22795
  }
22796
+ const sidecarWatcher = sidecarWatcherMap.get(root);
22797
+ if (sidecarWatcher) {
22798
+ Promise.resolve(sidecarWatcher.close()).catch(() => {
22799
+ });
22800
+ sidecarWatcherMap.delete(root);
22801
+ }
22617
22802
  }
22618
22803
  };
22619
22804
  }
@@ -25444,7 +25629,7 @@ async function createCompilerContext(options) {
25444
25629
  await configService.load(options);
25445
25630
  try {
25446
25631
  await scanService.loadAppEntry();
25447
- } catch (e14) {
25632
+ } catch (e15) {
25448
25633
  }
25449
25634
  return ctx;
25450
25635
  }