xtrm-tools 0.7.12 → 0.7.13
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/.xtrm/hooks/specialists/specialists-memory-cache-sync.mjs +57 -0
- package/.xtrm/registry.json +477 -389
- package/.xtrm/skills/default/premortem/SKILL.md +218 -0
- package/.xtrm/skills/default/releasing/SKILL.md +90 -0
- package/.xtrm/skills/default/sync-docs/SKILL.md +88 -208
- package/.xtrm/skills/default/sync-docs/scripts/pre-context.sh +17 -0
- package/.xtrm/skills/default/update-specialists/SKILL.md +228 -36
- package/.xtrm/skills/default/update-xt/SKILL.md +34 -0
- package/.xtrm/skills/default/using-kpi/SKILL.md +150 -0
- package/.xtrm/skills/default/using-specialists-v2/SKILL.md +683 -0
- package/cli/dist/index.cjs +839 -429
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/package.json +2 -2
- package/packages/pi-extensions/.serena/project.yml +119 -0
- package/packages/pi-extensions/extensions/pi-serena-compact/index.ts +4 -12
- package/packages/pi-extensions/extensions/xtrm-loader/index.ts +0 -1
- package/packages/pi-extensions/extensions/xtrm-ui/index.ts +201 -36
- package/packages/pi-extensions/extensions/xtrm-ui/themes/pidex-dark-flattools.json +79 -0
- package/packages/pi-extensions/extensions/xtrm-ui/themes/pidex-dark.json +85 -0
- package/packages/pi-extensions/extensions/xtrm-ui/themes/pidex-light-flattools.json +79 -0
- package/packages/pi-extensions/extensions/xtrm-ui/themes/pidex-light.json +85 -0
- package/packages/pi-extensions/package.json +1 -1
- package/packages/pi-extensions/themes/xtrm-ui/pidex-dark-flattools.json +79 -0
- package/packages/pi-extensions/themes/xtrm-ui/pidex-dark.json +3 -3
- package/packages/pi-extensions/themes/xtrm-ui/pidex-light-flattools.json +79 -0
package/cli/dist/index.cjs
CHANGED
|
@@ -1199,8 +1199,8 @@ var require_command = __commonJS({
|
|
|
1199
1199
|
"use strict";
|
|
1200
1200
|
var EventEmitter = require("events").EventEmitter;
|
|
1201
1201
|
var childProcess = require("child_process");
|
|
1202
|
-
var
|
|
1203
|
-
var
|
|
1202
|
+
var path38 = require("path");
|
|
1203
|
+
var fs36 = require("fs");
|
|
1204
1204
|
var process9 = require("process");
|
|
1205
1205
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1206
1206
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -2194,7 +2194,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2194
2194
|
* @param {string} subcommandName
|
|
2195
2195
|
*/
|
|
2196
2196
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
2197
|
-
if (
|
|
2197
|
+
if (fs36.existsSync(executableFile)) return;
|
|
2198
2198
|
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
2199
2199
|
const executableMissing = `'${executableFile}' does not exist
|
|
2200
2200
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -2212,11 +2212,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2212
2212
|
let launchWithNode = false;
|
|
2213
2213
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2214
2214
|
function findFile(baseDir, baseName) {
|
|
2215
|
-
const localBin =
|
|
2216
|
-
if (
|
|
2217
|
-
if (sourceExt.includes(
|
|
2215
|
+
const localBin = path38.resolve(baseDir, baseName);
|
|
2216
|
+
if (fs36.existsSync(localBin)) return localBin;
|
|
2217
|
+
if (sourceExt.includes(path38.extname(baseName))) return void 0;
|
|
2218
2218
|
const foundExt = sourceExt.find(
|
|
2219
|
-
(ext) =>
|
|
2219
|
+
(ext) => fs36.existsSync(`${localBin}${ext}`)
|
|
2220
2220
|
);
|
|
2221
2221
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2222
2222
|
return void 0;
|
|
@@ -2228,21 +2228,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2228
2228
|
if (this._scriptPath) {
|
|
2229
2229
|
let resolvedScriptPath;
|
|
2230
2230
|
try {
|
|
2231
|
-
resolvedScriptPath =
|
|
2231
|
+
resolvedScriptPath = fs36.realpathSync(this._scriptPath);
|
|
2232
2232
|
} catch {
|
|
2233
2233
|
resolvedScriptPath = this._scriptPath;
|
|
2234
2234
|
}
|
|
2235
|
-
executableDir =
|
|
2236
|
-
|
|
2235
|
+
executableDir = path38.resolve(
|
|
2236
|
+
path38.dirname(resolvedScriptPath),
|
|
2237
2237
|
executableDir
|
|
2238
2238
|
);
|
|
2239
2239
|
}
|
|
2240
2240
|
if (executableDir) {
|
|
2241
2241
|
let localFile = findFile(executableDir, executableFile);
|
|
2242
2242
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2243
|
-
const legacyName =
|
|
2243
|
+
const legacyName = path38.basename(
|
|
2244
2244
|
this._scriptPath,
|
|
2245
|
-
|
|
2245
|
+
path38.extname(this._scriptPath)
|
|
2246
2246
|
);
|
|
2247
2247
|
if (legacyName !== this._name) {
|
|
2248
2248
|
localFile = findFile(
|
|
@@ -2253,7 +2253,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2253
2253
|
}
|
|
2254
2254
|
executableFile = localFile || executableFile;
|
|
2255
2255
|
}
|
|
2256
|
-
launchWithNode = sourceExt.includes(
|
|
2256
|
+
launchWithNode = sourceExt.includes(path38.extname(executableFile));
|
|
2257
2257
|
let proc;
|
|
2258
2258
|
if (process9.platform !== "win32") {
|
|
2259
2259
|
if (launchWithNode) {
|
|
@@ -3168,7 +3168,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3168
3168
|
* @return {Command}
|
|
3169
3169
|
*/
|
|
3170
3170
|
nameFromFilename(filename) {
|
|
3171
|
-
this._name =
|
|
3171
|
+
this._name = path38.basename(filename, path38.extname(filename));
|
|
3172
3172
|
return this;
|
|
3173
3173
|
}
|
|
3174
3174
|
/**
|
|
@@ -3182,9 +3182,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3182
3182
|
* @param {string} [path]
|
|
3183
3183
|
* @return {(string|null|Command)}
|
|
3184
3184
|
*/
|
|
3185
|
-
executableDir(
|
|
3186
|
-
if (
|
|
3187
|
-
this._executableDir =
|
|
3185
|
+
executableDir(path39) {
|
|
3186
|
+
if (path39 === void 0) return this._executableDir;
|
|
3187
|
+
this._executableDir = path39;
|
|
3188
3188
|
return this;
|
|
3189
3189
|
}
|
|
3190
3190
|
/**
|
|
@@ -3518,54 +3518,54 @@ var require_polyfills = __commonJS({
|
|
|
3518
3518
|
}
|
|
3519
3519
|
var chdir;
|
|
3520
3520
|
module2.exports = patch;
|
|
3521
|
-
function patch(
|
|
3521
|
+
function patch(fs36) {
|
|
3522
3522
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
3523
|
-
patchLchmod(
|
|
3524
|
-
}
|
|
3525
|
-
if (!
|
|
3526
|
-
patchLutimes(
|
|
3527
|
-
}
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
if (
|
|
3547
|
-
|
|
3523
|
+
patchLchmod(fs36);
|
|
3524
|
+
}
|
|
3525
|
+
if (!fs36.lutimes) {
|
|
3526
|
+
patchLutimes(fs36);
|
|
3527
|
+
}
|
|
3528
|
+
fs36.chown = chownFix(fs36.chown);
|
|
3529
|
+
fs36.fchown = chownFix(fs36.fchown);
|
|
3530
|
+
fs36.lchown = chownFix(fs36.lchown);
|
|
3531
|
+
fs36.chmod = chmodFix(fs36.chmod);
|
|
3532
|
+
fs36.fchmod = chmodFix(fs36.fchmod);
|
|
3533
|
+
fs36.lchmod = chmodFix(fs36.lchmod);
|
|
3534
|
+
fs36.chownSync = chownFixSync(fs36.chownSync);
|
|
3535
|
+
fs36.fchownSync = chownFixSync(fs36.fchownSync);
|
|
3536
|
+
fs36.lchownSync = chownFixSync(fs36.lchownSync);
|
|
3537
|
+
fs36.chmodSync = chmodFixSync(fs36.chmodSync);
|
|
3538
|
+
fs36.fchmodSync = chmodFixSync(fs36.fchmodSync);
|
|
3539
|
+
fs36.lchmodSync = chmodFixSync(fs36.lchmodSync);
|
|
3540
|
+
fs36.stat = statFix(fs36.stat);
|
|
3541
|
+
fs36.fstat = statFix(fs36.fstat);
|
|
3542
|
+
fs36.lstat = statFix(fs36.lstat);
|
|
3543
|
+
fs36.statSync = statFixSync(fs36.statSync);
|
|
3544
|
+
fs36.fstatSync = statFixSync(fs36.fstatSync);
|
|
3545
|
+
fs36.lstatSync = statFixSync(fs36.lstatSync);
|
|
3546
|
+
if (fs36.chmod && !fs36.lchmod) {
|
|
3547
|
+
fs36.lchmod = function(path38, mode, cb) {
|
|
3548
3548
|
if (cb) process.nextTick(cb);
|
|
3549
3549
|
};
|
|
3550
|
-
|
|
3550
|
+
fs36.lchmodSync = function() {
|
|
3551
3551
|
};
|
|
3552
3552
|
}
|
|
3553
|
-
if (
|
|
3554
|
-
|
|
3553
|
+
if (fs36.chown && !fs36.lchown) {
|
|
3554
|
+
fs36.lchown = function(path38, uid, gid, cb) {
|
|
3555
3555
|
if (cb) process.nextTick(cb);
|
|
3556
3556
|
};
|
|
3557
|
-
|
|
3557
|
+
fs36.lchownSync = function() {
|
|
3558
3558
|
};
|
|
3559
3559
|
}
|
|
3560
3560
|
if (platform === "win32") {
|
|
3561
|
-
|
|
3561
|
+
fs36.rename = typeof fs36.rename !== "function" ? fs36.rename : (function(fs$rename) {
|
|
3562
3562
|
function rename(from, to, cb) {
|
|
3563
3563
|
var start = Date.now();
|
|
3564
3564
|
var backoff = 0;
|
|
3565
3565
|
fs$rename(from, to, function CB(er) {
|
|
3566
3566
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
3567
3567
|
setTimeout(function() {
|
|
3568
|
-
|
|
3568
|
+
fs36.stat(to, function(stater, st) {
|
|
3569
3569
|
if (stater && stater.code === "ENOENT")
|
|
3570
3570
|
fs$rename(from, to, CB);
|
|
3571
3571
|
else
|
|
@@ -3581,9 +3581,9 @@ var require_polyfills = __commonJS({
|
|
|
3581
3581
|
}
|
|
3582
3582
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
3583
3583
|
return rename;
|
|
3584
|
-
})(
|
|
3584
|
+
})(fs36.rename);
|
|
3585
3585
|
}
|
|
3586
|
-
|
|
3586
|
+
fs36.read = typeof fs36.read !== "function" ? fs36.read : (function(fs$read) {
|
|
3587
3587
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
3588
3588
|
var callback;
|
|
3589
3589
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -3591,22 +3591,22 @@ var require_polyfills = __commonJS({
|
|
|
3591
3591
|
callback = function(er, _, __) {
|
|
3592
3592
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
3593
3593
|
eagCounter++;
|
|
3594
|
-
return fs$read.call(
|
|
3594
|
+
return fs$read.call(fs36, fd, buffer, offset, length, position, callback);
|
|
3595
3595
|
}
|
|
3596
3596
|
callback_.apply(this, arguments);
|
|
3597
3597
|
};
|
|
3598
3598
|
}
|
|
3599
|
-
return fs$read.call(
|
|
3599
|
+
return fs$read.call(fs36, fd, buffer, offset, length, position, callback);
|
|
3600
3600
|
}
|
|
3601
3601
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
3602
3602
|
return read;
|
|
3603
|
-
})(
|
|
3604
|
-
|
|
3603
|
+
})(fs36.read);
|
|
3604
|
+
fs36.readSync = typeof fs36.readSync !== "function" ? fs36.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
3605
3605
|
return function(fd, buffer, offset, length, position) {
|
|
3606
3606
|
var eagCounter = 0;
|
|
3607
3607
|
while (true) {
|
|
3608
3608
|
try {
|
|
3609
|
-
return fs$readSync.call(
|
|
3609
|
+
return fs$readSync.call(fs36, fd, buffer, offset, length, position);
|
|
3610
3610
|
} catch (er) {
|
|
3611
3611
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
3612
3612
|
eagCounter++;
|
|
@@ -3616,11 +3616,11 @@ var require_polyfills = __commonJS({
|
|
|
3616
3616
|
}
|
|
3617
3617
|
}
|
|
3618
3618
|
};
|
|
3619
|
-
})(
|
|
3620
|
-
function patchLchmod(
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3619
|
+
})(fs36.readSync);
|
|
3620
|
+
function patchLchmod(fs37) {
|
|
3621
|
+
fs37.lchmod = function(path38, mode, callback) {
|
|
3622
|
+
fs37.open(
|
|
3623
|
+
path38,
|
|
3624
3624
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
3625
3625
|
mode,
|
|
3626
3626
|
function(err, fd) {
|
|
@@ -3628,80 +3628,80 @@ var require_polyfills = __commonJS({
|
|
|
3628
3628
|
if (callback) callback(err);
|
|
3629
3629
|
return;
|
|
3630
3630
|
}
|
|
3631
|
-
|
|
3632
|
-
|
|
3631
|
+
fs37.fchmod(fd, mode, function(err2) {
|
|
3632
|
+
fs37.close(fd, function(err22) {
|
|
3633
3633
|
if (callback) callback(err2 || err22);
|
|
3634
3634
|
});
|
|
3635
3635
|
});
|
|
3636
3636
|
}
|
|
3637
3637
|
);
|
|
3638
3638
|
};
|
|
3639
|
-
|
|
3640
|
-
var fd =
|
|
3639
|
+
fs37.lchmodSync = function(path38, mode) {
|
|
3640
|
+
var fd = fs37.openSync(path38, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
3641
3641
|
var threw = true;
|
|
3642
3642
|
var ret;
|
|
3643
3643
|
try {
|
|
3644
|
-
ret =
|
|
3644
|
+
ret = fs37.fchmodSync(fd, mode);
|
|
3645
3645
|
threw = false;
|
|
3646
3646
|
} finally {
|
|
3647
3647
|
if (threw) {
|
|
3648
3648
|
try {
|
|
3649
|
-
|
|
3649
|
+
fs37.closeSync(fd);
|
|
3650
3650
|
} catch (er) {
|
|
3651
3651
|
}
|
|
3652
3652
|
} else {
|
|
3653
|
-
|
|
3653
|
+
fs37.closeSync(fd);
|
|
3654
3654
|
}
|
|
3655
3655
|
}
|
|
3656
3656
|
return ret;
|
|
3657
3657
|
};
|
|
3658
3658
|
}
|
|
3659
|
-
function patchLutimes(
|
|
3660
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
3661
|
-
|
|
3662
|
-
|
|
3659
|
+
function patchLutimes(fs37) {
|
|
3660
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs37.futimes) {
|
|
3661
|
+
fs37.lutimes = function(path38, at, mt, cb) {
|
|
3662
|
+
fs37.open(path38, constants.O_SYMLINK, function(er, fd) {
|
|
3663
3663
|
if (er) {
|
|
3664
3664
|
if (cb) cb(er);
|
|
3665
3665
|
return;
|
|
3666
3666
|
}
|
|
3667
|
-
|
|
3668
|
-
|
|
3667
|
+
fs37.futimes(fd, at, mt, function(er2) {
|
|
3668
|
+
fs37.close(fd, function(er22) {
|
|
3669
3669
|
if (cb) cb(er2 || er22);
|
|
3670
3670
|
});
|
|
3671
3671
|
});
|
|
3672
3672
|
});
|
|
3673
3673
|
};
|
|
3674
|
-
|
|
3675
|
-
var fd =
|
|
3674
|
+
fs37.lutimesSync = function(path38, at, mt) {
|
|
3675
|
+
var fd = fs37.openSync(path38, constants.O_SYMLINK);
|
|
3676
3676
|
var ret;
|
|
3677
3677
|
var threw = true;
|
|
3678
3678
|
try {
|
|
3679
|
-
ret =
|
|
3679
|
+
ret = fs37.futimesSync(fd, at, mt);
|
|
3680
3680
|
threw = false;
|
|
3681
3681
|
} finally {
|
|
3682
3682
|
if (threw) {
|
|
3683
3683
|
try {
|
|
3684
|
-
|
|
3684
|
+
fs37.closeSync(fd);
|
|
3685
3685
|
} catch (er) {
|
|
3686
3686
|
}
|
|
3687
3687
|
} else {
|
|
3688
|
-
|
|
3688
|
+
fs37.closeSync(fd);
|
|
3689
3689
|
}
|
|
3690
3690
|
}
|
|
3691
3691
|
return ret;
|
|
3692
3692
|
};
|
|
3693
|
-
} else if (
|
|
3694
|
-
|
|
3693
|
+
} else if (fs37.futimes) {
|
|
3694
|
+
fs37.lutimes = function(_a2, _b, _c, cb) {
|
|
3695
3695
|
if (cb) process.nextTick(cb);
|
|
3696
3696
|
};
|
|
3697
|
-
|
|
3697
|
+
fs37.lutimesSync = function() {
|
|
3698
3698
|
};
|
|
3699
3699
|
}
|
|
3700
3700
|
}
|
|
3701
3701
|
function chmodFix(orig) {
|
|
3702
3702
|
if (!orig) return orig;
|
|
3703
3703
|
return function(target, mode, cb) {
|
|
3704
|
-
return orig.call(
|
|
3704
|
+
return orig.call(fs36, target, mode, function(er) {
|
|
3705
3705
|
if (chownErOk(er)) er = null;
|
|
3706
3706
|
if (cb) cb.apply(this, arguments);
|
|
3707
3707
|
});
|
|
@@ -3711,7 +3711,7 @@ var require_polyfills = __commonJS({
|
|
|
3711
3711
|
if (!orig) return orig;
|
|
3712
3712
|
return function(target, mode) {
|
|
3713
3713
|
try {
|
|
3714
|
-
return orig.call(
|
|
3714
|
+
return orig.call(fs36, target, mode);
|
|
3715
3715
|
} catch (er) {
|
|
3716
3716
|
if (!chownErOk(er)) throw er;
|
|
3717
3717
|
}
|
|
@@ -3720,7 +3720,7 @@ var require_polyfills = __commonJS({
|
|
|
3720
3720
|
function chownFix(orig) {
|
|
3721
3721
|
if (!orig) return orig;
|
|
3722
3722
|
return function(target, uid, gid, cb) {
|
|
3723
|
-
return orig.call(
|
|
3723
|
+
return orig.call(fs36, target, uid, gid, function(er) {
|
|
3724
3724
|
if (chownErOk(er)) er = null;
|
|
3725
3725
|
if (cb) cb.apply(this, arguments);
|
|
3726
3726
|
});
|
|
@@ -3730,7 +3730,7 @@ var require_polyfills = __commonJS({
|
|
|
3730
3730
|
if (!orig) return orig;
|
|
3731
3731
|
return function(target, uid, gid) {
|
|
3732
3732
|
try {
|
|
3733
|
-
return orig.call(
|
|
3733
|
+
return orig.call(fs36, target, uid, gid);
|
|
3734
3734
|
} catch (er) {
|
|
3735
3735
|
if (!chownErOk(er)) throw er;
|
|
3736
3736
|
}
|
|
@@ -3750,13 +3750,13 @@ var require_polyfills = __commonJS({
|
|
|
3750
3750
|
}
|
|
3751
3751
|
if (cb) cb.apply(this, arguments);
|
|
3752
3752
|
}
|
|
3753
|
-
return options ? orig.call(
|
|
3753
|
+
return options ? orig.call(fs36, target, options, callback) : orig.call(fs36, target, callback);
|
|
3754
3754
|
};
|
|
3755
3755
|
}
|
|
3756
3756
|
function statFixSync(orig) {
|
|
3757
3757
|
if (!orig) return orig;
|
|
3758
3758
|
return function(target, options) {
|
|
3759
|
-
var stats = options ? orig.call(
|
|
3759
|
+
var stats = options ? orig.call(fs36, target, options) : orig.call(fs36, target);
|
|
3760
3760
|
if (stats) {
|
|
3761
3761
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
3762
3762
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -3786,16 +3786,16 @@ var require_legacy_streams = __commonJS({
|
|
|
3786
3786
|
"use strict";
|
|
3787
3787
|
var Stream = require("stream").Stream;
|
|
3788
3788
|
module2.exports = legacy;
|
|
3789
|
-
function legacy(
|
|
3789
|
+
function legacy(fs36) {
|
|
3790
3790
|
return {
|
|
3791
3791
|
ReadStream,
|
|
3792
3792
|
WriteStream
|
|
3793
3793
|
};
|
|
3794
|
-
function ReadStream(
|
|
3795
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
3794
|
+
function ReadStream(path38, options) {
|
|
3795
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path38, options);
|
|
3796
3796
|
Stream.call(this);
|
|
3797
3797
|
var self = this;
|
|
3798
|
-
this.path =
|
|
3798
|
+
this.path = path38;
|
|
3799
3799
|
this.fd = null;
|
|
3800
3800
|
this.readable = true;
|
|
3801
3801
|
this.paused = false;
|
|
@@ -3829,7 +3829,7 @@ var require_legacy_streams = __commonJS({
|
|
|
3829
3829
|
});
|
|
3830
3830
|
return;
|
|
3831
3831
|
}
|
|
3832
|
-
|
|
3832
|
+
fs36.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
3833
3833
|
if (err) {
|
|
3834
3834
|
self.emit("error", err);
|
|
3835
3835
|
self.readable = false;
|
|
@@ -3840,10 +3840,10 @@ var require_legacy_streams = __commonJS({
|
|
|
3840
3840
|
self._read();
|
|
3841
3841
|
});
|
|
3842
3842
|
}
|
|
3843
|
-
function WriteStream(
|
|
3844
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
3843
|
+
function WriteStream(path38, options) {
|
|
3844
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path38, options);
|
|
3845
3845
|
Stream.call(this);
|
|
3846
|
-
this.path =
|
|
3846
|
+
this.path = path38;
|
|
3847
3847
|
this.fd = null;
|
|
3848
3848
|
this.writable = true;
|
|
3849
3849
|
this.flags = "w";
|
|
@@ -3868,7 +3868,7 @@ var require_legacy_streams = __commonJS({
|
|
|
3868
3868
|
this.busy = false;
|
|
3869
3869
|
this._queue = [];
|
|
3870
3870
|
if (this.fd === null) {
|
|
3871
|
-
this._open =
|
|
3871
|
+
this._open = fs36.open;
|
|
3872
3872
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
3873
3873
|
this.flush();
|
|
3874
3874
|
}
|
|
@@ -3904,7 +3904,7 @@ var require_clone = __commonJS({
|
|
|
3904
3904
|
var require_graceful_fs = __commonJS({
|
|
3905
3905
|
"../node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
3906
3906
|
"use strict";
|
|
3907
|
-
var
|
|
3907
|
+
var fs36 = require("fs");
|
|
3908
3908
|
var polyfills = require_polyfills();
|
|
3909
3909
|
var legacy = require_legacy_streams();
|
|
3910
3910
|
var clone2 = require_clone();
|
|
@@ -3936,12 +3936,12 @@ var require_graceful_fs = __commonJS({
|
|
|
3936
3936
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
3937
3937
|
console.error(m);
|
|
3938
3938
|
};
|
|
3939
|
-
if (!
|
|
3939
|
+
if (!fs36[gracefulQueue]) {
|
|
3940
3940
|
queue = global[gracefulQueue] || [];
|
|
3941
|
-
publishQueue(
|
|
3942
|
-
|
|
3941
|
+
publishQueue(fs36, queue);
|
|
3942
|
+
fs36.close = (function(fs$close) {
|
|
3943
3943
|
function close(fd, cb) {
|
|
3944
|
-
return fs$close.call(
|
|
3944
|
+
return fs$close.call(fs36, fd, function(err) {
|
|
3945
3945
|
if (!err) {
|
|
3946
3946
|
resetQueue();
|
|
3947
3947
|
}
|
|
@@ -3953,48 +3953,48 @@ var require_graceful_fs = __commonJS({
|
|
|
3953
3953
|
value: fs$close
|
|
3954
3954
|
});
|
|
3955
3955
|
return close;
|
|
3956
|
-
})(
|
|
3957
|
-
|
|
3956
|
+
})(fs36.close);
|
|
3957
|
+
fs36.closeSync = (function(fs$closeSync) {
|
|
3958
3958
|
function closeSync(fd) {
|
|
3959
|
-
fs$closeSync.apply(
|
|
3959
|
+
fs$closeSync.apply(fs36, arguments);
|
|
3960
3960
|
resetQueue();
|
|
3961
3961
|
}
|
|
3962
3962
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
3963
3963
|
value: fs$closeSync
|
|
3964
3964
|
});
|
|
3965
3965
|
return closeSync;
|
|
3966
|
-
})(
|
|
3966
|
+
})(fs36.closeSync);
|
|
3967
3967
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
3968
3968
|
process.on("exit", function() {
|
|
3969
|
-
debug(
|
|
3970
|
-
require("assert").equal(
|
|
3969
|
+
debug(fs36[gracefulQueue]);
|
|
3970
|
+
require("assert").equal(fs36[gracefulQueue].length, 0);
|
|
3971
3971
|
});
|
|
3972
3972
|
}
|
|
3973
3973
|
}
|
|
3974
3974
|
var queue;
|
|
3975
3975
|
if (!global[gracefulQueue]) {
|
|
3976
|
-
publishQueue(global,
|
|
3977
|
-
}
|
|
3978
|
-
module2.exports = patch(clone2(
|
|
3979
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
3980
|
-
module2.exports = patch(
|
|
3981
|
-
|
|
3982
|
-
}
|
|
3983
|
-
function patch(
|
|
3984
|
-
polyfills(
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
var fs$readFile =
|
|
3989
|
-
|
|
3990
|
-
function readFile(
|
|
3976
|
+
publishQueue(global, fs36[gracefulQueue]);
|
|
3977
|
+
}
|
|
3978
|
+
module2.exports = patch(clone2(fs36));
|
|
3979
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs36.__patched) {
|
|
3980
|
+
module2.exports = patch(fs36);
|
|
3981
|
+
fs36.__patched = true;
|
|
3982
|
+
}
|
|
3983
|
+
function patch(fs37) {
|
|
3984
|
+
polyfills(fs37);
|
|
3985
|
+
fs37.gracefulify = patch;
|
|
3986
|
+
fs37.createReadStream = createReadStream;
|
|
3987
|
+
fs37.createWriteStream = createWriteStream2;
|
|
3988
|
+
var fs$readFile = fs37.readFile;
|
|
3989
|
+
fs37.readFile = readFile;
|
|
3990
|
+
function readFile(path38, options, cb) {
|
|
3991
3991
|
if (typeof options === "function")
|
|
3992
3992
|
cb = options, options = null;
|
|
3993
|
-
return go$readFile(
|
|
3994
|
-
function go$readFile(
|
|
3995
|
-
return fs$readFile(
|
|
3993
|
+
return go$readFile(path38, options, cb);
|
|
3994
|
+
function go$readFile(path39, options2, cb2, startTime) {
|
|
3995
|
+
return fs$readFile(path39, options2, function(err) {
|
|
3996
3996
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
3997
|
-
enqueue([go$readFile, [
|
|
3997
|
+
enqueue([go$readFile, [path39, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
3998
3998
|
else {
|
|
3999
3999
|
if (typeof cb2 === "function")
|
|
4000
4000
|
cb2.apply(this, arguments);
|
|
@@ -4002,16 +4002,16 @@ var require_graceful_fs = __commonJS({
|
|
|
4002
4002
|
});
|
|
4003
4003
|
}
|
|
4004
4004
|
}
|
|
4005
|
-
var fs$writeFile =
|
|
4006
|
-
|
|
4007
|
-
function writeFile(
|
|
4005
|
+
var fs$writeFile = fs37.writeFile;
|
|
4006
|
+
fs37.writeFile = writeFile;
|
|
4007
|
+
function writeFile(path38, data, options, cb) {
|
|
4008
4008
|
if (typeof options === "function")
|
|
4009
4009
|
cb = options, options = null;
|
|
4010
|
-
return go$writeFile(
|
|
4011
|
-
function go$writeFile(
|
|
4012
|
-
return fs$writeFile(
|
|
4010
|
+
return go$writeFile(path38, data, options, cb);
|
|
4011
|
+
function go$writeFile(path39, data2, options2, cb2, startTime) {
|
|
4012
|
+
return fs$writeFile(path39, data2, options2, function(err) {
|
|
4013
4013
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4014
|
-
enqueue([go$writeFile, [
|
|
4014
|
+
enqueue([go$writeFile, [path39, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4015
4015
|
else {
|
|
4016
4016
|
if (typeof cb2 === "function")
|
|
4017
4017
|
cb2.apply(this, arguments);
|
|
@@ -4019,17 +4019,17 @@ var require_graceful_fs = __commonJS({
|
|
|
4019
4019
|
});
|
|
4020
4020
|
}
|
|
4021
4021
|
}
|
|
4022
|
-
var fs$appendFile =
|
|
4022
|
+
var fs$appendFile = fs37.appendFile;
|
|
4023
4023
|
if (fs$appendFile)
|
|
4024
|
-
|
|
4025
|
-
function appendFile(
|
|
4024
|
+
fs37.appendFile = appendFile;
|
|
4025
|
+
function appendFile(path38, data, options, cb) {
|
|
4026
4026
|
if (typeof options === "function")
|
|
4027
4027
|
cb = options, options = null;
|
|
4028
|
-
return go$appendFile(
|
|
4029
|
-
function go$appendFile(
|
|
4030
|
-
return fs$appendFile(
|
|
4028
|
+
return go$appendFile(path38, data, options, cb);
|
|
4029
|
+
function go$appendFile(path39, data2, options2, cb2, startTime) {
|
|
4030
|
+
return fs$appendFile(path39, data2, options2, function(err) {
|
|
4031
4031
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4032
|
-
enqueue([go$appendFile, [
|
|
4032
|
+
enqueue([go$appendFile, [path39, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4033
4033
|
else {
|
|
4034
4034
|
if (typeof cb2 === "function")
|
|
4035
4035
|
cb2.apply(this, arguments);
|
|
@@ -4037,9 +4037,9 @@ var require_graceful_fs = __commonJS({
|
|
|
4037
4037
|
});
|
|
4038
4038
|
}
|
|
4039
4039
|
}
|
|
4040
|
-
var fs$copyFile =
|
|
4040
|
+
var fs$copyFile = fs37.copyFile;
|
|
4041
4041
|
if (fs$copyFile)
|
|
4042
|
-
|
|
4042
|
+
fs37.copyFile = copyFile;
|
|
4043
4043
|
function copyFile(src, dest, flags, cb) {
|
|
4044
4044
|
if (typeof flags === "function") {
|
|
4045
4045
|
cb = flags;
|
|
@@ -4057,34 +4057,34 @@ var require_graceful_fs = __commonJS({
|
|
|
4057
4057
|
});
|
|
4058
4058
|
}
|
|
4059
4059
|
}
|
|
4060
|
-
var fs$readdir =
|
|
4061
|
-
|
|
4060
|
+
var fs$readdir = fs37.readdir;
|
|
4061
|
+
fs37.readdir = readdir;
|
|
4062
4062
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
4063
|
-
function readdir(
|
|
4063
|
+
function readdir(path38, options, cb) {
|
|
4064
4064
|
if (typeof options === "function")
|
|
4065
4065
|
cb = options, options = null;
|
|
4066
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
4067
|
-
return fs$readdir(
|
|
4068
|
-
|
|
4066
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path39, options2, cb2, startTime) {
|
|
4067
|
+
return fs$readdir(path39, fs$readdirCallback(
|
|
4068
|
+
path39,
|
|
4069
4069
|
options2,
|
|
4070
4070
|
cb2,
|
|
4071
4071
|
startTime
|
|
4072
4072
|
));
|
|
4073
|
-
} : function go$readdir2(
|
|
4074
|
-
return fs$readdir(
|
|
4075
|
-
|
|
4073
|
+
} : function go$readdir2(path39, options2, cb2, startTime) {
|
|
4074
|
+
return fs$readdir(path39, options2, fs$readdirCallback(
|
|
4075
|
+
path39,
|
|
4076
4076
|
options2,
|
|
4077
4077
|
cb2,
|
|
4078
4078
|
startTime
|
|
4079
4079
|
));
|
|
4080
4080
|
};
|
|
4081
|
-
return go$readdir(
|
|
4082
|
-
function fs$readdirCallback(
|
|
4081
|
+
return go$readdir(path38, options, cb);
|
|
4082
|
+
function fs$readdirCallback(path39, options2, cb2, startTime) {
|
|
4083
4083
|
return function(err, files) {
|
|
4084
4084
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4085
4085
|
enqueue([
|
|
4086
4086
|
go$readdir,
|
|
4087
|
-
[
|
|
4087
|
+
[path39, options2, cb2],
|
|
4088
4088
|
err,
|
|
4089
4089
|
startTime || Date.now(),
|
|
4090
4090
|
Date.now()
|
|
@@ -4099,21 +4099,21 @@ var require_graceful_fs = __commonJS({
|
|
|
4099
4099
|
}
|
|
4100
4100
|
}
|
|
4101
4101
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
4102
|
-
var legStreams = legacy(
|
|
4102
|
+
var legStreams = legacy(fs37);
|
|
4103
4103
|
ReadStream = legStreams.ReadStream;
|
|
4104
4104
|
WriteStream = legStreams.WriteStream;
|
|
4105
4105
|
}
|
|
4106
|
-
var fs$ReadStream =
|
|
4106
|
+
var fs$ReadStream = fs37.ReadStream;
|
|
4107
4107
|
if (fs$ReadStream) {
|
|
4108
4108
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
4109
4109
|
ReadStream.prototype.open = ReadStream$open;
|
|
4110
4110
|
}
|
|
4111
|
-
var fs$WriteStream =
|
|
4111
|
+
var fs$WriteStream = fs37.WriteStream;
|
|
4112
4112
|
if (fs$WriteStream) {
|
|
4113
4113
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
4114
4114
|
WriteStream.prototype.open = WriteStream$open;
|
|
4115
4115
|
}
|
|
4116
|
-
Object.defineProperty(
|
|
4116
|
+
Object.defineProperty(fs37, "ReadStream", {
|
|
4117
4117
|
get: function() {
|
|
4118
4118
|
return ReadStream;
|
|
4119
4119
|
},
|
|
@@ -4123,7 +4123,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4123
4123
|
enumerable: true,
|
|
4124
4124
|
configurable: true
|
|
4125
4125
|
});
|
|
4126
|
-
Object.defineProperty(
|
|
4126
|
+
Object.defineProperty(fs37, "WriteStream", {
|
|
4127
4127
|
get: function() {
|
|
4128
4128
|
return WriteStream;
|
|
4129
4129
|
},
|
|
@@ -4134,7 +4134,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4134
4134
|
configurable: true
|
|
4135
4135
|
});
|
|
4136
4136
|
var FileReadStream = ReadStream;
|
|
4137
|
-
Object.defineProperty(
|
|
4137
|
+
Object.defineProperty(fs37, "FileReadStream", {
|
|
4138
4138
|
get: function() {
|
|
4139
4139
|
return FileReadStream;
|
|
4140
4140
|
},
|
|
@@ -4145,7 +4145,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4145
4145
|
configurable: true
|
|
4146
4146
|
});
|
|
4147
4147
|
var FileWriteStream = WriteStream;
|
|
4148
|
-
Object.defineProperty(
|
|
4148
|
+
Object.defineProperty(fs37, "FileWriteStream", {
|
|
4149
4149
|
get: function() {
|
|
4150
4150
|
return FileWriteStream;
|
|
4151
4151
|
},
|
|
@@ -4155,7 +4155,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4155
4155
|
enumerable: true,
|
|
4156
4156
|
configurable: true
|
|
4157
4157
|
});
|
|
4158
|
-
function ReadStream(
|
|
4158
|
+
function ReadStream(path38, options) {
|
|
4159
4159
|
if (this instanceof ReadStream)
|
|
4160
4160
|
return fs$ReadStream.apply(this, arguments), this;
|
|
4161
4161
|
else
|
|
@@ -4175,7 +4175,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4175
4175
|
}
|
|
4176
4176
|
});
|
|
4177
4177
|
}
|
|
4178
|
-
function WriteStream(
|
|
4178
|
+
function WriteStream(path38, options) {
|
|
4179
4179
|
if (this instanceof WriteStream)
|
|
4180
4180
|
return fs$WriteStream.apply(this, arguments), this;
|
|
4181
4181
|
else
|
|
@@ -4193,22 +4193,22 @@ var require_graceful_fs = __commonJS({
|
|
|
4193
4193
|
}
|
|
4194
4194
|
});
|
|
4195
4195
|
}
|
|
4196
|
-
function createReadStream(
|
|
4197
|
-
return new
|
|
4196
|
+
function createReadStream(path38, options) {
|
|
4197
|
+
return new fs37.ReadStream(path38, options);
|
|
4198
4198
|
}
|
|
4199
|
-
function createWriteStream2(
|
|
4200
|
-
return new
|
|
4199
|
+
function createWriteStream2(path38, options) {
|
|
4200
|
+
return new fs37.WriteStream(path38, options);
|
|
4201
4201
|
}
|
|
4202
|
-
var fs$open =
|
|
4203
|
-
|
|
4204
|
-
function open(
|
|
4202
|
+
var fs$open = fs37.open;
|
|
4203
|
+
fs37.open = open;
|
|
4204
|
+
function open(path38, flags, mode, cb) {
|
|
4205
4205
|
if (typeof mode === "function")
|
|
4206
4206
|
cb = mode, mode = null;
|
|
4207
|
-
return go$open(
|
|
4208
|
-
function go$open(
|
|
4209
|
-
return fs$open(
|
|
4207
|
+
return go$open(path38, flags, mode, cb);
|
|
4208
|
+
function go$open(path39, flags2, mode2, cb2, startTime) {
|
|
4209
|
+
return fs$open(path39, flags2, mode2, function(err, fd) {
|
|
4210
4210
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4211
|
-
enqueue([go$open, [
|
|
4211
|
+
enqueue([go$open, [path39, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4212
4212
|
else {
|
|
4213
4213
|
if (typeof cb2 === "function")
|
|
4214
4214
|
cb2.apply(this, arguments);
|
|
@@ -4216,20 +4216,20 @@ var require_graceful_fs = __commonJS({
|
|
|
4216
4216
|
});
|
|
4217
4217
|
}
|
|
4218
4218
|
}
|
|
4219
|
-
return
|
|
4219
|
+
return fs37;
|
|
4220
4220
|
}
|
|
4221
4221
|
function enqueue(elem) {
|
|
4222
4222
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
4223
|
-
|
|
4223
|
+
fs36[gracefulQueue].push(elem);
|
|
4224
4224
|
retry();
|
|
4225
4225
|
}
|
|
4226
4226
|
var retryTimer;
|
|
4227
4227
|
function resetQueue() {
|
|
4228
4228
|
var now = Date.now();
|
|
4229
|
-
for (var i = 0; i <
|
|
4230
|
-
if (
|
|
4231
|
-
|
|
4232
|
-
|
|
4229
|
+
for (var i = 0; i < fs36[gracefulQueue].length; ++i) {
|
|
4230
|
+
if (fs36[gracefulQueue][i].length > 2) {
|
|
4231
|
+
fs36[gracefulQueue][i][3] = now;
|
|
4232
|
+
fs36[gracefulQueue][i][4] = now;
|
|
4233
4233
|
}
|
|
4234
4234
|
}
|
|
4235
4235
|
retry();
|
|
@@ -4237,9 +4237,9 @@ var require_graceful_fs = __commonJS({
|
|
|
4237
4237
|
function retry() {
|
|
4238
4238
|
clearTimeout(retryTimer);
|
|
4239
4239
|
retryTimer = void 0;
|
|
4240
|
-
if (
|
|
4240
|
+
if (fs36[gracefulQueue].length === 0)
|
|
4241
4241
|
return;
|
|
4242
|
-
var elem =
|
|
4242
|
+
var elem = fs36[gracefulQueue].shift();
|
|
4243
4243
|
var fn = elem[0];
|
|
4244
4244
|
var args = elem[1];
|
|
4245
4245
|
var err = elem[2];
|
|
@@ -4261,7 +4261,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4261
4261
|
debug("RETRY", fn.name, args);
|
|
4262
4262
|
fn.apply(null, args.concat([startTime]));
|
|
4263
4263
|
} else {
|
|
4264
|
-
|
|
4264
|
+
fs36[gracefulQueue].push(elem);
|
|
4265
4265
|
}
|
|
4266
4266
|
}
|
|
4267
4267
|
if (retryTimer === void 0) {
|
|
@@ -4276,7 +4276,7 @@ var require_fs = __commonJS({
|
|
|
4276
4276
|
"../node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
4277
4277
|
"use strict";
|
|
4278
4278
|
var u = require_universalify().fromCallback;
|
|
4279
|
-
var
|
|
4279
|
+
var fs36 = require_graceful_fs();
|
|
4280
4280
|
var api = [
|
|
4281
4281
|
"access",
|
|
4282
4282
|
"appendFile",
|
|
@@ -4317,26 +4317,26 @@ var require_fs = __commonJS({
|
|
|
4317
4317
|
"utimes",
|
|
4318
4318
|
"writeFile"
|
|
4319
4319
|
].filter((key) => {
|
|
4320
|
-
return typeof
|
|
4320
|
+
return typeof fs36[key] === "function";
|
|
4321
4321
|
});
|
|
4322
|
-
Object.assign(exports2,
|
|
4322
|
+
Object.assign(exports2, fs36);
|
|
4323
4323
|
api.forEach((method) => {
|
|
4324
|
-
exports2[method] = u(
|
|
4324
|
+
exports2[method] = u(fs36[method]);
|
|
4325
4325
|
});
|
|
4326
4326
|
exports2.exists = function(filename, callback) {
|
|
4327
4327
|
if (typeof callback === "function") {
|
|
4328
|
-
return
|
|
4328
|
+
return fs36.exists(filename, callback);
|
|
4329
4329
|
}
|
|
4330
4330
|
return new Promise((resolve4) => {
|
|
4331
|
-
return
|
|
4331
|
+
return fs36.exists(filename, resolve4);
|
|
4332
4332
|
});
|
|
4333
4333
|
};
|
|
4334
4334
|
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
4335
4335
|
if (typeof callback === "function") {
|
|
4336
|
-
return
|
|
4336
|
+
return fs36.read(fd, buffer, offset, length, position, callback);
|
|
4337
4337
|
}
|
|
4338
4338
|
return new Promise((resolve4, reject) => {
|
|
4339
|
-
|
|
4339
|
+
fs36.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
4340
4340
|
if (err) return reject(err);
|
|
4341
4341
|
resolve4({ bytesRead, buffer: buffer2 });
|
|
4342
4342
|
});
|
|
@@ -4344,10 +4344,10 @@ var require_fs = __commonJS({
|
|
|
4344
4344
|
};
|
|
4345
4345
|
exports2.write = function(fd, buffer, ...args) {
|
|
4346
4346
|
if (typeof args[args.length - 1] === "function") {
|
|
4347
|
-
return
|
|
4347
|
+
return fs36.write(fd, buffer, ...args);
|
|
4348
4348
|
}
|
|
4349
4349
|
return new Promise((resolve4, reject) => {
|
|
4350
|
-
|
|
4350
|
+
fs36.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
4351
4351
|
if (err) return reject(err);
|
|
4352
4352
|
resolve4({ bytesWritten, buffer: buffer2 });
|
|
4353
4353
|
});
|
|
@@ -4355,10 +4355,10 @@ var require_fs = __commonJS({
|
|
|
4355
4355
|
};
|
|
4356
4356
|
exports2.readv = function(fd, buffers, ...args) {
|
|
4357
4357
|
if (typeof args[args.length - 1] === "function") {
|
|
4358
|
-
return
|
|
4358
|
+
return fs36.readv(fd, buffers, ...args);
|
|
4359
4359
|
}
|
|
4360
4360
|
return new Promise((resolve4, reject) => {
|
|
4361
|
-
|
|
4361
|
+
fs36.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
4362
4362
|
if (err) return reject(err);
|
|
4363
4363
|
resolve4({ bytesRead, buffers: buffers2 });
|
|
4364
4364
|
});
|
|
@@ -4366,17 +4366,17 @@ var require_fs = __commonJS({
|
|
|
4366
4366
|
};
|
|
4367
4367
|
exports2.writev = function(fd, buffers, ...args) {
|
|
4368
4368
|
if (typeof args[args.length - 1] === "function") {
|
|
4369
|
-
return
|
|
4369
|
+
return fs36.writev(fd, buffers, ...args);
|
|
4370
4370
|
}
|
|
4371
4371
|
return new Promise((resolve4, reject) => {
|
|
4372
|
-
|
|
4372
|
+
fs36.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
4373
4373
|
if (err) return reject(err);
|
|
4374
4374
|
resolve4({ bytesWritten, buffers: buffers2 });
|
|
4375
4375
|
});
|
|
4376
4376
|
});
|
|
4377
4377
|
};
|
|
4378
|
-
if (typeof
|
|
4379
|
-
exports2.realpath.native = u(
|
|
4378
|
+
if (typeof fs36.realpath.native === "function") {
|
|
4379
|
+
exports2.realpath.native = u(fs36.realpath.native);
|
|
4380
4380
|
} else {
|
|
4381
4381
|
process.emitWarning(
|
|
4382
4382
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -4391,10 +4391,10 @@ var require_fs = __commonJS({
|
|
|
4391
4391
|
var require_utils = __commonJS({
|
|
4392
4392
|
"../node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
4393
4393
|
"use strict";
|
|
4394
|
-
var
|
|
4394
|
+
var path38 = require("path");
|
|
4395
4395
|
module2.exports.checkPath = function checkPath(pth) {
|
|
4396
4396
|
if (process.platform === "win32") {
|
|
4397
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
4397
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path38.parse(pth).root, ""));
|
|
4398
4398
|
if (pathHasInvalidWinCharacters) {
|
|
4399
4399
|
const error48 = new Error(`Path contains invalid characters: ${pth}`);
|
|
4400
4400
|
error48.code = "EINVAL";
|
|
@@ -4409,7 +4409,7 @@ var require_utils = __commonJS({
|
|
|
4409
4409
|
var require_make_dir = __commonJS({
|
|
4410
4410
|
"../node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
4411
4411
|
"use strict";
|
|
4412
|
-
var
|
|
4412
|
+
var fs36 = require_fs();
|
|
4413
4413
|
var { checkPath } = require_utils();
|
|
4414
4414
|
var getMode = (options) => {
|
|
4415
4415
|
const defaults = { mode: 511 };
|
|
@@ -4418,14 +4418,14 @@ var require_make_dir = __commonJS({
|
|
|
4418
4418
|
};
|
|
4419
4419
|
module2.exports.makeDir = async (dir, options) => {
|
|
4420
4420
|
checkPath(dir);
|
|
4421
|
-
return
|
|
4421
|
+
return fs36.mkdir(dir, {
|
|
4422
4422
|
mode: getMode(options),
|
|
4423
4423
|
recursive: true
|
|
4424
4424
|
});
|
|
4425
4425
|
};
|
|
4426
4426
|
module2.exports.makeDirSync = (dir, options) => {
|
|
4427
4427
|
checkPath(dir);
|
|
4428
|
-
return
|
|
4428
|
+
return fs36.mkdirSync(dir, {
|
|
4429
4429
|
mode: getMode(options),
|
|
4430
4430
|
recursive: true
|
|
4431
4431
|
});
|
|
@@ -4457,13 +4457,13 @@ var require_path_exists = __commonJS({
|
|
|
4457
4457
|
"../node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
4458
4458
|
"use strict";
|
|
4459
4459
|
var u = require_universalify().fromPromise;
|
|
4460
|
-
var
|
|
4461
|
-
function pathExists(
|
|
4462
|
-
return
|
|
4460
|
+
var fs36 = require_fs();
|
|
4461
|
+
function pathExists(path38) {
|
|
4462
|
+
return fs36.access(path38).then(() => true).catch(() => false);
|
|
4463
4463
|
}
|
|
4464
4464
|
module2.exports = {
|
|
4465
4465
|
pathExists: u(pathExists),
|
|
4466
|
-
pathExistsSync:
|
|
4466
|
+
pathExistsSync: fs36.existsSync
|
|
4467
4467
|
};
|
|
4468
4468
|
}
|
|
4469
4469
|
});
|
|
@@ -4472,16 +4472,16 @@ var require_path_exists = __commonJS({
|
|
|
4472
4472
|
var require_utimes = __commonJS({
|
|
4473
4473
|
"../node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
4474
4474
|
"use strict";
|
|
4475
|
-
var
|
|
4475
|
+
var fs36 = require_fs();
|
|
4476
4476
|
var u = require_universalify().fromPromise;
|
|
4477
|
-
async function utimesMillis(
|
|
4478
|
-
const fd = await
|
|
4477
|
+
async function utimesMillis(path38, atime, mtime) {
|
|
4478
|
+
const fd = await fs36.open(path38, "r+");
|
|
4479
4479
|
let closeErr = null;
|
|
4480
4480
|
try {
|
|
4481
|
-
await
|
|
4481
|
+
await fs36.futimes(fd, atime, mtime);
|
|
4482
4482
|
} finally {
|
|
4483
4483
|
try {
|
|
4484
|
-
await
|
|
4484
|
+
await fs36.close(fd);
|
|
4485
4485
|
} catch (e) {
|
|
4486
4486
|
closeErr = e;
|
|
4487
4487
|
}
|
|
@@ -4490,10 +4490,10 @@ var require_utimes = __commonJS({
|
|
|
4490
4490
|
throw closeErr;
|
|
4491
4491
|
}
|
|
4492
4492
|
}
|
|
4493
|
-
function utimesMillisSync(
|
|
4494
|
-
const fd =
|
|
4495
|
-
|
|
4496
|
-
return
|
|
4493
|
+
function utimesMillisSync(path38, atime, mtime) {
|
|
4494
|
+
const fd = fs36.openSync(path38, "r+");
|
|
4495
|
+
fs36.futimesSync(fd, atime, mtime);
|
|
4496
|
+
return fs36.closeSync(fd);
|
|
4497
4497
|
}
|
|
4498
4498
|
module2.exports = {
|
|
4499
4499
|
utimesMillis: u(utimesMillis),
|
|
@@ -4506,11 +4506,11 @@ var require_utimes = __commonJS({
|
|
|
4506
4506
|
var require_stat = __commonJS({
|
|
4507
4507
|
"../node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
4508
4508
|
"use strict";
|
|
4509
|
-
var
|
|
4510
|
-
var
|
|
4509
|
+
var fs36 = require_fs();
|
|
4510
|
+
var path38 = require("path");
|
|
4511
4511
|
var u = require_universalify().fromPromise;
|
|
4512
4512
|
function getStats(src, dest, opts) {
|
|
4513
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
4513
|
+
const statFunc = opts.dereference ? (file2) => fs36.stat(file2, { bigint: true }) : (file2) => fs36.lstat(file2, { bigint: true });
|
|
4514
4514
|
return Promise.all([
|
|
4515
4515
|
statFunc(src),
|
|
4516
4516
|
statFunc(dest).catch((err) => {
|
|
@@ -4521,7 +4521,7 @@ var require_stat = __commonJS({
|
|
|
4521
4521
|
}
|
|
4522
4522
|
function getStatsSync(src, dest, opts) {
|
|
4523
4523
|
let destStat;
|
|
4524
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
4524
|
+
const statFunc = opts.dereference ? (file2) => fs36.statSync(file2, { bigint: true }) : (file2) => fs36.lstatSync(file2, { bigint: true });
|
|
4525
4525
|
const srcStat = statFunc(src);
|
|
4526
4526
|
try {
|
|
4527
4527
|
destStat = statFunc(dest);
|
|
@@ -4535,8 +4535,8 @@ var require_stat = __commonJS({
|
|
|
4535
4535
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
4536
4536
|
if (destStat) {
|
|
4537
4537
|
if (areIdentical(srcStat, destStat)) {
|
|
4538
|
-
const srcBaseName =
|
|
4539
|
-
const destBaseName =
|
|
4538
|
+
const srcBaseName = path38.basename(src);
|
|
4539
|
+
const destBaseName = path38.basename(dest);
|
|
4540
4540
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
4541
4541
|
return { srcStat, destStat, isChangingCase: true };
|
|
4542
4542
|
}
|
|
@@ -4558,8 +4558,8 @@ var require_stat = __commonJS({
|
|
|
4558
4558
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
4559
4559
|
if (destStat) {
|
|
4560
4560
|
if (areIdentical(srcStat, destStat)) {
|
|
4561
|
-
const srcBaseName =
|
|
4562
|
-
const destBaseName =
|
|
4561
|
+
const srcBaseName = path38.basename(src);
|
|
4562
|
+
const destBaseName = path38.basename(dest);
|
|
4563
4563
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
4564
4564
|
return { srcStat, destStat, isChangingCase: true };
|
|
4565
4565
|
}
|
|
@@ -4578,12 +4578,12 @@ var require_stat = __commonJS({
|
|
|
4578
4578
|
return { srcStat, destStat };
|
|
4579
4579
|
}
|
|
4580
4580
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
4581
|
-
const srcParent =
|
|
4582
|
-
const destParent =
|
|
4583
|
-
if (destParent === srcParent || destParent ===
|
|
4581
|
+
const srcParent = path38.resolve(path38.dirname(src));
|
|
4582
|
+
const destParent = path38.resolve(path38.dirname(dest));
|
|
4583
|
+
if (destParent === srcParent || destParent === path38.parse(destParent).root) return;
|
|
4584
4584
|
let destStat;
|
|
4585
4585
|
try {
|
|
4586
|
-
destStat = await
|
|
4586
|
+
destStat = await fs36.stat(destParent, { bigint: true });
|
|
4587
4587
|
} catch (err) {
|
|
4588
4588
|
if (err.code === "ENOENT") return;
|
|
4589
4589
|
throw err;
|
|
@@ -4594,12 +4594,12 @@ var require_stat = __commonJS({
|
|
|
4594
4594
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
4595
4595
|
}
|
|
4596
4596
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
4597
|
-
const srcParent =
|
|
4598
|
-
const destParent =
|
|
4599
|
-
if (destParent === srcParent || destParent ===
|
|
4597
|
+
const srcParent = path38.resolve(path38.dirname(src));
|
|
4598
|
+
const destParent = path38.resolve(path38.dirname(dest));
|
|
4599
|
+
if (destParent === srcParent || destParent === path38.parse(destParent).root) return;
|
|
4600
4600
|
let destStat;
|
|
4601
4601
|
try {
|
|
4602
|
-
destStat =
|
|
4602
|
+
destStat = fs36.statSync(destParent, { bigint: true });
|
|
4603
4603
|
} catch (err) {
|
|
4604
4604
|
if (err.code === "ENOENT") return;
|
|
4605
4605
|
throw err;
|
|
@@ -4613,8 +4613,8 @@ var require_stat = __commonJS({
|
|
|
4613
4613
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
4614
4614
|
}
|
|
4615
4615
|
function isSrcSubdir(src, dest) {
|
|
4616
|
-
const srcArr =
|
|
4617
|
-
const destArr =
|
|
4616
|
+
const srcArr = path38.resolve(src).split(path38.sep).filter((i) => i);
|
|
4617
|
+
const destArr = path38.resolve(dest).split(path38.sep).filter((i) => i);
|
|
4618
4618
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
4619
4619
|
}
|
|
4620
4620
|
function errMsg(src, dest, funcName) {
|
|
@@ -4666,8 +4666,8 @@ var require_async = __commonJS({
|
|
|
4666
4666
|
var require_copy = __commonJS({
|
|
4667
4667
|
"../node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
4668
4668
|
"use strict";
|
|
4669
|
-
var
|
|
4670
|
-
var
|
|
4669
|
+
var fs36 = require_fs();
|
|
4670
|
+
var path38 = require("path");
|
|
4671
4671
|
var { mkdirs } = require_mkdirs();
|
|
4672
4672
|
var { pathExists } = require_path_exists();
|
|
4673
4673
|
var { utimesMillis } = require_utimes();
|
|
@@ -4690,7 +4690,7 @@ var require_copy = __commonJS({
|
|
|
4690
4690
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
4691
4691
|
const include = await runFilter(src, dest, opts);
|
|
4692
4692
|
if (!include) return;
|
|
4693
|
-
const destParent =
|
|
4693
|
+
const destParent = path38.dirname(dest);
|
|
4694
4694
|
const dirExists = await pathExists(destParent);
|
|
4695
4695
|
if (!dirExists) {
|
|
4696
4696
|
await mkdirs(destParent);
|
|
@@ -4702,7 +4702,7 @@ var require_copy = __commonJS({
|
|
|
4702
4702
|
return opts.filter(src, dest);
|
|
4703
4703
|
}
|
|
4704
4704
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
4705
|
-
const statFn = opts.dereference ?
|
|
4705
|
+
const statFn = opts.dereference ? fs36.stat : fs36.lstat;
|
|
4706
4706
|
const srcStat = await statFn(src);
|
|
4707
4707
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
4708
4708
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -4714,7 +4714,7 @@ var require_copy = __commonJS({
|
|
|
4714
4714
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
4715
4715
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
4716
4716
|
if (opts.overwrite) {
|
|
4717
|
-
await
|
|
4717
|
+
await fs36.unlink(dest);
|
|
4718
4718
|
return copyFile(srcStat, src, dest, opts);
|
|
4719
4719
|
}
|
|
4720
4720
|
if (opts.errorOnExist) {
|
|
@@ -4722,29 +4722,29 @@ var require_copy = __commonJS({
|
|
|
4722
4722
|
}
|
|
4723
4723
|
}
|
|
4724
4724
|
async function copyFile(srcStat, src, dest, opts) {
|
|
4725
|
-
await
|
|
4725
|
+
await fs36.copyFile(src, dest);
|
|
4726
4726
|
if (opts.preserveTimestamps) {
|
|
4727
4727
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
4728
4728
|
await makeFileWritable(dest, srcStat.mode);
|
|
4729
4729
|
}
|
|
4730
|
-
const updatedSrcStat = await
|
|
4730
|
+
const updatedSrcStat = await fs36.stat(src);
|
|
4731
4731
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
4732
4732
|
}
|
|
4733
|
-
return
|
|
4733
|
+
return fs36.chmod(dest, srcStat.mode);
|
|
4734
4734
|
}
|
|
4735
4735
|
function fileIsNotWritable(srcMode) {
|
|
4736
4736
|
return (srcMode & 128) === 0;
|
|
4737
4737
|
}
|
|
4738
4738
|
function makeFileWritable(dest, srcMode) {
|
|
4739
|
-
return
|
|
4739
|
+
return fs36.chmod(dest, srcMode | 128);
|
|
4740
4740
|
}
|
|
4741
4741
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
4742
4742
|
if (!destStat) {
|
|
4743
|
-
await
|
|
4743
|
+
await fs36.mkdir(dest);
|
|
4744
4744
|
}
|
|
4745
|
-
await asyncIteratorConcurrentProcess(await
|
|
4746
|
-
const srcItem =
|
|
4747
|
-
const destItem =
|
|
4745
|
+
await asyncIteratorConcurrentProcess(await fs36.opendir(src), async (item) => {
|
|
4746
|
+
const srcItem = path38.join(src, item.name);
|
|
4747
|
+
const destItem = path38.join(dest, item.name);
|
|
4748
4748
|
const include = await runFilter(srcItem, destItem, opts);
|
|
4749
4749
|
if (include) {
|
|
4750
4750
|
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -4752,26 +4752,26 @@ var require_copy = __commonJS({
|
|
|
4752
4752
|
}
|
|
4753
4753
|
});
|
|
4754
4754
|
if (!destStat) {
|
|
4755
|
-
await
|
|
4755
|
+
await fs36.chmod(dest, srcStat.mode);
|
|
4756
4756
|
}
|
|
4757
4757
|
}
|
|
4758
4758
|
async function onLink(destStat, src, dest, opts) {
|
|
4759
|
-
let resolvedSrc = await
|
|
4759
|
+
let resolvedSrc = await fs36.readlink(src);
|
|
4760
4760
|
if (opts.dereference) {
|
|
4761
|
-
resolvedSrc =
|
|
4761
|
+
resolvedSrc = path38.resolve(process.cwd(), resolvedSrc);
|
|
4762
4762
|
}
|
|
4763
4763
|
if (!destStat) {
|
|
4764
|
-
return
|
|
4764
|
+
return fs36.symlink(resolvedSrc, dest);
|
|
4765
4765
|
}
|
|
4766
4766
|
let resolvedDest = null;
|
|
4767
4767
|
try {
|
|
4768
|
-
resolvedDest = await
|
|
4768
|
+
resolvedDest = await fs36.readlink(dest);
|
|
4769
4769
|
} catch (e) {
|
|
4770
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
4770
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs36.symlink(resolvedSrc, dest);
|
|
4771
4771
|
throw e;
|
|
4772
4772
|
}
|
|
4773
4773
|
if (opts.dereference) {
|
|
4774
|
-
resolvedDest =
|
|
4774
|
+
resolvedDest = path38.resolve(process.cwd(), resolvedDest);
|
|
4775
4775
|
}
|
|
4776
4776
|
if (resolvedSrc !== resolvedDest) {
|
|
4777
4777
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -4781,8 +4781,8 @@ var require_copy = __commonJS({
|
|
|
4781
4781
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
4782
4782
|
}
|
|
4783
4783
|
}
|
|
4784
|
-
await
|
|
4785
|
-
return
|
|
4784
|
+
await fs36.unlink(dest);
|
|
4785
|
+
return fs36.symlink(resolvedSrc, dest);
|
|
4786
4786
|
}
|
|
4787
4787
|
module2.exports = copy;
|
|
4788
4788
|
}
|
|
@@ -4792,8 +4792,8 @@ var require_copy = __commonJS({
|
|
|
4792
4792
|
var require_copy_sync = __commonJS({
|
|
4793
4793
|
"../node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
4794
4794
|
"use strict";
|
|
4795
|
-
var
|
|
4796
|
-
var
|
|
4795
|
+
var fs36 = require_graceful_fs();
|
|
4796
|
+
var path38 = require("path");
|
|
4797
4797
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
4798
4798
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
4799
4799
|
var stat = require_stat();
|
|
@@ -4814,12 +4814,12 @@ var require_copy_sync = __commonJS({
|
|
|
4814
4814
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
4815
4815
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
4816
4816
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
4817
|
-
const destParent =
|
|
4818
|
-
if (!
|
|
4817
|
+
const destParent = path38.dirname(dest);
|
|
4818
|
+
if (!fs36.existsSync(destParent)) mkdirsSync(destParent);
|
|
4819
4819
|
return getStats(destStat, src, dest, opts);
|
|
4820
4820
|
}
|
|
4821
4821
|
function getStats(destStat, src, dest, opts) {
|
|
4822
|
-
const statSync2 = opts.dereference ?
|
|
4822
|
+
const statSync2 = opts.dereference ? fs36.statSync : fs36.lstatSync;
|
|
4823
4823
|
const srcStat = statSync2(src);
|
|
4824
4824
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
4825
4825
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -4834,14 +4834,14 @@ var require_copy_sync = __commonJS({
|
|
|
4834
4834
|
}
|
|
4835
4835
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
4836
4836
|
if (opts.overwrite) {
|
|
4837
|
-
|
|
4837
|
+
fs36.unlinkSync(dest);
|
|
4838
4838
|
return copyFile(srcStat, src, dest, opts);
|
|
4839
4839
|
} else if (opts.errorOnExist) {
|
|
4840
4840
|
throw new Error(`'${dest}' already exists`);
|
|
4841
4841
|
}
|
|
4842
4842
|
}
|
|
4843
4843
|
function copyFile(srcStat, src, dest, opts) {
|
|
4844
|
-
|
|
4844
|
+
fs36.copyFileSync(src, dest);
|
|
4845
4845
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
4846
4846
|
return setDestMode(dest, srcStat.mode);
|
|
4847
4847
|
}
|
|
@@ -4856,10 +4856,10 @@ var require_copy_sync = __commonJS({
|
|
|
4856
4856
|
return setDestMode(dest, srcMode | 128);
|
|
4857
4857
|
}
|
|
4858
4858
|
function setDestMode(dest, srcMode) {
|
|
4859
|
-
return
|
|
4859
|
+
return fs36.chmodSync(dest, srcMode);
|
|
4860
4860
|
}
|
|
4861
4861
|
function setDestTimestamps(src, dest) {
|
|
4862
|
-
const updatedSrcStat =
|
|
4862
|
+
const updatedSrcStat = fs36.statSync(src);
|
|
4863
4863
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
4864
4864
|
}
|
|
4865
4865
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -4867,12 +4867,12 @@ var require_copy_sync = __commonJS({
|
|
|
4867
4867
|
return copyDir(src, dest, opts);
|
|
4868
4868
|
}
|
|
4869
4869
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
4870
|
-
|
|
4870
|
+
fs36.mkdirSync(dest);
|
|
4871
4871
|
copyDir(src, dest, opts);
|
|
4872
4872
|
return setDestMode(dest, srcMode);
|
|
4873
4873
|
}
|
|
4874
4874
|
function copyDir(src, dest, opts) {
|
|
4875
|
-
const dir =
|
|
4875
|
+
const dir = fs36.opendirSync(src);
|
|
4876
4876
|
try {
|
|
4877
4877
|
let dirent;
|
|
4878
4878
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -4883,29 +4883,29 @@ var require_copy_sync = __commonJS({
|
|
|
4883
4883
|
}
|
|
4884
4884
|
}
|
|
4885
4885
|
function copyDirItem(item, src, dest, opts) {
|
|
4886
|
-
const srcItem =
|
|
4887
|
-
const destItem =
|
|
4886
|
+
const srcItem = path38.join(src, item);
|
|
4887
|
+
const destItem = path38.join(dest, item);
|
|
4888
4888
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
4889
4889
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
4890
4890
|
return getStats(destStat, srcItem, destItem, opts);
|
|
4891
4891
|
}
|
|
4892
4892
|
function onLink(destStat, src, dest, opts) {
|
|
4893
|
-
let resolvedSrc =
|
|
4893
|
+
let resolvedSrc = fs36.readlinkSync(src);
|
|
4894
4894
|
if (opts.dereference) {
|
|
4895
|
-
resolvedSrc =
|
|
4895
|
+
resolvedSrc = path38.resolve(process.cwd(), resolvedSrc);
|
|
4896
4896
|
}
|
|
4897
4897
|
if (!destStat) {
|
|
4898
|
-
return
|
|
4898
|
+
return fs36.symlinkSync(resolvedSrc, dest);
|
|
4899
4899
|
} else {
|
|
4900
4900
|
let resolvedDest;
|
|
4901
4901
|
try {
|
|
4902
|
-
resolvedDest =
|
|
4902
|
+
resolvedDest = fs36.readlinkSync(dest);
|
|
4903
4903
|
} catch (err) {
|
|
4904
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
4904
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs36.symlinkSync(resolvedSrc, dest);
|
|
4905
4905
|
throw err;
|
|
4906
4906
|
}
|
|
4907
4907
|
if (opts.dereference) {
|
|
4908
|
-
resolvedDest =
|
|
4908
|
+
resolvedDest = path38.resolve(process.cwd(), resolvedDest);
|
|
4909
4909
|
}
|
|
4910
4910
|
if (resolvedSrc !== resolvedDest) {
|
|
4911
4911
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -4919,8 +4919,8 @@ var require_copy_sync = __commonJS({
|
|
|
4919
4919
|
}
|
|
4920
4920
|
}
|
|
4921
4921
|
function copyLink(resolvedSrc, dest) {
|
|
4922
|
-
|
|
4923
|
-
return
|
|
4922
|
+
fs36.unlinkSync(dest);
|
|
4923
|
+
return fs36.symlinkSync(resolvedSrc, dest);
|
|
4924
4924
|
}
|
|
4925
4925
|
module2.exports = copySync;
|
|
4926
4926
|
}
|
|
@@ -4942,13 +4942,13 @@ var require_copy2 = __commonJS({
|
|
|
4942
4942
|
var require_remove = __commonJS({
|
|
4943
4943
|
"../node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
4944
4944
|
"use strict";
|
|
4945
|
-
var
|
|
4945
|
+
var fs36 = require_graceful_fs();
|
|
4946
4946
|
var u = require_universalify().fromCallback;
|
|
4947
|
-
function remove(
|
|
4948
|
-
|
|
4947
|
+
function remove(path38, callback) {
|
|
4948
|
+
fs36.rm(path38, { recursive: true, force: true }, callback);
|
|
4949
4949
|
}
|
|
4950
|
-
function removeSync(
|
|
4951
|
-
|
|
4950
|
+
function removeSync(path38) {
|
|
4951
|
+
fs36.rmSync(path38, { recursive: true, force: true });
|
|
4952
4952
|
}
|
|
4953
4953
|
module2.exports = {
|
|
4954
4954
|
remove: u(remove),
|
|
@@ -4962,28 +4962,28 @@ var require_empty = __commonJS({
|
|
|
4962
4962
|
"../node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
4963
4963
|
"use strict";
|
|
4964
4964
|
var u = require_universalify().fromPromise;
|
|
4965
|
-
var
|
|
4966
|
-
var
|
|
4965
|
+
var fs36 = require_fs();
|
|
4966
|
+
var path38 = require("path");
|
|
4967
4967
|
var mkdir = require_mkdirs();
|
|
4968
4968
|
var remove = require_remove();
|
|
4969
4969
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
4970
4970
|
let items;
|
|
4971
4971
|
try {
|
|
4972
|
-
items = await
|
|
4972
|
+
items = await fs36.readdir(dir);
|
|
4973
4973
|
} catch {
|
|
4974
4974
|
return mkdir.mkdirs(dir);
|
|
4975
4975
|
}
|
|
4976
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
4976
|
+
return Promise.all(items.map((item) => remove.remove(path38.join(dir, item))));
|
|
4977
4977
|
});
|
|
4978
4978
|
function emptyDirSync(dir) {
|
|
4979
4979
|
let items;
|
|
4980
4980
|
try {
|
|
4981
|
-
items =
|
|
4981
|
+
items = fs36.readdirSync(dir);
|
|
4982
4982
|
} catch {
|
|
4983
4983
|
return mkdir.mkdirsSync(dir);
|
|
4984
4984
|
}
|
|
4985
4985
|
items.forEach((item) => {
|
|
4986
|
-
item =
|
|
4986
|
+
item = path38.join(dir, item);
|
|
4987
4987
|
remove.removeSync(item);
|
|
4988
4988
|
});
|
|
4989
4989
|
}
|
|
@@ -5001,52 +5001,52 @@ var require_file = __commonJS({
|
|
|
5001
5001
|
"../node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
5002
5002
|
"use strict";
|
|
5003
5003
|
var u = require_universalify().fromPromise;
|
|
5004
|
-
var
|
|
5005
|
-
var
|
|
5004
|
+
var path38 = require("path");
|
|
5005
|
+
var fs36 = require_fs();
|
|
5006
5006
|
var mkdir = require_mkdirs();
|
|
5007
5007
|
async function createFile(file2) {
|
|
5008
5008
|
let stats;
|
|
5009
5009
|
try {
|
|
5010
|
-
stats = await
|
|
5010
|
+
stats = await fs36.stat(file2);
|
|
5011
5011
|
} catch {
|
|
5012
5012
|
}
|
|
5013
5013
|
if (stats && stats.isFile()) return;
|
|
5014
|
-
const dir =
|
|
5014
|
+
const dir = path38.dirname(file2);
|
|
5015
5015
|
let dirStats = null;
|
|
5016
5016
|
try {
|
|
5017
|
-
dirStats = await
|
|
5017
|
+
dirStats = await fs36.stat(dir);
|
|
5018
5018
|
} catch (err) {
|
|
5019
5019
|
if (err.code === "ENOENT") {
|
|
5020
5020
|
await mkdir.mkdirs(dir);
|
|
5021
|
-
await
|
|
5021
|
+
await fs36.writeFile(file2, "");
|
|
5022
5022
|
return;
|
|
5023
5023
|
} else {
|
|
5024
5024
|
throw err;
|
|
5025
5025
|
}
|
|
5026
5026
|
}
|
|
5027
5027
|
if (dirStats.isDirectory()) {
|
|
5028
|
-
await
|
|
5028
|
+
await fs36.writeFile(file2, "");
|
|
5029
5029
|
} else {
|
|
5030
|
-
await
|
|
5030
|
+
await fs36.readdir(dir);
|
|
5031
5031
|
}
|
|
5032
5032
|
}
|
|
5033
5033
|
function createFileSync(file2) {
|
|
5034
5034
|
let stats;
|
|
5035
5035
|
try {
|
|
5036
|
-
stats =
|
|
5036
|
+
stats = fs36.statSync(file2);
|
|
5037
5037
|
} catch {
|
|
5038
5038
|
}
|
|
5039
5039
|
if (stats && stats.isFile()) return;
|
|
5040
|
-
const dir =
|
|
5040
|
+
const dir = path38.dirname(file2);
|
|
5041
5041
|
try {
|
|
5042
|
-
if (!
|
|
5043
|
-
|
|
5042
|
+
if (!fs36.statSync(dir).isDirectory()) {
|
|
5043
|
+
fs36.readdirSync(dir);
|
|
5044
5044
|
}
|
|
5045
5045
|
} catch (err) {
|
|
5046
5046
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
5047
5047
|
else throw err;
|
|
5048
5048
|
}
|
|
5049
|
-
|
|
5049
|
+
fs36.writeFileSync(file2, "");
|
|
5050
5050
|
}
|
|
5051
5051
|
module2.exports = {
|
|
5052
5052
|
createFile: u(createFile),
|
|
@@ -5060,50 +5060,50 @@ var require_link = __commonJS({
|
|
|
5060
5060
|
"../node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
5061
5061
|
"use strict";
|
|
5062
5062
|
var u = require_universalify().fromPromise;
|
|
5063
|
-
var
|
|
5064
|
-
var
|
|
5063
|
+
var path38 = require("path");
|
|
5064
|
+
var fs36 = require_fs();
|
|
5065
5065
|
var mkdir = require_mkdirs();
|
|
5066
5066
|
var { pathExists } = require_path_exists();
|
|
5067
5067
|
var { areIdentical } = require_stat();
|
|
5068
5068
|
async function createLink(srcpath, dstpath) {
|
|
5069
5069
|
let dstStat;
|
|
5070
5070
|
try {
|
|
5071
|
-
dstStat = await
|
|
5071
|
+
dstStat = await fs36.lstat(dstpath);
|
|
5072
5072
|
} catch {
|
|
5073
5073
|
}
|
|
5074
5074
|
let srcStat;
|
|
5075
5075
|
try {
|
|
5076
|
-
srcStat = await
|
|
5076
|
+
srcStat = await fs36.lstat(srcpath);
|
|
5077
5077
|
} catch (err) {
|
|
5078
5078
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
5079
5079
|
throw err;
|
|
5080
5080
|
}
|
|
5081
5081
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
5082
|
-
const dir =
|
|
5082
|
+
const dir = path38.dirname(dstpath);
|
|
5083
5083
|
const dirExists = await pathExists(dir);
|
|
5084
5084
|
if (!dirExists) {
|
|
5085
5085
|
await mkdir.mkdirs(dir);
|
|
5086
5086
|
}
|
|
5087
|
-
await
|
|
5087
|
+
await fs36.link(srcpath, dstpath);
|
|
5088
5088
|
}
|
|
5089
5089
|
function createLinkSync(srcpath, dstpath) {
|
|
5090
5090
|
let dstStat;
|
|
5091
5091
|
try {
|
|
5092
|
-
dstStat =
|
|
5092
|
+
dstStat = fs36.lstatSync(dstpath);
|
|
5093
5093
|
} catch {
|
|
5094
5094
|
}
|
|
5095
5095
|
try {
|
|
5096
|
-
const srcStat =
|
|
5096
|
+
const srcStat = fs36.lstatSync(srcpath);
|
|
5097
5097
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
5098
5098
|
} catch (err) {
|
|
5099
5099
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
5100
5100
|
throw err;
|
|
5101
5101
|
}
|
|
5102
|
-
const dir =
|
|
5103
|
-
const dirExists =
|
|
5104
|
-
if (dirExists) return
|
|
5102
|
+
const dir = path38.dirname(dstpath);
|
|
5103
|
+
const dirExists = fs36.existsSync(dir);
|
|
5104
|
+
if (dirExists) return fs36.linkSync(srcpath, dstpath);
|
|
5105
5105
|
mkdir.mkdirsSync(dir);
|
|
5106
|
-
return
|
|
5106
|
+
return fs36.linkSync(srcpath, dstpath);
|
|
5107
5107
|
}
|
|
5108
5108
|
module2.exports = {
|
|
5109
5109
|
createLink: u(createLink),
|
|
@@ -5116,14 +5116,14 @@ var require_link = __commonJS({
|
|
|
5116
5116
|
var require_symlink_paths = __commonJS({
|
|
5117
5117
|
"../node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
5118
5118
|
"use strict";
|
|
5119
|
-
var
|
|
5120
|
-
var
|
|
5119
|
+
var path38 = require("path");
|
|
5120
|
+
var fs36 = require_fs();
|
|
5121
5121
|
var { pathExists } = require_path_exists();
|
|
5122
5122
|
var u = require_universalify().fromPromise;
|
|
5123
5123
|
async function symlinkPaths(srcpath, dstpath) {
|
|
5124
|
-
if (
|
|
5124
|
+
if (path38.isAbsolute(srcpath)) {
|
|
5125
5125
|
try {
|
|
5126
|
-
await
|
|
5126
|
+
await fs36.lstat(srcpath);
|
|
5127
5127
|
} catch (err) {
|
|
5128
5128
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
5129
5129
|
throw err;
|
|
@@ -5133,8 +5133,8 @@ var require_symlink_paths = __commonJS({
|
|
|
5133
5133
|
toDst: srcpath
|
|
5134
5134
|
};
|
|
5135
5135
|
}
|
|
5136
|
-
const dstdir =
|
|
5137
|
-
const relativeToDst =
|
|
5136
|
+
const dstdir = path38.dirname(dstpath);
|
|
5137
|
+
const relativeToDst = path38.join(dstdir, srcpath);
|
|
5138
5138
|
const exists = await pathExists(relativeToDst);
|
|
5139
5139
|
if (exists) {
|
|
5140
5140
|
return {
|
|
@@ -5143,39 +5143,39 @@ var require_symlink_paths = __commonJS({
|
|
|
5143
5143
|
};
|
|
5144
5144
|
}
|
|
5145
5145
|
try {
|
|
5146
|
-
await
|
|
5146
|
+
await fs36.lstat(srcpath);
|
|
5147
5147
|
} catch (err) {
|
|
5148
5148
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
5149
5149
|
throw err;
|
|
5150
5150
|
}
|
|
5151
5151
|
return {
|
|
5152
5152
|
toCwd: srcpath,
|
|
5153
|
-
toDst:
|
|
5153
|
+
toDst: path38.relative(dstdir, srcpath)
|
|
5154
5154
|
};
|
|
5155
5155
|
}
|
|
5156
5156
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
5157
|
-
if (
|
|
5158
|
-
const exists2 =
|
|
5157
|
+
if (path38.isAbsolute(srcpath)) {
|
|
5158
|
+
const exists2 = fs36.existsSync(srcpath);
|
|
5159
5159
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
5160
5160
|
return {
|
|
5161
5161
|
toCwd: srcpath,
|
|
5162
5162
|
toDst: srcpath
|
|
5163
5163
|
};
|
|
5164
5164
|
}
|
|
5165
|
-
const dstdir =
|
|
5166
|
-
const relativeToDst =
|
|
5167
|
-
const exists =
|
|
5165
|
+
const dstdir = path38.dirname(dstpath);
|
|
5166
|
+
const relativeToDst = path38.join(dstdir, srcpath);
|
|
5167
|
+
const exists = fs36.existsSync(relativeToDst);
|
|
5168
5168
|
if (exists) {
|
|
5169
5169
|
return {
|
|
5170
5170
|
toCwd: relativeToDst,
|
|
5171
5171
|
toDst: srcpath
|
|
5172
5172
|
};
|
|
5173
5173
|
}
|
|
5174
|
-
const srcExists =
|
|
5174
|
+
const srcExists = fs36.existsSync(srcpath);
|
|
5175
5175
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
5176
5176
|
return {
|
|
5177
5177
|
toCwd: srcpath,
|
|
5178
|
-
toDst:
|
|
5178
|
+
toDst: path38.relative(dstdir, srcpath)
|
|
5179
5179
|
};
|
|
5180
5180
|
}
|
|
5181
5181
|
module2.exports = {
|
|
@@ -5189,13 +5189,13 @@ var require_symlink_paths = __commonJS({
|
|
|
5189
5189
|
var require_symlink_type = __commonJS({
|
|
5190
5190
|
"../node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
5191
5191
|
"use strict";
|
|
5192
|
-
var
|
|
5192
|
+
var fs36 = require_fs();
|
|
5193
5193
|
var u = require_universalify().fromPromise;
|
|
5194
5194
|
async function symlinkType(srcpath, type) {
|
|
5195
5195
|
if (type) return type;
|
|
5196
5196
|
let stats;
|
|
5197
5197
|
try {
|
|
5198
|
-
stats = await
|
|
5198
|
+
stats = await fs36.lstat(srcpath);
|
|
5199
5199
|
} catch {
|
|
5200
5200
|
return "file";
|
|
5201
5201
|
}
|
|
@@ -5205,7 +5205,7 @@ var require_symlink_type = __commonJS({
|
|
|
5205
5205
|
if (type) return type;
|
|
5206
5206
|
let stats;
|
|
5207
5207
|
try {
|
|
5208
|
-
stats =
|
|
5208
|
+
stats = fs36.lstatSync(srcpath);
|
|
5209
5209
|
} catch {
|
|
5210
5210
|
return "file";
|
|
5211
5211
|
}
|
|
@@ -5223,8 +5223,8 @@ var require_symlink = __commonJS({
|
|
|
5223
5223
|
"../node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
5224
5224
|
"use strict";
|
|
5225
5225
|
var u = require_universalify().fromPromise;
|
|
5226
|
-
var
|
|
5227
|
-
var
|
|
5226
|
+
var path38 = require("path");
|
|
5227
|
+
var fs36 = require_fs();
|
|
5228
5228
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
5229
5229
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
5230
5230
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -5233,44 +5233,44 @@ var require_symlink = __commonJS({
|
|
|
5233
5233
|
async function createSymlink(srcpath, dstpath, type) {
|
|
5234
5234
|
let stats;
|
|
5235
5235
|
try {
|
|
5236
|
-
stats = await
|
|
5236
|
+
stats = await fs36.lstat(dstpath);
|
|
5237
5237
|
} catch {
|
|
5238
5238
|
}
|
|
5239
5239
|
if (stats && stats.isSymbolicLink()) {
|
|
5240
5240
|
const [srcStat, dstStat] = await Promise.all([
|
|
5241
|
-
|
|
5242
|
-
|
|
5241
|
+
fs36.stat(srcpath),
|
|
5242
|
+
fs36.stat(dstpath)
|
|
5243
5243
|
]);
|
|
5244
5244
|
if (areIdentical(srcStat, dstStat)) return;
|
|
5245
5245
|
}
|
|
5246
5246
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
5247
5247
|
srcpath = relative.toDst;
|
|
5248
5248
|
const toType = await symlinkType(relative.toCwd, type);
|
|
5249
|
-
const dir =
|
|
5249
|
+
const dir = path38.dirname(dstpath);
|
|
5250
5250
|
if (!await pathExists(dir)) {
|
|
5251
5251
|
await mkdirs(dir);
|
|
5252
5252
|
}
|
|
5253
|
-
return
|
|
5253
|
+
return fs36.symlink(srcpath, dstpath, toType);
|
|
5254
5254
|
}
|
|
5255
5255
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
5256
5256
|
let stats;
|
|
5257
5257
|
try {
|
|
5258
|
-
stats =
|
|
5258
|
+
stats = fs36.lstatSync(dstpath);
|
|
5259
5259
|
} catch {
|
|
5260
5260
|
}
|
|
5261
5261
|
if (stats && stats.isSymbolicLink()) {
|
|
5262
|
-
const srcStat =
|
|
5263
|
-
const dstStat =
|
|
5262
|
+
const srcStat = fs36.statSync(srcpath);
|
|
5263
|
+
const dstStat = fs36.statSync(dstpath);
|
|
5264
5264
|
if (areIdentical(srcStat, dstStat)) return;
|
|
5265
5265
|
}
|
|
5266
5266
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
5267
5267
|
srcpath = relative.toDst;
|
|
5268
5268
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
5269
|
-
const dir =
|
|
5270
|
-
const exists =
|
|
5271
|
-
if (exists) return
|
|
5269
|
+
const dir = path38.dirname(dstpath);
|
|
5270
|
+
const exists = fs36.existsSync(dir);
|
|
5271
|
+
if (exists) return fs36.symlinkSync(srcpath, dstpath, type);
|
|
5272
5272
|
mkdirsSync(dir);
|
|
5273
|
-
return
|
|
5273
|
+
return fs36.symlinkSync(srcpath, dstpath, type);
|
|
5274
5274
|
}
|
|
5275
5275
|
module2.exports = {
|
|
5276
5276
|
createSymlink: u(createSymlink),
|
|
@@ -5339,9 +5339,9 @@ var require_jsonfile = __commonJS({
|
|
|
5339
5339
|
if (typeof options === "string") {
|
|
5340
5340
|
options = { encoding: options };
|
|
5341
5341
|
}
|
|
5342
|
-
const
|
|
5342
|
+
const fs36 = options.fs || _fs;
|
|
5343
5343
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
5344
|
-
let data = await universalify.fromCallback(
|
|
5344
|
+
let data = await universalify.fromCallback(fs36.readFile)(file2, options);
|
|
5345
5345
|
data = stripBom(data);
|
|
5346
5346
|
let obj;
|
|
5347
5347
|
try {
|
|
@@ -5361,10 +5361,10 @@ var require_jsonfile = __commonJS({
|
|
|
5361
5361
|
if (typeof options === "string") {
|
|
5362
5362
|
options = { encoding: options };
|
|
5363
5363
|
}
|
|
5364
|
-
const
|
|
5364
|
+
const fs36 = options.fs || _fs;
|
|
5365
5365
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
5366
5366
|
try {
|
|
5367
|
-
let content =
|
|
5367
|
+
let content = fs36.readFileSync(file2, options);
|
|
5368
5368
|
content = stripBom(content);
|
|
5369
5369
|
return JSON.parse(content, options.reviver);
|
|
5370
5370
|
} catch (err) {
|
|
@@ -5377,15 +5377,15 @@ var require_jsonfile = __commonJS({
|
|
|
5377
5377
|
}
|
|
5378
5378
|
}
|
|
5379
5379
|
async function _writeFile(file2, obj, options = {}) {
|
|
5380
|
-
const
|
|
5380
|
+
const fs36 = options.fs || _fs;
|
|
5381
5381
|
const str = stringify2(obj, options);
|
|
5382
|
-
await universalify.fromCallback(
|
|
5382
|
+
await universalify.fromCallback(fs36.writeFile)(file2, str, options);
|
|
5383
5383
|
}
|
|
5384
5384
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
5385
5385
|
function writeFileSync3(file2, obj, options = {}) {
|
|
5386
|
-
const
|
|
5386
|
+
const fs36 = options.fs || _fs;
|
|
5387
5387
|
const str = stringify2(obj, options);
|
|
5388
|
-
return
|
|
5388
|
+
return fs36.writeFileSync(file2, str, options);
|
|
5389
5389
|
}
|
|
5390
5390
|
module2.exports = {
|
|
5391
5391
|
readFile,
|
|
@@ -5416,23 +5416,23 @@ var require_output_file = __commonJS({
|
|
|
5416
5416
|
"../node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
5417
5417
|
"use strict";
|
|
5418
5418
|
var u = require_universalify().fromPromise;
|
|
5419
|
-
var
|
|
5420
|
-
var
|
|
5419
|
+
var fs36 = require_fs();
|
|
5420
|
+
var path38 = require("path");
|
|
5421
5421
|
var mkdir = require_mkdirs();
|
|
5422
5422
|
var pathExists = require_path_exists().pathExists;
|
|
5423
5423
|
async function outputFile(file2, data, encoding = "utf-8") {
|
|
5424
|
-
const dir =
|
|
5424
|
+
const dir = path38.dirname(file2);
|
|
5425
5425
|
if (!await pathExists(dir)) {
|
|
5426
5426
|
await mkdir.mkdirs(dir);
|
|
5427
5427
|
}
|
|
5428
|
-
return
|
|
5428
|
+
return fs36.writeFile(file2, data, encoding);
|
|
5429
5429
|
}
|
|
5430
5430
|
function outputFileSync(file2, ...args) {
|
|
5431
|
-
const dir =
|
|
5432
|
-
if (!
|
|
5431
|
+
const dir = path38.dirname(file2);
|
|
5432
|
+
if (!fs36.existsSync(dir)) {
|
|
5433
5433
|
mkdir.mkdirsSync(dir);
|
|
5434
5434
|
}
|
|
5435
|
-
|
|
5435
|
+
fs36.writeFileSync(file2, ...args);
|
|
5436
5436
|
}
|
|
5437
5437
|
module2.exports = {
|
|
5438
5438
|
outputFile: u(outputFile),
|
|
@@ -5491,8 +5491,8 @@ var require_json = __commonJS({
|
|
|
5491
5491
|
var require_move = __commonJS({
|
|
5492
5492
|
"../node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
5493
5493
|
"use strict";
|
|
5494
|
-
var
|
|
5495
|
-
var
|
|
5494
|
+
var fs36 = require_fs();
|
|
5495
|
+
var path38 = require("path");
|
|
5496
5496
|
var { copy } = require_copy2();
|
|
5497
5497
|
var { remove } = require_remove();
|
|
5498
5498
|
var { mkdirp } = require_mkdirs();
|
|
@@ -5502,8 +5502,8 @@ var require_move = __commonJS({
|
|
|
5502
5502
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
5503
5503
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
5504
5504
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
5505
|
-
const destParent =
|
|
5506
|
-
const parsedParentPath =
|
|
5505
|
+
const destParent = path38.dirname(dest);
|
|
5506
|
+
const parsedParentPath = path38.parse(destParent);
|
|
5507
5507
|
if (parsedParentPath.root !== destParent) {
|
|
5508
5508
|
await mkdirp(destParent);
|
|
5509
5509
|
}
|
|
@@ -5518,7 +5518,7 @@ var require_move = __commonJS({
|
|
|
5518
5518
|
}
|
|
5519
5519
|
}
|
|
5520
5520
|
try {
|
|
5521
|
-
await
|
|
5521
|
+
await fs36.rename(src, dest);
|
|
5522
5522
|
} catch (err) {
|
|
5523
5523
|
if (err.code !== "EXDEV") {
|
|
5524
5524
|
throw err;
|
|
@@ -5543,8 +5543,8 @@ var require_move = __commonJS({
|
|
|
5543
5543
|
var require_move_sync = __commonJS({
|
|
5544
5544
|
"../node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
5545
5545
|
"use strict";
|
|
5546
|
-
var
|
|
5547
|
-
var
|
|
5546
|
+
var fs36 = require_graceful_fs();
|
|
5547
|
+
var path38 = require("path");
|
|
5548
5548
|
var copySync = require_copy2().copySync;
|
|
5549
5549
|
var removeSync = require_remove().removeSync;
|
|
5550
5550
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -5554,12 +5554,12 @@ var require_move_sync = __commonJS({
|
|
|
5554
5554
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
5555
5555
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
5556
5556
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
5557
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
5557
|
+
if (!isParentRoot(dest)) mkdirpSync(path38.dirname(dest));
|
|
5558
5558
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
5559
5559
|
}
|
|
5560
5560
|
function isParentRoot(dest) {
|
|
5561
|
-
const parent =
|
|
5562
|
-
const parsedPath =
|
|
5561
|
+
const parent = path38.dirname(dest);
|
|
5562
|
+
const parsedPath = path38.parse(parent);
|
|
5563
5563
|
return parsedPath.root === parent;
|
|
5564
5564
|
}
|
|
5565
5565
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -5568,12 +5568,12 @@ var require_move_sync = __commonJS({
|
|
|
5568
5568
|
removeSync(dest);
|
|
5569
5569
|
return rename(src, dest, overwrite);
|
|
5570
5570
|
}
|
|
5571
|
-
if (
|
|
5571
|
+
if (fs36.existsSync(dest)) throw new Error("dest already exists.");
|
|
5572
5572
|
return rename(src, dest, overwrite);
|
|
5573
5573
|
}
|
|
5574
5574
|
function rename(src, dest, overwrite) {
|
|
5575
5575
|
try {
|
|
5576
|
-
|
|
5576
|
+
fs36.renameSync(src, dest);
|
|
5577
5577
|
} catch (err) {
|
|
5578
5578
|
if (err.code !== "EXDEV") throw err;
|
|
5579
5579
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -13673,8 +13673,8 @@ var require_utils3 = __commonJS({
|
|
|
13673
13673
|
}
|
|
13674
13674
|
return ind;
|
|
13675
13675
|
}
|
|
13676
|
-
function removeDotSegments(
|
|
13677
|
-
let input =
|
|
13676
|
+
function removeDotSegments(path38) {
|
|
13677
|
+
let input = path38;
|
|
13678
13678
|
const output = [];
|
|
13679
13679
|
let nextSlash = -1;
|
|
13680
13680
|
let len = 0;
|
|
@@ -13873,8 +13873,8 @@ var require_schemes = __commonJS({
|
|
|
13873
13873
|
wsComponent.secure = void 0;
|
|
13874
13874
|
}
|
|
13875
13875
|
if (wsComponent.resourceName) {
|
|
13876
|
-
const [
|
|
13877
|
-
wsComponent.path =
|
|
13876
|
+
const [path38, query] = wsComponent.resourceName.split("?");
|
|
13877
|
+
wsComponent.path = path38 && path38 !== "/" ? path38 : void 0;
|
|
13878
13878
|
wsComponent.query = query;
|
|
13879
13879
|
wsComponent.resourceName = void 0;
|
|
13880
13880
|
}
|
|
@@ -17200,12 +17200,12 @@ var require_dist2 = __commonJS({
|
|
|
17200
17200
|
throw new Error(`Unknown format "${name}"`);
|
|
17201
17201
|
return f;
|
|
17202
17202
|
};
|
|
17203
|
-
function addFormats(ajv, list,
|
|
17203
|
+
function addFormats(ajv, list, fs36, exportName) {
|
|
17204
17204
|
var _a2;
|
|
17205
17205
|
var _b;
|
|
17206
17206
|
(_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`;
|
|
17207
17207
|
for (const f of list)
|
|
17208
|
-
ajv.addFormat(f,
|
|
17208
|
+
ajv.addFormat(f, fs36[f]);
|
|
17209
17209
|
}
|
|
17210
17210
|
module2.exports = exports2 = formatsPlugin;
|
|
17211
17211
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -27287,8 +27287,8 @@ var require_package = __commonJS({
|
|
|
27287
27287
|
var require_main = __commonJS({
|
|
27288
27288
|
"node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
27289
27289
|
"use strict";
|
|
27290
|
-
var
|
|
27291
|
-
var
|
|
27290
|
+
var fs36 = require("fs");
|
|
27291
|
+
var path38 = require("path");
|
|
27292
27292
|
var os9 = require("os");
|
|
27293
27293
|
var crypto4 = require("crypto");
|
|
27294
27294
|
var packageJson = require_package();
|
|
@@ -27396,7 +27396,7 @@ var require_main = __commonJS({
|
|
|
27396
27396
|
if (options && options.path && options.path.length > 0) {
|
|
27397
27397
|
if (Array.isArray(options.path)) {
|
|
27398
27398
|
for (const filepath of options.path) {
|
|
27399
|
-
if (
|
|
27399
|
+
if (fs36.existsSync(filepath)) {
|
|
27400
27400
|
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
27401
27401
|
}
|
|
27402
27402
|
}
|
|
@@ -27404,15 +27404,15 @@ var require_main = __commonJS({
|
|
|
27404
27404
|
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
27405
27405
|
}
|
|
27406
27406
|
} else {
|
|
27407
|
-
possibleVaultPath =
|
|
27407
|
+
possibleVaultPath = path38.resolve(process.cwd(), ".env.vault");
|
|
27408
27408
|
}
|
|
27409
|
-
if (
|
|
27409
|
+
if (fs36.existsSync(possibleVaultPath)) {
|
|
27410
27410
|
return possibleVaultPath;
|
|
27411
27411
|
}
|
|
27412
27412
|
return null;
|
|
27413
27413
|
}
|
|
27414
27414
|
function _resolveHome(envPath) {
|
|
27415
|
-
return envPath[0] === "~" ?
|
|
27415
|
+
return envPath[0] === "~" ? path38.join(os9.homedir(), envPath.slice(1)) : envPath;
|
|
27416
27416
|
}
|
|
27417
27417
|
function _configVault(options) {
|
|
27418
27418
|
const debug = Boolean(options && options.debug);
|
|
@@ -27429,7 +27429,7 @@ var require_main = __commonJS({
|
|
|
27429
27429
|
return { parsed };
|
|
27430
27430
|
}
|
|
27431
27431
|
function configDotenv(options) {
|
|
27432
|
-
const dotenvPath =
|
|
27432
|
+
const dotenvPath = path38.resolve(process.cwd(), ".env");
|
|
27433
27433
|
let encoding = "utf8";
|
|
27434
27434
|
const debug = Boolean(options && options.debug);
|
|
27435
27435
|
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
@@ -27453,13 +27453,13 @@ var require_main = __commonJS({
|
|
|
27453
27453
|
}
|
|
27454
27454
|
let lastError;
|
|
27455
27455
|
const parsedAll = {};
|
|
27456
|
-
for (const
|
|
27456
|
+
for (const path39 of optionPaths) {
|
|
27457
27457
|
try {
|
|
27458
|
-
const parsed = DotenvModule.parse(
|
|
27458
|
+
const parsed = DotenvModule.parse(fs36.readFileSync(path39, { encoding }));
|
|
27459
27459
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
27460
27460
|
} catch (e) {
|
|
27461
27461
|
if (debug) {
|
|
27462
|
-
_debug(`Failed to load ${
|
|
27462
|
+
_debug(`Failed to load ${path39} ${e.message}`);
|
|
27463
27463
|
}
|
|
27464
27464
|
lastError = e;
|
|
27465
27465
|
}
|
|
@@ -27474,7 +27474,7 @@ var require_main = __commonJS({
|
|
|
27474
27474
|
const shortPaths = [];
|
|
27475
27475
|
for (const filePath of optionPaths) {
|
|
27476
27476
|
try {
|
|
27477
|
-
const relative =
|
|
27477
|
+
const relative = path38.relative(process.cwd(), filePath);
|
|
27478
27478
|
shortPaths.push(relative);
|
|
27479
27479
|
} catch (e) {
|
|
27480
27480
|
if (debug) {
|
|
@@ -29057,7 +29057,7 @@ var require_cell = __commonJS({
|
|
|
29057
29057
|
var require_layout_manager = __commonJS({
|
|
29058
29058
|
"../node_modules/cli-table3/src/layout-manager.js"(exports2, module2) {
|
|
29059
29059
|
"use strict";
|
|
29060
|
-
var { warn, debug } = require_debug2();
|
|
29060
|
+
var { warn: warn2, debug } = require_debug2();
|
|
29061
29061
|
var Cell = require_cell();
|
|
29062
29062
|
var { ColSpanCell, RowSpanCell } = Cell;
|
|
29063
29063
|
(function() {
|
|
@@ -29190,7 +29190,7 @@ var require_layout_manager = __commonJS({
|
|
|
29190
29190
|
let cell = new Cell(opts);
|
|
29191
29191
|
cell.x = opts.x;
|
|
29192
29192
|
cell.y = opts.y;
|
|
29193
|
-
|
|
29193
|
+
warn2(`Missing cell at ${cell.y}-${cell.x}.`);
|
|
29194
29194
|
insertCell(cell, table[y]);
|
|
29195
29195
|
}
|
|
29196
29196
|
}
|
|
@@ -29396,7 +29396,7 @@ var require_cli_table3 = __commonJS({
|
|
|
29396
29396
|
|
|
29397
29397
|
// src/index.ts
|
|
29398
29398
|
var import_node_fs10 = require("fs");
|
|
29399
|
-
var
|
|
29399
|
+
var import_node_path22 = require("path");
|
|
29400
29400
|
|
|
29401
29401
|
// ../node_modules/commander/esm.mjs
|
|
29402
29402
|
var import_index = __toESM(require_commander(), 1);
|
|
@@ -30648,10 +30648,10 @@ function mergeDefs(...defs) {
|
|
|
30648
30648
|
function cloneDef(schema) {
|
|
30649
30649
|
return mergeDefs(schema._zod.def);
|
|
30650
30650
|
}
|
|
30651
|
-
function getElementAtPath(obj,
|
|
30652
|
-
if (!
|
|
30651
|
+
function getElementAtPath(obj, path38) {
|
|
30652
|
+
if (!path38)
|
|
30653
30653
|
return obj;
|
|
30654
|
-
return
|
|
30654
|
+
return path38.reduce((acc, key) => acc?.[key], obj);
|
|
30655
30655
|
}
|
|
30656
30656
|
function promiseAllObject(promisesObj) {
|
|
30657
30657
|
const keys = Object.keys(promisesObj);
|
|
@@ -31034,11 +31034,11 @@ function aborted(x, startIndex = 0) {
|
|
|
31034
31034
|
}
|
|
31035
31035
|
return false;
|
|
31036
31036
|
}
|
|
31037
|
-
function prefixIssues(
|
|
31037
|
+
function prefixIssues(path38, issues) {
|
|
31038
31038
|
return issues.map((iss) => {
|
|
31039
31039
|
var _a2;
|
|
31040
31040
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
31041
|
-
iss.path.unshift(
|
|
31041
|
+
iss.path.unshift(path38);
|
|
31042
31042
|
return iss;
|
|
31043
31043
|
});
|
|
31044
31044
|
}
|
|
@@ -31221,7 +31221,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
|
|
|
31221
31221
|
}
|
|
31222
31222
|
function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
31223
31223
|
const result = { errors: [] };
|
|
31224
|
-
const processError = (error49,
|
|
31224
|
+
const processError = (error49, path38 = []) => {
|
|
31225
31225
|
var _a2, _b;
|
|
31226
31226
|
for (const issue2 of error49.issues) {
|
|
31227
31227
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -31231,7 +31231,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
31231
31231
|
} else if (issue2.code === "invalid_element") {
|
|
31232
31232
|
processError({ issues: issue2.issues }, issue2.path);
|
|
31233
31233
|
} else {
|
|
31234
|
-
const fullpath = [...
|
|
31234
|
+
const fullpath = [...path38, ...issue2.path];
|
|
31235
31235
|
if (fullpath.length === 0) {
|
|
31236
31236
|
result.errors.push(mapper(issue2));
|
|
31237
31237
|
continue;
|
|
@@ -31263,8 +31263,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
31263
31263
|
}
|
|
31264
31264
|
function toDotPath(_path) {
|
|
31265
31265
|
const segs = [];
|
|
31266
|
-
const
|
|
31267
|
-
for (const seg of
|
|
31266
|
+
const path38 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
31267
|
+
for (const seg of path38) {
|
|
31268
31268
|
if (typeof seg === "number")
|
|
31269
31269
|
segs.push(`[${seg}]`);
|
|
31270
31270
|
else if (typeof seg === "symbol")
|
|
@@ -43241,13 +43241,13 @@ function resolveRef(ref, ctx) {
|
|
|
43241
43241
|
if (!ref.startsWith("#")) {
|
|
43242
43242
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
43243
43243
|
}
|
|
43244
|
-
const
|
|
43245
|
-
if (
|
|
43244
|
+
const path38 = ref.slice(1).split("/").filter(Boolean);
|
|
43245
|
+
if (path38.length === 0) {
|
|
43246
43246
|
return ctx.rootSchema;
|
|
43247
43247
|
}
|
|
43248
43248
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
43249
|
-
if (
|
|
43250
|
-
const key =
|
|
43249
|
+
if (path38[0] === defsKey) {
|
|
43250
|
+
const key = path38[1];
|
|
43251
43251
|
if (!key || !ctx.defs[key]) {
|
|
43252
43252
|
throw new Error(`Reference not found: ${ref}`);
|
|
43253
43253
|
}
|
|
@@ -44497,17 +44497,17 @@ function executeBootstrap(plan, opts = {}) {
|
|
|
44497
44497
|
}
|
|
44498
44498
|
console.log(kleur_default.dim(`
|
|
44499
44499
|
Installing ${dep.displayName}...`));
|
|
44500
|
-
let
|
|
44500
|
+
let ok2 = true;
|
|
44501
44501
|
for (const step of steps) {
|
|
44502
44502
|
const cmd = step.sudo && process.platform !== "darwin" ? "sudo" : step.cmd;
|
|
44503
44503
|
const args = step.sudo && process.platform !== "darwin" ? [step.cmd, ...step.args] : step.args;
|
|
44504
44504
|
const r = (0, import_child_process2.spawnSync)(cmd, args, { stdio: "inherit" });
|
|
44505
44505
|
if (r.status !== 0) {
|
|
44506
|
-
|
|
44506
|
+
ok2 = false;
|
|
44507
44507
|
break;
|
|
44508
44508
|
}
|
|
44509
44509
|
}
|
|
44510
|
-
if (
|
|
44510
|
+
if (ok2) {
|
|
44511
44511
|
console.log(t.success(` \u2713 ${dep.displayName} installed`));
|
|
44512
44512
|
result.installed.push(dep.id);
|
|
44513
44513
|
} else {
|
|
@@ -44826,6 +44826,21 @@ var LEGACY_PROJECT_EXTENSION_ENTRIES = /* @__PURE__ */ new Set([
|
|
|
44826
44826
|
PROJECT_EXTENSIONS_ENTRY,
|
|
44827
44827
|
".xtrm/extensions"
|
|
44828
44828
|
]);
|
|
44829
|
+
function runExternalPiToolPatch(pkgRoot, dryRun, log) {
|
|
44830
|
+
const scriptPath = import_path4.default.join(pkgRoot, "scripts", "patch-external-pi-tools.mjs");
|
|
44831
|
+
if (!import_fs_extra9.default.existsSync(scriptPath)) return;
|
|
44832
|
+
if (dryRun) {
|
|
44833
|
+
log?.(`[DRY RUN] node ${scriptPath}`);
|
|
44834
|
+
return;
|
|
44835
|
+
}
|
|
44836
|
+
const result = (0, import_child_process3.spawnSync)("node", [scriptPath], { encoding: "utf8" });
|
|
44837
|
+
if (result.status !== 0) {
|
|
44838
|
+
const stderr = (result.stderr ?? "").trim();
|
|
44839
|
+
if (stderr) log?.(`external tool patch failed: ${stderr}`);
|
|
44840
|
+
} else {
|
|
44841
|
+
log?.("external tool compact/spacing patches applied");
|
|
44842
|
+
}
|
|
44843
|
+
}
|
|
44829
44844
|
var MANAGED_EXTENSIONS = [
|
|
44830
44845
|
{ id: "core", displayName: "@xtrm/pi-core", isLibrary: true, required: true },
|
|
44831
44846
|
{ id: "auto-session-name", displayName: "auto-session-name", required: false },
|
|
@@ -45528,6 +45543,7 @@ async function runPiRuntimeSync(opts = {}) {
|
|
|
45528
45543
|
await rebuildRuntimeActiveView("pi", skillsRoot);
|
|
45529
45544
|
}
|
|
45530
45545
|
}
|
|
45546
|
+
runExternalPiToolPatch(pkgRoot, dryRun, log);
|
|
45531
45547
|
await updatePiSettings(resolvedProjectRoot, dryRun, log);
|
|
45532
45548
|
const requiredFailed = missingPackages.filter((status) => status.pkg.required && result.failed.includes(status.pkg.id));
|
|
45533
45549
|
if (requiredFailed.length === 0) {
|
|
@@ -47004,12 +47020,12 @@ var disallowedKeys = /* @__PURE__ */ new Set([
|
|
|
47004
47020
|
"constructor"
|
|
47005
47021
|
]);
|
|
47006
47022
|
var digits = new Set("0123456789");
|
|
47007
|
-
function getPathSegments(
|
|
47023
|
+
function getPathSegments(path38) {
|
|
47008
47024
|
const parts = [];
|
|
47009
47025
|
let currentSegment = "";
|
|
47010
47026
|
let currentPart = "start";
|
|
47011
47027
|
let isIgnoring = false;
|
|
47012
|
-
for (const character of
|
|
47028
|
+
for (const character of path38) {
|
|
47013
47029
|
switch (character) {
|
|
47014
47030
|
case "\\": {
|
|
47015
47031
|
if (currentPart === "index") {
|
|
@@ -47131,11 +47147,11 @@ function assertNotStringIndex(object2, key) {
|
|
|
47131
47147
|
throw new Error("Cannot use string index");
|
|
47132
47148
|
}
|
|
47133
47149
|
}
|
|
47134
|
-
function getProperty(object2,
|
|
47135
|
-
if (!isObject2(object2) || typeof
|
|
47150
|
+
function getProperty(object2, path38, value) {
|
|
47151
|
+
if (!isObject2(object2) || typeof path38 !== "string") {
|
|
47136
47152
|
return value === void 0 ? object2 : value;
|
|
47137
47153
|
}
|
|
47138
|
-
const pathArray = getPathSegments(
|
|
47154
|
+
const pathArray = getPathSegments(path38);
|
|
47139
47155
|
if (pathArray.length === 0) {
|
|
47140
47156
|
return value;
|
|
47141
47157
|
}
|
|
@@ -47155,12 +47171,12 @@ function getProperty(object2, path36, value) {
|
|
|
47155
47171
|
}
|
|
47156
47172
|
return object2 === void 0 ? value : object2;
|
|
47157
47173
|
}
|
|
47158
|
-
function setProperty(object2,
|
|
47159
|
-
if (!isObject2(object2) || typeof
|
|
47174
|
+
function setProperty(object2, path38, value) {
|
|
47175
|
+
if (!isObject2(object2) || typeof path38 !== "string") {
|
|
47160
47176
|
return object2;
|
|
47161
47177
|
}
|
|
47162
47178
|
const root = object2;
|
|
47163
|
-
const pathArray = getPathSegments(
|
|
47179
|
+
const pathArray = getPathSegments(path38);
|
|
47164
47180
|
for (let index = 0; index < pathArray.length; index++) {
|
|
47165
47181
|
const key = pathArray[index];
|
|
47166
47182
|
assertNotStringIndex(object2, key);
|
|
@@ -47173,11 +47189,11 @@ function setProperty(object2, path36, value) {
|
|
|
47173
47189
|
}
|
|
47174
47190
|
return root;
|
|
47175
47191
|
}
|
|
47176
|
-
function deleteProperty(object2,
|
|
47177
|
-
if (!isObject2(object2) || typeof
|
|
47192
|
+
function deleteProperty(object2, path38) {
|
|
47193
|
+
if (!isObject2(object2) || typeof path38 !== "string") {
|
|
47178
47194
|
return false;
|
|
47179
47195
|
}
|
|
47180
|
-
const pathArray = getPathSegments(
|
|
47196
|
+
const pathArray = getPathSegments(path38);
|
|
47181
47197
|
for (let index = 0; index < pathArray.length; index++) {
|
|
47182
47198
|
const key = pathArray[index];
|
|
47183
47199
|
assertNotStringIndex(object2, key);
|
|
@@ -47191,11 +47207,11 @@ function deleteProperty(object2, path36) {
|
|
|
47191
47207
|
}
|
|
47192
47208
|
}
|
|
47193
47209
|
}
|
|
47194
|
-
function hasProperty(object2,
|
|
47195
|
-
if (!isObject2(object2) || typeof
|
|
47210
|
+
function hasProperty(object2, path38) {
|
|
47211
|
+
if (!isObject2(object2) || typeof path38 !== "string") {
|
|
47196
47212
|
return false;
|
|
47197
47213
|
}
|
|
47198
|
-
const pathArray = getPathSegments(
|
|
47214
|
+
const pathArray = getPathSegments(path38);
|
|
47199
47215
|
if (pathArray.length === 0) {
|
|
47200
47216
|
return false;
|
|
47201
47217
|
}
|
|
@@ -48348,8 +48364,8 @@ function detectAdapter(systemRoot) {
|
|
|
48348
48364
|
// src/core/diff.ts
|
|
48349
48365
|
var IGNORED_ITEMS = /* @__PURE__ */ new Set(["__pycache__", ".DS_Store", "Thumbs.db", ".gitkeep", "node_modules"]);
|
|
48350
48366
|
var PruneModeReadError = class extends Error {
|
|
48351
|
-
constructor(
|
|
48352
|
-
super(`Cannot read ${
|
|
48367
|
+
constructor(path38) {
|
|
48368
|
+
super(`Cannot read ${path38} in prune mode \u2014 aborting to prevent accidental deletion`);
|
|
48353
48369
|
this.name = "PruneModeReadError";
|
|
48354
48370
|
}
|
|
48355
48371
|
};
|
|
@@ -48737,8 +48753,8 @@ async function runProjectInit(opts = {}) {
|
|
|
48737
48753
|
console.log(kleur_default.dim(" Dry run \u2014 no changes written\n"));
|
|
48738
48754
|
return;
|
|
48739
48755
|
}
|
|
48740
|
-
const
|
|
48741
|
-
if (!
|
|
48756
|
+
const ok2 = await confirmInitPlan(effectiveYes);
|
|
48757
|
+
if (!ok2) {
|
|
48742
48758
|
console.log(kleur_default.dim(" Init cancelled.\n"));
|
|
48743
48759
|
return;
|
|
48744
48760
|
}
|
|
@@ -49902,6 +49918,16 @@ function createHelpCommand() {
|
|
|
49902
49918
|
" xtrm reset [--yes/-y]",
|
|
49903
49919
|
" Clear saved CLI preferences.",
|
|
49904
49920
|
"",
|
|
49921
|
+
" xtrm doctor [--cwd <path>]",
|
|
49922
|
+
" Health check for xtrm-managed surfaces (currently: CLAUDE.md fragments).",
|
|
49923
|
+
"",
|
|
49924
|
+
" xtrm claude-sync [options]",
|
|
49925
|
+
" Sync managed CLAUDE.md fragments via XTRM-MANAGED:* sentinels.",
|
|
49926
|
+
" Modes: --check (default, exit 1 on drift), --apply --accept-overwrite,",
|
|
49927
|
+
" --list, --add <fragment>. Use --json on --check or --list for",
|
|
49928
|
+
" machine-readable output. Templated fragments use --repo-name /",
|
|
49929
|
+
" --repo-stats overrides.",
|
|
49930
|
+
"",
|
|
49905
49931
|
" xtrm help",
|
|
49906
49932
|
" Show this help page."
|
|
49907
49933
|
]));
|
|
@@ -53024,6 +53050,388 @@ function createSkillsCommand() {
|
|
|
53024
53050
|
return skills;
|
|
53025
53051
|
}
|
|
53026
53052
|
|
|
53053
|
+
// src/commands/claude-sync.ts
|
|
53054
|
+
var import_fs_extra32 = __toESM(require_lib(), 1);
|
|
53055
|
+
var import_node_path20 = __toESM(require("path"), 1);
|
|
53056
|
+
var import_node_child_process15 = require("child_process");
|
|
53057
|
+
var SENTINEL_RE = /<!-- XTRM-MANAGED:(\S+) start v=(\S+) -->\n([\s\S]*?)\n<!-- XTRM-MANAGED:\1 end -->/g;
|
|
53058
|
+
function parseFrontmatter2(text) {
|
|
53059
|
+
if (!text.startsWith("---\n")) {
|
|
53060
|
+
return { frontmatter: {}, body: text };
|
|
53061
|
+
}
|
|
53062
|
+
const end = text.indexOf("\n---\n", 4);
|
|
53063
|
+
if (end === -1) {
|
|
53064
|
+
return { frontmatter: {}, body: text };
|
|
53065
|
+
}
|
|
53066
|
+
const fmText = text.slice(4, end);
|
|
53067
|
+
const body = text.slice(end + 5);
|
|
53068
|
+
const fm = {};
|
|
53069
|
+
const lines = fmText.split("\n");
|
|
53070
|
+
let currentList = null;
|
|
53071
|
+
for (const line of lines) {
|
|
53072
|
+
if (currentList && line.startsWith(" - ")) {
|
|
53073
|
+
const arr = fm[currentList] ?? [];
|
|
53074
|
+
arr.push(line.slice(4).trim());
|
|
53075
|
+
fm[currentList] = arr;
|
|
53076
|
+
continue;
|
|
53077
|
+
}
|
|
53078
|
+
currentList = null;
|
|
53079
|
+
const m = /^([a-z_][a-z0-9_]*):\s*(.*)$/i.exec(line);
|
|
53080
|
+
if (!m) continue;
|
|
53081
|
+
const key = m[1];
|
|
53082
|
+
const val = m[2];
|
|
53083
|
+
if (val === "") {
|
|
53084
|
+
fm[key] = [];
|
|
53085
|
+
currentList = key;
|
|
53086
|
+
} else {
|
|
53087
|
+
fm[key] = val;
|
|
53088
|
+
}
|
|
53089
|
+
}
|
|
53090
|
+
return { frontmatter: fm, body };
|
|
53091
|
+
}
|
|
53092
|
+
function findTemplatesDir() {
|
|
53093
|
+
let dir = __dirname;
|
|
53094
|
+
for (let i = 0; i < 8; i++) {
|
|
53095
|
+
const candidate = import_node_path20.default.join(dir, "templates", "claude-md-fragments");
|
|
53096
|
+
if (import_fs_extra32.default.existsSync(candidate)) return candidate;
|
|
53097
|
+
const parent = import_node_path20.default.dirname(dir);
|
|
53098
|
+
if (parent === dir) break;
|
|
53099
|
+
dir = parent;
|
|
53100
|
+
}
|
|
53101
|
+
throw new Error("Cannot locate templates/claude-md-fragments/. Run xt claude-sync from inside an xtrm-tools checkout, or set XTRM_FRAGMENTS_DIR.");
|
|
53102
|
+
}
|
|
53103
|
+
function loadFragments() {
|
|
53104
|
+
const dir = process.env.XTRM_FRAGMENTS_DIR ?? findTemplatesDir();
|
|
53105
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
53106
|
+
for (const file2 of import_fs_extra32.default.readdirSync(dir)) {
|
|
53107
|
+
if (!file2.endsWith(".md")) continue;
|
|
53108
|
+
const text = import_fs_extra32.default.readFileSync(import_node_path20.default.join(dir, file2), "utf8");
|
|
53109
|
+
const { frontmatter, body } = parseFrontmatter2(text);
|
|
53110
|
+
const name = String(frontmatter.name ?? file2.replace(/\.md$/, ""));
|
|
53111
|
+
const version3 = String(frontmatter.version ?? "0.0.0");
|
|
53112
|
+
const description = String(frontmatter.description ?? "");
|
|
53113
|
+
const templateVars = Array.isArray(frontmatter.template_vars) ? frontmatter.template_vars : [];
|
|
53114
|
+
map2.set(name, { name, version: version3, description, body: body.replace(/\n+$/, ""), templateVars });
|
|
53115
|
+
}
|
|
53116
|
+
return map2;
|
|
53117
|
+
}
|
|
53118
|
+
function findManagedSections(content) {
|
|
53119
|
+
const out = [];
|
|
53120
|
+
SENTINEL_RE.lastIndex = 0;
|
|
53121
|
+
let m;
|
|
53122
|
+
while ((m = SENTINEL_RE.exec(content)) !== null) {
|
|
53123
|
+
const name = m[1];
|
|
53124
|
+
const version3 = m[2];
|
|
53125
|
+
const body = m[3];
|
|
53126
|
+
const fullStart = m.index;
|
|
53127
|
+
const fullEnd = m.index + m[0].length;
|
|
53128
|
+
const bodyStart = fullStart + `<!-- XTRM-MANAGED:${name} start v=${version3} -->
|
|
53129
|
+
`.length;
|
|
53130
|
+
const bodyEnd = bodyStart + body.length;
|
|
53131
|
+
out.push({ name, version: version3, body, bodyStart, bodyEnd, fullStart, fullEnd });
|
|
53132
|
+
}
|
|
53133
|
+
return out;
|
|
53134
|
+
}
|
|
53135
|
+
function renderFragmentBody(frag, ctx) {
|
|
53136
|
+
let out = frag.body;
|
|
53137
|
+
for (const v of frag.templateVars) {
|
|
53138
|
+
const val = ctx[v] ?? "";
|
|
53139
|
+
out = out.split(`{{${v}}}`).join(val);
|
|
53140
|
+
}
|
|
53141
|
+
return out;
|
|
53142
|
+
}
|
|
53143
|
+
function detectRepoContext(cwd) {
|
|
53144
|
+
let repoName = import_node_path20.default.basename(cwd);
|
|
53145
|
+
try {
|
|
53146
|
+
const top = (0, import_node_child_process15.execSync)("git rev-parse --show-toplevel", { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
53147
|
+
if (top) repoName = import_node_path20.default.basename(top);
|
|
53148
|
+
} catch {
|
|
53149
|
+
}
|
|
53150
|
+
let repoStats = "";
|
|
53151
|
+
const metaPath = import_node_path20.default.join(cwd, ".gitnexus", "meta.json");
|
|
53152
|
+
if (import_fs_extra32.default.existsSync(metaPath)) {
|
|
53153
|
+
try {
|
|
53154
|
+
const meta3 = JSON.parse(import_fs_extra32.default.readFileSync(metaPath, "utf8"));
|
|
53155
|
+
const s = meta3.stats ?? {};
|
|
53156
|
+
const symbols = s.nodes ?? s.symbols ?? s.symbol_count ?? "?";
|
|
53157
|
+
const rels = s.edges ?? s.relationships ?? s.relationship_count ?? "?";
|
|
53158
|
+
const flows = s.processes ?? s.execution_flows ?? s.flow_count ?? "?";
|
|
53159
|
+
repoStats = `${symbols} symbols, ${rels} relationships, ${flows} execution flows`;
|
|
53160
|
+
} catch {
|
|
53161
|
+
}
|
|
53162
|
+
}
|
|
53163
|
+
return { repo_name: repoName, repo_stats: repoStats };
|
|
53164
|
+
}
|
|
53165
|
+
function checkDrift2(content, fragments, ctx) {
|
|
53166
|
+
const sections = findManagedSections(content);
|
|
53167
|
+
const seen = /* @__PURE__ */ new Set();
|
|
53168
|
+
const out = [];
|
|
53169
|
+
for (const sec of sections) {
|
|
53170
|
+
seen.add(sec.name);
|
|
53171
|
+
const frag = fragments.get(sec.name);
|
|
53172
|
+
if (!frag) {
|
|
53173
|
+
out.push({ name: sec.name, kind: "unknown-fragment", currentVersion: sec.version, section: sec });
|
|
53174
|
+
continue;
|
|
53175
|
+
}
|
|
53176
|
+
if (sec.version !== frag.version) {
|
|
53177
|
+
out.push({
|
|
53178
|
+
name: sec.name,
|
|
53179
|
+
kind: "version-mismatch",
|
|
53180
|
+
currentVersion: sec.version,
|
|
53181
|
+
canonicalVersion: frag.version,
|
|
53182
|
+
section: sec
|
|
53183
|
+
});
|
|
53184
|
+
continue;
|
|
53185
|
+
}
|
|
53186
|
+
const expected = renderFragmentBody(frag, ctx);
|
|
53187
|
+
if (sec.body !== expected) {
|
|
53188
|
+
out.push({
|
|
53189
|
+
name: sec.name,
|
|
53190
|
+
kind: "body-mismatch",
|
|
53191
|
+
currentVersion: sec.version,
|
|
53192
|
+
canonicalVersion: frag.version,
|
|
53193
|
+
section: sec
|
|
53194
|
+
});
|
|
53195
|
+
}
|
|
53196
|
+
}
|
|
53197
|
+
return out;
|
|
53198
|
+
}
|
|
53199
|
+
function applyDrift(content, fragments, ctx) {
|
|
53200
|
+
const sections = findManagedSections(content);
|
|
53201
|
+
if (sections.length === 0) return content;
|
|
53202
|
+
let out = "";
|
|
53203
|
+
let cursor = 0;
|
|
53204
|
+
for (const sec of sections) {
|
|
53205
|
+
out += content.slice(cursor, sec.fullStart);
|
|
53206
|
+
const frag = fragments.get(sec.name);
|
|
53207
|
+
if (!frag) {
|
|
53208
|
+
out += content.slice(sec.fullStart, sec.fullEnd);
|
|
53209
|
+
} else {
|
|
53210
|
+
const body = renderFragmentBody(frag, ctx);
|
|
53211
|
+
out += `<!-- XTRM-MANAGED:${frag.name} start v=${frag.version} -->
|
|
53212
|
+
${body}
|
|
53213
|
+
<!-- XTRM-MANAGED:${frag.name} end -->`;
|
|
53214
|
+
}
|
|
53215
|
+
cursor = sec.fullEnd;
|
|
53216
|
+
}
|
|
53217
|
+
out += content.slice(cursor);
|
|
53218
|
+
return out;
|
|
53219
|
+
}
|
|
53220
|
+
function describeDrift(d) {
|
|
53221
|
+
switch (d.kind) {
|
|
53222
|
+
case "version-mismatch":
|
|
53223
|
+
return `${kleur_default.yellow("VERSION")} ${d.name} ${d.currentVersion} -> ${d.canonicalVersion}`;
|
|
53224
|
+
case "body-mismatch":
|
|
53225
|
+
return `${kleur_default.yellow("BODY")} ${d.name} v${d.currentVersion} (canonical v${d.canonicalVersion})`;
|
|
53226
|
+
case "unknown-fragment":
|
|
53227
|
+
return `${kleur_default.red("UNKNOWN")} ${d.name} v${d.currentVersion} (no canonical fragment)`;
|
|
53228
|
+
case "missing-fragment":
|
|
53229
|
+
return `${kleur_default.red("MISSING")} ${d.name}`;
|
|
53230
|
+
}
|
|
53231
|
+
}
|
|
53232
|
+
function resolveClaudeMd(cwd) {
|
|
53233
|
+
const p = import_node_path20.default.join(cwd, "CLAUDE.md");
|
|
53234
|
+
if (!import_fs_extra32.default.existsSync(p)) {
|
|
53235
|
+
throw new Error(`CLAUDE.md not found at ${p}`);
|
|
53236
|
+
}
|
|
53237
|
+
return p;
|
|
53238
|
+
}
|
|
53239
|
+
function createClaudeSyncCommand() {
|
|
53240
|
+
const cmd = new Command("claude-sync").description("Sync managed CLAUDE.md fragments (XTRM-MANAGED:* sentinels)").option("--check", "Report drift between CLAUDE.md sentinels and canonical fragments (exit 1 on drift)").option("--apply", "Rewrite managed sections from canonical fragments").option("--accept-overwrite", "Required with --apply to confirm overwrite of managed sections").option("--list", "List known canonical fragments + versions").option("--add <fragment>", "Append sentinels for <fragment> to end of CLAUDE.md (use when migrating)").option("--json", "Emit machine-readable JSON (with --check or --list)").option("--cwd <path>", "Operate on CLAUDE.md in this directory (default: process.cwd())").option("--repo-name <name>", "Override repo name for gitnexus template substitution").option("--repo-stats <stats>", "Override repo stats for gitnexus template substitution").action(async (opts) => {
|
|
53241
|
+
const fragments = loadFragments();
|
|
53242
|
+
const cwd = import_node_path20.default.resolve(opts.cwd ?? process.cwd());
|
|
53243
|
+
if (opts.list) {
|
|
53244
|
+
if (opts.json) {
|
|
53245
|
+
const out = [...fragments.values()].map((f) => ({
|
|
53246
|
+
name: f.name,
|
|
53247
|
+
version: f.version,
|
|
53248
|
+
description: f.description,
|
|
53249
|
+
template_vars: f.templateVars
|
|
53250
|
+
}));
|
|
53251
|
+
console.log(JSON.stringify(out, null, 2));
|
|
53252
|
+
return;
|
|
53253
|
+
}
|
|
53254
|
+
console.log(kleur_default.bold("Canonical CLAUDE.md fragments:\n"));
|
|
53255
|
+
for (const frag of [...fragments.values()].sort((a, b) => a.name.localeCompare(b.name))) {
|
|
53256
|
+
const vars = frag.templateVars.length ? ` ${kleur_default.dim(`(vars: ${frag.templateVars.join(", ")})`)}` : "";
|
|
53257
|
+
console.log(` ${kleur_default.cyan(frag.name.padEnd(20))} v${frag.version} ${kleur_default.dim(frag.description)}${vars}`);
|
|
53258
|
+
}
|
|
53259
|
+
return;
|
|
53260
|
+
}
|
|
53261
|
+
const claudeMd = resolveClaudeMd(cwd);
|
|
53262
|
+
const content = import_fs_extra32.default.readFileSync(claudeMd, "utf8");
|
|
53263
|
+
const detected = detectRepoContext(cwd);
|
|
53264
|
+
const ctx = {
|
|
53265
|
+
repo_name: opts.repoName ?? detected.repo_name,
|
|
53266
|
+
repo_stats: opts.repoStats ?? detected.repo_stats
|
|
53267
|
+
};
|
|
53268
|
+
if (opts.add) {
|
|
53269
|
+
const frag = fragments.get(opts.add);
|
|
53270
|
+
if (!frag) {
|
|
53271
|
+
console.error(kleur_default.red(`\u2717 Unknown fragment: ${opts.add}`));
|
|
53272
|
+
process.exit(1);
|
|
53273
|
+
}
|
|
53274
|
+
const sections2 = findManagedSections(content);
|
|
53275
|
+
if (sections2.some((s) => s.name === frag.name)) {
|
|
53276
|
+
console.error(kleur_default.yellow(`! Fragment ${frag.name} already present; nothing to add.`));
|
|
53277
|
+
return;
|
|
53278
|
+
}
|
|
53279
|
+
const body = renderFragmentBody(frag, ctx);
|
|
53280
|
+
const block = `
|
|
53281
|
+
<!-- XTRM-MANAGED:${frag.name} start v=${frag.version} -->
|
|
53282
|
+
${body}
|
|
53283
|
+
<!-- XTRM-MANAGED:${frag.name} end -->
|
|
53284
|
+
`;
|
|
53285
|
+
const next = content.replace(/\n*$/, "\n") + block;
|
|
53286
|
+
import_fs_extra32.default.writeFileSync(claudeMd, next, "utf8");
|
|
53287
|
+
console.log(kleur_default.green(`\u2713 Appended ${frag.name} v${frag.version} to ${import_node_path20.default.relative(cwd, claudeMd)}`));
|
|
53288
|
+
return;
|
|
53289
|
+
}
|
|
53290
|
+
if (opts.apply) {
|
|
53291
|
+
if (!opts.acceptOverwrite) {
|
|
53292
|
+
console.error(kleur_default.red("\u2717 --apply requires --accept-overwrite"));
|
|
53293
|
+
process.exit(1);
|
|
53294
|
+
}
|
|
53295
|
+
const next = applyDrift(content, fragments, ctx);
|
|
53296
|
+
if (next === content) {
|
|
53297
|
+
console.log(kleur_default.green(`\u2713 Already canonical: ${import_node_path20.default.relative(cwd, claudeMd)}`));
|
|
53298
|
+
return;
|
|
53299
|
+
}
|
|
53300
|
+
import_fs_extra32.default.writeFileSync(claudeMd, next, "utf8");
|
|
53301
|
+
const drift2 = checkDrift2(content, fragments, ctx);
|
|
53302
|
+
console.log(kleur_default.green(`\u2713 Updated ${import_node_path20.default.relative(cwd, claudeMd)} (${drift2.length} section${drift2.length === 1 ? "" : "s"})`));
|
|
53303
|
+
for (const d of drift2) console.log(` ${describeDrift(d)}`);
|
|
53304
|
+
return;
|
|
53305
|
+
}
|
|
53306
|
+
const drift = checkDrift2(content, fragments, ctx);
|
|
53307
|
+
const sections = findManagedSections(content);
|
|
53308
|
+
if (opts.json) {
|
|
53309
|
+
const present = sections.map((s) => ({
|
|
53310
|
+
name: s.name,
|
|
53311
|
+
version: s.version,
|
|
53312
|
+
canonical_version: fragments.get(s.name)?.version ?? null
|
|
53313
|
+
}));
|
|
53314
|
+
const knownNames = [...fragments.values()].map((f) => f.name);
|
|
53315
|
+
const out = {
|
|
53316
|
+
claude_md: claudeMd,
|
|
53317
|
+
repo_context: ctx,
|
|
53318
|
+
managed_sections: present,
|
|
53319
|
+
drift: drift.map((d) => ({
|
|
53320
|
+
name: d.name,
|
|
53321
|
+
kind: d.kind,
|
|
53322
|
+
current_version: d.currentVersion ?? null,
|
|
53323
|
+
canonical_version: d.canonicalVersion ?? null
|
|
53324
|
+
})),
|
|
53325
|
+
known_fragments: knownNames
|
|
53326
|
+
};
|
|
53327
|
+
console.log(JSON.stringify(out, null, 2));
|
|
53328
|
+
if (drift.length > 0) process.exit(1);
|
|
53329
|
+
return;
|
|
53330
|
+
}
|
|
53331
|
+
if (drift.length === 0) {
|
|
53332
|
+
console.log(kleur_default.green(`\u2713 Clean: ${import_node_path20.default.relative(cwd, claudeMd)} (${sections.length} managed section${sections.length === 1 ? "" : "s"})`));
|
|
53333
|
+
return;
|
|
53334
|
+
}
|
|
53335
|
+
console.log(kleur_default.yellow(`! Drift in ${import_node_path20.default.relative(cwd, claudeMd)}:
|
|
53336
|
+
`));
|
|
53337
|
+
for (const d of drift) console.log(` ${describeDrift(d)}`);
|
|
53338
|
+
console.log(kleur_default.dim(`
|
|
53339
|
+
Run: xt claude-sync --apply --accept-overwrite`));
|
|
53340
|
+
process.exit(1);
|
|
53341
|
+
});
|
|
53342
|
+
return cmd;
|
|
53343
|
+
}
|
|
53344
|
+
|
|
53345
|
+
// src/commands/doctor.ts
|
|
53346
|
+
var import_fs_extra33 = __toESM(require_lib(), 1);
|
|
53347
|
+
var import_node_path21 = __toESM(require("path"), 1);
|
|
53348
|
+
var import_node_child_process16 = require("child_process");
|
|
53349
|
+
function ok(msg) {
|
|
53350
|
+
console.log(` ${kleur_default.green("\u2713")} ${msg}`);
|
|
53351
|
+
}
|
|
53352
|
+
function warn(msg) {
|
|
53353
|
+
console.log(` ${kleur_default.yellow("\u25CB")} ${msg}`);
|
|
53354
|
+
}
|
|
53355
|
+
function fix(msg) {
|
|
53356
|
+
console.log(` ${kleur_default.dim("\u2192 fix:")} ${kleur_default.yellow(msg)}`);
|
|
53357
|
+
}
|
|
53358
|
+
function section2(label) {
|
|
53359
|
+
const line = "\u2500".repeat(Math.max(0, 38 - label.length));
|
|
53360
|
+
console.log(`
|
|
53361
|
+
${kleur_default.bold(`\u2500\u2500 ${label} ${line}`)}`);
|
|
53362
|
+
}
|
|
53363
|
+
function runSelfCheck(cwd) {
|
|
53364
|
+
const cliEntry = process.argv[1];
|
|
53365
|
+
if (!cliEntry) return null;
|
|
53366
|
+
const result = (0, import_node_child_process16.spawnSync)(process.execPath, [cliEntry, "claude-sync", "--check", "--json", "--cwd", cwd], {
|
|
53367
|
+
encoding: "utf8",
|
|
53368
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
53369
|
+
});
|
|
53370
|
+
if (result.error || !result.stdout) return null;
|
|
53371
|
+
try {
|
|
53372
|
+
return JSON.parse(result.stdout);
|
|
53373
|
+
} catch {
|
|
53374
|
+
return null;
|
|
53375
|
+
}
|
|
53376
|
+
}
|
|
53377
|
+
function checkClaudeMdFragments(cwd) {
|
|
53378
|
+
section2("CLAUDE.md fragments");
|
|
53379
|
+
const claudeMd = import_node_path21.default.join(cwd, "CLAUDE.md");
|
|
53380
|
+
if (!import_fs_extra33.default.existsSync(claudeMd)) {
|
|
53381
|
+
warn("No CLAUDE.md in this directory \u2014 skipping fragment check");
|
|
53382
|
+
return true;
|
|
53383
|
+
}
|
|
53384
|
+
const parsed = runSelfCheck(cwd);
|
|
53385
|
+
if (!parsed) {
|
|
53386
|
+
warn("claude-sync self-invoke failed \u2014 skipping fragment drift check");
|
|
53387
|
+
return true;
|
|
53388
|
+
}
|
|
53389
|
+
const sections = parsed.managed_sections ?? [];
|
|
53390
|
+
const drift = parsed.drift ?? [];
|
|
53391
|
+
if (sections.length === 0) {
|
|
53392
|
+
warn("CLAUDE.md has no XTRM-MANAGED sentinels \u2014 fragments not initialized");
|
|
53393
|
+
fix("xt claude-sync --add bd-workflow (and other fragments)");
|
|
53394
|
+
return false;
|
|
53395
|
+
}
|
|
53396
|
+
const driftByName = new Map(drift.map((d) => [d.name, d]));
|
|
53397
|
+
let allOk = true;
|
|
53398
|
+
for (const s of sections) {
|
|
53399
|
+
const d = driftByName.get(s.name);
|
|
53400
|
+
if (!d) {
|
|
53401
|
+
ok(`${s.name.padEnd(20)} current (v${s.version})`);
|
|
53402
|
+
continue;
|
|
53403
|
+
}
|
|
53404
|
+
allOk = false;
|
|
53405
|
+
if (d.kind === "version-mismatch") {
|
|
53406
|
+
warn(`${s.name.padEnd(20)} project v${d.current_version}; canonical v${d.canonical_version}`);
|
|
53407
|
+
fix("xt claude-sync --apply --accept-overwrite");
|
|
53408
|
+
} else if (d.kind === "body-mismatch") {
|
|
53409
|
+
warn(`${s.name.padEnd(20)} body diverges from canonical v${d.canonical_version}`);
|
|
53410
|
+
fix("xt claude-sync --apply --accept-overwrite");
|
|
53411
|
+
} else if (d.kind === "unknown-fragment") {
|
|
53412
|
+
warn(`${s.name.padEnd(20)} not a known canonical fragment`);
|
|
53413
|
+
}
|
|
53414
|
+
}
|
|
53415
|
+
return allOk;
|
|
53416
|
+
}
|
|
53417
|
+
function createDoctorCommand() {
|
|
53418
|
+
return new Command("doctor").description("Health check for the xtrm-managed surfaces of the current project").option("--cwd <path>", "Operate on this directory (default: process.cwd())").action(async (opts) => {
|
|
53419
|
+
const cwd = import_node_path21.default.resolve(opts.cwd ?? process.cwd());
|
|
53420
|
+
console.log(`
|
|
53421
|
+
${kleur_default.bold("xt doctor")}
|
|
53422
|
+
`);
|
|
53423
|
+
const fragmentsOk = checkClaudeMdFragments(cwd);
|
|
53424
|
+
console.log("");
|
|
53425
|
+
if (fragmentsOk) {
|
|
53426
|
+
console.log(` ${kleur_default.green("\u2713")} ${kleur_default.bold("All checks passed")}`);
|
|
53427
|
+
} else {
|
|
53428
|
+
console.log(` ${kleur_default.yellow("\u25CB")} ${kleur_default.bold("Some checks failed")} \u2014 follow the fix hints above`);
|
|
53429
|
+
process.exitCode = 1;
|
|
53430
|
+
}
|
|
53431
|
+
console.log("");
|
|
53432
|
+
});
|
|
53433
|
+
}
|
|
53434
|
+
|
|
53027
53435
|
// src/utils/banner.ts
|
|
53028
53436
|
var ART = [
|
|
53029
53437
|
" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
|
|
@@ -53180,7 +53588,7 @@ async function printBanner(version3) {
|
|
|
53180
53588
|
// src/index.ts
|
|
53181
53589
|
var version2 = "0.0.0";
|
|
53182
53590
|
try {
|
|
53183
|
-
version2 = JSON.parse((0, import_node_fs10.readFileSync)((0,
|
|
53591
|
+
version2 = JSON.parse((0, import_node_fs10.readFileSync)((0, import_node_path22.resolve)(__dirname, "../package.json"), "utf8")).version;
|
|
53184
53592
|
} catch {
|
|
53185
53593
|
}
|
|
53186
53594
|
var program2 = new Command();
|
|
@@ -53211,6 +53619,8 @@ program2.addCommand(createMergeCommand());
|
|
|
53211
53619
|
program2.addCommand(createDebugCommand());
|
|
53212
53620
|
program2.addCommand(createReportCommand());
|
|
53213
53621
|
program2.addCommand(createSkillsCommand());
|
|
53622
|
+
program2.addCommand(createClaudeSyncCommand());
|
|
53623
|
+
program2.addCommand(createDoctorCommand());
|
|
53214
53624
|
program2.addCommand(createHelpCommand());
|
|
53215
53625
|
program2.command("update").description("Reinstall and sync all tools to latest (alias: xtrm init --prune -y)").action(async () => {
|
|
53216
53626
|
await printBanner(version2);
|