weapp-vite 5.2.1 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-LUDOMADB.cjs → chunk-RHQGM7EB.cjs} +474 -430
- package/dist/{chunk-74S2J7GW.mjs → chunk-VWY5EX25.mjs} +526 -482
- package/dist/cli.cjs +13 -13
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
|
@@ -2863,7 +2863,7 @@ var ReaddirpStream = class extends _stream.Readable {
|
|
|
2863
2863
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
2864
2864
|
const statMethod = opts.lstat ? _promises.lstat : _promises.stat;
|
|
2865
2865
|
if (wantBigintFsStats) {
|
|
2866
|
-
this._stat = (
|
|
2866
|
+
this._stat = (path25) => statMethod(path25, { bigint: true });
|
|
2867
2867
|
} else {
|
|
2868
2868
|
this._stat = statMethod;
|
|
2869
2869
|
}
|
|
@@ -2888,8 +2888,8 @@ var ReaddirpStream = class extends _stream.Readable {
|
|
|
2888
2888
|
const par = this.parent;
|
|
2889
2889
|
const fil = par && par.files;
|
|
2890
2890
|
if (fil && fil.length > 0) {
|
|
2891
|
-
const { path:
|
|
2892
|
-
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent,
|
|
2891
|
+
const { path: path25, depth } = par;
|
|
2892
|
+
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path25));
|
|
2893
2893
|
const awaited = await Promise.all(slice);
|
|
2894
2894
|
for (const entry of awaited) {
|
|
2895
2895
|
if (!entry)
|
|
@@ -2929,20 +2929,20 @@ var ReaddirpStream = class extends _stream.Readable {
|
|
|
2929
2929
|
this.reading = false;
|
|
2930
2930
|
}
|
|
2931
2931
|
}
|
|
2932
|
-
async _exploreDir(
|
|
2932
|
+
async _exploreDir(path25, depth) {
|
|
2933
2933
|
let files;
|
|
2934
2934
|
try {
|
|
2935
|
-
files = await _promises.readdir.call(void 0,
|
|
2935
|
+
files = await _promises.readdir.call(void 0, path25, this._rdOptions);
|
|
2936
2936
|
} catch (error) {
|
|
2937
2937
|
this._onError(error);
|
|
2938
2938
|
}
|
|
2939
|
-
return { files, depth, path:
|
|
2939
|
+
return { files, depth, path: path25 };
|
|
2940
2940
|
}
|
|
2941
|
-
async _formatEntry(dirent,
|
|
2941
|
+
async _formatEntry(dirent, path25) {
|
|
2942
2942
|
let entry;
|
|
2943
2943
|
const basename4 = this._isDirent ? dirent.name : dirent;
|
|
2944
2944
|
try {
|
|
2945
|
-
const fullPath = _path.resolve.call(void 0, _path.join.call(void 0,
|
|
2945
|
+
const fullPath = _path.resolve.call(void 0, _path.join.call(void 0, path25, basename4));
|
|
2946
2946
|
entry = { path: _path.relative.call(void 0, this._root, fullPath), fullPath, basename: basename4 };
|
|
2947
2947
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
2948
2948
|
} catch (err) {
|
|
@@ -3343,16 +3343,16 @@ var delFromSet = (main, prop, item) => {
|
|
|
3343
3343
|
};
|
|
3344
3344
|
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
3345
3345
|
var FsWatchInstances = /* @__PURE__ */ new Map();
|
|
3346
|
-
function createFsWatchInstance(
|
|
3346
|
+
function createFsWatchInstance(path25, options, listener, errHandler, emitRaw) {
|
|
3347
3347
|
const handleEvent = (rawEvent, evPath) => {
|
|
3348
|
-
listener(
|
|
3349
|
-
emitRaw(rawEvent, evPath, { watchedPath:
|
|
3350
|
-
if (evPath &&
|
|
3351
|
-
fsWatchBroadcast(sysPath.resolve(
|
|
3348
|
+
listener(path25);
|
|
3349
|
+
emitRaw(rawEvent, evPath, { watchedPath: path25 });
|
|
3350
|
+
if (evPath && path25 !== evPath) {
|
|
3351
|
+
fsWatchBroadcast(sysPath.resolve(path25, evPath), KEY_LISTENERS, sysPath.join(path25, evPath));
|
|
3352
3352
|
}
|
|
3353
3353
|
};
|
|
3354
3354
|
try {
|
|
3355
|
-
return _fs.watch.call(void 0,
|
|
3355
|
+
return _fs.watch.call(void 0, path25, {
|
|
3356
3356
|
persistent: options.persistent
|
|
3357
3357
|
}, handleEvent);
|
|
3358
3358
|
} catch (error) {
|
|
@@ -3368,12 +3368,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
|
3368
3368
|
listener(val1, val2, val3);
|
|
3369
3369
|
});
|
|
3370
3370
|
};
|
|
3371
|
-
var setFsWatchListener = (
|
|
3371
|
+
var setFsWatchListener = (path25, fullPath, options, handlers) => {
|
|
3372
3372
|
const { listener, errHandler, rawEmitter } = handlers;
|
|
3373
3373
|
let cont = FsWatchInstances.get(fullPath);
|
|
3374
3374
|
let watcher;
|
|
3375
3375
|
if (!options.persistent) {
|
|
3376
|
-
watcher = createFsWatchInstance(
|
|
3376
|
+
watcher = createFsWatchInstance(path25, options, listener, errHandler, rawEmitter);
|
|
3377
3377
|
if (!watcher)
|
|
3378
3378
|
return;
|
|
3379
3379
|
return watcher.close.bind(watcher);
|
|
@@ -3384,7 +3384,7 @@ var setFsWatchListener = (path23, fullPath, options, handlers) => {
|
|
|
3384
3384
|
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
3385
3385
|
} else {
|
|
3386
3386
|
watcher = createFsWatchInstance(
|
|
3387
|
-
|
|
3387
|
+
path25,
|
|
3388
3388
|
options,
|
|
3389
3389
|
fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
|
|
3390
3390
|
errHandler,
|
|
@@ -3399,7 +3399,7 @@ var setFsWatchListener = (path23, fullPath, options, handlers) => {
|
|
|
3399
3399
|
cont.watcherUnusable = true;
|
|
3400
3400
|
if (isWindows && error.code === "EPERM") {
|
|
3401
3401
|
try {
|
|
3402
|
-
const fd = await _promises.open.call(void 0,
|
|
3402
|
+
const fd = await _promises.open.call(void 0, path25, "r");
|
|
3403
3403
|
await fd.close();
|
|
3404
3404
|
broadcastErr(error);
|
|
3405
3405
|
} catch (err) {
|
|
@@ -3430,7 +3430,7 @@ var setFsWatchListener = (path23, fullPath, options, handlers) => {
|
|
|
3430
3430
|
};
|
|
3431
3431
|
};
|
|
3432
3432
|
var FsWatchFileInstances = /* @__PURE__ */ new Map();
|
|
3433
|
-
var setFsWatchFileListener = (
|
|
3433
|
+
var setFsWatchFileListener = (path25, fullPath, options, handlers) => {
|
|
3434
3434
|
const { listener, rawEmitter } = handlers;
|
|
3435
3435
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
3436
3436
|
const copts = cont && cont.options;
|
|
@@ -3452,7 +3452,7 @@ var setFsWatchFileListener = (path23, fullPath, options, handlers) => {
|
|
|
3452
3452
|
});
|
|
3453
3453
|
const currmtime = curr.mtimeMs;
|
|
3454
3454
|
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
3455
|
-
foreach(cont.listeners, (listener2) => listener2(
|
|
3455
|
+
foreach(cont.listeners, (listener2) => listener2(path25, curr));
|
|
3456
3456
|
}
|
|
3457
3457
|
})
|
|
3458
3458
|
};
|
|
@@ -3480,13 +3480,13 @@ var NodeFsHandler = class {
|
|
|
3480
3480
|
* @param listener on fs change
|
|
3481
3481
|
* @returns closer for the watcher instance
|
|
3482
3482
|
*/
|
|
3483
|
-
_watchWithNodeFs(
|
|
3483
|
+
_watchWithNodeFs(path25, listener) {
|
|
3484
3484
|
const opts = this.fsw.options;
|
|
3485
|
-
const directory = sysPath.dirname(
|
|
3486
|
-
const basename4 = sysPath.basename(
|
|
3485
|
+
const directory = sysPath.dirname(path25);
|
|
3486
|
+
const basename4 = sysPath.basename(path25);
|
|
3487
3487
|
const parent = this.fsw._getWatchedDir(directory);
|
|
3488
3488
|
parent.add(basename4);
|
|
3489
|
-
const absolutePath = sysPath.resolve(
|
|
3489
|
+
const absolutePath = sysPath.resolve(path25);
|
|
3490
3490
|
const options = {
|
|
3491
3491
|
persistent: opts.persistent
|
|
3492
3492
|
};
|
|
@@ -3496,12 +3496,12 @@ var NodeFsHandler = class {
|
|
|
3496
3496
|
if (opts.usePolling) {
|
|
3497
3497
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
3498
3498
|
options.interval = enableBin && isBinaryPath(basename4) ? opts.binaryInterval : opts.interval;
|
|
3499
|
-
closer = setFsWatchFileListener(
|
|
3499
|
+
closer = setFsWatchFileListener(path25, absolutePath, options, {
|
|
3500
3500
|
listener,
|
|
3501
3501
|
rawEmitter: this.fsw._emitRaw
|
|
3502
3502
|
});
|
|
3503
3503
|
} else {
|
|
3504
|
-
closer = setFsWatchListener(
|
|
3504
|
+
closer = setFsWatchListener(path25, absolutePath, options, {
|
|
3505
3505
|
listener,
|
|
3506
3506
|
errHandler: this._boundHandleError,
|
|
3507
3507
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -3523,7 +3523,7 @@ var NodeFsHandler = class {
|
|
|
3523
3523
|
let prevStats = stats;
|
|
3524
3524
|
if (parent.has(basename4))
|
|
3525
3525
|
return;
|
|
3526
|
-
const listener = async (
|
|
3526
|
+
const listener = async (path25, newStats) => {
|
|
3527
3527
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
|
|
3528
3528
|
return;
|
|
3529
3529
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
@@ -3537,11 +3537,11 @@ var NodeFsHandler = class {
|
|
|
3537
3537
|
this.fsw._emit(EV.CHANGE, file, newStats2);
|
|
3538
3538
|
}
|
|
3539
3539
|
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
3540
|
-
this.fsw._closeFile(
|
|
3540
|
+
this.fsw._closeFile(path25);
|
|
3541
3541
|
prevStats = newStats2;
|
|
3542
3542
|
const closer2 = this._watchWithNodeFs(file, listener);
|
|
3543
3543
|
if (closer2)
|
|
3544
|
-
this.fsw._addPathCloser(
|
|
3544
|
+
this.fsw._addPathCloser(path25, closer2);
|
|
3545
3545
|
} else {
|
|
3546
3546
|
prevStats = newStats2;
|
|
3547
3547
|
}
|
|
@@ -3573,7 +3573,7 @@ var NodeFsHandler = class {
|
|
|
3573
3573
|
* @param item basename of this item
|
|
3574
3574
|
* @returns true if no more processing is needed for this entry.
|
|
3575
3575
|
*/
|
|
3576
|
-
async _handleSymlink(entry, directory,
|
|
3576
|
+
async _handleSymlink(entry, directory, path25, item) {
|
|
3577
3577
|
if (this.fsw.closed) {
|
|
3578
3578
|
return;
|
|
3579
3579
|
}
|
|
@@ -3583,7 +3583,7 @@ var NodeFsHandler = class {
|
|
|
3583
3583
|
this.fsw._incrReadyCount();
|
|
3584
3584
|
let linkPath;
|
|
3585
3585
|
try {
|
|
3586
|
-
linkPath = await _promises.realpath.call(void 0,
|
|
3586
|
+
linkPath = await _promises.realpath.call(void 0, path25);
|
|
3587
3587
|
} catch (e) {
|
|
3588
3588
|
this.fsw._emitReady();
|
|
3589
3589
|
return true;
|
|
@@ -3593,12 +3593,12 @@ var NodeFsHandler = class {
|
|
|
3593
3593
|
if (dir.has(item)) {
|
|
3594
3594
|
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
3595
3595
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
3596
|
-
this.fsw._emit(EV.CHANGE,
|
|
3596
|
+
this.fsw._emit(EV.CHANGE, path25, entry.stats);
|
|
3597
3597
|
}
|
|
3598
3598
|
} else {
|
|
3599
3599
|
dir.add(item);
|
|
3600
3600
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
3601
|
-
this.fsw._emit(EV.ADD,
|
|
3601
|
+
this.fsw._emit(EV.ADD, path25, entry.stats);
|
|
3602
3602
|
}
|
|
3603
3603
|
this.fsw._emitReady();
|
|
3604
3604
|
return true;
|
|
@@ -3627,9 +3627,9 @@ var NodeFsHandler = class {
|
|
|
3627
3627
|
return;
|
|
3628
3628
|
}
|
|
3629
3629
|
const item = entry.path;
|
|
3630
|
-
let
|
|
3630
|
+
let path25 = sysPath.join(directory, item);
|
|
3631
3631
|
current2.add(item);
|
|
3632
|
-
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory,
|
|
3632
|
+
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path25, item)) {
|
|
3633
3633
|
return;
|
|
3634
3634
|
}
|
|
3635
3635
|
if (this.fsw.closed) {
|
|
@@ -3638,8 +3638,8 @@ var NodeFsHandler = class {
|
|
|
3638
3638
|
}
|
|
3639
3639
|
if (item === target || !target && !previous.has(item)) {
|
|
3640
3640
|
this.fsw._incrReadyCount();
|
|
3641
|
-
|
|
3642
|
-
this._addToNodeFs(
|
|
3641
|
+
path25 = sysPath.join(dir, sysPath.relative(dir, path25));
|
|
3642
|
+
this._addToNodeFs(path25, initialAdd, wh, depth + 1);
|
|
3643
3643
|
}
|
|
3644
3644
|
}).on(EV.ERROR, this._boundHandleError);
|
|
3645
3645
|
return new Promise((resolve8, reject) => {
|
|
@@ -3708,13 +3708,13 @@ var NodeFsHandler = class {
|
|
|
3708
3708
|
* @param depth Child path actually targeted for watch
|
|
3709
3709
|
* @param target Child path actually targeted for watch
|
|
3710
3710
|
*/
|
|
3711
|
-
async _addToNodeFs(
|
|
3711
|
+
async _addToNodeFs(path25, initialAdd, priorWh, depth, target) {
|
|
3712
3712
|
const ready = this.fsw._emitReady;
|
|
3713
|
-
if (this.fsw._isIgnored(
|
|
3713
|
+
if (this.fsw._isIgnored(path25) || this.fsw.closed) {
|
|
3714
3714
|
ready();
|
|
3715
3715
|
return false;
|
|
3716
3716
|
}
|
|
3717
|
-
const wh = this.fsw._getWatchHelpers(
|
|
3717
|
+
const wh = this.fsw._getWatchHelpers(path25);
|
|
3718
3718
|
if (priorWh) {
|
|
3719
3719
|
wh.filterPath = (entry) => priorWh.filterPath(entry);
|
|
3720
3720
|
wh.filterDir = (entry) => priorWh.filterDir(entry);
|
|
@@ -3730,8 +3730,8 @@ var NodeFsHandler = class {
|
|
|
3730
3730
|
const follow = this.fsw.options.followSymlinks;
|
|
3731
3731
|
let closer;
|
|
3732
3732
|
if (stats.isDirectory()) {
|
|
3733
|
-
const absPath = sysPath.resolve(
|
|
3734
|
-
const targetPath = follow ? await _promises.realpath.call(void 0,
|
|
3733
|
+
const absPath = sysPath.resolve(path25);
|
|
3734
|
+
const targetPath = follow ? await _promises.realpath.call(void 0, path25) : path25;
|
|
3735
3735
|
if (this.fsw.closed)
|
|
3736
3736
|
return;
|
|
3737
3737
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -3741,29 +3741,29 @@ var NodeFsHandler = class {
|
|
|
3741
3741
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
3742
3742
|
}
|
|
3743
3743
|
} else if (stats.isSymbolicLink()) {
|
|
3744
|
-
const targetPath = follow ? await _promises.realpath.call(void 0,
|
|
3744
|
+
const targetPath = follow ? await _promises.realpath.call(void 0, path25) : path25;
|
|
3745
3745
|
if (this.fsw.closed)
|
|
3746
3746
|
return;
|
|
3747
3747
|
const parent = sysPath.dirname(wh.watchPath);
|
|
3748
3748
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
3749
3749
|
this.fsw._emit(EV.ADD, wh.watchPath, stats);
|
|
3750
|
-
closer = await this._handleDir(parent, stats, initialAdd, depth,
|
|
3750
|
+
closer = await this._handleDir(parent, stats, initialAdd, depth, path25, wh, targetPath);
|
|
3751
3751
|
if (this.fsw.closed)
|
|
3752
3752
|
return;
|
|
3753
3753
|
if (targetPath !== void 0) {
|
|
3754
|
-
this.fsw._symlinkPaths.set(sysPath.resolve(
|
|
3754
|
+
this.fsw._symlinkPaths.set(sysPath.resolve(path25), targetPath);
|
|
3755
3755
|
}
|
|
3756
3756
|
} else {
|
|
3757
3757
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
3758
3758
|
}
|
|
3759
3759
|
ready();
|
|
3760
3760
|
if (closer)
|
|
3761
|
-
this.fsw._addPathCloser(
|
|
3761
|
+
this.fsw._addPathCloser(path25, closer);
|
|
3762
3762
|
return false;
|
|
3763
3763
|
} catch (error) {
|
|
3764
3764
|
if (this.fsw._handleError(error)) {
|
|
3765
3765
|
ready();
|
|
3766
|
-
return
|
|
3766
|
+
return path25;
|
|
3767
3767
|
}
|
|
3768
3768
|
}
|
|
3769
3769
|
}
|
|
@@ -3806,26 +3806,26 @@ function createPattern(matcher) {
|
|
|
3806
3806
|
}
|
|
3807
3807
|
return () => false;
|
|
3808
3808
|
}
|
|
3809
|
-
function normalizePath(
|
|
3810
|
-
if (typeof
|
|
3809
|
+
function normalizePath(path25) {
|
|
3810
|
+
if (typeof path25 !== "string")
|
|
3811
3811
|
throw new Error("string expected");
|
|
3812
|
-
|
|
3813
|
-
|
|
3812
|
+
path25 = sysPath2.normalize(path25);
|
|
3813
|
+
path25 = path25.replace(/\\/g, "/");
|
|
3814
3814
|
let prepend = false;
|
|
3815
|
-
if (
|
|
3815
|
+
if (path25.startsWith("//"))
|
|
3816
3816
|
prepend = true;
|
|
3817
3817
|
const DOUBLE_SLASH_RE2 = /\/\//;
|
|
3818
|
-
while (
|
|
3819
|
-
|
|
3818
|
+
while (path25.match(DOUBLE_SLASH_RE2))
|
|
3819
|
+
path25 = path25.replace(DOUBLE_SLASH_RE2, "/");
|
|
3820
3820
|
if (prepend)
|
|
3821
|
-
|
|
3822
|
-
return
|
|
3821
|
+
path25 = "/" + path25;
|
|
3822
|
+
return path25;
|
|
3823
3823
|
}
|
|
3824
3824
|
function matchPatterns(patterns, testString, stats) {
|
|
3825
|
-
const
|
|
3825
|
+
const path25 = normalizePath(testString);
|
|
3826
3826
|
for (let index = 0; index < patterns.length; index++) {
|
|
3827
3827
|
const pattern = patterns[index];
|
|
3828
|
-
if (pattern(
|
|
3828
|
+
if (pattern(path25, stats)) {
|
|
3829
3829
|
return true;
|
|
3830
3830
|
}
|
|
3831
3831
|
}
|
|
@@ -3865,19 +3865,19 @@ var toUnix = (string) => {
|
|
|
3865
3865
|
}
|
|
3866
3866
|
return str;
|
|
3867
3867
|
};
|
|
3868
|
-
var normalizePathToUnix = (
|
|
3869
|
-
var normalizeIgnored = (cwd = "") => (
|
|
3870
|
-
if (typeof
|
|
3871
|
-
return normalizePathToUnix(sysPath2.isAbsolute(
|
|
3868
|
+
var normalizePathToUnix = (path25) => toUnix(sysPath2.normalize(toUnix(path25)));
|
|
3869
|
+
var normalizeIgnored = (cwd = "") => (path25) => {
|
|
3870
|
+
if (typeof path25 === "string") {
|
|
3871
|
+
return normalizePathToUnix(sysPath2.isAbsolute(path25) ? path25 : sysPath2.join(cwd, path25));
|
|
3872
3872
|
} else {
|
|
3873
|
-
return
|
|
3873
|
+
return path25;
|
|
3874
3874
|
}
|
|
3875
3875
|
};
|
|
3876
|
-
var getAbsolutePath = (
|
|
3877
|
-
if (sysPath2.isAbsolute(
|
|
3878
|
-
return
|
|
3876
|
+
var getAbsolutePath = (path25, cwd) => {
|
|
3877
|
+
if (sysPath2.isAbsolute(path25)) {
|
|
3878
|
+
return path25;
|
|
3879
3879
|
}
|
|
3880
|
-
return sysPath2.join(cwd,
|
|
3880
|
+
return sysPath2.join(cwd, path25);
|
|
3881
3881
|
};
|
|
3882
3882
|
var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
|
|
3883
3883
|
var DirEntry = class {
|
|
@@ -3932,10 +3932,10 @@ var DirEntry = class {
|
|
|
3932
3932
|
var STAT_METHOD_F = "stat";
|
|
3933
3933
|
var STAT_METHOD_L = "lstat";
|
|
3934
3934
|
var WatchHelper = class {
|
|
3935
|
-
constructor(
|
|
3935
|
+
constructor(path25, follow, fsw) {
|
|
3936
3936
|
this.fsw = fsw;
|
|
3937
|
-
const watchPath =
|
|
3938
|
-
this.path =
|
|
3937
|
+
const watchPath = path25;
|
|
3938
|
+
this.path = path25 = path25.replace(REPLACER_RE, "");
|
|
3939
3939
|
this.watchPath = watchPath;
|
|
3940
3940
|
this.fullWatchPath = sysPath2.resolve(watchPath);
|
|
3941
3941
|
this.dirParts = [];
|
|
@@ -4057,20 +4057,20 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4057
4057
|
this._closePromise = void 0;
|
|
4058
4058
|
let paths = unifyPaths(paths_);
|
|
4059
4059
|
if (cwd) {
|
|
4060
|
-
paths = paths.map((
|
|
4061
|
-
const absPath = getAbsolutePath(
|
|
4060
|
+
paths = paths.map((path25) => {
|
|
4061
|
+
const absPath = getAbsolutePath(path25, cwd);
|
|
4062
4062
|
return absPath;
|
|
4063
4063
|
});
|
|
4064
4064
|
}
|
|
4065
|
-
paths.forEach((
|
|
4066
|
-
this._removeIgnoredPath(
|
|
4065
|
+
paths.forEach((path25) => {
|
|
4066
|
+
this._removeIgnoredPath(path25);
|
|
4067
4067
|
});
|
|
4068
4068
|
this._userIgnored = void 0;
|
|
4069
4069
|
if (!this._readyCount)
|
|
4070
4070
|
this._readyCount = 0;
|
|
4071
4071
|
this._readyCount += paths.length;
|
|
4072
|
-
Promise.all(paths.map(async (
|
|
4073
|
-
const res = await this._nodeFsHandler._addToNodeFs(
|
|
4072
|
+
Promise.all(paths.map(async (path25) => {
|
|
4073
|
+
const res = await this._nodeFsHandler._addToNodeFs(path25, !_internal, void 0, 0, _origAdd);
|
|
4074
4074
|
if (res)
|
|
4075
4075
|
this._emitReady();
|
|
4076
4076
|
return res;
|
|
@@ -4092,17 +4092,17 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4092
4092
|
return this;
|
|
4093
4093
|
const paths = unifyPaths(paths_);
|
|
4094
4094
|
const { cwd } = this.options;
|
|
4095
|
-
paths.forEach((
|
|
4096
|
-
if (!sysPath2.isAbsolute(
|
|
4095
|
+
paths.forEach((path25) => {
|
|
4096
|
+
if (!sysPath2.isAbsolute(path25) && !this._closers.has(path25)) {
|
|
4097
4097
|
if (cwd)
|
|
4098
|
-
|
|
4099
|
-
|
|
4098
|
+
path25 = sysPath2.join(cwd, path25);
|
|
4099
|
+
path25 = sysPath2.resolve(path25);
|
|
4100
4100
|
}
|
|
4101
|
-
this._closePath(
|
|
4102
|
-
this._addIgnoredPath(
|
|
4103
|
-
if (this._watched.has(
|
|
4101
|
+
this._closePath(path25);
|
|
4102
|
+
this._addIgnoredPath(path25);
|
|
4103
|
+
if (this._watched.has(path25)) {
|
|
4104
4104
|
this._addIgnoredPath({
|
|
4105
|
-
path:
|
|
4105
|
+
path: path25,
|
|
4106
4106
|
recursive: true
|
|
4107
4107
|
});
|
|
4108
4108
|
}
|
|
@@ -4166,38 +4166,38 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4166
4166
|
* @param stats arguments to be passed with event
|
|
4167
4167
|
* @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
|
4168
4168
|
*/
|
|
4169
|
-
async _emit(event,
|
|
4169
|
+
async _emit(event, path25, stats) {
|
|
4170
4170
|
if (this.closed)
|
|
4171
4171
|
return;
|
|
4172
4172
|
const opts = this.options;
|
|
4173
4173
|
if (isWindows)
|
|
4174
|
-
|
|
4174
|
+
path25 = sysPath2.normalize(path25);
|
|
4175
4175
|
if (opts.cwd)
|
|
4176
|
-
|
|
4177
|
-
const args = [
|
|
4176
|
+
path25 = sysPath2.relative(opts.cwd, path25);
|
|
4177
|
+
const args = [path25];
|
|
4178
4178
|
if (stats != null)
|
|
4179
4179
|
args.push(stats);
|
|
4180
4180
|
const awf = opts.awaitWriteFinish;
|
|
4181
4181
|
let pw;
|
|
4182
|
-
if (awf && (pw = this._pendingWrites.get(
|
|
4182
|
+
if (awf && (pw = this._pendingWrites.get(path25))) {
|
|
4183
4183
|
pw.lastChange = /* @__PURE__ */ new Date();
|
|
4184
4184
|
return this;
|
|
4185
4185
|
}
|
|
4186
4186
|
if (opts.atomic) {
|
|
4187
4187
|
if (event === EVENTS.UNLINK) {
|
|
4188
|
-
this._pendingUnlinks.set(
|
|
4188
|
+
this._pendingUnlinks.set(path25, [event, ...args]);
|
|
4189
4189
|
setTimeout(() => {
|
|
4190
|
-
this._pendingUnlinks.forEach((entry,
|
|
4190
|
+
this._pendingUnlinks.forEach((entry, path26) => {
|
|
4191
4191
|
this.emit(...entry);
|
|
4192
4192
|
this.emit(EVENTS.ALL, ...entry);
|
|
4193
|
-
this._pendingUnlinks.delete(
|
|
4193
|
+
this._pendingUnlinks.delete(path26);
|
|
4194
4194
|
});
|
|
4195
4195
|
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
4196
4196
|
return this;
|
|
4197
4197
|
}
|
|
4198
|
-
if (event === EVENTS.ADD && this._pendingUnlinks.has(
|
|
4198
|
+
if (event === EVENTS.ADD && this._pendingUnlinks.has(path25)) {
|
|
4199
4199
|
event = EVENTS.CHANGE;
|
|
4200
|
-
this._pendingUnlinks.delete(
|
|
4200
|
+
this._pendingUnlinks.delete(path25);
|
|
4201
4201
|
}
|
|
4202
4202
|
}
|
|
4203
4203
|
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
@@ -4215,16 +4215,16 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4215
4215
|
this.emitWithAll(event, args);
|
|
4216
4216
|
}
|
|
4217
4217
|
};
|
|
4218
|
-
this._awaitWriteFinish(
|
|
4218
|
+
this._awaitWriteFinish(path25, awf.stabilityThreshold, event, awfEmit);
|
|
4219
4219
|
return this;
|
|
4220
4220
|
}
|
|
4221
4221
|
if (event === EVENTS.CHANGE) {
|
|
4222
|
-
const isThrottled = !this._throttle(EVENTS.CHANGE,
|
|
4222
|
+
const isThrottled = !this._throttle(EVENTS.CHANGE, path25, 50);
|
|
4223
4223
|
if (isThrottled)
|
|
4224
4224
|
return this;
|
|
4225
4225
|
}
|
|
4226
4226
|
if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
4227
|
-
const fullPath = opts.cwd ? sysPath2.join(opts.cwd,
|
|
4227
|
+
const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path25) : path25;
|
|
4228
4228
|
let stats2;
|
|
4229
4229
|
try {
|
|
4230
4230
|
stats2 = await _promises.stat.call(void 0, fullPath);
|
|
@@ -4255,23 +4255,23 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4255
4255
|
* @param timeout duration of time to suppress duplicate actions
|
|
4256
4256
|
* @returns tracking object or false if action should be suppressed
|
|
4257
4257
|
*/
|
|
4258
|
-
_throttle(actionType,
|
|
4258
|
+
_throttle(actionType, path25, timeout) {
|
|
4259
4259
|
if (!this._throttled.has(actionType)) {
|
|
4260
4260
|
this._throttled.set(actionType, /* @__PURE__ */ new Map());
|
|
4261
4261
|
}
|
|
4262
4262
|
const action = this._throttled.get(actionType);
|
|
4263
4263
|
if (!action)
|
|
4264
4264
|
throw new Error("invalid throttle");
|
|
4265
|
-
const actionPath = action.get(
|
|
4265
|
+
const actionPath = action.get(path25);
|
|
4266
4266
|
if (actionPath) {
|
|
4267
4267
|
actionPath.count++;
|
|
4268
4268
|
return false;
|
|
4269
4269
|
}
|
|
4270
4270
|
let timeoutObject;
|
|
4271
4271
|
const clear = () => {
|
|
4272
|
-
const item = action.get(
|
|
4272
|
+
const item = action.get(path25);
|
|
4273
4273
|
const count = item ? item.count : 0;
|
|
4274
|
-
action.delete(
|
|
4274
|
+
action.delete(path25);
|
|
4275
4275
|
clearTimeout(timeoutObject);
|
|
4276
4276
|
if (item)
|
|
4277
4277
|
clearTimeout(item.timeoutObject);
|
|
@@ -4279,7 +4279,7 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4279
4279
|
};
|
|
4280
4280
|
timeoutObject = setTimeout(clear, timeout);
|
|
4281
4281
|
const thr = { timeoutObject, clear, count: 0 };
|
|
4282
|
-
action.set(
|
|
4282
|
+
action.set(path25, thr);
|
|
4283
4283
|
return thr;
|
|
4284
4284
|
}
|
|
4285
4285
|
_incrReadyCount() {
|
|
@@ -4293,44 +4293,44 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4293
4293
|
* @param event
|
|
4294
4294
|
* @param awfEmit Callback to be called when ready for event to be emitted.
|
|
4295
4295
|
*/
|
|
4296
|
-
_awaitWriteFinish(
|
|
4296
|
+
_awaitWriteFinish(path25, threshold, event, awfEmit) {
|
|
4297
4297
|
const awf = this.options.awaitWriteFinish;
|
|
4298
4298
|
if (typeof awf !== "object")
|
|
4299
4299
|
return;
|
|
4300
4300
|
const pollInterval = awf.pollInterval;
|
|
4301
4301
|
let timeoutHandler;
|
|
4302
|
-
let fullPath =
|
|
4303
|
-
if (this.options.cwd && !sysPath2.isAbsolute(
|
|
4304
|
-
fullPath = sysPath2.join(this.options.cwd,
|
|
4302
|
+
let fullPath = path25;
|
|
4303
|
+
if (this.options.cwd && !sysPath2.isAbsolute(path25)) {
|
|
4304
|
+
fullPath = sysPath2.join(this.options.cwd, path25);
|
|
4305
4305
|
}
|
|
4306
4306
|
const now = /* @__PURE__ */ new Date();
|
|
4307
4307
|
const writes = this._pendingWrites;
|
|
4308
4308
|
function awaitWriteFinishFn(prevStat) {
|
|
4309
4309
|
_fs.stat.call(void 0, fullPath, (err, curStat) => {
|
|
4310
|
-
if (err || !writes.has(
|
|
4310
|
+
if (err || !writes.has(path25)) {
|
|
4311
4311
|
if (err && err.code !== "ENOENT")
|
|
4312
4312
|
awfEmit(err);
|
|
4313
4313
|
return;
|
|
4314
4314
|
}
|
|
4315
4315
|
const now2 = Number(/* @__PURE__ */ new Date());
|
|
4316
4316
|
if (prevStat && curStat.size !== prevStat.size) {
|
|
4317
|
-
writes.get(
|
|
4317
|
+
writes.get(path25).lastChange = now2;
|
|
4318
4318
|
}
|
|
4319
|
-
const pw = writes.get(
|
|
4319
|
+
const pw = writes.get(path25);
|
|
4320
4320
|
const df = now2 - pw.lastChange;
|
|
4321
4321
|
if (df >= threshold) {
|
|
4322
|
-
writes.delete(
|
|
4322
|
+
writes.delete(path25);
|
|
4323
4323
|
awfEmit(void 0, curStat);
|
|
4324
4324
|
} else {
|
|
4325
4325
|
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
|
|
4326
4326
|
}
|
|
4327
4327
|
});
|
|
4328
4328
|
}
|
|
4329
|
-
if (!writes.has(
|
|
4330
|
-
writes.set(
|
|
4329
|
+
if (!writes.has(path25)) {
|
|
4330
|
+
writes.set(path25, {
|
|
4331
4331
|
lastChange: now,
|
|
4332
4332
|
cancelWait: () => {
|
|
4333
|
-
writes.delete(
|
|
4333
|
+
writes.delete(path25);
|
|
4334
4334
|
clearTimeout(timeoutHandler);
|
|
4335
4335
|
return event;
|
|
4336
4336
|
}
|
|
@@ -4341,8 +4341,8 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4341
4341
|
/**
|
|
4342
4342
|
* Determines whether user has asked to ignore this path.
|
|
4343
4343
|
*/
|
|
4344
|
-
_isIgnored(
|
|
4345
|
-
if (this.options.atomic && DOT_RE.test(
|
|
4344
|
+
_isIgnored(path25, stats) {
|
|
4345
|
+
if (this.options.atomic && DOT_RE.test(path25))
|
|
4346
4346
|
return true;
|
|
4347
4347
|
if (!this._userIgnored) {
|
|
4348
4348
|
const { cwd } = this.options;
|
|
@@ -4352,17 +4352,17 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4352
4352
|
const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
|
|
4353
4353
|
this._userIgnored = anymatch(list, void 0);
|
|
4354
4354
|
}
|
|
4355
|
-
return this._userIgnored(
|
|
4355
|
+
return this._userIgnored(path25, stats);
|
|
4356
4356
|
}
|
|
4357
|
-
_isntIgnored(
|
|
4358
|
-
return !this._isIgnored(
|
|
4357
|
+
_isntIgnored(path25, stat6) {
|
|
4358
|
+
return !this._isIgnored(path25, stat6);
|
|
4359
4359
|
}
|
|
4360
4360
|
/**
|
|
4361
4361
|
* Provides a set of common helpers and properties relating to symlink handling.
|
|
4362
4362
|
* @param path file or directory pattern being watched
|
|
4363
4363
|
*/
|
|
4364
|
-
_getWatchHelpers(
|
|
4365
|
-
return new WatchHelper(
|
|
4364
|
+
_getWatchHelpers(path25) {
|
|
4365
|
+
return new WatchHelper(path25, this.options.followSymlinks, this);
|
|
4366
4366
|
}
|
|
4367
4367
|
// Directory helpers
|
|
4368
4368
|
// -----------------
|
|
@@ -4394,63 +4394,63 @@ var FSWatcher = class extends _events2.EventEmitter {
|
|
|
4394
4394
|
* @param item base path of item/directory
|
|
4395
4395
|
*/
|
|
4396
4396
|
_remove(directory, item, isDirectory) {
|
|
4397
|
-
const
|
|
4398
|
-
const fullPath = sysPath2.resolve(
|
|
4399
|
-
isDirectory = isDirectory != null ? isDirectory : this._watched.has(
|
|
4400
|
-
if (!this._throttle("remove",
|
|
4397
|
+
const path25 = sysPath2.join(directory, item);
|
|
4398
|
+
const fullPath = sysPath2.resolve(path25);
|
|
4399
|
+
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path25) || this._watched.has(fullPath);
|
|
4400
|
+
if (!this._throttle("remove", path25, 100))
|
|
4401
4401
|
return;
|
|
4402
4402
|
if (!isDirectory && this._watched.size === 1) {
|
|
4403
4403
|
this.add(directory, item, true);
|
|
4404
4404
|
}
|
|
4405
|
-
const wp = this._getWatchedDir(
|
|
4405
|
+
const wp = this._getWatchedDir(path25);
|
|
4406
4406
|
const nestedDirectoryChildren = wp.getChildren();
|
|
4407
|
-
nestedDirectoryChildren.forEach((nested) => this._remove(
|
|
4407
|
+
nestedDirectoryChildren.forEach((nested) => this._remove(path25, nested));
|
|
4408
4408
|
const parent = this._getWatchedDir(directory);
|
|
4409
4409
|
const wasTracked = parent.has(item);
|
|
4410
4410
|
parent.remove(item);
|
|
4411
4411
|
if (this._symlinkPaths.has(fullPath)) {
|
|
4412
4412
|
this._symlinkPaths.delete(fullPath);
|
|
4413
4413
|
}
|
|
4414
|
-
let relPath =
|
|
4414
|
+
let relPath = path25;
|
|
4415
4415
|
if (this.options.cwd)
|
|
4416
|
-
relPath = sysPath2.relative(this.options.cwd,
|
|
4416
|
+
relPath = sysPath2.relative(this.options.cwd, path25);
|
|
4417
4417
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
4418
4418
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
4419
4419
|
if (event === EVENTS.ADD)
|
|
4420
4420
|
return;
|
|
4421
4421
|
}
|
|
4422
|
-
this._watched.delete(
|
|
4422
|
+
this._watched.delete(path25);
|
|
4423
4423
|
this._watched.delete(fullPath);
|
|
4424
4424
|
const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
4425
|
-
if (wasTracked && !this._isIgnored(
|
|
4426
|
-
this._emit(eventName,
|
|
4427
|
-
this._closePath(
|
|
4425
|
+
if (wasTracked && !this._isIgnored(path25))
|
|
4426
|
+
this._emit(eventName, path25);
|
|
4427
|
+
this._closePath(path25);
|
|
4428
4428
|
}
|
|
4429
4429
|
/**
|
|
4430
4430
|
* Closes all watchers for a path
|
|
4431
4431
|
*/
|
|
4432
|
-
_closePath(
|
|
4433
|
-
this._closeFile(
|
|
4434
|
-
const dir = sysPath2.dirname(
|
|
4435
|
-
this._getWatchedDir(dir).remove(sysPath2.basename(
|
|
4432
|
+
_closePath(path25) {
|
|
4433
|
+
this._closeFile(path25);
|
|
4434
|
+
const dir = sysPath2.dirname(path25);
|
|
4435
|
+
this._getWatchedDir(dir).remove(sysPath2.basename(path25));
|
|
4436
4436
|
}
|
|
4437
4437
|
/**
|
|
4438
4438
|
* Closes only file-specific watchers
|
|
4439
4439
|
*/
|
|
4440
|
-
_closeFile(
|
|
4441
|
-
const closers = this._closers.get(
|
|
4440
|
+
_closeFile(path25) {
|
|
4441
|
+
const closers = this._closers.get(path25);
|
|
4442
4442
|
if (!closers)
|
|
4443
4443
|
return;
|
|
4444
4444
|
closers.forEach((closer) => closer());
|
|
4445
|
-
this._closers.delete(
|
|
4445
|
+
this._closers.delete(path25);
|
|
4446
4446
|
}
|
|
4447
|
-
_addPathCloser(
|
|
4447
|
+
_addPathCloser(path25, closer) {
|
|
4448
4448
|
if (!closer)
|
|
4449
4449
|
return;
|
|
4450
|
-
let list = this._closers.get(
|
|
4450
|
+
let list = this._closers.get(path25);
|
|
4451
4451
|
if (!list) {
|
|
4452
4452
|
list = [];
|
|
4453
|
-
this._closers.set(
|
|
4453
|
+
this._closers.set(path25, list);
|
|
4454
4454
|
}
|
|
4455
4455
|
list.push(closer);
|
|
4456
4456
|
}
|
|
@@ -6982,12 +6982,12 @@ var PathBase = (_class6 = class {
|
|
|
6982
6982
|
/**
|
|
6983
6983
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
6984
6984
|
*/
|
|
6985
|
-
resolve(
|
|
6986
|
-
if (!
|
|
6985
|
+
resolve(path25) {
|
|
6986
|
+
if (!path25) {
|
|
6987
6987
|
return this;
|
|
6988
6988
|
}
|
|
6989
|
-
const rootPath = this.getRootString(
|
|
6990
|
-
const dir =
|
|
6989
|
+
const rootPath = this.getRootString(path25);
|
|
6990
|
+
const dir = path25.substring(rootPath.length);
|
|
6991
6991
|
const dirParts = dir.split(this.splitSep);
|
|
6992
6992
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
6993
6993
|
return result;
|
|
@@ -7739,8 +7739,8 @@ var PathWin32 = (_class7 = class _PathWin32 extends PathBase {
|
|
|
7739
7739
|
/**
|
|
7740
7740
|
* @internal
|
|
7741
7741
|
*/
|
|
7742
|
-
getRootString(
|
|
7743
|
-
return _path.win32.parse(
|
|
7742
|
+
getRootString(path25) {
|
|
7743
|
+
return _path.win32.parse(path25).root;
|
|
7744
7744
|
}
|
|
7745
7745
|
/**
|
|
7746
7746
|
* @internal
|
|
@@ -7786,8 +7786,8 @@ var PathPosix = (_class8 = class _PathPosix extends PathBase {
|
|
|
7786
7786
|
/**
|
|
7787
7787
|
* @internal
|
|
7788
7788
|
*/
|
|
7789
|
-
getRootString(
|
|
7790
|
-
return
|
|
7789
|
+
getRootString(path25) {
|
|
7790
|
+
return path25.startsWith("/") ? "/" : "";
|
|
7791
7791
|
}
|
|
7792
7792
|
/**
|
|
7793
7793
|
* @internal
|
|
@@ -7836,8 +7836,8 @@ var PathScurryBase = class {
|
|
|
7836
7836
|
*
|
|
7837
7837
|
* @internal
|
|
7838
7838
|
*/
|
|
7839
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
7840
|
-
this.#fs = fsFromOption(
|
|
7839
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs19 = defaultFS } = {}) {
|
|
7840
|
+
this.#fs = fsFromOption(fs19);
|
|
7841
7841
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
7842
7842
|
cwd = _url.fileURLToPath.call(void 0, cwd);
|
|
7843
7843
|
}
|
|
@@ -7876,11 +7876,11 @@ var PathScurryBase = class {
|
|
|
7876
7876
|
/**
|
|
7877
7877
|
* Get the depth of a provided path, string, or the cwd
|
|
7878
7878
|
*/
|
|
7879
|
-
depth(
|
|
7880
|
-
if (typeof
|
|
7881
|
-
|
|
7879
|
+
depth(path25 = this.cwd) {
|
|
7880
|
+
if (typeof path25 === "string") {
|
|
7881
|
+
path25 = this.cwd.resolve(path25);
|
|
7882
7882
|
}
|
|
7883
|
-
return
|
|
7883
|
+
return path25.depth();
|
|
7884
7884
|
}
|
|
7885
7885
|
/**
|
|
7886
7886
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -8367,9 +8367,9 @@ var PathScurryBase = class {
|
|
|
8367
8367
|
process9();
|
|
8368
8368
|
return results;
|
|
8369
8369
|
}
|
|
8370
|
-
chdir(
|
|
8370
|
+
chdir(path25 = this.cwd) {
|
|
8371
8371
|
const oldCwd = this.cwd;
|
|
8372
|
-
this.cwd = typeof
|
|
8372
|
+
this.cwd = typeof path25 === "string" ? this.cwd.resolve(path25) : path25;
|
|
8373
8373
|
this.cwd[setAsCwd](oldCwd);
|
|
8374
8374
|
}
|
|
8375
8375
|
};
|
|
@@ -8395,8 +8395,8 @@ var PathScurryWin32 = (_class9 = class extends PathScurryBase {
|
|
|
8395
8395
|
/**
|
|
8396
8396
|
* @internal
|
|
8397
8397
|
*/
|
|
8398
|
-
newRoot(
|
|
8399
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
8398
|
+
newRoot(fs19) {
|
|
8399
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs19 });
|
|
8400
8400
|
}
|
|
8401
8401
|
/**
|
|
8402
8402
|
* Return true if the provided path string is an absolute path
|
|
@@ -8424,8 +8424,8 @@ var PathScurryPosix = (_class10 = class extends PathScurryBase {
|
|
|
8424
8424
|
/**
|
|
8425
8425
|
* @internal
|
|
8426
8426
|
*/
|
|
8427
|
-
newRoot(
|
|
8428
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
8427
|
+
newRoot(fs19) {
|
|
8428
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs19 });
|
|
8429
8429
|
}
|
|
8430
8430
|
/**
|
|
8431
8431
|
* Return true if the provided path string is an absolute path
|
|
@@ -8731,8 +8731,8 @@ var MatchRecord = (_class11 = class {constructor() { _class11.prototype.__init28
|
|
|
8731
8731
|
}
|
|
8732
8732
|
// match, absolute, ifdir
|
|
8733
8733
|
entries() {
|
|
8734
|
-
return [...this.store.entries()].map(([
|
|
8735
|
-
|
|
8734
|
+
return [...this.store.entries()].map(([path25, n2]) => [
|
|
8735
|
+
path25,
|
|
8736
8736
|
!!(n2 & 2),
|
|
8737
8737
|
!!(n2 & 1)
|
|
8738
8738
|
]);
|
|
@@ -8937,9 +8937,9 @@ var GlobUtil = (_class14 = class {
|
|
|
8937
8937
|
|
|
8938
8938
|
|
|
8939
8939
|
|
|
8940
|
-
constructor(patterns,
|
|
8940
|
+
constructor(patterns, path25, opts) {;_class14.prototype.__init32.call(this);_class14.prototype.__init33.call(this);_class14.prototype.__init34.call(this);
|
|
8941
8941
|
this.patterns = patterns;
|
|
8942
|
-
this.path =
|
|
8942
|
+
this.path = path25;
|
|
8943
8943
|
this.opts = opts;
|
|
8944
8944
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
8945
8945
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -8958,11 +8958,11 @@ var GlobUtil = (_class14 = class {
|
|
|
8958
8958
|
});
|
|
8959
8959
|
}
|
|
8960
8960
|
}
|
|
8961
|
-
#ignored(
|
|
8962
|
-
return this.seen.has(
|
|
8961
|
+
#ignored(path25) {
|
|
8962
|
+
return this.seen.has(path25) || !!_optionalChain([this, 'access', _125 => _125.#ignore, 'optionalAccess', _126 => _126.ignored, 'optionalCall', _127 => _127(path25)]);
|
|
8963
8963
|
}
|
|
8964
|
-
#childrenIgnored(
|
|
8965
|
-
return !!_optionalChain([this, 'access', _128 => _128.#ignore, 'optionalAccess', _129 => _129.childrenIgnored, 'optionalCall', _130 => _130(
|
|
8964
|
+
#childrenIgnored(path25) {
|
|
8965
|
+
return !!_optionalChain([this, 'access', _128 => _128.#ignore, 'optionalAccess', _129 => _129.childrenIgnored, 'optionalCall', _130 => _130(path25)]);
|
|
8966
8966
|
}
|
|
8967
8967
|
// backpressure mechanism
|
|
8968
8968
|
pause() {
|
|
@@ -9177,8 +9177,8 @@ var GlobUtil = (_class14 = class {
|
|
|
9177
9177
|
}, _class14);
|
|
9178
9178
|
var GlobWalker = (_class15 = class extends GlobUtil {
|
|
9179
9179
|
__init35() {this.matches = /* @__PURE__ */ new Set()}
|
|
9180
|
-
constructor(patterns,
|
|
9181
|
-
super(patterns,
|
|
9180
|
+
constructor(patterns, path25, opts) {
|
|
9181
|
+
super(patterns, path25, opts);_class15.prototype.__init35.call(this);;
|
|
9182
9182
|
}
|
|
9183
9183
|
matchEmit(e) {
|
|
9184
9184
|
this.matches.add(e);
|
|
@@ -9215,8 +9215,8 @@ var GlobWalker = (_class15 = class extends GlobUtil {
|
|
|
9215
9215
|
}, _class15);
|
|
9216
9216
|
var GlobStream = class extends GlobUtil {
|
|
9217
9217
|
|
|
9218
|
-
constructor(patterns,
|
|
9219
|
-
super(patterns,
|
|
9218
|
+
constructor(patterns, path25, opts) {
|
|
9219
|
+
super(patterns, path25, opts);
|
|
9220
9220
|
this.results = new Minipass({
|
|
9221
9221
|
signal: this.signal,
|
|
9222
9222
|
objectMode: true
|
|
@@ -9553,44 +9553,44 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
9553
9553
|
var platform_default = process.env.__TESTING_RIMRAF_PLATFORM__ || process.platform;
|
|
9554
9554
|
|
|
9555
9555
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/path-arg.js
|
|
9556
|
-
var pathArg = (
|
|
9557
|
-
const type = typeof
|
|
9556
|
+
var pathArg = (path25, opt = {}) => {
|
|
9557
|
+
const type = typeof path25;
|
|
9558
9558
|
if (type !== "string") {
|
|
9559
|
-
const ctor =
|
|
9560
|
-
const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? _util.inspect.call(void 0,
|
|
9559
|
+
const ctor = path25 && type === "object" && path25.constructor;
|
|
9560
|
+
const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? _util.inspect.call(void 0, path25) : `type ${type} ${path25}`;
|
|
9561
9561
|
const msg = `The "path" argument must be of type string. Received ${received}`;
|
|
9562
9562
|
throw Object.assign(new TypeError(msg), {
|
|
9563
|
-
path:
|
|
9563
|
+
path: path25,
|
|
9564
9564
|
code: "ERR_INVALID_ARG_TYPE"
|
|
9565
9565
|
});
|
|
9566
9566
|
}
|
|
9567
|
-
if (/\0/.test(
|
|
9567
|
+
if (/\0/.test(path25)) {
|
|
9568
9568
|
const msg = "path must be a string without null bytes";
|
|
9569
9569
|
throw Object.assign(new TypeError(msg), {
|
|
9570
|
-
path:
|
|
9570
|
+
path: path25,
|
|
9571
9571
|
code: "ERR_INVALID_ARG_VALUE"
|
|
9572
9572
|
});
|
|
9573
9573
|
}
|
|
9574
|
-
|
|
9575
|
-
const { root } = _path.parse.call(void 0,
|
|
9576
|
-
if (
|
|
9574
|
+
path25 = _path.resolve.call(void 0, path25);
|
|
9575
|
+
const { root } = _path.parse.call(void 0, path25);
|
|
9576
|
+
if (path25 === root && opt.preserveRoot !== false) {
|
|
9577
9577
|
const msg = "refusing to remove root directory without preserveRoot:false";
|
|
9578
9578
|
throw Object.assign(new Error(msg), {
|
|
9579
|
-
path:
|
|
9579
|
+
path: path25,
|
|
9580
9580
|
code: "ERR_PRESERVE_ROOT"
|
|
9581
9581
|
});
|
|
9582
9582
|
}
|
|
9583
9583
|
if (platform_default === "win32") {
|
|
9584
9584
|
const badWinChars = /[*|"<>?:]/;
|
|
9585
|
-
const { root: root2 } = _path.parse.call(void 0,
|
|
9586
|
-
if (badWinChars.test(
|
|
9585
|
+
const { root: root2 } = _path.parse.call(void 0, path25);
|
|
9586
|
+
if (badWinChars.test(path25.substring(root2.length))) {
|
|
9587
9587
|
throw Object.assign(new Error("Illegal characters in path."), {
|
|
9588
|
-
path:
|
|
9588
|
+
path: path25,
|
|
9589
9589
|
code: "EINVAL"
|
|
9590
9590
|
});
|
|
9591
9591
|
}
|
|
9592
9592
|
}
|
|
9593
|
-
return
|
|
9593
|
+
return path25;
|
|
9594
9594
|
};
|
|
9595
9595
|
var path_arg_default = pathArg;
|
|
9596
9596
|
|
|
@@ -9605,16 +9605,16 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
9605
9605
|
|
|
9606
9606
|
|
|
9607
9607
|
|
|
9608
|
-
var readdirSync2 = (
|
|
9609
|
-
var chmod = (
|
|
9610
|
-
var mkdir = (
|
|
9611
|
-
var readdir4 = (
|
|
9608
|
+
var readdirSync2 = (path25) => _fs.readdirSync.call(void 0, path25, { withFileTypes: true });
|
|
9609
|
+
var chmod = (path25, mode) => new Promise((res, rej) => actualFS.default.chmod(path25, mode, (er, ...d) => er ? rej(er) : res(...d)));
|
|
9610
|
+
var mkdir = (path25, options) => new Promise((res, rej) => actualFS.default.mkdir(path25, options, (er, made) => er ? rej(er) : res(made)));
|
|
9611
|
+
var readdir4 = (path25) => new Promise((res, rej) => actualFS.default.readdir(path25, { withFileTypes: true }, (er, data2) => er ? rej(er) : res(data2)));
|
|
9612
9612
|
var rename = (oldPath, newPath) => new Promise((res, rej) => actualFS.default.rename(oldPath, newPath, (er, ...d) => er ? rej(er) : res(...d)));
|
|
9613
|
-
var rm = (
|
|
9614
|
-
var rmdir = (
|
|
9615
|
-
var stat4 = (
|
|
9616
|
-
var lstat4 = (
|
|
9617
|
-
var unlink = (
|
|
9613
|
+
var rm = (path25, options) => new Promise((res, rej) => actualFS.default.rm(path25, options, (er, ...d) => er ? rej(er) : res(...d)));
|
|
9614
|
+
var rmdir = (path25) => new Promise((res, rej) => actualFS.default.rmdir(path25, (er, ...d) => er ? rej(er) : res(...d)));
|
|
9615
|
+
var stat4 = (path25) => new Promise((res, rej) => actualFS.default.stat(path25, (er, data2) => er ? rej(er) : res(data2)));
|
|
9616
|
+
var lstat4 = (path25) => new Promise((res, rej) => actualFS.default.lstat(path25, (er, data2) => er ? rej(er) : res(data2)));
|
|
9617
|
+
var unlink = (path25) => new Promise((res, rej) => actualFS.default.unlink(path25, (er, ...d) => er ? rej(er) : res(...d)));
|
|
9618
9618
|
var promises = {
|
|
9619
9619
|
chmod,
|
|
9620
9620
|
mkdir,
|
|
@@ -9633,10 +9633,10 @@ var promises = {
|
|
|
9633
9633
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/readdir-or-error.js
|
|
9634
9634
|
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
9635
9635
|
var { readdir: readdir5 } = promises;
|
|
9636
|
-
var readdirOrError = (
|
|
9637
|
-
var readdirOrErrorSync = (
|
|
9636
|
+
var readdirOrError = (path25) => readdir5(path25).catch((er) => er);
|
|
9637
|
+
var readdirOrErrorSync = (path25) => {
|
|
9638
9638
|
try {
|
|
9639
|
-
return readdirSync2(
|
|
9639
|
+
return readdirSync2(path25);
|
|
9640
9640
|
} catch (er) {
|
|
9641
9641
|
return er;
|
|
9642
9642
|
}
|
|
@@ -9661,35 +9661,35 @@ var ignoreENOENTSync = (fn) => {
|
|
|
9661
9661
|
|
|
9662
9662
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-posix.js
|
|
9663
9663
|
var { lstat: lstat5, rmdir: rmdir2, unlink: unlink2 } = promises;
|
|
9664
|
-
var rimrafPosix = async (
|
|
9664
|
+
var rimrafPosix = async (path25, opt) => {
|
|
9665
9665
|
if (_optionalChain([opt, 'optionalAccess', _164 => _164.signal, 'optionalAccess', _165 => _165.aborted])) {
|
|
9666
9666
|
throw opt.signal.reason;
|
|
9667
9667
|
}
|
|
9668
9668
|
try {
|
|
9669
|
-
return await rimrafPosixDir(
|
|
9669
|
+
return await rimrafPosixDir(path25, opt, await lstat5(path25));
|
|
9670
9670
|
} catch (er) {
|
|
9671
9671
|
if (_optionalChain([er, 'optionalAccess', _166 => _166.code]) === "ENOENT")
|
|
9672
9672
|
return true;
|
|
9673
9673
|
throw er;
|
|
9674
9674
|
}
|
|
9675
9675
|
};
|
|
9676
|
-
var rimrafPosixSync = (
|
|
9676
|
+
var rimrafPosixSync = (path25, opt) => {
|
|
9677
9677
|
if (_optionalChain([opt, 'optionalAccess', _167 => _167.signal, 'optionalAccess', _168 => _168.aborted])) {
|
|
9678
9678
|
throw opt.signal.reason;
|
|
9679
9679
|
}
|
|
9680
9680
|
try {
|
|
9681
|
-
return rimrafPosixDirSync(
|
|
9681
|
+
return rimrafPosixDirSync(path25, opt, _fs.lstatSync.call(void 0, path25));
|
|
9682
9682
|
} catch (er) {
|
|
9683
9683
|
if (_optionalChain([er, 'optionalAccess', _169 => _169.code]) === "ENOENT")
|
|
9684
9684
|
return true;
|
|
9685
9685
|
throw er;
|
|
9686
9686
|
}
|
|
9687
9687
|
};
|
|
9688
|
-
var rimrafPosixDir = async (
|
|
9688
|
+
var rimrafPosixDir = async (path25, opt, ent) => {
|
|
9689
9689
|
if (_optionalChain([opt, 'optionalAccess', _170 => _170.signal, 'optionalAccess', _171 => _171.aborted])) {
|
|
9690
9690
|
throw opt.signal.reason;
|
|
9691
9691
|
}
|
|
9692
|
-
const entries = ent.isDirectory() ? await readdirOrError(
|
|
9692
|
+
const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
|
|
9693
9693
|
if (!Array.isArray(entries)) {
|
|
9694
9694
|
if (entries) {
|
|
9695
9695
|
if (entries.code === "ENOENT") {
|
|
@@ -9699,30 +9699,30 @@ var rimrafPosixDir = async (path23, opt, ent) => {
|
|
|
9699
9699
|
throw entries;
|
|
9700
9700
|
}
|
|
9701
9701
|
}
|
|
9702
|
-
if (opt.filter && !await opt.filter(
|
|
9702
|
+
if (opt.filter && !await opt.filter(path25, ent)) {
|
|
9703
9703
|
return false;
|
|
9704
9704
|
}
|
|
9705
|
-
await ignoreENOENT(unlink2(
|
|
9705
|
+
await ignoreENOENT(unlink2(path25));
|
|
9706
9706
|
return true;
|
|
9707
9707
|
}
|
|
9708
|
-
const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(_path.resolve.call(void 0,
|
|
9708
|
+
const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
|
|
9709
9709
|
if (!removedAll) {
|
|
9710
9710
|
return false;
|
|
9711
9711
|
}
|
|
9712
|
-
if (opt.preserveRoot === false &&
|
|
9712
|
+
if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
|
|
9713
9713
|
return false;
|
|
9714
9714
|
}
|
|
9715
|
-
if (opt.filter && !await opt.filter(
|
|
9715
|
+
if (opt.filter && !await opt.filter(path25, ent)) {
|
|
9716
9716
|
return false;
|
|
9717
9717
|
}
|
|
9718
|
-
await ignoreENOENT(rmdir2(
|
|
9718
|
+
await ignoreENOENT(rmdir2(path25));
|
|
9719
9719
|
return true;
|
|
9720
9720
|
};
|
|
9721
|
-
var rimrafPosixDirSync = (
|
|
9721
|
+
var rimrafPosixDirSync = (path25, opt, ent) => {
|
|
9722
9722
|
if (_optionalChain([opt, 'optionalAccess', _172 => _172.signal, 'optionalAccess', _173 => _173.aborted])) {
|
|
9723
9723
|
throw opt.signal.reason;
|
|
9724
9724
|
}
|
|
9725
|
-
const entries = ent.isDirectory() ? readdirOrErrorSync(
|
|
9725
|
+
const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
|
|
9726
9726
|
if (!Array.isArray(entries)) {
|
|
9727
9727
|
if (entries) {
|
|
9728
9728
|
if (entries.code === "ENOENT") {
|
|
@@ -9732,27 +9732,27 @@ var rimrafPosixDirSync = (path23, opt, ent) => {
|
|
|
9732
9732
|
throw entries;
|
|
9733
9733
|
}
|
|
9734
9734
|
}
|
|
9735
|
-
if (opt.filter && !opt.filter(
|
|
9735
|
+
if (opt.filter && !opt.filter(path25, ent)) {
|
|
9736
9736
|
return false;
|
|
9737
9737
|
}
|
|
9738
|
-
ignoreENOENTSync(() => _fs.unlinkSync.call(void 0,
|
|
9738
|
+
ignoreENOENTSync(() => _fs.unlinkSync.call(void 0, path25));
|
|
9739
9739
|
return true;
|
|
9740
9740
|
}
|
|
9741
9741
|
let removedAll = true;
|
|
9742
9742
|
for (const ent2 of entries) {
|
|
9743
|
-
const p = _path.resolve.call(void 0,
|
|
9743
|
+
const p = _path.resolve.call(void 0, path25, ent2.name);
|
|
9744
9744
|
removedAll = rimrafPosixDirSync(p, opt, ent2) && removedAll;
|
|
9745
9745
|
}
|
|
9746
|
-
if (opt.preserveRoot === false &&
|
|
9746
|
+
if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
|
|
9747
9747
|
return false;
|
|
9748
9748
|
}
|
|
9749
9749
|
if (!removedAll) {
|
|
9750
9750
|
return false;
|
|
9751
9751
|
}
|
|
9752
|
-
if (opt.filter && !opt.filter(
|
|
9752
|
+
if (opt.filter && !opt.filter(path25, ent)) {
|
|
9753
9753
|
return false;
|
|
9754
9754
|
}
|
|
9755
|
-
ignoreENOENTSync(() => _fs.rmdirSync.call(void 0,
|
|
9755
|
+
ignoreENOENTSync(() => _fs.rmdirSync.call(void 0, path25));
|
|
9756
9756
|
return true;
|
|
9757
9757
|
};
|
|
9758
9758
|
|
|
@@ -9763,9 +9763,9 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
9763
9763
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/fix-eperm.js
|
|
9764
9764
|
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
9765
9765
|
var { chmod: chmod2 } = promises;
|
|
9766
|
-
var fixEPERM = (fn) => async (
|
|
9766
|
+
var fixEPERM = (fn) => async (path25) => {
|
|
9767
9767
|
try {
|
|
9768
|
-
return await fn(
|
|
9768
|
+
return await fn(path25);
|
|
9769
9769
|
} catch (er) {
|
|
9770
9770
|
const fer = er;
|
|
9771
9771
|
if (_optionalChain([fer, 'optionalAccess', _174 => _174.code]) === "ENOENT") {
|
|
@@ -9773,7 +9773,7 @@ var fixEPERM = (fn) => async (path23) => {
|
|
|
9773
9773
|
}
|
|
9774
9774
|
if (_optionalChain([fer, 'optionalAccess', _175 => _175.code]) === "EPERM") {
|
|
9775
9775
|
try {
|
|
9776
|
-
await chmod2(
|
|
9776
|
+
await chmod2(path25, 438);
|
|
9777
9777
|
} catch (er2) {
|
|
9778
9778
|
const fer2 = er2;
|
|
9779
9779
|
if (_optionalChain([fer2, 'optionalAccess', _176 => _176.code]) === "ENOENT") {
|
|
@@ -9781,14 +9781,14 @@ var fixEPERM = (fn) => async (path23) => {
|
|
|
9781
9781
|
}
|
|
9782
9782
|
throw er;
|
|
9783
9783
|
}
|
|
9784
|
-
return await fn(
|
|
9784
|
+
return await fn(path25);
|
|
9785
9785
|
}
|
|
9786
9786
|
throw er;
|
|
9787
9787
|
}
|
|
9788
9788
|
};
|
|
9789
|
-
var fixEPERMSync = (fn) => (
|
|
9789
|
+
var fixEPERMSync = (fn) => (path25) => {
|
|
9790
9790
|
try {
|
|
9791
|
-
return fn(
|
|
9791
|
+
return fn(path25);
|
|
9792
9792
|
} catch (er) {
|
|
9793
9793
|
const fer = er;
|
|
9794
9794
|
if (_optionalChain([fer, 'optionalAccess', _177 => _177.code]) === "ENOENT") {
|
|
@@ -9796,7 +9796,7 @@ var fixEPERMSync = (fn) => (path23) => {
|
|
|
9796
9796
|
}
|
|
9797
9797
|
if (_optionalChain([fer, 'optionalAccess', _178 => _178.code]) === "EPERM") {
|
|
9798
9798
|
try {
|
|
9799
|
-
_fs.chmodSync.call(void 0,
|
|
9799
|
+
_fs.chmodSync.call(void 0, path25, 438);
|
|
9800
9800
|
} catch (er2) {
|
|
9801
9801
|
const fer2 = er2;
|
|
9802
9802
|
if (_optionalChain([fer2, 'optionalAccess', _179 => _179.code]) === "ENOENT") {
|
|
@@ -9804,7 +9804,7 @@ var fixEPERMSync = (fn) => (path23) => {
|
|
|
9804
9804
|
}
|
|
9805
9805
|
throw er;
|
|
9806
9806
|
}
|
|
9807
|
-
return fn(
|
|
9807
|
+
return fn(path25);
|
|
9808
9808
|
}
|
|
9809
9809
|
throw er;
|
|
9810
9810
|
}
|
|
@@ -9817,23 +9817,23 @@ var RATE = 1.2;
|
|
|
9817
9817
|
var MAXRETRIES = 10;
|
|
9818
9818
|
var codes = /* @__PURE__ */ new Set(["EMFILE", "ENFILE", "EBUSY"]);
|
|
9819
9819
|
var retryBusy = (fn) => {
|
|
9820
|
-
const method = async (
|
|
9820
|
+
const method = async (path25, opt, backoff = 1, total = 0) => {
|
|
9821
9821
|
const mbo = opt.maxBackoff || MAXBACKOFF;
|
|
9822
9822
|
const rate = opt.backoff || RATE;
|
|
9823
9823
|
const max = opt.maxRetries || MAXRETRIES;
|
|
9824
9824
|
let retries = 0;
|
|
9825
9825
|
while (true) {
|
|
9826
9826
|
try {
|
|
9827
|
-
return await fn(
|
|
9827
|
+
return await fn(path25);
|
|
9828
9828
|
} catch (er) {
|
|
9829
9829
|
const fer = er;
|
|
9830
|
-
if (_optionalChain([fer, 'optionalAccess', _180 => _180.path]) ===
|
|
9830
|
+
if (_optionalChain([fer, 'optionalAccess', _180 => _180.path]) === path25 && _optionalChain([fer, 'optionalAccess', _181 => _181.code]) && codes.has(fer.code)) {
|
|
9831
9831
|
backoff = Math.ceil(backoff * rate);
|
|
9832
9832
|
total = backoff + total;
|
|
9833
9833
|
if (total < mbo) {
|
|
9834
9834
|
return new Promise((res, rej) => {
|
|
9835
9835
|
setTimeout(() => {
|
|
9836
|
-
method(
|
|
9836
|
+
method(path25, opt, backoff, total).then(res, rej);
|
|
9837
9837
|
}, backoff);
|
|
9838
9838
|
});
|
|
9839
9839
|
}
|
|
@@ -9849,15 +9849,15 @@ var retryBusy = (fn) => {
|
|
|
9849
9849
|
return method;
|
|
9850
9850
|
};
|
|
9851
9851
|
var retryBusySync = (fn) => {
|
|
9852
|
-
const method = (
|
|
9852
|
+
const method = (path25, opt) => {
|
|
9853
9853
|
const max = opt.maxRetries || MAXRETRIES;
|
|
9854
9854
|
let retries = 0;
|
|
9855
9855
|
while (true) {
|
|
9856
9856
|
try {
|
|
9857
|
-
return fn(
|
|
9857
|
+
return fn(path25);
|
|
9858
9858
|
} catch (er) {
|
|
9859
9859
|
const fer = er;
|
|
9860
|
-
if (_optionalChain([fer, 'optionalAccess', _182 => _182.path]) ===
|
|
9860
|
+
if (_optionalChain([fer, 'optionalAccess', _182 => _182.path]) === path25 && _optionalChain([fer, 'optionalAccess', _183 => _183.code]) && codes.has(fer.code) && retries < max) {
|
|
9861
9861
|
retries++;
|
|
9862
9862
|
continue;
|
|
9863
9863
|
}
|
|
@@ -9877,16 +9877,16 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
9877
9877
|
|
|
9878
9878
|
|
|
9879
9879
|
var { stat: stat5 } = promises;
|
|
9880
|
-
var isDirSync = (
|
|
9880
|
+
var isDirSync = (path25) => {
|
|
9881
9881
|
try {
|
|
9882
|
-
return _fs.statSync.call(void 0,
|
|
9882
|
+
return _fs.statSync.call(void 0, path25).isDirectory();
|
|
9883
9883
|
} catch (er) {
|
|
9884
9884
|
return false;
|
|
9885
9885
|
}
|
|
9886
9886
|
};
|
|
9887
|
-
var isDir = (
|
|
9888
|
-
var win32DefaultTmp = async (
|
|
9889
|
-
const { root } = _path.parse.call(void 0,
|
|
9887
|
+
var isDir = (path25) => stat5(path25).then((st) => st.isDirectory(), () => false);
|
|
9888
|
+
var win32DefaultTmp = async (path25) => {
|
|
9889
|
+
const { root } = _path.parse.call(void 0, path25);
|
|
9890
9890
|
const tmp = _os.tmpdir.call(void 0, );
|
|
9891
9891
|
const { root: tmpRoot } = _path.parse.call(void 0, tmp);
|
|
9892
9892
|
if (root.toLowerCase() === tmpRoot.toLowerCase()) {
|
|
@@ -9898,8 +9898,8 @@ var win32DefaultTmp = async (path23) => {
|
|
|
9898
9898
|
}
|
|
9899
9899
|
return root;
|
|
9900
9900
|
};
|
|
9901
|
-
var win32DefaultTmpSync = (
|
|
9902
|
-
const { root } = _path.parse.call(void 0,
|
|
9901
|
+
var win32DefaultTmpSync = (path25) => {
|
|
9902
|
+
const { root } = _path.parse.call(void 0, path25);
|
|
9903
9903
|
const tmp = _os.tmpdir.call(void 0, );
|
|
9904
9904
|
const { root: tmpRoot } = _path.parse.call(void 0, tmp);
|
|
9905
9905
|
if (root.toLowerCase() === tmpRoot.toLowerCase()) {
|
|
@@ -9918,10 +9918,10 @@ var defaultTmpSync = platform_default === "win32" ? win32DefaultTmpSync : posixD
|
|
|
9918
9918
|
|
|
9919
9919
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-move-remove.js
|
|
9920
9920
|
var { lstat: lstat6, rename: rename2, unlink: unlink3, rmdir: rmdir3, chmod: chmod3 } = promises;
|
|
9921
|
-
var uniqueFilename = (
|
|
9922
|
-
var unlinkFixEPERM = async (
|
|
9921
|
+
var uniqueFilename = (path25) => `.${_path.basename.call(void 0, path25)}.${Math.random()}`;
|
|
9922
|
+
var unlinkFixEPERM = async (path25) => unlink3(path25).catch((er) => {
|
|
9923
9923
|
if (er.code === "EPERM") {
|
|
9924
|
-
return chmod3(
|
|
9924
|
+
return chmod3(path25, 438).then(() => unlink3(path25), (er2) => {
|
|
9925
9925
|
if (er2.code === "ENOENT") {
|
|
9926
9926
|
return;
|
|
9927
9927
|
}
|
|
@@ -9932,13 +9932,13 @@ var unlinkFixEPERM = async (path23) => unlink3(path23).catch((er) => {
|
|
|
9932
9932
|
}
|
|
9933
9933
|
throw er;
|
|
9934
9934
|
});
|
|
9935
|
-
var unlinkFixEPERMSync = (
|
|
9935
|
+
var unlinkFixEPERMSync = (path25) => {
|
|
9936
9936
|
try {
|
|
9937
|
-
_fs.unlinkSync.call(void 0,
|
|
9937
|
+
_fs.unlinkSync.call(void 0, path25);
|
|
9938
9938
|
} catch (er) {
|
|
9939
9939
|
if (_optionalChain([er, 'optionalAccess', _184 => _184.code]) === "EPERM") {
|
|
9940
9940
|
try {
|
|
9941
|
-
return _fs.chmodSync.call(void 0,
|
|
9941
|
+
return _fs.chmodSync.call(void 0, path25, 438);
|
|
9942
9942
|
} catch (er2) {
|
|
9943
9943
|
if (_optionalChain([er2, 'optionalAccess', _185 => _185.code]) === "ENOENT") {
|
|
9944
9944
|
return;
|
|
@@ -9951,29 +9951,29 @@ var unlinkFixEPERMSync = (path23) => {
|
|
|
9951
9951
|
throw er;
|
|
9952
9952
|
}
|
|
9953
9953
|
};
|
|
9954
|
-
var rimrafMoveRemove = async (
|
|
9954
|
+
var rimrafMoveRemove = async (path25, opt) => {
|
|
9955
9955
|
if (_optionalChain([opt, 'optionalAccess', _187 => _187.signal, 'optionalAccess', _188 => _188.aborted])) {
|
|
9956
9956
|
throw opt.signal.reason;
|
|
9957
9957
|
}
|
|
9958
9958
|
try {
|
|
9959
|
-
return await rimrafMoveRemoveDir(
|
|
9959
|
+
return await rimrafMoveRemoveDir(path25, opt, await lstat6(path25));
|
|
9960
9960
|
} catch (er) {
|
|
9961
9961
|
if (_optionalChain([er, 'optionalAccess', _189 => _189.code]) === "ENOENT")
|
|
9962
9962
|
return true;
|
|
9963
9963
|
throw er;
|
|
9964
9964
|
}
|
|
9965
9965
|
};
|
|
9966
|
-
var rimrafMoveRemoveDir = async (
|
|
9966
|
+
var rimrafMoveRemoveDir = async (path25, opt, ent) => {
|
|
9967
9967
|
if (_optionalChain([opt, 'optionalAccess', _190 => _190.signal, 'optionalAccess', _191 => _191.aborted])) {
|
|
9968
9968
|
throw opt.signal.reason;
|
|
9969
9969
|
}
|
|
9970
9970
|
if (!opt.tmp) {
|
|
9971
|
-
return rimrafMoveRemoveDir(
|
|
9971
|
+
return rimrafMoveRemoveDir(path25, { ...opt, tmp: await defaultTmp(path25) }, ent);
|
|
9972
9972
|
}
|
|
9973
|
-
if (
|
|
9973
|
+
if (path25 === opt.tmp && _path.parse.call(void 0, path25).root !== path25) {
|
|
9974
9974
|
throw new Error("cannot delete temp directory used for deletion");
|
|
9975
9975
|
}
|
|
9976
|
-
const entries = ent.isDirectory() ? await readdirOrError(
|
|
9976
|
+
const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
|
|
9977
9977
|
if (!Array.isArray(entries)) {
|
|
9978
9978
|
if (entries) {
|
|
9979
9979
|
if (entries.code === "ENOENT") {
|
|
@@ -9983,54 +9983,54 @@ var rimrafMoveRemoveDir = async (path23, opt, ent) => {
|
|
|
9983
9983
|
throw entries;
|
|
9984
9984
|
}
|
|
9985
9985
|
}
|
|
9986
|
-
if (opt.filter && !await opt.filter(
|
|
9986
|
+
if (opt.filter && !await opt.filter(path25, ent)) {
|
|
9987
9987
|
return false;
|
|
9988
9988
|
}
|
|
9989
|
-
await ignoreENOENT(tmpUnlink(
|
|
9989
|
+
await ignoreENOENT(tmpUnlink(path25, opt.tmp, unlinkFixEPERM));
|
|
9990
9990
|
return true;
|
|
9991
9991
|
}
|
|
9992
|
-
const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(_path.resolve.call(void 0,
|
|
9992
|
+
const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
|
|
9993
9993
|
if (!removedAll) {
|
|
9994
9994
|
return false;
|
|
9995
9995
|
}
|
|
9996
|
-
if (opt.preserveRoot === false &&
|
|
9996
|
+
if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
|
|
9997
9997
|
return false;
|
|
9998
9998
|
}
|
|
9999
|
-
if (opt.filter && !await opt.filter(
|
|
9999
|
+
if (opt.filter && !await opt.filter(path25, ent)) {
|
|
10000
10000
|
return false;
|
|
10001
10001
|
}
|
|
10002
|
-
await ignoreENOENT(tmpUnlink(
|
|
10002
|
+
await ignoreENOENT(tmpUnlink(path25, opt.tmp, rmdir3));
|
|
10003
10003
|
return true;
|
|
10004
10004
|
};
|
|
10005
|
-
var tmpUnlink = async (
|
|
10006
|
-
const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(
|
|
10007
|
-
await rename2(
|
|
10005
|
+
var tmpUnlink = async (path25, tmp, rm3) => {
|
|
10006
|
+
const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path25));
|
|
10007
|
+
await rename2(path25, tmpFile);
|
|
10008
10008
|
return await rm3(tmpFile);
|
|
10009
10009
|
};
|
|
10010
|
-
var rimrafMoveRemoveSync = (
|
|
10010
|
+
var rimrafMoveRemoveSync = (path25, opt) => {
|
|
10011
10011
|
if (_optionalChain([opt, 'optionalAccess', _192 => _192.signal, 'optionalAccess', _193 => _193.aborted])) {
|
|
10012
10012
|
throw opt.signal.reason;
|
|
10013
10013
|
}
|
|
10014
10014
|
try {
|
|
10015
|
-
return rimrafMoveRemoveDirSync(
|
|
10015
|
+
return rimrafMoveRemoveDirSync(path25, opt, _fs.lstatSync.call(void 0, path25));
|
|
10016
10016
|
} catch (er) {
|
|
10017
10017
|
if (_optionalChain([er, 'optionalAccess', _194 => _194.code]) === "ENOENT")
|
|
10018
10018
|
return true;
|
|
10019
10019
|
throw er;
|
|
10020
10020
|
}
|
|
10021
10021
|
};
|
|
10022
|
-
var rimrafMoveRemoveDirSync = (
|
|
10022
|
+
var rimrafMoveRemoveDirSync = (path25, opt, ent) => {
|
|
10023
10023
|
if (_optionalChain([opt, 'optionalAccess', _195 => _195.signal, 'optionalAccess', _196 => _196.aborted])) {
|
|
10024
10024
|
throw opt.signal.reason;
|
|
10025
10025
|
}
|
|
10026
10026
|
if (!opt.tmp) {
|
|
10027
|
-
return rimrafMoveRemoveDirSync(
|
|
10027
|
+
return rimrafMoveRemoveDirSync(path25, { ...opt, tmp: defaultTmpSync(path25) }, ent);
|
|
10028
10028
|
}
|
|
10029
10029
|
const tmp = opt.tmp;
|
|
10030
|
-
if (
|
|
10030
|
+
if (path25 === opt.tmp && _path.parse.call(void 0, path25).root !== path25) {
|
|
10031
10031
|
throw new Error("cannot delete temp directory used for deletion");
|
|
10032
10032
|
}
|
|
10033
|
-
const entries = ent.isDirectory() ? readdirOrErrorSync(
|
|
10033
|
+
const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
|
|
10034
10034
|
if (!Array.isArray(entries)) {
|
|
10035
10035
|
if (entries) {
|
|
10036
10036
|
if (entries.code === "ENOENT") {
|
|
@@ -10040,32 +10040,32 @@ var rimrafMoveRemoveDirSync = (path23, opt, ent) => {
|
|
|
10040
10040
|
throw entries;
|
|
10041
10041
|
}
|
|
10042
10042
|
}
|
|
10043
|
-
if (opt.filter && !opt.filter(
|
|
10043
|
+
if (opt.filter && !opt.filter(path25, ent)) {
|
|
10044
10044
|
return false;
|
|
10045
10045
|
}
|
|
10046
|
-
ignoreENOENTSync(() => tmpUnlinkSync(
|
|
10046
|
+
ignoreENOENTSync(() => tmpUnlinkSync(path25, tmp, unlinkFixEPERMSync));
|
|
10047
10047
|
return true;
|
|
10048
10048
|
}
|
|
10049
10049
|
let removedAll = true;
|
|
10050
10050
|
for (const ent2 of entries) {
|
|
10051
|
-
const p = _path.resolve.call(void 0,
|
|
10051
|
+
const p = _path.resolve.call(void 0, path25, ent2.name);
|
|
10052
10052
|
removedAll = rimrafMoveRemoveDirSync(p, opt, ent2) && removedAll;
|
|
10053
10053
|
}
|
|
10054
10054
|
if (!removedAll) {
|
|
10055
10055
|
return false;
|
|
10056
10056
|
}
|
|
10057
|
-
if (opt.preserveRoot === false &&
|
|
10057
|
+
if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
|
|
10058
10058
|
return false;
|
|
10059
10059
|
}
|
|
10060
|
-
if (opt.filter && !opt.filter(
|
|
10060
|
+
if (opt.filter && !opt.filter(path25, ent)) {
|
|
10061
10061
|
return false;
|
|
10062
10062
|
}
|
|
10063
|
-
ignoreENOENTSync(() => tmpUnlinkSync(
|
|
10063
|
+
ignoreENOENTSync(() => tmpUnlinkSync(path25, tmp, _fs.rmdirSync));
|
|
10064
10064
|
return true;
|
|
10065
10065
|
};
|
|
10066
|
-
var tmpUnlinkSync = (
|
|
10067
|
-
const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(
|
|
10068
|
-
_fs.renameSync.call(void 0,
|
|
10066
|
+
var tmpUnlinkSync = (path25, tmp, rmSync2) => {
|
|
10067
|
+
const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path25));
|
|
10068
|
+
_fs.renameSync.call(void 0, path25, tmpFile);
|
|
10069
10069
|
return rmSync2(tmpFile);
|
|
10070
10070
|
};
|
|
10071
10071
|
|
|
@@ -10075,31 +10075,31 @@ var rimrafWindowsFile = retryBusy(fixEPERM(unlink4));
|
|
|
10075
10075
|
var rimrafWindowsFileSync = retryBusySync(fixEPERMSync(_fs.unlinkSync));
|
|
10076
10076
|
var rimrafWindowsDirRetry = retryBusy(fixEPERM(rmdir4));
|
|
10077
10077
|
var rimrafWindowsDirRetrySync = retryBusySync(fixEPERMSync(_fs.rmdirSync));
|
|
10078
|
-
var rimrafWindowsDirMoveRemoveFallback = async (
|
|
10078
|
+
var rimrafWindowsDirMoveRemoveFallback = async (path25, opt) => {
|
|
10079
10079
|
if (_optionalChain([opt, 'optionalAccess', _197 => _197.signal, 'optionalAccess', _198 => _198.aborted])) {
|
|
10080
10080
|
throw opt.signal.reason;
|
|
10081
10081
|
}
|
|
10082
10082
|
const { filter: filter3, ...options } = opt;
|
|
10083
10083
|
try {
|
|
10084
|
-
return await rimrafWindowsDirRetry(
|
|
10084
|
+
return await rimrafWindowsDirRetry(path25, options);
|
|
10085
10085
|
} catch (er) {
|
|
10086
10086
|
if (_optionalChain([er, 'optionalAccess', _199 => _199.code]) === "ENOTEMPTY") {
|
|
10087
|
-
return await rimrafMoveRemove(
|
|
10087
|
+
return await rimrafMoveRemove(path25, options);
|
|
10088
10088
|
}
|
|
10089
10089
|
throw er;
|
|
10090
10090
|
}
|
|
10091
10091
|
};
|
|
10092
|
-
var rimrafWindowsDirMoveRemoveFallbackSync = (
|
|
10092
|
+
var rimrafWindowsDirMoveRemoveFallbackSync = (path25, opt) => {
|
|
10093
10093
|
if (_optionalChain([opt, 'optionalAccess', _200 => _200.signal, 'optionalAccess', _201 => _201.aborted])) {
|
|
10094
10094
|
throw opt.signal.reason;
|
|
10095
10095
|
}
|
|
10096
10096
|
const { filter: filter3, ...options } = opt;
|
|
10097
10097
|
try {
|
|
10098
|
-
return rimrafWindowsDirRetrySync(
|
|
10098
|
+
return rimrafWindowsDirRetrySync(path25, options);
|
|
10099
10099
|
} catch (er) {
|
|
10100
10100
|
const fer = er;
|
|
10101
10101
|
if (_optionalChain([fer, 'optionalAccess', _202 => _202.code]) === "ENOTEMPTY") {
|
|
10102
|
-
return rimrafMoveRemoveSync(
|
|
10102
|
+
return rimrafMoveRemoveSync(path25, options);
|
|
10103
10103
|
}
|
|
10104
10104
|
throw er;
|
|
10105
10105
|
}
|
|
@@ -10107,35 +10107,35 @@ var rimrafWindowsDirMoveRemoveFallbackSync = (path23, opt) => {
|
|
|
10107
10107
|
var START = Symbol("start");
|
|
10108
10108
|
var CHILD = Symbol("child");
|
|
10109
10109
|
var FINISH = Symbol("finish");
|
|
10110
|
-
var rimrafWindows = async (
|
|
10110
|
+
var rimrafWindows = async (path25, opt) => {
|
|
10111
10111
|
if (_optionalChain([opt, 'optionalAccess', _203 => _203.signal, 'optionalAccess', _204 => _204.aborted])) {
|
|
10112
10112
|
throw opt.signal.reason;
|
|
10113
10113
|
}
|
|
10114
10114
|
try {
|
|
10115
|
-
return await rimrafWindowsDir(
|
|
10115
|
+
return await rimrafWindowsDir(path25, opt, await lstat7(path25), START);
|
|
10116
10116
|
} catch (er) {
|
|
10117
10117
|
if (_optionalChain([er, 'optionalAccess', _205 => _205.code]) === "ENOENT")
|
|
10118
10118
|
return true;
|
|
10119
10119
|
throw er;
|
|
10120
10120
|
}
|
|
10121
10121
|
};
|
|
10122
|
-
var rimrafWindowsSync = (
|
|
10122
|
+
var rimrafWindowsSync = (path25, opt) => {
|
|
10123
10123
|
if (_optionalChain([opt, 'optionalAccess', _206 => _206.signal, 'optionalAccess', _207 => _207.aborted])) {
|
|
10124
10124
|
throw opt.signal.reason;
|
|
10125
10125
|
}
|
|
10126
10126
|
try {
|
|
10127
|
-
return rimrafWindowsDirSync(
|
|
10127
|
+
return rimrafWindowsDirSync(path25, opt, _fs.lstatSync.call(void 0, path25), START);
|
|
10128
10128
|
} catch (er) {
|
|
10129
10129
|
if (_optionalChain([er, 'optionalAccess', _208 => _208.code]) === "ENOENT")
|
|
10130
10130
|
return true;
|
|
10131
10131
|
throw er;
|
|
10132
10132
|
}
|
|
10133
10133
|
};
|
|
10134
|
-
var rimrafWindowsDir = async (
|
|
10134
|
+
var rimrafWindowsDir = async (path25, opt, ent, state = START) => {
|
|
10135
10135
|
if (_optionalChain([opt, 'optionalAccess', _209 => _209.signal, 'optionalAccess', _210 => _210.aborted])) {
|
|
10136
10136
|
throw opt.signal.reason;
|
|
10137
10137
|
}
|
|
10138
|
-
const entries = ent.isDirectory() ? await readdirOrError(
|
|
10138
|
+
const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
|
|
10139
10139
|
if (!Array.isArray(entries)) {
|
|
10140
10140
|
if (entries) {
|
|
10141
10141
|
if (entries.code === "ENOENT") {
|
|
@@ -10145,32 +10145,32 @@ var rimrafWindowsDir = async (path23, opt, ent, state = START) => {
|
|
|
10145
10145
|
throw entries;
|
|
10146
10146
|
}
|
|
10147
10147
|
}
|
|
10148
|
-
if (opt.filter && !await opt.filter(
|
|
10148
|
+
if (opt.filter && !await opt.filter(path25, ent)) {
|
|
10149
10149
|
return false;
|
|
10150
10150
|
}
|
|
10151
|
-
await ignoreENOENT(rimrafWindowsFile(
|
|
10151
|
+
await ignoreENOENT(rimrafWindowsFile(path25, opt));
|
|
10152
10152
|
return true;
|
|
10153
10153
|
}
|
|
10154
10154
|
const s = state === START ? CHILD : state;
|
|
10155
|
-
const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(_path.resolve.call(void 0,
|
|
10155
|
+
const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2, s)))).reduce((a, b) => a && b, true);
|
|
10156
10156
|
if (state === START) {
|
|
10157
|
-
return rimrafWindowsDir(
|
|
10157
|
+
return rimrafWindowsDir(path25, opt, ent, FINISH);
|
|
10158
10158
|
} else if (state === FINISH) {
|
|
10159
|
-
if (opt.preserveRoot === false &&
|
|
10159
|
+
if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
|
|
10160
10160
|
return false;
|
|
10161
10161
|
}
|
|
10162
10162
|
if (!removedAll) {
|
|
10163
10163
|
return false;
|
|
10164
10164
|
}
|
|
10165
|
-
if (opt.filter && !await opt.filter(
|
|
10165
|
+
if (opt.filter && !await opt.filter(path25, ent)) {
|
|
10166
10166
|
return false;
|
|
10167
10167
|
}
|
|
10168
|
-
await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(
|
|
10168
|
+
await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path25, opt));
|
|
10169
10169
|
}
|
|
10170
10170
|
return true;
|
|
10171
10171
|
};
|
|
10172
|
-
var rimrafWindowsDirSync = (
|
|
10173
|
-
const entries = ent.isDirectory() ? readdirOrErrorSync(
|
|
10172
|
+
var rimrafWindowsDirSync = (path25, opt, ent, state = START) => {
|
|
10173
|
+
const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
|
|
10174
10174
|
if (!Array.isArray(entries)) {
|
|
10175
10175
|
if (entries) {
|
|
10176
10176
|
if (entries.code === "ENOENT") {
|
|
@@ -10180,32 +10180,32 @@ var rimrafWindowsDirSync = (path23, opt, ent, state = START) => {
|
|
|
10180
10180
|
throw entries;
|
|
10181
10181
|
}
|
|
10182
10182
|
}
|
|
10183
|
-
if (opt.filter && !opt.filter(
|
|
10183
|
+
if (opt.filter && !opt.filter(path25, ent)) {
|
|
10184
10184
|
return false;
|
|
10185
10185
|
}
|
|
10186
|
-
ignoreENOENTSync(() => rimrafWindowsFileSync(
|
|
10186
|
+
ignoreENOENTSync(() => rimrafWindowsFileSync(path25, opt));
|
|
10187
10187
|
return true;
|
|
10188
10188
|
}
|
|
10189
10189
|
let removedAll = true;
|
|
10190
10190
|
for (const ent2 of entries) {
|
|
10191
10191
|
const s = state === START ? CHILD : state;
|
|
10192
|
-
const p = _path.resolve.call(void 0,
|
|
10192
|
+
const p = _path.resolve.call(void 0, path25, ent2.name);
|
|
10193
10193
|
removedAll = rimrafWindowsDirSync(p, opt, ent2, s) && removedAll;
|
|
10194
10194
|
}
|
|
10195
10195
|
if (state === START) {
|
|
10196
|
-
return rimrafWindowsDirSync(
|
|
10196
|
+
return rimrafWindowsDirSync(path25, opt, ent, FINISH);
|
|
10197
10197
|
} else if (state === FINISH) {
|
|
10198
|
-
if (opt.preserveRoot === false &&
|
|
10198
|
+
if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
|
|
10199
10199
|
return false;
|
|
10200
10200
|
}
|
|
10201
10201
|
if (!removedAll) {
|
|
10202
10202
|
return false;
|
|
10203
10203
|
}
|
|
10204
|
-
if (opt.filter && !opt.filter(
|
|
10204
|
+
if (opt.filter && !opt.filter(path25, ent)) {
|
|
10205
10205
|
return false;
|
|
10206
10206
|
}
|
|
10207
10207
|
ignoreENOENTSync(() => {
|
|
10208
|
-
rimrafWindowsDirMoveRemoveFallbackSync(
|
|
10208
|
+
rimrafWindowsDirMoveRemoveFallbackSync(path25, opt);
|
|
10209
10209
|
});
|
|
10210
10210
|
}
|
|
10211
10211
|
return true;
|
|
@@ -10218,16 +10218,16 @@ var rimrafManualSync = platform_default === "win32" ? rimrafWindowsSync : rimraf
|
|
|
10218
10218
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-native.js
|
|
10219
10219
|
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
10220
10220
|
var { rm: rm2 } = promises;
|
|
10221
|
-
var rimrafNative = async (
|
|
10222
|
-
await rm2(
|
|
10221
|
+
var rimrafNative = async (path25, opt) => {
|
|
10222
|
+
await rm2(path25, {
|
|
10223
10223
|
...opt,
|
|
10224
10224
|
force: true,
|
|
10225
10225
|
recursive: true
|
|
10226
10226
|
});
|
|
10227
10227
|
return true;
|
|
10228
10228
|
};
|
|
10229
|
-
var rimrafNativeSync = (
|
|
10230
|
-
_fs.rmSync.call(void 0,
|
|
10229
|
+
var rimrafNativeSync = (path25, opt) => {
|
|
10230
|
+
_fs.rmSync.call(void 0, path25, {
|
|
10231
10231
|
...opt,
|
|
10232
10232
|
force: true,
|
|
10233
10233
|
recursive: true
|
|
@@ -10245,26 +10245,26 @@ var useNative = !hasNative || platform_default === "win32" ? () => false : (opt)
|
|
|
10245
10245
|
var useNativeSync = !hasNative || platform_default === "win32" ? () => false : (opt) => !_optionalChain([opt, 'optionalAccess', _213 => _213.signal]) && !_optionalChain([opt, 'optionalAccess', _214 => _214.filter]);
|
|
10246
10246
|
|
|
10247
10247
|
// ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/index.js
|
|
10248
|
-
var wrap = (fn) => async (
|
|
10248
|
+
var wrap = (fn) => async (path25, opt) => {
|
|
10249
10249
|
const options = optArg(opt);
|
|
10250
10250
|
if (options.glob) {
|
|
10251
|
-
|
|
10251
|
+
path25 = await glob(path25, options.glob);
|
|
10252
10252
|
}
|
|
10253
|
-
if (Array.isArray(
|
|
10254
|
-
return !!(await Promise.all(
|
|
10253
|
+
if (Array.isArray(path25)) {
|
|
10254
|
+
return !!(await Promise.all(path25.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
|
|
10255
10255
|
} else {
|
|
10256
|
-
return !!await fn(path_arg_default(
|
|
10256
|
+
return !!await fn(path_arg_default(path25, options), options);
|
|
10257
10257
|
}
|
|
10258
10258
|
};
|
|
10259
|
-
var wrapSync = (fn) => (
|
|
10259
|
+
var wrapSync = (fn) => (path25, opt) => {
|
|
10260
10260
|
const options = optArgSync(opt);
|
|
10261
10261
|
if (options.glob) {
|
|
10262
|
-
|
|
10262
|
+
path25 = globSync(path25, options.glob);
|
|
10263
10263
|
}
|
|
10264
|
-
if (Array.isArray(
|
|
10265
|
-
return !!
|
|
10264
|
+
if (Array.isArray(path25)) {
|
|
10265
|
+
return !!path25.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
|
|
10266
10266
|
} else {
|
|
10267
|
-
return !!fn(path_arg_default(
|
|
10267
|
+
return !!fn(path_arg_default(path25, options), options);
|
|
10268
10268
|
}
|
|
10269
10269
|
};
|
|
10270
10270
|
var nativeSync = wrapSync(rimrafNativeSync);
|
|
@@ -10279,8 +10279,8 @@ var moveRemoveSync = wrapSync(rimrafMoveRemoveSync);
|
|
|
10279
10279
|
var moveRemove = Object.assign(wrap(rimrafMoveRemove), {
|
|
10280
10280
|
sync: moveRemoveSync
|
|
10281
10281
|
});
|
|
10282
|
-
var rimrafSync = wrapSync((
|
|
10283
|
-
var rimraf_ = wrap((
|
|
10282
|
+
var rimrafSync = wrapSync((path25, opt) => useNativeSync(opt) ? rimrafNativeSync(path25, opt) : rimrafManualSync(path25, opt));
|
|
10283
|
+
var rimraf_ = wrap((path25, opt) => useNative(opt) ? rimrafNative(path25, opt) : rimrafManual(path25, opt));
|
|
10284
10284
|
var rimraf = Object.assign(rimraf_, {
|
|
10285
10285
|
rimraf: rimraf_,
|
|
10286
10286
|
sync: rimrafSync,
|
|
@@ -16154,17 +16154,17 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
|
|
|
16154
16154
|
if (hasTrailingSlash(input, true)) {
|
|
16155
16155
|
return input || "/";
|
|
16156
16156
|
}
|
|
16157
|
-
let
|
|
16157
|
+
let path25 = input;
|
|
16158
16158
|
let fragment = "";
|
|
16159
16159
|
const fragmentIndex = input.indexOf("#");
|
|
16160
16160
|
if (fragmentIndex !== -1) {
|
|
16161
|
-
|
|
16161
|
+
path25 = input.slice(0, fragmentIndex);
|
|
16162
16162
|
fragment = input.slice(fragmentIndex);
|
|
16163
|
-
if (!
|
|
16163
|
+
if (!path25) {
|
|
16164
16164
|
return fragment;
|
|
16165
16165
|
}
|
|
16166
16166
|
}
|
|
16167
|
-
const [s0, ...s] =
|
|
16167
|
+
const [s0, ...s] = path25.split("?");
|
|
16168
16168
|
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
16169
16169
|
}
|
|
16170
16170
|
function isNonEmptyURL(url) {
|
|
@@ -16193,8 +16193,8 @@ var _assert = require('assert'); var _assert2 = _interopRequireDefault(_assert);
|
|
|
16193
16193
|
var _v8 = require('v8'); var _v82 = _interopRequireDefault(_v8);
|
|
16194
16194
|
|
|
16195
16195
|
var BUILTIN_MODULES = new Set(_module.builtinModules);
|
|
16196
|
-
function normalizeSlash(
|
|
16197
|
-
return
|
|
16196
|
+
function normalizeSlash(path25) {
|
|
16197
|
+
return path25.replace(/\\/g, "/");
|
|
16198
16198
|
}
|
|
16199
16199
|
var own$1 = {}.hasOwnProperty;
|
|
16200
16200
|
var classRegExp = /^([A-Z][a-z\d]*)+$/;
|
|
@@ -16307,8 +16307,8 @@ codes2.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
16307
16307
|
* @param {string} [base]
|
|
16308
16308
|
* @param {string} [message]
|
|
16309
16309
|
*/
|
|
16310
|
-
(
|
|
16311
|
-
return `Invalid package config ${
|
|
16310
|
+
(path25, base, message) => {
|
|
16311
|
+
return `Invalid package config ${path25}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
16312
16312
|
},
|
|
16313
16313
|
Error
|
|
16314
16314
|
);
|
|
@@ -16340,8 +16340,8 @@ codes2.ERR_MODULE_NOT_FOUND = createError(
|
|
|
16340
16340
|
* @param {string} base
|
|
16341
16341
|
* @param {boolean} [exactUrl]
|
|
16342
16342
|
*/
|
|
16343
|
-
(
|
|
16344
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${
|
|
16343
|
+
(path25, base, exactUrl = false) => {
|
|
16344
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path25}' imported from ${base}`;
|
|
16345
16345
|
},
|
|
16346
16346
|
Error
|
|
16347
16347
|
);
|
|
@@ -16392,8 +16392,8 @@ codes2.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
16392
16392
|
* @param {string} extension
|
|
16393
16393
|
* @param {string} path
|
|
16394
16394
|
*/
|
|
16395
|
-
(extension,
|
|
16396
|
-
return `Unknown file extension "${extension}" for ${
|
|
16395
|
+
(extension, path25) => {
|
|
16396
|
+
return `Unknown file extension "${extension}" for ${path25}`;
|
|
16397
16397
|
},
|
|
16398
16398
|
TypeError
|
|
16399
16399
|
);
|
|
@@ -16764,9 +16764,9 @@ Default "index" lookups for the main are deprecated for ES modules.`,
|
|
|
16764
16764
|
);
|
|
16765
16765
|
}
|
|
16766
16766
|
}
|
|
16767
|
-
function tryStatSync(
|
|
16767
|
+
function tryStatSync(path25) {
|
|
16768
16768
|
try {
|
|
16769
|
-
return _fs.statSync.call(void 0,
|
|
16769
|
+
return _fs.statSync.call(void 0, path25);
|
|
16770
16770
|
} catch (e6) {
|
|
16771
16771
|
}
|
|
16772
16772
|
}
|
|
@@ -17685,7 +17685,7 @@ function findUpSync(name, {
|
|
|
17685
17685
|
directory = sysPath2.default.dirname(directory);
|
|
17686
17686
|
}
|
|
17687
17687
|
}
|
|
17688
|
-
function _resolve2(
|
|
17688
|
+
function _resolve2(path25, options = {}) {
|
|
17689
17689
|
if (options.platform === "auto" || !options.platform)
|
|
17690
17690
|
options.platform = _process2.default.platform === "win32" ? "win32" : "posix";
|
|
17691
17691
|
if (_process2.default.versions.pnp) {
|
|
@@ -17694,11 +17694,11 @@ function _resolve2(path23, options = {}) {
|
|
|
17694
17694
|
paths.push(_process2.default.cwd());
|
|
17695
17695
|
const targetRequire = _module.createRequire.call(void 0, _chunkOS76JPG2cjs.importMetaUrl);
|
|
17696
17696
|
try {
|
|
17697
|
-
return targetRequire.resolve(
|
|
17697
|
+
return targetRequire.resolve(path25, { paths });
|
|
17698
17698
|
} catch (e10) {
|
|
17699
17699
|
}
|
|
17700
17700
|
}
|
|
17701
|
-
const modulePath = resolvePathSync(
|
|
17701
|
+
const modulePath = resolvePathSync(path25, {
|
|
17702
17702
|
url: options.paths
|
|
17703
17703
|
});
|
|
17704
17704
|
if (options.platform === "win32")
|
|
@@ -17769,10 +17769,10 @@ var findUp = quansync2({
|
|
|
17769
17769
|
async: findUp$1
|
|
17770
17770
|
});
|
|
17771
17771
|
var loadPackageJSON = quansync2(function* (cwd = _process2.default.cwd()) {
|
|
17772
|
-
const
|
|
17773
|
-
if (!
|
|
17772
|
+
const path25 = yield findUp("package.json", { cwd });
|
|
17773
|
+
if (!path25 || !actualFS.default.existsSync(path25))
|
|
17774
17774
|
return null;
|
|
17775
|
-
return JSON.parse(yield readFile(
|
|
17775
|
+
return JSON.parse(yield readFile(path25));
|
|
17776
17776
|
});
|
|
17777
17777
|
var loadPackageJSONSync = loadPackageJSON.sync;
|
|
17778
17778
|
var isPackageListed = quansync2(function* (name, cwd) {
|
|
@@ -17825,9 +17825,9 @@ var INSTALL_METADATA = {
|
|
|
17825
17825
|
};
|
|
17826
17826
|
|
|
17827
17827
|
// ../../node_modules/.pnpm/package-manager-detector@1.4.0/node_modules/package-manager-detector/dist/detect.mjs
|
|
17828
|
-
async function pathExists(
|
|
17828
|
+
async function pathExists(path25, type) {
|
|
17829
17829
|
try {
|
|
17830
|
-
const stat6 = await _promises2.default.stat(
|
|
17830
|
+
const stat6 = await _promises2.default.stat(path25);
|
|
17831
17831
|
return type === "file" ? stat6.isFile() : stat6.isDirectory();
|
|
17832
17832
|
} catch (e13) {
|
|
17833
17833
|
return false;
|
|
@@ -20790,20 +20790,15 @@ function flatten(groups) {
|
|
|
20790
20790
|
}, []);
|
|
20791
20791
|
}
|
|
20792
20792
|
|
|
20793
|
-
// src/runtime/
|
|
20794
|
-
|
|
20795
|
-
|
|
20796
|
-
|
|
20797
|
-
|
|
20798
|
-
|
|
20799
|
-
|
|
20800
|
-
|
|
20801
|
-
|
|
20802
|
-
const NULL_BYTE = "\0";
|
|
20803
|
-
const OXC_RUNTIME_HELPER_ALIAS = new RegExp(`^(?:${NULL_BYTE})?@oxc-project(?:/|\\+)runtime(?:@[^/]+)?/helpers/(.+)\\.js$`);
|
|
20804
|
-
const FALLBACK_HELPER_PREFIX = `${NULL_BYTE}weapp-vite:oxc-helper:`;
|
|
20805
|
-
const fallbackHelpers = {
|
|
20806
|
-
objectWithoutProperties: `export default function _objectWithoutProperties(source, excluded) {
|
|
20793
|
+
// src/runtime/oxcRuntime.ts
|
|
20794
|
+
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
20795
|
+
|
|
20796
|
+
|
|
20797
|
+
var NULL_BYTE = "\0";
|
|
20798
|
+
var OXC_RUNTIME_HELPER_ALIAS = new RegExp(`^(?:${NULL_BYTE})?@oxc-project(?:/|\\+)runtime(?:@[^/]+)?/helpers/(.+)\\.js$`);
|
|
20799
|
+
var FALLBACK_HELPER_PREFIX = `${NULL_BYTE}weapp-vite:oxc-helper:`;
|
|
20800
|
+
var fallbackHelpers = {
|
|
20801
|
+
objectWithoutProperties: `export default function _objectWithoutProperties(source, excluded) {
|
|
20807
20802
|
if (source == null) return {};
|
|
20808
20803
|
var target = {};
|
|
20809
20804
|
var sourceKeys = Object.keys(source);
|
|
@@ -20825,7 +20820,7 @@ function createConfigService(ctx) {
|
|
|
20825
20820
|
}
|
|
20826
20821
|
return target;
|
|
20827
20822
|
}`,
|
|
20828
|
-
|
|
20823
|
+
objectSpread2: `function ownKeys(object, enumerableOnly) {
|
|
20829
20824
|
var keys = Object.keys(object);
|
|
20830
20825
|
if (Object.getOwnPropertySymbols) {
|
|
20831
20826
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -20858,13 +20853,25 @@ function _objectSpread2(target) {
|
|
|
20858
20853
|
return target;
|
|
20859
20854
|
}
|
|
20860
20855
|
export default _objectSpread2;`
|
|
20856
|
+
};
|
|
20857
|
+
function getOxcHelperName(id) {
|
|
20858
|
+
OXC_RUNTIME_HELPER_ALIAS.lastIndex = 0;
|
|
20859
|
+
const match2 = OXC_RUNTIME_HELPER_ALIAS.exec(id);
|
|
20860
|
+
return _optionalChain([match2, 'optionalAccess', _293 => _293[1]]);
|
|
20861
|
+
}
|
|
20862
|
+
function createOxcRuntimeSupport() {
|
|
20863
|
+
const oxcRuntimeInfo = getPackageInfoSync("@oxc-project/runtime");
|
|
20864
|
+
const oxcRuntimeHelpersRoot = oxcRuntimeInfo ? _pathe2.default.resolve(oxcRuntimeInfo.rootPath, "src/helpers/esm") : void 0;
|
|
20865
|
+
const alias = {
|
|
20866
|
+
find: OXC_RUNTIME_HELPER_ALIAS,
|
|
20867
|
+
replacement: "@oxc-project/runtime/src/helpers/esm/$1.js"
|
|
20861
20868
|
};
|
|
20862
|
-
|
|
20863
|
-
|
|
20864
|
-
|
|
20865
|
-
|
|
20869
|
+
if (!oxcRuntimeHelpersRoot) {
|
|
20870
|
+
return {
|
|
20871
|
+
alias
|
|
20872
|
+
};
|
|
20866
20873
|
}
|
|
20867
|
-
const
|
|
20874
|
+
const rolldownPlugin = {
|
|
20868
20875
|
name: "weapp-vite:rolldown-oxc-runtime",
|
|
20869
20876
|
resolveId(source) {
|
|
20870
20877
|
if (source.startsWith(NULL_BYTE)) {
|
|
@@ -20874,13 +20881,14 @@ export default _objectSpread2;`
|
|
|
20874
20881
|
if (!helperName) {
|
|
20875
20882
|
return null;
|
|
20876
20883
|
}
|
|
20877
|
-
|
|
20884
|
+
const helpersRoot = oxcRuntimeHelpersRoot;
|
|
20885
|
+
if (!helpersRoot) {
|
|
20878
20886
|
if (helperName in fallbackHelpers) {
|
|
20879
20887
|
return `${FALLBACK_HELPER_PREFIX}${helperName}`;
|
|
20880
20888
|
}
|
|
20881
20889
|
return null;
|
|
20882
20890
|
}
|
|
20883
|
-
return _pathe2.default.resolve(
|
|
20891
|
+
return _pathe2.default.resolve(helpersRoot, `${helperName}.js`);
|
|
20884
20892
|
},
|
|
20885
20893
|
async load(id) {
|
|
20886
20894
|
if (id.startsWith(FALLBACK_HELPER_PREFIX)) {
|
|
@@ -20893,12 +20901,10 @@ export default _objectSpread2;`
|
|
|
20893
20901
|
}
|
|
20894
20902
|
const helperName = getOxcHelperName(id);
|
|
20895
20903
|
if (helperName) {
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20899
|
-
|
|
20900
|
-
return _fsextra2.default.readFile(helperPath, "utf8");
|
|
20901
|
-
}
|
|
20904
|
+
const helperPath = id.startsWith(NULL_BYTE) ? _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`) : id;
|
|
20905
|
+
if (await _fsextra2.default.pathExists(helperPath)) {
|
|
20906
|
+
console.warn("[weapp-vite] resolving oxc helper via Rolldown plugin:", helperName);
|
|
20907
|
+
return _fsextra2.default.readFile(helperPath, "utf8");
|
|
20902
20908
|
}
|
|
20903
20909
|
const fallback = fallbackHelpers[helperName];
|
|
20904
20910
|
if (fallback) {
|
|
@@ -20907,7 +20913,81 @@ export default _objectSpread2;`
|
|
|
20907
20913
|
}
|
|
20908
20914
|
return null;
|
|
20909
20915
|
}
|
|
20910
|
-
}
|
|
20916
|
+
};
|
|
20917
|
+
const vitePlugin = {
|
|
20918
|
+
name: "weapp-vite:oxc-runtime-helpers",
|
|
20919
|
+
enforce: "pre",
|
|
20920
|
+
resolveId(source) {
|
|
20921
|
+
if (source.startsWith(NULL_BYTE)) {
|
|
20922
|
+
return null;
|
|
20923
|
+
}
|
|
20924
|
+
if (source.includes("@oxc-project/runtime/helpers")) {
|
|
20925
|
+
console.warn("[weapp-vite] resolveId intercepted:", source);
|
|
20926
|
+
}
|
|
20927
|
+
const helperName = getOxcHelperName(source);
|
|
20928
|
+
if (helperName) {
|
|
20929
|
+
return _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
|
|
20930
|
+
}
|
|
20931
|
+
return null;
|
|
20932
|
+
},
|
|
20933
|
+
async load(id) {
|
|
20934
|
+
if (!id.startsWith(NULL_BYTE)) {
|
|
20935
|
+
return null;
|
|
20936
|
+
}
|
|
20937
|
+
const helperName = getOxcHelperName(id);
|
|
20938
|
+
if (!helperName) {
|
|
20939
|
+
return null;
|
|
20940
|
+
}
|
|
20941
|
+
const helperPath = _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
|
|
20942
|
+
console.warn("[weapp-vite] resolving oxc helper via Vite plugin:", helperName);
|
|
20943
|
+
return _fsextra2.default.readFile(helperPath, "utf8");
|
|
20944
|
+
}
|
|
20945
|
+
};
|
|
20946
|
+
return {
|
|
20947
|
+
alias,
|
|
20948
|
+
rolldownPlugin,
|
|
20949
|
+
vitePlugin
|
|
20950
|
+
};
|
|
20951
|
+
}
|
|
20952
|
+
|
|
20953
|
+
// src/runtime/packageAliases.ts
|
|
20954
|
+
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
20955
|
+
|
|
20956
|
+
|
|
20957
|
+
var SPECIAL_PACKAGE_ALIASES = [
|
|
20958
|
+
{
|
|
20959
|
+
packageName: "class-variance-authority",
|
|
20960
|
+
distEntry: "dist/index.js"
|
|
20961
|
+
}
|
|
20962
|
+
];
|
|
20963
|
+
function resolveBuiltinPackageAliases() {
|
|
20964
|
+
const aliases = [];
|
|
20965
|
+
for (const { packageName, distEntry } of SPECIAL_PACKAGE_ALIASES) {
|
|
20966
|
+
const info = getPackageInfoSync(packageName);
|
|
20967
|
+
if (!info) {
|
|
20968
|
+
continue;
|
|
20969
|
+
}
|
|
20970
|
+
const resolvedEntry = _pathe2.default.resolve(info.rootPath, distEntry);
|
|
20971
|
+
if (!_fs.existsSync.call(void 0, resolvedEntry)) {
|
|
20972
|
+
continue;
|
|
20973
|
+
}
|
|
20974
|
+
aliases.push({
|
|
20975
|
+
find: packageName,
|
|
20976
|
+
replacement: resolvedEntry
|
|
20977
|
+
});
|
|
20978
|
+
}
|
|
20979
|
+
return aliases;
|
|
20980
|
+
}
|
|
20981
|
+
|
|
20982
|
+
// src/runtime/configPlugin.ts
|
|
20983
|
+
function createConfigService(ctx) {
|
|
20984
|
+
const configState = ctx.runtimeState.config;
|
|
20985
|
+
configState.packageInfo = getPackageInfoSync("weapp-vite");
|
|
20986
|
+
const defineEnv = configState.defineEnv;
|
|
20987
|
+
let packageManager = configState.packageManager;
|
|
20988
|
+
let options = configState.options;
|
|
20989
|
+
const builtinPackageAliases = resolveBuiltinPackageAliases();
|
|
20990
|
+
const oxcRuntimeSupport = createOxcRuntimeSupport();
|
|
20911
20991
|
function normalizeAliasOptions(alias) {
|
|
20912
20992
|
if (!alias) {
|
|
20913
20993
|
return [];
|
|
@@ -20921,16 +21001,9 @@ export default _objectSpread2;`
|
|
|
20921
21001
|
return { find, replacement };
|
|
20922
21002
|
});
|
|
20923
21003
|
}
|
|
20924
|
-
function
|
|
21004
|
+
function injectBuiltinAliases(config) {
|
|
20925
21005
|
const resolve8 = _nullishCoalesce(config.resolve, () => ( (config.resolve = {})));
|
|
20926
|
-
const aliasEntry =
|
|
20927
|
-
find: OXC_RUNTIME_HELPER_ALIAS,
|
|
20928
|
-
replacement: "@oxc-project/runtime/src/helpers/esm/$1.js"
|
|
20929
|
-
};
|
|
20930
|
-
const cvaAliasEntry = {
|
|
20931
|
-
find: "class-variance-authority",
|
|
20932
|
-
replacement: "class-variance-authority/dist/index.js"
|
|
20933
|
-
};
|
|
21006
|
+
const aliasEntry = oxcRuntimeSupport.alias;
|
|
20934
21007
|
const aliasArray = normalizeAliasOptions(resolve8.alias);
|
|
20935
21008
|
const hasAlias = aliasArray.some((entry) => {
|
|
20936
21009
|
return entry.find instanceof RegExp && entry.find.source === aliasEntry.find.source;
|
|
@@ -20938,9 +21011,11 @@ export default _objectSpread2;`
|
|
|
20938
21011
|
if (!hasAlias) {
|
|
20939
21012
|
aliasArray.unshift(aliasEntry);
|
|
20940
21013
|
}
|
|
20941
|
-
const
|
|
20942
|
-
|
|
20943
|
-
|
|
21014
|
+
for (const builtinAlias of builtinPackageAliases) {
|
|
21015
|
+
const hasAliasEntry = aliasArray.some((entry) => typeof entry.find === "string" && entry.find === builtinAlias.find);
|
|
21016
|
+
if (!hasAliasEntry) {
|
|
21017
|
+
aliasArray.unshift(builtinAlias);
|
|
21018
|
+
}
|
|
20944
21019
|
}
|
|
20945
21020
|
resolve8.alias = aliasArray;
|
|
20946
21021
|
}
|
|
@@ -21014,55 +21089,23 @@ export default _objectSpread2;`
|
|
|
21014
21089
|
weapp: getWeappViteConfig()
|
|
21015
21090
|
}
|
|
21016
21091
|
);
|
|
21017
|
-
|
|
21092
|
+
const rolldownPlugin = oxcRuntimeSupport.rolldownPlugin;
|
|
21093
|
+
if (rolldownPlugin) {
|
|
21018
21094
|
const build3 = _nullishCoalesce(config.build, () => ( (config.build = {})));
|
|
21019
21095
|
const rdOptions = _nullishCoalesce(build3.rolldownOptions, () => ( (build3.rolldownOptions = {})));
|
|
21020
21096
|
const rawPlugins = rdOptions.plugins;
|
|
21021
21097
|
const pluginArray = rawPlugins == null ? [] : Array.isArray(rawPlugins) ? [...rawPlugins] : [rawPlugins];
|
|
21022
|
-
const hasPlugin = pluginArray.
|
|
21023
|
-
if (!plugin || typeof plugin !== "object") {
|
|
21024
|
-
return false;
|
|
21025
|
-
}
|
|
21026
|
-
return "name" in plugin && plugin.name === rolldownOxcRuntimePlugin.name;
|
|
21027
|
-
});
|
|
21098
|
+
const hasPlugin = pluginArray.includes(rolldownPlugin);
|
|
21028
21099
|
if (!hasPlugin) {
|
|
21029
|
-
rdOptions.plugins = [
|
|
21100
|
+
rdOptions.plugins = [rolldownPlugin, ...pluginArray];
|
|
21030
21101
|
} else if (!Array.isArray(rawPlugins)) {
|
|
21031
21102
|
rdOptions.plugins = pluginArray;
|
|
21032
21103
|
}
|
|
21033
21104
|
}
|
|
21034
|
-
|
|
21035
|
-
if (
|
|
21105
|
+
injectBuiltinAliases(config);
|
|
21106
|
+
if (oxcRuntimeSupport.vitePlugin) {
|
|
21036
21107
|
config.plugins ??= [];
|
|
21037
|
-
config.plugins.unshift(
|
|
21038
|
-
name: "weapp-vite:oxc-runtime-helpers",
|
|
21039
|
-
enforce: "pre",
|
|
21040
|
-
resolveId(source) {
|
|
21041
|
-
if (source.startsWith(NULL_BYTE)) {
|
|
21042
|
-
return null;
|
|
21043
|
-
}
|
|
21044
|
-
if (source.includes("@oxc-project/runtime/helpers")) {
|
|
21045
|
-
console.warn("[weapp-vite] resolveId intercepted:", source);
|
|
21046
|
-
}
|
|
21047
|
-
const helperName = getOxcHelperName(source);
|
|
21048
|
-
if (helperName) {
|
|
21049
|
-
return _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
|
|
21050
|
-
}
|
|
21051
|
-
return null;
|
|
21052
|
-
},
|
|
21053
|
-
async load(id) {
|
|
21054
|
-
if (!id.startsWith(NULL_BYTE)) {
|
|
21055
|
-
return null;
|
|
21056
|
-
}
|
|
21057
|
-
const helperName = getOxcHelperName(id);
|
|
21058
|
-
if (!helperName) {
|
|
21059
|
-
return null;
|
|
21060
|
-
}
|
|
21061
|
-
const helperPath = _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
|
|
21062
|
-
console.warn("[weapp-vite] resolving oxc helper via Vite plugin:", helperName);
|
|
21063
|
-
return _fsextra2.default.readFile(helperPath, "utf8");
|
|
21064
|
-
}
|
|
21065
|
-
});
|
|
21108
|
+
config.plugins.unshift(oxcRuntimeSupport.vitePlugin);
|
|
21066
21109
|
}
|
|
21067
21110
|
const platform = _nullishCoalesce(_optionalChain([config, 'access', _297 => _297.weapp, 'optionalAccess', _298 => _298.platform]), () => ( "weapp"));
|
|
21068
21111
|
const resolvedOutputExtensions = getOutputExtensions(platform);
|
|
@@ -21135,7 +21178,7 @@ export default _objectSpread2;`
|
|
|
21135
21178
|
}
|
|
21136
21179
|
}
|
|
21137
21180
|
);
|
|
21138
|
-
|
|
21181
|
+
injectBuiltinAliases(inline);
|
|
21139
21182
|
return inline;
|
|
21140
21183
|
}
|
|
21141
21184
|
const inlineConfig = _shared.defu.call(void 0,
|
|
@@ -21152,7 +21195,7 @@ export default _objectSpread2;`
|
|
|
21152
21195
|
}
|
|
21153
21196
|
);
|
|
21154
21197
|
inlineConfig.logLevel = "info";
|
|
21155
|
-
|
|
21198
|
+
injectBuiltinAliases(inlineConfig);
|
|
21156
21199
|
return inlineConfig;
|
|
21157
21200
|
}
|
|
21158
21201
|
function merge(subPackageMeta, ...configs) {
|
|
@@ -21166,9 +21209,10 @@ export default _objectSpread2;`
|
|
|
21166
21209
|
return new RegExp(`^${pkg.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}(\\/|$)`);
|
|
21167
21210
|
}));
|
|
21168
21211
|
}
|
|
21212
|
+
const rolldownPlugin = oxcRuntimeSupport.rolldownPlugin;
|
|
21169
21213
|
const rolldownOptions = {
|
|
21170
21214
|
external,
|
|
21171
|
-
plugins:
|
|
21215
|
+
plugins: rolldownPlugin ? [rolldownPlugin] : void 0
|
|
21172
21216
|
};
|
|
21173
21217
|
if (options.isDev) {
|
|
21174
21218
|
const inline = _shared.defu.call(void 0,
|
|
@@ -21196,7 +21240,7 @@ export default _objectSpread2;`
|
|
|
21196
21240
|
}
|
|
21197
21241
|
}
|
|
21198
21242
|
);
|
|
21199
|
-
|
|
21243
|
+
injectBuiltinAliases(inline);
|
|
21200
21244
|
return inline;
|
|
21201
21245
|
}
|
|
21202
21246
|
const inlineConfig = _shared.defu.call(void 0,
|
|
@@ -21221,7 +21265,7 @@ export default _objectSpread2;`
|
|
|
21221
21265
|
}
|
|
21222
21266
|
);
|
|
21223
21267
|
inlineConfig.logLevel = "info";
|
|
21224
|
-
|
|
21268
|
+
injectBuiltinAliases(inlineConfig);
|
|
21225
21269
|
const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _306 => _306.subPackage, 'access', _307 => _307.root]);
|
|
21226
21270
|
options = {
|
|
21227
21271
|
...options,
|