weapp-vite 5.4.0 → 5.5.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.
- package/dist/auto-routes.cjs +2 -2
- package/dist/auto-routes.mjs +1 -1
- package/dist/{chunk-XEHEGODS.cjs → chunk-5GG5TEGR.cjs} +734 -488
- package/dist/{chunk-LX2OMRQ4.cjs → chunk-OWCDSB6F.cjs} +4 -4
- package/dist/{chunk-KW3QAG67.mjs → chunk-QCLEMTCV.mjs} +1 -1
- package/dist/{chunk-UT7K35VH.mjs → chunk-T4MUKDMP.mjs} +731 -485
- package/dist/cli.cjs +42 -36
- package/dist/cli.mjs +9 -3
- package/dist/{config-DNP6NeTc.d.cts → config-CzCzK7Jh.d.cts} +15 -1
- package/dist/{config-jhY9Idrt.d.ts → config-DepC4j8j.d.ts} +15 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/json.d.cts +1 -1
- package/dist/json.d.ts +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +9 -9
|
@@ -2952,13 +2952,13 @@ function extractComponentProps(code) {
|
|
|
2952
2952
|
});
|
|
2953
2953
|
let props = /* @__PURE__ */ new Map();
|
|
2954
2954
|
_traverse2.default.call(void 0, ast, {
|
|
2955
|
-
CallExpression(
|
|
2955
|
+
CallExpression(path31) {
|
|
2956
2956
|
if (props.size > 0) {
|
|
2957
2957
|
return;
|
|
2958
2958
|
}
|
|
2959
|
-
const callee =
|
|
2959
|
+
const callee = path31.node.callee;
|
|
2960
2960
|
if (callee.type === "Identifier" && callee.name === "Component") {
|
|
2961
|
-
const [options] =
|
|
2961
|
+
const [options] = path31.node.arguments;
|
|
2962
2962
|
if (options && options.type === "ObjectExpression") {
|
|
2963
2963
|
props = extractComponentProperties(options);
|
|
2964
2964
|
}
|
|
@@ -4386,7 +4386,7 @@ var ReaddirpStream = class extends _stream.Readable {
|
|
|
4386
4386
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
4387
4387
|
const statMethod = opts.lstat ? _promises.lstat : _promises.stat;
|
|
4388
4388
|
if (wantBigintFsStats) {
|
|
4389
|
-
this._stat = (
|
|
4389
|
+
this._stat = (path31) => statMethod(path31, { bigint: true });
|
|
4390
4390
|
} else {
|
|
4391
4391
|
this._stat = statMethod;
|
|
4392
4392
|
}
|
|
@@ -4411,8 +4411,8 @@ var ReaddirpStream = class extends _stream.Readable {
|
|
|
4411
4411
|
const par = this.parent;
|
|
4412
4412
|
const fil = par && par.files;
|
|
4413
4413
|
if (fil && fil.length > 0) {
|
|
4414
|
-
const { path:
|
|
4415
|
-
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent,
|
|
4414
|
+
const { path: path31, depth } = par;
|
|
4415
|
+
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path31));
|
|
4416
4416
|
const awaited = await Promise.all(slice);
|
|
4417
4417
|
for (const entry of awaited) {
|
|
4418
4418
|
if (!entry)
|
|
@@ -4452,20 +4452,20 @@ var ReaddirpStream = class extends _stream.Readable {
|
|
|
4452
4452
|
this.reading = false;
|
|
4453
4453
|
}
|
|
4454
4454
|
}
|
|
4455
|
-
async _exploreDir(
|
|
4455
|
+
async _exploreDir(path31, depth) {
|
|
4456
4456
|
let files;
|
|
4457
4457
|
try {
|
|
4458
|
-
files = await _promises.readdir.call(void 0,
|
|
4458
|
+
files = await _promises.readdir.call(void 0, path31, this._rdOptions);
|
|
4459
4459
|
} catch (error) {
|
|
4460
4460
|
this._onError(error);
|
|
4461
4461
|
}
|
|
4462
|
-
return { files, depth, path:
|
|
4462
|
+
return { files, depth, path: path31 };
|
|
4463
4463
|
}
|
|
4464
|
-
async _formatEntry(dirent,
|
|
4464
|
+
async _formatEntry(dirent, path31) {
|
|
4465
4465
|
let entry;
|
|
4466
4466
|
const basename4 = this._isDirent ? dirent.name : dirent;
|
|
4467
4467
|
try {
|
|
4468
|
-
const fullPath = _path.resolve.call(void 0, _path.join.call(void 0,
|
|
4468
|
+
const fullPath = _path.resolve.call(void 0, _path.join.call(void 0, path31, basename4));
|
|
4469
4469
|
entry = { path: _path.relative.call(void 0, this._root, fullPath), fullPath, basename: basename4 };
|
|
4470
4470
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
4471
4471
|
} catch (err) {
|
|
@@ -4866,16 +4866,16 @@ var delFromSet = (main, prop, item) => {
|
|
|
4866
4866
|
};
|
|
4867
4867
|
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
4868
4868
|
var FsWatchInstances = /* @__PURE__ */ new Map();
|
|
4869
|
-
function createFsWatchInstance(
|
|
4869
|
+
function createFsWatchInstance(path31, options, listener, errHandler, emitRaw) {
|
|
4870
4870
|
const handleEvent = (rawEvent, evPath) => {
|
|
4871
|
-
listener(
|
|
4872
|
-
emitRaw(rawEvent, evPath, { watchedPath:
|
|
4873
|
-
if (evPath &&
|
|
4874
|
-
fsWatchBroadcast(sysPath.resolve(
|
|
4871
|
+
listener(path31);
|
|
4872
|
+
emitRaw(rawEvent, evPath, { watchedPath: path31 });
|
|
4873
|
+
if (evPath && path31 !== evPath) {
|
|
4874
|
+
fsWatchBroadcast(sysPath.resolve(path31, evPath), KEY_LISTENERS, sysPath.join(path31, evPath));
|
|
4875
4875
|
}
|
|
4876
4876
|
};
|
|
4877
4877
|
try {
|
|
4878
|
-
return _fs.watch.call(void 0,
|
|
4878
|
+
return _fs.watch.call(void 0, path31, {
|
|
4879
4879
|
persistent: options.persistent
|
|
4880
4880
|
}, handleEvent);
|
|
4881
4881
|
} catch (error) {
|
|
@@ -4891,12 +4891,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
|
4891
4891
|
listener(val1, val2, val3);
|
|
4892
4892
|
});
|
|
4893
4893
|
};
|
|
4894
|
-
var setFsWatchListener = (
|
|
4894
|
+
var setFsWatchListener = (path31, fullPath, options, handlers) => {
|
|
4895
4895
|
const { listener, errHandler, rawEmitter } = handlers;
|
|
4896
4896
|
let cont = FsWatchInstances.get(fullPath);
|
|
4897
4897
|
let watcher;
|
|
4898
4898
|
if (!options.persistent) {
|
|
4899
|
-
watcher = createFsWatchInstance(
|
|
4899
|
+
watcher = createFsWatchInstance(path31, options, listener, errHandler, rawEmitter);
|
|
4900
4900
|
if (!watcher)
|
|
4901
4901
|
return;
|
|
4902
4902
|
return watcher.close.bind(watcher);
|
|
@@ -4907,7 +4907,7 @@ var setFsWatchListener = (path30, fullPath, options, handlers) => {
|
|
|
4907
4907
|
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
4908
4908
|
} else {
|
|
4909
4909
|
watcher = createFsWatchInstance(
|
|
4910
|
-
|
|
4910
|
+
path31,
|
|
4911
4911
|
options,
|
|
4912
4912
|
fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
|
|
4913
4913
|
errHandler,
|
|
@@ -4922,7 +4922,7 @@ var setFsWatchListener = (path30, fullPath, options, handlers) => {
|
|
|
4922
4922
|
cont.watcherUnusable = true;
|
|
4923
4923
|
if (isWindows && error.code === "EPERM") {
|
|
4924
4924
|
try {
|
|
4925
|
-
const fd = await _promises.open.call(void 0,
|
|
4925
|
+
const fd = await _promises.open.call(void 0, path31, "r");
|
|
4926
4926
|
await fd.close();
|
|
4927
4927
|
broadcastErr(error);
|
|
4928
4928
|
} catch (err) {
|
|
@@ -4953,7 +4953,7 @@ var setFsWatchListener = (path30, fullPath, options, handlers) => {
|
|
|
4953
4953
|
};
|
|
4954
4954
|
};
|
|
4955
4955
|
var FsWatchFileInstances = /* @__PURE__ */ new Map();
|
|
4956
|
-
var setFsWatchFileListener = (
|
|
4956
|
+
var setFsWatchFileListener = (path31, fullPath, options, handlers) => {
|
|
4957
4957
|
const { listener, rawEmitter } = handlers;
|
|
4958
4958
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
4959
4959
|
const copts = cont && cont.options;
|
|
@@ -4975,7 +4975,7 @@ var setFsWatchFileListener = (path30, fullPath, options, handlers) => {
|
|
|
4975
4975
|
});
|
|
4976
4976
|
const currmtime = curr.mtimeMs;
|
|
4977
4977
|
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
4978
|
-
foreach(cont.listeners, (listener2) => listener2(
|
|
4978
|
+
foreach(cont.listeners, (listener2) => listener2(path31, curr));
|
|
4979
4979
|
}
|
|
4980
4980
|
})
|
|
4981
4981
|
};
|
|
@@ -5003,13 +5003,13 @@ var NodeFsHandler = class {
|
|
|
5003
5003
|
* @param listener on fs change
|
|
5004
5004
|
* @returns closer for the watcher instance
|
|
5005
5005
|
*/
|
|
5006
|
-
_watchWithNodeFs(
|
|
5006
|
+
_watchWithNodeFs(path31, listener) {
|
|
5007
5007
|
const opts = this.fsw.options;
|
|
5008
|
-
const directory = sysPath.dirname(
|
|
5009
|
-
const basename4 = sysPath.basename(
|
|
5008
|
+
const directory = sysPath.dirname(path31);
|
|
5009
|
+
const basename4 = sysPath.basename(path31);
|
|
5010
5010
|
const parent = this.fsw._getWatchedDir(directory);
|
|
5011
5011
|
parent.add(basename4);
|
|
5012
|
-
const absolutePath = sysPath.resolve(
|
|
5012
|
+
const absolutePath = sysPath.resolve(path31);
|
|
5013
5013
|
const options = {
|
|
5014
5014
|
persistent: opts.persistent
|
|
5015
5015
|
};
|
|
@@ -5019,12 +5019,12 @@ var NodeFsHandler = class {
|
|
|
5019
5019
|
if (opts.usePolling) {
|
|
5020
5020
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
5021
5021
|
options.interval = enableBin && isBinaryPath(basename4) ? opts.binaryInterval : opts.interval;
|
|
5022
|
-
closer = setFsWatchFileListener(
|
|
5022
|
+
closer = setFsWatchFileListener(path31, absolutePath, options, {
|
|
5023
5023
|
listener,
|
|
5024
5024
|
rawEmitter: this.fsw._emitRaw
|
|
5025
5025
|
});
|
|
5026
5026
|
} else {
|
|
5027
|
-
closer = setFsWatchListener(
|
|
5027
|
+
closer = setFsWatchListener(path31, absolutePath, options, {
|
|
5028
5028
|
listener,
|
|
5029
5029
|
errHandler: this._boundHandleError,
|
|
5030
5030
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -5046,7 +5046,7 @@ var NodeFsHandler = class {
|
|
|
5046
5046
|
let prevStats = stats;
|
|
5047
5047
|
if (parent.has(basename4))
|
|
5048
5048
|
return;
|
|
5049
|
-
const listener = async (
|
|
5049
|
+
const listener = async (path31, newStats) => {
|
|
5050
5050
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
|
|
5051
5051
|
return;
|
|
5052
5052
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
@@ -5060,11 +5060,11 @@ var NodeFsHandler = class {
|
|
|
5060
5060
|
this.fsw._emit(EV.CHANGE, file, newStats2);
|
|
5061
5061
|
}
|
|
5062
5062
|
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
5063
|
-
this.fsw._closeFile(
|
|
5063
|
+
this.fsw._closeFile(path31);
|
|
5064
5064
|
prevStats = newStats2;
|
|
5065
5065
|
const closer2 = this._watchWithNodeFs(file, listener);
|
|
5066
5066
|
if (closer2)
|
|
5067
|
-
this.fsw._addPathCloser(
|
|
5067
|
+
this.fsw._addPathCloser(path31, closer2);
|
|
5068
5068
|
} else {
|
|
5069
5069
|
prevStats = newStats2;
|
|
5070
5070
|
}
|
|
@@ -5096,7 +5096,7 @@ var NodeFsHandler = class {
|
|
|
5096
5096
|
* @param item basename of this item
|
|
5097
5097
|
* @returns true if no more processing is needed for this entry.
|
|
5098
5098
|
*/
|
|
5099
|
-
async _handleSymlink(entry, directory,
|
|
5099
|
+
async _handleSymlink(entry, directory, path31, item) {
|
|
5100
5100
|
if (this.fsw.closed) {
|
|
5101
5101
|
return;
|
|
5102
5102
|
}
|
|
@@ -5106,7 +5106,7 @@ var NodeFsHandler = class {
|
|
|
5106
5106
|
this.fsw._incrReadyCount();
|
|
5107
5107
|
let linkPath;
|
|
5108
5108
|
try {
|
|
5109
|
-
linkPath = await _promises.realpath.call(void 0,
|
|
5109
|
+
linkPath = await _promises.realpath.call(void 0, path31);
|
|
5110
5110
|
} catch (e) {
|
|
5111
5111
|
this.fsw._emitReady();
|
|
5112
5112
|
return true;
|
|
@@ -5116,12 +5116,12 @@ var NodeFsHandler = class {
|
|
|
5116
5116
|
if (dir.has(item)) {
|
|
5117
5117
|
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
5118
5118
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
5119
|
-
this.fsw._emit(EV.CHANGE,
|
|
5119
|
+
this.fsw._emit(EV.CHANGE, path31, entry.stats);
|
|
5120
5120
|
}
|
|
5121
5121
|
} else {
|
|
5122
5122
|
dir.add(item);
|
|
5123
5123
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
5124
|
-
this.fsw._emit(EV.ADD,
|
|
5124
|
+
this.fsw._emit(EV.ADD, path31, entry.stats);
|
|
5125
5125
|
}
|
|
5126
5126
|
this.fsw._emitReady();
|
|
5127
5127
|
return true;
|
|
@@ -5150,9 +5150,9 @@ var NodeFsHandler = class {
|
|
|
5150
5150
|
return;
|
|
5151
5151
|
}
|
|
5152
5152
|
const item = entry.path;
|
|
5153
|
-
let
|
|
5153
|
+
let path31 = sysPath.join(directory, item);
|
|
5154
5154
|
current2.add(item);
|
|
5155
|
-
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory,
|
|
5155
|
+
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path31, item)) {
|
|
5156
5156
|
return;
|
|
5157
5157
|
}
|
|
5158
5158
|
if (this.fsw.closed) {
|
|
@@ -5161,8 +5161,8 @@ var NodeFsHandler = class {
|
|
|
5161
5161
|
}
|
|
5162
5162
|
if (item === target || !target && !previous.has(item)) {
|
|
5163
5163
|
this.fsw._incrReadyCount();
|
|
5164
|
-
|
|
5165
|
-
this._addToNodeFs(
|
|
5164
|
+
path31 = sysPath.join(dir, sysPath.relative(dir, path31));
|
|
5165
|
+
this._addToNodeFs(path31, initialAdd, wh, depth + 1);
|
|
5166
5166
|
}
|
|
5167
5167
|
}).on(EV.ERROR, this._boundHandleError);
|
|
5168
5168
|
return new Promise((resolve8, reject) => {
|
|
@@ -5231,13 +5231,13 @@ var NodeFsHandler = class {
|
|
|
5231
5231
|
* @param depth Child path actually targeted for watch
|
|
5232
5232
|
* @param target Child path actually targeted for watch
|
|
5233
5233
|
*/
|
|
5234
|
-
async _addToNodeFs(
|
|
5234
|
+
async _addToNodeFs(path31, initialAdd, priorWh, depth, target) {
|
|
5235
5235
|
const ready = this.fsw._emitReady;
|
|
5236
|
-
if (this.fsw._isIgnored(
|
|
5236
|
+
if (this.fsw._isIgnored(path31) || this.fsw.closed) {
|
|
5237
5237
|
ready();
|
|
5238
5238
|
return false;
|
|
5239
5239
|
}
|
|
5240
|
-
const wh = this.fsw._getWatchHelpers(
|
|
5240
|
+
const wh = this.fsw._getWatchHelpers(path31);
|
|
5241
5241
|
if (priorWh) {
|
|
5242
5242
|
wh.filterPath = (entry) => priorWh.filterPath(entry);
|
|
5243
5243
|
wh.filterDir = (entry) => priorWh.filterDir(entry);
|
|
@@ -5253,8 +5253,8 @@ var NodeFsHandler = class {
|
|
|
5253
5253
|
const follow = this.fsw.options.followSymlinks;
|
|
5254
5254
|
let closer;
|
|
5255
5255
|
if (stats.isDirectory()) {
|
|
5256
|
-
const absPath = sysPath.resolve(
|
|
5257
|
-
const targetPath = follow ? await _promises.realpath.call(void 0,
|
|
5256
|
+
const absPath = sysPath.resolve(path31);
|
|
5257
|
+
const targetPath = follow ? await _promises.realpath.call(void 0, path31) : path31;
|
|
5258
5258
|
if (this.fsw.closed)
|
|
5259
5259
|
return;
|
|
5260
5260
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -5264,29 +5264,29 @@ var NodeFsHandler = class {
|
|
|
5264
5264
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
5265
5265
|
}
|
|
5266
5266
|
} else if (stats.isSymbolicLink()) {
|
|
5267
|
-
const targetPath = follow ? await _promises.realpath.call(void 0,
|
|
5267
|
+
const targetPath = follow ? await _promises.realpath.call(void 0, path31) : path31;
|
|
5268
5268
|
if (this.fsw.closed)
|
|
5269
5269
|
return;
|
|
5270
5270
|
const parent = sysPath.dirname(wh.watchPath);
|
|
5271
5271
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
5272
5272
|
this.fsw._emit(EV.ADD, wh.watchPath, stats);
|
|
5273
|
-
closer = await this._handleDir(parent, stats, initialAdd, depth,
|
|
5273
|
+
closer = await this._handleDir(parent, stats, initialAdd, depth, path31, wh, targetPath);
|
|
5274
5274
|
if (this.fsw.closed)
|
|
5275
5275
|
return;
|
|
5276
5276
|
if (targetPath !== void 0) {
|
|
5277
|
-
this.fsw._symlinkPaths.set(sysPath.resolve(
|
|
5277
|
+
this.fsw._symlinkPaths.set(sysPath.resolve(path31), targetPath);
|
|
5278
5278
|
}
|
|
5279
5279
|
} else {
|
|
5280
5280
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
5281
5281
|
}
|
|
5282
5282
|
ready();
|
|
5283
5283
|
if (closer)
|
|
5284
|
-
this.fsw._addPathCloser(
|
|
5284
|
+
this.fsw._addPathCloser(path31, closer);
|
|
5285
5285
|
return false;
|
|
5286
5286
|
} catch (error) {
|
|
5287
5287
|
if (this.fsw._handleError(error)) {
|
|
5288
5288
|
ready();
|
|
5289
|
-
return
|
|
5289
|
+
return path31;
|
|
5290
5290
|
}
|
|
5291
5291
|
}
|
|
5292
5292
|
}
|
|
@@ -5329,26 +5329,26 @@ function createPattern(matcher) {
|
|
|
5329
5329
|
}
|
|
5330
5330
|
return () => false;
|
|
5331
5331
|
}
|
|
5332
|
-
function normalizePath(
|
|
5333
|
-
if (typeof
|
|
5332
|
+
function normalizePath(path31) {
|
|
5333
|
+
if (typeof path31 !== "string")
|
|
5334
5334
|
throw new Error("string expected");
|
|
5335
|
-
|
|
5336
|
-
|
|
5335
|
+
path31 = sysPath2.normalize(path31);
|
|
5336
|
+
path31 = path31.replace(/\\/g, "/");
|
|
5337
5337
|
let prepend = false;
|
|
5338
|
-
if (
|
|
5338
|
+
if (path31.startsWith("//"))
|
|
5339
5339
|
prepend = true;
|
|
5340
5340
|
const DOUBLE_SLASH_RE2 = /\/\//;
|
|
5341
|
-
while (
|
|
5342
|
-
|
|
5341
|
+
while (path31.match(DOUBLE_SLASH_RE2))
|
|
5342
|
+
path31 = path31.replace(DOUBLE_SLASH_RE2, "/");
|
|
5343
5343
|
if (prepend)
|
|
5344
|
-
|
|
5345
|
-
return
|
|
5344
|
+
path31 = "/" + path31;
|
|
5345
|
+
return path31;
|
|
5346
5346
|
}
|
|
5347
5347
|
function matchPatterns(patterns, testString, stats) {
|
|
5348
|
-
const
|
|
5348
|
+
const path31 = normalizePath(testString);
|
|
5349
5349
|
for (let index = 0; index < patterns.length; index++) {
|
|
5350
5350
|
const pattern = patterns[index];
|
|
5351
|
-
if (pattern(
|
|
5351
|
+
if (pattern(path31, stats)) {
|
|
5352
5352
|
return true;
|
|
5353
5353
|
}
|
|
5354
5354
|
}
|
|
@@ -5388,19 +5388,19 @@ var toUnix = (string) => {
|
|
|
5388
5388
|
}
|
|
5389
5389
|
return str;
|
|
5390
5390
|
};
|
|
5391
|
-
var normalizePathToUnix = (
|
|
5392
|
-
var normalizeIgnored = (cwd = "") => (
|
|
5393
|
-
if (typeof
|
|
5394
|
-
return normalizePathToUnix(sysPath2.isAbsolute(
|
|
5391
|
+
var normalizePathToUnix = (path31) => toUnix(sysPath2.normalize(toUnix(path31)));
|
|
5392
|
+
var normalizeIgnored = (cwd = "") => (path31) => {
|
|
5393
|
+
if (typeof path31 === "string") {
|
|
5394
|
+
return normalizePathToUnix(sysPath2.isAbsolute(path31) ? path31 : sysPath2.join(cwd, path31));
|
|
5395
5395
|
} else {
|
|
5396
|
-
return
|
|
5396
|
+
return path31;
|
|
5397
5397
|
}
|
|
5398
5398
|
};
|
|
5399
|
-
var getAbsolutePath = (
|
|
5400
|
-
if (sysPath2.isAbsolute(
|
|
5401
|
-
return
|
|
5399
|
+
var getAbsolutePath = (path31, cwd) => {
|
|
5400
|
+
if (sysPath2.isAbsolute(path31)) {
|
|
5401
|
+
return path31;
|
|
5402
5402
|
}
|
|
5403
|
-
return sysPath2.join(cwd,
|
|
5403
|
+
return sysPath2.join(cwd, path31);
|
|
5404
5404
|
};
|
|
5405
5405
|
var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
|
|
5406
5406
|
var DirEntry = class {
|
|
@@ -5455,10 +5455,10 @@ var DirEntry = class {
|
|
|
5455
5455
|
var STAT_METHOD_F = "stat";
|
|
5456
5456
|
var STAT_METHOD_L = "lstat";
|
|
5457
5457
|
var WatchHelper = class {
|
|
5458
|
-
constructor(
|
|
5458
|
+
constructor(path31, follow, fsw) {
|
|
5459
5459
|
this.fsw = fsw;
|
|
5460
|
-
const watchPath =
|
|
5461
|
-
this.path =
|
|
5460
|
+
const watchPath = path31;
|
|
5461
|
+
this.path = path31 = path31.replace(REPLACER_RE, "");
|
|
5462
5462
|
this.watchPath = watchPath;
|
|
5463
5463
|
this.fullWatchPath = sysPath2.resolve(watchPath);
|
|
5464
5464
|
this.dirParts = [];
|
|
@@ -5580,20 +5580,20 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5580
5580
|
this._closePromise = void 0;
|
|
5581
5581
|
let paths = unifyPaths(paths_);
|
|
5582
5582
|
if (cwd) {
|
|
5583
|
-
paths = paths.map((
|
|
5584
|
-
const absPath = getAbsolutePath(
|
|
5583
|
+
paths = paths.map((path31) => {
|
|
5584
|
+
const absPath = getAbsolutePath(path31, cwd);
|
|
5585
5585
|
return absPath;
|
|
5586
5586
|
});
|
|
5587
5587
|
}
|
|
5588
|
-
paths.forEach((
|
|
5589
|
-
this._removeIgnoredPath(
|
|
5588
|
+
paths.forEach((path31) => {
|
|
5589
|
+
this._removeIgnoredPath(path31);
|
|
5590
5590
|
});
|
|
5591
5591
|
this._userIgnored = void 0;
|
|
5592
5592
|
if (!this._readyCount)
|
|
5593
5593
|
this._readyCount = 0;
|
|
5594
5594
|
this._readyCount += paths.length;
|
|
5595
|
-
Promise.all(paths.map(async (
|
|
5596
|
-
const res = await this._nodeFsHandler._addToNodeFs(
|
|
5595
|
+
Promise.all(paths.map(async (path31) => {
|
|
5596
|
+
const res = await this._nodeFsHandler._addToNodeFs(path31, !_internal, void 0, 0, _origAdd);
|
|
5597
5597
|
if (res)
|
|
5598
5598
|
this._emitReady();
|
|
5599
5599
|
return res;
|
|
@@ -5615,17 +5615,17 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5615
5615
|
return this;
|
|
5616
5616
|
const paths = unifyPaths(paths_);
|
|
5617
5617
|
const { cwd } = this.options;
|
|
5618
|
-
paths.forEach((
|
|
5619
|
-
if (!sysPath2.isAbsolute(
|
|
5618
|
+
paths.forEach((path31) => {
|
|
5619
|
+
if (!sysPath2.isAbsolute(path31) && !this._closers.has(path31)) {
|
|
5620
5620
|
if (cwd)
|
|
5621
|
-
|
|
5622
|
-
|
|
5621
|
+
path31 = sysPath2.join(cwd, path31);
|
|
5622
|
+
path31 = sysPath2.resolve(path31);
|
|
5623
5623
|
}
|
|
5624
|
-
this._closePath(
|
|
5625
|
-
this._addIgnoredPath(
|
|
5626
|
-
if (this._watched.has(
|
|
5624
|
+
this._closePath(path31);
|
|
5625
|
+
this._addIgnoredPath(path31);
|
|
5626
|
+
if (this._watched.has(path31)) {
|
|
5627
5627
|
this._addIgnoredPath({
|
|
5628
|
-
path:
|
|
5628
|
+
path: path31,
|
|
5629
5629
|
recursive: true
|
|
5630
5630
|
});
|
|
5631
5631
|
}
|
|
@@ -5689,38 +5689,38 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5689
5689
|
* @param stats arguments to be passed with event
|
|
5690
5690
|
* @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
|
5691
5691
|
*/
|
|
5692
|
-
async _emit(event,
|
|
5692
|
+
async _emit(event, path31, stats) {
|
|
5693
5693
|
if (this.closed)
|
|
5694
5694
|
return;
|
|
5695
5695
|
const opts = this.options;
|
|
5696
5696
|
if (isWindows)
|
|
5697
|
-
|
|
5697
|
+
path31 = sysPath2.normalize(path31);
|
|
5698
5698
|
if (opts.cwd)
|
|
5699
|
-
|
|
5700
|
-
const args = [
|
|
5699
|
+
path31 = sysPath2.relative(opts.cwd, path31);
|
|
5700
|
+
const args = [path31];
|
|
5701
5701
|
if (stats != null)
|
|
5702
5702
|
args.push(stats);
|
|
5703
5703
|
const awf = opts.awaitWriteFinish;
|
|
5704
5704
|
let pw;
|
|
5705
|
-
if (awf && (pw = this._pendingWrites.get(
|
|
5705
|
+
if (awf && (pw = this._pendingWrites.get(path31))) {
|
|
5706
5706
|
pw.lastChange = /* @__PURE__ */ new Date();
|
|
5707
5707
|
return this;
|
|
5708
5708
|
}
|
|
5709
5709
|
if (opts.atomic) {
|
|
5710
5710
|
if (event === EVENTS.UNLINK) {
|
|
5711
|
-
this._pendingUnlinks.set(
|
|
5711
|
+
this._pendingUnlinks.set(path31, [event, ...args]);
|
|
5712
5712
|
setTimeout(() => {
|
|
5713
|
-
this._pendingUnlinks.forEach((entry,
|
|
5713
|
+
this._pendingUnlinks.forEach((entry, path32) => {
|
|
5714
5714
|
this.emit(...entry);
|
|
5715
5715
|
this.emit(EVENTS.ALL, ...entry);
|
|
5716
|
-
this._pendingUnlinks.delete(
|
|
5716
|
+
this._pendingUnlinks.delete(path32);
|
|
5717
5717
|
});
|
|
5718
5718
|
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
5719
5719
|
return this;
|
|
5720
5720
|
}
|
|
5721
|
-
if (event === EVENTS.ADD && this._pendingUnlinks.has(
|
|
5721
|
+
if (event === EVENTS.ADD && this._pendingUnlinks.has(path31)) {
|
|
5722
5722
|
event = EVENTS.CHANGE;
|
|
5723
|
-
this._pendingUnlinks.delete(
|
|
5723
|
+
this._pendingUnlinks.delete(path31);
|
|
5724
5724
|
}
|
|
5725
5725
|
}
|
|
5726
5726
|
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
@@ -5738,16 +5738,16 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5738
5738
|
this.emitWithAll(event, args);
|
|
5739
5739
|
}
|
|
5740
5740
|
};
|
|
5741
|
-
this._awaitWriteFinish(
|
|
5741
|
+
this._awaitWriteFinish(path31, awf.stabilityThreshold, event, awfEmit);
|
|
5742
5742
|
return this;
|
|
5743
5743
|
}
|
|
5744
5744
|
if (event === EVENTS.CHANGE) {
|
|
5745
|
-
const isThrottled = !this._throttle(EVENTS.CHANGE,
|
|
5745
|
+
const isThrottled = !this._throttle(EVENTS.CHANGE, path31, 50);
|
|
5746
5746
|
if (isThrottled)
|
|
5747
5747
|
return this;
|
|
5748
5748
|
}
|
|
5749
5749
|
if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
5750
|
-
const fullPath = opts.cwd ? sysPath2.join(opts.cwd,
|
|
5750
|
+
const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path31) : path31;
|
|
5751
5751
|
let stats2;
|
|
5752
5752
|
try {
|
|
5753
5753
|
stats2 = await _promises.stat.call(void 0, fullPath);
|
|
@@ -5778,23 +5778,23 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5778
5778
|
* @param timeout duration of time to suppress duplicate actions
|
|
5779
5779
|
* @returns tracking object or false if action should be suppressed
|
|
5780
5780
|
*/
|
|
5781
|
-
_throttle(actionType,
|
|
5781
|
+
_throttle(actionType, path31, timeout) {
|
|
5782
5782
|
if (!this._throttled.has(actionType)) {
|
|
5783
5783
|
this._throttled.set(actionType, /* @__PURE__ */ new Map());
|
|
5784
5784
|
}
|
|
5785
5785
|
const action = this._throttled.get(actionType);
|
|
5786
5786
|
if (!action)
|
|
5787
5787
|
throw new Error("invalid throttle");
|
|
5788
|
-
const actionPath = action.get(
|
|
5788
|
+
const actionPath = action.get(path31);
|
|
5789
5789
|
if (actionPath) {
|
|
5790
5790
|
actionPath.count++;
|
|
5791
5791
|
return false;
|
|
5792
5792
|
}
|
|
5793
5793
|
let timeoutObject;
|
|
5794
5794
|
const clear = () => {
|
|
5795
|
-
const item = action.get(
|
|
5795
|
+
const item = action.get(path31);
|
|
5796
5796
|
const count = item ? item.count : 0;
|
|
5797
|
-
action.delete(
|
|
5797
|
+
action.delete(path31);
|
|
5798
5798
|
clearTimeout(timeoutObject);
|
|
5799
5799
|
if (item)
|
|
5800
5800
|
clearTimeout(item.timeoutObject);
|
|
@@ -5802,7 +5802,7 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5802
5802
|
};
|
|
5803
5803
|
timeoutObject = setTimeout(clear, timeout);
|
|
5804
5804
|
const thr = { timeoutObject, clear, count: 0 };
|
|
5805
|
-
action.set(
|
|
5805
|
+
action.set(path31, thr);
|
|
5806
5806
|
return thr;
|
|
5807
5807
|
}
|
|
5808
5808
|
_incrReadyCount() {
|
|
@@ -5816,44 +5816,44 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5816
5816
|
* @param event
|
|
5817
5817
|
* @param awfEmit Callback to be called when ready for event to be emitted.
|
|
5818
5818
|
*/
|
|
5819
|
-
_awaitWriteFinish(
|
|
5819
|
+
_awaitWriteFinish(path31, threshold, event, awfEmit) {
|
|
5820
5820
|
const awf = this.options.awaitWriteFinish;
|
|
5821
5821
|
if (typeof awf !== "object")
|
|
5822
5822
|
return;
|
|
5823
5823
|
const pollInterval = awf.pollInterval;
|
|
5824
5824
|
let timeoutHandler;
|
|
5825
|
-
let fullPath =
|
|
5826
|
-
if (this.options.cwd && !sysPath2.isAbsolute(
|
|
5827
|
-
fullPath = sysPath2.join(this.options.cwd,
|
|
5825
|
+
let fullPath = path31;
|
|
5826
|
+
if (this.options.cwd && !sysPath2.isAbsolute(path31)) {
|
|
5827
|
+
fullPath = sysPath2.join(this.options.cwd, path31);
|
|
5828
5828
|
}
|
|
5829
5829
|
const now = /* @__PURE__ */ new Date();
|
|
5830
5830
|
const writes = this._pendingWrites;
|
|
5831
5831
|
function awaitWriteFinishFn(prevStat) {
|
|
5832
5832
|
_fs.stat.call(void 0, fullPath, (err, curStat) => {
|
|
5833
|
-
if (err || !writes.has(
|
|
5833
|
+
if (err || !writes.has(path31)) {
|
|
5834
5834
|
if (err && err.code !== "ENOENT")
|
|
5835
5835
|
awfEmit(err);
|
|
5836
5836
|
return;
|
|
5837
5837
|
}
|
|
5838
5838
|
const now2 = Number(/* @__PURE__ */ new Date());
|
|
5839
5839
|
if (prevStat && curStat.size !== prevStat.size) {
|
|
5840
|
-
writes.get(
|
|
5840
|
+
writes.get(path31).lastChange = now2;
|
|
5841
5841
|
}
|
|
5842
|
-
const pw = writes.get(
|
|
5842
|
+
const pw = writes.get(path31);
|
|
5843
5843
|
const df = now2 - pw.lastChange;
|
|
5844
5844
|
if (df >= threshold) {
|
|
5845
|
-
writes.delete(
|
|
5845
|
+
writes.delete(path31);
|
|
5846
5846
|
awfEmit(void 0, curStat);
|
|
5847
5847
|
} else {
|
|
5848
5848
|
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
|
|
5849
5849
|
}
|
|
5850
5850
|
});
|
|
5851
5851
|
}
|
|
5852
|
-
if (!writes.has(
|
|
5853
|
-
writes.set(
|
|
5852
|
+
if (!writes.has(path31)) {
|
|
5853
|
+
writes.set(path31, {
|
|
5854
5854
|
lastChange: now,
|
|
5855
5855
|
cancelWait: () => {
|
|
5856
|
-
writes.delete(
|
|
5856
|
+
writes.delete(path31);
|
|
5857
5857
|
clearTimeout(timeoutHandler);
|
|
5858
5858
|
return event;
|
|
5859
5859
|
}
|
|
@@ -5864,8 +5864,8 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5864
5864
|
/**
|
|
5865
5865
|
* Determines whether user has asked to ignore this path.
|
|
5866
5866
|
*/
|
|
5867
|
-
_isIgnored(
|
|
5868
|
-
if (this.options.atomic && DOT_RE.test(
|
|
5867
|
+
_isIgnored(path31, stats) {
|
|
5868
|
+
if (this.options.atomic && DOT_RE.test(path31))
|
|
5869
5869
|
return true;
|
|
5870
5870
|
if (!this._userIgnored) {
|
|
5871
5871
|
const { cwd } = this.options;
|
|
@@ -5875,17 +5875,17 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5875
5875
|
const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
|
|
5876
5876
|
this._userIgnored = anymatch(list, void 0);
|
|
5877
5877
|
}
|
|
5878
|
-
return this._userIgnored(
|
|
5878
|
+
return this._userIgnored(path31, stats);
|
|
5879
5879
|
}
|
|
5880
|
-
_isntIgnored(
|
|
5881
|
-
return !this._isIgnored(
|
|
5880
|
+
_isntIgnored(path31, stat6) {
|
|
5881
|
+
return !this._isIgnored(path31, stat6);
|
|
5882
5882
|
}
|
|
5883
5883
|
/**
|
|
5884
5884
|
* Provides a set of common helpers and properties relating to symlink handling.
|
|
5885
5885
|
* @param path file or directory pattern being watched
|
|
5886
5886
|
*/
|
|
5887
|
-
_getWatchHelpers(
|
|
5888
|
-
return new WatchHelper(
|
|
5887
|
+
_getWatchHelpers(path31) {
|
|
5888
|
+
return new WatchHelper(path31, this.options.followSymlinks, this);
|
|
5889
5889
|
}
|
|
5890
5890
|
// Directory helpers
|
|
5891
5891
|
// -----------------
|
|
@@ -5917,63 +5917,63 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
5917
5917
|
* @param item base path of item/directory
|
|
5918
5918
|
*/
|
|
5919
5919
|
_remove(directory, item, isDirectory) {
|
|
5920
|
-
const
|
|
5921
|
-
const fullPath = sysPath2.resolve(
|
|
5922
|
-
isDirectory = isDirectory != null ? isDirectory : this._watched.has(
|
|
5923
|
-
if (!this._throttle("remove",
|
|
5920
|
+
const path31 = sysPath2.join(directory, item);
|
|
5921
|
+
const fullPath = sysPath2.resolve(path31);
|
|
5922
|
+
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path31) || this._watched.has(fullPath);
|
|
5923
|
+
if (!this._throttle("remove", path31, 100))
|
|
5924
5924
|
return;
|
|
5925
5925
|
if (!isDirectory && this._watched.size === 1) {
|
|
5926
5926
|
this.add(directory, item, true);
|
|
5927
5927
|
}
|
|
5928
|
-
const wp = this._getWatchedDir(
|
|
5928
|
+
const wp = this._getWatchedDir(path31);
|
|
5929
5929
|
const nestedDirectoryChildren = wp.getChildren();
|
|
5930
|
-
nestedDirectoryChildren.forEach((nested) => this._remove(
|
|
5930
|
+
nestedDirectoryChildren.forEach((nested) => this._remove(path31, nested));
|
|
5931
5931
|
const parent = this._getWatchedDir(directory);
|
|
5932
5932
|
const wasTracked = parent.has(item);
|
|
5933
5933
|
parent.remove(item);
|
|
5934
5934
|
if (this._symlinkPaths.has(fullPath)) {
|
|
5935
5935
|
this._symlinkPaths.delete(fullPath);
|
|
5936
5936
|
}
|
|
5937
|
-
let relPath =
|
|
5937
|
+
let relPath = path31;
|
|
5938
5938
|
if (this.options.cwd)
|
|
5939
|
-
relPath = sysPath2.relative(this.options.cwd,
|
|
5939
|
+
relPath = sysPath2.relative(this.options.cwd, path31);
|
|
5940
5940
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
5941
5941
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
5942
5942
|
if (event === EVENTS.ADD)
|
|
5943
5943
|
return;
|
|
5944
5944
|
}
|
|
5945
|
-
this._watched.delete(
|
|
5945
|
+
this._watched.delete(path31);
|
|
5946
5946
|
this._watched.delete(fullPath);
|
|
5947
5947
|
const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
5948
|
-
if (wasTracked && !this._isIgnored(
|
|
5949
|
-
this._emit(eventName,
|
|
5950
|
-
this._closePath(
|
|
5948
|
+
if (wasTracked && !this._isIgnored(path31))
|
|
5949
|
+
this._emit(eventName, path31);
|
|
5950
|
+
this._closePath(path31);
|
|
5951
5951
|
}
|
|
5952
5952
|
/**
|
|
5953
5953
|
* Closes all watchers for a path
|
|
5954
5954
|
*/
|
|
5955
|
-
_closePath(
|
|
5956
|
-
this._closeFile(
|
|
5957
|
-
const dir = sysPath2.dirname(
|
|
5958
|
-
this._getWatchedDir(dir).remove(sysPath2.basename(
|
|
5955
|
+
_closePath(path31) {
|
|
5956
|
+
this._closeFile(path31);
|
|
5957
|
+
const dir = sysPath2.dirname(path31);
|
|
5958
|
+
this._getWatchedDir(dir).remove(sysPath2.basename(path31));
|
|
5959
5959
|
}
|
|
5960
5960
|
/**
|
|
5961
5961
|
* Closes only file-specific watchers
|
|
5962
5962
|
*/
|
|
5963
|
-
_closeFile(
|
|
5964
|
-
const closers = this._closers.get(
|
|
5963
|
+
_closeFile(path31) {
|
|
5964
|
+
const closers = this._closers.get(path31);
|
|
5965
5965
|
if (!closers)
|
|
5966
5966
|
return;
|
|
5967
5967
|
closers.forEach((closer) => closer());
|
|
5968
|
-
this._closers.delete(
|
|
5968
|
+
this._closers.delete(path31);
|
|
5969
5969
|
}
|
|
5970
|
-
_addPathCloser(
|
|
5970
|
+
_addPathCloser(path31, closer) {
|
|
5971
5971
|
if (!closer)
|
|
5972
5972
|
return;
|
|
5973
|
-
let list = this._closers.get(
|
|
5973
|
+
let list = this._closers.get(path31);
|
|
5974
5974
|
if (!list) {
|
|
5975
5975
|
list = [];
|
|
5976
|
-
this._closers.set(
|
|
5976
|
+
this._closers.set(path31, list);
|
|
5977
5977
|
}
|
|
5978
5978
|
list.push(closer);
|
|
5979
5979
|
}
|
|
@@ -8505,12 +8505,12 @@ var PathBase = (_class6 = class {
|
|
|
8505
8505
|
/**
|
|
8506
8506
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
8507
8507
|
*/
|
|
8508
|
-
resolve(
|
|
8509
|
-
if (!
|
|
8508
|
+
resolve(path31) {
|
|
8509
|
+
if (!path31) {
|
|
8510
8510
|
return this;
|
|
8511
8511
|
}
|
|
8512
|
-
const rootPath = this.getRootString(
|
|
8513
|
-
const dir =
|
|
8512
|
+
const rootPath = this.getRootString(path31);
|
|
8513
|
+
const dir = path31.substring(rootPath.length);
|
|
8514
8514
|
const dirParts = dir.split(this.splitSep);
|
|
8515
8515
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
8516
8516
|
return result;
|
|
@@ -9262,8 +9262,8 @@ var PathWin32 = (_class7 = class _PathWin32 extends PathBase {
|
|
|
9262
9262
|
/**
|
|
9263
9263
|
* @internal
|
|
9264
9264
|
*/
|
|
9265
|
-
getRootString(
|
|
9266
|
-
return _path.win32.parse(
|
|
9265
|
+
getRootString(path31) {
|
|
9266
|
+
return _path.win32.parse(path31).root;
|
|
9267
9267
|
}
|
|
9268
9268
|
/**
|
|
9269
9269
|
* @internal
|
|
@@ -9309,8 +9309,8 @@ var PathPosix = (_class8 = class _PathPosix extends PathBase {
|
|
|
9309
9309
|
/**
|
|
9310
9310
|
* @internal
|
|
9311
9311
|
*/
|
|
9312
|
-
getRootString(
|
|
9313
|
-
return
|
|
9312
|
+
getRootString(path31) {
|
|
9313
|
+
return path31.startsWith("/") ? "/" : "";
|
|
9314
9314
|
}
|
|
9315
9315
|
/**
|
|
9316
9316
|
* @internal
|
|
@@ -9399,11 +9399,11 @@ var PathScurryBase = class {
|
|
|
9399
9399
|
/**
|
|
9400
9400
|
* Get the depth of a provided path, string, or the cwd
|
|
9401
9401
|
*/
|
|
9402
|
-
depth(
|
|
9403
|
-
if (typeof
|
|
9404
|
-
|
|
9402
|
+
depth(path31 = this.cwd) {
|
|
9403
|
+
if (typeof path31 === "string") {
|
|
9404
|
+
path31 = this.cwd.resolve(path31);
|
|
9405
9405
|
}
|
|
9406
|
-
return
|
|
9406
|
+
return path31.depth();
|
|
9407
9407
|
}
|
|
9408
9408
|
/**
|
|
9409
9409
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -9890,9 +9890,9 @@ var PathScurryBase = class {
|
|
|
9890
9890
|
process10();
|
|
9891
9891
|
return results;
|
|
9892
9892
|
}
|
|
9893
|
-
chdir(
|
|
9893
|
+
chdir(path31 = this.cwd) {
|
|
9894
9894
|
const oldCwd = this.cwd;
|
|
9895
|
-
this.cwd = typeof
|
|
9895
|
+
this.cwd = typeof path31 === "string" ? this.cwd.resolve(path31) : path31;
|
|
9896
9896
|
this.cwd[setAsCwd](oldCwd);
|
|
9897
9897
|
}
|
|
9898
9898
|
};
|
|
@@ -10254,8 +10254,8 @@ var MatchRecord = (_class11 = class {constructor() { _class11.prototype.__init28
|
|
|
10254
10254
|
}
|
|
10255
10255
|
// match, absolute, ifdir
|
|
10256
10256
|
entries() {
|
|
10257
|
-
return [...this.store.entries()].map(([
|
|
10258
|
-
|
|
10257
|
+
return [...this.store.entries()].map(([path31, n2]) => [
|
|
10258
|
+
path31,
|
|
10259
10259
|
!!(n2 & 2),
|
|
10260
10260
|
!!(n2 & 1)
|
|
10261
10261
|
]);
|
|
@@ -10460,9 +10460,9 @@ var GlobUtil = (_class14 = class {
|
|
|
10460
10460
|
|
|
10461
10461
|
|
|
10462
10462
|
|
|
10463
|
-
constructor(patterns,
|
|
10463
|
+
constructor(patterns, path31, opts) {;_class14.prototype.__init32.call(this);_class14.prototype.__init33.call(this);_class14.prototype.__init34.call(this);
|
|
10464
10464
|
this.patterns = patterns;
|
|
10465
|
-
this.path =
|
|
10465
|
+
this.path = path31;
|
|
10466
10466
|
this.opts = opts;
|
|
10467
10467
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
10468
10468
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -10481,11 +10481,11 @@ var GlobUtil = (_class14 = class {
|
|
|
10481
10481
|
});
|
|
10482
10482
|
}
|
|
10483
10483
|
}
|
|
10484
|
-
#ignored(
|
|
10485
|
-
return this.seen.has(
|
|
10484
|
+
#ignored(path31) {
|
|
10485
|
+
return this.seen.has(path31) || !!_optionalChain([this, 'access', _143 => _143.#ignore, 'optionalAccess', _144 => _144.ignored, 'optionalCall', _145 => _145(path31)]);
|
|
10486
10486
|
}
|
|
10487
|
-
#childrenIgnored(
|
|
10488
|
-
return !!_optionalChain([this, 'access', _146 => _146.#ignore, 'optionalAccess', _147 => _147.childrenIgnored, 'optionalCall', _148 => _148(
|
|
10487
|
+
#childrenIgnored(path31) {
|
|
10488
|
+
return !!_optionalChain([this, 'access', _146 => _146.#ignore, 'optionalAccess', _147 => _147.childrenIgnored, 'optionalCall', _148 => _148(path31)]);
|
|
10489
10489
|
}
|
|
10490
10490
|
// backpressure mechanism
|
|
10491
10491
|
pause() {
|
|
@@ -10700,8 +10700,8 @@ var GlobUtil = (_class14 = class {
|
|
|
10700
10700
|
}, _class14);
|
|
10701
10701
|
var GlobWalker = (_class15 = class extends GlobUtil {
|
|
10702
10702
|
__init35() {this.matches = /* @__PURE__ */ new Set()}
|
|
10703
|
-
constructor(patterns,
|
|
10704
|
-
super(patterns,
|
|
10703
|
+
constructor(patterns, path31, opts) {
|
|
10704
|
+
super(patterns, path31, opts);_class15.prototype.__init35.call(this);;
|
|
10705
10705
|
}
|
|
10706
10706
|
matchEmit(e) {
|
|
10707
10707
|
this.matches.add(e);
|
|
@@ -10738,8 +10738,8 @@ var GlobWalker = (_class15 = class extends GlobUtil {
|
|
|
10738
10738
|
}, _class15);
|
|
10739
10739
|
var GlobStream = class extends GlobUtil {
|
|
10740
10740
|
|
|
10741
|
-
constructor(patterns,
|
|
10742
|
-
super(patterns,
|
|
10741
|
+
constructor(patterns, path31, opts) {
|
|
10742
|
+
super(patterns, path31, opts);
|
|
10743
10743
|
this.results = new Minipass({
|
|
10744
10744
|
signal: this.signal,
|
|
10745
10745
|
objectMode: true
|
|
@@ -11076,44 +11076,44 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
11076
11076
|
var platform_default = process.env.__TESTING_RIMRAF_PLATFORM__ || process.platform;
|
|
11077
11077
|
|
|
11078
11078
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/path-arg.js
|
|
11079
|
-
var pathArg = (
|
|
11080
|
-
const type = typeof
|
|
11079
|
+
var pathArg = (path31, opt = {}) => {
|
|
11080
|
+
const type = typeof path31;
|
|
11081
11081
|
if (type !== "string") {
|
|
11082
|
-
const ctor =
|
|
11083
|
-
const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? _util.inspect.call(void 0,
|
|
11082
|
+
const ctor = path31 && type === "object" && path31.constructor;
|
|
11083
|
+
const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? _util.inspect.call(void 0, path31) : `type ${type} ${path31}`;
|
|
11084
11084
|
const msg = `The "path" argument must be of type string. Received ${received}`;
|
|
11085
11085
|
throw Object.assign(new TypeError(msg), {
|
|
11086
|
-
path:
|
|
11086
|
+
path: path31,
|
|
11087
11087
|
code: "ERR_INVALID_ARG_TYPE"
|
|
11088
11088
|
});
|
|
11089
11089
|
}
|
|
11090
|
-
if (/\0/.test(
|
|
11090
|
+
if (/\0/.test(path31)) {
|
|
11091
11091
|
const msg = "path must be a string without null bytes";
|
|
11092
11092
|
throw Object.assign(new TypeError(msg), {
|
|
11093
|
-
path:
|
|
11093
|
+
path: path31,
|
|
11094
11094
|
code: "ERR_INVALID_ARG_VALUE"
|
|
11095
11095
|
});
|
|
11096
11096
|
}
|
|
11097
|
-
|
|
11098
|
-
const { root } = _path.parse.call(void 0,
|
|
11099
|
-
if (
|
|
11097
|
+
path31 = _path.resolve.call(void 0, path31);
|
|
11098
|
+
const { root } = _path.parse.call(void 0, path31);
|
|
11099
|
+
if (path31 === root && opt.preserveRoot !== false) {
|
|
11100
11100
|
const msg = "refusing to remove root directory without preserveRoot:false";
|
|
11101
11101
|
throw Object.assign(new Error(msg), {
|
|
11102
|
-
path:
|
|
11102
|
+
path: path31,
|
|
11103
11103
|
code: "ERR_PRESERVE_ROOT"
|
|
11104
11104
|
});
|
|
11105
11105
|
}
|
|
11106
11106
|
if (platform_default === "win32") {
|
|
11107
11107
|
const badWinChars = /[*|"<>?:]/;
|
|
11108
|
-
const { root: root2 } = _path.parse.call(void 0,
|
|
11109
|
-
if (badWinChars.test(
|
|
11108
|
+
const { root: root2 } = _path.parse.call(void 0, path31);
|
|
11109
|
+
if (badWinChars.test(path31.substring(root2.length))) {
|
|
11110
11110
|
throw Object.assign(new Error("Illegal characters in path."), {
|
|
11111
|
-
path:
|
|
11111
|
+
path: path31,
|
|
11112
11112
|
code: "EINVAL"
|
|
11113
11113
|
});
|
|
11114
11114
|
}
|
|
11115
11115
|
}
|
|
11116
|
-
return
|
|
11116
|
+
return path31;
|
|
11117
11117
|
};
|
|
11118
11118
|
var path_arg_default = pathArg;
|
|
11119
11119
|
|
|
@@ -11128,16 +11128,16 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
11128
11128
|
|
|
11129
11129
|
|
|
11130
11130
|
|
|
11131
|
-
var readdirSync2 = (
|
|
11132
|
-
var chmod = (
|
|
11133
|
-
var mkdir = (
|
|
11134
|
-
var readdir4 = (
|
|
11131
|
+
var readdirSync2 = (path31) => _fs.readdirSync.call(void 0, path31, { withFileTypes: true });
|
|
11132
|
+
var chmod = (path31, mode) => new Promise((res, rej) => actualFS.default.chmod(path31, mode, (er, ...d) => er ? rej(er) : res(...d)));
|
|
11133
|
+
var mkdir = (path31, options) => new Promise((res, rej) => actualFS.default.mkdir(path31, options, (er, made) => er ? rej(er) : res(made)));
|
|
11134
|
+
var readdir4 = (path31) => new Promise((res, rej) => actualFS.default.readdir(path31, { withFileTypes: true }, (er, data2) => er ? rej(er) : res(data2)));
|
|
11135
11135
|
var rename = (oldPath, newPath) => new Promise((res, rej) => actualFS.default.rename(oldPath, newPath, (er, ...d) => er ? rej(er) : res(...d)));
|
|
11136
|
-
var rm = (
|
|
11137
|
-
var rmdir = (
|
|
11138
|
-
var stat4 = (
|
|
11139
|
-
var lstat4 = (
|
|
11140
|
-
var unlink = (
|
|
11136
|
+
var rm = (path31, options) => new Promise((res, rej) => actualFS.default.rm(path31, options, (er, ...d) => er ? rej(er) : res(...d)));
|
|
11137
|
+
var rmdir = (path31) => new Promise((res, rej) => actualFS.default.rmdir(path31, (er, ...d) => er ? rej(er) : res(...d)));
|
|
11138
|
+
var stat4 = (path31) => new Promise((res, rej) => actualFS.default.stat(path31, (er, data2) => er ? rej(er) : res(data2)));
|
|
11139
|
+
var lstat4 = (path31) => new Promise((res, rej) => actualFS.default.lstat(path31, (er, data2) => er ? rej(er) : res(data2)));
|
|
11140
|
+
var unlink = (path31) => new Promise((res, rej) => actualFS.default.unlink(path31, (er, ...d) => er ? rej(er) : res(...d)));
|
|
11141
11141
|
var promises = {
|
|
11142
11142
|
chmod,
|
|
11143
11143
|
mkdir,
|
|
@@ -11156,10 +11156,10 @@ var promises = {
|
|
|
11156
11156
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/readdir-or-error.js
|
|
11157
11157
|
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
11158
11158
|
var { readdir: readdir5 } = promises;
|
|
11159
|
-
var readdirOrError = (
|
|
11160
|
-
var readdirOrErrorSync = (
|
|
11159
|
+
var readdirOrError = (path31) => readdir5(path31).catch((er) => er);
|
|
11160
|
+
var readdirOrErrorSync = (path31) => {
|
|
11161
11161
|
try {
|
|
11162
|
-
return readdirSync2(
|
|
11162
|
+
return readdirSync2(path31);
|
|
11163
11163
|
} catch (er) {
|
|
11164
11164
|
return er;
|
|
11165
11165
|
}
|
|
@@ -11184,35 +11184,35 @@ var ignoreENOENTSync = (fn) => {
|
|
|
11184
11184
|
|
|
11185
11185
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-posix.js
|
|
11186
11186
|
var { lstat: lstat5, rmdir: rmdir2, unlink: unlink2 } = promises;
|
|
11187
|
-
var rimrafPosix = async (
|
|
11187
|
+
var rimrafPosix = async (path31, opt) => {
|
|
11188
11188
|
if (_optionalChain([opt, 'optionalAccess', _182 => _182.signal, 'optionalAccess', _183 => _183.aborted])) {
|
|
11189
11189
|
throw opt.signal.reason;
|
|
11190
11190
|
}
|
|
11191
11191
|
try {
|
|
11192
|
-
return await rimrafPosixDir(
|
|
11192
|
+
return await rimrafPosixDir(path31, opt, await lstat5(path31));
|
|
11193
11193
|
} catch (er) {
|
|
11194
11194
|
if (_optionalChain([er, 'optionalAccess', _184 => _184.code]) === "ENOENT")
|
|
11195
11195
|
return true;
|
|
11196
11196
|
throw er;
|
|
11197
11197
|
}
|
|
11198
11198
|
};
|
|
11199
|
-
var rimrafPosixSync = (
|
|
11199
|
+
var rimrafPosixSync = (path31, opt) => {
|
|
11200
11200
|
if (_optionalChain([opt, 'optionalAccess', _185 => _185.signal, 'optionalAccess', _186 => _186.aborted])) {
|
|
11201
11201
|
throw opt.signal.reason;
|
|
11202
11202
|
}
|
|
11203
11203
|
try {
|
|
11204
|
-
return rimrafPosixDirSync(
|
|
11204
|
+
return rimrafPosixDirSync(path31, opt, _fs.lstatSync.call(void 0, path31));
|
|
11205
11205
|
} catch (er) {
|
|
11206
11206
|
if (_optionalChain([er, 'optionalAccess', _187 => _187.code]) === "ENOENT")
|
|
11207
11207
|
return true;
|
|
11208
11208
|
throw er;
|
|
11209
11209
|
}
|
|
11210
11210
|
};
|
|
11211
|
-
var rimrafPosixDir = async (
|
|
11211
|
+
var rimrafPosixDir = async (path31, opt, ent) => {
|
|
11212
11212
|
if (_optionalChain([opt, 'optionalAccess', _188 => _188.signal, 'optionalAccess', _189 => _189.aborted])) {
|
|
11213
11213
|
throw opt.signal.reason;
|
|
11214
11214
|
}
|
|
11215
|
-
const entries = ent.isDirectory() ? await readdirOrError(
|
|
11215
|
+
const entries = ent.isDirectory() ? await readdirOrError(path31) : null;
|
|
11216
11216
|
if (!Array.isArray(entries)) {
|
|
11217
11217
|
if (entries) {
|
|
11218
11218
|
if (entries.code === "ENOENT") {
|
|
@@ -11222,30 +11222,30 @@ var rimrafPosixDir = async (path30, opt, ent) => {
|
|
|
11222
11222
|
throw entries;
|
|
11223
11223
|
}
|
|
11224
11224
|
}
|
|
11225
|
-
if (opt.filter && !await opt.filter(
|
|
11225
|
+
if (opt.filter && !await opt.filter(path31, ent)) {
|
|
11226
11226
|
return false;
|
|
11227
11227
|
}
|
|
11228
|
-
await ignoreENOENT(unlink2(
|
|
11228
|
+
await ignoreENOENT(unlink2(path31));
|
|
11229
11229
|
return true;
|
|
11230
11230
|
}
|
|
11231
|
-
const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(_path.resolve.call(void 0,
|
|
11231
|
+
const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(_path.resolve.call(void 0, path31, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
|
|
11232
11232
|
if (!removedAll) {
|
|
11233
11233
|
return false;
|
|
11234
11234
|
}
|
|
11235
|
-
if (opt.preserveRoot === false &&
|
|
11235
|
+
if (opt.preserveRoot === false && path31 === _path.parse.call(void 0, path31).root) {
|
|
11236
11236
|
return false;
|
|
11237
11237
|
}
|
|
11238
|
-
if (opt.filter && !await opt.filter(
|
|
11238
|
+
if (opt.filter && !await opt.filter(path31, ent)) {
|
|
11239
11239
|
return false;
|
|
11240
11240
|
}
|
|
11241
|
-
await ignoreENOENT(rmdir2(
|
|
11241
|
+
await ignoreENOENT(rmdir2(path31));
|
|
11242
11242
|
return true;
|
|
11243
11243
|
};
|
|
11244
|
-
var rimrafPosixDirSync = (
|
|
11244
|
+
var rimrafPosixDirSync = (path31, opt, ent) => {
|
|
11245
11245
|
if (_optionalChain([opt, 'optionalAccess', _190 => _190.signal, 'optionalAccess', _191 => _191.aborted])) {
|
|
11246
11246
|
throw opt.signal.reason;
|
|
11247
11247
|
}
|
|
11248
|
-
const entries = ent.isDirectory() ? readdirOrErrorSync(
|
|
11248
|
+
const entries = ent.isDirectory() ? readdirOrErrorSync(path31) : null;
|
|
11249
11249
|
if (!Array.isArray(entries)) {
|
|
11250
11250
|
if (entries) {
|
|
11251
11251
|
if (entries.code === "ENOENT") {
|
|
@@ -11255,27 +11255,27 @@ var rimrafPosixDirSync = (path30, opt, ent) => {
|
|
|
11255
11255
|
throw entries;
|
|
11256
11256
|
}
|
|
11257
11257
|
}
|
|
11258
|
-
if (opt.filter && !opt.filter(
|
|
11258
|
+
if (opt.filter && !opt.filter(path31, ent)) {
|
|
11259
11259
|
return false;
|
|
11260
11260
|
}
|
|
11261
|
-
ignoreENOENTSync(() => _fs.unlinkSync.call(void 0,
|
|
11261
|
+
ignoreENOENTSync(() => _fs.unlinkSync.call(void 0, path31));
|
|
11262
11262
|
return true;
|
|
11263
11263
|
}
|
|
11264
11264
|
let removedAll = true;
|
|
11265
11265
|
for (const ent2 of entries) {
|
|
11266
|
-
const p = _path.resolve.call(void 0,
|
|
11266
|
+
const p = _path.resolve.call(void 0, path31, ent2.name);
|
|
11267
11267
|
removedAll = rimrafPosixDirSync(p, opt, ent2) && removedAll;
|
|
11268
11268
|
}
|
|
11269
|
-
if (opt.preserveRoot === false &&
|
|
11269
|
+
if (opt.preserveRoot === false && path31 === _path.parse.call(void 0, path31).root) {
|
|
11270
11270
|
return false;
|
|
11271
11271
|
}
|
|
11272
11272
|
if (!removedAll) {
|
|
11273
11273
|
return false;
|
|
11274
11274
|
}
|
|
11275
|
-
if (opt.filter && !opt.filter(
|
|
11275
|
+
if (opt.filter && !opt.filter(path31, ent)) {
|
|
11276
11276
|
return false;
|
|
11277
11277
|
}
|
|
11278
|
-
ignoreENOENTSync(() => _fs.rmdirSync.call(void 0,
|
|
11278
|
+
ignoreENOENTSync(() => _fs.rmdirSync.call(void 0, path31));
|
|
11279
11279
|
return true;
|
|
11280
11280
|
};
|
|
11281
11281
|
|
|
@@ -11286,9 +11286,9 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
11286
11286
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/fix-eperm.js
|
|
11287
11287
|
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
11288
11288
|
var { chmod: chmod2 } = promises;
|
|
11289
|
-
var fixEPERM = (fn) => async (
|
|
11289
|
+
var fixEPERM = (fn) => async (path31) => {
|
|
11290
11290
|
try {
|
|
11291
|
-
return await fn(
|
|
11291
|
+
return await fn(path31);
|
|
11292
11292
|
} catch (er) {
|
|
11293
11293
|
const fer = er;
|
|
11294
11294
|
if (_optionalChain([fer, 'optionalAccess', _192 => _192.code]) === "ENOENT") {
|
|
@@ -11296,7 +11296,7 @@ var fixEPERM = (fn) => async (path30) => {
|
|
|
11296
11296
|
}
|
|
11297
11297
|
if (_optionalChain([fer, 'optionalAccess', _193 => _193.code]) === "EPERM") {
|
|
11298
11298
|
try {
|
|
11299
|
-
await chmod2(
|
|
11299
|
+
await chmod2(path31, 438);
|
|
11300
11300
|
} catch (er2) {
|
|
11301
11301
|
const fer2 = er2;
|
|
11302
11302
|
if (_optionalChain([fer2, 'optionalAccess', _194 => _194.code]) === "ENOENT") {
|
|
@@ -11304,14 +11304,14 @@ var fixEPERM = (fn) => async (path30) => {
|
|
|
11304
11304
|
}
|
|
11305
11305
|
throw er;
|
|
11306
11306
|
}
|
|
11307
|
-
return await fn(
|
|
11307
|
+
return await fn(path31);
|
|
11308
11308
|
}
|
|
11309
11309
|
throw er;
|
|
11310
11310
|
}
|
|
11311
11311
|
};
|
|
11312
|
-
var fixEPERMSync = (fn) => (
|
|
11312
|
+
var fixEPERMSync = (fn) => (path31) => {
|
|
11313
11313
|
try {
|
|
11314
|
-
return fn(
|
|
11314
|
+
return fn(path31);
|
|
11315
11315
|
} catch (er) {
|
|
11316
11316
|
const fer = er;
|
|
11317
11317
|
if (_optionalChain([fer, 'optionalAccess', _195 => _195.code]) === "ENOENT") {
|
|
@@ -11319,7 +11319,7 @@ var fixEPERMSync = (fn) => (path30) => {
|
|
|
11319
11319
|
}
|
|
11320
11320
|
if (_optionalChain([fer, 'optionalAccess', _196 => _196.code]) === "EPERM") {
|
|
11321
11321
|
try {
|
|
11322
|
-
_fs.chmodSync.call(void 0,
|
|
11322
|
+
_fs.chmodSync.call(void 0, path31, 438);
|
|
11323
11323
|
} catch (er2) {
|
|
11324
11324
|
const fer2 = er2;
|
|
11325
11325
|
if (_optionalChain([fer2, 'optionalAccess', _197 => _197.code]) === "ENOENT") {
|
|
@@ -11327,7 +11327,7 @@ var fixEPERMSync = (fn) => (path30) => {
|
|
|
11327
11327
|
}
|
|
11328
11328
|
throw er;
|
|
11329
11329
|
}
|
|
11330
|
-
return fn(
|
|
11330
|
+
return fn(path31);
|
|
11331
11331
|
}
|
|
11332
11332
|
throw er;
|
|
11333
11333
|
}
|
|
@@ -11340,23 +11340,23 @@ var RATE = 1.2;
|
|
|
11340
11340
|
var MAXRETRIES = 10;
|
|
11341
11341
|
var codes = /* @__PURE__ */ new Set(["EMFILE", "ENFILE", "EBUSY"]);
|
|
11342
11342
|
var retryBusy = (fn) => {
|
|
11343
|
-
const method = async (
|
|
11343
|
+
const method = async (path31, opt, backoff = 1, total = 0) => {
|
|
11344
11344
|
const mbo = opt.maxBackoff || MAXBACKOFF;
|
|
11345
11345
|
const rate = opt.backoff || RATE;
|
|
11346
11346
|
const max = opt.maxRetries || MAXRETRIES;
|
|
11347
11347
|
let retries = 0;
|
|
11348
11348
|
while (true) {
|
|
11349
11349
|
try {
|
|
11350
|
-
return await fn(
|
|
11350
|
+
return await fn(path31);
|
|
11351
11351
|
} catch (er) {
|
|
11352
11352
|
const fer = er;
|
|
11353
|
-
if (_optionalChain([fer, 'optionalAccess', _198 => _198.path]) ===
|
|
11353
|
+
if (_optionalChain([fer, 'optionalAccess', _198 => _198.path]) === path31 && _optionalChain([fer, 'optionalAccess', _199 => _199.code]) && codes.has(fer.code)) {
|
|
11354
11354
|
backoff = Math.ceil(backoff * rate);
|
|
11355
11355
|
total = backoff + total;
|
|
11356
11356
|
if (total < mbo) {
|
|
11357
11357
|
return new Promise((res, rej) => {
|
|
11358
11358
|
setTimeout(() => {
|
|
11359
|
-
method(
|
|
11359
|
+
method(path31, opt, backoff, total).then(res, rej);
|
|
11360
11360
|
}, backoff);
|
|
11361
11361
|
});
|
|
11362
11362
|
}
|
|
@@ -11372,15 +11372,15 @@ var retryBusy = (fn) => {
|
|
|
11372
11372
|
return method;
|
|
11373
11373
|
};
|
|
11374
11374
|
var retryBusySync = (fn) => {
|
|
11375
|
-
const method = (
|
|
11375
|
+
const method = (path31, opt) => {
|
|
11376
11376
|
const max = opt.maxRetries || MAXRETRIES;
|
|
11377
11377
|
let retries = 0;
|
|
11378
11378
|
while (true) {
|
|
11379
11379
|
try {
|
|
11380
|
-
return fn(
|
|
11380
|
+
return fn(path31);
|
|
11381
11381
|
} catch (er) {
|
|
11382
11382
|
const fer = er;
|
|
11383
|
-
if (_optionalChain([fer, 'optionalAccess', _200 => _200.path]) ===
|
|
11383
|
+
if (_optionalChain([fer, 'optionalAccess', _200 => _200.path]) === path31 && _optionalChain([fer, 'optionalAccess', _201 => _201.code]) && codes.has(fer.code) && retries < max) {
|
|
11384
11384
|
retries++;
|
|
11385
11385
|
continue;
|
|
11386
11386
|
}
|
|
@@ -11400,16 +11400,16 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
11400
11400
|
|
|
11401
11401
|
|
|
11402
11402
|
var { stat: stat5 } = promises;
|
|
11403
|
-
var isDirSync = (
|
|
11403
|
+
var isDirSync = (path31) => {
|
|
11404
11404
|
try {
|
|
11405
|
-
return _fs.statSync.call(void 0,
|
|
11405
|
+
return _fs.statSync.call(void 0, path31).isDirectory();
|
|
11406
11406
|
} catch (er) {
|
|
11407
11407
|
return false;
|
|
11408
11408
|
}
|
|
11409
11409
|
};
|
|
11410
|
-
var isDir = (
|
|
11411
|
-
var win32DefaultTmp = async (
|
|
11412
|
-
const { root } = _path.parse.call(void 0,
|
|
11410
|
+
var isDir = (path31) => stat5(path31).then((st) => st.isDirectory(), () => false);
|
|
11411
|
+
var win32DefaultTmp = async (path31) => {
|
|
11412
|
+
const { root } = _path.parse.call(void 0, path31);
|
|
11413
11413
|
const tmp = _os.tmpdir.call(void 0, );
|
|
11414
11414
|
const { root: tmpRoot } = _path.parse.call(void 0, tmp);
|
|
11415
11415
|
if (root.toLowerCase() === tmpRoot.toLowerCase()) {
|
|
@@ -11421,8 +11421,8 @@ var win32DefaultTmp = async (path30) => {
|
|
|
11421
11421
|
}
|
|
11422
11422
|
return root;
|
|
11423
11423
|
};
|
|
11424
|
-
var win32DefaultTmpSync = (
|
|
11425
|
-
const { root } = _path.parse.call(void 0,
|
|
11424
|
+
var win32DefaultTmpSync = (path31) => {
|
|
11425
|
+
const { root } = _path.parse.call(void 0, path31);
|
|
11426
11426
|
const tmp = _os.tmpdir.call(void 0, );
|
|
11427
11427
|
const { root: tmpRoot } = _path.parse.call(void 0, tmp);
|
|
11428
11428
|
if (root.toLowerCase() === tmpRoot.toLowerCase()) {
|
|
@@ -11441,10 +11441,10 @@ var defaultTmpSync = platform_default === "win32" ? win32DefaultTmpSync : posixD
|
|
|
11441
11441
|
|
|
11442
11442
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-move-remove.js
|
|
11443
11443
|
var { lstat: lstat6, rename: rename2, unlink: unlink3, rmdir: rmdir3, chmod: chmod3 } = promises;
|
|
11444
|
-
var uniqueFilename = (
|
|
11445
|
-
var unlinkFixEPERM = async (
|
|
11444
|
+
var uniqueFilename = (path31) => `.${_path.basename.call(void 0, path31)}.${Math.random()}`;
|
|
11445
|
+
var unlinkFixEPERM = async (path31) => unlink3(path31).catch((er) => {
|
|
11446
11446
|
if (er.code === "EPERM") {
|
|
11447
|
-
return chmod3(
|
|
11447
|
+
return chmod3(path31, 438).then(() => unlink3(path31), (er2) => {
|
|
11448
11448
|
if (er2.code === "ENOENT") {
|
|
11449
11449
|
return;
|
|
11450
11450
|
}
|
|
@@ -11455,13 +11455,13 @@ var unlinkFixEPERM = async (path30) => unlink3(path30).catch((er) => {
|
|
|
11455
11455
|
}
|
|
11456
11456
|
throw er;
|
|
11457
11457
|
});
|
|
11458
|
-
var unlinkFixEPERMSync = (
|
|
11458
|
+
var unlinkFixEPERMSync = (path31) => {
|
|
11459
11459
|
try {
|
|
11460
|
-
_fs.unlinkSync.call(void 0,
|
|
11460
|
+
_fs.unlinkSync.call(void 0, path31);
|
|
11461
11461
|
} catch (er) {
|
|
11462
11462
|
if (_optionalChain([er, 'optionalAccess', _202 => _202.code]) === "EPERM") {
|
|
11463
11463
|
try {
|
|
11464
|
-
return _fs.chmodSync.call(void 0,
|
|
11464
|
+
return _fs.chmodSync.call(void 0, path31, 438);
|
|
11465
11465
|
} catch (er2) {
|
|
11466
11466
|
if (_optionalChain([er2, 'optionalAccess', _203 => _203.code]) === "ENOENT") {
|
|
11467
11467
|
return;
|
|
@@ -11474,29 +11474,29 @@ var unlinkFixEPERMSync = (path30) => {
|
|
|
11474
11474
|
throw er;
|
|
11475
11475
|
}
|
|
11476
11476
|
};
|
|
11477
|
-
var rimrafMoveRemove = async (
|
|
11477
|
+
var rimrafMoveRemove = async (path31, opt) => {
|
|
11478
11478
|
if (_optionalChain([opt, 'optionalAccess', _205 => _205.signal, 'optionalAccess', _206 => _206.aborted])) {
|
|
11479
11479
|
throw opt.signal.reason;
|
|
11480
11480
|
}
|
|
11481
11481
|
try {
|
|
11482
|
-
return await rimrafMoveRemoveDir(
|
|
11482
|
+
return await rimrafMoveRemoveDir(path31, opt, await lstat6(path31));
|
|
11483
11483
|
} catch (er) {
|
|
11484
11484
|
if (_optionalChain([er, 'optionalAccess', _207 => _207.code]) === "ENOENT")
|
|
11485
11485
|
return true;
|
|
11486
11486
|
throw er;
|
|
11487
11487
|
}
|
|
11488
11488
|
};
|
|
11489
|
-
var rimrafMoveRemoveDir = async (
|
|
11489
|
+
var rimrafMoveRemoveDir = async (path31, opt, ent) => {
|
|
11490
11490
|
if (_optionalChain([opt, 'optionalAccess', _208 => _208.signal, 'optionalAccess', _209 => _209.aborted])) {
|
|
11491
11491
|
throw opt.signal.reason;
|
|
11492
11492
|
}
|
|
11493
11493
|
if (!opt.tmp) {
|
|
11494
|
-
return rimrafMoveRemoveDir(
|
|
11494
|
+
return rimrafMoveRemoveDir(path31, { ...opt, tmp: await defaultTmp(path31) }, ent);
|
|
11495
11495
|
}
|
|
11496
|
-
if (
|
|
11496
|
+
if (path31 === opt.tmp && _path.parse.call(void 0, path31).root !== path31) {
|
|
11497
11497
|
throw new Error("cannot delete temp directory used for deletion");
|
|
11498
11498
|
}
|
|
11499
|
-
const entries = ent.isDirectory() ? await readdirOrError(
|
|
11499
|
+
const entries = ent.isDirectory() ? await readdirOrError(path31) : null;
|
|
11500
11500
|
if (!Array.isArray(entries)) {
|
|
11501
11501
|
if (entries) {
|
|
11502
11502
|
if (entries.code === "ENOENT") {
|
|
@@ -11506,54 +11506,54 @@ var rimrafMoveRemoveDir = async (path30, opt, ent) => {
|
|
|
11506
11506
|
throw entries;
|
|
11507
11507
|
}
|
|
11508
11508
|
}
|
|
11509
|
-
if (opt.filter && !await opt.filter(
|
|
11509
|
+
if (opt.filter && !await opt.filter(path31, ent)) {
|
|
11510
11510
|
return false;
|
|
11511
11511
|
}
|
|
11512
|
-
await ignoreENOENT(tmpUnlink(
|
|
11512
|
+
await ignoreENOENT(tmpUnlink(path31, opt.tmp, unlinkFixEPERM));
|
|
11513
11513
|
return true;
|
|
11514
11514
|
}
|
|
11515
|
-
const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(_path.resolve.call(void 0,
|
|
11515
|
+
const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(_path.resolve.call(void 0, path31, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
|
|
11516
11516
|
if (!removedAll) {
|
|
11517
11517
|
return false;
|
|
11518
11518
|
}
|
|
11519
|
-
if (opt.preserveRoot === false &&
|
|
11519
|
+
if (opt.preserveRoot === false && path31 === _path.parse.call(void 0, path31).root) {
|
|
11520
11520
|
return false;
|
|
11521
11521
|
}
|
|
11522
|
-
if (opt.filter && !await opt.filter(
|
|
11522
|
+
if (opt.filter && !await opt.filter(path31, ent)) {
|
|
11523
11523
|
return false;
|
|
11524
11524
|
}
|
|
11525
|
-
await ignoreENOENT(tmpUnlink(
|
|
11525
|
+
await ignoreENOENT(tmpUnlink(path31, opt.tmp, rmdir3));
|
|
11526
11526
|
return true;
|
|
11527
11527
|
};
|
|
11528
|
-
var tmpUnlink = async (
|
|
11529
|
-
const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(
|
|
11530
|
-
await rename2(
|
|
11528
|
+
var tmpUnlink = async (path31, tmp, rm3) => {
|
|
11529
|
+
const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path31));
|
|
11530
|
+
await rename2(path31, tmpFile);
|
|
11531
11531
|
return await rm3(tmpFile);
|
|
11532
11532
|
};
|
|
11533
|
-
var rimrafMoveRemoveSync = (
|
|
11533
|
+
var rimrafMoveRemoveSync = (path31, opt) => {
|
|
11534
11534
|
if (_optionalChain([opt, 'optionalAccess', _210 => _210.signal, 'optionalAccess', _211 => _211.aborted])) {
|
|
11535
11535
|
throw opt.signal.reason;
|
|
11536
11536
|
}
|
|
11537
11537
|
try {
|
|
11538
|
-
return rimrafMoveRemoveDirSync(
|
|
11538
|
+
return rimrafMoveRemoveDirSync(path31, opt, _fs.lstatSync.call(void 0, path31));
|
|
11539
11539
|
} catch (er) {
|
|
11540
11540
|
if (_optionalChain([er, 'optionalAccess', _212 => _212.code]) === "ENOENT")
|
|
11541
11541
|
return true;
|
|
11542
11542
|
throw er;
|
|
11543
11543
|
}
|
|
11544
11544
|
};
|
|
11545
|
-
var rimrafMoveRemoveDirSync = (
|
|
11545
|
+
var rimrafMoveRemoveDirSync = (path31, opt, ent) => {
|
|
11546
11546
|
if (_optionalChain([opt, 'optionalAccess', _213 => _213.signal, 'optionalAccess', _214 => _214.aborted])) {
|
|
11547
11547
|
throw opt.signal.reason;
|
|
11548
11548
|
}
|
|
11549
11549
|
if (!opt.tmp) {
|
|
11550
|
-
return rimrafMoveRemoveDirSync(
|
|
11550
|
+
return rimrafMoveRemoveDirSync(path31, { ...opt, tmp: defaultTmpSync(path31) }, ent);
|
|
11551
11551
|
}
|
|
11552
11552
|
const tmp = opt.tmp;
|
|
11553
|
-
if (
|
|
11553
|
+
if (path31 === opt.tmp && _path.parse.call(void 0, path31).root !== path31) {
|
|
11554
11554
|
throw new Error("cannot delete temp directory used for deletion");
|
|
11555
11555
|
}
|
|
11556
|
-
const entries = ent.isDirectory() ? readdirOrErrorSync(
|
|
11556
|
+
const entries = ent.isDirectory() ? readdirOrErrorSync(path31) : null;
|
|
11557
11557
|
if (!Array.isArray(entries)) {
|
|
11558
11558
|
if (entries) {
|
|
11559
11559
|
if (entries.code === "ENOENT") {
|
|
@@ -11563,32 +11563,32 @@ var rimrafMoveRemoveDirSync = (path30, opt, ent) => {
|
|
|
11563
11563
|
throw entries;
|
|
11564
11564
|
}
|
|
11565
11565
|
}
|
|
11566
|
-
if (opt.filter && !opt.filter(
|
|
11566
|
+
if (opt.filter && !opt.filter(path31, ent)) {
|
|
11567
11567
|
return false;
|
|
11568
11568
|
}
|
|
11569
|
-
ignoreENOENTSync(() => tmpUnlinkSync(
|
|
11569
|
+
ignoreENOENTSync(() => tmpUnlinkSync(path31, tmp, unlinkFixEPERMSync));
|
|
11570
11570
|
return true;
|
|
11571
11571
|
}
|
|
11572
11572
|
let removedAll = true;
|
|
11573
11573
|
for (const ent2 of entries) {
|
|
11574
|
-
const p = _path.resolve.call(void 0,
|
|
11574
|
+
const p = _path.resolve.call(void 0, path31, ent2.name);
|
|
11575
11575
|
removedAll = rimrafMoveRemoveDirSync(p, opt, ent2) && removedAll;
|
|
11576
11576
|
}
|
|
11577
11577
|
if (!removedAll) {
|
|
11578
11578
|
return false;
|
|
11579
11579
|
}
|
|
11580
|
-
if (opt.preserveRoot === false &&
|
|
11580
|
+
if (opt.preserveRoot === false && path31 === _path.parse.call(void 0, path31).root) {
|
|
11581
11581
|
return false;
|
|
11582
11582
|
}
|
|
11583
|
-
if (opt.filter && !opt.filter(
|
|
11583
|
+
if (opt.filter && !opt.filter(path31, ent)) {
|
|
11584
11584
|
return false;
|
|
11585
11585
|
}
|
|
11586
|
-
ignoreENOENTSync(() => tmpUnlinkSync(
|
|
11586
|
+
ignoreENOENTSync(() => tmpUnlinkSync(path31, tmp, _fs.rmdirSync));
|
|
11587
11587
|
return true;
|
|
11588
11588
|
};
|
|
11589
|
-
var tmpUnlinkSync = (
|
|
11590
|
-
const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(
|
|
11591
|
-
_fs.renameSync.call(void 0,
|
|
11589
|
+
var tmpUnlinkSync = (path31, tmp, rmSync2) => {
|
|
11590
|
+
const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path31));
|
|
11591
|
+
_fs.renameSync.call(void 0, path31, tmpFile);
|
|
11592
11592
|
return rmSync2(tmpFile);
|
|
11593
11593
|
};
|
|
11594
11594
|
|
|
@@ -11598,31 +11598,31 @@ var rimrafWindowsFile = retryBusy(fixEPERM(unlink4));
|
|
|
11598
11598
|
var rimrafWindowsFileSync = retryBusySync(fixEPERMSync(_fs.unlinkSync));
|
|
11599
11599
|
var rimrafWindowsDirRetry = retryBusy(fixEPERM(rmdir4));
|
|
11600
11600
|
var rimrafWindowsDirRetrySync = retryBusySync(fixEPERMSync(_fs.rmdirSync));
|
|
11601
|
-
var rimrafWindowsDirMoveRemoveFallback = async (
|
|
11601
|
+
var rimrafWindowsDirMoveRemoveFallback = async (path31, opt) => {
|
|
11602
11602
|
if (_optionalChain([opt, 'optionalAccess', _215 => _215.signal, 'optionalAccess', _216 => _216.aborted])) {
|
|
11603
11603
|
throw opt.signal.reason;
|
|
11604
11604
|
}
|
|
11605
11605
|
const { filter: filter3, ...options } = opt;
|
|
11606
11606
|
try {
|
|
11607
|
-
return await rimrafWindowsDirRetry(
|
|
11607
|
+
return await rimrafWindowsDirRetry(path31, options);
|
|
11608
11608
|
} catch (er) {
|
|
11609
11609
|
if (_optionalChain([er, 'optionalAccess', _217 => _217.code]) === "ENOTEMPTY") {
|
|
11610
|
-
return await rimrafMoveRemove(
|
|
11610
|
+
return await rimrafMoveRemove(path31, options);
|
|
11611
11611
|
}
|
|
11612
11612
|
throw er;
|
|
11613
11613
|
}
|
|
11614
11614
|
};
|
|
11615
|
-
var rimrafWindowsDirMoveRemoveFallbackSync = (
|
|
11615
|
+
var rimrafWindowsDirMoveRemoveFallbackSync = (path31, opt) => {
|
|
11616
11616
|
if (_optionalChain([opt, 'optionalAccess', _218 => _218.signal, 'optionalAccess', _219 => _219.aborted])) {
|
|
11617
11617
|
throw opt.signal.reason;
|
|
11618
11618
|
}
|
|
11619
11619
|
const { filter: filter3, ...options } = opt;
|
|
11620
11620
|
try {
|
|
11621
|
-
return rimrafWindowsDirRetrySync(
|
|
11621
|
+
return rimrafWindowsDirRetrySync(path31, options);
|
|
11622
11622
|
} catch (er) {
|
|
11623
11623
|
const fer = er;
|
|
11624
11624
|
if (_optionalChain([fer, 'optionalAccess', _220 => _220.code]) === "ENOTEMPTY") {
|
|
11625
|
-
return rimrafMoveRemoveSync(
|
|
11625
|
+
return rimrafMoveRemoveSync(path31, options);
|
|
11626
11626
|
}
|
|
11627
11627
|
throw er;
|
|
11628
11628
|
}
|
|
@@ -11630,35 +11630,35 @@ var rimrafWindowsDirMoveRemoveFallbackSync = (path30, opt) => {
|
|
|
11630
11630
|
var START = Symbol("start");
|
|
11631
11631
|
var CHILD = Symbol("child");
|
|
11632
11632
|
var FINISH = Symbol("finish");
|
|
11633
|
-
var rimrafWindows = async (
|
|
11633
|
+
var rimrafWindows = async (path31, opt) => {
|
|
11634
11634
|
if (_optionalChain([opt, 'optionalAccess', _221 => _221.signal, 'optionalAccess', _222 => _222.aborted])) {
|
|
11635
11635
|
throw opt.signal.reason;
|
|
11636
11636
|
}
|
|
11637
11637
|
try {
|
|
11638
|
-
return await rimrafWindowsDir(
|
|
11638
|
+
return await rimrafWindowsDir(path31, opt, await lstat7(path31), START);
|
|
11639
11639
|
} catch (er) {
|
|
11640
11640
|
if (_optionalChain([er, 'optionalAccess', _223 => _223.code]) === "ENOENT")
|
|
11641
11641
|
return true;
|
|
11642
11642
|
throw er;
|
|
11643
11643
|
}
|
|
11644
11644
|
};
|
|
11645
|
-
var rimrafWindowsSync = (
|
|
11645
|
+
var rimrafWindowsSync = (path31, opt) => {
|
|
11646
11646
|
if (_optionalChain([opt, 'optionalAccess', _224 => _224.signal, 'optionalAccess', _225 => _225.aborted])) {
|
|
11647
11647
|
throw opt.signal.reason;
|
|
11648
11648
|
}
|
|
11649
11649
|
try {
|
|
11650
|
-
return rimrafWindowsDirSync(
|
|
11650
|
+
return rimrafWindowsDirSync(path31, opt, _fs.lstatSync.call(void 0, path31), START);
|
|
11651
11651
|
} catch (er) {
|
|
11652
11652
|
if (_optionalChain([er, 'optionalAccess', _226 => _226.code]) === "ENOENT")
|
|
11653
11653
|
return true;
|
|
11654
11654
|
throw er;
|
|
11655
11655
|
}
|
|
11656
11656
|
};
|
|
11657
|
-
var rimrafWindowsDir = async (
|
|
11657
|
+
var rimrafWindowsDir = async (path31, opt, ent, state = START) => {
|
|
11658
11658
|
if (_optionalChain([opt, 'optionalAccess', _227 => _227.signal, 'optionalAccess', _228 => _228.aborted])) {
|
|
11659
11659
|
throw opt.signal.reason;
|
|
11660
11660
|
}
|
|
11661
|
-
const entries = ent.isDirectory() ? await readdirOrError(
|
|
11661
|
+
const entries = ent.isDirectory() ? await readdirOrError(path31) : null;
|
|
11662
11662
|
if (!Array.isArray(entries)) {
|
|
11663
11663
|
if (entries) {
|
|
11664
11664
|
if (entries.code === "ENOENT") {
|
|
@@ -11668,32 +11668,32 @@ var rimrafWindowsDir = async (path30, opt, ent, state = START) => {
|
|
|
11668
11668
|
throw entries;
|
|
11669
11669
|
}
|
|
11670
11670
|
}
|
|
11671
|
-
if (opt.filter && !await opt.filter(
|
|
11671
|
+
if (opt.filter && !await opt.filter(path31, ent)) {
|
|
11672
11672
|
return false;
|
|
11673
11673
|
}
|
|
11674
|
-
await ignoreENOENT(rimrafWindowsFile(
|
|
11674
|
+
await ignoreENOENT(rimrafWindowsFile(path31, opt));
|
|
11675
11675
|
return true;
|
|
11676
11676
|
}
|
|
11677
11677
|
const s = state === START ? CHILD : state;
|
|
11678
|
-
const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(_path.resolve.call(void 0,
|
|
11678
|
+
const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(_path.resolve.call(void 0, path31, ent2.name), opt, ent2, s)))).reduce((a, b) => a && b, true);
|
|
11679
11679
|
if (state === START) {
|
|
11680
|
-
return rimrafWindowsDir(
|
|
11680
|
+
return rimrafWindowsDir(path31, opt, ent, FINISH);
|
|
11681
11681
|
} else if (state === FINISH) {
|
|
11682
|
-
if (opt.preserveRoot === false &&
|
|
11682
|
+
if (opt.preserveRoot === false && path31 === _path.parse.call(void 0, path31).root) {
|
|
11683
11683
|
return false;
|
|
11684
11684
|
}
|
|
11685
11685
|
if (!removedAll) {
|
|
11686
11686
|
return false;
|
|
11687
11687
|
}
|
|
11688
|
-
if (opt.filter && !await opt.filter(
|
|
11688
|
+
if (opt.filter && !await opt.filter(path31, ent)) {
|
|
11689
11689
|
return false;
|
|
11690
11690
|
}
|
|
11691
|
-
await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(
|
|
11691
|
+
await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path31, opt));
|
|
11692
11692
|
}
|
|
11693
11693
|
return true;
|
|
11694
11694
|
};
|
|
11695
|
-
var rimrafWindowsDirSync = (
|
|
11696
|
-
const entries = ent.isDirectory() ? readdirOrErrorSync(
|
|
11695
|
+
var rimrafWindowsDirSync = (path31, opt, ent, state = START) => {
|
|
11696
|
+
const entries = ent.isDirectory() ? readdirOrErrorSync(path31) : null;
|
|
11697
11697
|
if (!Array.isArray(entries)) {
|
|
11698
11698
|
if (entries) {
|
|
11699
11699
|
if (entries.code === "ENOENT") {
|
|
@@ -11703,32 +11703,32 @@ var rimrafWindowsDirSync = (path30, opt, ent, state = START) => {
|
|
|
11703
11703
|
throw entries;
|
|
11704
11704
|
}
|
|
11705
11705
|
}
|
|
11706
|
-
if (opt.filter && !opt.filter(
|
|
11706
|
+
if (opt.filter && !opt.filter(path31, ent)) {
|
|
11707
11707
|
return false;
|
|
11708
11708
|
}
|
|
11709
|
-
ignoreENOENTSync(() => rimrafWindowsFileSync(
|
|
11709
|
+
ignoreENOENTSync(() => rimrafWindowsFileSync(path31, opt));
|
|
11710
11710
|
return true;
|
|
11711
11711
|
}
|
|
11712
11712
|
let removedAll = true;
|
|
11713
11713
|
for (const ent2 of entries) {
|
|
11714
11714
|
const s = state === START ? CHILD : state;
|
|
11715
|
-
const p = _path.resolve.call(void 0,
|
|
11715
|
+
const p = _path.resolve.call(void 0, path31, ent2.name);
|
|
11716
11716
|
removedAll = rimrafWindowsDirSync(p, opt, ent2, s) && removedAll;
|
|
11717
11717
|
}
|
|
11718
11718
|
if (state === START) {
|
|
11719
|
-
return rimrafWindowsDirSync(
|
|
11719
|
+
return rimrafWindowsDirSync(path31, opt, ent, FINISH);
|
|
11720
11720
|
} else if (state === FINISH) {
|
|
11721
|
-
if (opt.preserveRoot === false &&
|
|
11721
|
+
if (opt.preserveRoot === false && path31 === _path.parse.call(void 0, path31).root) {
|
|
11722
11722
|
return false;
|
|
11723
11723
|
}
|
|
11724
11724
|
if (!removedAll) {
|
|
11725
11725
|
return false;
|
|
11726
11726
|
}
|
|
11727
|
-
if (opt.filter && !opt.filter(
|
|
11727
|
+
if (opt.filter && !opt.filter(path31, ent)) {
|
|
11728
11728
|
return false;
|
|
11729
11729
|
}
|
|
11730
11730
|
ignoreENOENTSync(() => {
|
|
11731
|
-
rimrafWindowsDirMoveRemoveFallbackSync(
|
|
11731
|
+
rimrafWindowsDirMoveRemoveFallbackSync(path31, opt);
|
|
11732
11732
|
});
|
|
11733
11733
|
}
|
|
11734
11734
|
return true;
|
|
@@ -11741,16 +11741,16 @@ var rimrafManualSync = platform_default === "win32" ? rimrafWindowsSync : rimraf
|
|
|
11741
11741
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-native.js
|
|
11742
11742
|
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
11743
11743
|
var { rm: rm2 } = promises;
|
|
11744
|
-
var rimrafNative = async (
|
|
11745
|
-
await rm2(
|
|
11744
|
+
var rimrafNative = async (path31, opt) => {
|
|
11745
|
+
await rm2(path31, {
|
|
11746
11746
|
...opt,
|
|
11747
11747
|
force: true,
|
|
11748
11748
|
recursive: true
|
|
11749
11749
|
});
|
|
11750
11750
|
return true;
|
|
11751
11751
|
};
|
|
11752
|
-
var rimrafNativeSync = (
|
|
11753
|
-
_fs.rmSync.call(void 0,
|
|
11752
|
+
var rimrafNativeSync = (path31, opt) => {
|
|
11753
|
+
_fs.rmSync.call(void 0, path31, {
|
|
11754
11754
|
...opt,
|
|
11755
11755
|
force: true,
|
|
11756
11756
|
recursive: true
|
|
@@ -11768,26 +11768,26 @@ var useNative = !hasNative || platform_default === "win32" ? () => false : (opt)
|
|
|
11768
11768
|
var useNativeSync = !hasNative || platform_default === "win32" ? () => false : (opt) => !_optionalChain([opt, 'optionalAccess', _231 => _231.signal]) && !_optionalChain([opt, 'optionalAccess', _232 => _232.filter]);
|
|
11769
11769
|
|
|
11770
11770
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/index.js
|
|
11771
|
-
var wrap = (fn) => async (
|
|
11771
|
+
var wrap = (fn) => async (path31, opt) => {
|
|
11772
11772
|
const options = optArg(opt);
|
|
11773
11773
|
if (options.glob) {
|
|
11774
|
-
|
|
11774
|
+
path31 = await glob(path31, options.glob);
|
|
11775
11775
|
}
|
|
11776
|
-
if (Array.isArray(
|
|
11777
|
-
return !!(await Promise.all(
|
|
11776
|
+
if (Array.isArray(path31)) {
|
|
11777
|
+
return !!(await Promise.all(path31.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
|
|
11778
11778
|
} else {
|
|
11779
|
-
return !!await fn(path_arg_default(
|
|
11779
|
+
return !!await fn(path_arg_default(path31, options), options);
|
|
11780
11780
|
}
|
|
11781
11781
|
};
|
|
11782
|
-
var wrapSync = (fn) => (
|
|
11782
|
+
var wrapSync = (fn) => (path31, opt) => {
|
|
11783
11783
|
const options = optArgSync(opt);
|
|
11784
11784
|
if (options.glob) {
|
|
11785
|
-
|
|
11785
|
+
path31 = globSync(path31, options.glob);
|
|
11786
11786
|
}
|
|
11787
|
-
if (Array.isArray(
|
|
11788
|
-
return !!
|
|
11787
|
+
if (Array.isArray(path31)) {
|
|
11788
|
+
return !!path31.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
|
|
11789
11789
|
} else {
|
|
11790
|
-
return !!fn(path_arg_default(
|
|
11790
|
+
return !!fn(path_arg_default(path31, options), options);
|
|
11791
11791
|
}
|
|
11792
11792
|
};
|
|
11793
11793
|
var nativeSync = wrapSync(rimrafNativeSync);
|
|
@@ -11802,8 +11802,8 @@ var moveRemoveSync = wrapSync(rimrafMoveRemoveSync);
|
|
|
11802
11802
|
var moveRemove = Object.assign(wrap(rimrafMoveRemove), {
|
|
11803
11803
|
sync: moveRemoveSync
|
|
11804
11804
|
});
|
|
11805
|
-
var rimrafSync = wrapSync((
|
|
11806
|
-
var rimraf_ = wrap((
|
|
11805
|
+
var rimrafSync = wrapSync((path31, opt) => useNativeSync(opt) ? rimrafNativeSync(path31, opt) : rimrafManualSync(path31, opt));
|
|
11806
|
+
var rimraf_ = wrap((path31, opt) => useNative(opt) ? rimrafNative(path31, opt) : rimrafManual(path31, opt));
|
|
11807
11807
|
var rimraf = Object.assign(rimraf_, {
|
|
11808
11808
|
rimraf: rimraf_,
|
|
11809
11809
|
sync: rimrafSync,
|
|
@@ -11823,10 +11823,258 @@ rimraf.rimraf = rimraf;
|
|
|
11823
11823
|
|
|
11824
11824
|
// src/runtime/buildPlugin.ts
|
|
11825
11825
|
var _vite = require('vite');
|
|
11826
|
-
|
|
11826
|
+
|
|
11827
|
+
// src/runtime/advancedChunks.ts
|
|
11828
|
+
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
11829
|
+
|
|
11830
|
+
// src/runtime/chunkStrategy.ts
|
|
11831
|
+
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
11832
|
+
|
|
11833
|
+
var SHARED_CHUNK_VIRTUAL_PREFIX = "__weapp_shared__";
|
|
11834
|
+
var SUB_PACKAGE_SHARED_DIR = "__shared__";
|
|
11835
|
+
var DEFAULT_SHARED_CHUNK_STRATEGY = "duplicate";
|
|
11836
|
+
function resolveSharedChunkName(options) {
|
|
11837
|
+
const {
|
|
11838
|
+
id,
|
|
11839
|
+
ctx,
|
|
11840
|
+
relativeAbsoluteSrcRoot,
|
|
11841
|
+
subPackageRoots,
|
|
11842
|
+
strategy
|
|
11843
|
+
} = options;
|
|
11844
|
+
const moduleInfo = ctx.getModuleInfo(id);
|
|
11845
|
+
if (!_optionalChain([moduleInfo, 'optionalAccess', _233 => _233.importers]) || moduleInfo.importers.length <= 1) {
|
|
11846
|
+
return void 0;
|
|
11847
|
+
}
|
|
11848
|
+
const summary = summarizeImportPrefixes({
|
|
11849
|
+
importers: moduleInfo.importers,
|
|
11850
|
+
relativeAbsoluteSrcRoot,
|
|
11851
|
+
subPackageRoots: Array.from(subPackageRoots)
|
|
11852
|
+
});
|
|
11853
|
+
const keys = Object.keys(summary);
|
|
11854
|
+
if (keys.length === 0) {
|
|
11855
|
+
return void 0;
|
|
11856
|
+
}
|
|
11857
|
+
if (keys.length === 1) {
|
|
11858
|
+
const prefix = keys[0];
|
|
11859
|
+
return prefix ? _pathe.posix.join(prefix, "common") : "common";
|
|
11860
|
+
}
|
|
11861
|
+
const hasMainImporter = keys.includes("");
|
|
11862
|
+
if (strategy === "duplicate" && !hasMainImporter) {
|
|
11863
|
+
const combination = keys.filter(Boolean).sort().join("+");
|
|
11864
|
+
const combinationSegment = combination ? `${combination}/` : "";
|
|
11865
|
+
return `${SHARED_CHUNK_VIRTUAL_PREFIX}/${combinationSegment}common`;
|
|
11866
|
+
}
|
|
11867
|
+
return "common";
|
|
11868
|
+
}
|
|
11869
|
+
function summarizeImportPrefixes(options) {
|
|
11870
|
+
const { importers, relativeAbsoluteSrcRoot, subPackageRoots } = options;
|
|
11871
|
+
const summary = {};
|
|
11872
|
+
for (const importer of importers) {
|
|
11873
|
+
const relPath = relativeAbsoluteSrcRoot(importer);
|
|
11874
|
+
const prefix = resolveSubPackagePrefix(relPath, subPackageRoots);
|
|
11875
|
+
summary[prefix] = (summary[prefix] || 0) + 1;
|
|
11876
|
+
}
|
|
11877
|
+
return summary;
|
|
11878
|
+
}
|
|
11879
|
+
function resolveSubPackagePrefix(fileName, subPackageRoots) {
|
|
11880
|
+
for (const root of subPackageRoots) {
|
|
11881
|
+
if (!root) {
|
|
11882
|
+
continue;
|
|
11883
|
+
}
|
|
11884
|
+
if (fileName === root || fileName.startsWith(`${root}/`)) {
|
|
11885
|
+
return root;
|
|
11886
|
+
}
|
|
11887
|
+
}
|
|
11888
|
+
return "";
|
|
11889
|
+
}
|
|
11890
|
+
function applySharedChunkStrategy(bundle, options) {
|
|
11891
|
+
if (options.strategy !== "duplicate") {
|
|
11892
|
+
return;
|
|
11893
|
+
}
|
|
11894
|
+
if (!this) {
|
|
11895
|
+
throw new Error("applySharedChunkStrategy requires plugin context");
|
|
11896
|
+
}
|
|
11897
|
+
const subPackageRoots = Array.from(options.subPackageRoots).filter(Boolean);
|
|
11898
|
+
const entries = Object.entries(bundle);
|
|
11899
|
+
for (const [fileName, output] of entries) {
|
|
11900
|
+
if (!isSharedVirtualChunk(fileName, output)) {
|
|
11901
|
+
continue;
|
|
11902
|
+
}
|
|
11903
|
+
const chunk = output;
|
|
11904
|
+
const originalCode = chunk.code;
|
|
11905
|
+
const originalMap = chunk.map;
|
|
11906
|
+
const importers = findChunkImporters(bundle, fileName);
|
|
11907
|
+
if (importers.length === 0) {
|
|
11908
|
+
continue;
|
|
11909
|
+
}
|
|
11910
|
+
const importerMap = /* @__PURE__ */ new Map();
|
|
11911
|
+
let hasMainImporter = false;
|
|
11912
|
+
for (const importerFile of importers) {
|
|
11913
|
+
const root = resolveSubPackagePrefix(importerFile, subPackageRoots);
|
|
11914
|
+
if (!root) {
|
|
11915
|
+
hasMainImporter = true;
|
|
11916
|
+
break;
|
|
11917
|
+
}
|
|
11918
|
+
const duplicateBaseName = _pathe.posix.basename(fileName);
|
|
11919
|
+
const intendedFileName = _pathe.posix.join(root, SUB_PACKAGE_SHARED_DIR, duplicateBaseName);
|
|
11920
|
+
const uniqueFileName = ensureUniqueFileName(bundle, intendedFileName);
|
|
11921
|
+
const existing = importerMap.get(root);
|
|
11922
|
+
if (existing) {
|
|
11923
|
+
existing.importers.push(importerFile);
|
|
11924
|
+
} else {
|
|
11925
|
+
importerMap.set(root, {
|
|
11926
|
+
newFileName: uniqueFileName,
|
|
11927
|
+
importers: [importerFile]
|
|
11928
|
+
});
|
|
11929
|
+
}
|
|
11930
|
+
}
|
|
11931
|
+
if (hasMainImporter || importerMap.size === 0) {
|
|
11932
|
+
if (fileName.startsWith(`${SHARED_CHUNK_VIRTUAL_PREFIX}/`)) {
|
|
11933
|
+
const newFileName = fileName.slice(SHARED_CHUNK_VIRTUAL_PREFIX.length + 1);
|
|
11934
|
+
chunk.fileName = newFileName;
|
|
11935
|
+
}
|
|
11936
|
+
continue;
|
|
11937
|
+
}
|
|
11938
|
+
const importerToChunk = /* @__PURE__ */ new Map();
|
|
11939
|
+
for (const { newFileName, importers: importerFiles } of importerMap.values()) {
|
|
11940
|
+
this.emitFile({
|
|
11941
|
+
type: "asset",
|
|
11942
|
+
fileName: newFileName,
|
|
11943
|
+
source: originalCode
|
|
11944
|
+
});
|
|
11945
|
+
if (originalMap) {
|
|
11946
|
+
this.emitFile({
|
|
11947
|
+
type: "asset",
|
|
11948
|
+
fileName: `${newFileName}.map`,
|
|
11949
|
+
source: typeof originalMap === "string" ? originalMap : JSON.stringify(originalMap)
|
|
11950
|
+
});
|
|
11951
|
+
}
|
|
11952
|
+
for (const importerFile of importerFiles) {
|
|
11953
|
+
importerToChunk.set(importerFile, newFileName);
|
|
11954
|
+
}
|
|
11955
|
+
}
|
|
11956
|
+
updateImporters(bundle, importerToChunk, fileName);
|
|
11957
|
+
chunk.code = "// duplicated into sub-packages via weapp-vite chunk strategy\n";
|
|
11958
|
+
chunk.map = null;
|
|
11959
|
+
chunk.sourcemapFileName = null;
|
|
11960
|
+
chunk.imports = [];
|
|
11961
|
+
chunk.dynamicImports = [];
|
|
11962
|
+
chunk.exports = [];
|
|
11963
|
+
chunk.moduleIds = [];
|
|
11964
|
+
chunk.modules = {};
|
|
11965
|
+
}
|
|
11966
|
+
}
|
|
11967
|
+
function isSharedVirtualChunk(fileName, output) {
|
|
11968
|
+
return _optionalChain([output, 'optionalAccess', _234 => _234.type]) === "chunk" && fileName.startsWith(`${SHARED_CHUNK_VIRTUAL_PREFIX}/`);
|
|
11969
|
+
}
|
|
11970
|
+
function findChunkImporters(bundle, target) {
|
|
11971
|
+
const importers = /* @__PURE__ */ new Set();
|
|
11972
|
+
for (const [fileName, output] of Object.entries(bundle)) {
|
|
11973
|
+
if (_optionalChain([output, 'optionalAccess', _235 => _235.type]) !== "chunk") {
|
|
11974
|
+
continue;
|
|
11975
|
+
}
|
|
11976
|
+
const chunk = output;
|
|
11977
|
+
if (chunk.imports.includes(target) || chunk.dynamicImports.includes(target)) {
|
|
11978
|
+
importers.add(fileName);
|
|
11979
|
+
}
|
|
11980
|
+
}
|
|
11981
|
+
return Array.from(importers);
|
|
11982
|
+
}
|
|
11983
|
+
function ensureUniqueFileName(bundle, fileName) {
|
|
11984
|
+
if (!bundle[fileName]) {
|
|
11985
|
+
return fileName;
|
|
11986
|
+
}
|
|
11987
|
+
const { dir, name, ext: ext2 } = _pathe.posix.parse(fileName);
|
|
11988
|
+
let index = 1;
|
|
11989
|
+
let candidate = fileName;
|
|
11990
|
+
while (bundle[candidate]) {
|
|
11991
|
+
const nextName = `${name}.${index}`;
|
|
11992
|
+
candidate = dir ? _pathe.posix.join(dir, `${nextName}${ext2}`) : `${nextName}${ext2}`;
|
|
11993
|
+
index++;
|
|
11994
|
+
}
|
|
11995
|
+
return candidate;
|
|
11996
|
+
}
|
|
11997
|
+
function updateImporters(bundle, importerToChunk, originalFileName) {
|
|
11998
|
+
for (const [importerFile, newChunkFile] of importerToChunk.entries()) {
|
|
11999
|
+
const importer = bundle[importerFile];
|
|
12000
|
+
if (!importer || importer.type !== "chunk") {
|
|
12001
|
+
continue;
|
|
12002
|
+
}
|
|
12003
|
+
const importerChunk = importer;
|
|
12004
|
+
const originalImportPath = createRelativeImport(importerFile, originalFileName);
|
|
12005
|
+
const newImportPath = createRelativeImport(importerFile, newChunkFile);
|
|
12006
|
+
if (originalImportPath !== newImportPath) {
|
|
12007
|
+
importerChunk.code = replaceAll(importerChunk.code, originalImportPath, newImportPath);
|
|
12008
|
+
}
|
|
12009
|
+
importerChunk.imports = replaceInArray(importerChunk.imports, originalFileName, newChunkFile);
|
|
12010
|
+
importerChunk.dynamicImports = replaceInArray(importerChunk.dynamicImports, originalFileName, newChunkFile);
|
|
12011
|
+
}
|
|
12012
|
+
}
|
|
12013
|
+
function replaceAll(source, searchValue, replaceValue) {
|
|
12014
|
+
if (!searchValue) {
|
|
12015
|
+
return source;
|
|
12016
|
+
}
|
|
12017
|
+
if (source.includes(searchValue)) {
|
|
12018
|
+
return source.split(searchValue).join(replaceValue);
|
|
12019
|
+
}
|
|
12020
|
+
if (searchValue.startsWith("./") && replaceValue.startsWith("./")) {
|
|
12021
|
+
const trimmedSearch = searchValue.slice(2);
|
|
12022
|
+
const trimmedReplace = replaceValue.slice(2);
|
|
12023
|
+
if (trimmedSearch && source.includes(trimmedSearch)) {
|
|
12024
|
+
return source.split(trimmedSearch).join(trimmedReplace);
|
|
12025
|
+
}
|
|
12026
|
+
}
|
|
12027
|
+
return source;
|
|
12028
|
+
}
|
|
12029
|
+
function replaceInArray(list, searchValue, replaceValue) {
|
|
12030
|
+
return list.map((value) => {
|
|
12031
|
+
return value === searchValue ? replaceValue : value;
|
|
12032
|
+
});
|
|
12033
|
+
}
|
|
12034
|
+
function createRelativeImport(fromFile, toFile) {
|
|
12035
|
+
const relative3 = _pathe.posix.relative(_pathe.posix.dirname(fromFile), toFile);
|
|
12036
|
+
if (!relative3 || relative3.startsWith(".")) {
|
|
12037
|
+
return relative3 || "./";
|
|
12038
|
+
}
|
|
12039
|
+
return `./${relative3}`;
|
|
12040
|
+
}
|
|
12041
|
+
|
|
12042
|
+
// src/runtime/advancedChunks.ts
|
|
11827
12043
|
function testByReg2DExpList(reg2DExpList) {
|
|
11828
|
-
return (id) => reg2DExpList.some((regExpList) => regExpList.some((regExp) =>
|
|
12044
|
+
return (id) => reg2DExpList.some((regExpList) => regExpList.some((regExp) => {
|
|
12045
|
+
regExp.lastIndex = 0;
|
|
12046
|
+
return regExp.test(id);
|
|
12047
|
+
}));
|
|
12048
|
+
}
|
|
12049
|
+
function createAdvancedChunkNameResolver(options) {
|
|
12050
|
+
const {
|
|
12051
|
+
relativeAbsoluteSrcRoot,
|
|
12052
|
+
getSubPackageRoots,
|
|
12053
|
+
strategy,
|
|
12054
|
+
vendorsMatchers
|
|
12055
|
+
} = options;
|
|
12056
|
+
const isVendor = testByReg2DExpList(vendorsMatchers);
|
|
12057
|
+
return (id, ctx) => {
|
|
12058
|
+
const subPackageRoots = Array.from(getSubPackageRoots());
|
|
12059
|
+
const sharedName = resolveSharedChunkName({
|
|
12060
|
+
id,
|
|
12061
|
+
ctx,
|
|
12062
|
+
relativeAbsoluteSrcRoot,
|
|
12063
|
+
subPackageRoots,
|
|
12064
|
+
strategy
|
|
12065
|
+
});
|
|
12066
|
+
if (!isVendor(id)) {
|
|
12067
|
+
return sharedName;
|
|
12068
|
+
}
|
|
12069
|
+
if (strategy === "hoist") {
|
|
12070
|
+
return "vendors";
|
|
12071
|
+
}
|
|
12072
|
+
return sharedName;
|
|
12073
|
+
};
|
|
11829
12074
|
}
|
|
12075
|
+
|
|
12076
|
+
// src/runtime/buildPlugin.ts
|
|
12077
|
+
var REG_NODE_MODULES_DIR = /[\\/]node_modules[\\/]/gi;
|
|
11830
12078
|
function createBuildService(ctx) {
|
|
11831
12079
|
function assertRuntimeServices(target) {
|
|
11832
12080
|
if (!target.configService || !target.watcherService || !target.npmService || !target.scanService) {
|
|
@@ -11840,7 +12088,7 @@ function createBuildService(ctx) {
|
|
|
11840
12088
|
function checkWorkersOptions() {
|
|
11841
12089
|
const workersDir = scanService.workersDir;
|
|
11842
12090
|
const hasWorkersDir = Boolean(workersDir);
|
|
11843
|
-
if (hasWorkersDir && _optionalChain([configService, 'access',
|
|
12091
|
+
if (hasWorkersDir && _optionalChain([configService, 'access', _236 => _236.weappViteConfig, 'optionalAccess', _237 => _237.worker, 'optionalAccess', _238 => _238.entry]) === void 0) {
|
|
11844
12092
|
logger_default.error("\u68C0\u6D4B\u5230\u5DF2\u7ECF\u5F00\u542F\u4E86 `worker`\uFF0C\u8BF7\u5728 `vite.config.ts` \u4E2D\u8BBE\u7F6E `weapp.worker.entry` \u8DEF\u5F84");
|
|
11845
12093
|
logger_default.error("\u6BD4\u5982\u5F15\u5165\u7684 `worker` \u8DEF\u5F84\u4E3A `workers/index`, \u6B64\u65F6 `weapp.worker.entry` \u8BBE\u7F6E\u4E3A `[index]` ");
|
|
11846
12094
|
throw new Error("\u8BF7\u5728 `vite.config.ts` \u4E2D\u8BBE\u7F6E `weapp.worker.entry` \u8DEF\u5F84");
|
|
@@ -11864,6 +12112,13 @@ function createBuildService(ctx) {
|
|
|
11864
12112
|
function sharedBuildConfig() {
|
|
11865
12113
|
const nodeModulesDeps = [REG_NODE_MODULES_DIR];
|
|
11866
12114
|
const commonjsHelpersDeps = [/commonjsHelpers\.js$/];
|
|
12115
|
+
const sharedStrategy = _nullishCoalesce(_optionalChain([configService, 'access', _239 => _239.weappViteConfig, 'optionalAccess', _240 => _240.chunks, 'optionalAccess', _241 => _241.sharedStrategy]), () => ( DEFAULT_SHARED_CHUNK_STRATEGY));
|
|
12116
|
+
const resolveAdvancedChunkName = createAdvancedChunkNameResolver({
|
|
12117
|
+
vendorsMatchers: [nodeModulesDeps, commonjsHelpersDeps],
|
|
12118
|
+
relativeAbsoluteSrcRoot: configService.relativeAbsoluteSrcRoot,
|
|
12119
|
+
getSubPackageRoots: () => scanService.subPackageMap.keys(),
|
|
12120
|
+
strategy: sharedStrategy
|
|
12121
|
+
});
|
|
11867
12122
|
return {
|
|
11868
12123
|
build: {
|
|
11869
12124
|
rolldownOptions: {
|
|
@@ -11871,28 +12126,7 @@ function createBuildService(ctx) {
|
|
|
11871
12126
|
advancedChunks: {
|
|
11872
12127
|
groups: [
|
|
11873
12128
|
{
|
|
11874
|
-
name: (id, ctxPlugin) =>
|
|
11875
|
-
REG_NODE_MODULES_DIR.lastIndex = 0;
|
|
11876
|
-
if (testByReg2DExpList([nodeModulesDeps, commonjsHelpersDeps])(id)) {
|
|
11877
|
-
return "vendors";
|
|
11878
|
-
}
|
|
11879
|
-
const moduleInfo = ctxPlugin.getModuleInfo(id);
|
|
11880
|
-
if (_optionalChain([moduleInfo, 'optionalAccess', _236 => _236.importers, 'optionalAccess', _237 => _237.length]) && moduleInfo.importers.length > 1) {
|
|
11881
|
-
const summary = moduleInfo.importers.reduce((acc, cur) => {
|
|
11882
|
-
const relPath = configService.relativeAbsoluteSrcRoot(cur);
|
|
11883
|
-
const prefix2 = _nullishCoalesce([
|
|
11884
|
-
...scanService.subPackageMap.keys()
|
|
11885
|
-
].find(
|
|
11886
|
-
(x) => relPath.startsWith(x)
|
|
11887
|
-
), () => ( ""));
|
|
11888
|
-
acc[prefix2] = (acc[prefix2] || 0) + 1;
|
|
11889
|
-
return acc;
|
|
11890
|
-
}, {});
|
|
11891
|
-
const summaryKeys = Object.keys(summary);
|
|
11892
|
-
const prefix = summaryKeys.length === 1 ? summaryKeys[0] : "";
|
|
11893
|
-
return _pathe2.default.join(prefix, "common");
|
|
11894
|
-
}
|
|
11895
|
-
}
|
|
12129
|
+
name: (id, ctxPlugin) => resolveAdvancedChunkName(id, ctxPlugin)
|
|
11896
12130
|
}
|
|
11897
12131
|
]
|
|
11898
12132
|
},
|
|
@@ -11906,7 +12140,7 @@ function createBuildService(ctx) {
|
|
|
11906
12140
|
if (_process2.default.env.NODE_ENV === void 0) {
|
|
11907
12141
|
_process2.default.env.NODE_ENV = "development";
|
|
11908
12142
|
}
|
|
11909
|
-
_optionalChain([debug, 'optionalCall',
|
|
12143
|
+
_optionalChain([debug, 'optionalCall', _242 => _242("dev build watcher start")]);
|
|
11910
12144
|
const buildOptions = configService.merge(void 0, sharedBuildConfig());
|
|
11911
12145
|
const watcher = await _vite.build.call(void 0,
|
|
11912
12146
|
buildOptions
|
|
@@ -11935,8 +12169,8 @@ function createBuildService(ctx) {
|
|
|
11935
12169
|
});
|
|
11936
12170
|
}
|
|
11937
12171
|
}
|
|
11938
|
-
_optionalChain([debug, 'optionalCall',
|
|
11939
|
-
_optionalChain([debug, 'optionalCall',
|
|
12172
|
+
_optionalChain([debug, 'optionalCall', _243 => _243("dev build watcher end")]);
|
|
12173
|
+
_optionalChain([debug, 'optionalCall', _244 => _244("dev watcher listen start")]);
|
|
11940
12174
|
let startTime;
|
|
11941
12175
|
let resolveWatcher;
|
|
11942
12176
|
let rejectWatcher;
|
|
@@ -11959,7 +12193,7 @@ function createBuildService(ctx) {
|
|
|
11959
12193
|
return watcher;
|
|
11960
12194
|
}
|
|
11961
12195
|
async function runProd() {
|
|
11962
|
-
_optionalChain([debug, 'optionalCall',
|
|
12196
|
+
_optionalChain([debug, 'optionalCall', _245 => _245("prod build start")]);
|
|
11963
12197
|
const output = await _vite.build.call(void 0,
|
|
11964
12198
|
configService.merge(void 0, sharedBuildConfig())
|
|
11965
12199
|
);
|
|
@@ -11967,7 +12201,7 @@ function createBuildService(ctx) {
|
|
|
11967
12201
|
if (hasWorkersDir) {
|
|
11968
12202
|
await buildWorkers();
|
|
11969
12203
|
}
|
|
11970
|
-
_optionalChain([debug, 'optionalCall',
|
|
12204
|
+
_optionalChain([debug, 'optionalCall', _246 => _246("prod build end")]);
|
|
11971
12205
|
return output;
|
|
11972
12206
|
}
|
|
11973
12207
|
async function buildEntry(options) {
|
|
@@ -11987,12 +12221,12 @@ function createBuildService(ctx) {
|
|
|
11987
12221
|
}
|
|
11988
12222
|
}
|
|
11989
12223
|
);
|
|
11990
|
-
_optionalChain([debug, 'optionalCall',
|
|
12224
|
+
_optionalChain([debug, 'optionalCall', _247 => _247("deletedFilePaths", deletedFilePaths)]);
|
|
11991
12225
|
logger_default.success(`\u5DF2\u6E05\u7A7A ${configService.mpDistRoot} \u76EE\u5F55`);
|
|
11992
12226
|
}
|
|
11993
|
-
_optionalChain([debug, 'optionalCall',
|
|
12227
|
+
_optionalChain([debug, 'optionalCall', _248 => _248("build start")]);
|
|
11994
12228
|
let npmBuildTask = Promise.resolve();
|
|
11995
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
12229
|
+
if (!_optionalChain([options, 'optionalAccess', _249 => _249.skipNpm])) {
|
|
11996
12230
|
let shouldBuildNpm = true;
|
|
11997
12231
|
if (configService.isDev) {
|
|
11998
12232
|
const isDependenciesOutdated = await npmService.checkDependenciesCacheOutdate();
|
|
@@ -12019,7 +12253,7 @@ function createBuildService(ctx) {
|
|
|
12019
12253
|
result = await runProd();
|
|
12020
12254
|
}
|
|
12021
12255
|
await npmBuildTask;
|
|
12022
|
-
_optionalChain([debug, 'optionalCall',
|
|
12256
|
+
_optionalChain([debug, 'optionalCall', _250 => _250("build end")]);
|
|
12023
12257
|
return result;
|
|
12024
12258
|
}
|
|
12025
12259
|
return {
|
|
@@ -17686,17 +17920,17 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
|
|
|
17686
17920
|
if (hasTrailingSlash(input, true)) {
|
|
17687
17921
|
return input || "/";
|
|
17688
17922
|
}
|
|
17689
|
-
let
|
|
17923
|
+
let path31 = input;
|
|
17690
17924
|
let fragment = "";
|
|
17691
17925
|
const fragmentIndex = input.indexOf("#");
|
|
17692
17926
|
if (fragmentIndex !== -1) {
|
|
17693
|
-
|
|
17927
|
+
path31 = input.slice(0, fragmentIndex);
|
|
17694
17928
|
fragment = input.slice(fragmentIndex);
|
|
17695
|
-
if (!
|
|
17929
|
+
if (!path31) {
|
|
17696
17930
|
return fragment;
|
|
17697
17931
|
}
|
|
17698
17932
|
}
|
|
17699
|
-
const [s0, ...s] =
|
|
17933
|
+
const [s0, ...s] = path31.split("?");
|
|
17700
17934
|
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
17701
17935
|
}
|
|
17702
17936
|
function isNonEmptyURL(url) {
|
|
@@ -17725,8 +17959,8 @@ var _assert = require('assert'); var _assert2 = _interopRequireDefault(_assert);
|
|
|
17725
17959
|
var _v8 = require('v8'); var _v82 = _interopRequireDefault(_v8);
|
|
17726
17960
|
|
|
17727
17961
|
var BUILTIN_MODULES = new Set(_module.builtinModules);
|
|
17728
|
-
function normalizeSlash(
|
|
17729
|
-
return
|
|
17962
|
+
function normalizeSlash(path31) {
|
|
17963
|
+
return path31.replace(/\\/g, "/");
|
|
17730
17964
|
}
|
|
17731
17965
|
var own$1 = {}.hasOwnProperty;
|
|
17732
17966
|
var classRegExp = /^([A-Z][a-z\d]*)+$/;
|
|
@@ -17839,8 +18073,8 @@ codes2.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
17839
18073
|
* @param {string} [base]
|
|
17840
18074
|
* @param {string} [message]
|
|
17841
18075
|
*/
|
|
17842
|
-
(
|
|
17843
|
-
return `Invalid package config ${
|
|
18076
|
+
(path31, base, message) => {
|
|
18077
|
+
return `Invalid package config ${path31}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
17844
18078
|
},
|
|
17845
18079
|
Error
|
|
17846
18080
|
);
|
|
@@ -17872,8 +18106,8 @@ codes2.ERR_MODULE_NOT_FOUND = createError(
|
|
|
17872
18106
|
* @param {string} base
|
|
17873
18107
|
* @param {boolean} [exactUrl]
|
|
17874
18108
|
*/
|
|
17875
|
-
(
|
|
17876
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${
|
|
18109
|
+
(path31, base, exactUrl = false) => {
|
|
18110
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path31}' imported from ${base}`;
|
|
17877
18111
|
},
|
|
17878
18112
|
Error
|
|
17879
18113
|
);
|
|
@@ -17924,8 +18158,8 @@ codes2.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
17924
18158
|
* @param {string} extension
|
|
17925
18159
|
* @param {string} path
|
|
17926
18160
|
*/
|
|
17927
|
-
(extension,
|
|
17928
|
-
return `Unknown file extension "${extension}" for ${
|
|
18161
|
+
(extension, path31) => {
|
|
18162
|
+
return `Unknown file extension "${extension}" for ${path31}`;
|
|
17929
18163
|
},
|
|
17930
18164
|
TypeError
|
|
17931
18165
|
);
|
|
@@ -18296,9 +18530,9 @@ Default "index" lookups for the main are deprecated for ES modules.`,
|
|
|
18296
18530
|
);
|
|
18297
18531
|
}
|
|
18298
18532
|
}
|
|
18299
|
-
function tryStatSync(
|
|
18533
|
+
function tryStatSync(path31) {
|
|
18300
18534
|
try {
|
|
18301
|
-
return _fs.statSync.call(void 0,
|
|
18535
|
+
return _fs.statSync.call(void 0, path31);
|
|
18302
18536
|
} catch (e13) {
|
|
18303
18537
|
}
|
|
18304
18538
|
}
|
|
@@ -18971,7 +19205,7 @@ function _tryModuleResolve(id, url, conditions) {
|
|
|
18971
19205
|
try {
|
|
18972
19206
|
return moduleResolve(id, url, conditions);
|
|
18973
19207
|
} catch (error) {
|
|
18974
|
-
if (!NOT_FOUND_ERRORS.has(_optionalChain([error, 'optionalAccess',
|
|
19208
|
+
if (!NOT_FOUND_ERRORS.has(_optionalChain([error, 'optionalAccess', _251 => _251.code]))) {
|
|
18975
19209
|
throw error;
|
|
18976
19210
|
}
|
|
18977
19211
|
}
|
|
@@ -19000,7 +19234,7 @@ function _resolve(id, options = {}) {
|
|
|
19000
19234
|
return pathToFileURL(id);
|
|
19001
19235
|
}
|
|
19002
19236
|
} catch (error) {
|
|
19003
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
19237
|
+
if (_optionalChain([error, 'optionalAccess', _252 => _252.code]) !== "ENOENT") {
|
|
19004
19238
|
throw error;
|
|
19005
19239
|
}
|
|
19006
19240
|
}
|
|
@@ -19144,10 +19378,10 @@ function fromGeneratorFn(generatorFn, options) {
|
|
|
19144
19378
|
return fromObject({
|
|
19145
19379
|
name: generatorFn.name,
|
|
19146
19380
|
async(...args) {
|
|
19147
|
-
return iterateAsync(generatorFn.apply(this, args), _optionalChain([options, 'optionalAccess',
|
|
19381
|
+
return iterateAsync(generatorFn.apply(this, args), _optionalChain([options, 'optionalAccess', _253 => _253.onYield]));
|
|
19148
19382
|
},
|
|
19149
19383
|
sync(...args) {
|
|
19150
|
-
return iterateSync2(generatorFn.apply(this, args), _optionalChain([options, 'optionalAccess',
|
|
19384
|
+
return iterateSync2(generatorFn.apply(this, args), _optionalChain([options, 'optionalAccess', _254 => _254.onYield]));
|
|
19151
19385
|
}
|
|
19152
19386
|
});
|
|
19153
19387
|
}
|
|
@@ -19206,7 +19440,7 @@ function findUpSync(name, {
|
|
|
19206
19440
|
const filePath = isAbsoluteName ? name : sysPath2.default.join(directory, name);
|
|
19207
19441
|
try {
|
|
19208
19442
|
const stats = actualFS.default.statSync(filePath, { throwIfNoEntry: false });
|
|
19209
|
-
if (type === "file" && _optionalChain([stats, 'optionalAccess',
|
|
19443
|
+
if (type === "file" && _optionalChain([stats, 'optionalAccess', _255 => _255.isFile, 'call', _256 => _256()]) || type === "directory" && _optionalChain([stats, 'optionalAccess', _257 => _257.isDirectory, 'call', _258 => _258()])) {
|
|
19210
19444
|
return filePath;
|
|
19211
19445
|
}
|
|
19212
19446
|
} catch (e16) {
|
|
@@ -19217,7 +19451,7 @@ function findUpSync(name, {
|
|
|
19217
19451
|
directory = sysPath2.default.dirname(directory);
|
|
19218
19452
|
}
|
|
19219
19453
|
}
|
|
19220
|
-
function _resolve2(
|
|
19454
|
+
function _resolve2(path31, options = {}) {
|
|
19221
19455
|
if (options.platform === "auto" || !options.platform)
|
|
19222
19456
|
options.platform = _process2.default.platform === "win32" ? "win32" : "posix";
|
|
19223
19457
|
if (_process2.default.versions.pnp) {
|
|
@@ -19226,11 +19460,11 @@ function _resolve2(path30, options = {}) {
|
|
|
19226
19460
|
paths.push(_process2.default.cwd());
|
|
19227
19461
|
const targetRequire = _module.createRequire.call(void 0, _chunkOS76JPG2cjs.importMetaUrl);
|
|
19228
19462
|
try {
|
|
19229
|
-
return targetRequire.resolve(
|
|
19463
|
+
return targetRequire.resolve(path31, { paths });
|
|
19230
19464
|
} catch (e17) {
|
|
19231
19465
|
}
|
|
19232
19466
|
}
|
|
19233
|
-
const modulePath = resolvePathSync(
|
|
19467
|
+
const modulePath = resolvePathSync(path31, {
|
|
19234
19468
|
url: options.paths
|
|
19235
19469
|
});
|
|
19236
19470
|
if (options.platform === "win32")
|
|
@@ -19301,10 +19535,10 @@ var findUp = quansync2({
|
|
|
19301
19535
|
async: findUp$1
|
|
19302
19536
|
});
|
|
19303
19537
|
var loadPackageJSON = quansync2(function* (cwd = _process2.default.cwd()) {
|
|
19304
|
-
const
|
|
19305
|
-
if (!
|
|
19538
|
+
const path31 = yield findUp("package.json", { cwd });
|
|
19539
|
+
if (!path31 || !actualFS.default.existsSync(path31))
|
|
19306
19540
|
return null;
|
|
19307
|
-
return JSON.parse(yield readFile(
|
|
19541
|
+
return JSON.parse(yield readFile(path31));
|
|
19308
19542
|
});
|
|
19309
19543
|
var loadPackageJSONSync = loadPackageJSON.sync;
|
|
19310
19544
|
var isPackageListed = quansync2(function* (name, cwd) {
|
|
@@ -19313,13 +19547,13 @@ var isPackageListed = quansync2(function* (name, cwd) {
|
|
|
19313
19547
|
});
|
|
19314
19548
|
var isPackageListedSync = isPackageListed.sync;
|
|
19315
19549
|
|
|
19316
|
-
// ../../node_modules/.pnpm/package-manager-detector@1.
|
|
19550
|
+
// ../../node_modules/.pnpm/package-manager-detector@1.5.0/node_modules/package-manager-detector/dist/detect.mjs
|
|
19317
19551
|
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
19318
19552
|
|
|
19319
19553
|
|
|
19320
19554
|
|
|
19321
19555
|
|
|
19322
|
-
// ../../node_modules/.pnpm/package-manager-detector@1.
|
|
19556
|
+
// ../../node_modules/.pnpm/package-manager-detector@1.5.0/node_modules/package-manager-detector/dist/constants.mjs
|
|
19323
19557
|
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
19324
19558
|
var AGENTS = [
|
|
19325
19559
|
"npm",
|
|
@@ -19356,7 +19590,7 @@ var INSTALL_METADATA = {
|
|
|
19356
19590
|
"bun.lockb": "bun"
|
|
19357
19591
|
};
|
|
19358
19592
|
|
|
19359
|
-
// ../../node_modules/.pnpm/package-manager-detector@1.
|
|
19593
|
+
// ../../node_modules/.pnpm/package-manager-detector@1.5.0/node_modules/package-manager-detector/dist/detect.mjs
|
|
19360
19594
|
async function pathExists(path210, type) {
|
|
19361
19595
|
try {
|
|
19362
19596
|
const stat6 = await _promises2.default.stat(path210);
|
|
@@ -19425,18 +19659,18 @@ async function detect(options = {}) {
|
|
|
19425
19659
|
}
|
|
19426
19660
|
}
|
|
19427
19661
|
}
|
|
19428
|
-
if (_optionalChain([stopDir, 'optionalCall',
|
|
19662
|
+
if (_optionalChain([stopDir, 'optionalCall', _259 => _259(directory)]))
|
|
19429
19663
|
break;
|
|
19430
19664
|
}
|
|
19431
19665
|
return null;
|
|
19432
19666
|
}
|
|
19433
19667
|
function getNameAndVer(pkg) {
|
|
19434
|
-
const handelVer = (version3) => _nullishCoalesce(_optionalChain([version3, 'optionalAccess',
|
|
19668
|
+
const handelVer = (version3) => _nullishCoalesce(_optionalChain([version3, 'optionalAccess', _260 => _260.match, 'call', _261 => _261(/\d+(\.\d+){0,2}/), 'optionalAccess', _262 => _262[0]]), () => ( version3));
|
|
19435
19669
|
if (typeof pkg.packageManager === "string") {
|
|
19436
19670
|
const [name, ver] = pkg.packageManager.replace(/^\^/, "").split("@");
|
|
19437
19671
|
return { name, ver: handelVer(ver) };
|
|
19438
19672
|
}
|
|
19439
|
-
if (typeof _optionalChain([pkg, 'access',
|
|
19673
|
+
if (typeof _optionalChain([pkg, 'access', _263 => _263.devEngines, 'optionalAccess', _264 => _264.packageManager, 'optionalAccess', _265 => _265.name]) === "string") {
|
|
19440
19674
|
return {
|
|
19441
19675
|
name: pkg.devEngines.packageManager.name,
|
|
19442
19676
|
ver: handelVer(pkg.devEngines.packageManager.version)
|
|
@@ -19464,7 +19698,7 @@ async function handlePackageManager(filepath, onUnknown) {
|
|
|
19464
19698
|
agent = name;
|
|
19465
19699
|
return { name, agent, version: version3 };
|
|
19466
19700
|
} else {
|
|
19467
|
-
return _nullishCoalesce(_optionalChain([onUnknown, 'optionalCall',
|
|
19701
|
+
return _nullishCoalesce(_optionalChain([onUnknown, 'optionalCall', _266 => _266(pkg.packageManager)]), () => ( null));
|
|
19468
19702
|
}
|
|
19469
19703
|
}
|
|
19470
19704
|
} catch (e21) {
|
|
@@ -19511,6 +19745,9 @@ function getWeappViteConfig() {
|
|
|
19511
19745
|
npm: {
|
|
19512
19746
|
enable: true,
|
|
19513
19747
|
cache: true
|
|
19748
|
+
},
|
|
19749
|
+
chunks: {
|
|
19750
|
+
sharedStrategy: "duplicate"
|
|
19514
19751
|
}
|
|
19515
19752
|
};
|
|
19516
19753
|
}
|
|
@@ -19566,7 +19803,7 @@ function createAssetCollector(state) {
|
|
|
19566
19803
|
},
|
|
19567
19804
|
async buildEnd() {
|
|
19568
19805
|
const assets = await state.pendingAssets;
|
|
19569
|
-
if (!_optionalChain([assets, 'optionalAccess',
|
|
19806
|
+
if (!_optionalChain([assets, 'optionalAccess', _267 => _267.length])) {
|
|
19570
19807
|
return;
|
|
19571
19808
|
}
|
|
19572
19809
|
for (const candidate of assets) {
|
|
@@ -19581,9 +19818,9 @@ function createAssetCollector(state) {
|
|
|
19581
19818
|
}
|
|
19582
19819
|
function scanAssetFiles(configService, config) {
|
|
19583
19820
|
const weappViteConfig = configService.weappViteConfig;
|
|
19584
|
-
const include = normalizeCopyGlobs(_optionalChain([weappViteConfig, 'optionalAccess',
|
|
19585
|
-
const exclude = normalizeCopyGlobs(_optionalChain([weappViteConfig, 'optionalAccess',
|
|
19586
|
-
const filter3 = _nullishCoalesce(_optionalChain([weappViteConfig, 'optionalAccess',
|
|
19821
|
+
const include = normalizeCopyGlobs(_optionalChain([weappViteConfig, 'optionalAccess', _268 => _268.copy, 'optionalAccess', _269 => _269.include]));
|
|
19822
|
+
const exclude = normalizeCopyGlobs(_optionalChain([weappViteConfig, 'optionalAccess', _270 => _270.copy, 'optionalAccess', _271 => _271.exclude]));
|
|
19823
|
+
const filter3 = _nullishCoalesce(_optionalChain([weappViteConfig, 'optionalAccess', _272 => _272.copy, 'optionalAccess', _273 => _273.filter]), () => ( (() => true)));
|
|
19587
19824
|
const ignore = [
|
|
19588
19825
|
...defaultExcluded,
|
|
19589
19826
|
_pathe2.default.resolve(configService.cwd, `${config.build.outDir}/**/*`),
|
|
@@ -19699,13 +19936,13 @@ function createAutoImportPlugin(state) {
|
|
|
19699
19936
|
return;
|
|
19700
19937
|
}
|
|
19701
19938
|
const weappConfig = configService.weappViteConfig;
|
|
19702
|
-
const globs = _nullishCoalesce(_optionalChain([weappConfig, 'optionalAccess',
|
|
19703
|
-
const globsKey = _nullishCoalesce(_optionalChain([globs, 'optionalAccess',
|
|
19939
|
+
const globs = _nullishCoalesce(_optionalChain([weappConfig, 'optionalAccess', _274 => _274.autoImportComponents, 'optionalAccess', _275 => _275.globs]), () => ( _optionalChain([weappConfig, 'optionalAccess', _276 => _276.enhance, 'optionalAccess', _277 => _277.autoImportComponents, 'optionalAccess', _278 => _278.globs])));
|
|
19940
|
+
const globsKey = _nullishCoalesce(_optionalChain([globs, 'optionalAccess', _279 => _279.join, 'call', _280 => _280("\0")]), () => ( ""));
|
|
19704
19941
|
if (globsKey !== state.lastGlobsKey) {
|
|
19705
19942
|
state.initialScanDone = false;
|
|
19706
19943
|
state.lastGlobsKey = globsKey;
|
|
19707
19944
|
}
|
|
19708
|
-
if (!_optionalChain([globs, 'optionalAccess',
|
|
19945
|
+
if (!_optionalChain([globs, 'optionalAccess', _281 => _281.length])) {
|
|
19709
19946
|
return;
|
|
19710
19947
|
}
|
|
19711
19948
|
if (state.initialScanDone) {
|
|
@@ -19802,7 +20039,7 @@ function createAutoRoutesPlugin(ctx) {
|
|
|
19802
20039
|
if (!service.isRouteFile(context.file)) {
|
|
19803
20040
|
return;
|
|
19804
20041
|
}
|
|
19805
|
-
if (_optionalChain([resolvedConfig, 'optionalAccess',
|
|
20042
|
+
if (_optionalChain([resolvedConfig, 'optionalAccess', _282 => _282.command]) === "serve") {
|
|
19806
20043
|
await service.ensureFresh();
|
|
19807
20044
|
}
|
|
19808
20045
|
const virtualModule = context.server.moduleGraph.getModuleById(RESOLVED_VIRTUAL_ID);
|
|
@@ -21034,7 +21271,7 @@ function createCacheKey(options) {
|
|
|
21034
21271
|
return `${options.removeComment ? 1 : 0}|${options.transformEvent ? 1 : 0}`;
|
|
21035
21272
|
}
|
|
21036
21273
|
function getCachedResult(data2, cacheKey) {
|
|
21037
|
-
return _optionalChain([handleCache, 'access',
|
|
21274
|
+
return _optionalChain([handleCache, 'access', _283 => _283.get, 'call', _284 => _284(data2), 'optionalAccess', _285 => _285.get, 'call', _286 => _286(cacheKey)]);
|
|
21038
21275
|
}
|
|
21039
21276
|
function setCachedResult(data2, cacheKey, result) {
|
|
21040
21277
|
let cacheForToken = handleCache.get(data2);
|
|
@@ -21110,7 +21347,7 @@ function handleWxml(data2, options) {
|
|
|
21110
21347
|
if (shouldTransformInlineWxs) {
|
|
21111
21348
|
for (const { end, start, value } of inlineWxsTokens) {
|
|
21112
21349
|
const { result } = getCachedInlineWxsTransform(value);
|
|
21113
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
21350
|
+
if (_optionalChain([result, 'optionalAccess', _287 => _287.code])) {
|
|
21114
21351
|
ms.update(start, end, `
|
|
21115
21352
|
${result.code}`);
|
|
21116
21353
|
}
|
|
@@ -21190,7 +21427,7 @@ function createChunkEmitter(configService, loadedEntrySet, debug4) {
|
|
|
21190
21427
|
// @ts-ignore
|
|
21191
21428
|
preserveSignature: "exports-only"
|
|
21192
21429
|
});
|
|
21193
|
-
_optionalChain([debug4, 'optionalCall',
|
|
21430
|
+
_optionalChain([debug4, 'optionalCall', _288 => _288(`load ${fileName} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
|
|
21194
21431
|
});
|
|
21195
21432
|
};
|
|
21196
21433
|
}
|
|
@@ -21427,7 +21664,7 @@ function createEntryLoader(options) {
|
|
|
21427
21664
|
normalizedEntries,
|
|
21428
21665
|
configService.absoluteSrcRoot
|
|
21429
21666
|
);
|
|
21430
|
-
_optionalChain([debug4, 'optionalCall',
|
|
21667
|
+
_optionalChain([debug4, 'optionalCall', _289 => _289(`resolvedIds ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
|
|
21431
21668
|
const pendingResolvedIds = [];
|
|
21432
21669
|
for (const { entry, resolvedId } of resolvedIds) {
|
|
21433
21670
|
if (!resolvedId) {
|
|
@@ -21442,7 +21679,7 @@ function createEntryLoader(options) {
|
|
|
21442
21679
|
if (pendingResolvedIds.length) {
|
|
21443
21680
|
await Promise.all(emitEntriesChunks.call(this, pendingResolvedIds));
|
|
21444
21681
|
}
|
|
21445
|
-
_optionalChain([debug4, 'optionalCall',
|
|
21682
|
+
_optionalChain([debug4, 'optionalCall', _290 => _290(`emitEntriesChunks ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
|
|
21446
21683
|
registerJsonAsset({
|
|
21447
21684
|
jsonPath,
|
|
21448
21685
|
json,
|
|
@@ -21450,7 +21687,7 @@ function createEntryLoader(options) {
|
|
|
21450
21687
|
});
|
|
21451
21688
|
const code = await _fsextra2.default.readFile(id, "utf8");
|
|
21452
21689
|
const styleImports = await collectStyleImports(this, id, existsCache);
|
|
21453
|
-
_optionalChain([debug4, 'optionalCall',
|
|
21690
|
+
_optionalChain([debug4, 'optionalCall', _291 => _291(`loadEntry ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
|
|
21454
21691
|
if (styleImports.length === 0) {
|
|
21455
21692
|
return {
|
|
21456
21693
|
code
|
|
@@ -21521,7 +21758,7 @@ function createTemplateScanner(wxmlService, debug4) {
|
|
|
21521
21758
|
const { components: components2 } = wxmlToken;
|
|
21522
21759
|
wxmlService.setWxmlComponentsMap(templateEntry, components2);
|
|
21523
21760
|
}
|
|
21524
|
-
_optionalChain([debug4, 'optionalCall',
|
|
21761
|
+
_optionalChain([debug4, 'optionalCall', _292 => _292(`scanTemplateEntry ${templateEntry} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
|
|
21525
21762
|
};
|
|
21526
21763
|
}
|
|
21527
21764
|
|
|
@@ -21666,7 +21903,7 @@ function ensureSidecarWatcher(ctx, rootDir) {
|
|
|
21666
21903
|
};
|
|
21667
21904
|
const warnWatchLimit = (error, action) => {
|
|
21668
21905
|
const relativeRoot = ctx.configService.relativeCwd(absRoot);
|
|
21669
|
-
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
21906
|
+
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _293 => _293.code]), () => ( "UNKNOWN"));
|
|
21670
21907
|
const message = action === "fallback" ? `[watch] ${relativeRoot} \u76D1\u542C\u6570\u91CF\u8FBE\u5230\u4E0A\u9650 (${code})\uFF0C\u6B63\u5728\u56DE\u9000\u5230 chokidar watcher` : `[watch] ${relativeRoot} \u76D1\u542C\u6570\u91CF\u8FBE\u5230\u4E0A\u9650 (${code})\uFF0C\u5DF2\u505C\u7528\u4FA7\u8F66\u6587\u4EF6\u76D1\u542C`;
|
|
21671
21908
|
logger_default.warn(message);
|
|
21672
21909
|
};
|
|
@@ -21686,7 +21923,7 @@ function ensureSidecarWatcher(ctx, rootDir) {
|
|
|
21686
21923
|
}
|
|
21687
21924
|
handledWatchLimit = true;
|
|
21688
21925
|
try {
|
|
21689
|
-
_optionalChain([watcher, 'optionalAccess',
|
|
21926
|
+
_optionalChain([watcher, 'optionalAccess', _294 => _294.close, 'call', _295 => _295()]);
|
|
21690
21927
|
} catch (e24) {
|
|
21691
21928
|
}
|
|
21692
21929
|
if (supportsRecursiveWatch) {
|
|
@@ -21703,7 +21940,7 @@ function ensureSidecarWatcher(ctx, rootDir) {
|
|
|
21703
21940
|
}
|
|
21704
21941
|
});
|
|
21705
21942
|
sidecarWatcherMap.set(absRoot, {
|
|
21706
|
-
close: () => _optionalChain([watcher, 'optionalAccess',
|
|
21943
|
+
close: () => _optionalChain([watcher, 'optionalAccess', _296 => _296.close, 'call', _297 => _297()])
|
|
21707
21944
|
});
|
|
21708
21945
|
return;
|
|
21709
21946
|
} catch (error) {
|
|
@@ -21865,7 +22102,7 @@ function createCoreLifecyclePlugin(state) {
|
|
|
21865
22102
|
options.input = scannedInput;
|
|
21866
22103
|
},
|
|
21867
22104
|
async load(id) {
|
|
21868
|
-
_optionalChain([configService, 'access',
|
|
22105
|
+
_optionalChain([configService, 'access', _298 => _298.weappViteConfig, 'optionalAccess', _299 => _299.debug, 'optionalAccess', _300 => _300.load, 'optionalCall', _301 => _301(id, subPackageMeta)]);
|
|
21869
22106
|
const relativeBasename = _shared.removeExtensionDeep.call(void 0, configService.relativeAbsoluteSrcRoot(id));
|
|
21870
22107
|
if (isCSSRequest(id)) {
|
|
21871
22108
|
const parsed = parseRequest(id);
|
|
@@ -21879,7 +22116,7 @@ function createCoreLifecyclePlugin(state) {
|
|
|
21879
22116
|
}
|
|
21880
22117
|
return null;
|
|
21881
22118
|
}
|
|
21882
|
-
if (loadedEntrySet.has(id) || _optionalChain([subPackageMeta, 'optionalAccess',
|
|
22119
|
+
if (loadedEntrySet.has(id) || _optionalChain([subPackageMeta, 'optionalAccess', _302 => _302.entries, 'access', _303 => _303.includes, 'call', _304 => _304(relativeBasename)])) {
|
|
21883
22120
|
return await loadEntry.call(this, id, "component");
|
|
21884
22121
|
}
|
|
21885
22122
|
if (relativeBasename === "app") {
|
|
@@ -21890,12 +22127,19 @@ function createCoreLifecyclePlugin(state) {
|
|
|
21890
22127
|
emitJsonAssets.call(this, state);
|
|
21891
22128
|
state.watchFilesSnapshot = emitWxmlAssets.call(this, state);
|
|
21892
22129
|
},
|
|
21893
|
-
async generateBundle() {
|
|
22130
|
+
async generateBundle(_options, bundle) {
|
|
21894
22131
|
await flushIndependentBuilds.call(this, state, watcherService);
|
|
21895
|
-
if (
|
|
22132
|
+
if (!subPackageMeta) {
|
|
22133
|
+
const sharedStrategy = _nullishCoalesce(_optionalChain([configService, 'access', _305 => _305.weappViteConfig, 'optionalAccess', _306 => _306.chunks, 'optionalAccess', _307 => _307.sharedStrategy]), () => ( DEFAULT_SHARED_CHUNK_STRATEGY));
|
|
22134
|
+
applySharedChunkStrategy.call(this, bundle, {
|
|
22135
|
+
strategy: sharedStrategy,
|
|
22136
|
+
subPackageRoots: scanService.subPackageMap.keys()
|
|
22137
|
+
});
|
|
22138
|
+
}
|
|
22139
|
+
if (_optionalChain([configService, 'access', _308 => _308.weappViteConfig, 'optionalAccess', _309 => _309.debug, 'optionalAccess', _310 => _310.watchFiles])) {
|
|
21896
22140
|
const watcherService2 = ctx.watcherService;
|
|
21897
|
-
const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess',
|
|
21898
|
-
const watcher = _optionalChain([watcherService2, 'optionalAccess',
|
|
22141
|
+
const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess', _311 => _311.subPackage, 'access', _312 => _312.root]), () => ( "/"));
|
|
22142
|
+
const watcher = _optionalChain([watcherService2, 'optionalAccess', _313 => _313.getRollupWatcher, 'call', _314 => _314(watcherRoot)]);
|
|
21899
22143
|
let watchFiles;
|
|
21900
22144
|
if (watcher && typeof watcher.getWatchFiles === "function") {
|
|
21901
22145
|
watchFiles = await watcher.getWatchFiles();
|
|
@@ -21909,7 +22153,7 @@ function createCoreLifecyclePlugin(state) {
|
|
|
21909
22153
|
}
|
|
21910
22154
|
},
|
|
21911
22155
|
buildEnd() {
|
|
21912
|
-
_optionalChain([debug2, 'optionalCall',
|
|
22156
|
+
_optionalChain([debug2, 'optionalCall', _315 => _315(`${subPackageMeta ? `\u72EC\u7ACB\u5206\u5305 ${subPackageMeta.subPackage.root}` : "\u4E3B\u5305"} ${Array.from(this.getModuleIds()).length} \u4E2A\u6A21\u5757\u88AB\u7F16\u8BD1`)]);
|
|
21913
22157
|
}
|
|
21914
22158
|
};
|
|
21915
22159
|
}
|
|
@@ -22265,14 +22509,14 @@ function createPluginPruner() {
|
|
|
22265
22509
|
name: "weapp-vite:preflight",
|
|
22266
22510
|
enforce: "pre",
|
|
22267
22511
|
configResolved(config) {
|
|
22268
|
-
if (!_optionalChain([config, 'access',
|
|
22512
|
+
if (!_optionalChain([config, 'access', _316 => _316.plugins, 'optionalAccess', _317 => _317.length])) {
|
|
22269
22513
|
return;
|
|
22270
22514
|
}
|
|
22271
22515
|
for (const removePlugin of removePlugins) {
|
|
22272
22516
|
const idx = config.plugins.findIndex((plugin) => plugin.name === removePlugin);
|
|
22273
22517
|
if (idx > -1) {
|
|
22274
22518
|
const [plugin] = config.plugins.splice(idx, 1);
|
|
22275
|
-
plugin && _optionalChain([debug3, 'optionalCall',
|
|
22519
|
+
plugin && _optionalChain([debug3, 'optionalCall', _318 => _318("remove plugin", plugin.name)]);
|
|
22276
22520
|
}
|
|
22277
22521
|
}
|
|
22278
22522
|
}
|
|
@@ -22311,8 +22555,8 @@ function createWorkerBuildPlugin(ctx) {
|
|
|
22311
22555
|
name: "weapp-vite:workers",
|
|
22312
22556
|
enforce: "pre",
|
|
22313
22557
|
async options(options) {
|
|
22314
|
-
const workerConfig = _optionalChain([configService, 'access',
|
|
22315
|
-
const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess',
|
|
22558
|
+
const workerConfig = _optionalChain([configService, 'access', _319 => _319.weappViteConfig, 'optionalAccess', _320 => _320.worker]);
|
|
22559
|
+
const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess', _321 => _321.entry])) ? workerConfig.entry : [_optionalChain([workerConfig, 'optionalAccess', _322 => _322.entry])];
|
|
22316
22560
|
const normalized = (await Promise.all(entries.filter(Boolean).map((entry) => resolveWorkerEntry(ctx, entry)))).filter((result) => Boolean(result.value)).reduce((acc, cur) => {
|
|
22317
22561
|
acc[cur.key] = cur.value;
|
|
22318
22562
|
return acc;
|
|
@@ -22429,7 +22673,7 @@ async function transformWxsFile(state, wxsPath) {
|
|
|
22429
22673
|
const { result, importees } = transformWxsCode(rawCode, {
|
|
22430
22674
|
filename: wxsPath
|
|
22431
22675
|
});
|
|
22432
|
-
if (typeof _optionalChain([result, 'optionalAccess',
|
|
22676
|
+
if (typeof _optionalChain([result, 'optionalAccess', _323 => _323.code]) === "string") {
|
|
22433
22677
|
code = result.code;
|
|
22434
22678
|
}
|
|
22435
22679
|
const dirname5 = _pathe2.default.dirname(wxsPath);
|
|
@@ -22462,13 +22706,13 @@ async function transformWxsFile(state, wxsPath) {
|
|
|
22462
22706
|
var RUNTIME_PLUGINS_SYMBOL = Symbol.for("weapp-runtime:plugins");
|
|
22463
22707
|
function attachRuntimePlugins(ctx, plugins) {
|
|
22464
22708
|
const runtimePlugins = ctx[RUNTIME_PLUGINS_SYMBOL];
|
|
22465
|
-
if (!_optionalChain([runtimePlugins, 'optionalAccess',
|
|
22709
|
+
if (!_optionalChain([runtimePlugins, 'optionalAccess', _324 => _324.length])) {
|
|
22466
22710
|
return plugins;
|
|
22467
22711
|
}
|
|
22468
22712
|
return [...runtimePlugins, ...plugins];
|
|
22469
22713
|
}
|
|
22470
22714
|
function applyInspect(ctx, plugins) {
|
|
22471
|
-
const inspectOptions = _optionalChain([ctx, 'access',
|
|
22715
|
+
const inspectOptions = _optionalChain([ctx, 'access', _325 => _325.configService, 'access', _326 => _326.weappViteConfig, 'optionalAccess', _327 => _327.debug, 'optionalAccess', _328 => _328.inspect]);
|
|
22472
22716
|
if (!inspectOptions) {
|
|
22473
22717
|
return plugins;
|
|
22474
22718
|
}
|
|
@@ -22514,13 +22758,13 @@ function migrateEnhanceOptions(target, options) {
|
|
|
22514
22758
|
}
|
|
22515
22759
|
const enhance = target.enhance;
|
|
22516
22760
|
const userConfigured = _nullishCoalesce(options.userConfigured, () => ( {}));
|
|
22517
|
-
if (!userConfigured.wxml && _optionalChain([enhance, 'optionalAccess',
|
|
22761
|
+
if (!userConfigured.wxml && _optionalChain([enhance, 'optionalAccess', _329 => _329.wxml]) !== void 0) {
|
|
22518
22762
|
target.wxml = enhance.wxml;
|
|
22519
22763
|
}
|
|
22520
|
-
if (!userConfigured.wxs && _optionalChain([enhance, 'optionalAccess',
|
|
22764
|
+
if (!userConfigured.wxs && _optionalChain([enhance, 'optionalAccess', _330 => _330.wxs]) !== void 0) {
|
|
22521
22765
|
target.wxs = enhance.wxs;
|
|
22522
22766
|
}
|
|
22523
|
-
if (!userConfigured.autoImportComponents && _optionalChain([enhance, 'optionalAccess',
|
|
22767
|
+
if (!userConfigured.autoImportComponents && _optionalChain([enhance, 'optionalAccess', _331 => _331.autoImportComponents]) !== void 0) {
|
|
22524
22768
|
target.autoImportComponents = enhance.autoImportComponents;
|
|
22525
22769
|
}
|
|
22526
22770
|
if (options.warn && !hasLoggedEnhanceDeprecation) {
|
|
@@ -22685,7 +22929,7 @@ function normalizeSrcDir(root, cwd, srcRoot, config) {
|
|
|
22685
22929
|
return _pathe2.default.relative(root, absoluteSrc) || "";
|
|
22686
22930
|
}
|
|
22687
22931
|
function normalizeOutDir(root, config) {
|
|
22688
|
-
if (!_optionalChain([config, 'optionalAccess',
|
|
22932
|
+
if (!_optionalChain([config, 'optionalAccess', _332 => _332.outDir])) {
|
|
22689
22933
|
return _pathe2.default.resolve(root, "dist-web");
|
|
22690
22934
|
}
|
|
22691
22935
|
if (_pathe2.default.isAbsolute(config.outDir)) {
|
|
@@ -22788,7 +23032,7 @@ export default _objectSpread2;`
|
|
|
22788
23032
|
function getOxcHelperName(id) {
|
|
22789
23033
|
OXC_RUNTIME_HELPER_ALIAS.lastIndex = 0;
|
|
22790
23034
|
const match2 = OXC_RUNTIME_HELPER_ALIAS.exec(id);
|
|
22791
|
-
return _optionalChain([match2, 'optionalAccess',
|
|
23035
|
+
return _optionalChain([match2, 'optionalAccess', _333 => _333[1]]);
|
|
22792
23036
|
}
|
|
22793
23037
|
function createOxcRuntimeSupport() {
|
|
22794
23038
|
const oxcRuntimeInfo = getPackageInfoSync("@oxc-project/runtime");
|
|
@@ -22961,7 +23205,7 @@ function createConfigService(ctx) {
|
|
|
22961
23205
|
resolve8.alias = aliasArray;
|
|
22962
23206
|
}
|
|
22963
23207
|
function getDefineImportMetaEnv() {
|
|
22964
|
-
const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
23208
|
+
const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _334 => _334.platform]), () => ( DEFAULT_MP_PLATFORM));
|
|
22965
23209
|
const resolvedPlatform = _nullishCoalesce(defineEnv.PLATFORM, () => ( mpPlatform));
|
|
22966
23210
|
const env = {
|
|
22967
23211
|
PLATFORM: resolvedPlatform,
|
|
@@ -22980,7 +23224,7 @@ function createConfigService(ctx) {
|
|
|
22980
23224
|
}
|
|
22981
23225
|
function applyRuntimePlatform(runtime) {
|
|
22982
23226
|
const isWeb = runtime === "web";
|
|
22983
|
-
const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
23227
|
+
const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _335 => _335.platform]), () => ( DEFAULT_MP_PLATFORM));
|
|
22984
23228
|
const resolvedPlatform = isWeb ? "web" : mpPlatform;
|
|
22985
23229
|
setDefineEnv("PLATFORM", resolvedPlatform);
|
|
22986
23230
|
setDefineEnv("IS_WEB", isWeb);
|
|
@@ -23014,11 +23258,11 @@ function createConfigService(ctx) {
|
|
|
23014
23258
|
command: isDev ? "serve" : "build",
|
|
23015
23259
|
mode
|
|
23016
23260
|
}, resolvedConfigFile, cwd);
|
|
23017
|
-
const loadedConfig = _optionalChain([loaded, 'optionalAccess',
|
|
23261
|
+
const loadedConfig = _optionalChain([loaded, 'optionalAccess', _336 => _336.config]);
|
|
23018
23262
|
let weappLoaded;
|
|
23019
23263
|
if (weappConfigFilePath) {
|
|
23020
23264
|
const normalizedWeappPath = _pathe2.default.resolve(weappConfigFilePath);
|
|
23021
|
-
const normalizedLoadedPath = _optionalChain([loaded, 'optionalAccess',
|
|
23265
|
+
const normalizedLoadedPath = _optionalChain([loaded, 'optionalAccess', _337 => _337.path]) ? _pathe2.default.resolve(loaded.path) : void 0;
|
|
23022
23266
|
if (normalizedLoadedPath && normalizedLoadedPath === normalizedWeappPath) {
|
|
23023
23267
|
weappLoaded = loaded;
|
|
23024
23268
|
} else {
|
|
@@ -23051,47 +23295,47 @@ function createConfigService(ctx) {
|
|
|
23051
23295
|
weapp: getWeappViteConfig()
|
|
23052
23296
|
}
|
|
23053
23297
|
);
|
|
23054
|
-
if (_optionalChain([weappLoaded, 'optionalAccess',
|
|
23298
|
+
if (_optionalChain([weappLoaded, 'optionalAccess', _338 => _338.config, 'optionalAccess', _339 => _339.weapp])) {
|
|
23055
23299
|
config.weapp = _shared.defu.call(void 0,
|
|
23056
23300
|
weappLoaded.config.weapp,
|
|
23057
23301
|
_nullishCoalesce(config.weapp, () => ( {}))
|
|
23058
23302
|
);
|
|
23059
23303
|
}
|
|
23060
23304
|
const shouldWarnEnhance = [
|
|
23061
|
-
_optionalChain([inlineConfig, 'optionalAccess',
|
|
23062
|
-
_optionalChain([loadedConfig, 'optionalAccess',
|
|
23063
|
-
_optionalChain([weappLoaded, 'optionalAccess',
|
|
23305
|
+
_optionalChain([inlineConfig, 'optionalAccess', _340 => _340.weapp, 'optionalAccess', _341 => _341.enhance]),
|
|
23306
|
+
_optionalChain([loadedConfig, 'optionalAccess', _342 => _342.weapp, 'optionalAccess', _343 => _343.enhance]),
|
|
23307
|
+
_optionalChain([weappLoaded, 'optionalAccess', _344 => _344.config, 'optionalAccess', _345 => _345.weapp, 'optionalAccess', _346 => _346.enhance])
|
|
23064
23308
|
].some(hasDeprecatedEnhanceUsage);
|
|
23065
23309
|
const userConfiguredTopLevel = {
|
|
23066
23310
|
wxml: [
|
|
23067
|
-
_optionalChain([inlineConfig, 'optionalAccess',
|
|
23068
|
-
_optionalChain([loadedConfig, 'optionalAccess',
|
|
23069
|
-
_optionalChain([weappLoaded, 'optionalAccess',
|
|
23311
|
+
_optionalChain([inlineConfig, 'optionalAccess', _347 => _347.weapp, 'optionalAccess', _348 => _348.wxml]),
|
|
23312
|
+
_optionalChain([loadedConfig, 'optionalAccess', _349 => _349.weapp, 'optionalAccess', _350 => _350.wxml]),
|
|
23313
|
+
_optionalChain([weappLoaded, 'optionalAccess', _351 => _351.config, 'optionalAccess', _352 => _352.weapp, 'optionalAccess', _353 => _353.wxml])
|
|
23070
23314
|
].some((value) => value !== void 0),
|
|
23071
23315
|
wxs: [
|
|
23072
|
-
_optionalChain([inlineConfig, 'optionalAccess',
|
|
23073
|
-
_optionalChain([loadedConfig, 'optionalAccess',
|
|
23074
|
-
_optionalChain([weappLoaded, 'optionalAccess',
|
|
23316
|
+
_optionalChain([inlineConfig, 'optionalAccess', _354 => _354.weapp, 'optionalAccess', _355 => _355.wxs]),
|
|
23317
|
+
_optionalChain([loadedConfig, 'optionalAccess', _356 => _356.weapp, 'optionalAccess', _357 => _357.wxs]),
|
|
23318
|
+
_optionalChain([weappLoaded, 'optionalAccess', _358 => _358.config, 'optionalAccess', _359 => _359.weapp, 'optionalAccess', _360 => _360.wxs])
|
|
23075
23319
|
].some((value) => value !== void 0),
|
|
23076
23320
|
autoImportComponents: [
|
|
23077
|
-
_optionalChain([inlineConfig, 'optionalAccess',
|
|
23078
|
-
_optionalChain([loadedConfig, 'optionalAccess',
|
|
23079
|
-
_optionalChain([weappLoaded, 'optionalAccess',
|
|
23321
|
+
_optionalChain([inlineConfig, 'optionalAccess', _361 => _361.weapp, 'optionalAccess', _362 => _362.autoImportComponents]),
|
|
23322
|
+
_optionalChain([loadedConfig, 'optionalAccess', _363 => _363.weapp, 'optionalAccess', _364 => _364.autoImportComponents]),
|
|
23323
|
+
_optionalChain([weappLoaded, 'optionalAccess', _365 => _365.config, 'optionalAccess', _366 => _366.weapp, 'optionalAccess', _367 => _367.autoImportComponents])
|
|
23080
23324
|
].some((value) => value !== void 0)
|
|
23081
23325
|
};
|
|
23082
23326
|
migrateEnhanceOptions(config.weapp, {
|
|
23083
23327
|
warn: shouldWarnEnhance,
|
|
23084
23328
|
userConfigured: userConfiguredTopLevel
|
|
23085
23329
|
});
|
|
23086
|
-
const srcRoot = _nullishCoalesce(_optionalChain([config, 'access',
|
|
23330
|
+
const srcRoot = _nullishCoalesce(_optionalChain([config, 'access', _368 => _368.weapp, 'optionalAccess', _369 => _369.srcRoot]), () => ( ""));
|
|
23087
23331
|
const resolvedWebConfig = resolveWeappWebConfig({
|
|
23088
23332
|
cwd,
|
|
23089
23333
|
srcRoot,
|
|
23090
|
-
config: _optionalChain([config, 'access',
|
|
23334
|
+
config: _optionalChain([config, 'access', _370 => _370.weapp, 'optionalAccess', _371 => _371.web])
|
|
23091
23335
|
});
|
|
23092
23336
|
const buildConfig = _nullishCoalesce(config.build, () => ( (config.build = {})));
|
|
23093
|
-
const jsFormat = _nullishCoalesce(_optionalChain([config, 'access',
|
|
23094
|
-
const enableLegacyEs5 = _optionalChain([config, 'access',
|
|
23337
|
+
const jsFormat = _nullishCoalesce(_optionalChain([config, 'access', _372 => _372.weapp, 'optionalAccess', _373 => _373.jsFormat]), () => ( "cjs"));
|
|
23338
|
+
const enableLegacyEs5 = _optionalChain([config, 'access', _374 => _374.weapp, 'optionalAccess', _375 => _375.es5]) === true;
|
|
23095
23339
|
if (enableLegacyEs5 && jsFormat !== "cjs") {
|
|
23096
23340
|
throw new Error('`weapp.es5` \u4EC5\u652F\u6301\u5728 `weapp.jsFormat` \u4E3A "cjs" \u65F6\u4F7F\u7528\uFF0C\u8BF7\u5207\u6362\u5230 CommonJS \u6216\u5173\u95ED\u8BE5\u9009\u9879\u3002');
|
|
23097
23341
|
}
|
|
@@ -23117,7 +23361,7 @@ function createConfigService(ctx) {
|
|
|
23117
23361
|
const pluginArray = rawPlugins == null ? [] : Array.isArray(rawPlugins) ? [...rawPlugins] : [rawPlugins];
|
|
23118
23362
|
if (enableLegacyEs5) {
|
|
23119
23363
|
const swcPluginName = "weapp-runtime:swc-es5-transform";
|
|
23120
|
-
const hasSwcPlugin = pluginArray.some((plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
23364
|
+
const hasSwcPlugin = pluginArray.some((plugin) => _optionalChain([plugin, 'optionalAccess', _376 => _376.name]) === swcPluginName);
|
|
23121
23365
|
if (!hasSwcPlugin) {
|
|
23122
23366
|
pluginArray.push(createLegacyEs5Plugin());
|
|
23123
23367
|
}
|
|
@@ -23149,12 +23393,12 @@ function createConfigService(ctx) {
|
|
|
23149
23393
|
config.plugins ??= [];
|
|
23150
23394
|
config.plugins.unshift(oxcRuntimeSupport.vitePlugin);
|
|
23151
23395
|
}
|
|
23152
|
-
const platform = _nullishCoalesce(_optionalChain([config, 'access',
|
|
23396
|
+
const platform = _nullishCoalesce(_optionalChain([config, 'access', _377 => _377.weapp, 'optionalAccess', _378 => _378.platform]), () => ( "weapp"));
|
|
23153
23397
|
const resolvedOutputExtensions = getOutputExtensions(platform);
|
|
23154
23398
|
config.plugins ??= [];
|
|
23155
|
-
_optionalChain([config, 'access',
|
|
23156
|
-
const aliasEntries = getAliasEntries(_optionalChain([config, 'access',
|
|
23157
|
-
const configFilePath = _nullishCoalesce(_nullishCoalesce(_optionalChain([weappLoaded, 'optionalAccess',
|
|
23399
|
+
_optionalChain([config, 'access', _379 => _379.plugins, 'optionalAccess', _380 => _380.push, 'call', _381 => _381(_vitetsconfigpaths2.default.call(void 0, _optionalChain([config, 'access', _382 => _382.weapp, 'optionalAccess', _383 => _383.tsconfigPaths])))]);
|
|
23400
|
+
const aliasEntries = getAliasEntries(_optionalChain([config, 'access', _384 => _384.weapp, 'optionalAccess', _385 => _385.jsonAlias]));
|
|
23401
|
+
const configFilePath = _nullishCoalesce(_nullishCoalesce(_optionalChain([weappLoaded, 'optionalAccess', _386 => _386.path]), () => ( _optionalChain([loaded, 'optionalAccess', _387 => _387.path]))), () => ( resolvedConfigFile));
|
|
23158
23402
|
return {
|
|
23159
23403
|
config,
|
|
23160
23404
|
aliasEntries,
|
|
@@ -23282,6 +23526,7 @@ function createConfigService(ctx) {
|
|
|
23282
23526
|
},
|
|
23283
23527
|
minify: false,
|
|
23284
23528
|
emptyOutDir: false,
|
|
23529
|
+
// @ts-ignore
|
|
23285
23530
|
rolldownOptions: {
|
|
23286
23531
|
...rolldownOptions
|
|
23287
23532
|
},
|
|
@@ -23307,6 +23552,7 @@ function createConfigService(ctx) {
|
|
|
23307
23552
|
define: getDefineImportMetaEnv(),
|
|
23308
23553
|
build: {
|
|
23309
23554
|
emptyOutDir: false,
|
|
23555
|
+
// @ts-ignore
|
|
23310
23556
|
rolldownOptions: {
|
|
23311
23557
|
...rolldownOptions
|
|
23312
23558
|
}
|
|
@@ -23315,7 +23561,7 @@ function createConfigService(ctx) {
|
|
|
23315
23561
|
);
|
|
23316
23562
|
inlineConfig.logLevel = "info";
|
|
23317
23563
|
injectBuiltinAliases(inlineConfig);
|
|
23318
|
-
const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess',
|
|
23564
|
+
const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _388 => _388.subPackage, 'access', _389 => _389.root]);
|
|
23319
23565
|
options = {
|
|
23320
23566
|
...options,
|
|
23321
23567
|
currentSubPackageRoot: currentRoot
|
|
@@ -23329,7 +23575,7 @@ function createConfigService(ctx) {
|
|
|
23329
23575
|
}
|
|
23330
23576
|
options = configState.options;
|
|
23331
23577
|
const web = options.weappWeb;
|
|
23332
|
-
if (!_optionalChain([web, 'optionalAccess',
|
|
23578
|
+
if (!_optionalChain([web, 'optionalAccess', _390 => _390.enabled])) {
|
|
23333
23579
|
return void 0;
|
|
23334
23580
|
}
|
|
23335
23581
|
applyRuntimePlatform("web");
|
|
@@ -23448,10 +23694,10 @@ function createConfigService(ctx) {
|
|
|
23448
23694
|
return options.srcRoot;
|
|
23449
23695
|
},
|
|
23450
23696
|
get pluginRoot() {
|
|
23451
|
-
return _optionalChain([options, 'access',
|
|
23697
|
+
return _optionalChain([options, 'access', _391 => _391.config, 'access', _392 => _392.weapp, 'optionalAccess', _393 => _393.pluginRoot]);
|
|
23452
23698
|
},
|
|
23453
23699
|
get absolutePluginRoot() {
|
|
23454
|
-
if (_optionalChain([options, 'access',
|
|
23700
|
+
if (_optionalChain([options, 'access', _394 => _394.config, 'access', _395 => _395.weapp, 'optionalAccess', _396 => _396.pluginRoot])) {
|
|
23455
23701
|
return _pathe2.default.resolve(options.cwd, options.config.weapp.pluginRoot);
|
|
23456
23702
|
}
|
|
23457
23703
|
},
|
|
@@ -23516,10 +23762,10 @@ function createJsonService(ctx) {
|
|
|
23516
23762
|
}
|
|
23517
23763
|
let resultJson;
|
|
23518
23764
|
if (/app\.json(?:\.[jt]s)?$/.test(filepath)) {
|
|
23519
|
-
await _optionalChain([ctx, 'access',
|
|
23765
|
+
await _optionalChain([ctx, 'access', _397 => _397.autoRoutesService, 'optionalAccess', _398 => _398.ensureFresh, 'call', _399 => _399()]);
|
|
23520
23766
|
}
|
|
23521
23767
|
if (/\.json\.[jt]s$/.test(filepath)) {
|
|
23522
|
-
const routesReference = _optionalChain([ctx, 'access',
|
|
23768
|
+
const routesReference = _optionalChain([ctx, 'access', _400 => _400.autoRoutesService, 'optionalAccess', _401 => _401.getReference, 'call', _402 => _402()]);
|
|
23523
23769
|
const fallbackRoutes = _nullishCoalesce(routesReference, () => ( { pages: [], entries: [], subPackages: [] }));
|
|
23524
23770
|
const routesModule = {
|
|
23525
23771
|
routes: fallbackRoutes,
|
|
@@ -23568,7 +23814,7 @@ function createJsonService(ctx) {
|
|
|
23568
23814
|
return resultJson;
|
|
23569
23815
|
} catch (error) {
|
|
23570
23816
|
logger_default.error(`\u6B8B\u7834\u7684JSON\u6587\u4EF6: ${filepath}`);
|
|
23571
|
-
_optionalChain([debug, 'optionalCall',
|
|
23817
|
+
_optionalChain([debug, 'optionalCall', _403 => _403(error)]);
|
|
23572
23818
|
}
|
|
23573
23819
|
}
|
|
23574
23820
|
function resolve8(entry) {
|
|
@@ -23620,7 +23866,7 @@ function createNpmService(ctx) {
|
|
|
23620
23866
|
if (!ctx.configService) {
|
|
23621
23867
|
throw new Error("configService must be initialized before writing npm cache");
|
|
23622
23868
|
}
|
|
23623
|
-
if (_optionalChain([ctx, 'access',
|
|
23869
|
+
if (_optionalChain([ctx, 'access', _404 => _404.configService, 'access', _405 => _405.weappViteConfig, 'optionalAccess', _406 => _406.npm, 'optionalAccess', _407 => _407.cache])) {
|
|
23624
23870
|
await _fsextra2.default.outputJSON(getDependenciesCacheFilePath(root), {
|
|
23625
23871
|
hash: dependenciesCacheHash()
|
|
23626
23872
|
});
|
|
@@ -23633,7 +23879,7 @@ function createNpmService(ctx) {
|
|
|
23633
23879
|
}
|
|
23634
23880
|
}
|
|
23635
23881
|
async function checkDependenciesCacheOutdate(root) {
|
|
23636
|
-
if (_optionalChain([ctx, 'access',
|
|
23882
|
+
if (_optionalChain([ctx, 'access', _408 => _408.configService, 'optionalAccess', _409 => _409.weappViteConfig, 'optionalAccess', _410 => _410.npm, 'optionalAccess', _411 => _411.cache])) {
|
|
23637
23883
|
const json = await readDependenciesCache(root);
|
|
23638
23884
|
if (_shared.isObject.call(void 0, json)) {
|
|
23639
23885
|
return dependenciesCacheHash() !== json.hash;
|
|
@@ -23667,7 +23913,7 @@ function createNpmService(ctx) {
|
|
|
23667
23913
|
target: "es6",
|
|
23668
23914
|
external: []
|
|
23669
23915
|
});
|
|
23670
|
-
const resolvedOptions = _optionalChain([ctx, 'access',
|
|
23916
|
+
const resolvedOptions = _optionalChain([ctx, 'access', _412 => _412.configService, 'optionalAccess', _413 => _413.weappViteConfig, 'optionalAccess', _414 => _414.npm, 'optionalAccess', _415 => _415.buildOptions, 'optionalCall', _416 => _416(
|
|
23671
23917
|
mergedOptions,
|
|
23672
23918
|
{ name, entry }
|
|
23673
23919
|
)]);
|
|
@@ -23755,7 +24001,7 @@ function createNpmService(ctx) {
|
|
|
23755
24001
|
throw new Error("configService must be initialized before resolving npm relation list");
|
|
23756
24002
|
}
|
|
23757
24003
|
let packNpmRelationList = [];
|
|
23758
|
-
if (_optionalChain([ctx, 'access',
|
|
24004
|
+
if (_optionalChain([ctx, 'access', _417 => _417.configService, 'access', _418 => _418.projectConfig, 'access', _419 => _419.setting, 'optionalAccess', _420 => _420.packNpmManually]) && Array.isArray(ctx.configService.projectConfig.setting.packNpmRelationList)) {
|
|
23759
24005
|
packNpmRelationList = ctx.configService.projectConfig.setting.packNpmRelationList;
|
|
23760
24006
|
} else {
|
|
23761
24007
|
packNpmRelationList = [
|
|
@@ -23768,10 +24014,10 @@ function createNpmService(ctx) {
|
|
|
23768
24014
|
return packNpmRelationList;
|
|
23769
24015
|
}
|
|
23770
24016
|
async function build4(options) {
|
|
23771
|
-
if (!_optionalChain([ctx, 'access',
|
|
24017
|
+
if (!_optionalChain([ctx, 'access', _421 => _421.configService, 'optionalAccess', _422 => _422.weappViteConfig, 'optionalAccess', _423 => _423.npm, 'optionalAccess', _424 => _424.enable])) {
|
|
23772
24018
|
return;
|
|
23773
24019
|
}
|
|
23774
|
-
_optionalChain([debug, 'optionalCall',
|
|
24020
|
+
_optionalChain([debug, 'optionalCall', _425 => _425("buildNpm start")]);
|
|
23775
24021
|
const packNpmRelationList = getPackNpmRelationList();
|
|
23776
24022
|
const [mainRelation, ...subRelations] = packNpmRelationList;
|
|
23777
24023
|
const packageJsonPath = _pathe2.default.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
|
|
@@ -23846,7 +24092,7 @@ function createNpmService(ctx) {
|
|
|
23846
24092
|
}
|
|
23847
24093
|
}
|
|
23848
24094
|
}
|
|
23849
|
-
_optionalChain([debug, 'optionalCall',
|
|
24095
|
+
_optionalChain([debug, 'optionalCall', _426 => _426("buildNpm end")]);
|
|
23850
24096
|
}
|
|
23851
24097
|
return {
|
|
23852
24098
|
getDependenciesCacheFilePath,
|
|
@@ -23890,7 +24136,7 @@ var TimeoutError = (_class16 = class _TimeoutError extends Error {
|
|
|
23890
24136
|
__init36() {this.name = "TimeoutError"}
|
|
23891
24137
|
constructor(message, options) {
|
|
23892
24138
|
super(message, options);_class16.prototype.__init36.call(this);;
|
|
23893
|
-
_optionalChain([Error, 'access',
|
|
24139
|
+
_optionalChain([Error, 'access', _427 => _427.captureStackTrace, 'optionalCall', _428 => _428(this, _TimeoutError)]);
|
|
23894
24140
|
}
|
|
23895
24141
|
}, _class16);
|
|
23896
24142
|
var getAbortedReason = (signal) => _nullishCoalesce(signal.reason, () => ( new DOMException("This operation was aborted.", "AbortError")));
|
|
@@ -23908,7 +24154,7 @@ function pTimeout(promise, options) {
|
|
|
23908
24154
|
if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
|
|
23909
24155
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
|
|
23910
24156
|
}
|
|
23911
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
24157
|
+
if (_optionalChain([signal, 'optionalAccess', _429 => _429.aborted])) {
|
|
23912
24158
|
reject(getAbortedReason(signal));
|
|
23913
24159
|
return;
|
|
23914
24160
|
}
|
|
@@ -24006,7 +24252,7 @@ var PriorityQueue = class {
|
|
|
24006
24252
|
}
|
|
24007
24253
|
dequeue() {
|
|
24008
24254
|
const item = this.#queue.shift();
|
|
24009
|
-
return _optionalChain([item, 'optionalAccess',
|
|
24255
|
+
return _optionalChain([item, 'optionalAccess', _430 => _430.run]);
|
|
24010
24256
|
}
|
|
24011
24257
|
filter(options) {
|
|
24012
24258
|
return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
@@ -24067,10 +24313,10 @@ var PQueue = class extends import_index2.default {
|
|
|
24067
24313
|
...options
|
|
24068
24314
|
};
|
|
24069
24315
|
if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
|
|
24070
|
-
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access',
|
|
24316
|
+
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _431 => _431.intervalCap, 'optionalAccess', _432 => _432.toString, 'call', _433 => _433()]), () => ( ""))}\` (${typeof options.intervalCap})`);
|
|
24071
24317
|
}
|
|
24072
24318
|
if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
|
|
24073
|
-
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access',
|
|
24319
|
+
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _434 => _434.interval, 'optionalAccess', _435 => _435.toString, 'call', _436 => _436()]), () => ( ""))}\` (${typeof options.interval})`);
|
|
24074
24320
|
}
|
|
24075
24321
|
this.#carryoverIntervalCount = _nullishCoalesce(_nullishCoalesce(options.carryoverIntervalCount, () => ( options.carryoverConcurrencyCount)), () => ( false));
|
|
24076
24322
|
this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
|
|
@@ -24277,7 +24523,7 @@ var PQueue = class extends import_index2.default {
|
|
|
24277
24523
|
});
|
|
24278
24524
|
try {
|
|
24279
24525
|
try {
|
|
24280
|
-
_optionalChain([options, 'access',
|
|
24526
|
+
_optionalChain([options, 'access', _437 => _437.signal, 'optionalAccess', _438 => _438.throwIfAborted, 'call', _439 => _439()]);
|
|
24281
24527
|
} catch (error) {
|
|
24282
24528
|
if (!this.#isIntervalIgnored) {
|
|
24283
24529
|
this.#intervalCount--;
|
|
@@ -24650,7 +24896,7 @@ var FileCache = class {
|
|
|
24650
24896
|
return true;
|
|
24651
24897
|
}
|
|
24652
24898
|
const cachedMtime = this.mtimeMap.get(id);
|
|
24653
|
-
const nextSignature = _optionalChain([options, 'optionalAccess',
|
|
24899
|
+
const nextSignature = _optionalChain([options, 'optionalAccess', _440 => _440.content]) !== void 0 ? createSignature(options.content) : void 0;
|
|
24654
24900
|
const updateSignature = () => {
|
|
24655
24901
|
if (nextSignature !== void 0) {
|
|
24656
24902
|
this.signatureMap.set(id, nextSignature);
|
|
@@ -24857,7 +25103,7 @@ function createScanService(ctx) {
|
|
|
24857
25103
|
if (!ctx.configService) {
|
|
24858
25104
|
throw new Error("configService must be initialized before scanning subpackages");
|
|
24859
25105
|
}
|
|
24860
|
-
const json = _optionalChain([scanState, 'access',
|
|
25106
|
+
const json = _optionalChain([scanState, 'access', _441 => _441.appEntry, 'optionalAccess', _442 => _442.json]);
|
|
24861
25107
|
if (scanState.isDirty || subPackageMap.size === 0) {
|
|
24862
25108
|
subPackageMap.clear();
|
|
24863
25109
|
independentSubPackageMap.clear();
|
|
@@ -24875,9 +25121,9 @@ function createScanService(ctx) {
|
|
|
24875
25121
|
subPackage,
|
|
24876
25122
|
entries: resolveSubPackageEntries(subPackage)
|
|
24877
25123
|
};
|
|
24878
|
-
const subPackageConfig = _optionalChain([ctx, 'access',
|
|
24879
|
-
meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess',
|
|
24880
|
-
meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess',
|
|
25124
|
+
const subPackageConfig = _optionalChain([ctx, 'access', _443 => _443.configService, 'access', _444 => _444.weappViteConfig, 'optionalAccess', _445 => _445.subPackages, 'optionalAccess', _446 => _446[subPackage.root]]);
|
|
25125
|
+
meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess', _447 => _447.dependencies]);
|
|
25126
|
+
meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess', _448 => _448.inlineConfig]);
|
|
24881
25127
|
metas.push(meta);
|
|
24882
25128
|
if (subPackage.root) {
|
|
24883
25129
|
subPackageMap.set(subPackage.root, meta);
|
|
@@ -24927,11 +25173,11 @@ function createScanService(ctx) {
|
|
|
24927
25173
|
loadSubPackages,
|
|
24928
25174
|
isMainPackageFileName,
|
|
24929
25175
|
get workersOptions() {
|
|
24930
|
-
return _optionalChain([scanState, 'access',
|
|
25176
|
+
return _optionalChain([scanState, 'access', _449 => _449.appEntry, 'optionalAccess', _450 => _450.json, 'optionalAccess', _451 => _451.workers]);
|
|
24931
25177
|
},
|
|
24932
25178
|
get workersDir() {
|
|
24933
|
-
const workersOptions = _optionalChain([scanState, 'access',
|
|
24934
|
-
return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess',
|
|
25179
|
+
const workersOptions = _optionalChain([scanState, 'access', _452 => _452.appEntry, 'optionalAccess', _453 => _453.json, 'optionalAccess', _454 => _454.workers]);
|
|
25180
|
+
return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess', _455 => _455.path]) : workersOptions;
|
|
24935
25181
|
},
|
|
24936
25182
|
markDirty() {
|
|
24937
25183
|
scanState.isDirty = true;
|
|
@@ -24977,7 +25223,7 @@ function createWatcherService(ctx) {
|
|
|
24977
25223
|
},
|
|
24978
25224
|
setRollupWatcher(watcher, root = "/") {
|
|
24979
25225
|
const oldWatcher = rollupWatcherMap.get(root);
|
|
24980
|
-
_optionalChain([oldWatcher, 'optionalAccess',
|
|
25226
|
+
_optionalChain([oldWatcher, 'optionalAccess', _456 => _456.close, 'call', _457 => _457()]);
|
|
24981
25227
|
rollupWatcherMap.set(root, watcher);
|
|
24982
25228
|
},
|
|
24983
25229
|
closeAll() {
|
|
@@ -24990,7 +25236,7 @@ function createWatcherService(ctx) {
|
|
|
24990
25236
|
});
|
|
24991
25237
|
});
|
|
24992
25238
|
sidecarWatcherMap.clear();
|
|
24993
|
-
void _optionalChain([ctx, 'access',
|
|
25239
|
+
void _optionalChain([ctx, 'access', _458 => _458.webService, 'optionalAccess', _459 => _459.close, 'call', _460 => _460(), 'access', _461 => _461.catch, 'call', _462 => _462(() => {
|
|
24994
25240
|
})]);
|
|
24995
25241
|
},
|
|
24996
25242
|
close(root = "/") {
|
|
@@ -25006,7 +25252,7 @@ function createWatcherService(ctx) {
|
|
|
25006
25252
|
sidecarWatcherMap.delete(root);
|
|
25007
25253
|
}
|
|
25008
25254
|
if (rollupWatcherMap.size === 0 && sidecarWatcherMap.size === 0) {
|
|
25009
|
-
void _optionalChain([ctx, 'access',
|
|
25255
|
+
void _optionalChain([ctx, 'access', _463 => _463.webService, 'optionalAccess', _464 => _464.close, 'call', _465 => _465(), 'access', _466 => _466.catch, 'call', _467 => _467(() => {
|
|
25010
25256
|
})]);
|
|
25011
25257
|
}
|
|
25012
25258
|
}
|
|
@@ -25019,7 +25265,7 @@ function createWatcherServicePlugin(ctx) {
|
|
|
25019
25265
|
name: "weapp-runtime:watcher-service",
|
|
25020
25266
|
closeBundle() {
|
|
25021
25267
|
const configService = ctx.configService;
|
|
25022
|
-
const isWatchMode = _optionalChain([configService, 'optionalAccess',
|
|
25268
|
+
const isWatchMode = _optionalChain([configService, 'optionalAccess', _468 => _468.isDev]) || Boolean(_optionalChain([configService, 'optionalAccess', _469 => _469.inlineConfig, 'optionalAccess', _470 => _470.build, 'optionalAccess', _471 => _471.watch]));
|
|
25023
25269
|
if (!isWatchMode) {
|
|
25024
25270
|
service.closeAll();
|
|
25025
25271
|
}
|
|
@@ -25036,10 +25282,10 @@ function createWebService(ctx) {
|
|
|
25036
25282
|
}
|
|
25037
25283
|
let devServer;
|
|
25038
25284
|
function isEnabled() {
|
|
25039
|
-
return Boolean(_optionalChain([ctx, 'access',
|
|
25285
|
+
return Boolean(_optionalChain([ctx, 'access', _472 => _472.configService, 'optionalAccess', _473 => _473.weappWebConfig, 'optionalAccess', _474 => _474.enabled]));
|
|
25040
25286
|
}
|
|
25041
25287
|
async function startDevServer() {
|
|
25042
|
-
if (!_optionalChain([ctx, 'access',
|
|
25288
|
+
if (!_optionalChain([ctx, 'access', _475 => _475.configService, 'optionalAccess', _476 => _476.isDev])) {
|
|
25043
25289
|
return void 0;
|
|
25044
25290
|
}
|
|
25045
25291
|
if (!isEnabled()) {
|
|
@@ -25048,7 +25294,7 @@ function createWebService(ctx) {
|
|
|
25048
25294
|
if (devServer) {
|
|
25049
25295
|
return devServer;
|
|
25050
25296
|
}
|
|
25051
|
-
const inlineConfig = _optionalChain([ctx, 'access',
|
|
25297
|
+
const inlineConfig = _optionalChain([ctx, 'access', _477 => _477.configService, 'optionalAccess', _478 => _478.mergeWeb, 'call', _479 => _479()]);
|
|
25052
25298
|
if (!inlineConfig) {
|
|
25053
25299
|
return void 0;
|
|
25054
25300
|
}
|
|
@@ -25061,7 +25307,7 @@ function createWebService(ctx) {
|
|
|
25061
25307
|
if (!isEnabled()) {
|
|
25062
25308
|
return void 0;
|
|
25063
25309
|
}
|
|
25064
|
-
const inlineConfig = _optionalChain([ctx, 'access',
|
|
25310
|
+
const inlineConfig = _optionalChain([ctx, 'access', _480 => _480.configService, 'optionalAccess', _481 => _481.mergeWeb, 'call', _482 => _482()]);
|
|
25065
25311
|
if (!inlineConfig) {
|
|
25066
25312
|
return void 0;
|
|
25067
25313
|
}
|
|
@@ -25091,7 +25337,7 @@ function createWebServicePlugin(ctx) {
|
|
|
25091
25337
|
return {
|
|
25092
25338
|
name: "weapp-runtime:web-service",
|
|
25093
25339
|
async closeBundle() {
|
|
25094
|
-
if (!_optionalChain([ctx, 'access',
|
|
25340
|
+
if (!_optionalChain([ctx, 'access', _483 => _483.configService, 'optionalAccess', _484 => _484.isDev])) {
|
|
25095
25341
|
await service.close();
|
|
25096
25342
|
}
|
|
25097
25343
|
}
|
|
@@ -27740,7 +27986,7 @@ function createWxmlService(ctx) {
|
|
|
27740
27986
|
return set3;
|
|
27741
27987
|
}
|
|
27742
27988
|
function clearAll() {
|
|
27743
|
-
const currentRoot = _optionalChain([ctx, 'access',
|
|
27989
|
+
const currentRoot = _optionalChain([ctx, 'access', _485 => _485.configService, 'optionalAccess', _486 => _486.currentSubPackageRoot]);
|
|
27744
27990
|
if (!currentRoot) {
|
|
27745
27991
|
depsMap.clear();
|
|
27746
27992
|
tokenMap.clear();
|
|
@@ -27793,7 +28039,7 @@ function createWxmlService(ctx) {
|
|
|
27793
28039
|
if (!ctx.configService) {
|
|
27794
28040
|
throw new Error("configService must be initialized before scanning wxml");
|
|
27795
28041
|
}
|
|
27796
|
-
const wxmlConfig = _nullishCoalesce(_optionalChain([ctx, 'access',
|
|
28042
|
+
const wxmlConfig = _nullishCoalesce(_optionalChain([ctx, 'access', _487 => _487.configService, 'access', _488 => _488.weappViteConfig, 'optionalAccess', _489 => _489.wxml]), () => ( _optionalChain([ctx, 'access', _490 => _490.configService, 'access', _491 => _491.weappViteConfig, 'optionalAccess', _492 => _492.enhance, 'optionalAccess', _493 => _493.wxml])));
|
|
27797
28043
|
return scanWxml(wxml, {
|
|
27798
28044
|
platform: ctx.configService.platform,
|
|
27799
28045
|
...wxmlConfig === true ? {} : wxmlConfig
|