weapp-vite 5.9.5 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/auto-import-components/resolvers.cjs +6 -6
  2. package/dist/auto-import-components/resolvers.mjs +1 -1
  3. package/dist/auto-routes.cjs +8 -8
  4. package/dist/auto-routes.mjs +4 -4
  5. package/dist/{chunk-KV5JVZNT.cjs → chunk-4DCIL32Z.cjs} +2 -2
  6. package/dist/{chunk-XF6XMVVY.cjs → chunk-5OVHBJIB.cjs} +6 -6
  7. package/dist/{chunk-O6FIJOUD.mjs → chunk-7JZ3SMTK.mjs} +889 -678
  8. package/dist/{chunk-B4H5W45I.mjs → chunk-B4PYVZ55.mjs} +1 -1
  9. package/dist/{chunk-POPKYIZY.cjs → chunk-F3RCFW4U.cjs} +1282 -1071
  10. package/dist/{chunk-3OFG76US.cjs → chunk-GUSULIGY.cjs} +2 -2
  11. package/dist/chunk-IU53YO5Y.cjs +6 -0
  12. package/dist/{chunk-3V77QISZ.mjs → chunk-KYR4QU4G.mjs} +2 -2
  13. package/dist/{chunk-FUIUGCNV.cjs → chunk-L34YWFZM.cjs} +2 -2
  14. package/dist/{chunk-VNPRE7DQ.mjs → chunk-MQDPMFK7.mjs} +1 -1
  15. package/dist/{chunk-C5O4OVCK.mjs → chunk-NPMFLWIR.mjs} +2 -2
  16. package/dist/{chunk-FYXAC53C.mjs → chunk-OT4RNAKX.mjs} +1 -1
  17. package/dist/cli.cjs +78 -78
  18. package/dist/cli.mjs +4 -4
  19. package/dist/{config-CRwMOjkF.d.ts → config-9JglUSN2.d.ts} +4 -0
  20. package/dist/{config-C8y2cWbg.d.cts → config-D1eBLaq2.d.cts} +4 -0
  21. package/dist/config.cjs +4 -4
  22. package/dist/config.d.cts +1 -1
  23. package/dist/config.d.ts +1 -1
  24. package/dist/config.mjs +3 -3
  25. package/dist/index.cjs +8 -8
  26. package/dist/index.d.cts +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.mjs +6 -6
  29. package/dist/json.cjs +3 -3
  30. package/dist/json.d.cts +1 -1
  31. package/dist/json.d.ts +1 -1
  32. package/dist/json.mjs +2 -2
  33. package/dist/types.cjs +9 -9
  34. package/dist/types.d.cts +1 -1
  35. package/dist/types.d.ts +1 -1
  36. package/dist/types.mjs +2 -2
  37. package/dist/volar.cjs +2 -2
  38. package/dist/volar.mjs +1 -1
  39. package/modules/analyze-dashboard/assets/echarts.js +4 -4
  40. package/modules/analyze-dashboard/assets/index.css +1 -1
  41. package/modules/analyze-dashboard/assets/rolldown-runtime.js +1 -1
  42. package/modules/analyze-dashboard/assets/vue.js +1 -1
  43. package/package.json +17 -17
  44. package/dist/chunk-MDUAIMDF.cjs +0 -6
@@ -3,7 +3,7 @@ import {
3
3
  __require,
4
4
  __toESM,
5
5
  init_esm_shims
6
- } from "./chunk-3V77QISZ.mjs";
6
+ } from "./chunk-KYR4QU4G.mjs";
7
7
 
8
8
  // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
9
9
  var require_debug = __commonJS({
@@ -1030,7 +1030,7 @@ init_esm_shims();
1030
1030
  import { removeExtensionDeep } from "@weapp-core/shared";
1031
1031
  import fs4 from "fs-extra";
1032
1032
 
1033
- // ../../node_modules/.pnpm/lru-cache@11.2.2/node_modules/lru-cache/dist/esm/index.js
1033
+ // ../../node_modules/.pnpm/lru-cache@11.2.4/node_modules/lru-cache/dist/esm/index.js
1034
1034
  init_esm_shims();
1035
1035
  var defaultPerf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
1036
1036
  var warned = /* @__PURE__ */ new Set();
@@ -1075,7 +1075,6 @@ if (typeof AC === "undefined") {
1075
1075
  };
1076
1076
  }
1077
1077
  var shouldWarn = (code) => !warned.has(code);
1078
- var TYPE = Symbol("type");
1079
1078
  var isPosInt = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2);
1080
1079
  var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
1081
1080
  var ZeroArray = class extends Array {
@@ -1203,6 +1202,7 @@ var LRUCache = class _LRUCache {
1203
1202
  #sizes;
1204
1203
  #starts;
1205
1204
  #ttls;
1205
+ #autopurgeTimers;
1206
1206
  #hasDispose;
1207
1207
  #hasFetchMethod;
1208
1208
  #hasDisposeAfter;
@@ -1221,6 +1221,7 @@ var LRUCache = class _LRUCache {
1221
1221
  // properties
1222
1222
  starts: c.#starts,
1223
1223
  ttls: c.#ttls,
1224
+ autopurgeTimers: c.#autopurgeTimers,
1224
1225
  sizes: c.#sizes,
1225
1226
  keyMap: c.#keyMap,
1226
1227
  keyList: c.#keyList,
@@ -1411,10 +1412,16 @@ var LRUCache = class _LRUCache {
1411
1412
  const starts = new ZeroArray(this.#max);
1412
1413
  this.#ttls = ttls;
1413
1414
  this.#starts = starts;
1415
+ const purgeTimers = this.ttlAutopurge ? new Array(this.#max) : void 0;
1416
+ this.#autopurgeTimers = purgeTimers;
1414
1417
  this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {
1415
1418
  starts[index] = ttl !== 0 ? start : 0;
1416
1419
  ttls[index] = ttl;
1417
- if (ttl !== 0 && this.ttlAutopurge) {
1420
+ if (purgeTimers?.[index]) {
1421
+ clearTimeout(purgeTimers[index]);
1422
+ purgeTimers[index] = void 0;
1423
+ }
1424
+ if (ttl !== 0 && purgeTimers) {
1418
1425
  const t2 = setTimeout(() => {
1419
1426
  if (this.#isStale(index)) {
1420
1427
  this.#delete(this.#keyList[index], "expire");
@@ -1423,6 +1430,7 @@ var LRUCache = class _LRUCache {
1423
1430
  if (t2.unref) {
1424
1431
  t2.unref();
1425
1432
  }
1433
+ purgeTimers[index] = t2;
1426
1434
  }
1427
1435
  };
1428
1436
  this.#updateItemAge = (index) => {
@@ -1972,6 +1980,10 @@ var LRUCache = class _LRUCache {
1972
1980
  }
1973
1981
  }
1974
1982
  this.#removeItemSize(head);
1983
+ if (this.#autopurgeTimers?.[head]) {
1984
+ clearTimeout(this.#autopurgeTimers[head]);
1985
+ this.#autopurgeTimers[head] = void 0;
1986
+ }
1975
1987
  if (free) {
1976
1988
  this.#keyList[head] = void 0;
1977
1989
  this.#valList[head] = void 0;
@@ -2343,6 +2355,10 @@ var LRUCache = class _LRUCache {
2343
2355
  if (this.#size !== 0) {
2344
2356
  const index = this.#keyMap.get(k);
2345
2357
  if (index !== void 0) {
2358
+ if (this.#autopurgeTimers?.[index]) {
2359
+ clearTimeout(this.#autopurgeTimers?.[index]);
2360
+ this.#autopurgeTimers[index] = void 0;
2361
+ }
2346
2362
  deleted = true;
2347
2363
  if (this.#size === 1) {
2348
2364
  this.#clear(reason);
@@ -2413,6 +2429,11 @@ var LRUCache = class _LRUCache {
2413
2429
  if (this.#ttls && this.#starts) {
2414
2430
  this.#ttls.fill(0);
2415
2431
  this.#starts.fill(0);
2432
+ for (const t2 of this.#autopurgeTimers ?? []) {
2433
+ if (t2 !== void 0)
2434
+ clearTimeout(t2);
2435
+ }
2436
+ this.#autopurgeTimers?.fill(void 0);
2416
2437
  }
2417
2438
  if (this.#sizes) {
2418
2439
  this.#sizes.fill(0);
@@ -2650,13 +2671,13 @@ function extractComponentProps(code) {
2650
2671
  });
2651
2672
  let props = /* @__PURE__ */ new Map();
2652
2673
  traverse(ast, {
2653
- CallExpression(path36) {
2674
+ CallExpression(path37) {
2654
2675
  if (props.size > 0) {
2655
2676
  return;
2656
2677
  }
2657
- const callee = path36.node.callee;
2678
+ const callee = path37.node.callee;
2658
2679
  if (callee.type === "Identifier" && callee.name === "Component") {
2659
- const [options] = path36.node.arguments;
2680
+ const [options] = path37.node.arguments;
2660
2681
  if (options && options.type === "ObjectExpression") {
2661
2682
  props = extractComponentProperties(options);
2662
2683
  }
@@ -4303,18 +4324,18 @@ init_esm_shims();
4303
4324
  import fs6 from "fs";
4304
4325
  import process3 from "process";
4305
4326
 
4306
- // ../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js
4327
+ // ../../node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/index.js
4307
4328
  init_esm_shims();
4308
- import { stat as statcb } from "fs";
4309
- import { stat as stat3, readdir as readdir2 } from "fs/promises";
4310
4329
  import { EventEmitter } from "events";
4311
- import * as sysPath2 from "path";
4330
+ import { stat as statcb, Stats } from "fs";
4331
+ import { readdir as readdir2, stat as stat3 } from "fs/promises";
4332
+ import * as sp2 from "path";
4312
4333
 
4313
- // ../../node_modules/.pnpm/readdirp@4.1.2/node_modules/readdirp/esm/index.js
4334
+ // ../../node_modules/.pnpm/readdirp@5.0.0/node_modules/readdirp/index.js
4314
4335
  init_esm_shims();
4315
- import { stat, lstat, readdir, realpath } from "fs/promises";
4336
+ import { lstat, readdir, realpath, stat } from "fs/promises";
4337
+ import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "path";
4316
4338
  import { Readable } from "stream";
4317
- import { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from "path";
4318
4339
  var EntryTypes = {
4319
4340
  FILE_TYPE: "files",
4320
4341
  DIR_TYPE: "directories",
@@ -4369,6 +4390,20 @@ var normalizeFilter = (filter3) => {
4369
4390
  return emptyFn;
4370
4391
  };
4371
4392
  var ReaddirpStream = class extends Readable {
4393
+ parents;
4394
+ reading;
4395
+ parent;
4396
+ _stat;
4397
+ _maxDepth;
4398
+ _wantsDir;
4399
+ _wantsFile;
4400
+ _wantsEverything;
4401
+ _root;
4402
+ _isDirent;
4403
+ _statsProp;
4404
+ _rdOptions;
4405
+ _fileFilter;
4406
+ _directoryFilter;
4372
4407
  constructor(options = {}) {
4373
4408
  super({
4374
4409
  objectMode: true,
@@ -4381,11 +4416,11 @@ var ReaddirpStream = class extends Readable {
4381
4416
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
4382
4417
  const statMethod = opts.lstat ? lstat : stat;
4383
4418
  if (wantBigintFsStats) {
4384
- this._stat = (path36) => statMethod(path36, { bigint: true });
4419
+ this._stat = (path37) => statMethod(path37, { bigint: true });
4385
4420
  } else {
4386
4421
  this._stat = statMethod;
4387
4422
  }
4388
- this._maxDepth = opts.depth ?? defaultOptions.depth;
4423
+ this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
4389
4424
  this._wantsDir = type ? DIR_TYPES.has(type) : false;
4390
4425
  this._wantsFile = type ? FILE_TYPES.has(type) : false;
4391
4426
  this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
@@ -4406,8 +4441,8 @@ var ReaddirpStream = class extends Readable {
4406
4441
  const par = this.parent;
4407
4442
  const fil = par && par.files;
4408
4443
  if (fil && fil.length > 0) {
4409
- const { path: path36, depth } = par;
4410
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path36));
4444
+ const { path: path37, depth } = par;
4445
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path37));
4411
4446
  const awaited = await Promise.all(slice);
4412
4447
  for (const entry of awaited) {
4413
4448
  if (!entry)
@@ -4447,20 +4482,20 @@ var ReaddirpStream = class extends Readable {
4447
4482
  this.reading = false;
4448
4483
  }
4449
4484
  }
4450
- async _exploreDir(path36, depth) {
4485
+ async _exploreDir(path37, depth) {
4451
4486
  let files;
4452
4487
  try {
4453
- files = await readdir(path36, this._rdOptions);
4488
+ files = await readdir(path37, this._rdOptions);
4454
4489
  } catch (error) {
4455
4490
  this._onError(error);
4456
4491
  }
4457
- return { files, depth, path: path36 };
4492
+ return { files, depth, path: path37 };
4458
4493
  }
4459
- async _formatEntry(dirent, path36) {
4494
+ async _formatEntry(dirent, path37) {
4460
4495
  let entry;
4461
4496
  const basename4 = this._isDirent ? dirent.name : dirent;
4462
4497
  try {
4463
- const fullPath = presolve(pjoin(path36, basename4));
4498
+ const fullPath = presolve(pjoin(path37, basename4));
4464
4499
  entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
4465
4500
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
4466
4501
  } catch (err) {
@@ -4530,12 +4565,12 @@ function readdirp(root, options = {}) {
4530
4565
  return new ReaddirpStream(options);
4531
4566
  }
4532
4567
 
4533
- // ../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/handler.js
4568
+ // ../../node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/handler.js
4534
4569
  init_esm_shims();
4535
- import { watchFile, unwatchFile, watch as fs_watch } from "fs";
4536
- import { open, stat as stat2, lstat as lstat2, realpath as fsrealpath } from "fs/promises";
4537
- import * as sysPath from "path";
4570
+ import { watch as fs_watch, unwatchFile, watchFile } from "fs";
4571
+ import { realpath as fsrealpath, lstat as lstat2, open, stat as stat2 } from "fs/promises";
4538
4572
  import { type as osType } from "os";
4573
+ import * as sp from "path";
4539
4574
  var STR_DATA = "data";
4540
4575
  var STR_END = "end";
4541
4576
  var STR_CLOSE = "close";
@@ -4828,7 +4863,7 @@ var binaryExtensions = /* @__PURE__ */ new Set([
4828
4863
  "zip",
4829
4864
  "zipx"
4830
4865
  ]);
4831
- var isBinaryPath = (filePath) => binaryExtensions.has(sysPath.extname(filePath).slice(1).toLowerCase());
4866
+ var isBinaryPath = (filePath) => binaryExtensions.has(sp.extname(filePath).slice(1).toLowerCase());
4832
4867
  var foreach = (val, fn) => {
4833
4868
  if (val instanceof Set) {
4834
4869
  val.forEach(fn);
@@ -4861,16 +4896,16 @@ var delFromSet = (main, prop, item) => {
4861
4896
  };
4862
4897
  var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
4863
4898
  var FsWatchInstances = /* @__PURE__ */ new Map();
4864
- function createFsWatchInstance(path36, options, listener, errHandler, emitRaw) {
4899
+ function createFsWatchInstance(path37, options, listener, errHandler, emitRaw) {
4865
4900
  const handleEvent = (rawEvent, evPath) => {
4866
- listener(path36);
4867
- emitRaw(rawEvent, evPath, { watchedPath: path36 });
4868
- if (evPath && path36 !== evPath) {
4869
- fsWatchBroadcast(sysPath.resolve(path36, evPath), KEY_LISTENERS, sysPath.join(path36, evPath));
4901
+ listener(path37);
4902
+ emitRaw(rawEvent, evPath, { watchedPath: path37 });
4903
+ if (evPath && path37 !== evPath) {
4904
+ fsWatchBroadcast(sp.resolve(path37, evPath), KEY_LISTENERS, sp.join(path37, evPath));
4870
4905
  }
4871
4906
  };
4872
4907
  try {
4873
- return fs_watch(path36, {
4908
+ return fs_watch(path37, {
4874
4909
  persistent: options.persistent
4875
4910
  }, handleEvent);
4876
4911
  } catch (error) {
@@ -4886,12 +4921,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
4886
4921
  listener(val1, val2, val3);
4887
4922
  });
4888
4923
  };
4889
- var setFsWatchListener = (path36, fullPath, options, handlers) => {
4924
+ var setFsWatchListener = (path37, fullPath, options, handlers) => {
4890
4925
  const { listener, errHandler, rawEmitter } = handlers;
4891
4926
  let cont = FsWatchInstances.get(fullPath);
4892
4927
  let watcher;
4893
4928
  if (!options.persistent) {
4894
- watcher = createFsWatchInstance(path36, options, listener, errHandler, rawEmitter);
4929
+ watcher = createFsWatchInstance(path37, options, listener, errHandler, rawEmitter);
4895
4930
  if (!watcher)
4896
4931
  return;
4897
4932
  return watcher.close.bind(watcher);
@@ -4902,7 +4937,7 @@ var setFsWatchListener = (path36, fullPath, options, handlers) => {
4902
4937
  addAndConvert(cont, KEY_RAW, rawEmitter);
4903
4938
  } else {
4904
4939
  watcher = createFsWatchInstance(
4905
- path36,
4940
+ path37,
4906
4941
  options,
4907
4942
  fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
4908
4943
  errHandler,
@@ -4917,7 +4952,7 @@ var setFsWatchListener = (path36, fullPath, options, handlers) => {
4917
4952
  cont.watcherUnusable = true;
4918
4953
  if (isWindows && error.code === "EPERM") {
4919
4954
  try {
4920
- const fd = await open(path36, "r");
4955
+ const fd = await open(path37, "r");
4921
4956
  await fd.close();
4922
4957
  broadcastErr(error);
4923
4958
  } catch (err) {
@@ -4948,7 +4983,7 @@ var setFsWatchListener = (path36, fullPath, options, handlers) => {
4948
4983
  };
4949
4984
  };
4950
4985
  var FsWatchFileInstances = /* @__PURE__ */ new Map();
4951
- var setFsWatchFileListener = (path36, fullPath, options, handlers) => {
4986
+ var setFsWatchFileListener = (path37, fullPath, options, handlers) => {
4952
4987
  const { listener, rawEmitter } = handlers;
4953
4988
  let cont = FsWatchFileInstances.get(fullPath);
4954
4989
  const copts = cont && cont.options;
@@ -4970,7 +5005,7 @@ var setFsWatchFileListener = (path36, fullPath, options, handlers) => {
4970
5005
  });
4971
5006
  const currmtime = curr.mtimeMs;
4972
5007
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
4973
- foreach(cont.listeners, (listener2) => listener2(path36, curr));
5008
+ foreach(cont.listeners, (listener2) => listener2(path37, curr));
4974
5009
  }
4975
5010
  })
4976
5011
  };
@@ -4988,6 +5023,8 @@ var setFsWatchFileListener = (path36, fullPath, options, handlers) => {
4988
5023
  };
4989
5024
  };
4990
5025
  var NodeFsHandler = class {
5026
+ fsw;
5027
+ _boundHandleError;
4991
5028
  constructor(fsW) {
4992
5029
  this.fsw = fsW;
4993
5030
  this._boundHandleError = (error) => fsW._handleError(error);
@@ -4998,13 +5035,13 @@ var NodeFsHandler = class {
4998
5035
  * @param listener on fs change
4999
5036
  * @returns closer for the watcher instance
5000
5037
  */
5001
- _watchWithNodeFs(path36, listener) {
5038
+ _watchWithNodeFs(path37, listener) {
5002
5039
  const opts = this.fsw.options;
5003
- const directory = sysPath.dirname(path36);
5004
- const basename4 = sysPath.basename(path36);
5040
+ const directory = sp.dirname(path37);
5041
+ const basename4 = sp.basename(path37);
5005
5042
  const parent = this.fsw._getWatchedDir(directory);
5006
5043
  parent.add(basename4);
5007
- const absolutePath = sysPath.resolve(path36);
5044
+ const absolutePath = sp.resolve(path37);
5008
5045
  const options = {
5009
5046
  persistent: opts.persistent
5010
5047
  };
@@ -5014,12 +5051,12 @@ var NodeFsHandler = class {
5014
5051
  if (opts.usePolling) {
5015
5052
  const enableBin = opts.interval !== opts.binaryInterval;
5016
5053
  options.interval = enableBin && isBinaryPath(basename4) ? opts.binaryInterval : opts.interval;
5017
- closer = setFsWatchFileListener(path36, absolutePath, options, {
5054
+ closer = setFsWatchFileListener(path37, absolutePath, options, {
5018
5055
  listener,
5019
5056
  rawEmitter: this.fsw._emitRaw
5020
5057
  });
5021
5058
  } else {
5022
- closer = setFsWatchListener(path36, absolutePath, options, {
5059
+ closer = setFsWatchListener(path37, absolutePath, options, {
5023
5060
  listener,
5024
5061
  errHandler: this._boundHandleError,
5025
5062
  rawEmitter: this.fsw._emitRaw
@@ -5035,13 +5072,13 @@ var NodeFsHandler = class {
5035
5072
  if (this.fsw.closed) {
5036
5073
  return;
5037
5074
  }
5038
- const dirname5 = sysPath.dirname(file);
5039
- const basename4 = sysPath.basename(file);
5075
+ const dirname5 = sp.dirname(file);
5076
+ const basename4 = sp.basename(file);
5040
5077
  const parent = this.fsw._getWatchedDir(dirname5);
5041
5078
  let prevStats = stats;
5042
5079
  if (parent.has(basename4))
5043
5080
  return;
5044
- const listener = async (path36, newStats) => {
5081
+ const listener = async (path37, newStats) => {
5045
5082
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
5046
5083
  return;
5047
5084
  if (!newStats || newStats.mtimeMs === 0) {
@@ -5055,11 +5092,11 @@ var NodeFsHandler = class {
5055
5092
  this.fsw._emit(EV.CHANGE, file, newStats2);
5056
5093
  }
5057
5094
  if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
5058
- this.fsw._closeFile(path36);
5095
+ this.fsw._closeFile(path37);
5059
5096
  prevStats = newStats2;
5060
5097
  const closer2 = this._watchWithNodeFs(file, listener);
5061
5098
  if (closer2)
5062
- this.fsw._addPathCloser(path36, closer2);
5099
+ this.fsw._addPathCloser(path37, closer2);
5063
5100
  } else {
5064
5101
  prevStats = newStats2;
5065
5102
  }
@@ -5091,7 +5128,7 @@ var NodeFsHandler = class {
5091
5128
  * @param item basename of this item
5092
5129
  * @returns true if no more processing is needed for this entry.
5093
5130
  */
5094
- async _handleSymlink(entry, directory, path36, item) {
5131
+ async _handleSymlink(entry, directory, path37, item) {
5095
5132
  if (this.fsw.closed) {
5096
5133
  return;
5097
5134
  }
@@ -5101,7 +5138,7 @@ var NodeFsHandler = class {
5101
5138
  this.fsw._incrReadyCount();
5102
5139
  let linkPath;
5103
5140
  try {
5104
- linkPath = await fsrealpath(path36);
5141
+ linkPath = await fsrealpath(path37);
5105
5142
  } catch (e) {
5106
5143
  this.fsw._emitReady();
5107
5144
  return true;
@@ -5111,12 +5148,12 @@ var NodeFsHandler = class {
5111
5148
  if (dir.has(item)) {
5112
5149
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
5113
5150
  this.fsw._symlinkPaths.set(full, linkPath);
5114
- this.fsw._emit(EV.CHANGE, path36, entry.stats);
5151
+ this.fsw._emit(EV.CHANGE, path37, entry.stats);
5115
5152
  }
5116
5153
  } else {
5117
5154
  dir.add(item);
5118
5155
  this.fsw._symlinkPaths.set(full, linkPath);
5119
- this.fsw._emit(EV.ADD, path36, entry.stats);
5156
+ this.fsw._emit(EV.ADD, path37, entry.stats);
5120
5157
  }
5121
5158
  this.fsw._emitReady();
5122
5159
  return true;
@@ -5127,8 +5164,9 @@ var NodeFsHandler = class {
5127
5164
  this.fsw._symlinkPaths.set(full, true);
5128
5165
  }
5129
5166
  _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
5130
- directory = sysPath.join(directory, "");
5131
- throttler = this.fsw._throttle("readdir", directory, 1e3);
5167
+ directory = sp.join(directory, "");
5168
+ const throttleKey = target ? `${directory}:${target}` : directory;
5169
+ throttler = this.fsw._throttle("readdir", throttleKey, 1e3);
5132
5170
  if (!throttler)
5133
5171
  return;
5134
5172
  const previous = this.fsw._getWatchedDir(wh.path);
@@ -5145,9 +5183,9 @@ var NodeFsHandler = class {
5145
5183
  return;
5146
5184
  }
5147
5185
  const item = entry.path;
5148
- let path36 = sysPath.join(directory, item);
5186
+ let path37 = sp.join(directory, item);
5149
5187
  current2.add(item);
5150
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path36, item)) {
5188
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path37, item)) {
5151
5189
  return;
5152
5190
  }
5153
5191
  if (this.fsw.closed) {
@@ -5156,8 +5194,8 @@ var NodeFsHandler = class {
5156
5194
  }
5157
5195
  if (item === target || !target && !previous.has(item)) {
5158
5196
  this.fsw._incrReadyCount();
5159
- path36 = sysPath.join(dir, sysPath.relative(dir, path36));
5160
- this._addToNodeFs(path36, initialAdd, wh, depth + 1);
5197
+ path37 = sp.join(dir, sp.relative(dir, path37));
5198
+ this._addToNodeFs(path37, initialAdd, wh, depth + 1);
5161
5199
  }
5162
5200
  }).on(EV.ERROR, this._boundHandleError);
5163
5201
  return new Promise((resolve8, reject) => {
@@ -5193,12 +5231,12 @@ var NodeFsHandler = class {
5193
5231
  * @returns closer for the watcher instance.
5194
5232
  */
5195
5233
  async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath3) {
5196
- const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
5197
- const tracked = parentDir.has(sysPath.basename(dir));
5234
+ const parentDir = this.fsw._getWatchedDir(sp.dirname(dir));
5235
+ const tracked = parentDir.has(sp.basename(dir));
5198
5236
  if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
5199
5237
  this.fsw._emit(EV.ADD_DIR, dir, stats);
5200
5238
  }
5201
- parentDir.add(sysPath.basename(dir));
5239
+ parentDir.add(sp.basename(dir));
5202
5240
  this.fsw._getWatchedDir(dir);
5203
5241
  let throttler;
5204
5242
  let closer;
@@ -5226,13 +5264,13 @@ var NodeFsHandler = class {
5226
5264
  * @param depth Child path actually targeted for watch
5227
5265
  * @param target Child path actually targeted for watch
5228
5266
  */
5229
- async _addToNodeFs(path36, initialAdd, priorWh, depth, target) {
5267
+ async _addToNodeFs(path37, initialAdd, priorWh, depth, target) {
5230
5268
  const ready = this.fsw._emitReady;
5231
- if (this.fsw._isIgnored(path36) || this.fsw.closed) {
5269
+ if (this.fsw._isIgnored(path37) || this.fsw.closed) {
5232
5270
  ready();
5233
5271
  return false;
5234
5272
  }
5235
- const wh = this.fsw._getWatchHelpers(path36);
5273
+ const wh = this.fsw._getWatchHelpers(path37);
5236
5274
  if (priorWh) {
5237
5275
  wh.filterPath = (entry) => priorWh.filterPath(entry);
5238
5276
  wh.filterDir = (entry) => priorWh.filterDir(entry);
@@ -5248,8 +5286,8 @@ var NodeFsHandler = class {
5248
5286
  const follow = this.fsw.options.followSymlinks;
5249
5287
  let closer;
5250
5288
  if (stats.isDirectory()) {
5251
- const absPath = sysPath.resolve(path36);
5252
- const targetPath = follow ? await fsrealpath(path36) : path36;
5289
+ const absPath = sp.resolve(path37);
5290
+ const targetPath = follow ? await fsrealpath(path37) : path37;
5253
5291
  if (this.fsw.closed)
5254
5292
  return;
5255
5293
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -5259,42 +5297,42 @@ var NodeFsHandler = class {
5259
5297
  this.fsw._symlinkPaths.set(absPath, targetPath);
5260
5298
  }
5261
5299
  } else if (stats.isSymbolicLink()) {
5262
- const targetPath = follow ? await fsrealpath(path36) : path36;
5300
+ const targetPath = follow ? await fsrealpath(path37) : path37;
5263
5301
  if (this.fsw.closed)
5264
5302
  return;
5265
- const parent = sysPath.dirname(wh.watchPath);
5303
+ const parent = sp.dirname(wh.watchPath);
5266
5304
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
5267
5305
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
5268
- closer = await this._handleDir(parent, stats, initialAdd, depth, path36, wh, targetPath);
5306
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path37, wh, targetPath);
5269
5307
  if (this.fsw.closed)
5270
5308
  return;
5271
5309
  if (targetPath !== void 0) {
5272
- this.fsw._symlinkPaths.set(sysPath.resolve(path36), targetPath);
5310
+ this.fsw._symlinkPaths.set(sp.resolve(path37), targetPath);
5273
5311
  }
5274
5312
  } else {
5275
5313
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
5276
5314
  }
5277
5315
  ready();
5278
5316
  if (closer)
5279
- this.fsw._addPathCloser(path36, closer);
5317
+ this.fsw._addPathCloser(path37, closer);
5280
5318
  return false;
5281
5319
  } catch (error) {
5282
5320
  if (this.fsw._handleError(error)) {
5283
5321
  ready();
5284
- return path36;
5322
+ return path37;
5285
5323
  }
5286
5324
  }
5287
5325
  }
5288
5326
  };
5289
5327
 
5290
- // ../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js
5328
+ // ../../node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/index.js
5291
5329
  var SLASH = "/";
5292
5330
  var SLASH_SLASH = "//";
5293
5331
  var ONE_DOT = ".";
5294
5332
  var TWO_DOTS = "..";
5295
5333
  var STRING_TYPE = "string";
5296
5334
  var BACK_SLASH_RE = /\\/g;
5297
- var DOUBLE_SLASH_RE = /\/\//;
5335
+ var DOUBLE_SLASH_RE = /\/\//g;
5298
5336
  var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
5299
5337
  var REPLACER_RE = /^\.[/\\]/;
5300
5338
  function arrify(item) {
@@ -5313,37 +5351,35 @@ function createPattern(matcher) {
5313
5351
  if (matcher.path === string)
5314
5352
  return true;
5315
5353
  if (matcher.recursive) {
5316
- const relative3 = sysPath2.relative(matcher.path, string);
5354
+ const relative3 = sp2.relative(matcher.path, string);
5317
5355
  if (!relative3) {
5318
5356
  return false;
5319
5357
  }
5320
- return !relative3.startsWith("..") && !sysPath2.isAbsolute(relative3);
5358
+ return !relative3.startsWith("..") && !sp2.isAbsolute(relative3);
5321
5359
  }
5322
5360
  return false;
5323
5361
  };
5324
5362
  }
5325
5363
  return () => false;
5326
5364
  }
5327
- function normalizePath(path36) {
5328
- if (typeof path36 !== "string")
5365
+ function normalizePath(path37) {
5366
+ if (typeof path37 !== "string")
5329
5367
  throw new Error("string expected");
5330
- path36 = sysPath2.normalize(path36);
5331
- path36 = path36.replace(/\\/g, "/");
5368
+ path37 = sp2.normalize(path37);
5369
+ path37 = path37.replace(/\\/g, "/");
5332
5370
  let prepend = false;
5333
- if (path36.startsWith("//"))
5371
+ if (path37.startsWith("//"))
5334
5372
  prepend = true;
5335
- const DOUBLE_SLASH_RE2 = /\/\//;
5336
- while (path36.match(DOUBLE_SLASH_RE2))
5337
- path36 = path36.replace(DOUBLE_SLASH_RE2, "/");
5373
+ path37 = path37.replace(DOUBLE_SLASH_RE, "/");
5338
5374
  if (prepend)
5339
- path36 = "/" + path36;
5340
- return path36;
5375
+ path37 = "/" + path37;
5376
+ return path37;
5341
5377
  }
5342
5378
  function matchPatterns(patterns, testString, stats) {
5343
- const path36 = normalizePath(testString);
5379
+ const path37 = normalizePath(testString);
5344
5380
  for (let index = 0; index < patterns.length; index++) {
5345
5381
  const pattern = patterns[index];
5346
- if (pattern(path36, stats)) {
5382
+ if (pattern(path37, stats)) {
5347
5383
  return true;
5348
5384
  }
5349
5385
  }
@@ -5375,30 +5411,31 @@ var toUnix = (string) => {
5375
5411
  if (str.startsWith(SLASH_SLASH)) {
5376
5412
  prepend = true;
5377
5413
  }
5378
- while (str.match(DOUBLE_SLASH_RE)) {
5379
- str = str.replace(DOUBLE_SLASH_RE, SLASH);
5380
- }
5414
+ str = str.replace(DOUBLE_SLASH_RE, SLASH);
5381
5415
  if (prepend) {
5382
5416
  str = SLASH + str;
5383
5417
  }
5384
5418
  return str;
5385
5419
  };
5386
- var normalizePathToUnix = (path36) => toUnix(sysPath2.normalize(toUnix(path36)));
5387
- var normalizeIgnored = (cwd = "") => (path36) => {
5388
- if (typeof path36 === "string") {
5389
- return normalizePathToUnix(sysPath2.isAbsolute(path36) ? path36 : sysPath2.join(cwd, path36));
5420
+ var normalizePathToUnix = (path37) => toUnix(sp2.normalize(toUnix(path37)));
5421
+ var normalizeIgnored = (cwd = "") => (path37) => {
5422
+ if (typeof path37 === "string") {
5423
+ return normalizePathToUnix(sp2.isAbsolute(path37) ? path37 : sp2.join(cwd, path37));
5390
5424
  } else {
5391
- return path36;
5425
+ return path37;
5392
5426
  }
5393
5427
  };
5394
- var getAbsolutePath = (path36, cwd) => {
5395
- if (sysPath2.isAbsolute(path36)) {
5396
- return path36;
5428
+ var getAbsolutePath = (path37, cwd) => {
5429
+ if (sp2.isAbsolute(path37)) {
5430
+ return path37;
5397
5431
  }
5398
- return sysPath2.join(cwd, path36);
5432
+ return sp2.join(cwd, path37);
5399
5433
  };
5400
5434
  var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
5401
5435
  var DirEntry = class {
5436
+ path;
5437
+ _removeWatcher;
5438
+ items;
5402
5439
  constructor(dir, removeWatcher) {
5403
5440
  this.path = dir;
5404
5441
  this._removeWatcher = removeWatcher;
@@ -5423,7 +5460,7 @@ var DirEntry = class {
5423
5460
  await readdir2(dir);
5424
5461
  } catch (err) {
5425
5462
  if (this._removeWatcher) {
5426
- this._removeWatcher(sysPath2.dirname(dir), sysPath2.basename(dir));
5463
+ this._removeWatcher(sp2.dirname(dir), sp2.basename(dir));
5427
5464
  }
5428
5465
  }
5429
5466
  }
@@ -5450,12 +5487,19 @@ var DirEntry = class {
5450
5487
  var STAT_METHOD_F = "stat";
5451
5488
  var STAT_METHOD_L = "lstat";
5452
5489
  var WatchHelper = class {
5453
- constructor(path36, follow, fsw) {
5490
+ fsw;
5491
+ path;
5492
+ watchPath;
5493
+ fullWatchPath;
5494
+ dirParts;
5495
+ followSymlinks;
5496
+ statMethod;
5497
+ constructor(path37, follow, fsw) {
5454
5498
  this.fsw = fsw;
5455
- const watchPath = path36;
5456
- this.path = path36 = path36.replace(REPLACER_RE, "");
5499
+ const watchPath = path37;
5500
+ this.path = path37 = path37.replace(REPLACER_RE, "");
5457
5501
  this.watchPath = watchPath;
5458
- this.fullWatchPath = sysPath2.resolve(watchPath);
5502
+ this.fullWatchPath = sp2.resolve(watchPath);
5459
5503
  this.dirParts = [];
5460
5504
  this.dirParts.forEach((parts) => {
5461
5505
  if (parts.length > 1)
@@ -5465,7 +5509,7 @@ var WatchHelper = class {
5465
5509
  this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
5466
5510
  }
5467
5511
  entryPath(entry) {
5468
- return sysPath2.join(this.watchPath, sysPath2.relative(this.watchPath, entry.fullPath));
5512
+ return sp2.join(this.watchPath, sp2.relative(this.watchPath, entry.fullPath));
5469
5513
  }
5470
5514
  filterPath(entry) {
5471
5515
  const { stats } = entry;
@@ -5479,6 +5523,24 @@ var WatchHelper = class {
5479
5523
  }
5480
5524
  };
5481
5525
  var FSWatcher = class extends EventEmitter {
5526
+ closed;
5527
+ options;
5528
+ _closers;
5529
+ _ignoredPaths;
5530
+ _throttled;
5531
+ _streams;
5532
+ _symlinkPaths;
5533
+ _watched;
5534
+ _pendingWrites;
5535
+ _pendingUnlinks;
5536
+ _readyCount;
5537
+ _emitReady;
5538
+ _closePromise;
5539
+ _userIgnored;
5540
+ _readyEmitted;
5541
+ _emitRaw;
5542
+ _boundRemove;
5543
+ _nodeFsHandler;
5482
5544
  // Not indenting methods for history sake; for now.
5483
5545
  constructor(_opts = {}) {
5484
5546
  super();
@@ -5575,20 +5637,20 @@ var FSWatcher = class extends EventEmitter {
5575
5637
  this._closePromise = void 0;
5576
5638
  let paths = unifyPaths(paths_);
5577
5639
  if (cwd) {
5578
- paths = paths.map((path36) => {
5579
- const absPath = getAbsolutePath(path36, cwd);
5640
+ paths = paths.map((path37) => {
5641
+ const absPath = getAbsolutePath(path37, cwd);
5580
5642
  return absPath;
5581
5643
  });
5582
5644
  }
5583
- paths.forEach((path36) => {
5584
- this._removeIgnoredPath(path36);
5645
+ paths.forEach((path37) => {
5646
+ this._removeIgnoredPath(path37);
5585
5647
  });
5586
5648
  this._userIgnored = void 0;
5587
5649
  if (!this._readyCount)
5588
5650
  this._readyCount = 0;
5589
5651
  this._readyCount += paths.length;
5590
- Promise.all(paths.map(async (path36) => {
5591
- const res = await this._nodeFsHandler._addToNodeFs(path36, !_internal, void 0, 0, _origAdd);
5652
+ Promise.all(paths.map(async (path37) => {
5653
+ const res = await this._nodeFsHandler._addToNodeFs(path37, !_internal, void 0, 0, _origAdd);
5592
5654
  if (res)
5593
5655
  this._emitReady();
5594
5656
  return res;
@@ -5597,7 +5659,7 @@ var FSWatcher = class extends EventEmitter {
5597
5659
  return;
5598
5660
  results.forEach((item) => {
5599
5661
  if (item)
5600
- this.add(sysPath2.dirname(item), sysPath2.basename(_origAdd || item));
5662
+ this.add(sp2.dirname(item), sp2.basename(_origAdd || item));
5601
5663
  });
5602
5664
  });
5603
5665
  return this;
@@ -5610,17 +5672,17 @@ var FSWatcher = class extends EventEmitter {
5610
5672
  return this;
5611
5673
  const paths = unifyPaths(paths_);
5612
5674
  const { cwd } = this.options;
5613
- paths.forEach((path36) => {
5614
- if (!sysPath2.isAbsolute(path36) && !this._closers.has(path36)) {
5675
+ paths.forEach((path37) => {
5676
+ if (!sp2.isAbsolute(path37) && !this._closers.has(path37)) {
5615
5677
  if (cwd)
5616
- path36 = sysPath2.join(cwd, path36);
5617
- path36 = sysPath2.resolve(path36);
5678
+ path37 = sp2.join(cwd, path37);
5679
+ path37 = sp2.resolve(path37);
5618
5680
  }
5619
- this._closePath(path36);
5620
- this._addIgnoredPath(path36);
5621
- if (this._watched.has(path36)) {
5681
+ this._closePath(path37);
5682
+ this._addIgnoredPath(path37);
5683
+ if (this._watched.has(path37)) {
5622
5684
  this._addIgnoredPath({
5623
- path: path36,
5685
+ path: path37,
5624
5686
  recursive: true
5625
5687
  });
5626
5688
  }
@@ -5663,7 +5725,7 @@ var FSWatcher = class extends EventEmitter {
5663
5725
  getWatched() {
5664
5726
  const watchList = {};
5665
5727
  this._watched.forEach((entry, dir) => {
5666
- const key = this.options.cwd ? sysPath2.relative(this.options.cwd, dir) : dir;
5728
+ const key = this.options.cwd ? sp2.relative(this.options.cwd, dir) : dir;
5667
5729
  const index = key || ONE_DOT;
5668
5730
  watchList[index] = entry.getChildren().sort();
5669
5731
  });
@@ -5684,38 +5746,38 @@ var FSWatcher = class extends EventEmitter {
5684
5746
  * @param stats arguments to be passed with event
5685
5747
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
5686
5748
  */
5687
- async _emit(event, path36, stats) {
5749
+ async _emit(event, path37, stats) {
5688
5750
  if (this.closed)
5689
5751
  return;
5690
5752
  const opts = this.options;
5691
5753
  if (isWindows)
5692
- path36 = sysPath2.normalize(path36);
5754
+ path37 = sp2.normalize(path37);
5693
5755
  if (opts.cwd)
5694
- path36 = sysPath2.relative(opts.cwd, path36);
5695
- const args = [path36];
5756
+ path37 = sp2.relative(opts.cwd, path37);
5757
+ const args = [path37];
5696
5758
  if (stats != null)
5697
5759
  args.push(stats);
5698
5760
  const awf = opts.awaitWriteFinish;
5699
5761
  let pw;
5700
- if (awf && (pw = this._pendingWrites.get(path36))) {
5762
+ if (awf && (pw = this._pendingWrites.get(path37))) {
5701
5763
  pw.lastChange = /* @__PURE__ */ new Date();
5702
5764
  return this;
5703
5765
  }
5704
5766
  if (opts.atomic) {
5705
5767
  if (event === EVENTS.UNLINK) {
5706
- this._pendingUnlinks.set(path36, [event, ...args]);
5768
+ this._pendingUnlinks.set(path37, [event, ...args]);
5707
5769
  setTimeout(() => {
5708
- this._pendingUnlinks.forEach((entry, path37) => {
5770
+ this._pendingUnlinks.forEach((entry, path38) => {
5709
5771
  this.emit(...entry);
5710
5772
  this.emit(EVENTS.ALL, ...entry);
5711
- this._pendingUnlinks.delete(path37);
5773
+ this._pendingUnlinks.delete(path38);
5712
5774
  });
5713
5775
  }, typeof opts.atomic === "number" ? opts.atomic : 100);
5714
5776
  return this;
5715
5777
  }
5716
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path36)) {
5778
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path37)) {
5717
5779
  event = EVENTS.CHANGE;
5718
- this._pendingUnlinks.delete(path36);
5780
+ this._pendingUnlinks.delete(path37);
5719
5781
  }
5720
5782
  }
5721
5783
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
@@ -5733,16 +5795,16 @@ var FSWatcher = class extends EventEmitter {
5733
5795
  this.emitWithAll(event, args);
5734
5796
  }
5735
5797
  };
5736
- this._awaitWriteFinish(path36, awf.stabilityThreshold, event, awfEmit);
5798
+ this._awaitWriteFinish(path37, awf.stabilityThreshold, event, awfEmit);
5737
5799
  return this;
5738
5800
  }
5739
5801
  if (event === EVENTS.CHANGE) {
5740
- const isThrottled = !this._throttle(EVENTS.CHANGE, path36, 50);
5802
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path37, 50);
5741
5803
  if (isThrottled)
5742
5804
  return this;
5743
5805
  }
5744
5806
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
5745
- const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path36) : path36;
5807
+ const fullPath = opts.cwd ? sp2.join(opts.cwd, path37) : path37;
5746
5808
  let stats2;
5747
5809
  try {
5748
5810
  stats2 = await stat3(fullPath);
@@ -5773,23 +5835,23 @@ var FSWatcher = class extends EventEmitter {
5773
5835
  * @param timeout duration of time to suppress duplicate actions
5774
5836
  * @returns tracking object or false if action should be suppressed
5775
5837
  */
5776
- _throttle(actionType, path36, timeout) {
5838
+ _throttle(actionType, path37, timeout) {
5777
5839
  if (!this._throttled.has(actionType)) {
5778
5840
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
5779
5841
  }
5780
5842
  const action = this._throttled.get(actionType);
5781
5843
  if (!action)
5782
5844
  throw new Error("invalid throttle");
5783
- const actionPath = action.get(path36);
5845
+ const actionPath = action.get(path37);
5784
5846
  if (actionPath) {
5785
5847
  actionPath.count++;
5786
5848
  return false;
5787
5849
  }
5788
5850
  let timeoutObject;
5789
5851
  const clear = () => {
5790
- const item = action.get(path36);
5852
+ const item = action.get(path37);
5791
5853
  const count = item ? item.count : 0;
5792
- action.delete(path36);
5854
+ action.delete(path37);
5793
5855
  clearTimeout(timeoutObject);
5794
5856
  if (item)
5795
5857
  clearTimeout(item.timeoutObject);
@@ -5797,7 +5859,7 @@ var FSWatcher = class extends EventEmitter {
5797
5859
  };
5798
5860
  timeoutObject = setTimeout(clear, timeout);
5799
5861
  const thr = { timeoutObject, clear, count: 0 };
5800
- action.set(path36, thr);
5862
+ action.set(path37, thr);
5801
5863
  return thr;
5802
5864
  }
5803
5865
  _incrReadyCount() {
@@ -5811,44 +5873,44 @@ var FSWatcher = class extends EventEmitter {
5811
5873
  * @param event
5812
5874
  * @param awfEmit Callback to be called when ready for event to be emitted.
5813
5875
  */
5814
- _awaitWriteFinish(path36, threshold, event, awfEmit) {
5876
+ _awaitWriteFinish(path37, threshold, event, awfEmit) {
5815
5877
  const awf = this.options.awaitWriteFinish;
5816
5878
  if (typeof awf !== "object")
5817
5879
  return;
5818
5880
  const pollInterval = awf.pollInterval;
5819
5881
  let timeoutHandler;
5820
- let fullPath = path36;
5821
- if (this.options.cwd && !sysPath2.isAbsolute(path36)) {
5822
- fullPath = sysPath2.join(this.options.cwd, path36);
5882
+ let fullPath = path37;
5883
+ if (this.options.cwd && !sp2.isAbsolute(path37)) {
5884
+ fullPath = sp2.join(this.options.cwd, path37);
5823
5885
  }
5824
5886
  const now = /* @__PURE__ */ new Date();
5825
5887
  const writes = this._pendingWrites;
5826
5888
  function awaitWriteFinishFn(prevStat) {
5827
5889
  statcb(fullPath, (err, curStat) => {
5828
- if (err || !writes.has(path36)) {
5890
+ if (err || !writes.has(path37)) {
5829
5891
  if (err && err.code !== "ENOENT")
5830
5892
  awfEmit(err);
5831
5893
  return;
5832
5894
  }
5833
5895
  const now2 = Number(/* @__PURE__ */ new Date());
5834
5896
  if (prevStat && curStat.size !== prevStat.size) {
5835
- writes.get(path36).lastChange = now2;
5897
+ writes.get(path37).lastChange = now2;
5836
5898
  }
5837
- const pw = writes.get(path36);
5899
+ const pw = writes.get(path37);
5838
5900
  const df = now2 - pw.lastChange;
5839
5901
  if (df >= threshold) {
5840
- writes.delete(path36);
5902
+ writes.delete(path37);
5841
5903
  awfEmit(void 0, curStat);
5842
5904
  } else {
5843
5905
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
5844
5906
  }
5845
5907
  });
5846
5908
  }
5847
- if (!writes.has(path36)) {
5848
- writes.set(path36, {
5909
+ if (!writes.has(path37)) {
5910
+ writes.set(path37, {
5849
5911
  lastChange: now,
5850
5912
  cancelWait: () => {
5851
- writes.delete(path36);
5913
+ writes.delete(path37);
5852
5914
  clearTimeout(timeoutHandler);
5853
5915
  return event;
5854
5916
  }
@@ -5859,8 +5921,8 @@ var FSWatcher = class extends EventEmitter {
5859
5921
  /**
5860
5922
  * Determines whether user has asked to ignore this path.
5861
5923
  */
5862
- _isIgnored(path36, stats) {
5863
- if (this.options.atomic && DOT_RE.test(path36))
5924
+ _isIgnored(path37, stats) {
5925
+ if (this.options.atomic && DOT_RE.test(path37))
5864
5926
  return true;
5865
5927
  if (!this._userIgnored) {
5866
5928
  const { cwd } = this.options;
@@ -5870,17 +5932,17 @@ var FSWatcher = class extends EventEmitter {
5870
5932
  const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
5871
5933
  this._userIgnored = anymatch(list, void 0);
5872
5934
  }
5873
- return this._userIgnored(path36, stats);
5935
+ return this._userIgnored(path37, stats);
5874
5936
  }
5875
- _isntIgnored(path36, stat5) {
5876
- return !this._isIgnored(path36, stat5);
5937
+ _isntIgnored(path37, stat5) {
5938
+ return !this._isIgnored(path37, stat5);
5877
5939
  }
5878
5940
  /**
5879
5941
  * Provides a set of common helpers and properties relating to symlink handling.
5880
5942
  * @param path file or directory pattern being watched
5881
5943
  */
5882
- _getWatchHelpers(path36) {
5883
- return new WatchHelper(path36, this.options.followSymlinks, this);
5944
+ _getWatchHelpers(path37) {
5945
+ return new WatchHelper(path37, this.options.followSymlinks, this);
5884
5946
  }
5885
5947
  // Directory helpers
5886
5948
  // -----------------
@@ -5889,7 +5951,7 @@ var FSWatcher = class extends EventEmitter {
5889
5951
  * @param directory path of the directory
5890
5952
  */
5891
5953
  _getWatchedDir(directory) {
5892
- const dir = sysPath2.resolve(directory);
5954
+ const dir = sp2.resolve(directory);
5893
5955
  if (!this._watched.has(dir))
5894
5956
  this._watched.set(dir, new DirEntry(dir, this._boundRemove));
5895
5957
  return this._watched.get(dir);
@@ -5912,63 +5974,63 @@ var FSWatcher = class extends EventEmitter {
5912
5974
  * @param item base path of item/directory
5913
5975
  */
5914
5976
  _remove(directory, item, isDirectory) {
5915
- const path36 = sysPath2.join(directory, item);
5916
- const fullPath = sysPath2.resolve(path36);
5917
- isDirectory = isDirectory != null ? isDirectory : this._watched.has(path36) || this._watched.has(fullPath);
5918
- if (!this._throttle("remove", path36, 100))
5977
+ const path37 = sp2.join(directory, item);
5978
+ const fullPath = sp2.resolve(path37);
5979
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path37) || this._watched.has(fullPath);
5980
+ if (!this._throttle("remove", path37, 100))
5919
5981
  return;
5920
5982
  if (!isDirectory && this._watched.size === 1) {
5921
5983
  this.add(directory, item, true);
5922
5984
  }
5923
- const wp = this._getWatchedDir(path36);
5985
+ const wp = this._getWatchedDir(path37);
5924
5986
  const nestedDirectoryChildren = wp.getChildren();
5925
- nestedDirectoryChildren.forEach((nested) => this._remove(path36, nested));
5987
+ nestedDirectoryChildren.forEach((nested) => this._remove(path37, nested));
5926
5988
  const parent = this._getWatchedDir(directory);
5927
5989
  const wasTracked = parent.has(item);
5928
5990
  parent.remove(item);
5929
5991
  if (this._symlinkPaths.has(fullPath)) {
5930
5992
  this._symlinkPaths.delete(fullPath);
5931
5993
  }
5932
- let relPath = path36;
5994
+ let relPath = path37;
5933
5995
  if (this.options.cwd)
5934
- relPath = sysPath2.relative(this.options.cwd, path36);
5996
+ relPath = sp2.relative(this.options.cwd, path37);
5935
5997
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
5936
5998
  const event = this._pendingWrites.get(relPath).cancelWait();
5937
5999
  if (event === EVENTS.ADD)
5938
6000
  return;
5939
6001
  }
5940
- this._watched.delete(path36);
6002
+ this._watched.delete(path37);
5941
6003
  this._watched.delete(fullPath);
5942
6004
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
5943
- if (wasTracked && !this._isIgnored(path36))
5944
- this._emit(eventName, path36);
5945
- this._closePath(path36);
6005
+ if (wasTracked && !this._isIgnored(path37))
6006
+ this._emit(eventName, path37);
6007
+ this._closePath(path37);
5946
6008
  }
5947
6009
  /**
5948
6010
  * Closes all watchers for a path
5949
6011
  */
5950
- _closePath(path36) {
5951
- this._closeFile(path36);
5952
- const dir = sysPath2.dirname(path36);
5953
- this._getWatchedDir(dir).remove(sysPath2.basename(path36));
6012
+ _closePath(path37) {
6013
+ this._closeFile(path37);
6014
+ const dir = sp2.dirname(path37);
6015
+ this._getWatchedDir(dir).remove(sp2.basename(path37));
5954
6016
  }
5955
6017
  /**
5956
6018
  * Closes only file-specific watchers
5957
6019
  */
5958
- _closeFile(path36) {
5959
- const closers = this._closers.get(path36);
6020
+ _closeFile(path37) {
6021
+ const closers = this._closers.get(path37);
5960
6022
  if (!closers)
5961
6023
  return;
5962
6024
  closers.forEach((closer) => closer());
5963
- this._closers.delete(path36);
6025
+ this._closers.delete(path37);
5964
6026
  }
5965
- _addPathCloser(path36, closer) {
6027
+ _addPathCloser(path37, closer) {
5966
6028
  if (!closer)
5967
6029
  return;
5968
- let list = this._closers.get(path36);
6030
+ let list = this._closers.get(path37);
5969
6031
  if (!list) {
5970
6032
  list = [];
5971
- this._closers.set(path36, list);
6033
+ this._closers.set(path37, list);
5972
6034
  }
5973
6035
  list.push(closer);
5974
6036
  }
@@ -5995,15 +6057,15 @@ function watch(paths, options = {}) {
5995
6057
  watcher.add(paths);
5996
6058
  return watcher;
5997
6059
  }
5998
- var esm_default = { watch, FSWatcher };
6060
+ var chokidar_default = { watch, FSWatcher };
5999
6061
 
6000
6062
  // src/runtime/buildPlugin.ts
6001
6063
  import path11 from "pathe";
6002
6064
 
6003
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/index.js
6065
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/index.js
6004
6066
  init_esm_shims();
6005
6067
 
6006
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/index.js
6068
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/index.js
6007
6069
  init_esm_shims();
6008
6070
 
6009
6071
  // ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/index.js
@@ -6908,7 +6970,7 @@ var path9 = {
6908
6970
  };
6909
6971
  var sep = defaultPlatform === "win32" ? path9.win32.sep : path9.posix.sep;
6910
6972
  minimatch.sep = sep;
6911
- var GLOBSTAR = Symbol("globstar **");
6973
+ var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
6912
6974
  minimatch.GLOBSTAR = GLOBSTAR;
6913
6975
  var qmark2 = "[^/]";
6914
6976
  var star2 = qmark2 + "*?";
@@ -7572,11 +7634,11 @@ minimatch.Minimatch = Minimatch;
7572
7634
  minimatch.escape = escape;
7573
7635
  minimatch.unescape = unescape2;
7574
7636
 
7575
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/glob.js
7637
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/glob.js
7576
7638
  init_esm_shims();
7577
7639
  import { fileURLToPath as fileURLToPath2 } from "url";
7578
7640
 
7579
- // ../../node_modules/.pnpm/path-scurry@2.0.0/node_modules/path-scurry/dist/esm/index.js
7641
+ // ../../node_modules/.pnpm/path-scurry@2.0.1/node_modules/path-scurry/dist/esm/index.js
7580
7642
  init_esm_shims();
7581
7643
  import { posix, win32 } from "path";
7582
7644
  import { fileURLToPath } from "url";
@@ -7597,37 +7659,37 @@ var isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass ||
7597
7659
  var isReadable = (s) => !!s && typeof s === "object" && s instanceof EventEmitter2 && typeof s.pipe === "function" && // node core Writable streams have a pipe() method, but it throws
7598
7660
  s.pipe !== Stream.Writable.prototype.pipe;
7599
7661
  var isWritable = (s) => !!s && typeof s === "object" && s instanceof EventEmitter2 && typeof s.write === "function" && typeof s.end === "function";
7600
- var EOF = Symbol("EOF");
7601
- var MAYBE_EMIT_END = Symbol("maybeEmitEnd");
7602
- var EMITTED_END = Symbol("emittedEnd");
7603
- var EMITTING_END = Symbol("emittingEnd");
7604
- var EMITTED_ERROR = Symbol("emittedError");
7605
- var CLOSED = Symbol("closed");
7606
- var READ = Symbol("read");
7607
- var FLUSH = Symbol("flush");
7608
- var FLUSHCHUNK = Symbol("flushChunk");
7609
- var ENCODING = Symbol("encoding");
7610
- var DECODER = Symbol("decoder");
7611
- var FLOWING = Symbol("flowing");
7612
- var PAUSED = Symbol("paused");
7613
- var RESUME = Symbol("resume");
7614
- var BUFFER = Symbol("buffer");
7615
- var PIPES = Symbol("pipes");
7616
- var BUFFERLENGTH = Symbol("bufferLength");
7617
- var BUFFERPUSH = Symbol("bufferPush");
7618
- var BUFFERSHIFT = Symbol("bufferShift");
7619
- var OBJECTMODE = Symbol("objectMode");
7620
- var DESTROYED = Symbol("destroyed");
7621
- var ERROR = Symbol("error");
7622
- var EMITDATA = Symbol("emitData");
7623
- var EMITEND = Symbol("emitEnd");
7624
- var EMITEND2 = Symbol("emitEnd2");
7625
- var ASYNC = Symbol("async");
7626
- var ABORT = Symbol("abort");
7627
- var ABORTED = Symbol("aborted");
7628
- var SIGNAL = Symbol("signal");
7629
- var DATALISTENERS = Symbol("dataListeners");
7630
- var DISCARDED = Symbol("discarded");
7662
+ var EOF = /* @__PURE__ */ Symbol("EOF");
7663
+ var MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd");
7664
+ var EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd");
7665
+ var EMITTING_END = /* @__PURE__ */ Symbol("emittingEnd");
7666
+ var EMITTED_ERROR = /* @__PURE__ */ Symbol("emittedError");
7667
+ var CLOSED = /* @__PURE__ */ Symbol("closed");
7668
+ var READ = /* @__PURE__ */ Symbol("read");
7669
+ var FLUSH = /* @__PURE__ */ Symbol("flush");
7670
+ var FLUSHCHUNK = /* @__PURE__ */ Symbol("flushChunk");
7671
+ var ENCODING = /* @__PURE__ */ Symbol("encoding");
7672
+ var DECODER = /* @__PURE__ */ Symbol("decoder");
7673
+ var FLOWING = /* @__PURE__ */ Symbol("flowing");
7674
+ var PAUSED = /* @__PURE__ */ Symbol("paused");
7675
+ var RESUME = /* @__PURE__ */ Symbol("resume");
7676
+ var BUFFER = /* @__PURE__ */ Symbol("buffer");
7677
+ var PIPES = /* @__PURE__ */ Symbol("pipes");
7678
+ var BUFFERLENGTH = /* @__PURE__ */ Symbol("bufferLength");
7679
+ var BUFFERPUSH = /* @__PURE__ */ Symbol("bufferPush");
7680
+ var BUFFERSHIFT = /* @__PURE__ */ Symbol("bufferShift");
7681
+ var OBJECTMODE = /* @__PURE__ */ Symbol("objectMode");
7682
+ var DESTROYED = /* @__PURE__ */ Symbol("destroyed");
7683
+ var ERROR = /* @__PURE__ */ Symbol("error");
7684
+ var EMITDATA = /* @__PURE__ */ Symbol("emitData");
7685
+ var EMITEND = /* @__PURE__ */ Symbol("emitEnd");
7686
+ var EMITEND2 = /* @__PURE__ */ Symbol("emitEnd2");
7687
+ var ASYNC = /* @__PURE__ */ Symbol("async");
7688
+ var ABORT = /* @__PURE__ */ Symbol("abort");
7689
+ var ABORTED = /* @__PURE__ */ Symbol("aborted");
7690
+ var SIGNAL = /* @__PURE__ */ Symbol("signal");
7691
+ var DATALISTENERS = /* @__PURE__ */ Symbol("dataListeners");
7692
+ var DISCARDED = /* @__PURE__ */ Symbol("discarded");
7631
7693
  var defer = (fn) => Promise.resolve().then(fn);
7632
7694
  var nodefer = (fn) => fn();
7633
7695
  var isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish";
@@ -8463,7 +8525,7 @@ var Minipass = class extends EventEmitter2 {
8463
8525
  }
8464
8526
  };
8465
8527
 
8466
- // ../../node_modules/.pnpm/path-scurry@2.0.0/node_modules/path-scurry/dist/esm/index.js
8528
+ // ../../node_modules/.pnpm/path-scurry@2.0.1/node_modules/path-scurry/dist/esm/index.js
8467
8529
  var realpathSync = rps.native;
8468
8530
  var defaultFS = {
8469
8531
  lstatSync,
@@ -8508,7 +8570,7 @@ var ENOREALPATH = 512;
8508
8570
  var ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
8509
8571
  var TYPEMASK = 1023;
8510
8572
  var entToType = (s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN;
8511
- var normalizeCache = /* @__PURE__ */ new Map();
8573
+ var normalizeCache = new LRUCache({ max: 2 ** 12 });
8512
8574
  var normalize2 = (s) => {
8513
8575
  const c = normalizeCache.get(s);
8514
8576
  if (c)
@@ -8517,7 +8579,7 @@ var normalize2 = (s) => {
8517
8579
  normalizeCache.set(s, n2);
8518
8580
  return n2;
8519
8581
  };
8520
- var normalizeNocaseCache = /* @__PURE__ */ new Map();
8582
+ var normalizeNocaseCache = new LRUCache({ max: 2 ** 12 });
8521
8583
  var normalizeNocase = (s) => {
8522
8584
  const c = normalizeNocaseCache.get(s);
8523
8585
  if (c)
@@ -8540,7 +8602,7 @@ var ChildrenCache = class extends LRUCache {
8540
8602
  });
8541
8603
  }
8542
8604
  };
8543
- var setAsCwd = Symbol("PathScurry setAsCwd");
8605
+ var setAsCwd = /* @__PURE__ */ Symbol("PathScurry setAsCwd");
8544
8606
  var PathBase = class {
8545
8607
  /**
8546
8608
  * the basename of this path
@@ -8674,6 +8736,7 @@ var PathBase = class {
8674
8736
  get parentPath() {
8675
8737
  return (this.parent || this).fullpath();
8676
8738
  }
8739
+ /* c8 ignore start */
8677
8740
  /**
8678
8741
  * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
8679
8742
  * this property refers to the *parent* path, not the path object itself.
@@ -8683,6 +8746,7 @@ var PathBase = class {
8683
8746
  get path() {
8684
8747
  return this.parentPath;
8685
8748
  }
8749
+ /* c8 ignore stop */
8686
8750
  /**
8687
8751
  * Do not create new Path objects directly. They should always be accessed
8688
8752
  * via the PathScurry class or other methods on the Path class.
@@ -8728,12 +8792,12 @@ var PathBase = class {
8728
8792
  /**
8729
8793
  * Get the Path object referenced by the string path, resolved from this Path
8730
8794
  */
8731
- resolve(path36) {
8732
- if (!path36) {
8795
+ resolve(path37) {
8796
+ if (!path37) {
8733
8797
  return this;
8734
8798
  }
8735
- const rootPath = this.getRootString(path36);
8736
- const dir = path36.substring(rootPath.length);
8799
+ const rootPath = this.getRootString(path37);
8800
+ const dir = path37.substring(rootPath.length);
8737
8801
  const dirParts = dir.split(this.splitSep);
8738
8802
  const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
8739
8803
  return result;
@@ -9485,8 +9549,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
9485
9549
  /**
9486
9550
  * @internal
9487
9551
  */
9488
- getRootString(path36) {
9489
- return win32.parse(path36).root;
9552
+ getRootString(path37) {
9553
+ return win32.parse(path37).root;
9490
9554
  }
9491
9555
  /**
9492
9556
  * @internal
@@ -9532,8 +9596,8 @@ var PathPosix = class _PathPosix extends PathBase {
9532
9596
  /**
9533
9597
  * @internal
9534
9598
  */
9535
- getRootString(path36) {
9536
- return path36.startsWith("/") ? "/" : "";
9599
+ getRootString(path37) {
9600
+ return path37.startsWith("/") ? "/" : "";
9537
9601
  }
9538
9602
  /**
9539
9603
  * @internal
@@ -9622,11 +9686,11 @@ var PathScurryBase = class {
9622
9686
  /**
9623
9687
  * Get the depth of a provided path, string, or the cwd
9624
9688
  */
9625
- depth(path36 = this.cwd) {
9626
- if (typeof path36 === "string") {
9627
- path36 = this.cwd.resolve(path36);
9689
+ depth(path37 = this.cwd) {
9690
+ if (typeof path37 === "string") {
9691
+ path37 = this.cwd.resolve(path37);
9628
9692
  }
9629
- return path36.depth();
9693
+ return path37.depth();
9630
9694
  }
9631
9695
  /**
9632
9696
  * Return the cache of child entries. Exposed so subclasses can create
@@ -10113,9 +10177,9 @@ var PathScurryBase = class {
10113
10177
  process10();
10114
10178
  return results;
10115
10179
  }
10116
- chdir(path36 = this.cwd) {
10180
+ chdir(path37 = this.cwd) {
10117
10181
  const oldCwd = this.cwd;
10118
- this.cwd = typeof path36 === "string" ? this.cwd.resolve(path36) : path36;
10182
+ this.cwd = typeof path37 === "string" ? this.cwd.resolve(path37) : path37;
10119
10183
  this.cwd[setAsCwd](oldCwd);
10120
10184
  }
10121
10185
  };
@@ -10189,7 +10253,7 @@ var PathScurryDarwin = class extends PathScurryPosix {
10189
10253
  var Path = process.platform === "win32" ? PathWin32 : PathPosix;
10190
10254
  var PathScurry = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
10191
10255
 
10192
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/pattern.js
10256
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/pattern.js
10193
10257
  init_esm_shims();
10194
10258
  var isPatternList = (pl2) => pl2.length >= 1;
10195
10259
  var isGlobList = (gl) => gl.length >= 1;
@@ -10355,10 +10419,10 @@ var Pattern = class _Pattern {
10355
10419
  }
10356
10420
  };
10357
10421
 
10358
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/walker.js
10422
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/walker.js
10359
10423
  init_esm_shims();
10360
10424
 
10361
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/ignore.js
10425
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/ignore.js
10362
10426
  init_esm_shims();
10363
10427
  var defaultPlatform2 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
10364
10428
  var Ignore = class {
@@ -10446,7 +10510,7 @@ var Ignore = class {
10446
10510
  }
10447
10511
  };
10448
10512
 
10449
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/processor.js
10513
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/processor.js
10450
10514
  init_esm_shims();
10451
10515
  var HasWalkedCache = class _HasWalkedCache {
10452
10516
  store;
@@ -10477,8 +10541,8 @@ var MatchRecord = class {
10477
10541
  }
10478
10542
  // match, absolute, ifdir
10479
10543
  entries() {
10480
- return [...this.store.entries()].map(([path36, n2]) => [
10481
- path36,
10544
+ return [...this.store.entries()].map(([path37, n2]) => [
10545
+ path37,
10482
10546
  !!(n2 & 2),
10483
10547
  !!(n2 & 1)
10484
10548
  ]);
@@ -10668,7 +10732,7 @@ var Processor = class _Processor {
10668
10732
  }
10669
10733
  };
10670
10734
 
10671
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/walker.js
10735
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/walker.js
10672
10736
  var makeIgnore = (ignore, opts) => typeof ignore === "string" ? new Ignore([ignore], opts) : Array.isArray(ignore) ? new Ignore(ignore, opts) : ignore;
10673
10737
  var GlobUtil = class {
10674
10738
  path;
@@ -10683,9 +10747,9 @@ var GlobUtil = class {
10683
10747
  signal;
10684
10748
  maxDepth;
10685
10749
  includeChildMatches;
10686
- constructor(patterns, path36, opts) {
10750
+ constructor(patterns, path37, opts) {
10687
10751
  this.patterns = patterns;
10688
- this.path = path36;
10752
+ this.path = path37;
10689
10753
  this.opts = opts;
10690
10754
  this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
10691
10755
  this.includeChildMatches = opts.includeChildMatches !== false;
@@ -10704,11 +10768,11 @@ var GlobUtil = class {
10704
10768
  });
10705
10769
  }
10706
10770
  }
10707
- #ignored(path36) {
10708
- return this.seen.has(path36) || !!this.#ignore?.ignored?.(path36);
10771
+ #ignored(path37) {
10772
+ return this.seen.has(path37) || !!this.#ignore?.ignored?.(path37);
10709
10773
  }
10710
- #childrenIgnored(path36) {
10711
- return !!this.#ignore?.childrenIgnored?.(path36);
10774
+ #childrenIgnored(path37) {
10775
+ return !!this.#ignore?.childrenIgnored?.(path37);
10712
10776
  }
10713
10777
  // backpressure mechanism
10714
10778
  pause() {
@@ -10923,8 +10987,8 @@ var GlobUtil = class {
10923
10987
  };
10924
10988
  var GlobWalker = class extends GlobUtil {
10925
10989
  matches = /* @__PURE__ */ new Set();
10926
- constructor(patterns, path36, opts) {
10927
- super(patterns, path36, opts);
10990
+ constructor(patterns, path37, opts) {
10991
+ super(patterns, path37, opts);
10928
10992
  }
10929
10993
  matchEmit(e) {
10930
10994
  this.matches.add(e);
@@ -10961,8 +11025,8 @@ var GlobWalker = class extends GlobUtil {
10961
11025
  };
10962
11026
  var GlobStream = class extends GlobUtil {
10963
11027
  results;
10964
- constructor(patterns, path36, opts) {
10965
- super(patterns, path36, opts);
11028
+ constructor(patterns, path37, opts) {
11029
+ super(patterns, path37, opts);
10966
11030
  this.results = new Minipass({
10967
11031
  signal: this.signal,
10968
11032
  objectMode: true
@@ -10995,7 +11059,7 @@ var GlobStream = class extends GlobUtil {
10995
11059
  }
10996
11060
  };
10997
11061
 
10998
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/glob.js
11062
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/glob.js
10999
11063
  var defaultPlatform3 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
11000
11064
  var Glob = class {
11001
11065
  absolute;
@@ -11195,7 +11259,7 @@ var Glob = class {
11195
11259
  }
11196
11260
  };
11197
11261
 
11198
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/has-magic.js
11262
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/has-magic.js
11199
11263
  init_esm_shims();
11200
11264
  var hasMagic = (pattern, options = {}) => {
11201
11265
  if (!Array.isArray(pattern)) {
@@ -11208,7 +11272,7 @@ var hasMagic = (pattern, options = {}) => {
11208
11272
  return false;
11209
11273
  };
11210
11274
 
11211
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/index.js
11275
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/index.js
11212
11276
  function globStreamSync(pattern, options = {}) {
11213
11277
  return new Glob(pattern, options).streamSync();
11214
11278
  }
@@ -11256,7 +11320,7 @@ var glob = Object.assign(glob_, {
11256
11320
  });
11257
11321
  glob.glob = glob;
11258
11322
 
11259
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/opt-arg.js
11323
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/opt-arg.js
11260
11324
  init_esm_shims();
11261
11325
  var typeOrUndef = (val, t2) => typeof val === "undefined" || typeof val === t2;
11262
11326
  var isRimrafOptions = (o) => !!o && typeof o === "object" && typeOrUndef(o.preserveRoot, "boolean") && typeOrUndef(o.tmp, "string") && typeOrUndef(o.maxRetries, "number") && typeOrUndef(o.retryDelay, "number") && typeOrUndef(o.backoff, "number") && typeOrUndef(o.maxBackoff, "number") && (typeOrUndef(o.glob, "boolean") || o.glob && typeof o.glob === "object") && typeOrUndef(o.filter, "function");
@@ -11289,67 +11353,67 @@ var optArgT = (opt) => {
11289
11353
  var optArg = (opt = {}) => optArgT(opt);
11290
11354
  var optArgSync = (opt = {}) => optArgT(opt);
11291
11355
 
11292
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/path-arg.js
11356
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/path-arg.js
11293
11357
  init_esm_shims();
11294
11358
  import { parse as parse2, resolve as resolve3 } from "path";
11295
11359
  import { inspect } from "util";
11296
- var pathArg = (path36, opt = {}) => {
11297
- const type = typeof path36;
11360
+ var pathArg = (path37, opt = {}) => {
11361
+ const type = typeof path37;
11298
11362
  if (type !== "string") {
11299
- const ctor = path36 && type === "object" && path36.constructor;
11300
- const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? inspect(path36) : `type ${type} ${path36}`;
11363
+ const ctor = path37 && type === "object" && path37.constructor;
11364
+ const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? inspect(path37) : `type ${type} ${path37}`;
11301
11365
  const msg = `The "path" argument must be of type string. Received ${received}`;
11302
11366
  throw Object.assign(new TypeError(msg), {
11303
- path: path36,
11367
+ path: path37,
11304
11368
  code: "ERR_INVALID_ARG_TYPE"
11305
11369
  });
11306
11370
  }
11307
- if (/\0/.test(path36)) {
11371
+ if (/\0/.test(path37)) {
11308
11372
  const msg = "path must be a string without null bytes";
11309
11373
  throw Object.assign(new TypeError(msg), {
11310
- path: path36,
11374
+ path: path37,
11311
11375
  code: "ERR_INVALID_ARG_VALUE"
11312
11376
  });
11313
11377
  }
11314
- path36 = resolve3(path36);
11315
- const { root } = parse2(path36);
11316
- if (path36 === root && opt.preserveRoot !== false) {
11378
+ path37 = resolve3(path37);
11379
+ const { root } = parse2(path37);
11380
+ if (path37 === root && opt.preserveRoot !== false) {
11317
11381
  const msg = "refusing to remove root directory without preserveRoot:false";
11318
11382
  throw Object.assign(new Error(msg), {
11319
- path: path36,
11383
+ path: path37,
11320
11384
  code: "ERR_PRESERVE_ROOT"
11321
11385
  });
11322
11386
  }
11323
11387
  if (process.platform === "win32") {
11324
11388
  const badWinChars = /[*|"<>?:]/;
11325
- const { root: root2 } = parse2(path36);
11326
- if (badWinChars.test(path36.substring(root2.length))) {
11389
+ const { root: root2 } = parse2(path37);
11390
+ if (badWinChars.test(path37.substring(root2.length))) {
11327
11391
  throw Object.assign(new Error("Illegal characters in path."), {
11328
- path: path36,
11392
+ path: path37,
11329
11393
  code: "EINVAL"
11330
11394
  });
11331
11395
  }
11332
11396
  }
11333
- return path36;
11397
+ return path37;
11334
11398
  };
11335
11399
  var path_arg_default = pathArg;
11336
11400
 
11337
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-manual.js
11401
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-manual.js
11338
11402
  init_esm_shims();
11339
11403
 
11340
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-posix.js
11404
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-posix.js
11341
11405
  init_esm_shims();
11342
11406
 
11343
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/fs.js
11407
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/fs.js
11344
11408
  init_esm_shims();
11345
11409
  import { readdirSync as rdSync } from "fs";
11346
11410
  import fsPromises from "fs/promises";
11347
11411
  import { chmodSync, mkdirSync, renameSync, rmdirSync, rmSync, statSync, lstatSync as lstatSync2, unlinkSync } from "fs";
11348
- var readdirSync2 = (path36) => rdSync(path36, { withFileTypes: true });
11412
+ var readdirSync2 = (path37) => rdSync(path37, { withFileTypes: true });
11349
11413
  var promises = {
11350
11414
  chmod: fsPromises.chmod,
11351
11415
  mkdir: fsPromises.mkdir,
11352
- readdir: (path36) => fsPromises.readdir(path36, { withFileTypes: true }),
11416
+ readdir: (path37) => fsPromises.readdir(path37, { withFileTypes: true }),
11353
11417
  rename: fsPromises.rename,
11354
11418
  rm: fsPromises.rm,
11355
11419
  rmdir: fsPromises.rmdir,
@@ -11358,32 +11422,32 @@ var promises = {
11358
11422
  unlink: fsPromises.unlink
11359
11423
  };
11360
11424
 
11361
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-posix.js
11425
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-posix.js
11362
11426
  import { parse as parse3, resolve as resolve4 } from "path";
11363
11427
 
11364
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/readdir-or-error.js
11428
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/readdir-or-error.js
11365
11429
  init_esm_shims();
11366
11430
  var { readdir: readdir4 } = promises;
11367
- var readdirOrError = (path36) => readdir4(path36).catch((er) => er);
11368
- var readdirOrErrorSync = (path36) => {
11431
+ var readdirOrError = (path37) => readdir4(path37).catch((er) => er);
11432
+ var readdirOrErrorSync = (path37) => {
11369
11433
  try {
11370
- return readdirSync2(path36);
11434
+ return readdirSync2(path37);
11371
11435
  } catch (er) {
11372
11436
  return er;
11373
11437
  }
11374
11438
  };
11375
11439
 
11376
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/ignore-enoent.js
11440
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/ignore-enoent.js
11377
11441
  init_esm_shims();
11378
11442
 
11379
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/error.js
11443
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/error.js
11380
11444
  init_esm_shims();
11381
11445
  var isRecord = (o) => !!o && typeof o === "object";
11382
11446
  var hasString = (o, key) => key in o && typeof o[key] === "string";
11383
11447
  var isFsError = (o) => isRecord(o) && hasString(o, "code") && hasString(o, "path");
11384
11448
  var errorCode = (er) => isRecord(er) && hasString(er, "code") ? er.code : null;
11385
11449
 
11386
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/ignore-enoent.js
11450
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/ignore-enoent.js
11387
11451
  var ignoreENOENT = async (p, rethrow) => p.catch((er) => {
11388
11452
  if (errorCode(er) === "ENOENT") {
11389
11453
  return;
@@ -11401,19 +11465,19 @@ var ignoreENOENTSync = (fn, rethrow) => {
11401
11465
  }
11402
11466
  };
11403
11467
 
11404
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-posix.js
11468
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-posix.js
11405
11469
  var { lstat: lstat4, rmdir, unlink } = promises;
11406
- var rimrafPosix = async (path36, opt) => {
11470
+ var rimrafPosix = async (path37, opt) => {
11407
11471
  opt?.signal?.throwIfAborted();
11408
- return await ignoreENOENT(lstat4(path36).then((stat5) => rimrafPosixDir(path36, opt, stat5))) ?? true;
11472
+ return await ignoreENOENT(lstat4(path37).then((stat5) => rimrafPosixDir(path37, opt, stat5))) ?? true;
11409
11473
  };
11410
- var rimrafPosixSync = (path36, opt) => {
11474
+ var rimrafPosixSync = (path37, opt) => {
11411
11475
  opt?.signal?.throwIfAborted();
11412
- return ignoreENOENTSync(() => rimrafPosixDirSync(path36, opt, lstatSync2(path36))) ?? true;
11476
+ return ignoreENOENTSync(() => rimrafPosixDirSync(path37, opt, lstatSync2(path37))) ?? true;
11413
11477
  };
11414
- var rimrafPosixDir = async (path36, opt, ent) => {
11478
+ var rimrafPosixDir = async (path37, opt, ent) => {
11415
11479
  opt?.signal?.throwIfAborted();
11416
- const entries = ent.isDirectory() ? await readdirOrError(path36) : null;
11480
+ const entries = ent.isDirectory() ? await readdirOrError(path37) : null;
11417
11481
  if (!Array.isArray(entries)) {
11418
11482
  if (entries) {
11419
11483
  if (errorCode(entries) === "ENOENT") {
@@ -11423,28 +11487,28 @@ var rimrafPosixDir = async (path36, opt, ent) => {
11423
11487
  throw entries;
11424
11488
  }
11425
11489
  }
11426
- if (opt.filter && !await opt.filter(path36, ent)) {
11490
+ if (opt.filter && !await opt.filter(path37, ent)) {
11427
11491
  return false;
11428
11492
  }
11429
- await ignoreENOENT(unlink(path36));
11493
+ await ignoreENOENT(unlink(path37));
11430
11494
  return true;
11431
11495
  }
11432
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(resolve4(path36, ent2.name), opt, ent2)))).every((v) => v === true);
11496
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(resolve4(path37, ent2.name), opt, ent2)))).every((v) => v === true);
11433
11497
  if (!removedAll) {
11434
11498
  return false;
11435
11499
  }
11436
- if (opt.preserveRoot === false && path36 === parse3(path36).root) {
11500
+ if (opt.preserveRoot === false && path37 === parse3(path37).root) {
11437
11501
  return false;
11438
11502
  }
11439
- if (opt.filter && !await opt.filter(path36, ent)) {
11503
+ if (opt.filter && !await opt.filter(path37, ent)) {
11440
11504
  return false;
11441
11505
  }
11442
- await ignoreENOENT(rmdir(path36));
11506
+ await ignoreENOENT(rmdir(path37));
11443
11507
  return true;
11444
11508
  };
11445
- var rimrafPosixDirSync = (path36, opt, ent) => {
11509
+ var rimrafPosixDirSync = (path37, opt, ent) => {
11446
11510
  opt?.signal?.throwIfAborted();
11447
- const entries = ent.isDirectory() ? readdirOrErrorSync(path36) : null;
11511
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path37) : null;
11448
11512
  if (!Array.isArray(entries)) {
11449
11513
  if (entries) {
11450
11514
  if (errorCode(entries) === "ENOENT") {
@@ -11454,65 +11518,65 @@ var rimrafPosixDirSync = (path36, opt, ent) => {
11454
11518
  throw entries;
11455
11519
  }
11456
11520
  }
11457
- if (opt.filter && !opt.filter(path36, ent)) {
11521
+ if (opt.filter && !opt.filter(path37, ent)) {
11458
11522
  return false;
11459
11523
  }
11460
- ignoreENOENTSync(() => unlinkSync(path36));
11524
+ ignoreENOENTSync(() => unlinkSync(path37));
11461
11525
  return true;
11462
11526
  }
11463
11527
  let removedAll = true;
11464
11528
  for (const ent2 of entries) {
11465
- const p = resolve4(path36, ent2.name);
11529
+ const p = resolve4(path37, ent2.name);
11466
11530
  removedAll = rimrafPosixDirSync(p, opt, ent2) && removedAll;
11467
11531
  }
11468
- if (opt.preserveRoot === false && path36 === parse3(path36).root) {
11532
+ if (opt.preserveRoot === false && path37 === parse3(path37).root) {
11469
11533
  return false;
11470
11534
  }
11471
11535
  if (!removedAll) {
11472
11536
  return false;
11473
11537
  }
11474
- if (opt.filter && !opt.filter(path36, ent)) {
11538
+ if (opt.filter && !opt.filter(path37, ent)) {
11475
11539
  return false;
11476
11540
  }
11477
- ignoreENOENTSync(() => rmdirSync(path36));
11541
+ ignoreENOENTSync(() => rmdirSync(path37));
11478
11542
  return true;
11479
11543
  };
11480
11544
 
11481
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-windows.js
11545
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-windows.js
11482
11546
  init_esm_shims();
11483
11547
  import { parse as parse6, resolve as resolve7 } from "path";
11484
11548
 
11485
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/fix-eperm.js
11549
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/fix-eperm.js
11486
11550
  init_esm_shims();
11487
11551
  var { chmod } = promises;
11488
- var fixEPERM = (fn) => async (path36) => {
11552
+ var fixEPERM = (fn) => async (path37) => {
11489
11553
  try {
11490
- return void await ignoreENOENT(fn(path36));
11554
+ return void await ignoreENOENT(fn(path37));
11491
11555
  } catch (er) {
11492
11556
  if (errorCode(er) === "EPERM") {
11493
- if (!await ignoreENOENT(chmod(path36, 438).then(() => true), er)) {
11557
+ if (!await ignoreENOENT(chmod(path37, 438).then(() => true), er)) {
11494
11558
  return;
11495
11559
  }
11496
- return void await fn(path36);
11560
+ return void await fn(path37);
11497
11561
  }
11498
11562
  throw er;
11499
11563
  }
11500
11564
  };
11501
- var fixEPERMSync = (fn) => (path36) => {
11565
+ var fixEPERMSync = (fn) => (path37) => {
11502
11566
  try {
11503
- return void ignoreENOENTSync(() => fn(path36));
11567
+ return void ignoreENOENTSync(() => fn(path37));
11504
11568
  } catch (er) {
11505
11569
  if (errorCode(er) === "EPERM") {
11506
- if (!ignoreENOENTSync(() => (chmodSync(path36, 438), true), er)) {
11570
+ if (!ignoreENOENTSync(() => (chmodSync(path37, 438), true), er)) {
11507
11571
  return;
11508
11572
  }
11509
- return void fn(path36);
11573
+ return void fn(path37);
11510
11574
  }
11511
11575
  throw er;
11512
11576
  }
11513
11577
  };
11514
11578
 
11515
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/retry-busy.js
11579
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/retry-busy.js
11516
11580
  init_esm_shims();
11517
11581
  import { setTimeout as setTimeout2 } from "timers/promises";
11518
11582
  var MAXBACKOFF = 200;
@@ -11520,21 +11584,21 @@ var RATE = 1.2;
11520
11584
  var MAXRETRIES = 10;
11521
11585
  var codes = /* @__PURE__ */ new Set(["EMFILE", "ENFILE", "EBUSY"]);
11522
11586
  var retryBusy = (fn) => {
11523
- const method = async (path36, opt, backoff = 1, total = 0) => {
11587
+ const method = async (path37, opt, backoff = 1, total = 0) => {
11524
11588
  const mbo = opt.maxBackoff || MAXBACKOFF;
11525
11589
  const rate = opt.backoff || RATE;
11526
11590
  const max = opt.maxRetries || MAXRETRIES;
11527
11591
  let retries = 0;
11528
11592
  while (true) {
11529
11593
  try {
11530
- return await fn(path36);
11594
+ return await fn(path37);
11531
11595
  } catch (er) {
11532
- if (isFsError(er) && er.path === path36 && codes.has(er.code)) {
11596
+ if (isFsError(er) && er.path === path37 && codes.has(er.code)) {
11533
11597
  backoff = Math.ceil(backoff * rate);
11534
11598
  total = backoff + total;
11535
11599
  if (total < mbo) {
11536
11600
  await setTimeout2(backoff);
11537
- return method(path36, opt, backoff, total);
11601
+ return method(path37, opt, backoff, total);
11538
11602
  }
11539
11603
  if (retries < max) {
11540
11604
  retries++;
@@ -11548,14 +11612,14 @@ var retryBusy = (fn) => {
11548
11612
  return method;
11549
11613
  };
11550
11614
  var retryBusySync = (fn) => {
11551
- const method = (path36, opt) => {
11615
+ const method = (path37, opt) => {
11552
11616
  const max = opt.maxRetries || MAXRETRIES;
11553
11617
  let retries = 0;
11554
11618
  while (true) {
11555
11619
  try {
11556
- return fn(path36);
11620
+ return fn(path37);
11557
11621
  } catch (er) {
11558
- if (isFsError(er) && er.path === path36 && codes.has(er.code) && retries < max) {
11622
+ if (isFsError(er) && er.path === path37 && codes.has(er.code) && retries < max) {
11559
11623
  retries++;
11560
11624
  continue;
11561
11625
  }
@@ -11566,25 +11630,25 @@ var retryBusySync = (fn) => {
11566
11630
  return method;
11567
11631
  };
11568
11632
 
11569
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-move-remove.js
11633
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-move-remove.js
11570
11634
  init_esm_shims();
11571
11635
  import { basename as basename3, parse as parse5, resolve as resolve6 } from "path";
11572
11636
 
11573
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/default-tmp.js
11637
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/default-tmp.js
11574
11638
  init_esm_shims();
11575
11639
  import { tmpdir } from "os";
11576
11640
  import { parse as parse4, resolve as resolve5 } from "path";
11577
11641
  var { stat: stat4 } = promises;
11578
- var isDirSync = (path36) => {
11642
+ var isDirSync = (path37) => {
11579
11643
  try {
11580
- return statSync(path36).isDirectory();
11644
+ return statSync(path37).isDirectory();
11581
11645
  } catch {
11582
11646
  return false;
11583
11647
  }
11584
11648
  };
11585
- var isDir = (path36) => stat4(path36).then((st) => st.isDirectory(), () => false);
11586
- var win32DefaultTmp = async (path36) => {
11587
- const { root } = parse4(path36);
11649
+ var isDir = (path37) => stat4(path37).then((st) => st.isDirectory(), () => false);
11650
+ var win32DefaultTmp = async (path37) => {
11651
+ const { root } = parse4(path37);
11588
11652
  const tmp = tmpdir();
11589
11653
  const { root: tmpRoot } = parse4(tmp);
11590
11654
  if (root.toLowerCase() === tmpRoot.toLowerCase()) {
@@ -11596,8 +11660,8 @@ var win32DefaultTmp = async (path36) => {
11596
11660
  }
11597
11661
  return root;
11598
11662
  };
11599
- var win32DefaultTmpSync = (path36) => {
11600
- const { root } = parse4(path36);
11663
+ var win32DefaultTmpSync = (path37) => {
11664
+ const { root } = parse4(path37);
11601
11665
  const tmp = tmpdir();
11602
11666
  const { root: tmpRoot } = parse4(tmp);
11603
11667
  if (root.toLowerCase() === tmpRoot.toLowerCase()) {
@@ -11614,24 +11678,24 @@ var posixDefaultTmpSync = () => tmpdir();
11614
11678
  var defaultTmp = process.platform === "win32" ? win32DefaultTmp : posixDefaultTmp;
11615
11679
  var defaultTmpSync = process.platform === "win32" ? win32DefaultTmpSync : posixDefaultTmpSync;
11616
11680
 
11617
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-move-remove.js
11681
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-move-remove.js
11618
11682
  var { lstat: lstat5, rename, unlink: unlink2, rmdir: rmdir2 } = promises;
11619
- var uniqueFilename = (path36) => `.${basename3(path36)}.${Math.random()}`;
11683
+ var uniqueFilename = (path37) => `.${basename3(path37)}.${Math.random()}`;
11620
11684
  var unlinkFixEPERM = fixEPERM(unlink2);
11621
11685
  var unlinkFixEPERMSync = fixEPERMSync(unlinkSync);
11622
- var rimrafMoveRemove = async (path36, opt) => {
11686
+ var rimrafMoveRemove = async (path37, opt) => {
11623
11687
  opt?.signal?.throwIfAborted();
11624
- return await ignoreENOENT(lstat5(path36).then((stat5) => rimrafMoveRemoveDir(path36, opt, stat5))) ?? true;
11688
+ return await ignoreENOENT(lstat5(path37).then((stat5) => rimrafMoveRemoveDir(path37, opt, stat5))) ?? true;
11625
11689
  };
11626
- var rimrafMoveRemoveDir = async (path36, opt, ent) => {
11690
+ var rimrafMoveRemoveDir = async (path37, opt, ent) => {
11627
11691
  opt?.signal?.throwIfAborted();
11628
11692
  if (!opt.tmp) {
11629
- return rimrafMoveRemoveDir(path36, { ...opt, tmp: await defaultTmp(path36) }, ent);
11693
+ return rimrafMoveRemoveDir(path37, { ...opt, tmp: await defaultTmp(path37) }, ent);
11630
11694
  }
11631
- if (path36 === opt.tmp && parse5(path36).root !== path36) {
11695
+ if (path37 === opt.tmp && parse5(path37).root !== path37) {
11632
11696
  throw new Error("cannot delete temp directory used for deletion");
11633
11697
  }
11634
- const entries = ent.isDirectory() ? await readdirOrError(path36) : null;
11698
+ const entries = ent.isDirectory() ? await readdirOrError(path37) : null;
11635
11699
  if (!Array.isArray(entries)) {
11636
11700
  if (entries) {
11637
11701
  if (errorCode(entries) === "ENOENT") {
@@ -11641,44 +11705,44 @@ var rimrafMoveRemoveDir = async (path36, opt, ent) => {
11641
11705
  throw entries;
11642
11706
  }
11643
11707
  }
11644
- if (opt.filter && !await opt.filter(path36, ent)) {
11708
+ if (opt.filter && !await opt.filter(path37, ent)) {
11645
11709
  return false;
11646
11710
  }
11647
- await ignoreENOENT(tmpUnlink(path36, opt.tmp, unlinkFixEPERM));
11711
+ await ignoreENOENT(tmpUnlink(path37, opt.tmp, unlinkFixEPERM));
11648
11712
  return true;
11649
11713
  }
11650
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(resolve6(path36, ent2.name), opt, ent2)))).every((v) => v === true);
11714
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(resolve6(path37, ent2.name), opt, ent2)))).every((v) => v === true);
11651
11715
  if (!removedAll) {
11652
11716
  return false;
11653
11717
  }
11654
- if (opt.preserveRoot === false && path36 === parse5(path36).root) {
11718
+ if (opt.preserveRoot === false && path37 === parse5(path37).root) {
11655
11719
  return false;
11656
11720
  }
11657
- if (opt.filter && !await opt.filter(path36, ent)) {
11721
+ if (opt.filter && !await opt.filter(path37, ent)) {
11658
11722
  return false;
11659
11723
  }
11660
- await ignoreENOENT(tmpUnlink(path36, opt.tmp, rmdir2));
11724
+ await ignoreENOENT(tmpUnlink(path37, opt.tmp, rmdir2));
11661
11725
  return true;
11662
11726
  };
11663
- var tmpUnlink = async (path36, tmp, rm2) => {
11664
- const tmpFile = resolve6(tmp, uniqueFilename(path36));
11665
- await rename(path36, tmpFile);
11727
+ var tmpUnlink = async (path37, tmp, rm2) => {
11728
+ const tmpFile = resolve6(tmp, uniqueFilename(path37));
11729
+ await rename(path37, tmpFile);
11666
11730
  return await rm2(tmpFile);
11667
11731
  };
11668
- var rimrafMoveRemoveSync = (path36, opt) => {
11732
+ var rimrafMoveRemoveSync = (path37, opt) => {
11669
11733
  opt?.signal?.throwIfAborted();
11670
- return ignoreENOENTSync(() => rimrafMoveRemoveDirSync(path36, opt, lstatSync2(path36))) ?? true;
11734
+ return ignoreENOENTSync(() => rimrafMoveRemoveDirSync(path37, opt, lstatSync2(path37))) ?? true;
11671
11735
  };
11672
- var rimrafMoveRemoveDirSync = (path36, opt, ent) => {
11736
+ var rimrafMoveRemoveDirSync = (path37, opt, ent) => {
11673
11737
  opt?.signal?.throwIfAborted();
11674
11738
  if (!opt.tmp) {
11675
- return rimrafMoveRemoveDirSync(path36, { ...opt, tmp: defaultTmpSync(path36) }, ent);
11739
+ return rimrafMoveRemoveDirSync(path37, { ...opt, tmp: defaultTmpSync(path37) }, ent);
11676
11740
  }
11677
11741
  const tmp = opt.tmp;
11678
- if (path36 === opt.tmp && parse5(path36).root !== path36) {
11742
+ if (path37 === opt.tmp && parse5(path37).root !== path37) {
11679
11743
  throw new Error("cannot delete temp directory used for deletion");
11680
11744
  }
11681
- const entries = ent.isDirectory() ? readdirOrErrorSync(path36) : null;
11745
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path37) : null;
11682
11746
  if (!Array.isArray(entries)) {
11683
11747
  if (entries) {
11684
11748
  if (errorCode(entries) === "ENOENT") {
@@ -11688,79 +11752,79 @@ var rimrafMoveRemoveDirSync = (path36, opt, ent) => {
11688
11752
  throw entries;
11689
11753
  }
11690
11754
  }
11691
- if (opt.filter && !opt.filter(path36, ent)) {
11755
+ if (opt.filter && !opt.filter(path37, ent)) {
11692
11756
  return false;
11693
11757
  }
11694
- ignoreENOENTSync(() => tmpUnlinkSync(path36, tmp, unlinkFixEPERMSync));
11758
+ ignoreENOENTSync(() => tmpUnlinkSync(path37, tmp, unlinkFixEPERMSync));
11695
11759
  return true;
11696
11760
  }
11697
11761
  let removedAll = true;
11698
11762
  for (const ent2 of entries) {
11699
- const p = resolve6(path36, ent2.name);
11763
+ const p = resolve6(path37, ent2.name);
11700
11764
  removedAll = rimrafMoveRemoveDirSync(p, opt, ent2) && removedAll;
11701
11765
  }
11702
11766
  if (!removedAll) {
11703
11767
  return false;
11704
11768
  }
11705
- if (opt.preserveRoot === false && path36 === parse5(path36).root) {
11769
+ if (opt.preserveRoot === false && path37 === parse5(path37).root) {
11706
11770
  return false;
11707
11771
  }
11708
- if (opt.filter && !opt.filter(path36, ent)) {
11772
+ if (opt.filter && !opt.filter(path37, ent)) {
11709
11773
  return false;
11710
11774
  }
11711
- ignoreENOENTSync(() => tmpUnlinkSync(path36, tmp, rmdirSync));
11775
+ ignoreENOENTSync(() => tmpUnlinkSync(path37, tmp, rmdirSync));
11712
11776
  return true;
11713
11777
  };
11714
- var tmpUnlinkSync = (path36, tmp, rmSync2) => {
11715
- const tmpFile = resolve6(tmp, uniqueFilename(path36));
11716
- renameSync(path36, tmpFile);
11778
+ var tmpUnlinkSync = (path37, tmp, rmSync2) => {
11779
+ const tmpFile = resolve6(tmp, uniqueFilename(path37));
11780
+ renameSync(path37, tmpFile);
11717
11781
  return rmSync2(tmpFile);
11718
11782
  };
11719
11783
 
11720
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-windows.js
11784
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-windows.js
11721
11785
  var { unlink: unlink3, rmdir: rmdir3, lstat: lstat6 } = promises;
11722
11786
  var rimrafWindowsFile = retryBusy(fixEPERM(unlink3));
11723
11787
  var rimrafWindowsFileSync = retryBusySync(fixEPERMSync(unlinkSync));
11724
11788
  var rimrafWindowsDirRetry = retryBusy(fixEPERM(rmdir3));
11725
11789
  var rimrafWindowsDirRetrySync = retryBusySync(fixEPERMSync(rmdirSync));
11726
- var rimrafWindowsDirMoveRemoveFallback = async (path36, { filter: filter3, ...opt }) => {
11790
+ var rimrafWindowsDirMoveRemoveFallback = async (path37, { filter: filter3, ...opt }) => {
11727
11791
  opt?.signal?.throwIfAborted();
11728
11792
  try {
11729
- await rimrafWindowsDirRetry(path36, opt);
11793
+ await rimrafWindowsDirRetry(path37, opt);
11730
11794
  return true;
11731
11795
  } catch (er) {
11732
11796
  if (errorCode(er) === "ENOTEMPTY") {
11733
- return rimrafMoveRemove(path36, opt);
11797
+ return rimrafMoveRemove(path37, opt);
11734
11798
  }
11735
11799
  throw er;
11736
11800
  }
11737
11801
  };
11738
- var rimrafWindowsDirMoveRemoveFallbackSync = (path36, { filter: filter3, ...opt }) => {
11802
+ var rimrafWindowsDirMoveRemoveFallbackSync = (path37, { filter: filter3, ...opt }) => {
11739
11803
  opt?.signal?.throwIfAborted();
11740
11804
  try {
11741
- rimrafWindowsDirRetrySync(path36, opt);
11805
+ rimrafWindowsDirRetrySync(path37, opt);
11742
11806
  return true;
11743
11807
  } catch (er) {
11744
11808
  if (errorCode(er) === "ENOTEMPTY") {
11745
- return rimrafMoveRemoveSync(path36, opt);
11809
+ return rimrafMoveRemoveSync(path37, opt);
11746
11810
  }
11747
11811
  throw er;
11748
11812
  }
11749
11813
  };
11750
- var START = Symbol("start");
11751
- var CHILD = Symbol("child");
11752
- var FINISH = Symbol("finish");
11753
- var rimrafWindows = async (path36, opt) => {
11814
+ var START = /* @__PURE__ */ Symbol("start");
11815
+ var CHILD = /* @__PURE__ */ Symbol("child");
11816
+ var FINISH = /* @__PURE__ */ Symbol("finish");
11817
+ var rimrafWindows = async (path37, opt) => {
11754
11818
  opt?.signal?.throwIfAborted();
11755
- return await ignoreENOENT(lstat6(path36).then((stat5) => rimrafWindowsDir(path36, opt, stat5, START))) ?? true;
11819
+ return await ignoreENOENT(lstat6(path37).then((stat5) => rimrafWindowsDir(path37, opt, stat5, START))) ?? true;
11756
11820
  };
11757
- var rimrafWindowsSync = (path36, opt) => {
11821
+ var rimrafWindowsSync = (path37, opt) => {
11758
11822
  opt?.signal?.throwIfAborted();
11759
- return ignoreENOENTSync(() => rimrafWindowsDirSync(path36, opt, lstatSync2(path36), START)) ?? true;
11823
+ return ignoreENOENTSync(() => rimrafWindowsDirSync(path37, opt, lstatSync2(path37), START)) ?? true;
11760
11824
  };
11761
- var rimrafWindowsDir = async (path36, opt, ent, state = START) => {
11825
+ var rimrafWindowsDir = async (path37, opt, ent, state = START) => {
11762
11826
  opt?.signal?.throwIfAborted();
11763
- const entries = ent.isDirectory() ? await readdirOrError(path36) : null;
11827
+ const entries = ent.isDirectory() ? await readdirOrError(path37) : null;
11764
11828
  if (!Array.isArray(entries)) {
11765
11829
  if (entries) {
11766
11830
  if (errorCode(entries) === "ENOENT") {
@@ -11770,32 +11834,32 @@ var rimrafWindowsDir = async (path36, opt, ent, state = START) => {
11770
11834
  throw entries;
11771
11835
  }
11772
11836
  }
11773
- if (opt.filter && !await opt.filter(path36, ent)) {
11837
+ if (opt.filter && !await opt.filter(path37, ent)) {
11774
11838
  return false;
11775
11839
  }
11776
- await ignoreENOENT(rimrafWindowsFile(path36, opt));
11840
+ await ignoreENOENT(rimrafWindowsFile(path37, opt));
11777
11841
  return true;
11778
11842
  }
11779
11843
  const s = state === START ? CHILD : state;
11780
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(resolve7(path36, ent2.name), opt, ent2, s)))).every((v) => v === true);
11844
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(resolve7(path37, ent2.name), opt, ent2, s)))).every((v) => v === true);
11781
11845
  if (state === START) {
11782
- return rimrafWindowsDir(path36, opt, ent, FINISH);
11846
+ return rimrafWindowsDir(path37, opt, ent, FINISH);
11783
11847
  } else if (state === FINISH) {
11784
- if (opt.preserveRoot === false && path36 === parse6(path36).root) {
11848
+ if (opt.preserveRoot === false && path37 === parse6(path37).root) {
11785
11849
  return false;
11786
11850
  }
11787
11851
  if (!removedAll) {
11788
11852
  return false;
11789
11853
  }
11790
- if (opt.filter && !await opt.filter(path36, ent)) {
11854
+ if (opt.filter && !await opt.filter(path37, ent)) {
11791
11855
  return false;
11792
11856
  }
11793
- await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path36, opt));
11857
+ await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path37, opt));
11794
11858
  }
11795
11859
  return true;
11796
11860
  };
11797
- var rimrafWindowsDirSync = (path36, opt, ent, state = START) => {
11798
- const entries = ent.isDirectory() ? readdirOrErrorSync(path36) : null;
11861
+ var rimrafWindowsDirSync = (path37, opt, ent, state = START) => {
11862
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path37) : null;
11799
11863
  if (!Array.isArray(entries)) {
11800
11864
  if (entries) {
11801
11865
  if (errorCode(entries) === "ENOENT") {
@@ -11805,52 +11869,52 @@ var rimrafWindowsDirSync = (path36, opt, ent, state = START) => {
11805
11869
  throw entries;
11806
11870
  }
11807
11871
  }
11808
- if (opt.filter && !opt.filter(path36, ent)) {
11872
+ if (opt.filter && !opt.filter(path37, ent)) {
11809
11873
  return false;
11810
11874
  }
11811
- ignoreENOENTSync(() => rimrafWindowsFileSync(path36, opt));
11875
+ ignoreENOENTSync(() => rimrafWindowsFileSync(path37, opt));
11812
11876
  return true;
11813
11877
  }
11814
11878
  let removedAll = true;
11815
11879
  for (const ent2 of entries) {
11816
11880
  const s = state === START ? CHILD : state;
11817
- const p = resolve7(path36, ent2.name);
11881
+ const p = resolve7(path37, ent2.name);
11818
11882
  removedAll = rimrafWindowsDirSync(p, opt, ent2, s) && removedAll;
11819
11883
  }
11820
11884
  if (state === START) {
11821
- return rimrafWindowsDirSync(path36, opt, ent, FINISH);
11885
+ return rimrafWindowsDirSync(path37, opt, ent, FINISH);
11822
11886
  } else if (state === FINISH) {
11823
- if (opt.preserveRoot === false && path36 === parse6(path36).root) {
11887
+ if (opt.preserveRoot === false && path37 === parse6(path37).root) {
11824
11888
  return false;
11825
11889
  }
11826
11890
  if (!removedAll) {
11827
11891
  return false;
11828
11892
  }
11829
- if (opt.filter && !opt.filter(path36, ent)) {
11893
+ if (opt.filter && !opt.filter(path37, ent)) {
11830
11894
  return false;
11831
11895
  }
11832
- ignoreENOENTSync(() => rimrafWindowsDirMoveRemoveFallbackSync(path36, opt));
11896
+ ignoreENOENTSync(() => rimrafWindowsDirMoveRemoveFallbackSync(path37, opt));
11833
11897
  }
11834
11898
  return true;
11835
11899
  };
11836
11900
 
11837
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-manual.js
11901
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-manual.js
11838
11902
  var rimrafManual = process.platform === "win32" ? rimrafWindows : rimrafPosix;
11839
11903
  var rimrafManualSync = process.platform === "win32" ? rimrafWindowsSync : rimrafPosixSync;
11840
11904
 
11841
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-native.js
11905
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-native.js
11842
11906
  init_esm_shims();
11843
11907
  var { rm } = promises;
11844
- var rimrafNative = async (path36, opt) => {
11845
- await rm(path36, {
11908
+ var rimrafNative = async (path37, opt) => {
11909
+ await rm(path37, {
11846
11910
  ...opt,
11847
11911
  force: true,
11848
11912
  recursive: true
11849
11913
  });
11850
11914
  return true;
11851
11915
  };
11852
- var rimrafNativeSync = (path36, opt) => {
11853
- rmSync(path36, {
11916
+ var rimrafNativeSync = (path37, opt) => {
11917
+ rmSync(path37, {
11854
11918
  ...opt,
11855
11919
  force: true,
11856
11920
  recursive: true
@@ -11858,34 +11922,34 @@ var rimrafNativeSync = (path36, opt) => {
11858
11922
  return true;
11859
11923
  };
11860
11924
 
11861
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/use-native.js
11925
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/use-native.js
11862
11926
  init_esm_shims();
11863
11927
  var [major = 0, minor = 0] = process.version.replace(/^v/, "").split(".").map((v) => parseInt(v, 10));
11864
11928
  var hasNative = major > 14 || major === 14 && minor >= 14;
11865
11929
  var useNative = !hasNative || process.platform === "win32" ? () => false : (opt) => !opt?.signal && !opt?.filter;
11866
11930
  var useNativeSync = !hasNative || process.platform === "win32" ? () => false : (opt) => !opt?.signal && !opt?.filter;
11867
11931
 
11868
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/index.js
11869
- var wrap = (fn) => async (path36, opt) => {
11932
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/index.js
11933
+ var wrap = (fn) => async (path37, opt) => {
11870
11934
  const options = optArg(opt);
11871
11935
  if (options.glob) {
11872
- path36 = await glob(path36, options.glob);
11936
+ path37 = await glob(path37, options.glob);
11873
11937
  }
11874
- if (Array.isArray(path36)) {
11875
- return !!(await Promise.all(path36.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
11938
+ if (Array.isArray(path37)) {
11939
+ return !!(await Promise.all(path37.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
11876
11940
  } else {
11877
- return !!await fn(path_arg_default(path36, options), options);
11941
+ return !!await fn(path_arg_default(path37, options), options);
11878
11942
  }
11879
11943
  };
11880
- var wrapSync = (fn) => (path36, opt) => {
11944
+ var wrapSync = (fn) => (path37, opt) => {
11881
11945
  const options = optArgSync(opt);
11882
11946
  if (options.glob) {
11883
- path36 = globSync(path36, options.glob);
11947
+ path37 = globSync(path37, options.glob);
11884
11948
  }
11885
- if (Array.isArray(path36)) {
11886
- return !!path36.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
11949
+ if (Array.isArray(path37)) {
11950
+ return !!path37.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
11887
11951
  } else {
11888
- return !!fn(path_arg_default(path36, options), options);
11952
+ return !!fn(path_arg_default(path37, options), options);
11889
11953
  }
11890
11954
  };
11891
11955
  var nativeSync = wrapSync(rimrafNativeSync);
@@ -11900,8 +11964,8 @@ var moveRemoveSync = wrapSync(rimrafMoveRemoveSync);
11900
11964
  var moveRemove = Object.assign(wrap(rimrafMoveRemove), {
11901
11965
  sync: moveRemoveSync
11902
11966
  });
11903
- var rimrafSync = wrapSync((path36, opt) => useNativeSync(opt) ? rimrafNativeSync(path36, opt) : rimrafManualSync(path36, opt));
11904
- var rimraf_ = wrap((path36, opt) => useNative(opt) ? rimrafNative(path36, opt) : rimrafManual(path36, opt));
11967
+ var rimrafSync = wrapSync((path37, opt) => useNativeSync(opt) ? rimrafNativeSync(path37, opt) : rimrafManualSync(path37, opt));
11968
+ var rimraf_ = wrap((path37, opt) => useNative(opt) ? rimrafNative(path37, opt) : rimrafManual(path37, opt));
11905
11969
  var rimraf = Object.assign(rimraf_, {
11906
11970
  rimraf: rimraf_,
11907
11971
  sync: rimrafSync,
@@ -12953,7 +13017,13 @@ function createBuildService(ctx) {
12953
13017
  independentBuildTasks.set(root, task);
12954
13018
  return task;
12955
13019
  }
12956
- function checkWorkersOptions() {
13020
+ function checkWorkersOptions(target = "app") {
13021
+ if (target === "plugin") {
13022
+ return {
13023
+ hasWorkersDir: false,
13024
+ workersDir: void 0
13025
+ };
13026
+ }
12957
13027
  const workersDir = scanService.workersDir;
12958
13028
  const hasWorkersDir = Boolean(workersDir);
12959
13029
  if (hasWorkersDir && configService.weappViteConfig?.worker?.entry === void 0) {
@@ -12977,12 +13047,12 @@ function createBuildService(ctx) {
12977
13047
  configService.mergeWorkers()
12978
13048
  );
12979
13049
  }
12980
- async function runDev() {
13050
+ async function runDev(target) {
12981
13051
  if (process3.env.NODE_ENV === void 0) {
12982
13052
  process3.env.NODE_ENV = "development";
12983
13053
  }
12984
- debug?.("dev build watcher start");
12985
- const { hasWorkersDir, workersDir } = checkWorkersOptions();
13054
+ debug?.(`[${target}] dev build watcher start`);
13055
+ const { hasWorkersDir, workersDir } = checkWorkersOptions(target);
12986
13056
  const buildOptions = configService.merge(
12987
13057
  void 0,
12988
13058
  createSharedBuildConfig(configService, scanService)
@@ -12990,63 +13060,57 @@ function createBuildService(ctx) {
12990
13060
  const watcherPromise = build(
12991
13061
  buildOptions
12992
13062
  );
12993
- const workerPromise = hasWorkersDir && workersDir ? devWorkers(workersDir) : Promise.resolve();
13063
+ const workerPromise = target === "app" && hasWorkersDir && workersDir ? devWorkers(workersDir) : Promise.resolve();
12994
13064
  const [watcher] = await Promise.all([watcherPromise, workerPromise]);
12995
13065
  const isTestEnv = process3.env.VITEST === "true" || process3.env.NODE_ENV === "test";
12996
- if (hasWorkersDir && workersDir) {
12997
- if (!isTestEnv) {
12998
- const absWorkerRoot = path11.resolve(configService.absoluteSrcRoot, workersDir);
12999
- const watcher2 = esm_default.watch(
13000
- absWorkerRoot,
13001
- {
13002
- persistent: true,
13003
- ignoreInitial: true
13004
- }
13005
- );
13006
- const logWorkerEvent = (type, target, level = "info") => {
13007
- if (!target) {
13008
- return;
13009
- }
13010
- const relative3 = configService.relativeCwd(target);
13011
- const message = `[workers:${type}] ${relative3}`;
13012
- if (level === "success") {
13013
- logger_default.success(message);
13014
- } else {
13015
- logger_default.info(message);
13016
- }
13017
- };
13018
- watcher2.on("all", (event, id) => {
13019
- if (!id) {
13020
- return;
13021
- }
13022
- if (event === "add") {
13023
- logWorkerEvent(event, id, "success");
13024
- void devWorkers(workersDir);
13025
- return;
13026
- }
13027
- logWorkerEvent(event, id);
13028
- });
13029
- watcher2.on("raw", (eventName, rawPath, details) => {
13030
- if (eventName !== "rename") {
13031
- return;
13032
- }
13033
- const candidate = typeof rawPath === "string" ? rawPath : rawPath && typeof rawPath.toString === "function" ? rawPath.toString() : "";
13034
- if (!candidate) {
13035
- return;
13036
- }
13037
- const baseDir = typeof details === "object" && details && "watchedPath" in details ? details.watchedPath ?? absWorkerRoot : absWorkerRoot;
13038
- const resolved = path11.isAbsolute(candidate) ? candidate : path11.resolve(baseDir, candidate);
13039
- const exists = fs6.existsSync(resolved);
13040
- if (exists) {
13041
- logWorkerEvent("rename->add", resolved);
13042
- return;
13043
- }
13044
- logWorkerEvent("rename->unlink", resolved);
13045
- });
13046
- watcherService.sidecarWatcherMap.set(absWorkerRoot, {
13047
- close: () => watcher2.close()
13048
- });
13049
- }
13066
+ if (target === "app" && hasWorkersDir && workersDir && !isTestEnv) {
13067
+ const absWorkerRoot = path11.resolve(configService.absoluteSrcRoot, workersDir);
13068
+ const workerWatcher = chokidar_default.watch(
13069
+ absWorkerRoot,
13070
+ {
13071
+ persistent: true,
13072
+ ignoreInitial: true
13073
+ }
13074
+ );
13075
+ const logWorkerEvent = (type, targetPath, level = "info") => {
13076
+ if (!targetPath) {
13077
+ return;
13078
+ }
13079
+ const relative3 = configService.relativeCwd(targetPath);
13080
+ const message = `[workers:${type}] ${relative3}`;
13081
+ if (level === "success") {
13082
+ logger_default.success(message);
13083
+ } else {
13084
+ logger_default.info(message);
13085
+ }
13086
+ };
13087
+ workerWatcher.on("all", (event, id) => {
13088
+ if (!id) {
13089
+ return;
13090
+ }
13091
+ if (event === "add") {
13092
+ logWorkerEvent(event, id, "success");
13093
+ void devWorkers(workersDir);
13094
+ return;
13095
+ }
13096
+ logWorkerEvent(event, id);
13097
+ });
13098
+ workerWatcher.on("raw", (eventName, rawPath, details) => {
13099
+ if (eventName !== "rename") {
13100
+ return;
13101
+ }
13102
+ const candidate = typeof rawPath === "string" ? rawPath : rawPath && typeof rawPath.toString === "function" ? rawPath.toString() : "";
13103
+ if (!candidate) {
13104
+ return;
13105
+ }
13106
+ const baseDir = typeof details === "object" && details && "watchedPath" in details ? details.watchedPath ?? absWorkerRoot : absWorkerRoot;
13107
+ const resolved = path11.isAbsolute(candidate) ? candidate : path11.resolve(baseDir, candidate);
13108
+ const exists = fs6.existsSync(resolved);
13109
+ logWorkerEvent(exists ? "rename->add" : "rename->unlink", resolved, exists ? "success" : "info");
13110
+ });
13111
+ watcherService.sidecarWatcherMap.set(absWorkerRoot, {
13112
+ close: () => workerWatcher.close()
13113
+ });
13050
13114
  }
13051
13115
  debug?.("dev build watcher end");
13052
13116
  debug?.("dev watcher listen start");
@@ -13068,24 +13132,25 @@ function createBuildService(ctx) {
13068
13132
  }
13069
13133
  });
13070
13134
  await promise;
13071
- watcherService.setRollupWatcher(watcher);
13135
+ const watcherRoot = target === "plugin" ? configService.absolutePluginRoot ?? configService.absoluteSrcRoot : "/";
13136
+ watcherService.setRollupWatcher(watcher, watcherRoot);
13072
13137
  return watcher;
13073
13138
  }
13074
- async function runProd() {
13075
- debug?.("prod build start");
13076
- const { hasWorkersDir } = checkWorkersOptions();
13139
+ async function runProd(target) {
13140
+ debug?.(`[${target}] prod build start`);
13141
+ const { hasWorkersDir } = checkWorkersOptions(target);
13077
13142
  const bundlerPromise = build(
13078
13143
  configService.merge(
13079
13144
  void 0,
13080
13145
  createSharedBuildConfig(configService, scanService)
13081
13146
  )
13082
13147
  );
13083
- const workerPromise = hasWorkersDir ? buildWorkers() : Promise.resolve();
13148
+ const workerPromise = target === "app" && hasWorkersDir ? buildWorkers() : Promise.resolve();
13084
13149
  const [output] = await Promise.all([bundlerPromise, workerPromise]);
13085
- debug?.("prod build end");
13150
+ debug?.(`[${target}] prod build end`);
13086
13151
  return output;
13087
13152
  }
13088
- async function buildEntry(options) {
13153
+ async function cleanOutputs() {
13089
13154
  if (configService.mpDistRoot) {
13090
13155
  const deletedFilePaths = await rimraf(
13091
13156
  [
@@ -13105,35 +13170,66 @@ function createBuildService(ctx) {
13105
13170
  debug?.("deletedFilePaths", deletedFilePaths);
13106
13171
  logger_default.success(`\u5DF2\u6E05\u7A7A ${configService.mpDistRoot} \u76EE\u5F55`);
13107
13172
  }
13108
- debug?.("build start");
13109
- let npmBuildTask = Promise.resolve();
13110
- if (!options?.skipNpm) {
13111
- let shouldBuildNpm = true;
13173
+ const pluginOutputRoot = configService.absolutePluginOutputRoot;
13174
+ if (pluginOutputRoot) {
13175
+ const relativeToOutDir = path11.relative(configService.outDir, pluginOutputRoot);
13176
+ const isInsideOutDir = relativeToOutDir === "" || !relativeToOutDir.startsWith("..") && !path11.isAbsolute(relativeToOutDir);
13177
+ if (!isInsideOutDir) {
13178
+ const deletedPluginFiles = await rimraf([
13179
+ path11.resolve(pluginOutputRoot, "*"),
13180
+ path11.resolve(pluginOutputRoot, ".*")
13181
+ ], {
13182
+ glob: true
13183
+ });
13184
+ debug?.("deletedPluginOutput", deletedPluginFiles);
13185
+ logger_default.success(`\u5DF2\u6E05\u7A7A ${configService.relativeCwd(pluginOutputRoot)} \u76EE\u5F55`);
13186
+ }
13187
+ }
13188
+ }
13189
+ function scheduleNpmBuild(options) {
13190
+ if (options?.skipNpm) {
13191
+ return Promise.resolve();
13192
+ }
13193
+ const runTask = () => queue.add(async () => {
13194
+ await npmService.build();
13112
13195
  if (configService.isDev) {
13196
+ buildState.npmBuilt = true;
13197
+ }
13198
+ });
13199
+ if (configService.isDev) {
13200
+ return (async () => {
13113
13201
  const isDependenciesOutdated = await npmService.checkDependenciesCacheOutdate();
13114
13202
  if (!isDependenciesOutdated && buildState.npmBuilt) {
13115
- shouldBuildNpm = false;
13116
- } else if (isDependenciesOutdated) {
13203
+ return;
13204
+ }
13205
+ if (isDependenciesOutdated) {
13117
13206
  buildState.npmBuilt = false;
13118
13207
  }
13119
- }
13120
- if (shouldBuildNpm) {
13121
- npmBuildTask = queue.add(async () => {
13122
- await npmService.build();
13123
- if (configService.isDev) {
13124
- buildState.npmBuilt = true;
13125
- }
13126
- });
13208
+ const task2 = runTask();
13127
13209
  queue.start();
13128
- }
13210
+ await task2;
13211
+ })();
13129
13212
  }
13130
- let result;
13213
+ const task = runTask();
13214
+ queue.start();
13215
+ return task;
13216
+ }
13217
+ async function runBuildTarget(target) {
13218
+ ctx.currentBuildTarget = target;
13131
13219
  if (configService.isDev) {
13132
- result = await runDev();
13133
- } else {
13134
- result = await runProd();
13220
+ return await runDev(target);
13135
13221
  }
13222
+ return await runProd(target);
13223
+ }
13224
+ async function buildEntry(options) {
13225
+ await cleanOutputs();
13226
+ debug?.("build start");
13227
+ const npmBuildTask = scheduleNpmBuild(options);
13228
+ const result = await runBuildTarget("app");
13136
13229
  await npmBuildTask;
13230
+ if (configService.absolutePluginRoot) {
13231
+ await runBuildTarget("plugin");
13232
+ }
13137
13233
  debug?.("build end");
13138
13234
  return result;
13139
13235
  }
@@ -18805,17 +18901,17 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
18805
18901
  if (hasTrailingSlash(input, true)) {
18806
18902
  return input || "/";
18807
18903
  }
18808
- let path36 = input;
18904
+ let path37 = input;
18809
18905
  let fragment = "";
18810
18906
  const fragmentIndex = input.indexOf("#");
18811
18907
  if (fragmentIndex !== -1) {
18812
- path36 = input.slice(0, fragmentIndex);
18908
+ path37 = input.slice(0, fragmentIndex);
18813
18909
  fragment = input.slice(fragmentIndex);
18814
- if (!path36) {
18910
+ if (!path37) {
18815
18911
  return fragment;
18816
18912
  }
18817
18913
  }
18818
- const [s0, ...s] = path36.split("?");
18914
+ const [s0, ...s] = path37.split("?");
18819
18915
  return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
18820
18916
  }
18821
18917
  function isNonEmptyURL(url) {
@@ -18833,7 +18929,6 @@ function joinURL(base, ...input) {
18833
18929
  }
18834
18930
  return url;
18835
18931
  }
18836
- var protocolRelative = Symbol.for("ufo:protocolRelative");
18837
18932
 
18838
18933
  // ../../node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs
18839
18934
  import { normalize as normalize3, isAbsolute as isAbsolute2, extname as extname$1 } from "pathe";
@@ -18844,8 +18939,8 @@ import path12, { dirname as dirname3 } from "path";
18844
18939
  import v8 from "v8";
18845
18940
  import { format, inspect as inspect2 } from "util";
18846
18941
  var BUILTIN_MODULES = new Set(builtinModules);
18847
- function normalizeSlash(path36) {
18848
- return path36.replace(/\\/g, "/");
18942
+ function normalizeSlash(path37) {
18943
+ return path37.replace(/\\/g, "/");
18849
18944
  }
18850
18945
  var own$1 = {}.hasOwnProperty;
18851
18946
  var classRegExp = /^([A-Z][a-z\d]*)+$/;
@@ -18958,8 +19053,8 @@ codes2.ERR_INVALID_PACKAGE_CONFIG = createError(
18958
19053
  * @param {string} [base]
18959
19054
  * @param {string} [message]
18960
19055
  */
18961
- (path36, base, message) => {
18962
- return `Invalid package config ${path36}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
19056
+ (path37, base, message) => {
19057
+ return `Invalid package config ${path37}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
18963
19058
  },
18964
19059
  Error
18965
19060
  );
@@ -18991,8 +19086,8 @@ codes2.ERR_MODULE_NOT_FOUND = createError(
18991
19086
  * @param {string} base
18992
19087
  * @param {boolean} [exactUrl]
18993
19088
  */
18994
- (path36, base, exactUrl = false) => {
18995
- return `Cannot find ${exactUrl ? "module" : "package"} '${path36}' imported from ${base}`;
19089
+ (path37, base, exactUrl = false) => {
19090
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path37}' imported from ${base}`;
18996
19091
  },
18997
19092
  Error
18998
19093
  );
@@ -19043,8 +19138,8 @@ codes2.ERR_UNKNOWN_FILE_EXTENSION = createError(
19043
19138
  * @param {string} extension
19044
19139
  * @param {string} path
19045
19140
  */
19046
- (extension, path36) => {
19047
- return `Unknown file extension "${extension}" for ${path36}`;
19141
+ (extension, path37) => {
19142
+ return `Unknown file extension "${extension}" for ${path37}`;
19048
19143
  },
19049
19144
  TypeError
19050
19145
  );
@@ -19415,9 +19510,9 @@ Default "index" lookups for the main are deprecated for ES modules.`,
19415
19510
  );
19416
19511
  }
19417
19512
  }
19418
- function tryStatSync(path36) {
19513
+ function tryStatSync(path37) {
19419
19514
  try {
19420
- return statSync2(path36);
19515
+ return statSync2(path37);
19421
19516
  } catch {
19422
19517
  }
19423
19518
  }
@@ -20187,7 +20282,7 @@ init_esm_shims();
20187
20282
 
20188
20283
  // ../../node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/index.mjs
20189
20284
  init_esm_shims();
20190
- var GET_IS_ASYNC = Symbol.for("quansync.getIsAsync");
20285
+ var GET_IS_ASYNC = /* @__PURE__ */ Symbol.for("quansync.getIsAsync");
20191
20286
  var QuansyncError = class extends Error {
20192
20287
  constructor(message = "Unexpected promise in sync context") {
20193
20288
  super(message);
@@ -20336,7 +20431,7 @@ function findUpSync(name, {
20336
20431
  directory = path13.dirname(directory);
20337
20432
  }
20338
20433
  }
20339
- function _resolve2(path36, options = {}) {
20434
+ function _resolve2(path37, options = {}) {
20340
20435
  if (options.platform === "auto" || !options.platform)
20341
20436
  options.platform = process4.platform === "win32" ? "win32" : "posix";
20342
20437
  if (process4.versions.pnp) {
@@ -20345,11 +20440,11 @@ function _resolve2(path36, options = {}) {
20345
20440
  paths.push(process4.cwd());
20346
20441
  const targetRequire = createRequire2(import.meta.url);
20347
20442
  try {
20348
- return targetRequire.resolve(path36, { paths });
20443
+ return targetRequire.resolve(path37, { paths });
20349
20444
  } catch {
20350
20445
  }
20351
20446
  }
20352
- const modulePath = resolvePathSync(path36, {
20447
+ const modulePath = resolvePathSync(path37, {
20353
20448
  url: options.paths
20354
20449
  });
20355
20450
  if (options.platform === "win32")
@@ -20420,10 +20515,10 @@ var findUp = quansync2({
20420
20515
  async: findUp$1
20421
20516
  });
20422
20517
  var loadPackageJSON = quansync2(function* (cwd = process4.cwd()) {
20423
- const path36 = yield findUp("package.json", { cwd });
20424
- if (!path36 || !fs8.existsSync(path36))
20518
+ const path37 = yield findUp("package.json", { cwd });
20519
+ if (!path37 || !fs8.existsSync(path37))
20425
20520
  return null;
20426
- return JSON.parse(yield readFile(path36));
20521
+ return JSON.parse(yield readFile(path37));
20427
20522
  });
20428
20523
  var loadPackageJSONSync = loadPackageJSON.sync;
20429
20524
  var isPackageListed = quansync2(function* (name, cwd) {
@@ -20432,13 +20527,13 @@ var isPackageListed = quansync2(function* (name, cwd) {
20432
20527
  });
20433
20528
  var isPackageListedSync = isPackageListed.sync;
20434
20529
 
20435
- // ../../node_modules/.pnpm/package-manager-detector@1.5.0/node_modules/package-manager-detector/dist/detect.mjs
20530
+ // ../../node_modules/.pnpm/package-manager-detector@1.6.0/node_modules/package-manager-detector/dist/detect.mjs
20436
20531
  init_esm_shims();
20437
20532
  import fs9 from "fs/promises";
20438
20533
  import path14 from "path";
20439
20534
  import process5 from "process";
20440
20535
 
20441
- // ../../node_modules/.pnpm/package-manager-detector@1.5.0/node_modules/package-manager-detector/dist/constants.mjs
20536
+ // ../../node_modules/.pnpm/package-manager-detector@1.6.0/node_modules/package-manager-detector/dist/constants.mjs
20442
20537
  init_esm_shims();
20443
20538
  var AGENTS = [
20444
20539
  "npm",
@@ -20475,7 +20570,7 @@ var INSTALL_METADATA = {
20475
20570
  "bun.lockb": "bun"
20476
20571
  };
20477
20572
 
20478
- // ../../node_modules/.pnpm/package-manager-detector@1.5.0/node_modules/package-manager-detector/dist/detect.mjs
20573
+ // ../../node_modules/.pnpm/package-manager-detector@1.6.0/node_modules/package-manager-detector/dist/detect.mjs
20479
20574
  async function pathExists(path210, type) {
20480
20575
  try {
20481
20576
  const stat5 = await fs9.stat(path210);
@@ -20492,14 +20587,15 @@ function* lookup(cwd = process5.cwd()) {
20492
20587
  directory = path14.dirname(directory);
20493
20588
  }
20494
20589
  }
20495
- async function parsePackageJson(filepath, onUnknown) {
20496
- return !filepath || !pathExists(filepath, "file") ? null : await handlePackageManager(filepath, onUnknown);
20590
+ async function parsePackageJson(filepath, options) {
20591
+ if (!filepath || !await pathExists(filepath, "file"))
20592
+ return null;
20593
+ return await handlePackageManager(filepath, options);
20497
20594
  }
20498
20595
  async function detect(options = {}) {
20499
20596
  const {
20500
20597
  cwd,
20501
- strategies = ["lockfile", "packageManager-field", "devEngines-field"],
20502
- onUnknown
20598
+ strategies = ["lockfile", "packageManager-field", "devEngines-field"]
20503
20599
  } = options;
20504
20600
  let stopDir;
20505
20601
  if (typeof options.stopDir === "string") {
@@ -20515,7 +20611,7 @@ async function detect(options = {}) {
20515
20611
  for (const lock of Object.keys(LOCKS)) {
20516
20612
  if (await pathExists(path14.join(directory, lock), "file")) {
20517
20613
  const name = LOCKS[lock];
20518
- const result = await parsePackageJson(path14.join(directory, "package.json"), onUnknown);
20614
+ const result = await parsePackageJson(path14.join(directory, "package.json"), options);
20519
20615
  if (result)
20520
20616
  return result;
20521
20617
  else
@@ -20526,7 +20622,7 @@ async function detect(options = {}) {
20526
20622
  }
20527
20623
  case "packageManager-field":
20528
20624
  case "devEngines-field": {
20529
- const result = await parsePackageJson(path14.join(directory, "package.json"), onUnknown);
20625
+ const result = await parsePackageJson(path14.join(directory, "package.json"), options);
20530
20626
  if (result)
20531
20627
  return result;
20532
20628
  break;
@@ -20563,9 +20659,10 @@ function getNameAndVer(pkg) {
20563
20659
  }
20564
20660
  return void 0;
20565
20661
  }
20566
- async function handlePackageManager(filepath, onUnknown) {
20662
+ async function handlePackageManager(filepath, options) {
20567
20663
  try {
20568
- const pkg = JSON.parse(await fs9.readFile(filepath, "utf8"));
20664
+ const content = await fs9.readFile(filepath, "utf8");
20665
+ const pkg = options.packageJsonParser ? await options.packageJsonParser(content, filepath) : JSON.parse(content);
20569
20666
  let agent;
20570
20667
  const nameAndVer = getNameAndVer(pkg);
20571
20668
  if (nameAndVer) {
@@ -20583,7 +20680,7 @@ async function handlePackageManager(filepath, onUnknown) {
20583
20680
  agent = name;
20584
20681
  return { name, agent, version: version2 };
20585
20682
  } else {
20586
- return onUnknown?.(pkg.packageManager) ?? null;
20683
+ return options.onUnknown?.(pkg.packageManager) ?? null;
20587
20684
  }
20588
20685
  }
20589
20686
  } catch {
@@ -20595,7 +20692,7 @@ function isMetadataYarnClassic(metadataPath) {
20595
20692
  }
20596
20693
 
20597
20694
  // src/runtime/config/createConfigService.ts
20598
- import path32 from "pathe";
20695
+ import path33 from "pathe";
20599
20696
 
20600
20697
  // src/platform.ts
20601
20698
  init_esm_shims();
@@ -21447,7 +21544,7 @@ function createLoadConfig(options) {
21447
21544
  init_esm_shims();
21448
21545
  import { defu as defu4 } from "@weapp-core/shared";
21449
21546
  import { weappWebPlugin } from "@weapp-vite/web";
21450
- import path31 from "pathe";
21547
+ import path32 from "pathe";
21451
21548
 
21452
21549
  // src/plugins/index.ts
21453
21550
  init_esm_shims();
@@ -21461,7 +21558,7 @@ import path19 from "pathe";
21461
21558
  function normalizeCopyGlobs(globs) {
21462
21559
  return Array.isArray(globs) ? globs : [];
21463
21560
  }
21464
- function scanAssetFiles(configService, config) {
21561
+ function scanAssetFiles(configService, config, buildTarget) {
21465
21562
  const weappViteConfig = configService.weappViteConfig;
21466
21563
  const include = normalizeCopyGlobs(weappViteConfig?.copy?.include);
21467
21564
  const exclude = normalizeCopyGlobs(weappViteConfig?.copy?.exclude);
@@ -21475,10 +21572,16 @@ function scanAssetFiles(configService, config) {
21475
21572
  `**/*.{${defaultAssetExtensions.join(",")}}`,
21476
21573
  ...include
21477
21574
  ];
21478
- const roots = /* @__PURE__ */ new Set([configService.absoluteSrcRoot]);
21479
- if (configService.absolutePluginRoot) {
21575
+ const roots = /* @__PURE__ */ new Set();
21576
+ if (buildTarget !== "plugin") {
21577
+ roots.add(configService.absoluteSrcRoot);
21578
+ }
21579
+ if (configService.absolutePluginRoot && buildTarget === "plugin") {
21480
21580
  roots.add(configService.absolutePluginRoot);
21481
21581
  }
21582
+ if (!roots.size) {
21583
+ return Promise.resolve([]);
21584
+ }
21482
21585
  const crawlPromises = Array.from(roots).map((root) => {
21483
21586
  return new Fdir2({
21484
21587
  includeDirs: false,
@@ -21519,7 +21622,7 @@ function createAssetCollector(state) {
21519
21622
  state.pendingAssets = Promise.resolve([]);
21520
21623
  return;
21521
21624
  }
21522
- state.pendingAssets = scanAssetFiles(configService, state.resolvedConfig);
21625
+ state.pendingAssets = scanAssetFiles(configService, state.resolvedConfig, state.buildTarget);
21523
21626
  },
21524
21627
  async buildEnd() {
21525
21628
  const assets = await state.pendingAssets;
@@ -21529,7 +21632,7 @@ function createAssetCollector(state) {
21529
21632
  for (const candidate of assets) {
21530
21633
  this.emitFile({
21531
21634
  type: "asset",
21532
- fileName: configService.relativeAbsoluteSrcRoot(candidate.file),
21635
+ fileName: configService.relativeOutputPath(candidate.file),
21533
21636
  source: candidate.buffer
21534
21637
  });
21535
21638
  }
@@ -21537,7 +21640,7 @@ function createAssetCollector(state) {
21537
21640
  };
21538
21641
  }
21539
21642
  function asset(ctx) {
21540
- const state = { ctx };
21643
+ const state = { ctx, buildTarget: ctx.currentBuildTarget ?? "app" };
21541
21644
  return [createAssetCollector(state)];
21542
21645
  }
21543
21646
 
@@ -22827,7 +22930,7 @@ var MagicString = class _MagicString {
22827
22930
  };
22828
22931
 
22829
22932
  // src/plugins/core.ts
22830
- import path26 from "pathe";
22933
+ import path27 from "pathe";
22831
22934
 
22832
22935
  // src/plugins/css/shared/preprocessor.ts
22833
22936
  init_esm_shims();
@@ -23121,7 +23224,7 @@ function createChunkEmitter(configService, loadedEntrySet, debug4) {
23121
23224
  const start = performance2.now();
23122
23225
  loadedEntrySet.add(resolvedId.id);
23123
23226
  await this.load(resolvedId);
23124
- const fileName = configService.relativeAbsoluteSrcRoot(
23227
+ const fileName = configService.relativeOutputPath(
23125
23228
  changeFileExtension(resolvedId.id, ".js")
23126
23229
  );
23127
23230
  this.emitFile({
@@ -23191,7 +23294,7 @@ function createJsonEmitManager(configService) {
23191
23294
  if (!entry.jsonPath) {
23192
23295
  return;
23193
23296
  }
23194
- const fileName = configService.relativeAbsoluteSrcRoot(
23297
+ const fileName = configService.relativeOutputPath(
23195
23298
  jsonFileRemoveJsExtension(entry.jsonPath)
23196
23299
  );
23197
23300
  map.set(fileName, {
@@ -23370,8 +23473,10 @@ function createEntryLoader(options) {
23370
23473
  emitEntriesChunks,
23371
23474
  applyAutoImports,
23372
23475
  extendedLibManager,
23476
+ buildTarget,
23373
23477
  debug: debug4
23374
23478
  } = options;
23479
+ const isPluginBuild = buildTarget === "plugin";
23375
23480
  const { jsonService, configService, scanService } = ctx;
23376
23481
  const existsCache = /* @__PURE__ */ new Map();
23377
23482
  return async function loadEntry(id, type) {
@@ -23398,16 +23503,18 @@ function createEntryLoader(options) {
23398
23503
  let pluginJsonPathForRegistration;
23399
23504
  let pluginJsonForRegistration;
23400
23505
  if (type === "app") {
23401
- extendedLibManager.syncFromAppJson(json);
23402
- entries.push(...analyzeAppJson(json));
23403
- await collectAppSideFiles(
23404
- this,
23405
- id,
23406
- json,
23407
- jsonService,
23408
- registerJsonAsset,
23409
- existsCache
23410
- );
23506
+ if (!isPluginBuild) {
23507
+ extendedLibManager.syncFromAppJson(json);
23508
+ entries.push(...analyzeAppJson(json));
23509
+ await collectAppSideFiles(
23510
+ this,
23511
+ id,
23512
+ json,
23513
+ jsonService,
23514
+ registerJsonAsset,
23515
+ existsCache
23516
+ );
23517
+ }
23411
23518
  const pluginJsonPath = scanService?.pluginJsonPath;
23412
23519
  if (configService.absolutePluginRoot && pluginJsonPath) {
23413
23520
  this.addWatchFile(pluginJsonPath);
@@ -23441,25 +23548,27 @@ function createEntryLoader(options) {
23441
23548
  applyAutoImports(baseName, json);
23442
23549
  entries.push(...analyzeCommonJson(json));
23443
23550
  }
23444
- const filteredEntries = entries.filter((entry) => !extendedLibManager.shouldIgnoreEntry(entry));
23445
- const normalizedEntries = filteredEntries.map((entry) => normalizeEntry(entry, jsonPath));
23446
- for (const normalizedEntry of normalizedEntries) {
23447
- entriesMap.set(normalizedEntry, {
23448
- type: json.component ? "component" : "page",
23449
- templatePath,
23450
- jsonPath,
23451
- json,
23452
- path: id
23453
- });
23551
+ const filteredEntries = isPluginBuild ? [] : entries.filter((entry) => !extendedLibManager.shouldIgnoreEntry(entry));
23552
+ const normalizedEntries = isPluginBuild ? [] : filteredEntries.map((entry) => normalizeEntry(entry, jsonPath));
23553
+ if (!isPluginBuild) {
23554
+ for (const normalizedEntry of normalizedEntries) {
23555
+ entriesMap.set(normalizedEntry, {
23556
+ type: json.component ? "component" : "page",
23557
+ templatePath,
23558
+ jsonPath,
23559
+ json,
23560
+ path: id
23561
+ });
23562
+ }
23454
23563
  }
23455
- const resolvedIds = await resolveEntries.call(
23564
+ const resolvedIds = normalizedEntries.length ? await resolveEntries.call(
23456
23565
  this,
23457
23566
  normalizedEntries,
23458
23567
  configService.absoluteSrcRoot
23459
- );
23568
+ ) : [];
23460
23569
  debug4?.(`resolvedIds ${relativeCwdId} \u8017\u65F6 ${getTime()}`);
23461
23570
  const pendingResolvedIds = [];
23462
- const combinedResolved = pluginResolvedRecords ? [...resolvedIds, ...pluginResolvedRecords] : resolvedIds;
23571
+ const combinedResolved = pluginResolvedRecords ? isPluginBuild ? pluginResolvedRecords : [...resolvedIds, ...pluginResolvedRecords] : resolvedIds;
23463
23572
  const pluginEntrySet = pluginResolvedRecords ? new Set(pluginResolvedRecords.map((record) => record.entry)) : void 0;
23464
23573
  for (const { entry, resolvedId } of combinedResolved) {
23465
23574
  if (!resolvedId) {
@@ -23479,11 +23588,13 @@ function createEntryLoader(options) {
23479
23588
  await Promise.all(emitEntriesChunks.call(this, pendingResolvedIds));
23480
23589
  }
23481
23590
  debug4?.(`emitEntriesChunks ${relativeCwdId} \u8017\u65F6 ${getTime()}`);
23482
- registerJsonAsset({
23483
- jsonPath,
23484
- json,
23485
- type
23486
- });
23591
+ if (!isPluginBuild) {
23592
+ registerJsonAsset({
23593
+ jsonPath,
23594
+ json,
23595
+ type
23596
+ });
23597
+ }
23487
23598
  if (pluginJsonPathForRegistration && pluginJsonForRegistration) {
23488
23599
  registerJsonAsset({
23489
23600
  jsonPath: pluginJsonPathForRegistration,
@@ -23569,8 +23680,9 @@ function createTemplateScanner(wxmlService, debug4) {
23569
23680
  }
23570
23681
 
23571
23682
  // src/plugins/hooks/useLoadEntry/index.ts
23572
- function useLoadEntry(ctx) {
23683
+ function useLoadEntry(ctx, options) {
23573
23684
  const debug4 = createDebugger("weapp-vite:load-entry");
23685
+ const buildTarget = options?.buildTarget ?? "app";
23574
23686
  const entriesMap = /* @__PURE__ */ new Map();
23575
23687
  const loadedEntrySet = /* @__PURE__ */ new Set();
23576
23688
  const jsonEmitManager = createJsonEmitManager(ctx.configService);
@@ -23590,6 +23702,7 @@ function useLoadEntry(ctx) {
23590
23702
  emitEntriesChunks,
23591
23703
  applyAutoImports,
23592
23704
  extendedLibManager,
23705
+ buildTarget,
23593
23706
  debug: debug4
23594
23707
  });
23595
23708
  return {
@@ -23947,7 +24060,7 @@ function ensureSidecarWatcher(ctx, rootDir) {
23947
24060
  ...templateExtensions.map((ext2) => path25.join(absRoot, `**/*.${ext2}`))
23948
24061
  ];
23949
24062
  const ignoredMatcher = createSidecarIgnoredMatcher(ctx, absRoot);
23950
- const watcher = esm_default.watch(patterns, {
24063
+ const watcher = chokidar_default.watch(patterns, {
23951
24064
  ignoreInitial: false,
23952
24065
  persistent: true,
23953
24066
  awaitWriteFinish: {
@@ -23966,9 +24079,9 @@ function ensureSidecarWatcher(ctx, rootDir) {
23966
24079
  }
23967
24080
  handleSidecarChange(event, normalizedPath, isReady);
23968
24081
  };
23969
- watcher.on("add", (path36) => forwardChange("create", path36));
23970
- watcher.on("change", (path36) => forwardChange("update", path36));
23971
- watcher.on("unlink", (path36) => forwardChange("delete", path36));
24082
+ watcher.on("add", (path37) => forwardChange("create", path37));
24083
+ watcher.on("change", (path37) => forwardChange("update", path37));
24084
+ watcher.on("unlink", (path37) => forwardChange("delete", path37));
23972
24085
  watcher.on("raw", (eventName, rawPath, details) => {
23973
24086
  if (eventName !== "rename") {
23974
24087
  return;
@@ -24048,6 +24161,7 @@ function getCssRealPath(res) {
24048
24161
 
24049
24162
  // src/plugins/utils/wxmlEmit.ts
24050
24163
  init_esm_shims();
24164
+ import path26 from "pathe";
24051
24165
 
24052
24166
  // src/wxml/handle.ts
24053
24167
  init_esm_shims();
@@ -24290,7 +24404,7 @@ ${result.code}`);
24290
24404
 
24291
24405
  // src/plugins/utils/wxmlEmit.ts
24292
24406
  function emitWxmlAssetsWithCache(options) {
24293
- const { runtime, compiler, subPackageMeta, emittedCodeCache } = options;
24407
+ const { runtime, compiler, subPackageMeta, emittedCodeCache, buildTarget = "app" } = options;
24294
24408
  const { wxmlService, configService, scanService } = compiler;
24295
24409
  if (!wxmlService || !configService || !scanService) {
24296
24410
  throw new Error("emitWxmlAssets requires wxmlService, configService and scanService to be initialized");
@@ -24299,12 +24413,20 @@ function emitWxmlAssetsWithCache(options) {
24299
24413
  return {
24300
24414
  id,
24301
24415
  token,
24302
- fileName: configService.relativeAbsoluteSrcRoot(id)
24416
+ fileName: configService.relativeOutputPath(id)
24303
24417
  };
24304
24418
  }).filter(({ fileName }) => {
24305
24419
  if (subPackageMeta) {
24306
24420
  return fileName.startsWith(subPackageMeta.subPackage.root);
24307
24421
  }
24422
+ if (buildTarget === "plugin") {
24423
+ const pluginRoot = configService.absolutePluginRoot;
24424
+ if (!pluginRoot) {
24425
+ return false;
24426
+ }
24427
+ const pluginBase = path26.basename(pluginRoot);
24428
+ return fileName.startsWith(pluginBase);
24429
+ }
24308
24430
  return scanService.isMainPackageFileName(fileName);
24309
24431
  });
24310
24432
  const emittedFiles = [];
@@ -24342,7 +24464,8 @@ function emitJsonAsset(runtime, fileName, source) {
24342
24464
  // src/plugins/core.ts
24343
24465
  var debug2 = createDebugger("weapp-vite:core");
24344
24466
  function weappVite(ctx, subPackageMeta) {
24345
- const { loadEntry, loadedEntrySet, jsonEmitFilesMap, entriesMap } = useLoadEntry(ctx);
24467
+ const buildTarget = ctx.currentBuildTarget ?? "app";
24468
+ const { loadEntry, loadedEntrySet, jsonEmitFilesMap, entriesMap } = useLoadEntry(ctx, { buildTarget });
24346
24469
  const state = {
24347
24470
  ctx,
24348
24471
  subPackageMeta,
@@ -24352,7 +24475,8 @@ function weappVite(ctx, subPackageMeta) {
24352
24475
  jsonEmitFilesMap,
24353
24476
  requireAsyncEmittedChunks: /* @__PURE__ */ new Set(),
24354
24477
  pendingIndependentBuilds: [],
24355
- watchFilesSnapshot: []
24478
+ watchFilesSnapshot: [],
24479
+ buildTarget
24356
24480
  };
24357
24481
  return [
24358
24482
  createTakeQueryPlugin(state),
@@ -24433,18 +24557,25 @@ function createWxssResolverPlugin(_state) {
24433
24557
  };
24434
24558
  }
24435
24559
  function createCoreLifecyclePlugin(state) {
24436
- const { ctx, subPackageMeta, loadEntry, loadedEntrySet } = state;
24560
+ const { ctx, subPackageMeta, loadEntry, loadedEntrySet, buildTarget } = state;
24437
24561
  const { scanService, configService, buildService } = ctx;
24562
+ const isPluginBuild = buildTarget === "plugin";
24438
24563
  return {
24439
24564
  name: "weapp-vite:pre",
24440
24565
  enforce: "pre",
24441
24566
  buildStart() {
24442
24567
  loadedEntrySet.clear();
24443
24568
  if (configService.isDev) {
24444
- const rootDir = subPackageMeta ? path26.resolve(configService.absoluteSrcRoot, subPackageMeta.subPackage.root) : configService.absoluteSrcRoot;
24445
- ensureSidecarWatcher(ctx, rootDir);
24446
- if (!subPackageMeta && configService.absolutePluginRoot) {
24447
- ensureSidecarWatcher(ctx, configService.absolutePluginRoot);
24569
+ if (isPluginBuild) {
24570
+ if (configService.absolutePluginRoot) {
24571
+ ensureSidecarWatcher(ctx, configService.absolutePluginRoot);
24572
+ }
24573
+ } else {
24574
+ const rootDir = subPackageMeta ? path27.resolve(configService.absoluteSrcRoot, subPackageMeta.subPackage.root) : configService.absoluteSrcRoot;
24575
+ ensureSidecarWatcher(ctx, rootDir);
24576
+ if (!subPackageMeta && configService.absolutePluginRoot) {
24577
+ ensureSidecarWatcher(ctx, configService.absolutePluginRoot);
24578
+ }
24448
24579
  }
24449
24580
  }
24450
24581
  },
@@ -24487,7 +24618,7 @@ function createCoreLifecyclePlugin(state) {
24487
24618
  let scannedInput;
24488
24619
  if (subPackageMeta) {
24489
24620
  scannedInput = subPackageMeta.entries.reduce((acc, entry) => {
24490
- acc[entry] = path26.resolve(configService.absoluteSrcRoot, entry);
24621
+ acc[entry] = path27.resolve(configService.absoluteSrcRoot, entry);
24491
24622
  return acc;
24492
24623
  }, {});
24493
24624
  } else {
@@ -24551,11 +24682,16 @@ function createCoreLifecyclePlugin(state) {
24551
24682
  runtime,
24552
24683
  compiler: ctx,
24553
24684
  subPackageMeta,
24554
- emittedCodeCache: ctx.runtimeState.wxml.emittedCode
24685
+ emittedCodeCache: ctx.runtimeState.wxml.emittedCode,
24686
+ buildTarget
24555
24687
  });
24556
24688
  },
24557
24689
  async generateBundle(_options, bundle) {
24558
24690
  await flushIndependentBuilds.call(this, state);
24691
+ if (isPluginBuild) {
24692
+ filterPluginBundleOutputs(bundle, configService);
24693
+ return;
24694
+ }
24559
24695
  if (!subPackageMeta) {
24560
24696
  let matchSubPackage2 = function(filePath) {
24561
24697
  return subPackageRoots.find((root) => filePath === root || filePath.startsWith(`${root}/`));
@@ -24681,7 +24817,7 @@ function createRequireAnalysisPlugin(state) {
24681
24817
  return;
24682
24818
  }
24683
24819
  for (const requireModule of requireTokens) {
24684
- const absPath = path26.resolve(path26.dirname(moduleInfo.id), requireModule.value);
24820
+ const absPath = path27.resolve(path27.dirname(moduleInfo.id), requireModule.value);
24685
24821
  const resolved = await this.resolve(absPath, moduleInfo.id);
24686
24822
  if (!resolved) {
24687
24823
  continue;
@@ -24694,7 +24830,7 @@ function createRequireAnalysisPlugin(state) {
24694
24830
  this.emitFile({
24695
24831
  type: "chunk",
24696
24832
  id: resolved.id,
24697
- fileName: configService.relativeAbsoluteSrcRoot(
24833
+ fileName: configService.relativeOutputPath(
24698
24834
  changeFileExtension(resolved.id, ".js")
24699
24835
  ),
24700
24836
  preserveSignature: "exports-only"
@@ -24718,6 +24854,17 @@ function formatBytes(bytes) {
24718
24854
  const formatted = value.toFixed(precision).replace(/\.0+$/, "");
24719
24855
  return `${formatted} ${units[index]}`;
24720
24856
  }
24857
+ function filterPluginBundleOutputs(bundle, configService) {
24858
+ const pluginOutputRoot = configService.absolutePluginOutputRoot;
24859
+ for (const [fileName] of Object.entries(bundle)) {
24860
+ const absolute = path27.resolve(configService.outDir, fileName);
24861
+ const relative3 = pluginOutputRoot ? path27.relative(pluginOutputRoot, absolute) : "";
24862
+ const isPluginFile = pluginOutputRoot ? !relative3.startsWith("..") && !path27.isAbsolute(relative3) : fileName.startsWith(path27.basename(configService.absolutePluginRoot ?? "plugin"));
24863
+ if (!isPluginFile) {
24864
+ delete bundle[fileName];
24865
+ }
24866
+ }
24867
+ }
24721
24868
  function emitJsonAssets(state) {
24722
24869
  const { ctx } = state;
24723
24870
  const { jsonService } = ctx;
@@ -24827,8 +24974,8 @@ function resolveRelativeImport(fromFile, specifier) {
24827
24974
  if (!specifier) {
24828
24975
  return "";
24829
24976
  }
24830
- const dir = path26.posix.dirname(fromFile);
24831
- const absolute = path26.posix.resolve("/", dir, specifier);
24977
+ const dir = path27.posix.dirname(fromFile);
24978
+ const absolute = path27.posix.resolve("/", dir, specifier);
24832
24979
  return absolute.startsWith("/") ? absolute.slice(1) : absolute;
24833
24980
  }
24834
24981
  async function flushIndependentBuilds(state) {
@@ -24862,11 +25009,11 @@ async function flushIndependentBuilds(state) {
24862
25009
  // src/plugins/css.ts
24863
25010
  init_esm_shims();
24864
25011
  import fs17 from "fs-extra";
24865
- import path28 from "pathe";
25012
+ import path29 from "pathe";
24866
25013
 
24867
25014
  // src/plugins/css/shared/sharedStyles.ts
24868
25015
  init_esm_shims();
24869
- import path27 from "pathe";
25016
+ import path28 from "pathe";
24870
25017
  import picomatch2 from "picomatch";
24871
25018
  var SLASH_RE = /\\/g;
24872
25019
  function toPosixPath(value) {
@@ -24982,7 +25129,7 @@ function findSharedStylesForModule(modulePath, fileName, sharedStyles) {
24982
25129
  }
24983
25130
  function resolveImportSpecifiers(fileName, entries) {
24984
25131
  const posixFileName = toPosixPath(fileName);
24985
- const dir = path27.posix.dirname(posixFileName);
25132
+ const dir = path28.posix.dirname(posixFileName);
24986
25133
  const seen = /* @__PURE__ */ new Set();
24987
25134
  const specifiers = [];
24988
25135
  for (const entry of entries) {
@@ -24990,8 +25137,8 @@ function resolveImportSpecifiers(fileName, entries) {
24990
25137
  if (target === posixFileName) {
24991
25138
  continue;
24992
25139
  }
24993
- const relative3 = path27.posix.relative(dir, target);
24994
- let specifier = relative3 || path27.posix.basename(target);
25140
+ const relative3 = path28.posix.relative(dir, target);
25141
+ let specifier = relative3 || path28.posix.basename(target);
24995
25142
  if (!specifier || specifier === ".") {
24996
25143
  continue;
24997
25144
  }
@@ -25068,12 +25215,12 @@ async function handleBundleEntry(bundle, bundleKey, asset2, configService, share
25068
25215
  return;
25069
25216
  }
25070
25217
  const toAbsolute = (id) => {
25071
- return path28.isAbsolute(id) ? id : path28.resolve(configService.cwd, id);
25218
+ return path29.isAbsolute(id) ? id : path29.resolve(configService.cwd, id);
25072
25219
  };
25073
25220
  if (bundleKey.endsWith(".wxss")) {
25074
25221
  const [rawOriginal] = asset2.originalFileNames ?? [];
25075
- const absOriginal = rawOriginal ? toAbsolute(rawOriginal) : path28.resolve(configService.absoluteSrcRoot, bundleKey);
25076
- const fileName = configService.relativeAbsoluteSrcRoot(absOriginal);
25222
+ const absOriginal = rawOriginal ? toAbsolute(rawOriginal) : path29.resolve(configService.absoluteSrcRoot, bundleKey);
25223
+ const fileName = configService.relativeOutputPath(absOriginal);
25077
25224
  if (fileName) {
25078
25225
  emitted.add(toPosixPath(fileName));
25079
25226
  }
@@ -25102,7 +25249,7 @@ async function handleBundleEntry(bundle, bundleKey, asset2, configService, share
25102
25249
  }
25103
25250
  const modulePath = toAbsolute(originalFileName);
25104
25251
  const converted = changeFileExtension(modulePath, configService.outputExtensions.wxss);
25105
- const fileName = configService.relativeAbsoluteSrcRoot(converted);
25252
+ const fileName = configService.relativeOutputPath(converted);
25106
25253
  if (!fileName) {
25107
25254
  return;
25108
25255
  }
@@ -25183,7 +25330,7 @@ async function emitSharedStyleImportsForChunks(sharedStyles, emitted, configServ
25183
25330
  return;
25184
25331
  }
25185
25332
  const converted = changeFileExtension(moduleId, outputExtensions.wxss);
25186
- const fileName = configService.relativeAbsoluteSrcRoot(converted);
25333
+ const fileName = configService.relativeOutputPath(converted);
25187
25334
  if (!fileName) {
25188
25335
  return;
25189
25336
  }
@@ -25284,12 +25431,12 @@ init_esm_shims();
25284
25431
  import { createHash as createHash2 } from "crypto";
25285
25432
  import { removeExtension as removeExtension2 } from "@weapp-core/shared";
25286
25433
  import fs18 from "fs-extra";
25287
- import path29 from "pathe";
25434
+ import path30 from "pathe";
25288
25435
  async function resolveWorkerEntry(ctx, entry) {
25289
25436
  const { configService, scanService } = ctx;
25290
- const relativeEntryPath = path29.join(scanService.workersDir, entry);
25437
+ const relativeEntryPath = path30.join(scanService.workersDir, entry);
25291
25438
  const key = removeExtension2(relativeEntryPath);
25292
- const absoluteEntry = path29.resolve(configService.absoluteSrcRoot, relativeEntryPath);
25439
+ const absoluteEntry = path30.resolve(configService.absoluteSrcRoot, relativeEntryPath);
25293
25440
  if (isJsOrTs(entry)) {
25294
25441
  const exists = await fs18.exists(absoluteEntry);
25295
25442
  if (!exists) {
@@ -25326,12 +25473,12 @@ function createWorkerBuildPlugin(ctx) {
25326
25473
  options.chunkFileNames = (chunkInfo) => {
25327
25474
  const workersDir = scanService.workersDir ?? "";
25328
25475
  if (chunkInfo.isDynamicEntry) {
25329
- return path29.join(workersDir, "[name].js");
25476
+ return path30.join(workersDir, "[name].js");
25330
25477
  }
25331
25478
  const sourceId = chunkInfo.facadeModuleId ?? chunkInfo.moduleIds[0];
25332
25479
  const hashBase = typeof sourceId === "string" ? configService.relativeCwd(sourceId) : chunkInfo.name;
25333
25480
  const stableHash = createHash2("sha256").update(hashBase).digest("base64url").slice(0, 8);
25334
- return path29.join(workersDir, `${chunkInfo.name}-${stableHash}.js`);
25481
+ return path30.join(workersDir, `${chunkInfo.name}-${stableHash}.js`);
25335
25482
  };
25336
25483
  }
25337
25484
  };
@@ -25347,7 +25494,7 @@ function workers(ctx) {
25347
25494
  init_esm_shims();
25348
25495
  import { removeExtension as removeExtension3 } from "@weapp-core/shared";
25349
25496
  import fs19 from "fs-extra";
25350
- import path30 from "pathe";
25497
+ import path31 from "pathe";
25351
25498
  var wxsCodeCache = new LRUCache({
25352
25499
  max: 512
25353
25500
  });
@@ -25372,13 +25519,13 @@ async function transformWxsFile(state, wxsPath) {
25372
25519
  if (typeof result?.code === "string") {
25373
25520
  code = result.code;
25374
25521
  }
25375
- const dirname5 = path30.dirname(wxsPath);
25522
+ const dirname5 = path31.dirname(wxsPath);
25376
25523
  await Promise.all(
25377
25524
  importees.map(({ source }) => {
25378
25525
  return transformWxsFile.call(
25379
25526
  this,
25380
25527
  state,
25381
- path30.resolve(dirname5, source)
25528
+ path31.resolve(dirname5, source)
25382
25529
  );
25383
25530
  })
25384
25531
  );
@@ -25389,7 +25536,7 @@ async function transformWxsFile(state, wxsPath) {
25389
25536
  state.wxsMap.set(wxsPath, {
25390
25537
  emittedFile: {
25391
25538
  type: "asset",
25392
- fileName: configService.relativeAbsoluteSrcRoot(
25539
+ fileName: configService.relativeOutputPath(
25393
25540
  isRaw ? wxsPath : removeExtension3(wxsPath)
25394
25541
  ),
25395
25542
  source: code
@@ -25404,7 +25551,7 @@ async function handleWxsDeps(state, deps, absPath) {
25404
25551
  if (!jsExtensions.includes(dep.attrs.lang) && !arr) {
25405
25552
  return;
25406
25553
  }
25407
- const wxsPath = path30.resolve(path30.dirname(absPath), dep.value);
25554
+ const wxsPath = path31.resolve(path31.dirname(absPath), dep.value);
25408
25555
  await transformWxsFile.call(this, state, wxsPath);
25409
25556
  })
25410
25557
  );
@@ -25445,7 +25592,7 @@ function wxs(ctx) {
25445
25592
  }
25446
25593
 
25447
25594
  // src/plugins/index.ts
25448
- var RUNTIME_PLUGINS_SYMBOL = Symbol.for("weapp-runtime:plugins");
25595
+ var RUNTIME_PLUGINS_SYMBOL = /* @__PURE__ */ Symbol.for("weapp-runtime:plugins");
25449
25596
  var WEAPP_VITE_CONTEXT_PLUGIN_NAME = "weapp-vite:context";
25450
25597
  function createContextPlugin(ctx) {
25451
25598
  return {
@@ -25608,17 +25755,17 @@ function createMergeFactories(options) {
25608
25755
  };
25609
25756
  if (currentOptions.isDev) {
25610
25757
  const watchInclude = [
25611
- path31.join(currentOptions.cwd, currentOptions.srcRoot, "**")
25758
+ path32.join(currentOptions.cwd, currentOptions.srcRoot, "**")
25612
25759
  ];
25613
25760
  const pluginRootConfig = currentOptions.config.weapp?.pluginRoot;
25614
25761
  if (pluginRootConfig) {
25615
- const absolutePluginRoot = path31.resolve(currentOptions.cwd, pluginRootConfig);
25616
- const relativeToSrc = path31.relative(
25617
- path31.resolve(currentOptions.cwd, currentOptions.srcRoot),
25762
+ const absolutePluginRoot = path32.resolve(currentOptions.cwd, pluginRootConfig);
25763
+ const relativeToSrc = path32.relative(
25764
+ path32.resolve(currentOptions.cwd, currentOptions.srcRoot),
25618
25765
  absolutePluginRoot
25619
25766
  );
25620
- const pluginPatternBase = relativeToSrc.startsWith("..") ? absolutePluginRoot : path31.join(currentOptions.cwd, currentOptions.srcRoot, relativeToSrc);
25621
- watchInclude.push(path31.join(pluginPatternBase, "**"));
25767
+ const pluginPatternBase = relativeToSrc.startsWith("..") ? absolutePluginRoot : path32.join(currentOptions.cwd, currentOptions.srcRoot, relativeToSrc);
25768
+ watchInclude.push(path32.join(pluginPatternBase, "**"));
25622
25769
  }
25623
25770
  const inline = defu4(
25624
25771
  currentOptions.config,
@@ -25631,7 +25778,7 @@ function createMergeFactories(options) {
25631
25778
  watch: {
25632
25779
  exclude: [
25633
25780
  ...defaultExcluded,
25634
- currentOptions.mpDistRoot ? path31.join(currentOptions.cwd, currentOptions.mpDistRoot, "**") : path31.join(currentOptions.cwd, "dist", "**")
25781
+ currentOptions.mpDistRoot ? path32.join(currentOptions.cwd, currentOptions.mpDistRoot, "**") : path32.join(currentOptions.cwd, "dist", "**")
25635
25782
  ],
25636
25783
  include: watchInclude
25637
25784
  },
@@ -25761,6 +25908,62 @@ function createConfigService(ctx) {
25761
25908
  const builtinAliases = resolveBuiltinPackageAliases();
25762
25909
  const oxcRuntimeSupport = createOxcRuntimeSupport();
25763
25910
  const aliasManager = createAliasManager(oxcRuntimeSupport.alias, builtinAliases);
25911
+ const toPosix3 = (value) => value.replace(/\\/g, "/");
25912
+ const fromPosix = (value) => path33.sep === "/" ? value : value.split("/").join(path33.sep);
25913
+ const resolveAbsolutePluginRoot = () => {
25914
+ const pluginRootConfig = options.config.weapp?.pluginRoot;
25915
+ if (!pluginRootConfig) {
25916
+ return void 0;
25917
+ }
25918
+ return path33.resolve(options.cwd, pluginRootConfig);
25919
+ };
25920
+ const resolvePluginSourceBase = () => {
25921
+ const absolutePluginRoot = resolveAbsolutePluginRoot();
25922
+ if (!absolutePluginRoot) {
25923
+ return void 0;
25924
+ }
25925
+ return toPosix3(path33.basename(absolutePluginRoot));
25926
+ };
25927
+ const resolveAbsolutePluginOutputRoot = () => {
25928
+ const absolutePluginRoot = resolveAbsolutePluginRoot();
25929
+ if (!absolutePluginRoot) {
25930
+ return void 0;
25931
+ }
25932
+ const configured = options.projectConfig?.pluginRoot;
25933
+ if (configured) {
25934
+ return path33.resolve(options.cwd, configured);
25935
+ }
25936
+ const outDir = path33.resolve(options.cwd, options.mpDistRoot ?? "");
25937
+ const pluginBase = path33.basename(absolutePluginRoot);
25938
+ return path33.resolve(outDir, pluginBase);
25939
+ };
25940
+ const resolvePluginOutputBasePosix = () => {
25941
+ const absoluteOutputRoot = resolveAbsolutePluginOutputRoot();
25942
+ if (!absoluteOutputRoot) {
25943
+ return void 0;
25944
+ }
25945
+ const outDir = path33.resolve(options.cwd, options.mpDistRoot ?? "");
25946
+ const relative3 = path33.relative(outDir, absoluteOutputRoot);
25947
+ const normalized = toPosix3(relative3);
25948
+ if (!normalized || normalized === ".") {
25949
+ return resolvePluginSourceBase();
25950
+ }
25951
+ return normalized;
25952
+ };
25953
+ const remapPluginRelativePath = (relativePath) => {
25954
+ const pluginBase = resolvePluginSourceBase();
25955
+ if (!pluginBase) {
25956
+ return relativePath;
25957
+ }
25958
+ const normalizedRelative = toPosix3(relativePath);
25959
+ if (normalizedRelative === pluginBase || normalizedRelative.startsWith(`${pluginBase}/`)) {
25960
+ const pluginRelative = normalizedRelative === pluginBase ? "" : normalizedRelative.slice(pluginBase.length + 1);
25961
+ const outputBase = resolvePluginOutputBasePosix() ?? pluginBase;
25962
+ const mapped = pluginRelative ? `${outputBase}/${pluginRelative}` : outputBase;
25963
+ return fromPosix(mapped);
25964
+ }
25965
+ return relativePath;
25966
+ };
25764
25967
  function setOptions(value) {
25765
25968
  options = value;
25766
25969
  configState.options = value;
@@ -25876,7 +26079,7 @@ function createConfigService(ctx) {
25876
26079
  return options.mpDistRoot;
25877
26080
  },
25878
26081
  get outDir() {
25879
- return path32.resolve(options.cwd, options.mpDistRoot ?? "");
26082
+ return path33.resolve(options.cwd, options.mpDistRoot ?? "");
25880
26083
  },
25881
26084
  get currentSubPackageRoot() {
25882
26085
  return options.currentSubPackageRoot;
@@ -25900,12 +26103,13 @@ function createConfigService(ctx) {
25900
26103
  return options.config.weapp?.pluginRoot;
25901
26104
  },
25902
26105
  get absolutePluginRoot() {
25903
- if (options.config.weapp?.pluginRoot) {
25904
- return path32.resolve(options.cwd, options.config.weapp.pluginRoot);
25905
- }
26106
+ return resolveAbsolutePluginRoot();
26107
+ },
26108
+ get absolutePluginOutputRoot() {
26109
+ return resolveAbsolutePluginOutputRoot();
25906
26110
  },
25907
26111
  get absoluteSrcRoot() {
25908
- return path32.resolve(options.cwd, options.srcRoot);
26112
+ return path33.resolve(options.cwd, options.srcRoot);
25909
26113
  },
25910
26114
  get mode() {
25911
26115
  return options.mode;
@@ -25923,28 +26127,34 @@ function createConfigService(ctx) {
25923
26127
  return options.weappWeb;
25924
26128
  },
25925
26129
  relativeCwd(p) {
25926
- return path32.relative(options.cwd, p);
26130
+ return path33.relative(options.cwd, p);
25927
26131
  },
25928
26132
  relativeSrcRoot(p) {
25929
26133
  return options.relativeSrcRoot(p);
25930
26134
  },
25931
26135
  relativeAbsoluteSrcRoot(p) {
25932
- const absoluteSrcRoot = path32.resolve(options.cwd, options.srcRoot);
25933
- const pluginRootConfig = options.config.weapp?.pluginRoot;
25934
- if (pluginRootConfig) {
25935
- const absolutePluginRoot = path32.resolve(options.cwd, pluginRootConfig);
25936
- const relativeToPlugin = path32.relative(absolutePluginRoot, p);
26136
+ const absoluteSrcRoot = path33.resolve(options.cwd, options.srcRoot);
26137
+ const absolutePluginRoot = resolveAbsolutePluginRoot();
26138
+ if (absolutePluginRoot) {
26139
+ const relativeToPlugin = path33.relative(absolutePluginRoot, p);
25937
26140
  if (!relativeToPlugin.startsWith("..")) {
25938
- const pluginBase = path32.basename(absolutePluginRoot);
25939
- return relativeToPlugin ? path32.join(pluginBase, relativeToPlugin) : pluginBase;
26141
+ const pluginBase = path33.basename(absolutePluginRoot);
26142
+ return relativeToPlugin ? path33.join(pluginBase, relativeToPlugin) : pluginBase;
25940
26143
  }
25941
26144
  }
25942
- const relativeFromSrc = path32.relative(absoluteSrcRoot, p);
26145
+ const relativeFromSrc = path33.relative(absoluteSrcRoot, p);
25943
26146
  if (!relativeFromSrc.startsWith("..")) {
25944
26147
  return relativeFromSrc;
25945
26148
  }
25946
- const relativeFromCwd = path32.relative(options.cwd, p);
26149
+ const relativeFromCwd = path33.relative(options.cwd, p);
25947
26150
  return relativeFromCwd;
26151
+ },
26152
+ relativeOutputPath(p) {
26153
+ const relative3 = this.relativeAbsoluteSrcRoot(p);
26154
+ if (!relative3) {
26155
+ return relative3;
26156
+ }
26157
+ return remapPluginRelativePath(relative3);
25948
26158
  }
25949
26159
  };
25950
26160
  }
@@ -26019,6 +26229,7 @@ function createJsonService(ctx) {
26019
26229
  require: customRequire,
26020
26230
  rolldownOptions: {
26021
26231
  input: {
26232
+ // @ts-ignore
26022
26233
  define: ctx.configService.defineImportMetaEnv
26023
26234
  },
26024
26235
  output: {
@@ -26062,7 +26273,7 @@ init_esm_shims();
26062
26273
  import { isBuiltin } from "module";
26063
26274
  import { defu as defu6, isObject as isObject9, objectHash } from "@weapp-core/shared";
26064
26275
  import fs21 from "fs-extra";
26065
- import path33 from "pathe";
26276
+ import path34 from "pathe";
26066
26277
  import { build as tsdownBuild } from "tsdown";
26067
26278
  function createNpmService(ctx) {
26068
26279
  const oxcRuntimeSupport = createOxcRuntimeSupport();
@@ -26071,7 +26282,7 @@ function createNpmService(ctx) {
26071
26282
  if (!ctx.configService) {
26072
26283
  throw new Error("configService must be initialized before generating npm cache path");
26073
26284
  }
26074
- return path33.resolve(ctx.configService.cwd, `node_modules/weapp-vite/.cache/${key.replaceAll("/", "-")}.json`);
26285
+ return path34.resolve(ctx.configService.cwd, `node_modules/weapp-vite/.cache/${key.replaceAll("/", "-")}.json`);
26075
26286
  }
26076
26287
  function dependenciesCacheHash() {
26077
26288
  if (!ctx.configService) {
@@ -26175,14 +26386,14 @@ function createNpmService(ctx) {
26175
26386
  const { packageJson: targetJson, rootPath } = packageInfo;
26176
26387
  const dependencies = targetJson.dependencies ?? {};
26177
26388
  const keys = Object.keys(dependencies);
26178
- const destOutDir = path33.resolve(outDir, dep);
26389
+ const destOutDir = path34.resolve(outDir, dep);
26179
26390
  if (await shouldSkipBuild(destOutDir, isDependenciesCacheOutdate)) {
26180
26391
  logger_default.info(`[npm] \u4F9D\u8D56 \`${dep}\` \u672A\u53D1\u751F\u53D8\u5316\uFF0C\u8DF3\u8FC7\u5904\u7406!`);
26181
26392
  return;
26182
26393
  }
26183
26394
  if (isMiniprogramPackage(targetJson)) {
26184
26395
  await copyBuild({
26185
- from: path33.resolve(
26396
+ from: path34.resolve(
26186
26397
  rootPath,
26187
26398
  targetJson.miniprogram
26188
26399
  ),
@@ -26254,10 +26465,10 @@ function createNpmService(ctx) {
26254
26465
  debug?.("buildNpm start");
26255
26466
  const packNpmRelationList = getPackNpmRelationList();
26256
26467
  const [mainRelation, ...subRelations] = packNpmRelationList;
26257
- const packageJsonPath = path33.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
26468
+ const packageJsonPath = path34.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
26258
26469
  if (await fs21.exists(packageJsonPath)) {
26259
26470
  const pkgJson = await fs21.readJson(packageJsonPath);
26260
- const outDir = path33.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, "miniprogram_npm");
26471
+ const outDir = path34.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, "miniprogram_npm");
26261
26472
  if (pkgJson.dependencies) {
26262
26473
  const dependencies = Object.keys(pkgJson.dependencies);
26263
26474
  if (dependencies.length > 0) {
@@ -26276,7 +26487,7 @@ function createNpmService(ctx) {
26276
26487
  const targetDirs = [
26277
26488
  ...subRelations.map((x) => {
26278
26489
  return {
26279
- npmDistDir: path33.resolve(ctx.configService.cwd, x.miniprogramNpmDistDir, "miniprogram_npm")
26490
+ npmDistDir: path34.resolve(ctx.configService.cwd, x.miniprogramNpmDistDir, "miniprogram_npm")
26280
26491
  };
26281
26492
  }),
26282
26493
  ...[...ctx.scanService.independentSubPackageMap.values()].map((x) => {
@@ -26284,7 +26495,7 @@ function createNpmService(ctx) {
26284
26495
  return {
26285
26496
  root: x.subPackage.root,
26286
26497
  dependencies: dependencies2,
26287
- npmDistDir: path33.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, x.subPackage.root, "miniprogram_npm")
26498
+ npmDistDir: path34.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, x.subPackage.root, "miniprogram_npm")
26288
26499
  };
26289
26500
  })
26290
26501
  ];
@@ -26296,7 +26507,7 @@ function createNpmService(ctx) {
26296
26507
  overwrite: true,
26297
26508
  filter: (src) => {
26298
26509
  if (Array.isArray(x.dependencies)) {
26299
- const relPath = path33.relative(outDir, src);
26510
+ const relPath = path34.relative(outDir, src);
26300
26511
  if (relPath === "") {
26301
26512
  return true;
26302
26513
  }
@@ -26312,7 +26523,7 @@ function createNpmService(ctx) {
26312
26523
  overwrite: true,
26313
26524
  filter: (src) => {
26314
26525
  if (Array.isArray(x.dependencies)) {
26315
- const relPath = path33.relative(outDir, src);
26526
+ const relPath = path34.relative(outDir, src);
26316
26527
  if (relPath === "") {
26317
26528
  return true;
26318
26529
  }
@@ -26738,7 +26949,7 @@ var PQueue = class extends import_index2.default {
26738
26949
  ...options
26739
26950
  };
26740
26951
  return new Promise((resolve8, reject) => {
26741
- const taskSymbol = Symbol(`task-${options.id}`);
26952
+ const taskSymbol = /* @__PURE__ */ Symbol(`task-${options.id}`);
26742
26953
  this.#queue.enqueue(async () => {
26743
26954
  this.#pending++;
26744
26955
  this.#runningTasks.set(taskSymbol, {
@@ -27281,7 +27492,7 @@ function createRuntimeState() {
27281
27492
  init_esm_shims();
27282
27493
  import { isObject as isObject10, removeExtensionDeep as removeExtensionDeep6 } from "@weapp-core/shared";
27283
27494
  import fs23 from "fs-extra";
27284
- import path34 from "pathe";
27495
+ import path35 from "pathe";
27285
27496
  var SUPPORTED_SHARED_STYLE_EXTENSIONS = [
27286
27497
  ".wxss",
27287
27498
  ".css",
@@ -27300,8 +27511,8 @@ function toPosix2(value) {
27300
27511
  return value.replace(BACKSLASH_RE, "/");
27301
27512
  }
27302
27513
  function isPathInside(parent, target) {
27303
- const relative3 = path34.relative(parent, target);
27304
- return relative3 === "" || !relative3.startsWith("..") && !path34.isAbsolute(relative3);
27514
+ const relative3 = path35.relative(parent, target);
27515
+ return relative3 === "" || !relative3.startsWith("..") && !path35.isAbsolute(relative3);
27305
27516
  }
27306
27517
  function resolveSubPackageEntries(subPackage) {
27307
27518
  const entries = [];
@@ -27325,17 +27536,17 @@ function resolveStyleEntryAbsolutePath(source, subPackageRoot, configService) {
27325
27536
  return void 0;
27326
27537
  }
27327
27538
  const srcRoot = service.absoluteSrcRoot;
27328
- const absoluteSubRoot = path34.resolve(srcRoot, subPackageRoot);
27539
+ const absoluteSubRoot = path35.resolve(srcRoot, subPackageRoot);
27329
27540
  const normalizedEntry = toPosix2(trimmed);
27330
27541
  const normalizedRoot = toPosix2(subPackageRoot);
27331
27542
  const candidates = [];
27332
- if (path34.isAbsolute(trimmed)) {
27543
+ if (path35.isAbsolute(trimmed)) {
27333
27544
  candidates.push(trimmed);
27334
27545
  } else if (normalizedEntry === normalizedRoot || normalizedEntry.startsWith(`${normalizedRoot}/`)) {
27335
- candidates.push(path34.resolve(srcRoot, trimmed));
27546
+ candidates.push(path35.resolve(srcRoot, trimmed));
27336
27547
  } else {
27337
- candidates.push(path34.resolve(absoluteSubRoot, trimmed));
27338
- candidates.push(path34.resolve(srcRoot, trimmed));
27548
+ candidates.push(path35.resolve(absoluteSubRoot, trimmed));
27549
+ candidates.push(path35.resolve(srcRoot, trimmed));
27339
27550
  }
27340
27551
  for (const candidate of candidates) {
27341
27552
  if (isPathInside(srcRoot, candidate)) {
@@ -27443,7 +27654,7 @@ function inferScopeFromRelativePath(relativePath) {
27443
27654
  if (cleaned.includes("/")) {
27444
27655
  return void 0;
27445
27656
  }
27446
- const base = path34.posix.basename(cleaned, path34.posix.extname(cleaned));
27657
+ const base = path35.posix.basename(cleaned, path35.posix.extname(cleaned));
27447
27658
  if (base === "pages") {
27448
27659
  return "pages";
27449
27660
  }
@@ -27506,18 +27717,18 @@ function addStyleEntry(descriptor, absolutePath, posixOutput, root, normalizedRo
27506
27717
  source: descriptor.source,
27507
27718
  absolutePath,
27508
27719
  outputRelativePath: posixOutput,
27509
- inputExtension: path34.extname(absolutePath).toLowerCase(),
27720
+ inputExtension: path35.extname(absolutePath).toLowerCase(),
27510
27721
  scope: descriptor.scope,
27511
27722
  include,
27512
27723
  exclude
27513
27724
  });
27514
27725
  }
27515
27726
  function appendDefaultScopedStyleEntries(root, normalizedRoot, service, dedupe, normalized) {
27516
- const absoluteSubRoot = path34.resolve(service.absoluteSrcRoot, root);
27727
+ const absoluteSubRoot = path35.resolve(service.absoluteSrcRoot, root);
27517
27728
  for (const { base, scope } of DEFAULT_SCOPED_FILES) {
27518
27729
  for (const ext2 of DEFAULT_SCOPED_EXTENSIONS) {
27519
27730
  const filename = `${base}${ext2}`;
27520
- const absolutePath = path34.resolve(absoluteSubRoot, filename);
27731
+ const absolutePath = path35.resolve(absoluteSubRoot, filename);
27521
27732
  if (!fs23.existsSync(absolutePath)) {
27522
27733
  continue;
27523
27734
  }
@@ -27529,7 +27740,7 @@ function appendDefaultScopedStyleEntries(root, normalizedRoot, service, dedupe,
27529
27740
  explicitScope: true
27530
27741
  };
27531
27742
  const outputAbsolutePath = changeFileExtension(absolutePath, service.outputExtensions.wxss);
27532
- const outputRelativePath = service.relativeAbsoluteSrcRoot(outputAbsolutePath);
27743
+ const outputRelativePath = service.relativeOutputPath(outputAbsolutePath);
27533
27744
  if (!outputRelativePath) {
27534
27745
  continue;
27535
27746
  }
@@ -27567,13 +27778,13 @@ function normalizeSubPackageStyleEntries(styles, subPackage, configService) {
27567
27778
  logger_default.warn(`[subpackages] \u5206\u5305 ${root} \u6837\u5F0F\u5165\u53E3 \`${descriptor.source}\` \u5BF9\u5E94\u6587\u4EF6\u4E0D\u5B58\u5728\uFF0C\u5DF2\u5FFD\u7565\u3002`);
27568
27779
  continue;
27569
27780
  }
27570
- const ext2 = path34.extname(absolutePath).toLowerCase();
27781
+ const ext2 = path35.extname(absolutePath).toLowerCase();
27571
27782
  if (!SUPPORTED_SHARED_STYLE_EXTS.has(ext2)) {
27572
27783
  logger_default.warn(`[subpackages] \u5206\u5305 ${root} \u6837\u5F0F\u5165\u53E3 \`${descriptor.source}\` \u5F53\u524D\u4EC5\u652F\u6301\u4EE5\u4E0B\u683C\u5F0F\uFF1A${SUPPORTED_SHARED_STYLE_EXTENSIONS.join(", ")}\uFF0C\u5DF2\u5FFD\u7565\u3002`);
27573
27784
  continue;
27574
27785
  }
27575
27786
  const outputAbsolutePath = changeFileExtension(absolutePath, service.outputExtensions.wxss);
27576
- const outputRelativePath = service.relativeAbsoluteSrcRoot(outputAbsolutePath);
27787
+ const outputRelativePath = service.relativeOutputPath(outputAbsolutePath);
27577
27788
  if (!outputRelativePath) {
27578
27789
  logger_default.warn(`[subpackages] \u5206\u5305 ${root} \u6837\u5F0F\u5165\u53E3 \`${descriptor.source}\` \u4E0D\u5728\u9879\u76EE\u6E90\u7801\u76EE\u5F55\u5185\uFF0C\u5DF2\u5FFD\u7565\u3002`);
27579
27790
  continue;
@@ -27601,11 +27812,11 @@ function createScanService(ctx) {
27601
27812
  return scanState.appEntry;
27602
27813
  }
27603
27814
  const appDirname = ctx.configService.absoluteSrcRoot;
27604
- const appBasename = path34.resolve(appDirname, "app");
27815
+ const appBasename = path35.resolve(appDirname, "app");
27605
27816
  const { path: appConfigFile } = await findJsonEntry(appBasename);
27606
27817
  const { path: appEntryPath } = await findJsEntry(appBasename);
27607
27818
  if (ctx.configService.absolutePluginRoot) {
27608
- const pluginBasename = path34.resolve(ctx.configService.absolutePluginRoot, "plugin");
27819
+ const pluginBasename = path35.resolve(ctx.configService.absolutePluginRoot, "plugin");
27609
27820
  const { path: pluginConfigFile } = await findJsonEntry(pluginBasename);
27610
27821
  if (pluginConfigFile) {
27611
27822
  const pluginConfig = await ctx.jsonService.read(pluginConfigFile);
@@ -27628,14 +27839,14 @@ function createScanService(ctx) {
27628
27839
  scanState.appEntry = resolvedAppEntry;
27629
27840
  const { sitemapLocation = "sitemap.json", themeLocation = "theme.json" } = config;
27630
27841
  if (sitemapLocation) {
27631
- const { path: sitemapJsonPath } = await findJsonEntry(path34.resolve(appDirname, sitemapLocation));
27842
+ const { path: sitemapJsonPath } = await findJsonEntry(path35.resolve(appDirname, sitemapLocation));
27632
27843
  if (sitemapJsonPath) {
27633
27844
  resolvedAppEntry.sitemapJsonPath = sitemapJsonPath;
27634
27845
  resolvedAppEntry.sitemapJson = await ctx.jsonService.read(sitemapJsonPath);
27635
27846
  }
27636
27847
  }
27637
27848
  if (themeLocation) {
27638
- const { path: themeJsonPath } = await findJsonEntry(path34.resolve(appDirname, themeLocation));
27849
+ const { path: themeJsonPath } = await findJsonEntry(path35.resolve(appDirname, themeLocation));
27639
27850
  if (themeJsonPath) {
27640
27851
  resolvedAppEntry.themeJsonPath = themeJsonPath;
27641
27852
  resolvedAppEntry.themeJson = await ctx.jsonService.read(themeJsonPath);
@@ -27911,7 +28122,7 @@ function createWebServicePlugin(ctx) {
27911
28122
  init_esm_shims();
27912
28123
  import { removeExtensionDeep as removeExtensionDeep7 } from "@weapp-core/shared";
27913
28124
  import fs24 from "fs-extra";
27914
- import path35 from "pathe";
28125
+ import path36 from "pathe";
27915
28126
 
27916
28127
  // src/wxml/index.ts
27917
28128
  init_esm_shims();
@@ -30621,7 +30832,7 @@ function createWxmlService(ctx) {
30621
30832
  throw new Error("configService must be initialized before scanning wxml");
30622
30833
  }
30623
30834
  if (await fs24.exists(filepath)) {
30624
- const dirname5 = path35.dirname(filepath);
30835
+ const dirname5 = path36.dirname(filepath);
30625
30836
  const wxml = await fs24.readFile(filepath, "utf8");
30626
30837
  const shouldRescan = await cache2.isInvalidate(filepath, { content: wxml });
30627
30838
  if (!shouldRescan) {
@@ -30638,9 +30849,9 @@ function createWxmlService(ctx) {
30638
30849
  filepath,
30639
30850
  res.deps.filter((x) => isImportTag(x.tagName) && isTemplate(x.value)).map((x) => {
30640
30851
  if (x.value.startsWith("/")) {
30641
- return path35.resolve(ctx.configService.absoluteSrcRoot, x.value.slice(1));
30852
+ return path36.resolve(ctx.configService.absoluteSrcRoot, x.value.slice(1));
30642
30853
  } else {
30643
- return path35.resolve(dirname5, x.value);
30854
+ return path36.resolve(dirname5, x.value);
30644
30855
  }
30645
30856
  })
30646
30857
  );
@@ -30694,7 +30905,7 @@ function createCompilerContextInstance() {
30694
30905
  createBuildServicePlugin(context),
30695
30906
  createWebServicePlugin(context)
30696
30907
  ];
30697
- Object.defineProperty(context, Symbol.for("weapp-runtime:plugins"), {
30908
+ Object.defineProperty(context, /* @__PURE__ */ Symbol.for("weapp-runtime:plugins"), {
30698
30909
  configurable: false,
30699
30910
  enumerable: false,
30700
30911
  writable: false,
@@ -30747,6 +30958,6 @@ export {
30747
30958
  };
30748
30959
  /*! Bundled license information:
30749
30960
 
30750
- chokidar/esm/index.js:
30961
+ chokidar/index.js:
30751
30962
  (*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
30752
30963
  */