xtrm-tools 2.1.0 → 2.1.1
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/cli/dist/index.cjs +955 -557
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/package.json +1 -1
package/cli/dist/index.cjs
CHANGED
|
@@ -1202,8 +1202,8 @@ var require_command = __commonJS({
|
|
|
1202
1202
|
"use strict";
|
|
1203
1203
|
var EventEmitter2 = require("events").EventEmitter;
|
|
1204
1204
|
var childProcess = require("child_process");
|
|
1205
|
-
var
|
|
1206
|
-
var
|
|
1205
|
+
var path15 = require("path");
|
|
1206
|
+
var fs16 = require("fs");
|
|
1207
1207
|
var process19 = require("process");
|
|
1208
1208
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1209
1209
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -2197,7 +2197,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2197
2197
|
* @param {string} subcommandName
|
|
2198
2198
|
*/
|
|
2199
2199
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
2200
|
-
if (
|
|
2200
|
+
if (fs16.existsSync(executableFile)) return;
|
|
2201
2201
|
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";
|
|
2202
2202
|
const executableMissing = `'${executableFile}' does not exist
|
|
2203
2203
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -2215,11 +2215,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2215
2215
|
let launchWithNode = false;
|
|
2216
2216
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2217
2217
|
function findFile(baseDir, baseName) {
|
|
2218
|
-
const localBin =
|
|
2219
|
-
if (
|
|
2220
|
-
if (sourceExt.includes(
|
|
2218
|
+
const localBin = path15.resolve(baseDir, baseName);
|
|
2219
|
+
if (fs16.existsSync(localBin)) return localBin;
|
|
2220
|
+
if (sourceExt.includes(path15.extname(baseName))) return void 0;
|
|
2221
2221
|
const foundExt = sourceExt.find(
|
|
2222
|
-
(ext) =>
|
|
2222
|
+
(ext) => fs16.existsSync(`${localBin}${ext}`)
|
|
2223
2223
|
);
|
|
2224
2224
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2225
2225
|
return void 0;
|
|
@@ -2231,21 +2231,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2231
2231
|
if (this._scriptPath) {
|
|
2232
2232
|
let resolvedScriptPath;
|
|
2233
2233
|
try {
|
|
2234
|
-
resolvedScriptPath =
|
|
2234
|
+
resolvedScriptPath = fs16.realpathSync(this._scriptPath);
|
|
2235
2235
|
} catch {
|
|
2236
2236
|
resolvedScriptPath = this._scriptPath;
|
|
2237
2237
|
}
|
|
2238
|
-
executableDir =
|
|
2239
|
-
|
|
2238
|
+
executableDir = path15.resolve(
|
|
2239
|
+
path15.dirname(resolvedScriptPath),
|
|
2240
2240
|
executableDir
|
|
2241
2241
|
);
|
|
2242
2242
|
}
|
|
2243
2243
|
if (executableDir) {
|
|
2244
2244
|
let localFile = findFile(executableDir, executableFile);
|
|
2245
2245
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2246
|
-
const legacyName =
|
|
2246
|
+
const legacyName = path15.basename(
|
|
2247
2247
|
this._scriptPath,
|
|
2248
|
-
|
|
2248
|
+
path15.extname(this._scriptPath)
|
|
2249
2249
|
);
|
|
2250
2250
|
if (legacyName !== this._name) {
|
|
2251
2251
|
localFile = findFile(
|
|
@@ -2256,7 +2256,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2256
2256
|
}
|
|
2257
2257
|
executableFile = localFile || executableFile;
|
|
2258
2258
|
}
|
|
2259
|
-
launchWithNode = sourceExt.includes(
|
|
2259
|
+
launchWithNode = sourceExt.includes(path15.extname(executableFile));
|
|
2260
2260
|
let proc;
|
|
2261
2261
|
if (process19.platform !== "win32") {
|
|
2262
2262
|
if (launchWithNode) {
|
|
@@ -3171,7 +3171,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3171
3171
|
* @return {Command}
|
|
3172
3172
|
*/
|
|
3173
3173
|
nameFromFilename(filename) {
|
|
3174
|
-
this._name =
|
|
3174
|
+
this._name = path15.basename(filename, path15.extname(filename));
|
|
3175
3175
|
return this;
|
|
3176
3176
|
}
|
|
3177
3177
|
/**
|
|
@@ -3185,9 +3185,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3185
3185
|
* @param {string} [path]
|
|
3186
3186
|
* @return {(string|null|Command)}
|
|
3187
3187
|
*/
|
|
3188
|
-
executableDir(
|
|
3189
|
-
if (
|
|
3190
|
-
this._executableDir =
|
|
3188
|
+
executableDir(path16) {
|
|
3189
|
+
if (path16 === void 0) return this._executableDir;
|
|
3190
|
+
this._executableDir = path16;
|
|
3191
3191
|
return this;
|
|
3192
3192
|
}
|
|
3193
3193
|
/**
|
|
@@ -11556,54 +11556,54 @@ var require_polyfills = __commonJS({
|
|
|
11556
11556
|
}
|
|
11557
11557
|
var chdir;
|
|
11558
11558
|
module2.exports = patch;
|
|
11559
|
-
function patch(
|
|
11559
|
+
function patch(fs16) {
|
|
11560
11560
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
11561
|
-
patchLchmod(
|
|
11562
|
-
}
|
|
11563
|
-
if (!
|
|
11564
|
-
patchLutimes(
|
|
11565
|
-
}
|
|
11566
|
-
|
|
11567
|
-
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
|
|
11572
|
-
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
|
|
11583
|
-
|
|
11584
|
-
if (
|
|
11585
|
-
|
|
11561
|
+
patchLchmod(fs16);
|
|
11562
|
+
}
|
|
11563
|
+
if (!fs16.lutimes) {
|
|
11564
|
+
patchLutimes(fs16);
|
|
11565
|
+
}
|
|
11566
|
+
fs16.chown = chownFix(fs16.chown);
|
|
11567
|
+
fs16.fchown = chownFix(fs16.fchown);
|
|
11568
|
+
fs16.lchown = chownFix(fs16.lchown);
|
|
11569
|
+
fs16.chmod = chmodFix(fs16.chmod);
|
|
11570
|
+
fs16.fchmod = chmodFix(fs16.fchmod);
|
|
11571
|
+
fs16.lchmod = chmodFix(fs16.lchmod);
|
|
11572
|
+
fs16.chownSync = chownFixSync(fs16.chownSync);
|
|
11573
|
+
fs16.fchownSync = chownFixSync(fs16.fchownSync);
|
|
11574
|
+
fs16.lchownSync = chownFixSync(fs16.lchownSync);
|
|
11575
|
+
fs16.chmodSync = chmodFixSync(fs16.chmodSync);
|
|
11576
|
+
fs16.fchmodSync = chmodFixSync(fs16.fchmodSync);
|
|
11577
|
+
fs16.lchmodSync = chmodFixSync(fs16.lchmodSync);
|
|
11578
|
+
fs16.stat = statFix(fs16.stat);
|
|
11579
|
+
fs16.fstat = statFix(fs16.fstat);
|
|
11580
|
+
fs16.lstat = statFix(fs16.lstat);
|
|
11581
|
+
fs16.statSync = statFixSync(fs16.statSync);
|
|
11582
|
+
fs16.fstatSync = statFixSync(fs16.fstatSync);
|
|
11583
|
+
fs16.lstatSync = statFixSync(fs16.lstatSync);
|
|
11584
|
+
if (fs16.chmod && !fs16.lchmod) {
|
|
11585
|
+
fs16.lchmod = function(path15, mode, cb) {
|
|
11586
11586
|
if (cb) process.nextTick(cb);
|
|
11587
11587
|
};
|
|
11588
|
-
|
|
11588
|
+
fs16.lchmodSync = function() {
|
|
11589
11589
|
};
|
|
11590
11590
|
}
|
|
11591
|
-
if (
|
|
11592
|
-
|
|
11591
|
+
if (fs16.chown && !fs16.lchown) {
|
|
11592
|
+
fs16.lchown = function(path15, uid, gid, cb) {
|
|
11593
11593
|
if (cb) process.nextTick(cb);
|
|
11594
11594
|
};
|
|
11595
|
-
|
|
11595
|
+
fs16.lchownSync = function() {
|
|
11596
11596
|
};
|
|
11597
11597
|
}
|
|
11598
11598
|
if (platform2 === "win32") {
|
|
11599
|
-
|
|
11599
|
+
fs16.rename = typeof fs16.rename !== "function" ? fs16.rename : (function(fs$rename) {
|
|
11600
11600
|
function rename(from, to, cb) {
|
|
11601
11601
|
var start = Date.now();
|
|
11602
11602
|
var backoff = 0;
|
|
11603
11603
|
fs$rename(from, to, function CB(er) {
|
|
11604
11604
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
11605
11605
|
setTimeout(function() {
|
|
11606
|
-
|
|
11606
|
+
fs16.stat(to, function(stater, st) {
|
|
11607
11607
|
if (stater && stater.code === "ENOENT")
|
|
11608
11608
|
fs$rename(from, to, CB);
|
|
11609
11609
|
else
|
|
@@ -11619,9 +11619,9 @@ var require_polyfills = __commonJS({
|
|
|
11619
11619
|
}
|
|
11620
11620
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
11621
11621
|
return rename;
|
|
11622
|
-
})(
|
|
11622
|
+
})(fs16.rename);
|
|
11623
11623
|
}
|
|
11624
|
-
|
|
11624
|
+
fs16.read = typeof fs16.read !== "function" ? fs16.read : (function(fs$read) {
|
|
11625
11625
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
11626
11626
|
var callback;
|
|
11627
11627
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -11629,22 +11629,22 @@ var require_polyfills = __commonJS({
|
|
|
11629
11629
|
callback = function(er, _, __) {
|
|
11630
11630
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
11631
11631
|
eagCounter++;
|
|
11632
|
-
return fs$read.call(
|
|
11632
|
+
return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
|
|
11633
11633
|
}
|
|
11634
11634
|
callback_.apply(this, arguments);
|
|
11635
11635
|
};
|
|
11636
11636
|
}
|
|
11637
|
-
return fs$read.call(
|
|
11637
|
+
return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
|
|
11638
11638
|
}
|
|
11639
11639
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
11640
11640
|
return read;
|
|
11641
|
-
})(
|
|
11642
|
-
|
|
11641
|
+
})(fs16.read);
|
|
11642
|
+
fs16.readSync = typeof fs16.readSync !== "function" ? fs16.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
11643
11643
|
return function(fd, buffer, offset, length, position) {
|
|
11644
11644
|
var eagCounter = 0;
|
|
11645
11645
|
while (true) {
|
|
11646
11646
|
try {
|
|
11647
|
-
return fs$readSync.call(
|
|
11647
|
+
return fs$readSync.call(fs16, fd, buffer, offset, length, position);
|
|
11648
11648
|
} catch (er) {
|
|
11649
11649
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
11650
11650
|
eagCounter++;
|
|
@@ -11654,11 +11654,11 @@ var require_polyfills = __commonJS({
|
|
|
11654
11654
|
}
|
|
11655
11655
|
}
|
|
11656
11656
|
};
|
|
11657
|
-
})(
|
|
11658
|
-
function patchLchmod(
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11657
|
+
})(fs16.readSync);
|
|
11658
|
+
function patchLchmod(fs17) {
|
|
11659
|
+
fs17.lchmod = function(path15, mode, callback) {
|
|
11660
|
+
fs17.open(
|
|
11661
|
+
path15,
|
|
11662
11662
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
11663
11663
|
mode,
|
|
11664
11664
|
function(err, fd) {
|
|
@@ -11666,80 +11666,80 @@ var require_polyfills = __commonJS({
|
|
|
11666
11666
|
if (callback) callback(err);
|
|
11667
11667
|
return;
|
|
11668
11668
|
}
|
|
11669
|
-
|
|
11670
|
-
|
|
11669
|
+
fs17.fchmod(fd, mode, function(err2) {
|
|
11670
|
+
fs17.close(fd, function(err22) {
|
|
11671
11671
|
if (callback) callback(err2 || err22);
|
|
11672
11672
|
});
|
|
11673
11673
|
});
|
|
11674
11674
|
}
|
|
11675
11675
|
);
|
|
11676
11676
|
};
|
|
11677
|
-
|
|
11678
|
-
var fd =
|
|
11677
|
+
fs17.lchmodSync = function(path15, mode) {
|
|
11678
|
+
var fd = fs17.openSync(path15, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
11679
11679
|
var threw = true;
|
|
11680
11680
|
var ret;
|
|
11681
11681
|
try {
|
|
11682
|
-
ret =
|
|
11682
|
+
ret = fs17.fchmodSync(fd, mode);
|
|
11683
11683
|
threw = false;
|
|
11684
11684
|
} finally {
|
|
11685
11685
|
if (threw) {
|
|
11686
11686
|
try {
|
|
11687
|
-
|
|
11687
|
+
fs17.closeSync(fd);
|
|
11688
11688
|
} catch (er) {
|
|
11689
11689
|
}
|
|
11690
11690
|
} else {
|
|
11691
|
-
|
|
11691
|
+
fs17.closeSync(fd);
|
|
11692
11692
|
}
|
|
11693
11693
|
}
|
|
11694
11694
|
return ret;
|
|
11695
11695
|
};
|
|
11696
11696
|
}
|
|
11697
|
-
function patchLutimes(
|
|
11698
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
11699
|
-
|
|
11700
|
-
|
|
11697
|
+
function patchLutimes(fs17) {
|
|
11698
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs17.futimes) {
|
|
11699
|
+
fs17.lutimes = function(path15, at, mt, cb) {
|
|
11700
|
+
fs17.open(path15, constants.O_SYMLINK, function(er, fd) {
|
|
11701
11701
|
if (er) {
|
|
11702
11702
|
if (cb) cb(er);
|
|
11703
11703
|
return;
|
|
11704
11704
|
}
|
|
11705
|
-
|
|
11706
|
-
|
|
11705
|
+
fs17.futimes(fd, at, mt, function(er2) {
|
|
11706
|
+
fs17.close(fd, function(er22) {
|
|
11707
11707
|
if (cb) cb(er2 || er22);
|
|
11708
11708
|
});
|
|
11709
11709
|
});
|
|
11710
11710
|
});
|
|
11711
11711
|
};
|
|
11712
|
-
|
|
11713
|
-
var fd =
|
|
11712
|
+
fs17.lutimesSync = function(path15, at, mt) {
|
|
11713
|
+
var fd = fs17.openSync(path15, constants.O_SYMLINK);
|
|
11714
11714
|
var ret;
|
|
11715
11715
|
var threw = true;
|
|
11716
11716
|
try {
|
|
11717
|
-
ret =
|
|
11717
|
+
ret = fs17.futimesSync(fd, at, mt);
|
|
11718
11718
|
threw = false;
|
|
11719
11719
|
} finally {
|
|
11720
11720
|
if (threw) {
|
|
11721
11721
|
try {
|
|
11722
|
-
|
|
11722
|
+
fs17.closeSync(fd);
|
|
11723
11723
|
} catch (er) {
|
|
11724
11724
|
}
|
|
11725
11725
|
} else {
|
|
11726
|
-
|
|
11726
|
+
fs17.closeSync(fd);
|
|
11727
11727
|
}
|
|
11728
11728
|
}
|
|
11729
11729
|
return ret;
|
|
11730
11730
|
};
|
|
11731
|
-
} else if (
|
|
11732
|
-
|
|
11731
|
+
} else if (fs17.futimes) {
|
|
11732
|
+
fs17.lutimes = function(_a2, _b, _c, cb) {
|
|
11733
11733
|
if (cb) process.nextTick(cb);
|
|
11734
11734
|
};
|
|
11735
|
-
|
|
11735
|
+
fs17.lutimesSync = function() {
|
|
11736
11736
|
};
|
|
11737
11737
|
}
|
|
11738
11738
|
}
|
|
11739
11739
|
function chmodFix(orig) {
|
|
11740
11740
|
if (!orig) return orig;
|
|
11741
11741
|
return function(target, mode, cb) {
|
|
11742
|
-
return orig.call(
|
|
11742
|
+
return orig.call(fs16, target, mode, function(er) {
|
|
11743
11743
|
if (chownErOk(er)) er = null;
|
|
11744
11744
|
if (cb) cb.apply(this, arguments);
|
|
11745
11745
|
});
|
|
@@ -11749,7 +11749,7 @@ var require_polyfills = __commonJS({
|
|
|
11749
11749
|
if (!orig) return orig;
|
|
11750
11750
|
return function(target, mode) {
|
|
11751
11751
|
try {
|
|
11752
|
-
return orig.call(
|
|
11752
|
+
return orig.call(fs16, target, mode);
|
|
11753
11753
|
} catch (er) {
|
|
11754
11754
|
if (!chownErOk(er)) throw er;
|
|
11755
11755
|
}
|
|
@@ -11758,7 +11758,7 @@ var require_polyfills = __commonJS({
|
|
|
11758
11758
|
function chownFix(orig) {
|
|
11759
11759
|
if (!orig) return orig;
|
|
11760
11760
|
return function(target, uid, gid, cb) {
|
|
11761
|
-
return orig.call(
|
|
11761
|
+
return orig.call(fs16, target, uid, gid, function(er) {
|
|
11762
11762
|
if (chownErOk(er)) er = null;
|
|
11763
11763
|
if (cb) cb.apply(this, arguments);
|
|
11764
11764
|
});
|
|
@@ -11768,7 +11768,7 @@ var require_polyfills = __commonJS({
|
|
|
11768
11768
|
if (!orig) return orig;
|
|
11769
11769
|
return function(target, uid, gid) {
|
|
11770
11770
|
try {
|
|
11771
|
-
return orig.call(
|
|
11771
|
+
return orig.call(fs16, target, uid, gid);
|
|
11772
11772
|
} catch (er) {
|
|
11773
11773
|
if (!chownErOk(er)) throw er;
|
|
11774
11774
|
}
|
|
@@ -11788,13 +11788,13 @@ var require_polyfills = __commonJS({
|
|
|
11788
11788
|
}
|
|
11789
11789
|
if (cb) cb.apply(this, arguments);
|
|
11790
11790
|
}
|
|
11791
|
-
return options ? orig.call(
|
|
11791
|
+
return options ? orig.call(fs16, target, options, callback) : orig.call(fs16, target, callback);
|
|
11792
11792
|
};
|
|
11793
11793
|
}
|
|
11794
11794
|
function statFixSync(orig) {
|
|
11795
11795
|
if (!orig) return orig;
|
|
11796
11796
|
return function(target, options) {
|
|
11797
|
-
var stats = options ? orig.call(
|
|
11797
|
+
var stats = options ? orig.call(fs16, target, options) : orig.call(fs16, target);
|
|
11798
11798
|
if (stats) {
|
|
11799
11799
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
11800
11800
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -11824,16 +11824,16 @@ var require_legacy_streams = __commonJS({
|
|
|
11824
11824
|
"use strict";
|
|
11825
11825
|
var Stream = require("stream").Stream;
|
|
11826
11826
|
module2.exports = legacy;
|
|
11827
|
-
function legacy(
|
|
11827
|
+
function legacy(fs16) {
|
|
11828
11828
|
return {
|
|
11829
11829
|
ReadStream,
|
|
11830
11830
|
WriteStream
|
|
11831
11831
|
};
|
|
11832
|
-
function ReadStream(
|
|
11833
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
11832
|
+
function ReadStream(path15, options) {
|
|
11833
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path15, options);
|
|
11834
11834
|
Stream.call(this);
|
|
11835
11835
|
var self = this;
|
|
11836
|
-
this.path =
|
|
11836
|
+
this.path = path15;
|
|
11837
11837
|
this.fd = null;
|
|
11838
11838
|
this.readable = true;
|
|
11839
11839
|
this.paused = false;
|
|
@@ -11867,7 +11867,7 @@ var require_legacy_streams = __commonJS({
|
|
|
11867
11867
|
});
|
|
11868
11868
|
return;
|
|
11869
11869
|
}
|
|
11870
|
-
|
|
11870
|
+
fs16.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
11871
11871
|
if (err) {
|
|
11872
11872
|
self.emit("error", err);
|
|
11873
11873
|
self.readable = false;
|
|
@@ -11878,10 +11878,10 @@ var require_legacy_streams = __commonJS({
|
|
|
11878
11878
|
self._read();
|
|
11879
11879
|
});
|
|
11880
11880
|
}
|
|
11881
|
-
function WriteStream(
|
|
11882
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
11881
|
+
function WriteStream(path15, options) {
|
|
11882
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path15, options);
|
|
11883
11883
|
Stream.call(this);
|
|
11884
|
-
this.path =
|
|
11884
|
+
this.path = path15;
|
|
11885
11885
|
this.fd = null;
|
|
11886
11886
|
this.writable = true;
|
|
11887
11887
|
this.flags = "w";
|
|
@@ -11906,7 +11906,7 @@ var require_legacy_streams = __commonJS({
|
|
|
11906
11906
|
this.busy = false;
|
|
11907
11907
|
this._queue = [];
|
|
11908
11908
|
if (this.fd === null) {
|
|
11909
|
-
this._open =
|
|
11909
|
+
this._open = fs16.open;
|
|
11910
11910
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
11911
11911
|
this.flush();
|
|
11912
11912
|
}
|
|
@@ -11942,7 +11942,7 @@ var require_clone = __commonJS({
|
|
|
11942
11942
|
var require_graceful_fs = __commonJS({
|
|
11943
11943
|
"node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
11944
11944
|
"use strict";
|
|
11945
|
-
var
|
|
11945
|
+
var fs16 = require("fs");
|
|
11946
11946
|
var polyfills = require_polyfills();
|
|
11947
11947
|
var legacy = require_legacy_streams();
|
|
11948
11948
|
var clone3 = require_clone();
|
|
@@ -11974,12 +11974,12 @@ var require_graceful_fs = __commonJS({
|
|
|
11974
11974
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
11975
11975
|
console.error(m);
|
|
11976
11976
|
};
|
|
11977
|
-
if (!
|
|
11977
|
+
if (!fs16[gracefulQueue]) {
|
|
11978
11978
|
queue = global[gracefulQueue] || [];
|
|
11979
|
-
publishQueue(
|
|
11980
|
-
|
|
11979
|
+
publishQueue(fs16, queue);
|
|
11980
|
+
fs16.close = (function(fs$close) {
|
|
11981
11981
|
function close(fd, cb) {
|
|
11982
|
-
return fs$close.call(
|
|
11982
|
+
return fs$close.call(fs16, fd, function(err) {
|
|
11983
11983
|
if (!err) {
|
|
11984
11984
|
resetQueue();
|
|
11985
11985
|
}
|
|
@@ -11991,48 +11991,48 @@ var require_graceful_fs = __commonJS({
|
|
|
11991
11991
|
value: fs$close
|
|
11992
11992
|
});
|
|
11993
11993
|
return close;
|
|
11994
|
-
})(
|
|
11995
|
-
|
|
11994
|
+
})(fs16.close);
|
|
11995
|
+
fs16.closeSync = (function(fs$closeSync) {
|
|
11996
11996
|
function closeSync(fd) {
|
|
11997
|
-
fs$closeSync.apply(
|
|
11997
|
+
fs$closeSync.apply(fs16, arguments);
|
|
11998
11998
|
resetQueue();
|
|
11999
11999
|
}
|
|
12000
12000
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
12001
12001
|
value: fs$closeSync
|
|
12002
12002
|
});
|
|
12003
12003
|
return closeSync;
|
|
12004
|
-
})(
|
|
12004
|
+
})(fs16.closeSync);
|
|
12005
12005
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
12006
12006
|
process.on("exit", function() {
|
|
12007
|
-
debug(
|
|
12008
|
-
require("assert").equal(
|
|
12007
|
+
debug(fs16[gracefulQueue]);
|
|
12008
|
+
require("assert").equal(fs16[gracefulQueue].length, 0);
|
|
12009
12009
|
});
|
|
12010
12010
|
}
|
|
12011
12011
|
}
|
|
12012
12012
|
var queue;
|
|
12013
12013
|
if (!global[gracefulQueue]) {
|
|
12014
|
-
publishQueue(global,
|
|
12015
|
-
}
|
|
12016
|
-
module2.exports = patch(clone3(
|
|
12017
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
12018
|
-
module2.exports = patch(
|
|
12019
|
-
|
|
12020
|
-
}
|
|
12021
|
-
function patch(
|
|
12022
|
-
polyfills(
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
var fs$readFile =
|
|
12027
|
-
|
|
12028
|
-
function readFile(
|
|
12014
|
+
publishQueue(global, fs16[gracefulQueue]);
|
|
12015
|
+
}
|
|
12016
|
+
module2.exports = patch(clone3(fs16));
|
|
12017
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs16.__patched) {
|
|
12018
|
+
module2.exports = patch(fs16);
|
|
12019
|
+
fs16.__patched = true;
|
|
12020
|
+
}
|
|
12021
|
+
function patch(fs17) {
|
|
12022
|
+
polyfills(fs17);
|
|
12023
|
+
fs17.gracefulify = patch;
|
|
12024
|
+
fs17.createReadStream = createReadStream;
|
|
12025
|
+
fs17.createWriteStream = createWriteStream2;
|
|
12026
|
+
var fs$readFile = fs17.readFile;
|
|
12027
|
+
fs17.readFile = readFile;
|
|
12028
|
+
function readFile(path15, options, cb) {
|
|
12029
12029
|
if (typeof options === "function")
|
|
12030
12030
|
cb = options, options = null;
|
|
12031
|
-
return go$readFile(
|
|
12032
|
-
function go$readFile(
|
|
12033
|
-
return fs$readFile(
|
|
12031
|
+
return go$readFile(path15, options, cb);
|
|
12032
|
+
function go$readFile(path16, options2, cb2, startTime) {
|
|
12033
|
+
return fs$readFile(path16, options2, function(err) {
|
|
12034
12034
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12035
|
-
enqueue([go$readFile, [
|
|
12035
|
+
enqueue([go$readFile, [path16, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
12036
12036
|
else {
|
|
12037
12037
|
if (typeof cb2 === "function")
|
|
12038
12038
|
cb2.apply(this, arguments);
|
|
@@ -12040,16 +12040,16 @@ var require_graceful_fs = __commonJS({
|
|
|
12040
12040
|
});
|
|
12041
12041
|
}
|
|
12042
12042
|
}
|
|
12043
|
-
var fs$writeFile =
|
|
12044
|
-
|
|
12045
|
-
function writeFile(
|
|
12043
|
+
var fs$writeFile = fs17.writeFile;
|
|
12044
|
+
fs17.writeFile = writeFile;
|
|
12045
|
+
function writeFile(path15, data, options, cb) {
|
|
12046
12046
|
if (typeof options === "function")
|
|
12047
12047
|
cb = options, options = null;
|
|
12048
|
-
return go$writeFile(
|
|
12049
|
-
function go$writeFile(
|
|
12050
|
-
return fs$writeFile(
|
|
12048
|
+
return go$writeFile(path15, data, options, cb);
|
|
12049
|
+
function go$writeFile(path16, data2, options2, cb2, startTime) {
|
|
12050
|
+
return fs$writeFile(path16, data2, options2, function(err) {
|
|
12051
12051
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12052
|
-
enqueue([go$writeFile, [
|
|
12052
|
+
enqueue([go$writeFile, [path16, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
12053
12053
|
else {
|
|
12054
12054
|
if (typeof cb2 === "function")
|
|
12055
12055
|
cb2.apply(this, arguments);
|
|
@@ -12057,17 +12057,17 @@ var require_graceful_fs = __commonJS({
|
|
|
12057
12057
|
});
|
|
12058
12058
|
}
|
|
12059
12059
|
}
|
|
12060
|
-
var fs$appendFile =
|
|
12060
|
+
var fs$appendFile = fs17.appendFile;
|
|
12061
12061
|
if (fs$appendFile)
|
|
12062
|
-
|
|
12063
|
-
function appendFile(
|
|
12062
|
+
fs17.appendFile = appendFile;
|
|
12063
|
+
function appendFile(path15, data, options, cb) {
|
|
12064
12064
|
if (typeof options === "function")
|
|
12065
12065
|
cb = options, options = null;
|
|
12066
|
-
return go$appendFile(
|
|
12067
|
-
function go$appendFile(
|
|
12068
|
-
return fs$appendFile(
|
|
12066
|
+
return go$appendFile(path15, data, options, cb);
|
|
12067
|
+
function go$appendFile(path16, data2, options2, cb2, startTime) {
|
|
12068
|
+
return fs$appendFile(path16, data2, options2, function(err) {
|
|
12069
12069
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12070
|
-
enqueue([go$appendFile, [
|
|
12070
|
+
enqueue([go$appendFile, [path16, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
12071
12071
|
else {
|
|
12072
12072
|
if (typeof cb2 === "function")
|
|
12073
12073
|
cb2.apply(this, arguments);
|
|
@@ -12075,9 +12075,9 @@ var require_graceful_fs = __commonJS({
|
|
|
12075
12075
|
});
|
|
12076
12076
|
}
|
|
12077
12077
|
}
|
|
12078
|
-
var fs$copyFile =
|
|
12078
|
+
var fs$copyFile = fs17.copyFile;
|
|
12079
12079
|
if (fs$copyFile)
|
|
12080
|
-
|
|
12080
|
+
fs17.copyFile = copyFile;
|
|
12081
12081
|
function copyFile(src, dest, flags, cb) {
|
|
12082
12082
|
if (typeof flags === "function") {
|
|
12083
12083
|
cb = flags;
|
|
@@ -12095,34 +12095,34 @@ var require_graceful_fs = __commonJS({
|
|
|
12095
12095
|
});
|
|
12096
12096
|
}
|
|
12097
12097
|
}
|
|
12098
|
-
var fs$readdir =
|
|
12099
|
-
|
|
12098
|
+
var fs$readdir = fs17.readdir;
|
|
12099
|
+
fs17.readdir = readdir;
|
|
12100
12100
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
12101
|
-
function readdir(
|
|
12101
|
+
function readdir(path15, options, cb) {
|
|
12102
12102
|
if (typeof options === "function")
|
|
12103
12103
|
cb = options, options = null;
|
|
12104
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
12105
|
-
return fs$readdir(
|
|
12106
|
-
|
|
12104
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path16, options2, cb2, startTime) {
|
|
12105
|
+
return fs$readdir(path16, fs$readdirCallback(
|
|
12106
|
+
path16,
|
|
12107
12107
|
options2,
|
|
12108
12108
|
cb2,
|
|
12109
12109
|
startTime
|
|
12110
12110
|
));
|
|
12111
|
-
} : function go$readdir2(
|
|
12112
|
-
return fs$readdir(
|
|
12113
|
-
|
|
12111
|
+
} : function go$readdir2(path16, options2, cb2, startTime) {
|
|
12112
|
+
return fs$readdir(path16, options2, fs$readdirCallback(
|
|
12113
|
+
path16,
|
|
12114
12114
|
options2,
|
|
12115
12115
|
cb2,
|
|
12116
12116
|
startTime
|
|
12117
12117
|
));
|
|
12118
12118
|
};
|
|
12119
|
-
return go$readdir(
|
|
12120
|
-
function fs$readdirCallback(
|
|
12119
|
+
return go$readdir(path15, options, cb);
|
|
12120
|
+
function fs$readdirCallback(path16, options2, cb2, startTime) {
|
|
12121
12121
|
return function(err, files) {
|
|
12122
12122
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12123
12123
|
enqueue([
|
|
12124
12124
|
go$readdir,
|
|
12125
|
-
[
|
|
12125
|
+
[path16, options2, cb2],
|
|
12126
12126
|
err,
|
|
12127
12127
|
startTime || Date.now(),
|
|
12128
12128
|
Date.now()
|
|
@@ -12137,21 +12137,21 @@ var require_graceful_fs = __commonJS({
|
|
|
12137
12137
|
}
|
|
12138
12138
|
}
|
|
12139
12139
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
12140
|
-
var legStreams = legacy(
|
|
12140
|
+
var legStreams = legacy(fs17);
|
|
12141
12141
|
ReadStream = legStreams.ReadStream;
|
|
12142
12142
|
WriteStream = legStreams.WriteStream;
|
|
12143
12143
|
}
|
|
12144
|
-
var fs$ReadStream =
|
|
12144
|
+
var fs$ReadStream = fs17.ReadStream;
|
|
12145
12145
|
if (fs$ReadStream) {
|
|
12146
12146
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
12147
12147
|
ReadStream.prototype.open = ReadStream$open;
|
|
12148
12148
|
}
|
|
12149
|
-
var fs$WriteStream =
|
|
12149
|
+
var fs$WriteStream = fs17.WriteStream;
|
|
12150
12150
|
if (fs$WriteStream) {
|
|
12151
12151
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
12152
12152
|
WriteStream.prototype.open = WriteStream$open;
|
|
12153
12153
|
}
|
|
12154
|
-
Object.defineProperty(
|
|
12154
|
+
Object.defineProperty(fs17, "ReadStream", {
|
|
12155
12155
|
get: function() {
|
|
12156
12156
|
return ReadStream;
|
|
12157
12157
|
},
|
|
@@ -12161,7 +12161,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12161
12161
|
enumerable: true,
|
|
12162
12162
|
configurable: true
|
|
12163
12163
|
});
|
|
12164
|
-
Object.defineProperty(
|
|
12164
|
+
Object.defineProperty(fs17, "WriteStream", {
|
|
12165
12165
|
get: function() {
|
|
12166
12166
|
return WriteStream;
|
|
12167
12167
|
},
|
|
@@ -12172,7 +12172,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12172
12172
|
configurable: true
|
|
12173
12173
|
});
|
|
12174
12174
|
var FileReadStream = ReadStream;
|
|
12175
|
-
Object.defineProperty(
|
|
12175
|
+
Object.defineProperty(fs17, "FileReadStream", {
|
|
12176
12176
|
get: function() {
|
|
12177
12177
|
return FileReadStream;
|
|
12178
12178
|
},
|
|
@@ -12183,7 +12183,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12183
12183
|
configurable: true
|
|
12184
12184
|
});
|
|
12185
12185
|
var FileWriteStream = WriteStream;
|
|
12186
|
-
Object.defineProperty(
|
|
12186
|
+
Object.defineProperty(fs17, "FileWriteStream", {
|
|
12187
12187
|
get: function() {
|
|
12188
12188
|
return FileWriteStream;
|
|
12189
12189
|
},
|
|
@@ -12193,7 +12193,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12193
12193
|
enumerable: true,
|
|
12194
12194
|
configurable: true
|
|
12195
12195
|
});
|
|
12196
|
-
function ReadStream(
|
|
12196
|
+
function ReadStream(path15, options) {
|
|
12197
12197
|
if (this instanceof ReadStream)
|
|
12198
12198
|
return fs$ReadStream.apply(this, arguments), this;
|
|
12199
12199
|
else
|
|
@@ -12213,7 +12213,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12213
12213
|
}
|
|
12214
12214
|
});
|
|
12215
12215
|
}
|
|
12216
|
-
function WriteStream(
|
|
12216
|
+
function WriteStream(path15, options) {
|
|
12217
12217
|
if (this instanceof WriteStream)
|
|
12218
12218
|
return fs$WriteStream.apply(this, arguments), this;
|
|
12219
12219
|
else
|
|
@@ -12231,22 +12231,22 @@ var require_graceful_fs = __commonJS({
|
|
|
12231
12231
|
}
|
|
12232
12232
|
});
|
|
12233
12233
|
}
|
|
12234
|
-
function createReadStream(
|
|
12235
|
-
return new
|
|
12234
|
+
function createReadStream(path15, options) {
|
|
12235
|
+
return new fs17.ReadStream(path15, options);
|
|
12236
12236
|
}
|
|
12237
|
-
function createWriteStream2(
|
|
12238
|
-
return new
|
|
12237
|
+
function createWriteStream2(path15, options) {
|
|
12238
|
+
return new fs17.WriteStream(path15, options);
|
|
12239
12239
|
}
|
|
12240
|
-
var fs$open =
|
|
12241
|
-
|
|
12242
|
-
function open(
|
|
12240
|
+
var fs$open = fs17.open;
|
|
12241
|
+
fs17.open = open;
|
|
12242
|
+
function open(path15, flags, mode, cb) {
|
|
12243
12243
|
if (typeof mode === "function")
|
|
12244
12244
|
cb = mode, mode = null;
|
|
12245
|
-
return go$open(
|
|
12246
|
-
function go$open(
|
|
12247
|
-
return fs$open(
|
|
12245
|
+
return go$open(path15, flags, mode, cb);
|
|
12246
|
+
function go$open(path16, flags2, mode2, cb2, startTime) {
|
|
12247
|
+
return fs$open(path16, flags2, mode2, function(err, fd) {
|
|
12248
12248
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12249
|
-
enqueue([go$open, [
|
|
12249
|
+
enqueue([go$open, [path16, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
12250
12250
|
else {
|
|
12251
12251
|
if (typeof cb2 === "function")
|
|
12252
12252
|
cb2.apply(this, arguments);
|
|
@@ -12254,20 +12254,20 @@ var require_graceful_fs = __commonJS({
|
|
|
12254
12254
|
});
|
|
12255
12255
|
}
|
|
12256
12256
|
}
|
|
12257
|
-
return
|
|
12257
|
+
return fs17;
|
|
12258
12258
|
}
|
|
12259
12259
|
function enqueue(elem) {
|
|
12260
12260
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
12261
|
-
|
|
12261
|
+
fs16[gracefulQueue].push(elem);
|
|
12262
12262
|
retry();
|
|
12263
12263
|
}
|
|
12264
12264
|
var retryTimer;
|
|
12265
12265
|
function resetQueue() {
|
|
12266
12266
|
var now = Date.now();
|
|
12267
|
-
for (var i = 0; i <
|
|
12268
|
-
if (
|
|
12269
|
-
|
|
12270
|
-
|
|
12267
|
+
for (var i = 0; i < fs16[gracefulQueue].length; ++i) {
|
|
12268
|
+
if (fs16[gracefulQueue][i].length > 2) {
|
|
12269
|
+
fs16[gracefulQueue][i][3] = now;
|
|
12270
|
+
fs16[gracefulQueue][i][4] = now;
|
|
12271
12271
|
}
|
|
12272
12272
|
}
|
|
12273
12273
|
retry();
|
|
@@ -12275,9 +12275,9 @@ var require_graceful_fs = __commonJS({
|
|
|
12275
12275
|
function retry() {
|
|
12276
12276
|
clearTimeout(retryTimer);
|
|
12277
12277
|
retryTimer = void 0;
|
|
12278
|
-
if (
|
|
12278
|
+
if (fs16[gracefulQueue].length === 0)
|
|
12279
12279
|
return;
|
|
12280
|
-
var elem =
|
|
12280
|
+
var elem = fs16[gracefulQueue].shift();
|
|
12281
12281
|
var fn = elem[0];
|
|
12282
12282
|
var args = elem[1];
|
|
12283
12283
|
var err = elem[2];
|
|
@@ -12299,7 +12299,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12299
12299
|
debug("RETRY", fn.name, args);
|
|
12300
12300
|
fn.apply(null, args.concat([startTime]));
|
|
12301
12301
|
} else {
|
|
12302
|
-
|
|
12302
|
+
fs16[gracefulQueue].push(elem);
|
|
12303
12303
|
}
|
|
12304
12304
|
}
|
|
12305
12305
|
if (retryTimer === void 0) {
|
|
@@ -12314,7 +12314,7 @@ var require_fs = __commonJS({
|
|
|
12314
12314
|
"node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
12315
12315
|
"use strict";
|
|
12316
12316
|
var u = require_universalify().fromCallback;
|
|
12317
|
-
var
|
|
12317
|
+
var fs16 = require_graceful_fs();
|
|
12318
12318
|
var api = [
|
|
12319
12319
|
"access",
|
|
12320
12320
|
"appendFile",
|
|
@@ -12355,26 +12355,26 @@ var require_fs = __commonJS({
|
|
|
12355
12355
|
"utimes",
|
|
12356
12356
|
"writeFile"
|
|
12357
12357
|
].filter((key) => {
|
|
12358
|
-
return typeof
|
|
12358
|
+
return typeof fs16[key] === "function";
|
|
12359
12359
|
});
|
|
12360
|
-
Object.assign(exports2,
|
|
12360
|
+
Object.assign(exports2, fs16);
|
|
12361
12361
|
api.forEach((method) => {
|
|
12362
|
-
exports2[method] = u(
|
|
12362
|
+
exports2[method] = u(fs16[method]);
|
|
12363
12363
|
});
|
|
12364
12364
|
exports2.exists = function(filename, callback) {
|
|
12365
12365
|
if (typeof callback === "function") {
|
|
12366
|
-
return
|
|
12366
|
+
return fs16.exists(filename, callback);
|
|
12367
12367
|
}
|
|
12368
12368
|
return new Promise((resolve2) => {
|
|
12369
|
-
return
|
|
12369
|
+
return fs16.exists(filename, resolve2);
|
|
12370
12370
|
});
|
|
12371
12371
|
};
|
|
12372
12372
|
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
12373
12373
|
if (typeof callback === "function") {
|
|
12374
|
-
return
|
|
12374
|
+
return fs16.read(fd, buffer, offset, length, position, callback);
|
|
12375
12375
|
}
|
|
12376
12376
|
return new Promise((resolve2, reject) => {
|
|
12377
|
-
|
|
12377
|
+
fs16.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
12378
12378
|
if (err) return reject(err);
|
|
12379
12379
|
resolve2({ bytesRead, buffer: buffer2 });
|
|
12380
12380
|
});
|
|
@@ -12382,10 +12382,10 @@ var require_fs = __commonJS({
|
|
|
12382
12382
|
};
|
|
12383
12383
|
exports2.write = function(fd, buffer, ...args) {
|
|
12384
12384
|
if (typeof args[args.length - 1] === "function") {
|
|
12385
|
-
return
|
|
12385
|
+
return fs16.write(fd, buffer, ...args);
|
|
12386
12386
|
}
|
|
12387
12387
|
return new Promise((resolve2, reject) => {
|
|
12388
|
-
|
|
12388
|
+
fs16.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
12389
12389
|
if (err) return reject(err);
|
|
12390
12390
|
resolve2({ bytesWritten, buffer: buffer2 });
|
|
12391
12391
|
});
|
|
@@ -12393,10 +12393,10 @@ var require_fs = __commonJS({
|
|
|
12393
12393
|
};
|
|
12394
12394
|
exports2.readv = function(fd, buffers, ...args) {
|
|
12395
12395
|
if (typeof args[args.length - 1] === "function") {
|
|
12396
|
-
return
|
|
12396
|
+
return fs16.readv(fd, buffers, ...args);
|
|
12397
12397
|
}
|
|
12398
12398
|
return new Promise((resolve2, reject) => {
|
|
12399
|
-
|
|
12399
|
+
fs16.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
12400
12400
|
if (err) return reject(err);
|
|
12401
12401
|
resolve2({ bytesRead, buffers: buffers2 });
|
|
12402
12402
|
});
|
|
@@ -12404,17 +12404,17 @@ var require_fs = __commonJS({
|
|
|
12404
12404
|
};
|
|
12405
12405
|
exports2.writev = function(fd, buffers, ...args) {
|
|
12406
12406
|
if (typeof args[args.length - 1] === "function") {
|
|
12407
|
-
return
|
|
12407
|
+
return fs16.writev(fd, buffers, ...args);
|
|
12408
12408
|
}
|
|
12409
12409
|
return new Promise((resolve2, reject) => {
|
|
12410
|
-
|
|
12410
|
+
fs16.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
12411
12411
|
if (err) return reject(err);
|
|
12412
12412
|
resolve2({ bytesWritten, buffers: buffers2 });
|
|
12413
12413
|
});
|
|
12414
12414
|
});
|
|
12415
12415
|
};
|
|
12416
|
-
if (typeof
|
|
12417
|
-
exports2.realpath.native = u(
|
|
12416
|
+
if (typeof fs16.realpath.native === "function") {
|
|
12417
|
+
exports2.realpath.native = u(fs16.realpath.native);
|
|
12418
12418
|
} else {
|
|
12419
12419
|
process.emitWarning(
|
|
12420
12420
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -12429,10 +12429,10 @@ var require_fs = __commonJS({
|
|
|
12429
12429
|
var require_utils = __commonJS({
|
|
12430
12430
|
"node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
12431
12431
|
"use strict";
|
|
12432
|
-
var
|
|
12432
|
+
var path15 = require("path");
|
|
12433
12433
|
module2.exports.checkPath = function checkPath(pth) {
|
|
12434
12434
|
if (process.platform === "win32") {
|
|
12435
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
12435
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path15.parse(pth).root, ""));
|
|
12436
12436
|
if (pathHasInvalidWinCharacters) {
|
|
12437
12437
|
const error49 = new Error(`Path contains invalid characters: ${pth}`);
|
|
12438
12438
|
error49.code = "EINVAL";
|
|
@@ -12447,7 +12447,7 @@ var require_utils = __commonJS({
|
|
|
12447
12447
|
var require_make_dir = __commonJS({
|
|
12448
12448
|
"node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
12449
12449
|
"use strict";
|
|
12450
|
-
var
|
|
12450
|
+
var fs16 = require_fs();
|
|
12451
12451
|
var { checkPath } = require_utils();
|
|
12452
12452
|
var getMode = (options) => {
|
|
12453
12453
|
const defaults = { mode: 511 };
|
|
@@ -12456,14 +12456,14 @@ var require_make_dir = __commonJS({
|
|
|
12456
12456
|
};
|
|
12457
12457
|
module2.exports.makeDir = async (dir, options) => {
|
|
12458
12458
|
checkPath(dir);
|
|
12459
|
-
return
|
|
12459
|
+
return fs16.mkdir(dir, {
|
|
12460
12460
|
mode: getMode(options),
|
|
12461
12461
|
recursive: true
|
|
12462
12462
|
});
|
|
12463
12463
|
};
|
|
12464
12464
|
module2.exports.makeDirSync = (dir, options) => {
|
|
12465
12465
|
checkPath(dir);
|
|
12466
|
-
return
|
|
12466
|
+
return fs16.mkdirSync(dir, {
|
|
12467
12467
|
mode: getMode(options),
|
|
12468
12468
|
recursive: true
|
|
12469
12469
|
});
|
|
@@ -12495,13 +12495,13 @@ var require_path_exists = __commonJS({
|
|
|
12495
12495
|
"node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
12496
12496
|
"use strict";
|
|
12497
12497
|
var u = require_universalify().fromPromise;
|
|
12498
|
-
var
|
|
12499
|
-
function pathExists(
|
|
12500
|
-
return
|
|
12498
|
+
var fs16 = require_fs();
|
|
12499
|
+
function pathExists(path15) {
|
|
12500
|
+
return fs16.access(path15).then(() => true).catch(() => false);
|
|
12501
12501
|
}
|
|
12502
12502
|
module2.exports = {
|
|
12503
12503
|
pathExists: u(pathExists),
|
|
12504
|
-
pathExistsSync:
|
|
12504
|
+
pathExistsSync: fs16.existsSync
|
|
12505
12505
|
};
|
|
12506
12506
|
}
|
|
12507
12507
|
});
|
|
@@ -12510,16 +12510,16 @@ var require_path_exists = __commonJS({
|
|
|
12510
12510
|
var require_utimes = __commonJS({
|
|
12511
12511
|
"node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
12512
12512
|
"use strict";
|
|
12513
|
-
var
|
|
12513
|
+
var fs16 = require_fs();
|
|
12514
12514
|
var u = require_universalify().fromPromise;
|
|
12515
|
-
async function utimesMillis(
|
|
12516
|
-
const fd = await
|
|
12515
|
+
async function utimesMillis(path15, atime, mtime) {
|
|
12516
|
+
const fd = await fs16.open(path15, "r+");
|
|
12517
12517
|
let closeErr = null;
|
|
12518
12518
|
try {
|
|
12519
|
-
await
|
|
12519
|
+
await fs16.futimes(fd, atime, mtime);
|
|
12520
12520
|
} finally {
|
|
12521
12521
|
try {
|
|
12522
|
-
await
|
|
12522
|
+
await fs16.close(fd);
|
|
12523
12523
|
} catch (e) {
|
|
12524
12524
|
closeErr = e;
|
|
12525
12525
|
}
|
|
@@ -12528,10 +12528,10 @@ var require_utimes = __commonJS({
|
|
|
12528
12528
|
throw closeErr;
|
|
12529
12529
|
}
|
|
12530
12530
|
}
|
|
12531
|
-
function utimesMillisSync(
|
|
12532
|
-
const fd =
|
|
12533
|
-
|
|
12534
|
-
return
|
|
12531
|
+
function utimesMillisSync(path15, atime, mtime) {
|
|
12532
|
+
const fd = fs16.openSync(path15, "r+");
|
|
12533
|
+
fs16.futimesSync(fd, atime, mtime);
|
|
12534
|
+
return fs16.closeSync(fd);
|
|
12535
12535
|
}
|
|
12536
12536
|
module2.exports = {
|
|
12537
12537
|
utimesMillis: u(utimesMillis),
|
|
@@ -12544,11 +12544,11 @@ var require_utimes = __commonJS({
|
|
|
12544
12544
|
var require_stat = __commonJS({
|
|
12545
12545
|
"node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
12546
12546
|
"use strict";
|
|
12547
|
-
var
|
|
12548
|
-
var
|
|
12547
|
+
var fs16 = require_fs();
|
|
12548
|
+
var path15 = require("path");
|
|
12549
12549
|
var u = require_universalify().fromPromise;
|
|
12550
12550
|
function getStats(src, dest, opts) {
|
|
12551
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
12551
|
+
const statFunc = opts.dereference ? (file2) => fs16.stat(file2, { bigint: true }) : (file2) => fs16.lstat(file2, { bigint: true });
|
|
12552
12552
|
return Promise.all([
|
|
12553
12553
|
statFunc(src),
|
|
12554
12554
|
statFunc(dest).catch((err) => {
|
|
@@ -12559,7 +12559,7 @@ var require_stat = __commonJS({
|
|
|
12559
12559
|
}
|
|
12560
12560
|
function getStatsSync(src, dest, opts) {
|
|
12561
12561
|
let destStat;
|
|
12562
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
12562
|
+
const statFunc = opts.dereference ? (file2) => fs16.statSync(file2, { bigint: true }) : (file2) => fs16.lstatSync(file2, { bigint: true });
|
|
12563
12563
|
const srcStat = statFunc(src);
|
|
12564
12564
|
try {
|
|
12565
12565
|
destStat = statFunc(dest);
|
|
@@ -12573,8 +12573,8 @@ var require_stat = __commonJS({
|
|
|
12573
12573
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
12574
12574
|
if (destStat) {
|
|
12575
12575
|
if (areIdentical(srcStat, destStat)) {
|
|
12576
|
-
const srcBaseName =
|
|
12577
|
-
const destBaseName =
|
|
12576
|
+
const srcBaseName = path15.basename(src);
|
|
12577
|
+
const destBaseName = path15.basename(dest);
|
|
12578
12578
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
12579
12579
|
return { srcStat, destStat, isChangingCase: true };
|
|
12580
12580
|
}
|
|
@@ -12596,8 +12596,8 @@ var require_stat = __commonJS({
|
|
|
12596
12596
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
12597
12597
|
if (destStat) {
|
|
12598
12598
|
if (areIdentical(srcStat, destStat)) {
|
|
12599
|
-
const srcBaseName =
|
|
12600
|
-
const destBaseName =
|
|
12599
|
+
const srcBaseName = path15.basename(src);
|
|
12600
|
+
const destBaseName = path15.basename(dest);
|
|
12601
12601
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
12602
12602
|
return { srcStat, destStat, isChangingCase: true };
|
|
12603
12603
|
}
|
|
@@ -12616,12 +12616,12 @@ var require_stat = __commonJS({
|
|
|
12616
12616
|
return { srcStat, destStat };
|
|
12617
12617
|
}
|
|
12618
12618
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
12619
|
-
const srcParent =
|
|
12620
|
-
const destParent =
|
|
12621
|
-
if (destParent === srcParent || destParent ===
|
|
12619
|
+
const srcParent = path15.resolve(path15.dirname(src));
|
|
12620
|
+
const destParent = path15.resolve(path15.dirname(dest));
|
|
12621
|
+
if (destParent === srcParent || destParent === path15.parse(destParent).root) return;
|
|
12622
12622
|
let destStat;
|
|
12623
12623
|
try {
|
|
12624
|
-
destStat = await
|
|
12624
|
+
destStat = await fs16.stat(destParent, { bigint: true });
|
|
12625
12625
|
} catch (err) {
|
|
12626
12626
|
if (err.code === "ENOENT") return;
|
|
12627
12627
|
throw err;
|
|
@@ -12632,12 +12632,12 @@ var require_stat = __commonJS({
|
|
|
12632
12632
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
12633
12633
|
}
|
|
12634
12634
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
12635
|
-
const srcParent =
|
|
12636
|
-
const destParent =
|
|
12637
|
-
if (destParent === srcParent || destParent ===
|
|
12635
|
+
const srcParent = path15.resolve(path15.dirname(src));
|
|
12636
|
+
const destParent = path15.resolve(path15.dirname(dest));
|
|
12637
|
+
if (destParent === srcParent || destParent === path15.parse(destParent).root) return;
|
|
12638
12638
|
let destStat;
|
|
12639
12639
|
try {
|
|
12640
|
-
destStat =
|
|
12640
|
+
destStat = fs16.statSync(destParent, { bigint: true });
|
|
12641
12641
|
} catch (err) {
|
|
12642
12642
|
if (err.code === "ENOENT") return;
|
|
12643
12643
|
throw err;
|
|
@@ -12651,8 +12651,8 @@ var require_stat = __commonJS({
|
|
|
12651
12651
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
12652
12652
|
}
|
|
12653
12653
|
function isSrcSubdir(src, dest) {
|
|
12654
|
-
const srcArr =
|
|
12655
|
-
const destArr =
|
|
12654
|
+
const srcArr = path15.resolve(src).split(path15.sep).filter((i) => i);
|
|
12655
|
+
const destArr = path15.resolve(dest).split(path15.sep).filter((i) => i);
|
|
12656
12656
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
12657
12657
|
}
|
|
12658
12658
|
function errMsg(src, dest, funcName) {
|
|
@@ -12704,8 +12704,8 @@ var require_async = __commonJS({
|
|
|
12704
12704
|
var require_copy = __commonJS({
|
|
12705
12705
|
"node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
12706
12706
|
"use strict";
|
|
12707
|
-
var
|
|
12708
|
-
var
|
|
12707
|
+
var fs16 = require_fs();
|
|
12708
|
+
var path15 = require("path");
|
|
12709
12709
|
var { mkdirs } = require_mkdirs();
|
|
12710
12710
|
var { pathExists } = require_path_exists();
|
|
12711
12711
|
var { utimesMillis } = require_utimes();
|
|
@@ -12728,7 +12728,7 @@ var require_copy = __commonJS({
|
|
|
12728
12728
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
12729
12729
|
const include = await runFilter(src, dest, opts);
|
|
12730
12730
|
if (!include) return;
|
|
12731
|
-
const destParent =
|
|
12731
|
+
const destParent = path15.dirname(dest);
|
|
12732
12732
|
const dirExists = await pathExists(destParent);
|
|
12733
12733
|
if (!dirExists) {
|
|
12734
12734
|
await mkdirs(destParent);
|
|
@@ -12740,7 +12740,7 @@ var require_copy = __commonJS({
|
|
|
12740
12740
|
return opts.filter(src, dest);
|
|
12741
12741
|
}
|
|
12742
12742
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
12743
|
-
const statFn = opts.dereference ?
|
|
12743
|
+
const statFn = opts.dereference ? fs16.stat : fs16.lstat;
|
|
12744
12744
|
const srcStat = await statFn(src);
|
|
12745
12745
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
12746
12746
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -12752,7 +12752,7 @@ var require_copy = __commonJS({
|
|
|
12752
12752
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
12753
12753
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
12754
12754
|
if (opts.overwrite) {
|
|
12755
|
-
await
|
|
12755
|
+
await fs16.unlink(dest);
|
|
12756
12756
|
return copyFile(srcStat, src, dest, opts);
|
|
12757
12757
|
}
|
|
12758
12758
|
if (opts.errorOnExist) {
|
|
@@ -12760,29 +12760,29 @@ var require_copy = __commonJS({
|
|
|
12760
12760
|
}
|
|
12761
12761
|
}
|
|
12762
12762
|
async function copyFile(srcStat, src, dest, opts) {
|
|
12763
|
-
await
|
|
12763
|
+
await fs16.copyFile(src, dest);
|
|
12764
12764
|
if (opts.preserveTimestamps) {
|
|
12765
12765
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
12766
12766
|
await makeFileWritable(dest, srcStat.mode);
|
|
12767
12767
|
}
|
|
12768
|
-
const updatedSrcStat = await
|
|
12768
|
+
const updatedSrcStat = await fs16.stat(src);
|
|
12769
12769
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
12770
12770
|
}
|
|
12771
|
-
return
|
|
12771
|
+
return fs16.chmod(dest, srcStat.mode);
|
|
12772
12772
|
}
|
|
12773
12773
|
function fileIsNotWritable(srcMode) {
|
|
12774
12774
|
return (srcMode & 128) === 0;
|
|
12775
12775
|
}
|
|
12776
12776
|
function makeFileWritable(dest, srcMode) {
|
|
12777
|
-
return
|
|
12777
|
+
return fs16.chmod(dest, srcMode | 128);
|
|
12778
12778
|
}
|
|
12779
12779
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
12780
12780
|
if (!destStat) {
|
|
12781
|
-
await
|
|
12781
|
+
await fs16.mkdir(dest);
|
|
12782
12782
|
}
|
|
12783
|
-
await asyncIteratorConcurrentProcess(await
|
|
12784
|
-
const srcItem =
|
|
12785
|
-
const destItem =
|
|
12783
|
+
await asyncIteratorConcurrentProcess(await fs16.opendir(src), async (item) => {
|
|
12784
|
+
const srcItem = path15.join(src, item.name);
|
|
12785
|
+
const destItem = path15.join(dest, item.name);
|
|
12786
12786
|
const include = await runFilter(srcItem, destItem, opts);
|
|
12787
12787
|
if (include) {
|
|
12788
12788
|
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -12790,26 +12790,26 @@ var require_copy = __commonJS({
|
|
|
12790
12790
|
}
|
|
12791
12791
|
});
|
|
12792
12792
|
if (!destStat) {
|
|
12793
|
-
await
|
|
12793
|
+
await fs16.chmod(dest, srcStat.mode);
|
|
12794
12794
|
}
|
|
12795
12795
|
}
|
|
12796
12796
|
async function onLink(destStat, src, dest, opts) {
|
|
12797
|
-
let resolvedSrc = await
|
|
12797
|
+
let resolvedSrc = await fs16.readlink(src);
|
|
12798
12798
|
if (opts.dereference) {
|
|
12799
|
-
resolvedSrc =
|
|
12799
|
+
resolvedSrc = path15.resolve(process.cwd(), resolvedSrc);
|
|
12800
12800
|
}
|
|
12801
12801
|
if (!destStat) {
|
|
12802
|
-
return
|
|
12802
|
+
return fs16.symlink(resolvedSrc, dest);
|
|
12803
12803
|
}
|
|
12804
12804
|
let resolvedDest = null;
|
|
12805
12805
|
try {
|
|
12806
|
-
resolvedDest = await
|
|
12806
|
+
resolvedDest = await fs16.readlink(dest);
|
|
12807
12807
|
} catch (e) {
|
|
12808
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
12808
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs16.symlink(resolvedSrc, dest);
|
|
12809
12809
|
throw e;
|
|
12810
12810
|
}
|
|
12811
12811
|
if (opts.dereference) {
|
|
12812
|
-
resolvedDest =
|
|
12812
|
+
resolvedDest = path15.resolve(process.cwd(), resolvedDest);
|
|
12813
12813
|
}
|
|
12814
12814
|
if (resolvedSrc !== resolvedDest) {
|
|
12815
12815
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -12819,8 +12819,8 @@ var require_copy = __commonJS({
|
|
|
12819
12819
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
12820
12820
|
}
|
|
12821
12821
|
}
|
|
12822
|
-
await
|
|
12823
|
-
return
|
|
12822
|
+
await fs16.unlink(dest);
|
|
12823
|
+
return fs16.symlink(resolvedSrc, dest);
|
|
12824
12824
|
}
|
|
12825
12825
|
module2.exports = copy;
|
|
12826
12826
|
}
|
|
@@ -12830,8 +12830,8 @@ var require_copy = __commonJS({
|
|
|
12830
12830
|
var require_copy_sync = __commonJS({
|
|
12831
12831
|
"node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
12832
12832
|
"use strict";
|
|
12833
|
-
var
|
|
12834
|
-
var
|
|
12833
|
+
var fs16 = require_graceful_fs();
|
|
12834
|
+
var path15 = require("path");
|
|
12835
12835
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
12836
12836
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
12837
12837
|
var stat = require_stat();
|
|
@@ -12852,12 +12852,12 @@ var require_copy_sync = __commonJS({
|
|
|
12852
12852
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
12853
12853
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
12854
12854
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
12855
|
-
const destParent =
|
|
12856
|
-
if (!
|
|
12855
|
+
const destParent = path15.dirname(dest);
|
|
12856
|
+
if (!fs16.existsSync(destParent)) mkdirsSync(destParent);
|
|
12857
12857
|
return getStats(destStat, src, dest, opts);
|
|
12858
12858
|
}
|
|
12859
12859
|
function getStats(destStat, src, dest, opts) {
|
|
12860
|
-
const statSync = opts.dereference ?
|
|
12860
|
+
const statSync = opts.dereference ? fs16.statSync : fs16.lstatSync;
|
|
12861
12861
|
const srcStat = statSync(src);
|
|
12862
12862
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
12863
12863
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -12872,14 +12872,14 @@ var require_copy_sync = __commonJS({
|
|
|
12872
12872
|
}
|
|
12873
12873
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
12874
12874
|
if (opts.overwrite) {
|
|
12875
|
-
|
|
12875
|
+
fs16.unlinkSync(dest);
|
|
12876
12876
|
return copyFile(srcStat, src, dest, opts);
|
|
12877
12877
|
} else if (opts.errorOnExist) {
|
|
12878
12878
|
throw new Error(`'${dest}' already exists`);
|
|
12879
12879
|
}
|
|
12880
12880
|
}
|
|
12881
12881
|
function copyFile(srcStat, src, dest, opts) {
|
|
12882
|
-
|
|
12882
|
+
fs16.copyFileSync(src, dest);
|
|
12883
12883
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
12884
12884
|
return setDestMode(dest, srcStat.mode);
|
|
12885
12885
|
}
|
|
@@ -12894,10 +12894,10 @@ var require_copy_sync = __commonJS({
|
|
|
12894
12894
|
return setDestMode(dest, srcMode | 128);
|
|
12895
12895
|
}
|
|
12896
12896
|
function setDestMode(dest, srcMode) {
|
|
12897
|
-
return
|
|
12897
|
+
return fs16.chmodSync(dest, srcMode);
|
|
12898
12898
|
}
|
|
12899
12899
|
function setDestTimestamps(src, dest) {
|
|
12900
|
-
const updatedSrcStat =
|
|
12900
|
+
const updatedSrcStat = fs16.statSync(src);
|
|
12901
12901
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
12902
12902
|
}
|
|
12903
12903
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -12905,12 +12905,12 @@ var require_copy_sync = __commonJS({
|
|
|
12905
12905
|
return copyDir(src, dest, opts);
|
|
12906
12906
|
}
|
|
12907
12907
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
12908
|
-
|
|
12908
|
+
fs16.mkdirSync(dest);
|
|
12909
12909
|
copyDir(src, dest, opts);
|
|
12910
12910
|
return setDestMode(dest, srcMode);
|
|
12911
12911
|
}
|
|
12912
12912
|
function copyDir(src, dest, opts) {
|
|
12913
|
-
const dir =
|
|
12913
|
+
const dir = fs16.opendirSync(src);
|
|
12914
12914
|
try {
|
|
12915
12915
|
let dirent;
|
|
12916
12916
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -12921,29 +12921,29 @@ var require_copy_sync = __commonJS({
|
|
|
12921
12921
|
}
|
|
12922
12922
|
}
|
|
12923
12923
|
function copyDirItem(item, src, dest, opts) {
|
|
12924
|
-
const srcItem =
|
|
12925
|
-
const destItem =
|
|
12924
|
+
const srcItem = path15.join(src, item);
|
|
12925
|
+
const destItem = path15.join(dest, item);
|
|
12926
12926
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
12927
12927
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
12928
12928
|
return getStats(destStat, srcItem, destItem, opts);
|
|
12929
12929
|
}
|
|
12930
12930
|
function onLink(destStat, src, dest, opts) {
|
|
12931
|
-
let resolvedSrc =
|
|
12931
|
+
let resolvedSrc = fs16.readlinkSync(src);
|
|
12932
12932
|
if (opts.dereference) {
|
|
12933
|
-
resolvedSrc =
|
|
12933
|
+
resolvedSrc = path15.resolve(process.cwd(), resolvedSrc);
|
|
12934
12934
|
}
|
|
12935
12935
|
if (!destStat) {
|
|
12936
|
-
return
|
|
12936
|
+
return fs16.symlinkSync(resolvedSrc, dest);
|
|
12937
12937
|
} else {
|
|
12938
12938
|
let resolvedDest;
|
|
12939
12939
|
try {
|
|
12940
|
-
resolvedDest =
|
|
12940
|
+
resolvedDest = fs16.readlinkSync(dest);
|
|
12941
12941
|
} catch (err) {
|
|
12942
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
12942
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs16.symlinkSync(resolvedSrc, dest);
|
|
12943
12943
|
throw err;
|
|
12944
12944
|
}
|
|
12945
12945
|
if (opts.dereference) {
|
|
12946
|
-
resolvedDest =
|
|
12946
|
+
resolvedDest = path15.resolve(process.cwd(), resolvedDest);
|
|
12947
12947
|
}
|
|
12948
12948
|
if (resolvedSrc !== resolvedDest) {
|
|
12949
12949
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -12957,8 +12957,8 @@ var require_copy_sync = __commonJS({
|
|
|
12957
12957
|
}
|
|
12958
12958
|
}
|
|
12959
12959
|
function copyLink(resolvedSrc, dest) {
|
|
12960
|
-
|
|
12961
|
-
return
|
|
12960
|
+
fs16.unlinkSync(dest);
|
|
12961
|
+
return fs16.symlinkSync(resolvedSrc, dest);
|
|
12962
12962
|
}
|
|
12963
12963
|
module2.exports = copySync;
|
|
12964
12964
|
}
|
|
@@ -12980,13 +12980,13 @@ var require_copy2 = __commonJS({
|
|
|
12980
12980
|
var require_remove = __commonJS({
|
|
12981
12981
|
"node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
12982
12982
|
"use strict";
|
|
12983
|
-
var
|
|
12983
|
+
var fs16 = require_graceful_fs();
|
|
12984
12984
|
var u = require_universalify().fromCallback;
|
|
12985
|
-
function remove(
|
|
12986
|
-
|
|
12985
|
+
function remove(path15, callback) {
|
|
12986
|
+
fs16.rm(path15, { recursive: true, force: true }, callback);
|
|
12987
12987
|
}
|
|
12988
|
-
function removeSync(
|
|
12989
|
-
|
|
12988
|
+
function removeSync(path15) {
|
|
12989
|
+
fs16.rmSync(path15, { recursive: true, force: true });
|
|
12990
12990
|
}
|
|
12991
12991
|
module2.exports = {
|
|
12992
12992
|
remove: u(remove),
|
|
@@ -13000,28 +13000,28 @@ var require_empty = __commonJS({
|
|
|
13000
13000
|
"node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
13001
13001
|
"use strict";
|
|
13002
13002
|
var u = require_universalify().fromPromise;
|
|
13003
|
-
var
|
|
13004
|
-
var
|
|
13003
|
+
var fs16 = require_fs();
|
|
13004
|
+
var path15 = require("path");
|
|
13005
13005
|
var mkdir = require_mkdirs();
|
|
13006
13006
|
var remove = require_remove();
|
|
13007
13007
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
13008
13008
|
let items;
|
|
13009
13009
|
try {
|
|
13010
|
-
items = await
|
|
13010
|
+
items = await fs16.readdir(dir);
|
|
13011
13011
|
} catch {
|
|
13012
13012
|
return mkdir.mkdirs(dir);
|
|
13013
13013
|
}
|
|
13014
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
13014
|
+
return Promise.all(items.map((item) => remove.remove(path15.join(dir, item))));
|
|
13015
13015
|
});
|
|
13016
13016
|
function emptyDirSync(dir) {
|
|
13017
13017
|
let items;
|
|
13018
13018
|
try {
|
|
13019
|
-
items =
|
|
13019
|
+
items = fs16.readdirSync(dir);
|
|
13020
13020
|
} catch {
|
|
13021
13021
|
return mkdir.mkdirsSync(dir);
|
|
13022
13022
|
}
|
|
13023
13023
|
items.forEach((item) => {
|
|
13024
|
-
item =
|
|
13024
|
+
item = path15.join(dir, item);
|
|
13025
13025
|
remove.removeSync(item);
|
|
13026
13026
|
});
|
|
13027
13027
|
}
|
|
@@ -13039,52 +13039,52 @@ var require_file = __commonJS({
|
|
|
13039
13039
|
"node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
13040
13040
|
"use strict";
|
|
13041
13041
|
var u = require_universalify().fromPromise;
|
|
13042
|
-
var
|
|
13043
|
-
var
|
|
13042
|
+
var path15 = require("path");
|
|
13043
|
+
var fs16 = require_fs();
|
|
13044
13044
|
var mkdir = require_mkdirs();
|
|
13045
13045
|
async function createFile(file2) {
|
|
13046
13046
|
let stats;
|
|
13047
13047
|
try {
|
|
13048
|
-
stats = await
|
|
13048
|
+
stats = await fs16.stat(file2);
|
|
13049
13049
|
} catch {
|
|
13050
13050
|
}
|
|
13051
13051
|
if (stats && stats.isFile()) return;
|
|
13052
|
-
const dir =
|
|
13052
|
+
const dir = path15.dirname(file2);
|
|
13053
13053
|
let dirStats = null;
|
|
13054
13054
|
try {
|
|
13055
|
-
dirStats = await
|
|
13055
|
+
dirStats = await fs16.stat(dir);
|
|
13056
13056
|
} catch (err) {
|
|
13057
13057
|
if (err.code === "ENOENT") {
|
|
13058
13058
|
await mkdir.mkdirs(dir);
|
|
13059
|
-
await
|
|
13059
|
+
await fs16.writeFile(file2, "");
|
|
13060
13060
|
return;
|
|
13061
13061
|
} else {
|
|
13062
13062
|
throw err;
|
|
13063
13063
|
}
|
|
13064
13064
|
}
|
|
13065
13065
|
if (dirStats.isDirectory()) {
|
|
13066
|
-
await
|
|
13066
|
+
await fs16.writeFile(file2, "");
|
|
13067
13067
|
} else {
|
|
13068
|
-
await
|
|
13068
|
+
await fs16.readdir(dir);
|
|
13069
13069
|
}
|
|
13070
13070
|
}
|
|
13071
13071
|
function createFileSync(file2) {
|
|
13072
13072
|
let stats;
|
|
13073
13073
|
try {
|
|
13074
|
-
stats =
|
|
13074
|
+
stats = fs16.statSync(file2);
|
|
13075
13075
|
} catch {
|
|
13076
13076
|
}
|
|
13077
13077
|
if (stats && stats.isFile()) return;
|
|
13078
|
-
const dir =
|
|
13078
|
+
const dir = path15.dirname(file2);
|
|
13079
13079
|
try {
|
|
13080
|
-
if (!
|
|
13081
|
-
|
|
13080
|
+
if (!fs16.statSync(dir).isDirectory()) {
|
|
13081
|
+
fs16.readdirSync(dir);
|
|
13082
13082
|
}
|
|
13083
13083
|
} catch (err) {
|
|
13084
13084
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
13085
13085
|
else throw err;
|
|
13086
13086
|
}
|
|
13087
|
-
|
|
13087
|
+
fs16.writeFileSync(file2, "");
|
|
13088
13088
|
}
|
|
13089
13089
|
module2.exports = {
|
|
13090
13090
|
createFile: u(createFile),
|
|
@@ -13098,50 +13098,50 @@ var require_link = __commonJS({
|
|
|
13098
13098
|
"node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
13099
13099
|
"use strict";
|
|
13100
13100
|
var u = require_universalify().fromPromise;
|
|
13101
|
-
var
|
|
13102
|
-
var
|
|
13101
|
+
var path15 = require("path");
|
|
13102
|
+
var fs16 = require_fs();
|
|
13103
13103
|
var mkdir = require_mkdirs();
|
|
13104
13104
|
var { pathExists } = require_path_exists();
|
|
13105
13105
|
var { areIdentical } = require_stat();
|
|
13106
13106
|
async function createLink(srcpath, dstpath) {
|
|
13107
13107
|
let dstStat;
|
|
13108
13108
|
try {
|
|
13109
|
-
dstStat = await
|
|
13109
|
+
dstStat = await fs16.lstat(dstpath);
|
|
13110
13110
|
} catch {
|
|
13111
13111
|
}
|
|
13112
13112
|
let srcStat;
|
|
13113
13113
|
try {
|
|
13114
|
-
srcStat = await
|
|
13114
|
+
srcStat = await fs16.lstat(srcpath);
|
|
13115
13115
|
} catch (err) {
|
|
13116
13116
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
13117
13117
|
throw err;
|
|
13118
13118
|
}
|
|
13119
13119
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
13120
|
-
const dir =
|
|
13120
|
+
const dir = path15.dirname(dstpath);
|
|
13121
13121
|
const dirExists = await pathExists(dir);
|
|
13122
13122
|
if (!dirExists) {
|
|
13123
13123
|
await mkdir.mkdirs(dir);
|
|
13124
13124
|
}
|
|
13125
|
-
await
|
|
13125
|
+
await fs16.link(srcpath, dstpath);
|
|
13126
13126
|
}
|
|
13127
13127
|
function createLinkSync(srcpath, dstpath) {
|
|
13128
13128
|
let dstStat;
|
|
13129
13129
|
try {
|
|
13130
|
-
dstStat =
|
|
13130
|
+
dstStat = fs16.lstatSync(dstpath);
|
|
13131
13131
|
} catch {
|
|
13132
13132
|
}
|
|
13133
13133
|
try {
|
|
13134
|
-
const srcStat =
|
|
13134
|
+
const srcStat = fs16.lstatSync(srcpath);
|
|
13135
13135
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
13136
13136
|
} catch (err) {
|
|
13137
13137
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
13138
13138
|
throw err;
|
|
13139
13139
|
}
|
|
13140
|
-
const dir =
|
|
13141
|
-
const dirExists =
|
|
13142
|
-
if (dirExists) return
|
|
13140
|
+
const dir = path15.dirname(dstpath);
|
|
13141
|
+
const dirExists = fs16.existsSync(dir);
|
|
13142
|
+
if (dirExists) return fs16.linkSync(srcpath, dstpath);
|
|
13143
13143
|
mkdir.mkdirsSync(dir);
|
|
13144
|
-
return
|
|
13144
|
+
return fs16.linkSync(srcpath, dstpath);
|
|
13145
13145
|
}
|
|
13146
13146
|
module2.exports = {
|
|
13147
13147
|
createLink: u(createLink),
|
|
@@ -13154,14 +13154,14 @@ var require_link = __commonJS({
|
|
|
13154
13154
|
var require_symlink_paths = __commonJS({
|
|
13155
13155
|
"node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
13156
13156
|
"use strict";
|
|
13157
|
-
var
|
|
13158
|
-
var
|
|
13157
|
+
var path15 = require("path");
|
|
13158
|
+
var fs16 = require_fs();
|
|
13159
13159
|
var { pathExists } = require_path_exists();
|
|
13160
13160
|
var u = require_universalify().fromPromise;
|
|
13161
13161
|
async function symlinkPaths(srcpath, dstpath) {
|
|
13162
|
-
if (
|
|
13162
|
+
if (path15.isAbsolute(srcpath)) {
|
|
13163
13163
|
try {
|
|
13164
|
-
await
|
|
13164
|
+
await fs16.lstat(srcpath);
|
|
13165
13165
|
} catch (err) {
|
|
13166
13166
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
13167
13167
|
throw err;
|
|
@@ -13171,8 +13171,8 @@ var require_symlink_paths = __commonJS({
|
|
|
13171
13171
|
toDst: srcpath
|
|
13172
13172
|
};
|
|
13173
13173
|
}
|
|
13174
|
-
const dstdir =
|
|
13175
|
-
const relativeToDst =
|
|
13174
|
+
const dstdir = path15.dirname(dstpath);
|
|
13175
|
+
const relativeToDst = path15.join(dstdir, srcpath);
|
|
13176
13176
|
const exists = await pathExists(relativeToDst);
|
|
13177
13177
|
if (exists) {
|
|
13178
13178
|
return {
|
|
@@ -13181,39 +13181,39 @@ var require_symlink_paths = __commonJS({
|
|
|
13181
13181
|
};
|
|
13182
13182
|
}
|
|
13183
13183
|
try {
|
|
13184
|
-
await
|
|
13184
|
+
await fs16.lstat(srcpath);
|
|
13185
13185
|
} catch (err) {
|
|
13186
13186
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
13187
13187
|
throw err;
|
|
13188
13188
|
}
|
|
13189
13189
|
return {
|
|
13190
13190
|
toCwd: srcpath,
|
|
13191
|
-
toDst:
|
|
13191
|
+
toDst: path15.relative(dstdir, srcpath)
|
|
13192
13192
|
};
|
|
13193
13193
|
}
|
|
13194
13194
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
13195
|
-
if (
|
|
13196
|
-
const exists2 =
|
|
13195
|
+
if (path15.isAbsolute(srcpath)) {
|
|
13196
|
+
const exists2 = fs16.existsSync(srcpath);
|
|
13197
13197
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
13198
13198
|
return {
|
|
13199
13199
|
toCwd: srcpath,
|
|
13200
13200
|
toDst: srcpath
|
|
13201
13201
|
};
|
|
13202
13202
|
}
|
|
13203
|
-
const dstdir =
|
|
13204
|
-
const relativeToDst =
|
|
13205
|
-
const exists =
|
|
13203
|
+
const dstdir = path15.dirname(dstpath);
|
|
13204
|
+
const relativeToDst = path15.join(dstdir, srcpath);
|
|
13205
|
+
const exists = fs16.existsSync(relativeToDst);
|
|
13206
13206
|
if (exists) {
|
|
13207
13207
|
return {
|
|
13208
13208
|
toCwd: relativeToDst,
|
|
13209
13209
|
toDst: srcpath
|
|
13210
13210
|
};
|
|
13211
13211
|
}
|
|
13212
|
-
const srcExists =
|
|
13212
|
+
const srcExists = fs16.existsSync(srcpath);
|
|
13213
13213
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
13214
13214
|
return {
|
|
13215
13215
|
toCwd: srcpath,
|
|
13216
|
-
toDst:
|
|
13216
|
+
toDst: path15.relative(dstdir, srcpath)
|
|
13217
13217
|
};
|
|
13218
13218
|
}
|
|
13219
13219
|
module2.exports = {
|
|
@@ -13227,13 +13227,13 @@ var require_symlink_paths = __commonJS({
|
|
|
13227
13227
|
var require_symlink_type = __commonJS({
|
|
13228
13228
|
"node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
13229
13229
|
"use strict";
|
|
13230
|
-
var
|
|
13230
|
+
var fs16 = require_fs();
|
|
13231
13231
|
var u = require_universalify().fromPromise;
|
|
13232
13232
|
async function symlinkType(srcpath, type) {
|
|
13233
13233
|
if (type) return type;
|
|
13234
13234
|
let stats;
|
|
13235
13235
|
try {
|
|
13236
|
-
stats = await
|
|
13236
|
+
stats = await fs16.lstat(srcpath);
|
|
13237
13237
|
} catch {
|
|
13238
13238
|
return "file";
|
|
13239
13239
|
}
|
|
@@ -13243,7 +13243,7 @@ var require_symlink_type = __commonJS({
|
|
|
13243
13243
|
if (type) return type;
|
|
13244
13244
|
let stats;
|
|
13245
13245
|
try {
|
|
13246
|
-
stats =
|
|
13246
|
+
stats = fs16.lstatSync(srcpath);
|
|
13247
13247
|
} catch {
|
|
13248
13248
|
return "file";
|
|
13249
13249
|
}
|
|
@@ -13261,8 +13261,8 @@ var require_symlink = __commonJS({
|
|
|
13261
13261
|
"node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
13262
13262
|
"use strict";
|
|
13263
13263
|
var u = require_universalify().fromPromise;
|
|
13264
|
-
var
|
|
13265
|
-
var
|
|
13264
|
+
var path15 = require("path");
|
|
13265
|
+
var fs16 = require_fs();
|
|
13266
13266
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
13267
13267
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
13268
13268
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -13271,44 +13271,44 @@ var require_symlink = __commonJS({
|
|
|
13271
13271
|
async function createSymlink(srcpath, dstpath, type) {
|
|
13272
13272
|
let stats;
|
|
13273
13273
|
try {
|
|
13274
|
-
stats = await
|
|
13274
|
+
stats = await fs16.lstat(dstpath);
|
|
13275
13275
|
} catch {
|
|
13276
13276
|
}
|
|
13277
13277
|
if (stats && stats.isSymbolicLink()) {
|
|
13278
13278
|
const [srcStat, dstStat] = await Promise.all([
|
|
13279
|
-
|
|
13280
|
-
|
|
13279
|
+
fs16.stat(srcpath),
|
|
13280
|
+
fs16.stat(dstpath)
|
|
13281
13281
|
]);
|
|
13282
13282
|
if (areIdentical(srcStat, dstStat)) return;
|
|
13283
13283
|
}
|
|
13284
13284
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
13285
13285
|
srcpath = relative.toDst;
|
|
13286
13286
|
const toType = await symlinkType(relative.toCwd, type);
|
|
13287
|
-
const dir =
|
|
13287
|
+
const dir = path15.dirname(dstpath);
|
|
13288
13288
|
if (!await pathExists(dir)) {
|
|
13289
13289
|
await mkdirs(dir);
|
|
13290
13290
|
}
|
|
13291
|
-
return
|
|
13291
|
+
return fs16.symlink(srcpath, dstpath, toType);
|
|
13292
13292
|
}
|
|
13293
13293
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
13294
13294
|
let stats;
|
|
13295
13295
|
try {
|
|
13296
|
-
stats =
|
|
13296
|
+
stats = fs16.lstatSync(dstpath);
|
|
13297
13297
|
} catch {
|
|
13298
13298
|
}
|
|
13299
13299
|
if (stats && stats.isSymbolicLink()) {
|
|
13300
|
-
const srcStat =
|
|
13301
|
-
const dstStat =
|
|
13300
|
+
const srcStat = fs16.statSync(srcpath);
|
|
13301
|
+
const dstStat = fs16.statSync(dstpath);
|
|
13302
13302
|
if (areIdentical(srcStat, dstStat)) return;
|
|
13303
13303
|
}
|
|
13304
13304
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
13305
13305
|
srcpath = relative.toDst;
|
|
13306
13306
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
13307
|
-
const dir =
|
|
13308
|
-
const exists =
|
|
13309
|
-
if (exists) return
|
|
13307
|
+
const dir = path15.dirname(dstpath);
|
|
13308
|
+
const exists = fs16.existsSync(dir);
|
|
13309
|
+
if (exists) return fs16.symlinkSync(srcpath, dstpath, type);
|
|
13310
13310
|
mkdirsSync(dir);
|
|
13311
|
-
return
|
|
13311
|
+
return fs16.symlinkSync(srcpath, dstpath, type);
|
|
13312
13312
|
}
|
|
13313
13313
|
module2.exports = {
|
|
13314
13314
|
createSymlink: u(createSymlink),
|
|
@@ -13377,9 +13377,9 @@ var require_jsonfile = __commonJS({
|
|
|
13377
13377
|
if (typeof options === "string") {
|
|
13378
13378
|
options = { encoding: options };
|
|
13379
13379
|
}
|
|
13380
|
-
const
|
|
13380
|
+
const fs16 = options.fs || _fs;
|
|
13381
13381
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
13382
|
-
let data = await universalify.fromCallback(
|
|
13382
|
+
let data = await universalify.fromCallback(fs16.readFile)(file2, options);
|
|
13383
13383
|
data = stripBom(data);
|
|
13384
13384
|
let obj;
|
|
13385
13385
|
try {
|
|
@@ -13399,10 +13399,10 @@ var require_jsonfile = __commonJS({
|
|
|
13399
13399
|
if (typeof options === "string") {
|
|
13400
13400
|
options = { encoding: options };
|
|
13401
13401
|
}
|
|
13402
|
-
const
|
|
13402
|
+
const fs16 = options.fs || _fs;
|
|
13403
13403
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
13404
13404
|
try {
|
|
13405
|
-
let content =
|
|
13405
|
+
let content = fs16.readFileSync(file2, options);
|
|
13406
13406
|
content = stripBom(content);
|
|
13407
13407
|
return JSON.parse(content, options.reviver);
|
|
13408
13408
|
} catch (err) {
|
|
@@ -13415,15 +13415,15 @@ var require_jsonfile = __commonJS({
|
|
|
13415
13415
|
}
|
|
13416
13416
|
}
|
|
13417
13417
|
async function _writeFile(file2, obj, options = {}) {
|
|
13418
|
-
const
|
|
13418
|
+
const fs16 = options.fs || _fs;
|
|
13419
13419
|
const str = stringify2(obj, options);
|
|
13420
|
-
await universalify.fromCallback(
|
|
13420
|
+
await universalify.fromCallback(fs16.writeFile)(file2, str, options);
|
|
13421
13421
|
}
|
|
13422
13422
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
13423
13423
|
function writeFileSync2(file2, obj, options = {}) {
|
|
13424
|
-
const
|
|
13424
|
+
const fs16 = options.fs || _fs;
|
|
13425
13425
|
const str = stringify2(obj, options);
|
|
13426
|
-
return
|
|
13426
|
+
return fs16.writeFileSync(file2, str, options);
|
|
13427
13427
|
}
|
|
13428
13428
|
module2.exports = {
|
|
13429
13429
|
readFile,
|
|
@@ -13454,23 +13454,23 @@ var require_output_file = __commonJS({
|
|
|
13454
13454
|
"node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
13455
13455
|
"use strict";
|
|
13456
13456
|
var u = require_universalify().fromPromise;
|
|
13457
|
-
var
|
|
13458
|
-
var
|
|
13457
|
+
var fs16 = require_fs();
|
|
13458
|
+
var path15 = require("path");
|
|
13459
13459
|
var mkdir = require_mkdirs();
|
|
13460
13460
|
var pathExists = require_path_exists().pathExists;
|
|
13461
13461
|
async function outputFile(file2, data, encoding = "utf-8") {
|
|
13462
|
-
const dir =
|
|
13462
|
+
const dir = path15.dirname(file2);
|
|
13463
13463
|
if (!await pathExists(dir)) {
|
|
13464
13464
|
await mkdir.mkdirs(dir);
|
|
13465
13465
|
}
|
|
13466
|
-
return
|
|
13466
|
+
return fs16.writeFile(file2, data, encoding);
|
|
13467
13467
|
}
|
|
13468
13468
|
function outputFileSync(file2, ...args) {
|
|
13469
|
-
const dir =
|
|
13470
|
-
if (!
|
|
13469
|
+
const dir = path15.dirname(file2);
|
|
13470
|
+
if (!fs16.existsSync(dir)) {
|
|
13471
13471
|
mkdir.mkdirsSync(dir);
|
|
13472
13472
|
}
|
|
13473
|
-
|
|
13473
|
+
fs16.writeFileSync(file2, ...args);
|
|
13474
13474
|
}
|
|
13475
13475
|
module2.exports = {
|
|
13476
13476
|
outputFile: u(outputFile),
|
|
@@ -13529,8 +13529,8 @@ var require_json = __commonJS({
|
|
|
13529
13529
|
var require_move = __commonJS({
|
|
13530
13530
|
"node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
13531
13531
|
"use strict";
|
|
13532
|
-
var
|
|
13533
|
-
var
|
|
13532
|
+
var fs16 = require_fs();
|
|
13533
|
+
var path15 = require("path");
|
|
13534
13534
|
var { copy } = require_copy2();
|
|
13535
13535
|
var { remove } = require_remove();
|
|
13536
13536
|
var { mkdirp } = require_mkdirs();
|
|
@@ -13540,8 +13540,8 @@ var require_move = __commonJS({
|
|
|
13540
13540
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
13541
13541
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
13542
13542
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
13543
|
-
const destParent =
|
|
13544
|
-
const parsedParentPath =
|
|
13543
|
+
const destParent = path15.dirname(dest);
|
|
13544
|
+
const parsedParentPath = path15.parse(destParent);
|
|
13545
13545
|
if (parsedParentPath.root !== destParent) {
|
|
13546
13546
|
await mkdirp(destParent);
|
|
13547
13547
|
}
|
|
@@ -13556,7 +13556,7 @@ var require_move = __commonJS({
|
|
|
13556
13556
|
}
|
|
13557
13557
|
}
|
|
13558
13558
|
try {
|
|
13559
|
-
await
|
|
13559
|
+
await fs16.rename(src, dest);
|
|
13560
13560
|
} catch (err) {
|
|
13561
13561
|
if (err.code !== "EXDEV") {
|
|
13562
13562
|
throw err;
|
|
@@ -13581,8 +13581,8 @@ var require_move = __commonJS({
|
|
|
13581
13581
|
var require_move_sync = __commonJS({
|
|
13582
13582
|
"node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
13583
13583
|
"use strict";
|
|
13584
|
-
var
|
|
13585
|
-
var
|
|
13584
|
+
var fs16 = require_graceful_fs();
|
|
13585
|
+
var path15 = require("path");
|
|
13586
13586
|
var copySync = require_copy2().copySync;
|
|
13587
13587
|
var removeSync = require_remove().removeSync;
|
|
13588
13588
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -13592,12 +13592,12 @@ var require_move_sync = __commonJS({
|
|
|
13592
13592
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
13593
13593
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
13594
13594
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
13595
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
13595
|
+
if (!isParentRoot(dest)) mkdirpSync(path15.dirname(dest));
|
|
13596
13596
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
13597
13597
|
}
|
|
13598
13598
|
function isParentRoot(dest) {
|
|
13599
|
-
const parent =
|
|
13600
|
-
const parsedPath =
|
|
13599
|
+
const parent = path15.dirname(dest);
|
|
13600
|
+
const parsedPath = path15.parse(parent);
|
|
13601
13601
|
return parsedPath.root === parent;
|
|
13602
13602
|
}
|
|
13603
13603
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -13606,12 +13606,12 @@ var require_move_sync = __commonJS({
|
|
|
13606
13606
|
removeSync(dest);
|
|
13607
13607
|
return rename(src, dest, overwrite);
|
|
13608
13608
|
}
|
|
13609
|
-
if (
|
|
13609
|
+
if (fs16.existsSync(dest)) throw new Error("dest already exists.");
|
|
13610
13610
|
return rename(src, dest, overwrite);
|
|
13611
13611
|
}
|
|
13612
13612
|
function rename(src, dest, overwrite) {
|
|
13613
13613
|
try {
|
|
13614
|
-
|
|
13614
|
+
fs16.renameSync(src, dest);
|
|
13615
13615
|
} catch (err) {
|
|
13616
13616
|
if (err.code !== "EXDEV") throw err;
|
|
13617
13617
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -16856,8 +16856,8 @@ var require_utils3 = __commonJS({
|
|
|
16856
16856
|
}
|
|
16857
16857
|
return ind;
|
|
16858
16858
|
}
|
|
16859
|
-
function removeDotSegments(
|
|
16860
|
-
let input =
|
|
16859
|
+
function removeDotSegments(path15) {
|
|
16860
|
+
let input = path15;
|
|
16861
16861
|
const output = [];
|
|
16862
16862
|
let nextSlash = -1;
|
|
16863
16863
|
let len = 0;
|
|
@@ -17056,8 +17056,8 @@ var require_schemes = __commonJS({
|
|
|
17056
17056
|
wsComponent.secure = void 0;
|
|
17057
17057
|
}
|
|
17058
17058
|
if (wsComponent.resourceName) {
|
|
17059
|
-
const [
|
|
17060
|
-
wsComponent.path =
|
|
17059
|
+
const [path15, query] = wsComponent.resourceName.split("?");
|
|
17060
|
+
wsComponent.path = path15 && path15 !== "/" ? path15 : void 0;
|
|
17061
17061
|
wsComponent.query = query;
|
|
17062
17062
|
wsComponent.resourceName = void 0;
|
|
17063
17063
|
}
|
|
@@ -20383,12 +20383,12 @@ var require_dist2 = __commonJS({
|
|
|
20383
20383
|
throw new Error(`Unknown format "${name}"`);
|
|
20384
20384
|
return f;
|
|
20385
20385
|
};
|
|
20386
|
-
function addFormats(ajv, list,
|
|
20386
|
+
function addFormats(ajv, list, fs16, exportName) {
|
|
20387
20387
|
var _a2;
|
|
20388
20388
|
var _b;
|
|
20389
20389
|
(_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`;
|
|
20390
20390
|
for (const f of list)
|
|
20391
|
-
ajv.addFormat(f,
|
|
20391
|
+
ajv.addFormat(f, fs16[f]);
|
|
20392
20392
|
}
|
|
20393
20393
|
module2.exports = exports2 = formatsPlugin;
|
|
20394
20394
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -26938,19 +26938,19 @@ var require_esprima = __commonJS({
|
|
|
26938
26938
|
}
|
|
26939
26939
|
return error49;
|
|
26940
26940
|
};
|
|
26941
|
-
ErrorHandler2.prototype.createError = function(index, line,
|
|
26941
|
+
ErrorHandler2.prototype.createError = function(index, line, col2, description) {
|
|
26942
26942
|
var msg = "Line " + line + ": " + description;
|
|
26943
|
-
var error49 = this.constructError(msg,
|
|
26943
|
+
var error49 = this.constructError(msg, col2);
|
|
26944
26944
|
error49.index = index;
|
|
26945
26945
|
error49.lineNumber = line;
|
|
26946
26946
|
error49.description = description;
|
|
26947
26947
|
return error49;
|
|
26948
26948
|
};
|
|
26949
|
-
ErrorHandler2.prototype.throwError = function(index, line,
|
|
26950
|
-
throw this.createError(index, line,
|
|
26949
|
+
ErrorHandler2.prototype.throwError = function(index, line, col2, description) {
|
|
26950
|
+
throw this.createError(index, line, col2, description);
|
|
26951
26951
|
};
|
|
26952
|
-
ErrorHandler2.prototype.tolerateError = function(index, line,
|
|
26953
|
-
var error49 = this.createError(index, line,
|
|
26952
|
+
ErrorHandler2.prototype.tolerateError = function(index, line, col2, description) {
|
|
26953
|
+
var error49 = this.createError(index, line, col2, description);
|
|
26954
26954
|
if (this.tolerant) {
|
|
26955
26955
|
this.recordError(error49);
|
|
26956
26956
|
} else {
|
|
@@ -30990,8 +30990,8 @@ var require_package = __commonJS({
|
|
|
30990
30990
|
var require_main = __commonJS({
|
|
30991
30991
|
"node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
30992
30992
|
"use strict";
|
|
30993
|
-
var
|
|
30994
|
-
var
|
|
30993
|
+
var fs16 = require("fs");
|
|
30994
|
+
var path15 = require("path");
|
|
30995
30995
|
var os7 = require("os");
|
|
30996
30996
|
var crypto2 = require("crypto");
|
|
30997
30997
|
var packageJson = require_package();
|
|
@@ -31099,7 +31099,7 @@ var require_main = __commonJS({
|
|
|
31099
31099
|
if (options && options.path && options.path.length > 0) {
|
|
31100
31100
|
if (Array.isArray(options.path)) {
|
|
31101
31101
|
for (const filepath of options.path) {
|
|
31102
|
-
if (
|
|
31102
|
+
if (fs16.existsSync(filepath)) {
|
|
31103
31103
|
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
31104
31104
|
}
|
|
31105
31105
|
}
|
|
@@ -31107,15 +31107,15 @@ var require_main = __commonJS({
|
|
|
31107
31107
|
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
31108
31108
|
}
|
|
31109
31109
|
} else {
|
|
31110
|
-
possibleVaultPath =
|
|
31110
|
+
possibleVaultPath = path15.resolve(process.cwd(), ".env.vault");
|
|
31111
31111
|
}
|
|
31112
|
-
if (
|
|
31112
|
+
if (fs16.existsSync(possibleVaultPath)) {
|
|
31113
31113
|
return possibleVaultPath;
|
|
31114
31114
|
}
|
|
31115
31115
|
return null;
|
|
31116
31116
|
}
|
|
31117
31117
|
function _resolveHome(envPath) {
|
|
31118
|
-
return envPath[0] === "~" ?
|
|
31118
|
+
return envPath[0] === "~" ? path15.join(os7.homedir(), envPath.slice(1)) : envPath;
|
|
31119
31119
|
}
|
|
31120
31120
|
function _configVault(options) {
|
|
31121
31121
|
const debug = Boolean(options && options.debug);
|
|
@@ -31132,7 +31132,7 @@ var require_main = __commonJS({
|
|
|
31132
31132
|
return { parsed };
|
|
31133
31133
|
}
|
|
31134
31134
|
function configDotenv(options) {
|
|
31135
|
-
const dotenvPath =
|
|
31135
|
+
const dotenvPath = path15.resolve(process.cwd(), ".env");
|
|
31136
31136
|
let encoding = "utf8";
|
|
31137
31137
|
const debug = Boolean(options && options.debug);
|
|
31138
31138
|
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
@@ -31156,13 +31156,13 @@ var require_main = __commonJS({
|
|
|
31156
31156
|
}
|
|
31157
31157
|
let lastError;
|
|
31158
31158
|
const parsedAll = {};
|
|
31159
|
-
for (const
|
|
31159
|
+
for (const path16 of optionPaths) {
|
|
31160
31160
|
try {
|
|
31161
|
-
const parsed = DotenvModule.parse(
|
|
31161
|
+
const parsed = DotenvModule.parse(fs16.readFileSync(path16, { encoding }));
|
|
31162
31162
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
31163
31163
|
} catch (e) {
|
|
31164
31164
|
if (debug) {
|
|
31165
|
-
_debug(`Failed to load ${
|
|
31165
|
+
_debug(`Failed to load ${path16} ${e.message}`);
|
|
31166
31166
|
}
|
|
31167
31167
|
lastError = e;
|
|
31168
31168
|
}
|
|
@@ -31177,7 +31177,7 @@ var require_main = __commonJS({
|
|
|
31177
31177
|
const shortPaths = [];
|
|
31178
31178
|
for (const filePath of optionPaths) {
|
|
31179
31179
|
try {
|
|
31180
|
-
const relative =
|
|
31180
|
+
const relative = path15.relative(process.cwd(), filePath);
|
|
31181
31181
|
shortPaths.push(relative);
|
|
31182
31182
|
} catch (e) {
|
|
31183
31183
|
if (debug) {
|
|
@@ -32764,19 +32764,19 @@ var require_layout_manager = __commonJS({
|
|
|
32764
32764
|
var Cell = require_cell();
|
|
32765
32765
|
var { ColSpanCell, RowSpanCell } = Cell;
|
|
32766
32766
|
(function() {
|
|
32767
|
-
function next(alloc,
|
|
32768
|
-
if (alloc[
|
|
32769
|
-
return next(alloc,
|
|
32767
|
+
function next(alloc, col2) {
|
|
32768
|
+
if (alloc[col2] > 0) {
|
|
32769
|
+
return next(alloc, col2 + 1);
|
|
32770
32770
|
}
|
|
32771
|
-
return
|
|
32771
|
+
return col2;
|
|
32772
32772
|
}
|
|
32773
32773
|
function layoutTable(table) {
|
|
32774
32774
|
let alloc = {};
|
|
32775
32775
|
table.forEach(function(row, rowIndex) {
|
|
32776
|
-
let
|
|
32776
|
+
let col2 = 0;
|
|
32777
32777
|
row.forEach(function(cell) {
|
|
32778
32778
|
cell.y = rowIndex;
|
|
32779
|
-
cell.x = rowIndex ? next(alloc,
|
|
32779
|
+
cell.x = rowIndex ? next(alloc, col2) : col2;
|
|
32780
32780
|
const rowSpan = cell.rowSpan || 1;
|
|
32781
32781
|
const colSpan = cell.colSpan || 1;
|
|
32782
32782
|
if (rowSpan > 1) {
|
|
@@ -32784,7 +32784,7 @@ var require_layout_manager = __commonJS({
|
|
|
32784
32784
|
alloc[cell.x + cs] = rowSpan;
|
|
32785
32785
|
}
|
|
32786
32786
|
}
|
|
32787
|
-
|
|
32787
|
+
col2 = cell.x + colSpan;
|
|
32788
32788
|
});
|
|
32789
32789
|
Object.keys(alloc).forEach((idx) => {
|
|
32790
32790
|
alloc[idx]--;
|
|
@@ -32956,29 +32956,29 @@ var require_layout_manager = __commonJS({
|
|
|
32956
32956
|
for (let k = spanners.length - 1; k >= 0; k--) {
|
|
32957
32957
|
let cell = spanners[k];
|
|
32958
32958
|
let span = cell[colSpan];
|
|
32959
|
-
let
|
|
32960
|
-
let existingWidth = result[
|
|
32961
|
-
let editableCols = typeof vals[
|
|
32959
|
+
let col2 = cell[x];
|
|
32960
|
+
let existingWidth = result[col2];
|
|
32961
|
+
let editableCols = typeof vals[col2] === "number" ? 0 : 1;
|
|
32962
32962
|
if (typeof existingWidth === "number") {
|
|
32963
32963
|
for (let i = 1; i < span; i++) {
|
|
32964
|
-
existingWidth += 1 + result[
|
|
32965
|
-
if (typeof vals[
|
|
32964
|
+
existingWidth += 1 + result[col2 + i];
|
|
32965
|
+
if (typeof vals[col2 + i] !== "number") {
|
|
32966
32966
|
editableCols++;
|
|
32967
32967
|
}
|
|
32968
32968
|
}
|
|
32969
32969
|
} else {
|
|
32970
32970
|
existingWidth = desiredWidth === "desiredWidth" ? cell.desiredWidth - 1 : 1;
|
|
32971
|
-
if (!auto[
|
|
32972
|
-
auto[
|
|
32971
|
+
if (!auto[col2] || auto[col2] < existingWidth) {
|
|
32972
|
+
auto[col2] = existingWidth;
|
|
32973
32973
|
}
|
|
32974
32974
|
}
|
|
32975
32975
|
if (cell[desiredWidth] > existingWidth) {
|
|
32976
32976
|
let i = 0;
|
|
32977
32977
|
while (editableCols > 0 && cell[desiredWidth] > existingWidth) {
|
|
32978
|
-
if (typeof vals[
|
|
32978
|
+
if (typeof vals[col2 + i] !== "number") {
|
|
32979
32979
|
let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols);
|
|
32980
32980
|
existingWidth += dif;
|
|
32981
|
-
result[
|
|
32981
|
+
result[col2 + i] += dif;
|
|
32982
32982
|
editableCols--;
|
|
32983
32983
|
}
|
|
32984
32984
|
i++;
|
|
@@ -35788,6 +35788,9 @@ var Listr = class {
|
|
|
35788
35788
|
}
|
|
35789
35789
|
};
|
|
35790
35790
|
|
|
35791
|
+
// src/commands/install.ts
|
|
35792
|
+
var import_fs_extra11 = __toESM(require_lib2(), 1);
|
|
35793
|
+
|
|
35791
35794
|
// src/core/context.ts
|
|
35792
35795
|
var import_os2 = __toESM(require("os"), 1);
|
|
35793
35796
|
var import_path = __toESM(require("path"), 1);
|
|
@@ -35812,12 +35815,12 @@ var disallowedKeys = /* @__PURE__ */ new Set([
|
|
|
35812
35815
|
"constructor"
|
|
35813
35816
|
]);
|
|
35814
35817
|
var digits = new Set("0123456789");
|
|
35815
|
-
function getPathSegments(
|
|
35818
|
+
function getPathSegments(path15) {
|
|
35816
35819
|
const parts = [];
|
|
35817
35820
|
let currentSegment = "";
|
|
35818
35821
|
let currentPart = "start";
|
|
35819
35822
|
let isIgnoring = false;
|
|
35820
|
-
for (const character of
|
|
35823
|
+
for (const character of path15) {
|
|
35821
35824
|
switch (character) {
|
|
35822
35825
|
case "\\": {
|
|
35823
35826
|
if (currentPart === "index") {
|
|
@@ -35939,11 +35942,11 @@ function assertNotStringIndex(object2, key) {
|
|
|
35939
35942
|
throw new Error("Cannot use string index");
|
|
35940
35943
|
}
|
|
35941
35944
|
}
|
|
35942
|
-
function getProperty(object2,
|
|
35943
|
-
if (!isObject(object2) || typeof
|
|
35945
|
+
function getProperty(object2, path15, value) {
|
|
35946
|
+
if (!isObject(object2) || typeof path15 !== "string") {
|
|
35944
35947
|
return value === void 0 ? object2 : value;
|
|
35945
35948
|
}
|
|
35946
|
-
const pathArray = getPathSegments(
|
|
35949
|
+
const pathArray = getPathSegments(path15);
|
|
35947
35950
|
if (pathArray.length === 0) {
|
|
35948
35951
|
return value;
|
|
35949
35952
|
}
|
|
@@ -35963,12 +35966,12 @@ function getProperty(object2, path14, value) {
|
|
|
35963
35966
|
}
|
|
35964
35967
|
return object2 === void 0 ? value : object2;
|
|
35965
35968
|
}
|
|
35966
|
-
function setProperty(object2,
|
|
35967
|
-
if (!isObject(object2) || typeof
|
|
35969
|
+
function setProperty(object2, path15, value) {
|
|
35970
|
+
if (!isObject(object2) || typeof path15 !== "string") {
|
|
35968
35971
|
return object2;
|
|
35969
35972
|
}
|
|
35970
35973
|
const root = object2;
|
|
35971
|
-
const pathArray = getPathSegments(
|
|
35974
|
+
const pathArray = getPathSegments(path15);
|
|
35972
35975
|
for (let index = 0; index < pathArray.length; index++) {
|
|
35973
35976
|
const key = pathArray[index];
|
|
35974
35977
|
assertNotStringIndex(object2, key);
|
|
@@ -35981,11 +35984,11 @@ function setProperty(object2, path14, value) {
|
|
|
35981
35984
|
}
|
|
35982
35985
|
return root;
|
|
35983
35986
|
}
|
|
35984
|
-
function deleteProperty(object2,
|
|
35985
|
-
if (!isObject(object2) || typeof
|
|
35987
|
+
function deleteProperty(object2, path15) {
|
|
35988
|
+
if (!isObject(object2) || typeof path15 !== "string") {
|
|
35986
35989
|
return false;
|
|
35987
35990
|
}
|
|
35988
|
-
const pathArray = getPathSegments(
|
|
35991
|
+
const pathArray = getPathSegments(path15);
|
|
35989
35992
|
for (let index = 0; index < pathArray.length; index++) {
|
|
35990
35993
|
const key = pathArray[index];
|
|
35991
35994
|
assertNotStringIndex(object2, key);
|
|
@@ -35999,11 +36002,11 @@ function deleteProperty(object2, path14) {
|
|
|
35999
36002
|
}
|
|
36000
36003
|
}
|
|
36001
36004
|
}
|
|
36002
|
-
function hasProperty(object2,
|
|
36003
|
-
if (!isObject(object2) || typeof
|
|
36005
|
+
function hasProperty(object2, path15) {
|
|
36006
|
+
if (!isObject(object2) || typeof path15 !== "string") {
|
|
36004
36007
|
return false;
|
|
36005
36008
|
}
|
|
36006
|
-
const pathArray = getPathSegments(
|
|
36009
|
+
const pathArray = getPathSegments(path15);
|
|
36007
36010
|
if (pathArray.length === 0) {
|
|
36008
36011
|
return false;
|
|
36009
36012
|
}
|
|
@@ -37043,8 +37046,8 @@ function getCandidatePaths() {
|
|
|
37043
37046
|
const appData = process.env.APPDATA;
|
|
37044
37047
|
const isWindows3 = process.platform === "win32";
|
|
37045
37048
|
const paths = [
|
|
37046
|
-
{ label: "
|
|
37047
|
-
{ label: "
|
|
37049
|
+
{ label: "~/.claude (hooks + skills)", path: import_path.default.join(home, ".claude") },
|
|
37050
|
+
{ label: "~/.agents/skills", path: import_path.default.join(home, ".agents", "skills") }
|
|
37048
37051
|
];
|
|
37049
37052
|
if (isWindows3 && appData) {
|
|
37050
37053
|
paths.push({ label: "Claude (AppData)", path: import_path.default.join(appData, "Claude") });
|
|
@@ -37214,8 +37217,8 @@ function detectAdapter(systemRoot) {
|
|
|
37214
37217
|
// src/core/diff.ts
|
|
37215
37218
|
var IGNORED_ITEMS = /* @__PURE__ */ new Set(["__pycache__", ".DS_Store", "Thumbs.db", ".gitkeep", "node_modules"]);
|
|
37216
37219
|
var PruneModeReadError = class extends Error {
|
|
37217
|
-
constructor(
|
|
37218
|
-
super(`Cannot read ${
|
|
37220
|
+
constructor(path15) {
|
|
37221
|
+
super(`Cannot read ${path15} in prune mode \u2014 aborting to prevent accidental deletion`);
|
|
37219
37222
|
this.name = "PruneModeReadError";
|
|
37220
37223
|
}
|
|
37221
37224
|
};
|
|
@@ -40342,7 +40345,42 @@ async function cleanupBackup(backup) {
|
|
|
40342
40345
|
|
|
40343
40346
|
// src/core/sync-executor.ts
|
|
40344
40347
|
var syncedMcpAgents = /* @__PURE__ */ new Set();
|
|
40345
|
-
|
|
40348
|
+
function extractHookCommandPath(command) {
|
|
40349
|
+
const quoted = command.match(/"([^"]+)"/);
|
|
40350
|
+
if (quoted?.[1]) return quoted[1];
|
|
40351
|
+
const singleQuoted = command.match(/'([^']+)'/);
|
|
40352
|
+
if (singleQuoted?.[1]) return singleQuoted[1];
|
|
40353
|
+
const bare = command.trim().split(/\s+/).slice(1).join(" ").trim();
|
|
40354
|
+
return bare || null;
|
|
40355
|
+
}
|
|
40356
|
+
async function filterHooksByInstalledScripts(hooksConfig) {
|
|
40357
|
+
if (!hooksConfig || typeof hooksConfig !== "object" || !hooksConfig.hooks) {
|
|
40358
|
+
return hooksConfig;
|
|
40359
|
+
}
|
|
40360
|
+
for (const [event, wrappers] of Object.entries(hooksConfig.hooks)) {
|
|
40361
|
+
if (!Array.isArray(wrappers)) continue;
|
|
40362
|
+
const keptWrappers = [];
|
|
40363
|
+
for (const wrapper of wrappers) {
|
|
40364
|
+
if (!wrapper || !Array.isArray(wrapper.hooks)) continue;
|
|
40365
|
+
const keptInner = [];
|
|
40366
|
+
for (const inner of wrapper.hooks) {
|
|
40367
|
+
const command = inner?.command;
|
|
40368
|
+
if (typeof command !== "string" || !command.trim()) continue;
|
|
40369
|
+
const scriptPath = extractHookCommandPath(command);
|
|
40370
|
+
if (!scriptPath) continue;
|
|
40371
|
+
if (await import_fs_extra8.default.pathExists(scriptPath)) {
|
|
40372
|
+
keptInner.push(inner);
|
|
40373
|
+
}
|
|
40374
|
+
}
|
|
40375
|
+
if (keptInner.length > 0) {
|
|
40376
|
+
keptWrappers.push({ ...wrapper, hooks: keptInner });
|
|
40377
|
+
}
|
|
40378
|
+
}
|
|
40379
|
+
hooksConfig.hooks[event] = keptWrappers;
|
|
40380
|
+
}
|
|
40381
|
+
return hooksConfig;
|
|
40382
|
+
}
|
|
40383
|
+
async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, isDryRun = false, selectedMcpServers, options) {
|
|
40346
40384
|
const normalizedRoot = import_path8.default.normalize(systemRoot).replace(/\\/g, "/");
|
|
40347
40385
|
const isAgentsSkills = normalizedRoot.includes(".agents/skills");
|
|
40348
40386
|
const isClaude = systemRoot.includes(".claude") || systemRoot.includes("Claude");
|
|
@@ -40355,7 +40393,7 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
|
|
|
40355
40393
|
const backups = [];
|
|
40356
40394
|
try {
|
|
40357
40395
|
const agent = detectAgent(systemRoot);
|
|
40358
|
-
if (agent && actionType === "sync" && !syncedMcpAgents.has(agent)) {
|
|
40396
|
+
if (agent && actionType === "sync" && !syncedMcpAgents.has(agent) && !options?.skipMcp) {
|
|
40359
40397
|
const coreConfig = loadCanonicalMcpConfig(repoRoot);
|
|
40360
40398
|
const mcpToSync = { mcpServers: { ...coreConfig.mcpServers } };
|
|
40361
40399
|
if (selectedMcpServers && selectedMcpServers.length > 0) {
|
|
@@ -40380,6 +40418,9 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
|
|
|
40380
40418
|
const cat = changeSet[category];
|
|
40381
40419
|
itemsToProcess.push(...cat.missing);
|
|
40382
40420
|
itemsToProcess.push(...cat.outdated);
|
|
40421
|
+
if (options?.force) {
|
|
40422
|
+
itemsToProcess.push(...cat.drifted);
|
|
40423
|
+
}
|
|
40383
40424
|
if (mode === "prune") {
|
|
40384
40425
|
for (const itemToDelete of cat.drifted || []) {
|
|
40385
40426
|
const dest = import_path8.default.join(systemRoot, category, itemToDelete);
|
|
@@ -40403,9 +40444,6 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
|
|
|
40403
40444
|
src = import_path8.default.join(repoRoot, "config", "settings.json");
|
|
40404
40445
|
dest = import_path8.default.join(systemRoot, "settings.json");
|
|
40405
40446
|
const agent2 = detectAgent(systemRoot);
|
|
40406
|
-
if (agent2) {
|
|
40407
|
-
continue;
|
|
40408
|
-
}
|
|
40409
40447
|
console.log(kleur_default.gray(` --> config/settings.json`));
|
|
40410
40448
|
if (!isDryRun && await import_fs_extra8.default.pathExists(dest)) {
|
|
40411
40449
|
backups.push(await createBackup(dest));
|
|
@@ -40419,7 +40457,7 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
|
|
|
40419
40457
|
const hooksSrc = import_path8.default.join(repoRoot, "config", "hooks.json");
|
|
40420
40458
|
if (await import_fs_extra8.default.pathExists(hooksSrc)) {
|
|
40421
40459
|
const hooksRaw = await import_fs_extra8.default.readJson(hooksSrc);
|
|
40422
|
-
const hooksAdapted = adapter.adaptHooksConfig(hooksRaw);
|
|
40460
|
+
const hooksAdapted = await filterHooksByInstalledScripts(adapter.adaptHooksConfig(hooksRaw));
|
|
40423
40461
|
if (hooksAdapted.hooks) {
|
|
40424
40462
|
finalRepoConfig.hooks = hooksAdapted.hooks;
|
|
40425
40463
|
if (!isDryRun) console.log(kleur_default.dim(` (Injected hooks)`));
|
|
@@ -40676,6 +40714,82 @@ function resolvePkgRoot() {
|
|
|
40676
40714
|
}
|
|
40677
40715
|
var PKG_ROOT = resolvePkgRoot();
|
|
40678
40716
|
var PROJECT_SKILLS_DIR = import_path10.default.join(PKG_ROOT, "project-skills");
|
|
40717
|
+
var MCP_CORE_CONFIG_PATH = import_path10.default.join(PKG_ROOT, "config", "mcp_servers.json");
|
|
40718
|
+
var syncedProjectMcpRoots = /* @__PURE__ */ new Set();
|
|
40719
|
+
function resolveEnvVars(value) {
|
|
40720
|
+
if (typeof value !== "string") return value;
|
|
40721
|
+
return value.replace(/\$\{([A-Z0-9_]+)\}/g, (_m, name) => process.env[name] || "");
|
|
40722
|
+
}
|
|
40723
|
+
function hasClaudeCli() {
|
|
40724
|
+
const r = (0, import_child_process2.spawnSync)("claude", ["--version"], { stdio: "pipe" });
|
|
40725
|
+
return r.status === 0;
|
|
40726
|
+
}
|
|
40727
|
+
function buildProjectMcpArgs(name, server) {
|
|
40728
|
+
const transport = server.type || (server.url?.includes("/sse") ? "sse" : "http");
|
|
40729
|
+
if (server.command) {
|
|
40730
|
+
const args = ["mcp", "add", "-s", "project"];
|
|
40731
|
+
if (server.env && typeof server.env === "object") {
|
|
40732
|
+
for (const [k, v] of Object.entries(server.env)) {
|
|
40733
|
+
args.push("-e", `${k}=${resolveEnvVars(String(v))}`);
|
|
40734
|
+
}
|
|
40735
|
+
}
|
|
40736
|
+
args.push(name, "--", server.command, ...server.args || []);
|
|
40737
|
+
return args;
|
|
40738
|
+
}
|
|
40739
|
+
if (server.url || server.serverUrl) {
|
|
40740
|
+
const url2 = server.url || server.serverUrl;
|
|
40741
|
+
const args = ["mcp", "add", "-s", "project", "--transport", transport, name, url2];
|
|
40742
|
+
if (server.headers && typeof server.headers === "object") {
|
|
40743
|
+
for (const [k, v] of Object.entries(server.headers)) {
|
|
40744
|
+
args.push("--header", `${k}: ${resolveEnvVars(String(v))}`);
|
|
40745
|
+
}
|
|
40746
|
+
}
|
|
40747
|
+
return args;
|
|
40748
|
+
}
|
|
40749
|
+
return null;
|
|
40750
|
+
}
|
|
40751
|
+
async function syncProjectMcpServers(projectRoot) {
|
|
40752
|
+
if (syncedProjectMcpRoots.has(projectRoot)) return;
|
|
40753
|
+
syncedProjectMcpRoots.add(projectRoot);
|
|
40754
|
+
if (!await import_fs_extra10.default.pathExists(MCP_CORE_CONFIG_PATH)) return;
|
|
40755
|
+
console.log(kleur_default.bold("\n\u2500\u2500 Installing MCP (project scope) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
40756
|
+
if (!hasClaudeCli()) {
|
|
40757
|
+
console.log(kleur_default.yellow(" \u26A0 Claude CLI not found; skipping project-scope MCP registration."));
|
|
40758
|
+
return;
|
|
40759
|
+
}
|
|
40760
|
+
const mcpConfig = await import_fs_extra10.default.readJson(MCP_CORE_CONFIG_PATH);
|
|
40761
|
+
const servers = Object.entries(mcpConfig?.mcpServers ?? {});
|
|
40762
|
+
if (servers.length === 0) {
|
|
40763
|
+
console.log(kleur_default.dim(" \u2139 No core MCP servers configured."));
|
|
40764
|
+
return;
|
|
40765
|
+
}
|
|
40766
|
+
let added = 0;
|
|
40767
|
+
let existing = 0;
|
|
40768
|
+
let failed = 0;
|
|
40769
|
+
for (const [name, server] of servers) {
|
|
40770
|
+
const args = buildProjectMcpArgs(name, server);
|
|
40771
|
+
if (!args) continue;
|
|
40772
|
+
const r = (0, import_child_process2.spawnSync)("claude", args, {
|
|
40773
|
+
cwd: projectRoot,
|
|
40774
|
+
encoding: "utf8",
|
|
40775
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
40776
|
+
});
|
|
40777
|
+
if (r.status === 0) {
|
|
40778
|
+
added++;
|
|
40779
|
+
console.log(`${kleur_default.green(" \u2713")} ${name}`);
|
|
40780
|
+
continue;
|
|
40781
|
+
}
|
|
40782
|
+
const stderr = `${r.stderr || ""}`.toLowerCase();
|
|
40783
|
+
if (stderr.includes("already exists") || stderr.includes("already configured")) {
|
|
40784
|
+
existing++;
|
|
40785
|
+
console.log(kleur_default.dim(` \u2713 ${name} (already configured)`));
|
|
40786
|
+
continue;
|
|
40787
|
+
}
|
|
40788
|
+
failed++;
|
|
40789
|
+
console.log(kleur_default.red(` \u2717 ${name} (${(r.stderr || r.stdout || "failed").toString().trim()})`));
|
|
40790
|
+
}
|
|
40791
|
+
console.log(kleur_default.dim(` \u21B3 MCP project-scope result: ${added} added, ${existing} existing, ${failed} failed`));
|
|
40792
|
+
}
|
|
40679
40793
|
async function getAvailableProjectSkills() {
|
|
40680
40794
|
if (!await import_fs_extra10.default.pathExists(PROJECT_SKILLS_DIR)) {
|
|
40681
40795
|
return [];
|
|
@@ -40763,6 +40877,7 @@ async function installProjectSkill(toolName, projectRootOverride) {
|
|
|
40763
40877
|
await import_fs_extra10.default.writeFile(targetSettingsPath, JSON.stringify(mergedSettings, null, 2) + "\n");
|
|
40764
40878
|
console.log(`${kleur_default.green(" \u2713")} settings.json (hooks merged)`);
|
|
40765
40879
|
}
|
|
40880
|
+
await syncProjectMcpServers(projectRoot);
|
|
40766
40881
|
if (await import_fs_extra10.default.pathExists(skillSkillsDir)) {
|
|
40767
40882
|
console.log(kleur_default.bold("\n\u2500\u2500 Installing Skills \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
40768
40883
|
const targetSkillsDir = import_path10.default.join(claudeDir, "skills");
|
|
@@ -40899,6 +41014,8 @@ function createInstallProjectCommand() {
|
|
|
40899
41014
|
}
|
|
40900
41015
|
|
|
40901
41016
|
// src/commands/install.ts
|
|
41017
|
+
var import_child_process3 = require("child_process");
|
|
41018
|
+
var import_child_process4 = require("child_process");
|
|
40902
41019
|
function renderPlanTable(allChanges) {
|
|
40903
41020
|
const Table = require_cli_table3();
|
|
40904
41021
|
const table = new Table({
|
|
@@ -40942,22 +41059,275 @@ async function renderSummaryCard(allChanges, totalCount, allSkipped, isDryRun) {
|
|
|
40942
41059
|
borderColor: hasDrift ? "yellow" : "green"
|
|
40943
41060
|
}) + "\n");
|
|
40944
41061
|
}
|
|
41062
|
+
var BEADS_HOOK_PATTERN = /^beads-/;
|
|
41063
|
+
function filterBeadsFromChangeSet(changeSet) {
|
|
41064
|
+
return {
|
|
41065
|
+
...changeSet,
|
|
41066
|
+
hooks: {
|
|
41067
|
+
...changeSet.hooks,
|
|
41068
|
+
missing: changeSet.hooks.missing.filter((h) => !BEADS_HOOK_PATTERN.test(h)),
|
|
41069
|
+
outdated: changeSet.hooks.outdated.filter((h) => !BEADS_HOOK_PATTERN.test(h)),
|
|
41070
|
+
drifted: changeSet.hooks.drifted.filter((h) => !BEADS_HOOK_PATTERN.test(h)),
|
|
41071
|
+
total: changeSet.hooks.total
|
|
41072
|
+
}
|
|
41073
|
+
};
|
|
41074
|
+
}
|
|
41075
|
+
function isBeadsInstalled() {
|
|
41076
|
+
try {
|
|
41077
|
+
(0, import_child_process3.execSync)("bd --version", { stdio: "ignore" });
|
|
41078
|
+
return true;
|
|
41079
|
+
} catch {
|
|
41080
|
+
return false;
|
|
41081
|
+
}
|
|
41082
|
+
}
|
|
41083
|
+
function isDoltInstalled() {
|
|
41084
|
+
try {
|
|
41085
|
+
(0, import_child_process3.execSync)("dolt version", { stdio: "ignore" });
|
|
41086
|
+
return true;
|
|
41087
|
+
} catch {
|
|
41088
|
+
return false;
|
|
41089
|
+
}
|
|
41090
|
+
}
|
|
41091
|
+
async function needsSettingsSync(repoRoot, target) {
|
|
41092
|
+
const normalizedTarget = target.replace(/\\/g, "/").toLowerCase();
|
|
41093
|
+
if (normalizedTarget.includes(".agents/skills")) return false;
|
|
41094
|
+
const hooksTemplatePath = import_path11.default.join(repoRoot, "config", "hooks.json");
|
|
41095
|
+
if (!await import_fs_extra11.default.pathExists(hooksTemplatePath)) return false;
|
|
41096
|
+
const requiredEvents = Object.keys((await import_fs_extra11.default.readJson(hooksTemplatePath)).hooks ?? {});
|
|
41097
|
+
if (requiredEvents.length === 0) return false;
|
|
41098
|
+
const targetSettingsPath = import_path11.default.join(target, "settings.json");
|
|
41099
|
+
if (!await import_fs_extra11.default.pathExists(targetSettingsPath)) return true;
|
|
41100
|
+
let settings = {};
|
|
41101
|
+
try {
|
|
41102
|
+
settings = await import_fs_extra11.default.readJson(targetSettingsPath);
|
|
41103
|
+
} catch {
|
|
41104
|
+
return true;
|
|
41105
|
+
}
|
|
41106
|
+
const targetHooks = settings?.hooks;
|
|
41107
|
+
if (!targetHooks || typeof targetHooks !== "object" || Object.keys(targetHooks).length === 0) {
|
|
41108
|
+
return true;
|
|
41109
|
+
}
|
|
41110
|
+
return requiredEvents.some((event) => !(event in targetHooks));
|
|
41111
|
+
}
|
|
41112
|
+
async function runGlobalInstall(flags, installOpts = {}) {
|
|
41113
|
+
const { dryRun, yes, noMcp, force } = flags;
|
|
41114
|
+
const effectiveYes = yes || process.argv.includes("--yes") || process.argv.includes("-y");
|
|
41115
|
+
const repoRoot = await findRepoRoot();
|
|
41116
|
+
const ctx = await getContext({ selector: "all", createMissingDirs: !dryRun });
|
|
41117
|
+
const { targets, syncMode } = ctx;
|
|
41118
|
+
let skipBeads = installOpts.excludeBeads ?? false;
|
|
41119
|
+
if (installOpts.checkBeads && !skipBeads) {
|
|
41120
|
+
console.log(t.bold("\n \u2699 beads + dolt (workflow enforcement backend)"));
|
|
41121
|
+
console.log(t.muted(" beads is a git-backed issue tracker; dolt is its SQL+git storage backend."));
|
|
41122
|
+
console.log(t.muted(" Without them the gate hooks install but provide no enforcement.\n"));
|
|
41123
|
+
const beadsOk = isBeadsInstalled();
|
|
41124
|
+
const doltOk = isDoltInstalled();
|
|
41125
|
+
if (beadsOk && doltOk) {
|
|
41126
|
+
console.log(t.success(" \u2713 beads + dolt already installed\n"));
|
|
41127
|
+
} else {
|
|
41128
|
+
const missing = [!beadsOk && "bd", !doltOk && "dolt"].filter(Boolean).join(", ");
|
|
41129
|
+
let doInstall = effectiveYes;
|
|
41130
|
+
if (!effectiveYes) {
|
|
41131
|
+
const { install } = await (0, import_prompts2.default)({
|
|
41132
|
+
type: "confirm",
|
|
41133
|
+
name: "install",
|
|
41134
|
+
message: `Install beads + dolt? (${missing} not found) \u2014 required for workflow enforcement hooks`,
|
|
41135
|
+
initial: true
|
|
41136
|
+
});
|
|
41137
|
+
doInstall = install;
|
|
41138
|
+
}
|
|
41139
|
+
if (doInstall) {
|
|
41140
|
+
if (!beadsOk) {
|
|
41141
|
+
console.log(t.muted("\n Installing @beads/bd..."));
|
|
41142
|
+
(0, import_child_process4.spawnSync)("npm", ["install", "-g", "@beads/bd"], { stdio: "inherit" });
|
|
41143
|
+
console.log(t.success(" \u2713 bd installed"));
|
|
41144
|
+
}
|
|
41145
|
+
if (!doltOk) {
|
|
41146
|
+
console.log(t.muted("\n Installing dolt..."));
|
|
41147
|
+
if (process.platform === "darwin") {
|
|
41148
|
+
(0, import_child_process4.spawnSync)("brew", ["install", "dolt"], { stdio: "inherit" });
|
|
41149
|
+
} else {
|
|
41150
|
+
(0, import_child_process4.spawnSync)("sudo", [
|
|
41151
|
+
"bash",
|
|
41152
|
+
"-c",
|
|
41153
|
+
"curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | bash"
|
|
41154
|
+
], { stdio: "inherit" });
|
|
41155
|
+
}
|
|
41156
|
+
console.log(t.success(" \u2713 dolt installed"));
|
|
41157
|
+
}
|
|
41158
|
+
console.log("");
|
|
41159
|
+
} else {
|
|
41160
|
+
console.log(t.muted(" \u2139 Skipping beads gate hooks. Re-run xtrm install all after installing beads+dolt.\n"));
|
|
41161
|
+
skipBeads = true;
|
|
41162
|
+
}
|
|
41163
|
+
}
|
|
41164
|
+
}
|
|
41165
|
+
const diffTasks = new Listr(
|
|
41166
|
+
targets.map((target) => ({
|
|
41167
|
+
title: import_path11.default.basename(target),
|
|
41168
|
+
task: async (listCtx, task) => {
|
|
41169
|
+
try {
|
|
41170
|
+
let changeSet = await calculateDiff(repoRoot, target, false);
|
|
41171
|
+
if (skipBeads) {
|
|
41172
|
+
changeSet = filterBeadsFromChangeSet(changeSet);
|
|
41173
|
+
}
|
|
41174
|
+
const hasSettingsDiff = changeSet.config.missing.includes("settings.json") || changeSet.config.outdated.includes("settings.json") || changeSet.config.drifted.includes("settings.json");
|
|
41175
|
+
if (!hasSettingsDiff && await needsSettingsSync(repoRoot, target)) {
|
|
41176
|
+
changeSet.config.outdated.push("settings.json");
|
|
41177
|
+
}
|
|
41178
|
+
const totalChanges = Object.values(changeSet).reduce(
|
|
41179
|
+
(sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
|
|
41180
|
+
0
|
|
41181
|
+
);
|
|
41182
|
+
task.title = `${import_path11.default.basename(target)}${t.muted(` \u2014 ${totalChanges} change${totalChanges !== 1 ? "s" : ""}`)}`;
|
|
41183
|
+
if (totalChanges > 0) {
|
|
41184
|
+
listCtx.allChanges.push({ target, changeSet, totalChanges, skippedDrifted: [] });
|
|
41185
|
+
}
|
|
41186
|
+
} catch (err) {
|
|
41187
|
+
if (err instanceof PruneModeReadError) {
|
|
41188
|
+
task.title = `${import_path11.default.basename(target)} ${kleur_default.red("(skipped \u2014 cannot read in prune mode)")}`;
|
|
41189
|
+
} else {
|
|
41190
|
+
throw err;
|
|
41191
|
+
}
|
|
41192
|
+
}
|
|
41193
|
+
}
|
|
41194
|
+
})),
|
|
41195
|
+
{ concurrent: true, exitOnError: false }
|
|
41196
|
+
);
|
|
41197
|
+
const diffCtx = await diffTasks.run({ allChanges: [] });
|
|
41198
|
+
const allChanges = diffCtx.allChanges;
|
|
41199
|
+
if (allChanges.length === 0) {
|
|
41200
|
+
console.log("\n" + t.boldGreen("\u2713 Files are up-to-date") + "\n");
|
|
41201
|
+
return;
|
|
41202
|
+
}
|
|
41203
|
+
renderPlanTable(allChanges);
|
|
41204
|
+
if (dryRun) {
|
|
41205
|
+
console.log(t.accent("\u{1F4A1} Dry run \u2014 no changes written\n"));
|
|
41206
|
+
return;
|
|
41207
|
+
}
|
|
41208
|
+
if (!effectiveYes) {
|
|
41209
|
+
const totalChangesCount = allChanges.reduce((s, c) => s + c.totalChanges, 0);
|
|
41210
|
+
const { confirm } = await (0, import_prompts2.default)({
|
|
41211
|
+
type: "confirm",
|
|
41212
|
+
name: "confirm",
|
|
41213
|
+
message: `Proceed with install (${totalChangesCount} total changes)?`,
|
|
41214
|
+
initial: true
|
|
41215
|
+
});
|
|
41216
|
+
if (!confirm) {
|
|
41217
|
+
console.log(t.muted(" Install cancelled.\n"));
|
|
41218
|
+
return;
|
|
41219
|
+
}
|
|
41220
|
+
}
|
|
41221
|
+
let totalCount = 0;
|
|
41222
|
+
for (const { target, changeSet, skippedDrifted } of allChanges) {
|
|
41223
|
+
console.log(t.bold(`
|
|
41224
|
+
${sym.arrow} ${import_path11.default.basename(target)}`));
|
|
41225
|
+
const count = await executeSync(repoRoot, target, changeSet, syncMode, "sync", dryRun, void 0, {
|
|
41226
|
+
skipMcp: noMcp,
|
|
41227
|
+
force
|
|
41228
|
+
});
|
|
41229
|
+
totalCount += count;
|
|
41230
|
+
for (const [category, cat] of Object.entries(changeSet)) {
|
|
41231
|
+
const c = cat;
|
|
41232
|
+
if (c.drifted.length > 0 && !force) {
|
|
41233
|
+
skippedDrifted.push(...c.drifted.map((item) => `${category}/${item}`));
|
|
41234
|
+
}
|
|
41235
|
+
}
|
|
41236
|
+
console.log(t.success(` ${sym.ok} ${count} item${count !== 1 ? "s" : ""} installed`));
|
|
41237
|
+
}
|
|
41238
|
+
const allSkipped = allChanges.flatMap((c) => c.skippedDrifted);
|
|
41239
|
+
await renderSummaryCard(allChanges, totalCount, allSkipped, dryRun);
|
|
41240
|
+
}
|
|
41241
|
+
function createInstallAllCommand() {
|
|
41242
|
+
return new Command("all").description("Install everything: skills, all hooks (including beads gates), and MCP servers").option("--dry-run", "Preview changes without making any modifications", false).option("-y, --yes", "Skip confirmation prompts", false).option("--no-mcp", "Skip MCP server registration", false).option("--force", "Overwrite locally drifted files", false).action(async (opts) => {
|
|
41243
|
+
await runGlobalInstall(
|
|
41244
|
+
{ dryRun: opts.dryRun, yes: opts.yes, noMcp: opts.mcp === false, force: opts.force },
|
|
41245
|
+
{ checkBeads: true }
|
|
41246
|
+
);
|
|
41247
|
+
});
|
|
41248
|
+
}
|
|
41249
|
+
function createInstallBasicCommand() {
|
|
41250
|
+
return new Command("basic").description("Install skills, general hooks, and MCP servers (no beads gate hooks)").option("--dry-run", "Preview changes without making any modifications", false).option("-y, --yes", "Skip confirmation prompts", false).option("--no-mcp", "Skip MCP server registration", false).option("--force", "Overwrite locally drifted files", false).action(async (opts) => {
|
|
41251
|
+
await runGlobalInstall(
|
|
41252
|
+
{ dryRun: opts.dryRun, yes: opts.yes, noMcp: opts.mcp === false, force: opts.force },
|
|
41253
|
+
{ excludeBeads: true }
|
|
41254
|
+
);
|
|
41255
|
+
});
|
|
41256
|
+
}
|
|
40945
41257
|
function createInstallCommand() {
|
|
40946
41258
|
const installCmd = new Command("install").description("Install Claude Code tools (skills, hooks, MCP servers)").argument("[target-selector]", 'Install targets: use "*" or "all" to skip interactive target selection').option("--dry-run", "Preview changes without making any modifications", false).option("-y, --yes", "Skip confirmation prompts", false).option("--prune", "Remove items not in the canonical repository", false).option("--backport", "Backport drifted local changes back to the repository", false).action(async (targetSelector, opts) => {
|
|
40947
41259
|
const { dryRun, yes, prune, backport } = opts;
|
|
40948
|
-
const
|
|
41260
|
+
const effectiveYes = yes || process.argv.includes("--yes") || process.argv.includes("-y");
|
|
41261
|
+
const syncType = backport ? "backport" : "sync";
|
|
41262
|
+
const actionLabel = backport ? "backport" : "install";
|
|
40949
41263
|
const repoRoot = await findRepoRoot();
|
|
40950
41264
|
const ctx = await getContext({
|
|
40951
41265
|
selector: targetSelector,
|
|
40952
41266
|
createMissingDirs: !dryRun
|
|
40953
41267
|
});
|
|
40954
41268
|
const { targets, syncMode } = ctx;
|
|
41269
|
+
let skipBeads = false;
|
|
41270
|
+
if (!backport) {
|
|
41271
|
+
console.log(t.bold("\n \u2699 beads + dolt (workflow enforcement backend)"));
|
|
41272
|
+
console.log(t.muted(" beads is a git-backed issue tracker; dolt is its SQL+git storage backend."));
|
|
41273
|
+
console.log(t.muted(" Without them the gate hooks install but provide no enforcement.\n"));
|
|
41274
|
+
const beadsOk = isBeadsInstalled();
|
|
41275
|
+
const doltOk = isDoltInstalled();
|
|
41276
|
+
if (beadsOk && doltOk) {
|
|
41277
|
+
console.log(t.success(" \u2713 beads + dolt already installed\n"));
|
|
41278
|
+
} else {
|
|
41279
|
+
const missing = [!beadsOk && "bd", !doltOk && "dolt"].filter(Boolean).join(", ");
|
|
41280
|
+
let doInstall = effectiveYes;
|
|
41281
|
+
if (!effectiveYes) {
|
|
41282
|
+
const { install } = await (0, import_prompts2.default)({
|
|
41283
|
+
type: "confirm",
|
|
41284
|
+
name: "install",
|
|
41285
|
+
message: `Install beads + dolt? (${missing} not found) \u2014 required for workflow enforcement hooks`,
|
|
41286
|
+
initial: true
|
|
41287
|
+
});
|
|
41288
|
+
doInstall = install;
|
|
41289
|
+
}
|
|
41290
|
+
if (doInstall) {
|
|
41291
|
+
if (!beadsOk) {
|
|
41292
|
+
console.log(t.muted("\n Installing @beads/bd..."));
|
|
41293
|
+
(0, import_child_process4.spawnSync)("npm", ["install", "-g", "@beads/bd"], { stdio: "inherit" });
|
|
41294
|
+
console.log(t.success(" \u2713 bd installed"));
|
|
41295
|
+
}
|
|
41296
|
+
if (!doltOk) {
|
|
41297
|
+
console.log(t.muted("\n Installing dolt..."));
|
|
41298
|
+
if (process.platform === "darwin") {
|
|
41299
|
+
(0, import_child_process4.spawnSync)("brew", ["install", "dolt"], { stdio: "inherit" });
|
|
41300
|
+
} else {
|
|
41301
|
+
(0, import_child_process4.spawnSync)("sudo", [
|
|
41302
|
+
"bash",
|
|
41303
|
+
"-c",
|
|
41304
|
+
"curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | bash"
|
|
41305
|
+
], { stdio: "inherit" });
|
|
41306
|
+
}
|
|
41307
|
+
console.log(t.success(" \u2713 dolt installed"));
|
|
41308
|
+
}
|
|
41309
|
+
console.log("");
|
|
41310
|
+
} else {
|
|
41311
|
+
console.log(t.muted(" \u2139 Skipping beads gate hooks for this install run.\n"));
|
|
41312
|
+
skipBeads = true;
|
|
41313
|
+
}
|
|
41314
|
+
}
|
|
41315
|
+
}
|
|
40955
41316
|
const diffTasks = new Listr(
|
|
40956
41317
|
targets.map((target) => ({
|
|
40957
41318
|
title: import_path11.default.basename(target),
|
|
40958
41319
|
task: async (listCtx, task) => {
|
|
40959
41320
|
try {
|
|
40960
|
-
|
|
41321
|
+
let changeSet = await calculateDiff(repoRoot, target, prune);
|
|
41322
|
+
if (skipBeads) {
|
|
41323
|
+
changeSet = filterBeadsFromChangeSet(changeSet);
|
|
41324
|
+
}
|
|
41325
|
+
if (syncType === "sync" && !prune) {
|
|
41326
|
+
const hasSettingsDiff = changeSet.config.missing.includes("settings.json") || changeSet.config.outdated.includes("settings.json") || changeSet.config.drifted.includes("settings.json");
|
|
41327
|
+
if (!hasSettingsDiff && await needsSettingsSync(repoRoot, target)) {
|
|
41328
|
+
changeSet.config.outdated.push("settings.json");
|
|
41329
|
+
}
|
|
41330
|
+
}
|
|
40961
41331
|
const totalChanges = Object.values(changeSet).reduce(
|
|
40962
41332
|
(sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
|
|
40963
41333
|
0
|
|
@@ -40983,12 +41353,15 @@ function createInstallCommand() {
|
|
|
40983
41353
|
const emptyChangeSet = {
|
|
40984
41354
|
skills: { missing: [], outdated: [], drifted: [], total: 0 },
|
|
40985
41355
|
hooks: { missing: [], outdated: [], drifted: [], total: 0 },
|
|
40986
|
-
config: { missing: [], outdated: [], drifted: [], total: 0 }
|
|
41356
|
+
config: { missing: [], outdated: [], drifted: [], total: 0 },
|
|
41357
|
+
commands: { missing: [], outdated: [], drifted: [], total: 0 },
|
|
41358
|
+
"qwen-commands": { missing: [], outdated: [], drifted: [], total: 0 },
|
|
41359
|
+
"antigravity-workflows": { missing: [], outdated: [], drifted: [], total: 0 }
|
|
40987
41360
|
};
|
|
40988
41361
|
for (const target of targets) {
|
|
40989
41362
|
console.log(t.bold(`
|
|
40990
41363
|
${sym.arrow} ${import_path11.default.basename(target)}`));
|
|
40991
|
-
await executeSync(repoRoot, target, emptyChangeSet, syncMode, "
|
|
41364
|
+
await executeSync(repoRoot, target, emptyChangeSet, syncMode, "sync", false);
|
|
40992
41365
|
}
|
|
40993
41366
|
}
|
|
40994
41367
|
if (allChanges.length === 0) {
|
|
@@ -41000,12 +41373,12 @@ function createInstallCommand() {
|
|
|
41000
41373
|
console.log(t.accent("\u{1F4A1} Dry run \u2014 no changes written\n"));
|
|
41001
41374
|
return;
|
|
41002
41375
|
}
|
|
41003
|
-
if (!
|
|
41376
|
+
if (!effectiveYes) {
|
|
41004
41377
|
const totalChangesCount = allChanges.reduce((s, c) => s + c.totalChanges, 0);
|
|
41005
41378
|
const { confirm } = await (0, import_prompts2.default)({
|
|
41006
41379
|
type: "confirm",
|
|
41007
41380
|
name: "confirm",
|
|
41008
|
-
message: `Proceed with ${
|
|
41381
|
+
message: `Proceed with ${actionLabel} (${totalChangesCount} total changes)?`,
|
|
41009
41382
|
initial: true
|
|
41010
41383
|
});
|
|
41011
41384
|
if (!confirm) {
|
|
@@ -41017,11 +41390,11 @@ function createInstallCommand() {
|
|
|
41017
41390
|
for (const { target, changeSet, skippedDrifted } of allChanges) {
|
|
41018
41391
|
console.log(t.bold(`
|
|
41019
41392
|
${sym.arrow} ${import_path11.default.basename(target)}`));
|
|
41020
|
-
const count = await executeSync(repoRoot, target, changeSet, syncMode,
|
|
41393
|
+
const count = await executeSync(repoRoot, target, changeSet, syncMode, syncType, dryRun);
|
|
41021
41394
|
totalCount += count;
|
|
41022
41395
|
for (const [category, cat] of Object.entries(changeSet)) {
|
|
41023
41396
|
const c = cat;
|
|
41024
|
-
if (c.drifted.length > 0 &&
|
|
41397
|
+
if (c.drifted.length > 0 && syncType === "sync") {
|
|
41025
41398
|
skippedDrifted.push(...c.drifted.map((item) => `${category}/${item}`));
|
|
41026
41399
|
}
|
|
41027
41400
|
}
|
|
@@ -41030,6 +41403,8 @@ function createInstallCommand() {
|
|
|
41030
41403
|
const allSkipped = allChanges.flatMap((c) => c.skippedDrifted);
|
|
41031
41404
|
await renderSummaryCard(allChanges, totalCount, allSkipped, dryRun);
|
|
41032
41405
|
});
|
|
41406
|
+
installCmd.addCommand(createInstallAllCommand());
|
|
41407
|
+
installCmd.addCommand(createInstallBasicCommand());
|
|
41033
41408
|
installCmd.addCommand(createInstallProjectCommand());
|
|
41034
41409
|
return installCmd;
|
|
41035
41410
|
}
|
|
@@ -41807,10 +42182,10 @@ function mergeDefs(...defs) {
|
|
|
41807
42182
|
function cloneDef(schema) {
|
|
41808
42183
|
return mergeDefs(schema._zod.def);
|
|
41809
42184
|
}
|
|
41810
|
-
function getElementAtPath(obj,
|
|
41811
|
-
if (!
|
|
42185
|
+
function getElementAtPath(obj, path15) {
|
|
42186
|
+
if (!path15)
|
|
41812
42187
|
return obj;
|
|
41813
|
-
return
|
|
42188
|
+
return path15.reduce((acc, key) => acc?.[key], obj);
|
|
41814
42189
|
}
|
|
41815
42190
|
function promiseAllObject(promisesObj) {
|
|
41816
42191
|
const keys = Object.keys(promisesObj);
|
|
@@ -42193,11 +42568,11 @@ function aborted(x, startIndex = 0) {
|
|
|
42193
42568
|
}
|
|
42194
42569
|
return false;
|
|
42195
42570
|
}
|
|
42196
|
-
function prefixIssues(
|
|
42571
|
+
function prefixIssues(path15, issues) {
|
|
42197
42572
|
return issues.map((iss) => {
|
|
42198
42573
|
var _a2;
|
|
42199
42574
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
42200
|
-
iss.path.unshift(
|
|
42575
|
+
iss.path.unshift(path15);
|
|
42201
42576
|
return iss;
|
|
42202
42577
|
});
|
|
42203
42578
|
}
|
|
@@ -42380,7 +42755,7 @@ function formatError(error49, mapper = (issue2) => issue2.message) {
|
|
|
42380
42755
|
}
|
|
42381
42756
|
function treeifyError(error49, mapper = (issue2) => issue2.message) {
|
|
42382
42757
|
const result = { errors: [] };
|
|
42383
|
-
const processError = (error50,
|
|
42758
|
+
const processError = (error50, path15 = []) => {
|
|
42384
42759
|
var _a2, _b;
|
|
42385
42760
|
for (const issue2 of error50.issues) {
|
|
42386
42761
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -42390,7 +42765,7 @@ function treeifyError(error49, mapper = (issue2) => issue2.message) {
|
|
|
42390
42765
|
} else if (issue2.code === "invalid_element") {
|
|
42391
42766
|
processError({ issues: issue2.issues }, issue2.path);
|
|
42392
42767
|
} else {
|
|
42393
|
-
const fullpath = [...
|
|
42768
|
+
const fullpath = [...path15, ...issue2.path];
|
|
42394
42769
|
if (fullpath.length === 0) {
|
|
42395
42770
|
result.errors.push(mapper(issue2));
|
|
42396
42771
|
continue;
|
|
@@ -42422,8 +42797,8 @@ function treeifyError(error49, mapper = (issue2) => issue2.message) {
|
|
|
42422
42797
|
}
|
|
42423
42798
|
function toDotPath(_path) {
|
|
42424
42799
|
const segs = [];
|
|
42425
|
-
const
|
|
42426
|
-
for (const seg of
|
|
42800
|
+
const path15 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
42801
|
+
for (const seg of path15) {
|
|
42427
42802
|
if (typeof seg === "number")
|
|
42428
42803
|
segs.push(`[${seg}]`);
|
|
42429
42804
|
else if (typeof seg === "symbol")
|
|
@@ -54400,13 +54775,13 @@ function resolveRef(ref, ctx) {
|
|
|
54400
54775
|
if (!ref.startsWith("#")) {
|
|
54401
54776
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
54402
54777
|
}
|
|
54403
|
-
const
|
|
54404
|
-
if (
|
|
54778
|
+
const path15 = ref.slice(1).split("/").filter(Boolean);
|
|
54779
|
+
if (path15.length === 0) {
|
|
54405
54780
|
return ctx.rootSchema;
|
|
54406
54781
|
}
|
|
54407
54782
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
54408
|
-
if (
|
|
54409
|
-
const key =
|
|
54783
|
+
if (path15[0] === defsKey) {
|
|
54784
|
+
const key = path15[1];
|
|
54410
54785
|
if (!key || !ctx.defs[key]) {
|
|
54411
54786
|
throw new Error(`Reference not found: ${ref}`);
|
|
54412
54787
|
}
|
|
@@ -54853,7 +55228,7 @@ function getManifestPath(projectDir) {
|
|
|
54853
55228
|
}
|
|
54854
55229
|
|
|
54855
55230
|
// src/commands/status.ts
|
|
54856
|
-
var
|
|
55231
|
+
var import_fs_extra12 = __toESM(require_lib2(), 1);
|
|
54857
55232
|
var import_path13 = __toESM(require("path"), 1);
|
|
54858
55233
|
function formatRelativeTime(timestamp) {
|
|
54859
55234
|
const now = Date.now();
|
|
@@ -54873,7 +55248,7 @@ function createStatusCommand() {
|
|
|
54873
55248
|
const candidates = getCandidatePaths();
|
|
54874
55249
|
const targets = [];
|
|
54875
55250
|
for (const c of candidates) {
|
|
54876
|
-
if (await
|
|
55251
|
+
if (await import_fs_extra12.default.pathExists(c.path)) targets.push(c.path);
|
|
54877
55252
|
}
|
|
54878
55253
|
if (targets.length === 0) {
|
|
54879
55254
|
console.log(kleur_default.yellow("\n No agent environments found (~/.claude, ~/.gemini, ~/.qwen)\n"));
|
|
@@ -54884,8 +55259,8 @@ function createStatusCommand() {
|
|
|
54884
55259
|
const manifestPath = getManifestPath(target);
|
|
54885
55260
|
let lastSync = null;
|
|
54886
55261
|
try {
|
|
54887
|
-
if (await
|
|
54888
|
-
const manifest = await
|
|
55262
|
+
if (await import_fs_extra12.default.pathExists(manifestPath)) {
|
|
55263
|
+
const manifest = await import_fs_extra12.default.readJson(manifestPath);
|
|
54889
55264
|
if (manifest.lastSync) lastSync = manifest.lastSync;
|
|
54890
55265
|
}
|
|
54891
55266
|
} catch {
|
|
@@ -54977,102 +55352,125 @@ function createResetCommand() {
|
|
|
54977
55352
|
}
|
|
54978
55353
|
|
|
54979
55354
|
// src/commands/help.ts
|
|
55355
|
+
var import_path14 = __toESM(require("path"), 1);
|
|
55356
|
+
var import_fs_extra13 = __toESM(require_lib2(), 1);
|
|
55357
|
+
var HOOK_CATALOG = [
|
|
55358
|
+
{ file: "main-guard.mjs", event: "PreToolUse", desc: "Blocks direct edits on protected branches" },
|
|
55359
|
+
{ file: "skill-suggestion.py", event: "UserPromptSubmit", desc: "Suggests relevant skills based on user prompt" },
|
|
55360
|
+
{ file: "serena-workflow-reminder.py", event: "SessionStart", desc: "Injects Serena semantic editing workflow reminder" },
|
|
55361
|
+
{ file: "type-safety-enforcement.py", event: "PreToolUse", desc: "Prevents risky Bash and enforces safe edit patterns" },
|
|
55362
|
+
{ file: "gitnexus/gitnexus-hook.cjs", event: "PreToolUse", desc: "Adds GitNexus context for Grep/Glob/Bash searches" },
|
|
55363
|
+
{ file: "skill-discovery.py", event: "UserPromptSubmit", desc: "Discovers available skills for user requests" },
|
|
55364
|
+
{ file: "agent_context.py", event: "Support module", desc: "Shared hook I/O helper used by Python hook scripts" },
|
|
55365
|
+
{ file: "beads-edit-gate.mjs", event: "PreToolUse", desc: "Blocks file edits if no beads issue is claimed", beads: true },
|
|
55366
|
+
{ file: "beads-commit-gate.mjs", event: "PreToolUse", desc: "Blocks commits when no beads issue is in progress", beads: true },
|
|
55367
|
+
{ file: "beads-stop-gate.mjs", event: "Stop", desc: "Blocks session stop with an unclosed beads claim", beads: true },
|
|
55368
|
+
{ file: "beads-close-memory-prompt.mjs", event: "PostToolUse", desc: "Prompts memory save when closing a beads issue", beads: true }
|
|
55369
|
+
];
|
|
55370
|
+
async function readSkillsFromDir(dir) {
|
|
55371
|
+
if (!await import_fs_extra13.default.pathExists(dir)) return [];
|
|
55372
|
+
const entries = await import_fs_extra13.default.readdir(dir);
|
|
55373
|
+
const skills = [];
|
|
55374
|
+
for (const name of entries.sort()) {
|
|
55375
|
+
const skillMd = import_path14.default.join(dir, name, "SKILL.md");
|
|
55376
|
+
if (!await import_fs_extra13.default.pathExists(skillMd)) continue;
|
|
55377
|
+
const content = await import_fs_extra13.default.readFile(skillMd, "utf8");
|
|
55378
|
+
const m = content.match(/^description:\s*(.+)$/m);
|
|
55379
|
+
skills.push({ name, desc: m ? m[1].replace(/^["']|["']$/g, "").trim() : "" });
|
|
55380
|
+
}
|
|
55381
|
+
return skills;
|
|
55382
|
+
}
|
|
55383
|
+
function col(s, width) {
|
|
55384
|
+
return s.length >= width ? s.slice(0, width - 1) + "\u2026" : s.padEnd(width);
|
|
55385
|
+
}
|
|
54980
55386
|
function createHelpCommand() {
|
|
54981
|
-
return new Command("help").description("Show help information").action(() => {
|
|
54982
|
-
|
|
54983
|
-
|
|
54984
|
-
|
|
54985
|
-
|
|
54986
|
-
|
|
54987
|
-
|
|
54988
|
-
|
|
54989
|
-
|
|
54990
|
-
|
|
54991
|
-
|
|
54992
|
-
|
|
54993
|
-
|
|
54994
|
-
|
|
54995
|
-
|
|
54996
|
-
|
|
54997
|
-
|
|
54998
|
-
|
|
54999
|
-
|
|
55000
|
-
|
|
55001
|
-
|
|
55002
|
-
xtrm install
|
|
55003
|
-
|
|
55004
|
-
|
|
55005
|
-
|
|
55006
|
-
|
|
55007
|
-
|
|
55008
|
-
|
|
55009
|
-
|
|
55010
|
-
|
|
55011
|
-
|
|
55012
|
-
|
|
55013
|
-
|
|
55014
|
-
|
|
55015
|
-
|
|
55016
|
-
|
|
55017
|
-
|
|
55018
|
-
|
|
55019
|
-
|
|
55020
|
-
|
|
55021
|
-
|
|
55022
|
-
|
|
55023
|
-
|
|
55024
|
-
|
|
55025
|
-
|
|
55026
|
-
|
|
55027
|
-
|
|
55028
|
-
|
|
55029
|
-
|
|
55030
|
-
|
|
55031
|
-
|
|
55032
|
-
|
|
55033
|
-
|
|
55034
|
-
|
|
55035
|
-
|
|
55036
|
-
|
|
55037
|
-
|
|
55038
|
-
|
|
55039
|
-
|
|
55040
|
-
|
|
55041
|
-
|
|
55042
|
-
|
|
55043
|
-
|
|
55044
|
-
|
|
55045
|
-
|
|
55046
|
-
|
|
55047
|
-
|
|
55048
|
-
|
|
55049
|
-
|
|
55050
|
-
|
|
55051
|
-
|
|
55052
|
-
|
|
55053
|
-
|
|
55054
|
-
xtrm
|
|
55055
|
-
|
|
55056
|
-
|
|
55057
|
-
|
|
55058
|
-
|
|
55059
|
-
|
|
55060
|
-
|
|
55061
|
-
xtrm-tools
|
|
55062
|
-
|
|
55063
|
-
|
|
55064
|
-
|
|
55065
|
-
|
|
55066
|
-
|
|
55067
|
-
|
|
55068
|
-
${kleur_default.cyan("RESOURCES:")}
|
|
55069
|
-
|
|
55070
|
-
\u2022 Repository: https://github.com/Jaggerxtrm/xtrm-tools
|
|
55071
|
-
\u2022 Documentation: See README.md in the repository
|
|
55072
|
-
\u2022 Report Issues: https://github.com/Jaggerxtrm/xtrm-tools/issues
|
|
55073
|
-
|
|
55074
|
-
${kleur_default.dim("Run 'xtrm <command> --help' for more information on a specific command.")}
|
|
55075
|
-
`);
|
|
55387
|
+
return new Command("help").description("Show help information and component catalogue").action(async () => {
|
|
55388
|
+
let repoRoot;
|
|
55389
|
+
try {
|
|
55390
|
+
repoRoot = await findRepoRoot();
|
|
55391
|
+
} catch {
|
|
55392
|
+
repoRoot = "";
|
|
55393
|
+
}
|
|
55394
|
+
const skills = repoRoot ? await readSkillsFromDir(import_path14.default.join(repoRoot, "skills")) : [];
|
|
55395
|
+
const projectSkills = repoRoot ? await readSkillsFromDir(import_path14.default.join(repoRoot, "project-skills")) : [];
|
|
55396
|
+
const W = 80;
|
|
55397
|
+
const hr = kleur_default.dim("-".repeat(W));
|
|
55398
|
+
const section = (title) => `
|
|
55399
|
+
${kleur_default.bold().cyan(title)}
|
|
55400
|
+
${hr}`;
|
|
55401
|
+
const installSection = [
|
|
55402
|
+
section("INSTALL COMMANDS"),
|
|
55403
|
+
"",
|
|
55404
|
+
` ${kleur_default.bold("xtrm install all")}`,
|
|
55405
|
+
` ${kleur_default.dim("Global install: skills + all hooks (including beads gates) + MCP servers.")}`,
|
|
55406
|
+
` ${kleur_default.dim("Checks for beads+dolt and prompts to install if missing.")}`,
|
|
55407
|
+
"",
|
|
55408
|
+
` ${kleur_default.bold("xtrm install basic")}`,
|
|
55409
|
+
` ${kleur_default.dim("Global install: skills + general hooks + MCP servers.")}`,
|
|
55410
|
+
` ${kleur_default.dim("No beads dependency -- safe to run with zero external deps.")}`,
|
|
55411
|
+
"",
|
|
55412
|
+
` ${kleur_default.bold("xtrm install project")} ${kleur_default.dim("<tool-name | all>")}`,
|
|
55413
|
+
` ${kleur_default.dim("Project-scoped install into .claude/ of current git root.")}`,
|
|
55414
|
+
` ${kleur_default.dim("Run xtrm install project list to see available project skills.")}`,
|
|
55415
|
+
"",
|
|
55416
|
+
` ${kleur_default.dim("Default target directories:")}`,
|
|
55417
|
+
` ${kleur_default.dim("~/.claude/hooks (global hook scripts)")}`,
|
|
55418
|
+
` ${kleur_default.dim("~/.claude/skills (global Claude skills)")}`,
|
|
55419
|
+
` ${kleur_default.dim("~/.agents/skills (agents skills cache mirror)")}`,
|
|
55420
|
+
"",
|
|
55421
|
+
` ${kleur_default.dim("Flags (all profiles): --dry-run --yes / -y --no-mcp --force --prune --backport")}`
|
|
55422
|
+
].join("\n");
|
|
55423
|
+
const general = HOOK_CATALOG.filter((h) => !h.beads);
|
|
55424
|
+
const beads = HOOK_CATALOG.filter((h) => h.beads);
|
|
55425
|
+
const hookRows = (hooks) => hooks.map(
|
|
55426
|
+
(h) => ` ${kleur_default.white(col(h.file, 34))}${kleur_default.yellow(col(h.event, 20))}${kleur_default.dim(h.desc)}`
|
|
55427
|
+
).join("\n");
|
|
55428
|
+
const hooksSection = [
|
|
55429
|
+
section("GLOBAL HOOKS"),
|
|
55430
|
+
"",
|
|
55431
|
+
kleur_default.dim(" " + col("File", 34) + col("Event", 20) + "Description"),
|
|
55432
|
+
"",
|
|
55433
|
+
hookRows(general),
|
|
55434
|
+
"",
|
|
55435
|
+
` ${kleur_default.dim("beads gate hooks (xtrm install all -- require beads+dolt):")}`,
|
|
55436
|
+
hookRows(beads)
|
|
55437
|
+
].join("\n");
|
|
55438
|
+
const skillRows = skills.map((s) => {
|
|
55439
|
+
const desc = s.desc.length > 46 ? s.desc.slice(0, 45) + "\u2026" : s.desc;
|
|
55440
|
+
return ` ${kleur_default.white(col(s.name, 30))}${kleur_default.dim(desc)}`;
|
|
55441
|
+
}).join("\n");
|
|
55442
|
+
const skillsSection = [
|
|
55443
|
+
section(`SKILLS ${kleur_default.dim("(" + skills.length + " available)")}`),
|
|
55444
|
+
"",
|
|
55445
|
+
skills.length ? skillRows : kleur_default.dim(" (none found -- run from repo root to see skills)")
|
|
55446
|
+
].join("\n");
|
|
55447
|
+
const psRows = projectSkills.map(
|
|
55448
|
+
(s) => ` ${kleur_default.white(col(s.name, 30))}${kleur_default.dim(s.desc)}`
|
|
55449
|
+
).join("\n");
|
|
55450
|
+
const psSection = [
|
|
55451
|
+
section("PROJECT SKILLS"),
|
|
55452
|
+
"",
|
|
55453
|
+
projectSkills.length ? psRows : kleur_default.dim(" (none found)"),
|
|
55454
|
+
"",
|
|
55455
|
+
` ${kleur_default.dim("Install: xtrm install project <name> | xtrm install project list")}`
|
|
55456
|
+
].join("\n");
|
|
55457
|
+
const otherSection = [
|
|
55458
|
+
section("OTHER COMMANDS"),
|
|
55459
|
+
"",
|
|
55460
|
+
` ${kleur_default.bold("xtrm status")} ${kleur_default.dim("Show pending changes without applying them")}`,
|
|
55461
|
+
` ${kleur_default.bold("xtrm reset")} ${kleur_default.dim("Clear saved preferences and start fresh")}`,
|
|
55462
|
+
` ${kleur_default.bold("xtrm help")} ${kleur_default.dim("Show this overview")}`
|
|
55463
|
+
].join("\n");
|
|
55464
|
+
const resourcesSection = [
|
|
55465
|
+
section("RESOURCES"),
|
|
55466
|
+
"",
|
|
55467
|
+
` Repository https://github.com/Jaggerxtrm/xtrm-tools`,
|
|
55468
|
+
` Issues https://github.com/Jaggerxtrm/xtrm-tools/issues`,
|
|
55469
|
+
"",
|
|
55470
|
+
` ${kleur_default.dim("Run 'xtrm <command> --help' for command-specific options.")}`,
|
|
55471
|
+
""
|
|
55472
|
+
].join("\n");
|
|
55473
|
+
console.log([installSection, hooksSection, skillsSection, psSection, otherSection, resourcesSection].join("\n"));
|
|
55076
55474
|
});
|
|
55077
55475
|
}
|
|
55078
55476
|
|