@atlashub/smartstack-cli 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1213 -815
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -974,7 +974,7 @@ var require_command = __commonJS({
|
|
|
974
974
|
var EventEmitter2 = require("events").EventEmitter;
|
|
975
975
|
var childProcess2 = require("child_process");
|
|
976
976
|
var path5 = require("path");
|
|
977
|
-
var
|
|
977
|
+
var fs15 = require("fs");
|
|
978
978
|
var process17 = require("process");
|
|
979
979
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
980
980
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -1907,10 +1907,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1907
1907
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1908
1908
|
function findFile(baseDir, baseName) {
|
|
1909
1909
|
const localBin = path5.resolve(baseDir, baseName);
|
|
1910
|
-
if (
|
|
1910
|
+
if (fs15.existsSync(localBin)) return localBin;
|
|
1911
1911
|
if (sourceExt.includes(path5.extname(baseName))) return void 0;
|
|
1912
1912
|
const foundExt = sourceExt.find(
|
|
1913
|
-
(ext2) =>
|
|
1913
|
+
(ext2) => fs15.existsSync(`${localBin}${ext2}`)
|
|
1914
1914
|
);
|
|
1915
1915
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
1916
1916
|
return void 0;
|
|
@@ -1922,7 +1922,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1922
1922
|
if (this._scriptPath) {
|
|
1923
1923
|
let resolvedScriptPath;
|
|
1924
1924
|
try {
|
|
1925
|
-
resolvedScriptPath =
|
|
1925
|
+
resolvedScriptPath = fs15.realpathSync(this._scriptPath);
|
|
1926
1926
|
} catch (err) {
|
|
1927
1927
|
resolvedScriptPath = this._scriptPath;
|
|
1928
1928
|
}
|
|
@@ -4714,7 +4714,7 @@ var require_polyfills = __commonJS({
|
|
|
4714
4714
|
var constants = require("constants");
|
|
4715
4715
|
var origCwd = process.cwd;
|
|
4716
4716
|
var cwd = null;
|
|
4717
|
-
var
|
|
4717
|
+
var platform3 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
4718
4718
|
process.cwd = function() {
|
|
4719
4719
|
if (!cwd)
|
|
4720
4720
|
cwd = origCwd.call(process);
|
|
@@ -4734,54 +4734,54 @@ var require_polyfills = __commonJS({
|
|
|
4734
4734
|
}
|
|
4735
4735
|
var chdir;
|
|
4736
4736
|
module2.exports = patch;
|
|
4737
|
-
function patch(
|
|
4737
|
+
function patch(fs15) {
|
|
4738
4738
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
4739
|
-
patchLchmod(
|
|
4740
|
-
}
|
|
4741
|
-
if (!
|
|
4742
|
-
patchLutimes(
|
|
4743
|
-
}
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
if (
|
|
4763
|
-
|
|
4739
|
+
patchLchmod(fs15);
|
|
4740
|
+
}
|
|
4741
|
+
if (!fs15.lutimes) {
|
|
4742
|
+
patchLutimes(fs15);
|
|
4743
|
+
}
|
|
4744
|
+
fs15.chown = chownFix(fs15.chown);
|
|
4745
|
+
fs15.fchown = chownFix(fs15.fchown);
|
|
4746
|
+
fs15.lchown = chownFix(fs15.lchown);
|
|
4747
|
+
fs15.chmod = chmodFix(fs15.chmod);
|
|
4748
|
+
fs15.fchmod = chmodFix(fs15.fchmod);
|
|
4749
|
+
fs15.lchmod = chmodFix(fs15.lchmod);
|
|
4750
|
+
fs15.chownSync = chownFixSync(fs15.chownSync);
|
|
4751
|
+
fs15.fchownSync = chownFixSync(fs15.fchownSync);
|
|
4752
|
+
fs15.lchownSync = chownFixSync(fs15.lchownSync);
|
|
4753
|
+
fs15.chmodSync = chmodFixSync(fs15.chmodSync);
|
|
4754
|
+
fs15.fchmodSync = chmodFixSync(fs15.fchmodSync);
|
|
4755
|
+
fs15.lchmodSync = chmodFixSync(fs15.lchmodSync);
|
|
4756
|
+
fs15.stat = statFix(fs15.stat);
|
|
4757
|
+
fs15.fstat = statFix(fs15.fstat);
|
|
4758
|
+
fs15.lstat = statFix(fs15.lstat);
|
|
4759
|
+
fs15.statSync = statFixSync(fs15.statSync);
|
|
4760
|
+
fs15.fstatSync = statFixSync(fs15.fstatSync);
|
|
4761
|
+
fs15.lstatSync = statFixSync(fs15.lstatSync);
|
|
4762
|
+
if (fs15.chmod && !fs15.lchmod) {
|
|
4763
|
+
fs15.lchmod = function(path5, mode, cb) {
|
|
4764
4764
|
if (cb) process.nextTick(cb);
|
|
4765
4765
|
};
|
|
4766
|
-
|
|
4766
|
+
fs15.lchmodSync = function() {
|
|
4767
4767
|
};
|
|
4768
4768
|
}
|
|
4769
|
-
if (
|
|
4770
|
-
|
|
4769
|
+
if (fs15.chown && !fs15.lchown) {
|
|
4770
|
+
fs15.lchown = function(path5, uid, gid, cb) {
|
|
4771
4771
|
if (cb) process.nextTick(cb);
|
|
4772
4772
|
};
|
|
4773
|
-
|
|
4773
|
+
fs15.lchownSync = function() {
|
|
4774
4774
|
};
|
|
4775
4775
|
}
|
|
4776
|
-
if (
|
|
4777
|
-
|
|
4776
|
+
if (platform3 === "win32") {
|
|
4777
|
+
fs15.rename = typeof fs15.rename !== "function" ? fs15.rename : (function(fs$rename) {
|
|
4778
4778
|
function rename(from3, to, cb) {
|
|
4779
4779
|
var start = Date.now();
|
|
4780
4780
|
var backoff = 0;
|
|
4781
4781
|
fs$rename(from3, to, function CB(er) {
|
|
4782
4782
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
4783
4783
|
setTimeout(function() {
|
|
4784
|
-
|
|
4784
|
+
fs15.stat(to, function(stater, st) {
|
|
4785
4785
|
if (stater && stater.code === "ENOENT")
|
|
4786
4786
|
fs$rename(from3, to, CB);
|
|
4787
4787
|
else
|
|
@@ -4797,9 +4797,9 @@ var require_polyfills = __commonJS({
|
|
|
4797
4797
|
}
|
|
4798
4798
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
4799
4799
|
return rename;
|
|
4800
|
-
})(
|
|
4800
|
+
})(fs15.rename);
|
|
4801
4801
|
}
|
|
4802
|
-
|
|
4802
|
+
fs15.read = typeof fs15.read !== "function" ? fs15.read : (function(fs$read) {
|
|
4803
4803
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
4804
4804
|
var callback;
|
|
4805
4805
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -4807,22 +4807,22 @@ var require_polyfills = __commonJS({
|
|
|
4807
4807
|
callback = function(er, _3, __) {
|
|
4808
4808
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
4809
4809
|
eagCounter++;
|
|
4810
|
-
return fs$read.call(
|
|
4810
|
+
return fs$read.call(fs15, fd, buffer, offset, length, position, callback);
|
|
4811
4811
|
}
|
|
4812
4812
|
callback_.apply(this, arguments);
|
|
4813
4813
|
};
|
|
4814
4814
|
}
|
|
4815
|
-
return fs$read.call(
|
|
4815
|
+
return fs$read.call(fs15, fd, buffer, offset, length, position, callback);
|
|
4816
4816
|
}
|
|
4817
4817
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
4818
4818
|
return read;
|
|
4819
|
-
})(
|
|
4820
|
-
|
|
4819
|
+
})(fs15.read);
|
|
4820
|
+
fs15.readSync = typeof fs15.readSync !== "function" ? fs15.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
4821
4821
|
return function(fd, buffer, offset, length, position) {
|
|
4822
4822
|
var eagCounter = 0;
|
|
4823
4823
|
while (true) {
|
|
4824
4824
|
try {
|
|
4825
|
-
return fs$readSync.call(
|
|
4825
|
+
return fs$readSync.call(fs15, fd, buffer, offset, length, position);
|
|
4826
4826
|
} catch (er) {
|
|
4827
4827
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
4828
4828
|
eagCounter++;
|
|
@@ -4832,10 +4832,10 @@ var require_polyfills = __commonJS({
|
|
|
4832
4832
|
}
|
|
4833
4833
|
}
|
|
4834
4834
|
};
|
|
4835
|
-
})(
|
|
4836
|
-
function patchLchmod(
|
|
4837
|
-
|
|
4838
|
-
|
|
4835
|
+
})(fs15.readSync);
|
|
4836
|
+
function patchLchmod(fs16) {
|
|
4837
|
+
fs16.lchmod = function(path5, mode, callback) {
|
|
4838
|
+
fs16.open(
|
|
4839
4839
|
path5,
|
|
4840
4840
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
4841
4841
|
mode,
|
|
@@ -4844,80 +4844,80 @@ var require_polyfills = __commonJS({
|
|
|
4844
4844
|
if (callback) callback(err);
|
|
4845
4845
|
return;
|
|
4846
4846
|
}
|
|
4847
|
-
|
|
4848
|
-
|
|
4847
|
+
fs16.fchmod(fd, mode, function(err2) {
|
|
4848
|
+
fs16.close(fd, function(err22) {
|
|
4849
4849
|
if (callback) callback(err2 || err22);
|
|
4850
4850
|
});
|
|
4851
4851
|
});
|
|
4852
4852
|
}
|
|
4853
4853
|
);
|
|
4854
4854
|
};
|
|
4855
|
-
|
|
4856
|
-
var fd =
|
|
4855
|
+
fs16.lchmodSync = function(path5, mode) {
|
|
4856
|
+
var fd = fs16.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
4857
4857
|
var threw = true;
|
|
4858
4858
|
var ret;
|
|
4859
4859
|
try {
|
|
4860
|
-
ret =
|
|
4860
|
+
ret = fs16.fchmodSync(fd, mode);
|
|
4861
4861
|
threw = false;
|
|
4862
4862
|
} finally {
|
|
4863
4863
|
if (threw) {
|
|
4864
4864
|
try {
|
|
4865
|
-
|
|
4865
|
+
fs16.closeSync(fd);
|
|
4866
4866
|
} catch (er) {
|
|
4867
4867
|
}
|
|
4868
4868
|
} else {
|
|
4869
|
-
|
|
4869
|
+
fs16.closeSync(fd);
|
|
4870
4870
|
}
|
|
4871
4871
|
}
|
|
4872
4872
|
return ret;
|
|
4873
4873
|
};
|
|
4874
4874
|
}
|
|
4875
|
-
function patchLutimes(
|
|
4876
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
4877
|
-
|
|
4878
|
-
|
|
4875
|
+
function patchLutimes(fs16) {
|
|
4876
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs16.futimes) {
|
|
4877
|
+
fs16.lutimes = function(path5, at, mt, cb) {
|
|
4878
|
+
fs16.open(path5, constants.O_SYMLINK, function(er, fd) {
|
|
4879
4879
|
if (er) {
|
|
4880
4880
|
if (cb) cb(er);
|
|
4881
4881
|
return;
|
|
4882
4882
|
}
|
|
4883
|
-
|
|
4884
|
-
|
|
4883
|
+
fs16.futimes(fd, at, mt, function(er2) {
|
|
4884
|
+
fs16.close(fd, function(er22) {
|
|
4885
4885
|
if (cb) cb(er2 || er22);
|
|
4886
4886
|
});
|
|
4887
4887
|
});
|
|
4888
4888
|
});
|
|
4889
4889
|
};
|
|
4890
|
-
|
|
4891
|
-
var fd =
|
|
4890
|
+
fs16.lutimesSync = function(path5, at, mt) {
|
|
4891
|
+
var fd = fs16.openSync(path5, constants.O_SYMLINK);
|
|
4892
4892
|
var ret;
|
|
4893
4893
|
var threw = true;
|
|
4894
4894
|
try {
|
|
4895
|
-
ret =
|
|
4895
|
+
ret = fs16.futimesSync(fd, at, mt);
|
|
4896
4896
|
threw = false;
|
|
4897
4897
|
} finally {
|
|
4898
4898
|
if (threw) {
|
|
4899
4899
|
try {
|
|
4900
|
-
|
|
4900
|
+
fs16.closeSync(fd);
|
|
4901
4901
|
} catch (er) {
|
|
4902
4902
|
}
|
|
4903
4903
|
} else {
|
|
4904
|
-
|
|
4904
|
+
fs16.closeSync(fd);
|
|
4905
4905
|
}
|
|
4906
4906
|
}
|
|
4907
4907
|
return ret;
|
|
4908
4908
|
};
|
|
4909
|
-
} else if (
|
|
4910
|
-
|
|
4909
|
+
} else if (fs16.futimes) {
|
|
4910
|
+
fs16.lutimes = function(_a, _b, _c, cb) {
|
|
4911
4911
|
if (cb) process.nextTick(cb);
|
|
4912
4912
|
};
|
|
4913
|
-
|
|
4913
|
+
fs16.lutimesSync = function() {
|
|
4914
4914
|
};
|
|
4915
4915
|
}
|
|
4916
4916
|
}
|
|
4917
4917
|
function chmodFix(orig) {
|
|
4918
4918
|
if (!orig) return orig;
|
|
4919
4919
|
return function(target, mode, cb) {
|
|
4920
|
-
return orig.call(
|
|
4920
|
+
return orig.call(fs15, target, mode, function(er) {
|
|
4921
4921
|
if (chownErOk(er)) er = null;
|
|
4922
4922
|
if (cb) cb.apply(this, arguments);
|
|
4923
4923
|
});
|
|
@@ -4927,7 +4927,7 @@ var require_polyfills = __commonJS({
|
|
|
4927
4927
|
if (!orig) return orig;
|
|
4928
4928
|
return function(target, mode) {
|
|
4929
4929
|
try {
|
|
4930
|
-
return orig.call(
|
|
4930
|
+
return orig.call(fs15, target, mode);
|
|
4931
4931
|
} catch (er) {
|
|
4932
4932
|
if (!chownErOk(er)) throw er;
|
|
4933
4933
|
}
|
|
@@ -4936,7 +4936,7 @@ var require_polyfills = __commonJS({
|
|
|
4936
4936
|
function chownFix(orig) {
|
|
4937
4937
|
if (!orig) return orig;
|
|
4938
4938
|
return function(target, uid, gid, cb) {
|
|
4939
|
-
return orig.call(
|
|
4939
|
+
return orig.call(fs15, target, uid, gid, function(er) {
|
|
4940
4940
|
if (chownErOk(er)) er = null;
|
|
4941
4941
|
if (cb) cb.apply(this, arguments);
|
|
4942
4942
|
});
|
|
@@ -4946,7 +4946,7 @@ var require_polyfills = __commonJS({
|
|
|
4946
4946
|
if (!orig) return orig;
|
|
4947
4947
|
return function(target, uid, gid) {
|
|
4948
4948
|
try {
|
|
4949
|
-
return orig.call(
|
|
4949
|
+
return orig.call(fs15, target, uid, gid);
|
|
4950
4950
|
} catch (er) {
|
|
4951
4951
|
if (!chownErOk(er)) throw er;
|
|
4952
4952
|
}
|
|
@@ -4966,13 +4966,13 @@ var require_polyfills = __commonJS({
|
|
|
4966
4966
|
}
|
|
4967
4967
|
if (cb) cb.apply(this, arguments);
|
|
4968
4968
|
}
|
|
4969
|
-
return options ? orig.call(
|
|
4969
|
+
return options ? orig.call(fs15, target, options, callback) : orig.call(fs15, target, callback);
|
|
4970
4970
|
};
|
|
4971
4971
|
}
|
|
4972
4972
|
function statFixSync(orig) {
|
|
4973
4973
|
if (!orig) return orig;
|
|
4974
4974
|
return function(target, options) {
|
|
4975
|
-
var stats = options ? orig.call(
|
|
4975
|
+
var stats = options ? orig.call(fs15, target, options) : orig.call(fs15, target);
|
|
4976
4976
|
if (stats) {
|
|
4977
4977
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
4978
4978
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -5002,7 +5002,7 @@ var require_legacy_streams = __commonJS({
|
|
|
5002
5002
|
"use strict";
|
|
5003
5003
|
var Stream2 = require("stream").Stream;
|
|
5004
5004
|
module2.exports = legacy;
|
|
5005
|
-
function legacy(
|
|
5005
|
+
function legacy(fs15) {
|
|
5006
5006
|
return {
|
|
5007
5007
|
ReadStream,
|
|
5008
5008
|
WriteStream
|
|
@@ -5045,7 +5045,7 @@ var require_legacy_streams = __commonJS({
|
|
|
5045
5045
|
});
|
|
5046
5046
|
return;
|
|
5047
5047
|
}
|
|
5048
|
-
|
|
5048
|
+
fs15.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
5049
5049
|
if (err) {
|
|
5050
5050
|
self2.emit("error", err);
|
|
5051
5051
|
self2.readable = false;
|
|
@@ -5084,7 +5084,7 @@ var require_legacy_streams = __commonJS({
|
|
|
5084
5084
|
this.busy = false;
|
|
5085
5085
|
this._queue = [];
|
|
5086
5086
|
if (this.fd === null) {
|
|
5087
|
-
this._open =
|
|
5087
|
+
this._open = fs15.open;
|
|
5088
5088
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
5089
5089
|
this.flush();
|
|
5090
5090
|
}
|
|
@@ -5120,7 +5120,7 @@ var require_clone = __commonJS({
|
|
|
5120
5120
|
var require_graceful_fs = __commonJS({
|
|
5121
5121
|
"node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
5122
5122
|
"use strict";
|
|
5123
|
-
var
|
|
5123
|
+
var fs15 = require("fs");
|
|
5124
5124
|
var polyfills = require_polyfills();
|
|
5125
5125
|
var legacy = require_legacy_streams();
|
|
5126
5126
|
var clone = require_clone();
|
|
@@ -5152,12 +5152,12 @@ var require_graceful_fs = __commonJS({
|
|
|
5152
5152
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
5153
5153
|
console.error(m);
|
|
5154
5154
|
};
|
|
5155
|
-
if (!
|
|
5155
|
+
if (!fs15[gracefulQueue]) {
|
|
5156
5156
|
queue = global[gracefulQueue] || [];
|
|
5157
|
-
publishQueue(
|
|
5158
|
-
|
|
5157
|
+
publishQueue(fs15, queue);
|
|
5158
|
+
fs15.close = (function(fs$close) {
|
|
5159
5159
|
function close(fd, cb) {
|
|
5160
|
-
return fs$close.call(
|
|
5160
|
+
return fs$close.call(fs15, fd, function(err) {
|
|
5161
5161
|
if (!err) {
|
|
5162
5162
|
resetQueue();
|
|
5163
5163
|
}
|
|
@@ -5169,40 +5169,40 @@ var require_graceful_fs = __commonJS({
|
|
|
5169
5169
|
value: fs$close
|
|
5170
5170
|
});
|
|
5171
5171
|
return close;
|
|
5172
|
-
})(
|
|
5173
|
-
|
|
5172
|
+
})(fs15.close);
|
|
5173
|
+
fs15.closeSync = (function(fs$closeSync) {
|
|
5174
5174
|
function closeSync(fd) {
|
|
5175
|
-
fs$closeSync.apply(
|
|
5175
|
+
fs$closeSync.apply(fs15, arguments);
|
|
5176
5176
|
resetQueue();
|
|
5177
5177
|
}
|
|
5178
5178
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
5179
5179
|
value: fs$closeSync
|
|
5180
5180
|
});
|
|
5181
5181
|
return closeSync;
|
|
5182
|
-
})(
|
|
5182
|
+
})(fs15.closeSync);
|
|
5183
5183
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
5184
5184
|
process.on("exit", function() {
|
|
5185
|
-
debug(
|
|
5186
|
-
require("assert").equal(
|
|
5185
|
+
debug(fs15[gracefulQueue]);
|
|
5186
|
+
require("assert").equal(fs15[gracefulQueue].length, 0);
|
|
5187
5187
|
});
|
|
5188
5188
|
}
|
|
5189
5189
|
}
|
|
5190
5190
|
var queue;
|
|
5191
5191
|
if (!global[gracefulQueue]) {
|
|
5192
|
-
publishQueue(global,
|
|
5193
|
-
}
|
|
5194
|
-
module2.exports = patch(clone(
|
|
5195
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
5196
|
-
module2.exports = patch(
|
|
5197
|
-
|
|
5198
|
-
}
|
|
5199
|
-
function patch(
|
|
5200
|
-
polyfills(
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
var fs$readFile =
|
|
5205
|
-
|
|
5192
|
+
publishQueue(global, fs15[gracefulQueue]);
|
|
5193
|
+
}
|
|
5194
|
+
module2.exports = patch(clone(fs15));
|
|
5195
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs15.__patched) {
|
|
5196
|
+
module2.exports = patch(fs15);
|
|
5197
|
+
fs15.__patched = true;
|
|
5198
|
+
}
|
|
5199
|
+
function patch(fs16) {
|
|
5200
|
+
polyfills(fs16);
|
|
5201
|
+
fs16.gracefulify = patch;
|
|
5202
|
+
fs16.createReadStream = createReadStream;
|
|
5203
|
+
fs16.createWriteStream = createWriteStream;
|
|
5204
|
+
var fs$readFile = fs16.readFile;
|
|
5205
|
+
fs16.readFile = readFile2;
|
|
5206
5206
|
function readFile2(path5, options, cb) {
|
|
5207
5207
|
if (typeof options === "function")
|
|
5208
5208
|
cb = options, options = null;
|
|
@@ -5218,8 +5218,8 @@ var require_graceful_fs = __commonJS({
|
|
|
5218
5218
|
});
|
|
5219
5219
|
}
|
|
5220
5220
|
}
|
|
5221
|
-
var fs$writeFile =
|
|
5222
|
-
|
|
5221
|
+
var fs$writeFile = fs16.writeFile;
|
|
5222
|
+
fs16.writeFile = writeFile2;
|
|
5223
5223
|
function writeFile2(path5, data, options, cb) {
|
|
5224
5224
|
if (typeof options === "function")
|
|
5225
5225
|
cb = options, options = null;
|
|
@@ -5235,9 +5235,9 @@ var require_graceful_fs = __commonJS({
|
|
|
5235
5235
|
});
|
|
5236
5236
|
}
|
|
5237
5237
|
}
|
|
5238
|
-
var fs$appendFile =
|
|
5238
|
+
var fs$appendFile = fs16.appendFile;
|
|
5239
5239
|
if (fs$appendFile)
|
|
5240
|
-
|
|
5240
|
+
fs16.appendFile = appendFile;
|
|
5241
5241
|
function appendFile(path5, data, options, cb) {
|
|
5242
5242
|
if (typeof options === "function")
|
|
5243
5243
|
cb = options, options = null;
|
|
@@ -5253,9 +5253,9 @@ var require_graceful_fs = __commonJS({
|
|
|
5253
5253
|
});
|
|
5254
5254
|
}
|
|
5255
5255
|
}
|
|
5256
|
-
var fs$copyFile =
|
|
5256
|
+
var fs$copyFile = fs16.copyFile;
|
|
5257
5257
|
if (fs$copyFile)
|
|
5258
|
-
|
|
5258
|
+
fs16.copyFile = copyFile;
|
|
5259
5259
|
function copyFile(src, dest, flags, cb) {
|
|
5260
5260
|
if (typeof flags === "function") {
|
|
5261
5261
|
cb = flags;
|
|
@@ -5273,8 +5273,8 @@ var require_graceful_fs = __commonJS({
|
|
|
5273
5273
|
});
|
|
5274
5274
|
}
|
|
5275
5275
|
}
|
|
5276
|
-
var fs$readdir =
|
|
5277
|
-
|
|
5276
|
+
var fs$readdir = fs16.readdir;
|
|
5277
|
+
fs16.readdir = readdir2;
|
|
5278
5278
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
5279
5279
|
function readdir2(path5, options, cb) {
|
|
5280
5280
|
if (typeof options === "function")
|
|
@@ -5315,21 +5315,21 @@ var require_graceful_fs = __commonJS({
|
|
|
5315
5315
|
}
|
|
5316
5316
|
}
|
|
5317
5317
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
5318
|
-
var legStreams = legacy(
|
|
5318
|
+
var legStreams = legacy(fs16);
|
|
5319
5319
|
ReadStream = legStreams.ReadStream;
|
|
5320
5320
|
WriteStream = legStreams.WriteStream;
|
|
5321
5321
|
}
|
|
5322
|
-
var fs$ReadStream =
|
|
5322
|
+
var fs$ReadStream = fs16.ReadStream;
|
|
5323
5323
|
if (fs$ReadStream) {
|
|
5324
5324
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
5325
5325
|
ReadStream.prototype.open = ReadStream$open;
|
|
5326
5326
|
}
|
|
5327
|
-
var fs$WriteStream =
|
|
5327
|
+
var fs$WriteStream = fs16.WriteStream;
|
|
5328
5328
|
if (fs$WriteStream) {
|
|
5329
5329
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
5330
5330
|
WriteStream.prototype.open = WriteStream$open;
|
|
5331
5331
|
}
|
|
5332
|
-
Object.defineProperty(
|
|
5332
|
+
Object.defineProperty(fs16, "ReadStream", {
|
|
5333
5333
|
get: function() {
|
|
5334
5334
|
return ReadStream;
|
|
5335
5335
|
},
|
|
@@ -5339,7 +5339,7 @@ var require_graceful_fs = __commonJS({
|
|
|
5339
5339
|
enumerable: true,
|
|
5340
5340
|
configurable: true
|
|
5341
5341
|
});
|
|
5342
|
-
Object.defineProperty(
|
|
5342
|
+
Object.defineProperty(fs16, "WriteStream", {
|
|
5343
5343
|
get: function() {
|
|
5344
5344
|
return WriteStream;
|
|
5345
5345
|
},
|
|
@@ -5350,7 +5350,7 @@ var require_graceful_fs = __commonJS({
|
|
|
5350
5350
|
configurable: true
|
|
5351
5351
|
});
|
|
5352
5352
|
var FileReadStream = ReadStream;
|
|
5353
|
-
Object.defineProperty(
|
|
5353
|
+
Object.defineProperty(fs16, "FileReadStream", {
|
|
5354
5354
|
get: function() {
|
|
5355
5355
|
return FileReadStream;
|
|
5356
5356
|
},
|
|
@@ -5361,7 +5361,7 @@ var require_graceful_fs = __commonJS({
|
|
|
5361
5361
|
configurable: true
|
|
5362
5362
|
});
|
|
5363
5363
|
var FileWriteStream = WriteStream;
|
|
5364
|
-
Object.defineProperty(
|
|
5364
|
+
Object.defineProperty(fs16, "FileWriteStream", {
|
|
5365
5365
|
get: function() {
|
|
5366
5366
|
return FileWriteStream;
|
|
5367
5367
|
},
|
|
@@ -5410,13 +5410,13 @@ var require_graceful_fs = __commonJS({
|
|
|
5410
5410
|
});
|
|
5411
5411
|
}
|
|
5412
5412
|
function createReadStream(path5, options) {
|
|
5413
|
-
return new
|
|
5413
|
+
return new fs16.ReadStream(path5, options);
|
|
5414
5414
|
}
|
|
5415
5415
|
function createWriteStream(path5, options) {
|
|
5416
|
-
return new
|
|
5416
|
+
return new fs16.WriteStream(path5, options);
|
|
5417
5417
|
}
|
|
5418
|
-
var fs$open =
|
|
5419
|
-
|
|
5418
|
+
var fs$open = fs16.open;
|
|
5419
|
+
fs16.open = open2;
|
|
5420
5420
|
function open2(path5, flags, mode, cb) {
|
|
5421
5421
|
if (typeof mode === "function")
|
|
5422
5422
|
cb = mode, mode = null;
|
|
@@ -5432,20 +5432,20 @@ var require_graceful_fs = __commonJS({
|
|
|
5432
5432
|
});
|
|
5433
5433
|
}
|
|
5434
5434
|
}
|
|
5435
|
-
return
|
|
5435
|
+
return fs16;
|
|
5436
5436
|
}
|
|
5437
5437
|
function enqueue(elem) {
|
|
5438
5438
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
5439
|
-
|
|
5439
|
+
fs15[gracefulQueue].push(elem);
|
|
5440
5440
|
retry();
|
|
5441
5441
|
}
|
|
5442
5442
|
var retryTimer;
|
|
5443
5443
|
function resetQueue() {
|
|
5444
5444
|
var now = Date.now();
|
|
5445
|
-
for (var i = 0; i <
|
|
5446
|
-
if (
|
|
5447
|
-
|
|
5448
|
-
|
|
5445
|
+
for (var i = 0; i < fs15[gracefulQueue].length; ++i) {
|
|
5446
|
+
if (fs15[gracefulQueue][i].length > 2) {
|
|
5447
|
+
fs15[gracefulQueue][i][3] = now;
|
|
5448
|
+
fs15[gracefulQueue][i][4] = now;
|
|
5449
5449
|
}
|
|
5450
5450
|
}
|
|
5451
5451
|
retry();
|
|
@@ -5453,9 +5453,9 @@ var require_graceful_fs = __commonJS({
|
|
|
5453
5453
|
function retry() {
|
|
5454
5454
|
clearTimeout(retryTimer);
|
|
5455
5455
|
retryTimer = void 0;
|
|
5456
|
-
if (
|
|
5456
|
+
if (fs15[gracefulQueue].length === 0)
|
|
5457
5457
|
return;
|
|
5458
|
-
var elem =
|
|
5458
|
+
var elem = fs15[gracefulQueue].shift();
|
|
5459
5459
|
var fn = elem[0];
|
|
5460
5460
|
var args = elem[1];
|
|
5461
5461
|
var err = elem[2];
|
|
@@ -5477,7 +5477,7 @@ var require_graceful_fs = __commonJS({
|
|
|
5477
5477
|
debug("RETRY", fn.name, args);
|
|
5478
5478
|
fn.apply(null, args.concat([startTime]));
|
|
5479
5479
|
} else {
|
|
5480
|
-
|
|
5480
|
+
fs15[gracefulQueue].push(elem);
|
|
5481
5481
|
}
|
|
5482
5482
|
}
|
|
5483
5483
|
if (retryTimer === void 0) {
|
|
@@ -5492,7 +5492,7 @@ var require_fs = __commonJS({
|
|
|
5492
5492
|
"node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
5493
5493
|
"use strict";
|
|
5494
5494
|
var u = require_universalify().fromCallback;
|
|
5495
|
-
var
|
|
5495
|
+
var fs15 = require_graceful_fs();
|
|
5496
5496
|
var api = [
|
|
5497
5497
|
"access",
|
|
5498
5498
|
"appendFile",
|
|
@@ -5533,26 +5533,26 @@ var require_fs = __commonJS({
|
|
|
5533
5533
|
"utimes",
|
|
5534
5534
|
"writeFile"
|
|
5535
5535
|
].filter((key) => {
|
|
5536
|
-
return typeof
|
|
5536
|
+
return typeof fs15[key] === "function";
|
|
5537
5537
|
});
|
|
5538
|
-
Object.assign(exports2,
|
|
5538
|
+
Object.assign(exports2, fs15);
|
|
5539
5539
|
api.forEach((method) => {
|
|
5540
|
-
exports2[method] = u(
|
|
5540
|
+
exports2[method] = u(fs15[method]);
|
|
5541
5541
|
});
|
|
5542
5542
|
exports2.exists = function(filename, callback) {
|
|
5543
5543
|
if (typeof callback === "function") {
|
|
5544
|
-
return
|
|
5544
|
+
return fs15.exists(filename, callback);
|
|
5545
5545
|
}
|
|
5546
5546
|
return new Promise((resolve) => {
|
|
5547
|
-
return
|
|
5547
|
+
return fs15.exists(filename, resolve);
|
|
5548
5548
|
});
|
|
5549
5549
|
};
|
|
5550
5550
|
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
5551
5551
|
if (typeof callback === "function") {
|
|
5552
|
-
return
|
|
5552
|
+
return fs15.read(fd, buffer, offset, length, position, callback);
|
|
5553
5553
|
}
|
|
5554
5554
|
return new Promise((resolve, reject) => {
|
|
5555
|
-
|
|
5555
|
+
fs15.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
5556
5556
|
if (err) return reject(err);
|
|
5557
5557
|
resolve({ bytesRead, buffer: buffer2 });
|
|
5558
5558
|
});
|
|
@@ -5560,10 +5560,10 @@ var require_fs = __commonJS({
|
|
|
5560
5560
|
};
|
|
5561
5561
|
exports2.write = function(fd, buffer, ...args) {
|
|
5562
5562
|
if (typeof args[args.length - 1] === "function") {
|
|
5563
|
-
return
|
|
5563
|
+
return fs15.write(fd, buffer, ...args);
|
|
5564
5564
|
}
|
|
5565
5565
|
return new Promise((resolve, reject) => {
|
|
5566
|
-
|
|
5566
|
+
fs15.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
5567
5567
|
if (err) return reject(err);
|
|
5568
5568
|
resolve({ bytesWritten, buffer: buffer2 });
|
|
5569
5569
|
});
|
|
@@ -5571,10 +5571,10 @@ var require_fs = __commonJS({
|
|
|
5571
5571
|
};
|
|
5572
5572
|
exports2.readv = function(fd, buffers, ...args) {
|
|
5573
5573
|
if (typeof args[args.length - 1] === "function") {
|
|
5574
|
-
return
|
|
5574
|
+
return fs15.readv(fd, buffers, ...args);
|
|
5575
5575
|
}
|
|
5576
5576
|
return new Promise((resolve, reject) => {
|
|
5577
|
-
|
|
5577
|
+
fs15.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
5578
5578
|
if (err) return reject(err);
|
|
5579
5579
|
resolve({ bytesRead, buffers: buffers2 });
|
|
5580
5580
|
});
|
|
@@ -5582,17 +5582,17 @@ var require_fs = __commonJS({
|
|
|
5582
5582
|
};
|
|
5583
5583
|
exports2.writev = function(fd, buffers, ...args) {
|
|
5584
5584
|
if (typeof args[args.length - 1] === "function") {
|
|
5585
|
-
return
|
|
5585
|
+
return fs15.writev(fd, buffers, ...args);
|
|
5586
5586
|
}
|
|
5587
5587
|
return new Promise((resolve, reject) => {
|
|
5588
|
-
|
|
5588
|
+
fs15.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
5589
5589
|
if (err) return reject(err);
|
|
5590
5590
|
resolve({ bytesWritten, buffers: buffers2 });
|
|
5591
5591
|
});
|
|
5592
5592
|
});
|
|
5593
5593
|
};
|
|
5594
|
-
if (typeof
|
|
5595
|
-
exports2.realpath.native = u(
|
|
5594
|
+
if (typeof fs15.realpath.native === "function") {
|
|
5595
|
+
exports2.realpath.native = u(fs15.realpath.native);
|
|
5596
5596
|
} else {
|
|
5597
5597
|
process.emitWarning(
|
|
5598
5598
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -5625,7 +5625,7 @@ var require_utils = __commonJS({
|
|
|
5625
5625
|
var require_make_dir = __commonJS({
|
|
5626
5626
|
"node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
5627
5627
|
"use strict";
|
|
5628
|
-
var
|
|
5628
|
+
var fs15 = require_fs();
|
|
5629
5629
|
var { checkPath } = require_utils();
|
|
5630
5630
|
var getMode = (options) => {
|
|
5631
5631
|
const defaults2 = { mode: 511 };
|
|
@@ -5634,14 +5634,14 @@ var require_make_dir = __commonJS({
|
|
|
5634
5634
|
};
|
|
5635
5635
|
module2.exports.makeDir = async (dir, options) => {
|
|
5636
5636
|
checkPath(dir);
|
|
5637
|
-
return
|
|
5637
|
+
return fs15.mkdir(dir, {
|
|
5638
5638
|
mode: getMode(options),
|
|
5639
5639
|
recursive: true
|
|
5640
5640
|
});
|
|
5641
5641
|
};
|
|
5642
5642
|
module2.exports.makeDirSync = (dir, options) => {
|
|
5643
5643
|
checkPath(dir);
|
|
5644
|
-
return
|
|
5644
|
+
return fs15.mkdirSync(dir, {
|
|
5645
5645
|
mode: getMode(options),
|
|
5646
5646
|
recursive: true
|
|
5647
5647
|
});
|
|
@@ -5673,13 +5673,13 @@ var require_path_exists = __commonJS({
|
|
|
5673
5673
|
"node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
5674
5674
|
"use strict";
|
|
5675
5675
|
var u = require_universalify().fromPromise;
|
|
5676
|
-
var
|
|
5676
|
+
var fs15 = require_fs();
|
|
5677
5677
|
function pathExists2(path5) {
|
|
5678
|
-
return
|
|
5678
|
+
return fs15.access(path5).then(() => true).catch(() => false);
|
|
5679
5679
|
}
|
|
5680
5680
|
module2.exports = {
|
|
5681
5681
|
pathExists: u(pathExists2),
|
|
5682
|
-
pathExistsSync:
|
|
5682
|
+
pathExistsSync: fs15.existsSync
|
|
5683
5683
|
};
|
|
5684
5684
|
}
|
|
5685
5685
|
});
|
|
@@ -5688,16 +5688,16 @@ var require_path_exists = __commonJS({
|
|
|
5688
5688
|
var require_utimes = __commonJS({
|
|
5689
5689
|
"node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
5690
5690
|
"use strict";
|
|
5691
|
-
var
|
|
5691
|
+
var fs15 = require_fs();
|
|
5692
5692
|
var u = require_universalify().fromPromise;
|
|
5693
5693
|
async function utimesMillis(path5, atime, mtime) {
|
|
5694
|
-
const fd = await
|
|
5694
|
+
const fd = await fs15.open(path5, "r+");
|
|
5695
5695
|
let closeErr = null;
|
|
5696
5696
|
try {
|
|
5697
|
-
await
|
|
5697
|
+
await fs15.futimes(fd, atime, mtime);
|
|
5698
5698
|
} finally {
|
|
5699
5699
|
try {
|
|
5700
|
-
await
|
|
5700
|
+
await fs15.close(fd);
|
|
5701
5701
|
} catch (e) {
|
|
5702
5702
|
closeErr = e;
|
|
5703
5703
|
}
|
|
@@ -5707,9 +5707,9 @@ var require_utimes = __commonJS({
|
|
|
5707
5707
|
}
|
|
5708
5708
|
}
|
|
5709
5709
|
function utimesMillisSync(path5, atime, mtime) {
|
|
5710
|
-
const fd =
|
|
5711
|
-
|
|
5712
|
-
return
|
|
5710
|
+
const fd = fs15.openSync(path5, "r+");
|
|
5711
|
+
fs15.futimesSync(fd, atime, mtime);
|
|
5712
|
+
return fs15.closeSync(fd);
|
|
5713
5713
|
}
|
|
5714
5714
|
module2.exports = {
|
|
5715
5715
|
utimesMillis: u(utimesMillis),
|
|
@@ -5722,11 +5722,11 @@ var require_utimes = __commonJS({
|
|
|
5722
5722
|
var require_stat = __commonJS({
|
|
5723
5723
|
"node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
5724
5724
|
"use strict";
|
|
5725
|
-
var
|
|
5725
|
+
var fs15 = require_fs();
|
|
5726
5726
|
var path5 = require("path");
|
|
5727
5727
|
var u = require_universalify().fromPromise;
|
|
5728
5728
|
function getStats(src, dest, opts) {
|
|
5729
|
-
const statFunc = opts.dereference ? (file) =>
|
|
5729
|
+
const statFunc = opts.dereference ? (file) => fs15.stat(file, { bigint: true }) : (file) => fs15.lstat(file, { bigint: true });
|
|
5730
5730
|
return Promise.all([
|
|
5731
5731
|
statFunc(src),
|
|
5732
5732
|
statFunc(dest).catch((err) => {
|
|
@@ -5737,7 +5737,7 @@ var require_stat = __commonJS({
|
|
|
5737
5737
|
}
|
|
5738
5738
|
function getStatsSync(src, dest, opts) {
|
|
5739
5739
|
let destStat;
|
|
5740
|
-
const statFunc = opts.dereference ? (file) =>
|
|
5740
|
+
const statFunc = opts.dereference ? (file) => fs15.statSync(file, { bigint: true }) : (file) => fs15.lstatSync(file, { bigint: true });
|
|
5741
5741
|
const srcStat = statFunc(src);
|
|
5742
5742
|
try {
|
|
5743
5743
|
destStat = statFunc(dest);
|
|
@@ -5799,7 +5799,7 @@ var require_stat = __commonJS({
|
|
|
5799
5799
|
if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
|
|
5800
5800
|
let destStat;
|
|
5801
5801
|
try {
|
|
5802
|
-
destStat = await
|
|
5802
|
+
destStat = await fs15.stat(destParent, { bigint: true });
|
|
5803
5803
|
} catch (err) {
|
|
5804
5804
|
if (err.code === "ENOENT") return;
|
|
5805
5805
|
throw err;
|
|
@@ -5815,7 +5815,7 @@ var require_stat = __commonJS({
|
|
|
5815
5815
|
if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
|
|
5816
5816
|
let destStat;
|
|
5817
5817
|
try {
|
|
5818
|
-
destStat =
|
|
5818
|
+
destStat = fs15.statSync(destParent, { bigint: true });
|
|
5819
5819
|
} catch (err) {
|
|
5820
5820
|
if (err.code === "ENOENT") return;
|
|
5821
5821
|
throw err;
|
|
@@ -5882,7 +5882,7 @@ var require_async = __commonJS({
|
|
|
5882
5882
|
var require_copy = __commonJS({
|
|
5883
5883
|
"node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
5884
5884
|
"use strict";
|
|
5885
|
-
var
|
|
5885
|
+
var fs15 = require_fs();
|
|
5886
5886
|
var path5 = require("path");
|
|
5887
5887
|
var { mkdirs } = require_mkdirs();
|
|
5888
5888
|
var { pathExists: pathExists2 } = require_path_exists();
|
|
@@ -5918,7 +5918,7 @@ var require_copy = __commonJS({
|
|
|
5918
5918
|
return opts.filter(src, dest);
|
|
5919
5919
|
}
|
|
5920
5920
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
5921
|
-
const statFn = opts.dereference ?
|
|
5921
|
+
const statFn = opts.dereference ? fs15.stat : fs15.lstat;
|
|
5922
5922
|
const srcStat = await statFn(src);
|
|
5923
5923
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
5924
5924
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -5930,7 +5930,7 @@ var require_copy = __commonJS({
|
|
|
5930
5930
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
5931
5931
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
5932
5932
|
if (opts.overwrite) {
|
|
5933
|
-
await
|
|
5933
|
+
await fs15.unlink(dest);
|
|
5934
5934
|
return copyFile(srcStat, src, dest, opts);
|
|
5935
5935
|
}
|
|
5936
5936
|
if (opts.errorOnExist) {
|
|
@@ -5938,27 +5938,27 @@ var require_copy = __commonJS({
|
|
|
5938
5938
|
}
|
|
5939
5939
|
}
|
|
5940
5940
|
async function copyFile(srcStat, src, dest, opts) {
|
|
5941
|
-
await
|
|
5941
|
+
await fs15.copyFile(src, dest);
|
|
5942
5942
|
if (opts.preserveTimestamps) {
|
|
5943
5943
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
5944
5944
|
await makeFileWritable(dest, srcStat.mode);
|
|
5945
5945
|
}
|
|
5946
|
-
const updatedSrcStat = await
|
|
5946
|
+
const updatedSrcStat = await fs15.stat(src);
|
|
5947
5947
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
5948
5948
|
}
|
|
5949
|
-
return
|
|
5949
|
+
return fs15.chmod(dest, srcStat.mode);
|
|
5950
5950
|
}
|
|
5951
5951
|
function fileIsNotWritable(srcMode) {
|
|
5952
5952
|
return (srcMode & 128) === 0;
|
|
5953
5953
|
}
|
|
5954
5954
|
function makeFileWritable(dest, srcMode) {
|
|
5955
|
-
return
|
|
5955
|
+
return fs15.chmod(dest, srcMode | 128);
|
|
5956
5956
|
}
|
|
5957
5957
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
5958
5958
|
if (!destStat) {
|
|
5959
|
-
await
|
|
5959
|
+
await fs15.mkdir(dest);
|
|
5960
5960
|
}
|
|
5961
|
-
await asyncIteratorConcurrentProcess(await
|
|
5961
|
+
await asyncIteratorConcurrentProcess(await fs15.opendir(src), async (item) => {
|
|
5962
5962
|
const srcItem = path5.join(src, item.name);
|
|
5963
5963
|
const destItem = path5.join(dest, item.name);
|
|
5964
5964
|
const include = await runFilter(srcItem, destItem, opts);
|
|
@@ -5968,22 +5968,22 @@ var require_copy = __commonJS({
|
|
|
5968
5968
|
}
|
|
5969
5969
|
});
|
|
5970
5970
|
if (!destStat) {
|
|
5971
|
-
await
|
|
5971
|
+
await fs15.chmod(dest, srcStat.mode);
|
|
5972
5972
|
}
|
|
5973
5973
|
}
|
|
5974
5974
|
async function onLink(destStat, src, dest, opts) {
|
|
5975
|
-
let resolvedSrc = await
|
|
5975
|
+
let resolvedSrc = await fs15.readlink(src);
|
|
5976
5976
|
if (opts.dereference) {
|
|
5977
5977
|
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
5978
5978
|
}
|
|
5979
5979
|
if (!destStat) {
|
|
5980
|
-
return
|
|
5980
|
+
return fs15.symlink(resolvedSrc, dest);
|
|
5981
5981
|
}
|
|
5982
5982
|
let resolvedDest = null;
|
|
5983
5983
|
try {
|
|
5984
|
-
resolvedDest = await
|
|
5984
|
+
resolvedDest = await fs15.readlink(dest);
|
|
5985
5985
|
} catch (e) {
|
|
5986
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
5986
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs15.symlink(resolvedSrc, dest);
|
|
5987
5987
|
throw e;
|
|
5988
5988
|
}
|
|
5989
5989
|
if (opts.dereference) {
|
|
@@ -5997,8 +5997,8 @@ var require_copy = __commonJS({
|
|
|
5997
5997
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
5998
5998
|
}
|
|
5999
5999
|
}
|
|
6000
|
-
await
|
|
6001
|
-
return
|
|
6000
|
+
await fs15.unlink(dest);
|
|
6001
|
+
return fs15.symlink(resolvedSrc, dest);
|
|
6002
6002
|
}
|
|
6003
6003
|
module2.exports = copy;
|
|
6004
6004
|
}
|
|
@@ -6008,7 +6008,7 @@ var require_copy = __commonJS({
|
|
|
6008
6008
|
var require_copy_sync = __commonJS({
|
|
6009
6009
|
"node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
6010
6010
|
"use strict";
|
|
6011
|
-
var
|
|
6011
|
+
var fs15 = require_graceful_fs();
|
|
6012
6012
|
var path5 = require("path");
|
|
6013
6013
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
6014
6014
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
@@ -6031,11 +6031,11 @@ var require_copy_sync = __commonJS({
|
|
|
6031
6031
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
6032
6032
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
6033
6033
|
const destParent = path5.dirname(dest);
|
|
6034
|
-
if (!
|
|
6034
|
+
if (!fs15.existsSync(destParent)) mkdirsSync(destParent);
|
|
6035
6035
|
return getStats(destStat, src, dest, opts);
|
|
6036
6036
|
}
|
|
6037
6037
|
function getStats(destStat, src, dest, opts) {
|
|
6038
|
-
const statSync = opts.dereference ?
|
|
6038
|
+
const statSync = opts.dereference ? fs15.statSync : fs15.lstatSync;
|
|
6039
6039
|
const srcStat = statSync(src);
|
|
6040
6040
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
6041
6041
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -6050,14 +6050,14 @@ var require_copy_sync = __commonJS({
|
|
|
6050
6050
|
}
|
|
6051
6051
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
6052
6052
|
if (opts.overwrite) {
|
|
6053
|
-
|
|
6053
|
+
fs15.unlinkSync(dest);
|
|
6054
6054
|
return copyFile(srcStat, src, dest, opts);
|
|
6055
6055
|
} else if (opts.errorOnExist) {
|
|
6056
6056
|
throw new Error(`'${dest}' already exists`);
|
|
6057
6057
|
}
|
|
6058
6058
|
}
|
|
6059
6059
|
function copyFile(srcStat, src, dest, opts) {
|
|
6060
|
-
|
|
6060
|
+
fs15.copyFileSync(src, dest);
|
|
6061
6061
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
6062
6062
|
return setDestMode(dest, srcStat.mode);
|
|
6063
6063
|
}
|
|
@@ -6072,10 +6072,10 @@ var require_copy_sync = __commonJS({
|
|
|
6072
6072
|
return setDestMode(dest, srcMode | 128);
|
|
6073
6073
|
}
|
|
6074
6074
|
function setDestMode(dest, srcMode) {
|
|
6075
|
-
return
|
|
6075
|
+
return fs15.chmodSync(dest, srcMode);
|
|
6076
6076
|
}
|
|
6077
6077
|
function setDestTimestamps(src, dest) {
|
|
6078
|
-
const updatedSrcStat =
|
|
6078
|
+
const updatedSrcStat = fs15.statSync(src);
|
|
6079
6079
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
6080
6080
|
}
|
|
6081
6081
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -6083,12 +6083,12 @@ var require_copy_sync = __commonJS({
|
|
|
6083
6083
|
return copyDir(src, dest, opts);
|
|
6084
6084
|
}
|
|
6085
6085
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
6086
|
-
|
|
6086
|
+
fs15.mkdirSync(dest);
|
|
6087
6087
|
copyDir(src, dest, opts);
|
|
6088
6088
|
return setDestMode(dest, srcMode);
|
|
6089
6089
|
}
|
|
6090
6090
|
function copyDir(src, dest, opts) {
|
|
6091
|
-
const dir =
|
|
6091
|
+
const dir = fs15.opendirSync(src);
|
|
6092
6092
|
try {
|
|
6093
6093
|
let dirent;
|
|
6094
6094
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -6106,18 +6106,18 @@ var require_copy_sync = __commonJS({
|
|
|
6106
6106
|
return getStats(destStat, srcItem, destItem, opts);
|
|
6107
6107
|
}
|
|
6108
6108
|
function onLink(destStat, src, dest, opts) {
|
|
6109
|
-
let resolvedSrc =
|
|
6109
|
+
let resolvedSrc = fs15.readlinkSync(src);
|
|
6110
6110
|
if (opts.dereference) {
|
|
6111
6111
|
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
6112
6112
|
}
|
|
6113
6113
|
if (!destStat) {
|
|
6114
|
-
return
|
|
6114
|
+
return fs15.symlinkSync(resolvedSrc, dest);
|
|
6115
6115
|
} else {
|
|
6116
6116
|
let resolvedDest;
|
|
6117
6117
|
try {
|
|
6118
|
-
resolvedDest =
|
|
6118
|
+
resolvedDest = fs15.readlinkSync(dest);
|
|
6119
6119
|
} catch (err) {
|
|
6120
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
6120
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs15.symlinkSync(resolvedSrc, dest);
|
|
6121
6121
|
throw err;
|
|
6122
6122
|
}
|
|
6123
6123
|
if (opts.dereference) {
|
|
@@ -6135,8 +6135,8 @@ var require_copy_sync = __commonJS({
|
|
|
6135
6135
|
}
|
|
6136
6136
|
}
|
|
6137
6137
|
function copyLink(resolvedSrc, dest) {
|
|
6138
|
-
|
|
6139
|
-
return
|
|
6138
|
+
fs15.unlinkSync(dest);
|
|
6139
|
+
return fs15.symlinkSync(resolvedSrc, dest);
|
|
6140
6140
|
}
|
|
6141
6141
|
module2.exports = copySync;
|
|
6142
6142
|
}
|
|
@@ -6158,13 +6158,13 @@ var require_copy2 = __commonJS({
|
|
|
6158
6158
|
var require_remove = __commonJS({
|
|
6159
6159
|
"node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
6160
6160
|
"use strict";
|
|
6161
|
-
var
|
|
6161
|
+
var fs15 = require_graceful_fs();
|
|
6162
6162
|
var u = require_universalify().fromCallback;
|
|
6163
6163
|
function remove2(path5, callback) {
|
|
6164
|
-
|
|
6164
|
+
fs15.rm(path5, { recursive: true, force: true }, callback);
|
|
6165
6165
|
}
|
|
6166
6166
|
function removeSync(path5) {
|
|
6167
|
-
|
|
6167
|
+
fs15.rmSync(path5, { recursive: true, force: true });
|
|
6168
6168
|
}
|
|
6169
6169
|
module2.exports = {
|
|
6170
6170
|
remove: u(remove2),
|
|
@@ -6178,14 +6178,14 @@ var require_empty = __commonJS({
|
|
|
6178
6178
|
"node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
6179
6179
|
"use strict";
|
|
6180
6180
|
var u = require_universalify().fromPromise;
|
|
6181
|
-
var
|
|
6181
|
+
var fs15 = require_fs();
|
|
6182
6182
|
var path5 = require("path");
|
|
6183
6183
|
var mkdir = require_mkdirs();
|
|
6184
6184
|
var remove2 = require_remove();
|
|
6185
6185
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
6186
6186
|
let items;
|
|
6187
6187
|
try {
|
|
6188
|
-
items = await
|
|
6188
|
+
items = await fs15.readdir(dir);
|
|
6189
6189
|
} catch {
|
|
6190
6190
|
return mkdir.mkdirs(dir);
|
|
6191
6191
|
}
|
|
@@ -6194,7 +6194,7 @@ var require_empty = __commonJS({
|
|
|
6194
6194
|
function emptyDirSync(dir) {
|
|
6195
6195
|
let items;
|
|
6196
6196
|
try {
|
|
6197
|
-
items =
|
|
6197
|
+
items = fs15.readdirSync(dir);
|
|
6198
6198
|
} catch {
|
|
6199
6199
|
return mkdir.mkdirsSync(dir);
|
|
6200
6200
|
}
|
|
@@ -6218,51 +6218,51 @@ var require_file = __commonJS({
|
|
|
6218
6218
|
"use strict";
|
|
6219
6219
|
var u = require_universalify().fromPromise;
|
|
6220
6220
|
var path5 = require("path");
|
|
6221
|
-
var
|
|
6221
|
+
var fs15 = require_fs();
|
|
6222
6222
|
var mkdir = require_mkdirs();
|
|
6223
6223
|
async function createFile(file) {
|
|
6224
6224
|
let stats;
|
|
6225
6225
|
try {
|
|
6226
|
-
stats = await
|
|
6226
|
+
stats = await fs15.stat(file);
|
|
6227
6227
|
} catch {
|
|
6228
6228
|
}
|
|
6229
6229
|
if (stats && stats.isFile()) return;
|
|
6230
6230
|
const dir = path5.dirname(file);
|
|
6231
6231
|
let dirStats = null;
|
|
6232
6232
|
try {
|
|
6233
|
-
dirStats = await
|
|
6233
|
+
dirStats = await fs15.stat(dir);
|
|
6234
6234
|
} catch (err) {
|
|
6235
6235
|
if (err.code === "ENOENT") {
|
|
6236
6236
|
await mkdir.mkdirs(dir);
|
|
6237
|
-
await
|
|
6237
|
+
await fs15.writeFile(file, "");
|
|
6238
6238
|
return;
|
|
6239
6239
|
} else {
|
|
6240
6240
|
throw err;
|
|
6241
6241
|
}
|
|
6242
6242
|
}
|
|
6243
6243
|
if (dirStats.isDirectory()) {
|
|
6244
|
-
await
|
|
6244
|
+
await fs15.writeFile(file, "");
|
|
6245
6245
|
} else {
|
|
6246
|
-
await
|
|
6246
|
+
await fs15.readdir(dir);
|
|
6247
6247
|
}
|
|
6248
6248
|
}
|
|
6249
6249
|
function createFileSync(file) {
|
|
6250
6250
|
let stats;
|
|
6251
6251
|
try {
|
|
6252
|
-
stats =
|
|
6252
|
+
stats = fs15.statSync(file);
|
|
6253
6253
|
} catch {
|
|
6254
6254
|
}
|
|
6255
6255
|
if (stats && stats.isFile()) return;
|
|
6256
6256
|
const dir = path5.dirname(file);
|
|
6257
6257
|
try {
|
|
6258
|
-
if (!
|
|
6259
|
-
|
|
6258
|
+
if (!fs15.statSync(dir).isDirectory()) {
|
|
6259
|
+
fs15.readdirSync(dir);
|
|
6260
6260
|
}
|
|
6261
6261
|
} catch (err) {
|
|
6262
6262
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
6263
6263
|
else throw err;
|
|
6264
6264
|
}
|
|
6265
|
-
|
|
6265
|
+
fs15.writeFileSync(file, "");
|
|
6266
6266
|
}
|
|
6267
6267
|
module2.exports = {
|
|
6268
6268
|
createFile: u(createFile),
|
|
@@ -6277,19 +6277,19 @@ var require_link = __commonJS({
|
|
|
6277
6277
|
"use strict";
|
|
6278
6278
|
var u = require_universalify().fromPromise;
|
|
6279
6279
|
var path5 = require("path");
|
|
6280
|
-
var
|
|
6280
|
+
var fs15 = require_fs();
|
|
6281
6281
|
var mkdir = require_mkdirs();
|
|
6282
6282
|
var { pathExists: pathExists2 } = require_path_exists();
|
|
6283
6283
|
var { areIdentical } = require_stat();
|
|
6284
6284
|
async function createLink(srcpath, dstpath) {
|
|
6285
6285
|
let dstStat;
|
|
6286
6286
|
try {
|
|
6287
|
-
dstStat = await
|
|
6287
|
+
dstStat = await fs15.lstat(dstpath);
|
|
6288
6288
|
} catch {
|
|
6289
6289
|
}
|
|
6290
6290
|
let srcStat;
|
|
6291
6291
|
try {
|
|
6292
|
-
srcStat = await
|
|
6292
|
+
srcStat = await fs15.lstat(srcpath);
|
|
6293
6293
|
} catch (err) {
|
|
6294
6294
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
6295
6295
|
throw err;
|
|
@@ -6300,26 +6300,26 @@ var require_link = __commonJS({
|
|
|
6300
6300
|
if (!dirExists) {
|
|
6301
6301
|
await mkdir.mkdirs(dir);
|
|
6302
6302
|
}
|
|
6303
|
-
await
|
|
6303
|
+
await fs15.link(srcpath, dstpath);
|
|
6304
6304
|
}
|
|
6305
6305
|
function createLinkSync(srcpath, dstpath) {
|
|
6306
6306
|
let dstStat;
|
|
6307
6307
|
try {
|
|
6308
|
-
dstStat =
|
|
6308
|
+
dstStat = fs15.lstatSync(dstpath);
|
|
6309
6309
|
} catch {
|
|
6310
6310
|
}
|
|
6311
6311
|
try {
|
|
6312
|
-
const srcStat =
|
|
6312
|
+
const srcStat = fs15.lstatSync(srcpath);
|
|
6313
6313
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
6314
6314
|
} catch (err) {
|
|
6315
6315
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
6316
6316
|
throw err;
|
|
6317
6317
|
}
|
|
6318
6318
|
const dir = path5.dirname(dstpath);
|
|
6319
|
-
const dirExists =
|
|
6320
|
-
if (dirExists) return
|
|
6319
|
+
const dirExists = fs15.existsSync(dir);
|
|
6320
|
+
if (dirExists) return fs15.linkSync(srcpath, dstpath);
|
|
6321
6321
|
mkdir.mkdirsSync(dir);
|
|
6322
|
-
return
|
|
6322
|
+
return fs15.linkSync(srcpath, dstpath);
|
|
6323
6323
|
}
|
|
6324
6324
|
module2.exports = {
|
|
6325
6325
|
createLink: u(createLink),
|
|
@@ -6333,13 +6333,13 @@ var require_symlink_paths = __commonJS({
|
|
|
6333
6333
|
"node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
6334
6334
|
"use strict";
|
|
6335
6335
|
var path5 = require("path");
|
|
6336
|
-
var
|
|
6336
|
+
var fs15 = require_fs();
|
|
6337
6337
|
var { pathExists: pathExists2 } = require_path_exists();
|
|
6338
6338
|
var u = require_universalify().fromPromise;
|
|
6339
6339
|
async function symlinkPaths(srcpath, dstpath) {
|
|
6340
6340
|
if (path5.isAbsolute(srcpath)) {
|
|
6341
6341
|
try {
|
|
6342
|
-
await
|
|
6342
|
+
await fs15.lstat(srcpath);
|
|
6343
6343
|
} catch (err) {
|
|
6344
6344
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
6345
6345
|
throw err;
|
|
@@ -6359,7 +6359,7 @@ var require_symlink_paths = __commonJS({
|
|
|
6359
6359
|
};
|
|
6360
6360
|
}
|
|
6361
6361
|
try {
|
|
6362
|
-
await
|
|
6362
|
+
await fs15.lstat(srcpath);
|
|
6363
6363
|
} catch (err) {
|
|
6364
6364
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
6365
6365
|
throw err;
|
|
@@ -6371,7 +6371,7 @@ var require_symlink_paths = __commonJS({
|
|
|
6371
6371
|
}
|
|
6372
6372
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
6373
6373
|
if (path5.isAbsolute(srcpath)) {
|
|
6374
|
-
const exists2 =
|
|
6374
|
+
const exists2 = fs15.existsSync(srcpath);
|
|
6375
6375
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
6376
6376
|
return {
|
|
6377
6377
|
toCwd: srcpath,
|
|
@@ -6380,14 +6380,14 @@ var require_symlink_paths = __commonJS({
|
|
|
6380
6380
|
}
|
|
6381
6381
|
const dstdir = path5.dirname(dstpath);
|
|
6382
6382
|
const relativeToDst = path5.join(dstdir, srcpath);
|
|
6383
|
-
const exists =
|
|
6383
|
+
const exists = fs15.existsSync(relativeToDst);
|
|
6384
6384
|
if (exists) {
|
|
6385
6385
|
return {
|
|
6386
6386
|
toCwd: relativeToDst,
|
|
6387
6387
|
toDst: srcpath
|
|
6388
6388
|
};
|
|
6389
6389
|
}
|
|
6390
|
-
const srcExists =
|
|
6390
|
+
const srcExists = fs15.existsSync(srcpath);
|
|
6391
6391
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
6392
6392
|
return {
|
|
6393
6393
|
toCwd: srcpath,
|
|
@@ -6405,13 +6405,13 @@ var require_symlink_paths = __commonJS({
|
|
|
6405
6405
|
var require_symlink_type = __commonJS({
|
|
6406
6406
|
"node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
6407
6407
|
"use strict";
|
|
6408
|
-
var
|
|
6408
|
+
var fs15 = require_fs();
|
|
6409
6409
|
var u = require_universalify().fromPromise;
|
|
6410
6410
|
async function symlinkType(srcpath, type) {
|
|
6411
6411
|
if (type) return type;
|
|
6412
6412
|
let stats;
|
|
6413
6413
|
try {
|
|
6414
|
-
stats = await
|
|
6414
|
+
stats = await fs15.lstat(srcpath);
|
|
6415
6415
|
} catch {
|
|
6416
6416
|
return "file";
|
|
6417
6417
|
}
|
|
@@ -6421,7 +6421,7 @@ var require_symlink_type = __commonJS({
|
|
|
6421
6421
|
if (type) return type;
|
|
6422
6422
|
let stats;
|
|
6423
6423
|
try {
|
|
6424
|
-
stats =
|
|
6424
|
+
stats = fs15.lstatSync(srcpath);
|
|
6425
6425
|
} catch {
|
|
6426
6426
|
return "file";
|
|
6427
6427
|
}
|
|
@@ -6440,7 +6440,7 @@ var require_symlink = __commonJS({
|
|
|
6440
6440
|
"use strict";
|
|
6441
6441
|
var u = require_universalify().fromPromise;
|
|
6442
6442
|
var path5 = require("path");
|
|
6443
|
-
var
|
|
6443
|
+
var fs15 = require_fs();
|
|
6444
6444
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
6445
6445
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
6446
6446
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -6449,13 +6449,13 @@ var require_symlink = __commonJS({
|
|
|
6449
6449
|
async function createSymlink(srcpath, dstpath, type) {
|
|
6450
6450
|
let stats;
|
|
6451
6451
|
try {
|
|
6452
|
-
stats = await
|
|
6452
|
+
stats = await fs15.lstat(dstpath);
|
|
6453
6453
|
} catch {
|
|
6454
6454
|
}
|
|
6455
6455
|
if (stats && stats.isSymbolicLink()) {
|
|
6456
6456
|
const [srcStat, dstStat] = await Promise.all([
|
|
6457
|
-
|
|
6458
|
-
|
|
6457
|
+
fs15.stat(srcpath),
|
|
6458
|
+
fs15.stat(dstpath)
|
|
6459
6459
|
]);
|
|
6460
6460
|
if (areIdentical(srcStat, dstStat)) return;
|
|
6461
6461
|
}
|
|
@@ -6466,27 +6466,27 @@ var require_symlink = __commonJS({
|
|
|
6466
6466
|
if (!await pathExists2(dir)) {
|
|
6467
6467
|
await mkdirs(dir);
|
|
6468
6468
|
}
|
|
6469
|
-
return
|
|
6469
|
+
return fs15.symlink(srcpath, dstpath, toType);
|
|
6470
6470
|
}
|
|
6471
6471
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
6472
6472
|
let stats;
|
|
6473
6473
|
try {
|
|
6474
|
-
stats =
|
|
6474
|
+
stats = fs15.lstatSync(dstpath);
|
|
6475
6475
|
} catch {
|
|
6476
6476
|
}
|
|
6477
6477
|
if (stats && stats.isSymbolicLink()) {
|
|
6478
|
-
const srcStat =
|
|
6479
|
-
const dstStat =
|
|
6478
|
+
const srcStat = fs15.statSync(srcpath);
|
|
6479
|
+
const dstStat = fs15.statSync(dstpath);
|
|
6480
6480
|
if (areIdentical(srcStat, dstStat)) return;
|
|
6481
6481
|
}
|
|
6482
6482
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
6483
6483
|
srcpath = relative.toDst;
|
|
6484
6484
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
6485
6485
|
const dir = path5.dirname(dstpath);
|
|
6486
|
-
const exists =
|
|
6487
|
-
if (exists) return
|
|
6486
|
+
const exists = fs15.existsSync(dir);
|
|
6487
|
+
if (exists) return fs15.symlinkSync(srcpath, dstpath, type);
|
|
6488
6488
|
mkdirsSync(dir);
|
|
6489
|
-
return
|
|
6489
|
+
return fs15.symlinkSync(srcpath, dstpath, type);
|
|
6490
6490
|
}
|
|
6491
6491
|
module2.exports = {
|
|
6492
6492
|
createSymlink: u(createSymlink),
|
|
@@ -6555,9 +6555,9 @@ var require_jsonfile = __commonJS({
|
|
|
6555
6555
|
if (typeof options === "string") {
|
|
6556
6556
|
options = { encoding: options };
|
|
6557
6557
|
}
|
|
6558
|
-
const
|
|
6558
|
+
const fs15 = options.fs || _fs;
|
|
6559
6559
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
6560
|
-
let data = await universalify.fromCallback(
|
|
6560
|
+
let data = await universalify.fromCallback(fs15.readFile)(file, options);
|
|
6561
6561
|
data = stripBom(data);
|
|
6562
6562
|
let obj;
|
|
6563
6563
|
try {
|
|
@@ -6577,10 +6577,10 @@ var require_jsonfile = __commonJS({
|
|
|
6577
6577
|
if (typeof options === "string") {
|
|
6578
6578
|
options = { encoding: options };
|
|
6579
6579
|
}
|
|
6580
|
-
const
|
|
6580
|
+
const fs15 = options.fs || _fs;
|
|
6581
6581
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
6582
6582
|
try {
|
|
6583
|
-
let content =
|
|
6583
|
+
let content = fs15.readFileSync(file, options);
|
|
6584
6584
|
content = stripBom(content);
|
|
6585
6585
|
return JSON.parse(content, options.reviver);
|
|
6586
6586
|
} catch (err) {
|
|
@@ -6593,15 +6593,15 @@ var require_jsonfile = __commonJS({
|
|
|
6593
6593
|
}
|
|
6594
6594
|
}
|
|
6595
6595
|
async function _writeFile(file, obj, options = {}) {
|
|
6596
|
-
const
|
|
6596
|
+
const fs15 = options.fs || _fs;
|
|
6597
6597
|
const str = stringify2(obj, options);
|
|
6598
|
-
await universalify.fromCallback(
|
|
6598
|
+
await universalify.fromCallback(fs15.writeFile)(file, str, options);
|
|
6599
6599
|
}
|
|
6600
6600
|
var writeFile2 = universalify.fromPromise(_writeFile);
|
|
6601
6601
|
function writeFileSync2(file, obj, options = {}) {
|
|
6602
|
-
const
|
|
6602
|
+
const fs15 = options.fs || _fs;
|
|
6603
6603
|
const str = stringify2(obj, options);
|
|
6604
|
-
return
|
|
6604
|
+
return fs15.writeFileSync(file, str, options);
|
|
6605
6605
|
}
|
|
6606
6606
|
module2.exports = {
|
|
6607
6607
|
readFile: readFile2,
|
|
@@ -6632,7 +6632,7 @@ var require_output_file = __commonJS({
|
|
|
6632
6632
|
"node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
6633
6633
|
"use strict";
|
|
6634
6634
|
var u = require_universalify().fromPromise;
|
|
6635
|
-
var
|
|
6635
|
+
var fs15 = require_fs();
|
|
6636
6636
|
var path5 = require("path");
|
|
6637
6637
|
var mkdir = require_mkdirs();
|
|
6638
6638
|
var pathExists2 = require_path_exists().pathExists;
|
|
@@ -6641,14 +6641,14 @@ var require_output_file = __commonJS({
|
|
|
6641
6641
|
if (!await pathExists2(dir)) {
|
|
6642
6642
|
await mkdir.mkdirs(dir);
|
|
6643
6643
|
}
|
|
6644
|
-
return
|
|
6644
|
+
return fs15.writeFile(file, data, encoding);
|
|
6645
6645
|
}
|
|
6646
6646
|
function outputFileSync(file, ...args) {
|
|
6647
6647
|
const dir = path5.dirname(file);
|
|
6648
|
-
if (!
|
|
6648
|
+
if (!fs15.existsSync(dir)) {
|
|
6649
6649
|
mkdir.mkdirsSync(dir);
|
|
6650
6650
|
}
|
|
6651
|
-
|
|
6651
|
+
fs15.writeFileSync(file, ...args);
|
|
6652
6652
|
}
|
|
6653
6653
|
module2.exports = {
|
|
6654
6654
|
outputFile: u(outputFile),
|
|
@@ -6707,7 +6707,7 @@ var require_json = __commonJS({
|
|
|
6707
6707
|
var require_move = __commonJS({
|
|
6708
6708
|
"node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
6709
6709
|
"use strict";
|
|
6710
|
-
var
|
|
6710
|
+
var fs15 = require_fs();
|
|
6711
6711
|
var path5 = require("path");
|
|
6712
6712
|
var { copy } = require_copy2();
|
|
6713
6713
|
var { remove: remove2 } = require_remove();
|
|
@@ -6734,7 +6734,7 @@ var require_move = __commonJS({
|
|
|
6734
6734
|
}
|
|
6735
6735
|
}
|
|
6736
6736
|
try {
|
|
6737
|
-
await
|
|
6737
|
+
await fs15.rename(src, dest);
|
|
6738
6738
|
} catch (err) {
|
|
6739
6739
|
if (err.code !== "EXDEV") {
|
|
6740
6740
|
throw err;
|
|
@@ -6759,7 +6759,7 @@ var require_move = __commonJS({
|
|
|
6759
6759
|
var require_move_sync = __commonJS({
|
|
6760
6760
|
"node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
6761
6761
|
"use strict";
|
|
6762
|
-
var
|
|
6762
|
+
var fs15 = require_graceful_fs();
|
|
6763
6763
|
var path5 = require("path");
|
|
6764
6764
|
var copySync = require_copy2().copySync;
|
|
6765
6765
|
var removeSync = require_remove().removeSync;
|
|
@@ -6784,12 +6784,12 @@ var require_move_sync = __commonJS({
|
|
|
6784
6784
|
removeSync(dest);
|
|
6785
6785
|
return rename(src, dest, overwrite);
|
|
6786
6786
|
}
|
|
6787
|
-
if (
|
|
6787
|
+
if (fs15.existsSync(dest)) throw new Error("dest already exists.");
|
|
6788
6788
|
return rename(src, dest, overwrite);
|
|
6789
6789
|
}
|
|
6790
6790
|
function rename(src, dest, overwrite) {
|
|
6791
6791
|
try {
|
|
6792
|
-
|
|
6792
|
+
fs15.renameSync(src, dest);
|
|
6793
6793
|
} catch (err) {
|
|
6794
6794
|
if (err.code !== "EXDEV") throw err;
|
|
6795
6795
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -19200,7 +19200,7 @@ var require_buffer_list = __commonJS({
|
|
|
19200
19200
|
}
|
|
19201
19201
|
}, {
|
|
19202
19202
|
key: "join",
|
|
19203
|
-
value: function
|
|
19203
|
+
value: function join13(s) {
|
|
19204
19204
|
if (this.length === 0) return "";
|
|
19205
19205
|
var p = this.head;
|
|
19206
19206
|
var ret = "" + p.data;
|
|
@@ -28077,10 +28077,10 @@ var require_lib2 = __commonJS({
|
|
|
28077
28077
|
exports2.analyse = analyse;
|
|
28078
28078
|
var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
|
|
28079
28079
|
let fd;
|
|
28080
|
-
const
|
|
28080
|
+
const fs15 = (0, node_1.default)();
|
|
28081
28081
|
const handler = (err, buffer) => {
|
|
28082
28082
|
if (fd) {
|
|
28083
|
-
|
|
28083
|
+
fs15.closeSync(fd);
|
|
28084
28084
|
}
|
|
28085
28085
|
if (err) {
|
|
28086
28086
|
reject(err);
|
|
@@ -28092,9 +28092,9 @@ var require_lib2 = __commonJS({
|
|
|
28092
28092
|
};
|
|
28093
28093
|
const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
|
|
28094
28094
|
if (sampleSize > 0) {
|
|
28095
|
-
fd =
|
|
28095
|
+
fd = fs15.openSync(filepath, "r");
|
|
28096
28096
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
28097
|
-
|
|
28097
|
+
fs15.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
|
|
28098
28098
|
if (err) {
|
|
28099
28099
|
handler(err, null);
|
|
28100
28100
|
} else {
|
|
@@ -28106,22 +28106,22 @@ var require_lib2 = __commonJS({
|
|
|
28106
28106
|
});
|
|
28107
28107
|
return;
|
|
28108
28108
|
}
|
|
28109
|
-
|
|
28109
|
+
fs15.readFile(filepath, handler);
|
|
28110
28110
|
});
|
|
28111
28111
|
exports2.detectFile = detectFile;
|
|
28112
28112
|
var detectFileSync = (filepath, opts = {}) => {
|
|
28113
|
-
const
|
|
28113
|
+
const fs15 = (0, node_1.default)();
|
|
28114
28114
|
if (opts && opts.sampleSize) {
|
|
28115
|
-
const fd =
|
|
28115
|
+
const fd = fs15.openSync(filepath, "r");
|
|
28116
28116
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
28117
|
-
const bytesRead =
|
|
28117
|
+
const bytesRead = fs15.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
|
|
28118
28118
|
if (bytesRead < opts.sampleSize) {
|
|
28119
28119
|
sample = sample.subarray(0, bytesRead);
|
|
28120
28120
|
}
|
|
28121
|
-
|
|
28121
|
+
fs15.closeSync(fd);
|
|
28122
28122
|
return (0, exports2.detect)(sample);
|
|
28123
28123
|
}
|
|
28124
|
-
return (0, exports2.detect)(
|
|
28124
|
+
return (0, exports2.detect)(fs15.readFileSync(filepath));
|
|
28125
28125
|
};
|
|
28126
28126
|
exports2.detectFileSync = detectFileSync;
|
|
28127
28127
|
exports2.default = {
|
|
@@ -33660,7 +33660,7 @@ var require_table = __commonJS({
|
|
|
33660
33660
|
var debug = require_debug();
|
|
33661
33661
|
var utils = require_utils4();
|
|
33662
33662
|
var tableLayout = require_layout_manager();
|
|
33663
|
-
var
|
|
33663
|
+
var Table6 = class extends Array {
|
|
33664
33664
|
constructor(opts) {
|
|
33665
33665
|
super();
|
|
33666
33666
|
const options = utils.mergeOptions(opts);
|
|
@@ -33735,7 +33735,7 @@ var require_table = __commonJS({
|
|
|
33735
33735
|
return str[0].length;
|
|
33736
33736
|
}
|
|
33737
33737
|
};
|
|
33738
|
-
|
|
33738
|
+
Table6.reset = () => debug.reset();
|
|
33739
33739
|
function doDraw(row, lineNum, result) {
|
|
33740
33740
|
let line = [];
|
|
33741
33741
|
row.forEach(function(cell) {
|
|
@@ -33744,7 +33744,7 @@ var require_table = __commonJS({
|
|
|
33744
33744
|
let str = line.join("");
|
|
33745
33745
|
if (str.length) result.push(str);
|
|
33746
33746
|
}
|
|
33747
|
-
module2.exports =
|
|
33747
|
+
module2.exports = Table6;
|
|
33748
33748
|
}
|
|
33749
33749
|
});
|
|
33750
33750
|
|
|
@@ -39525,9 +39525,9 @@ var require_table2 = __commonJS({
|
|
|
39525
39525
|
var objectHasProperty = require_utils6().objectHasProperty;
|
|
39526
39526
|
var MAX = 65535;
|
|
39527
39527
|
var JSON_COLUMN_ID = "JSON_F52E2B61-18A1-11d1-B105-00805F49916B";
|
|
39528
|
-
function
|
|
39528
|
+
function Table6(name) {
|
|
39529
39529
|
if (name) {
|
|
39530
|
-
const parsed =
|
|
39530
|
+
const parsed = Table6.parseName(name);
|
|
39531
39531
|
this.name = parsed.name;
|
|
39532
39532
|
this.schema = parsed.schema;
|
|
39533
39533
|
this.database = parsed.database;
|
|
@@ -39573,7 +39573,7 @@ var require_table2 = __commonJS({
|
|
|
39573
39573
|
}
|
|
39574
39574
|
);
|
|
39575
39575
|
}
|
|
39576
|
-
|
|
39576
|
+
Table6.prototype._makeBulk = function _makeBulk() {
|
|
39577
39577
|
for (let i = 0; i < this.columns.length; i++) {
|
|
39578
39578
|
const col = this.columns[i];
|
|
39579
39579
|
switch (col.type) {
|
|
@@ -39605,7 +39605,7 @@ var require_table2 = __commonJS({
|
|
|
39605
39605
|
}
|
|
39606
39606
|
return this;
|
|
39607
39607
|
};
|
|
39608
|
-
|
|
39608
|
+
Table6.prototype.declare = function declare() {
|
|
39609
39609
|
const pkey = this.columns.filter((col) => col.primary === true).map((col) => `[${col.name}]`);
|
|
39610
39610
|
const cols = this.columns.map((col) => {
|
|
39611
39611
|
const def = [`[${col.name}] ${declareType(col.type, col)}`];
|
|
@@ -39622,7 +39622,7 @@ var require_table2 = __commonJS({
|
|
|
39622
39622
|
const constraint = pkey.length > 1 ? `, constraint [PK_${this.temporary ? this.name.substr(1) : this.name}] primary key (${pkey.join(", ")})` : "";
|
|
39623
39623
|
return `create table ${this.path} (${cols.join(", ")}${constraint})`;
|
|
39624
39624
|
};
|
|
39625
|
-
|
|
39625
|
+
Table6.fromRecordset = function fromRecordset(recordset, name) {
|
|
39626
39626
|
const t = new this(name);
|
|
39627
39627
|
for (const colName in recordset.columns) {
|
|
39628
39628
|
if (objectHasProperty(recordset.columns, colName)) {
|
|
@@ -39650,7 +39650,7 @@ var require_table2 = __commonJS({
|
|
|
39650
39650
|
}
|
|
39651
39651
|
return t;
|
|
39652
39652
|
};
|
|
39653
|
-
|
|
39653
|
+
Table6.parseName = function parseName(name) {
|
|
39654
39654
|
const length = name.length;
|
|
39655
39655
|
let cursor = -1;
|
|
39656
39656
|
let buffer = "";
|
|
@@ -39707,7 +39707,7 @@ var require_table2 = __commonJS({
|
|
|
39707
39707
|
throw new Error("Invalid table name.");
|
|
39708
39708
|
}
|
|
39709
39709
|
};
|
|
39710
|
-
module2.exports =
|
|
39710
|
+
module2.exports = Table6;
|
|
39711
39711
|
}
|
|
39712
39712
|
});
|
|
39713
39713
|
|
|
@@ -39716,7 +39716,7 @@ var require_shared = __commonJS({
|
|
|
39716
39716
|
"node_modules/mssql/lib/shared.js"(exports2, module2) {
|
|
39717
39717
|
"use strict";
|
|
39718
39718
|
var TYPES = require_datatypes().TYPES;
|
|
39719
|
-
var
|
|
39719
|
+
var Table6 = require_table2();
|
|
39720
39720
|
var PromiseLibrary = Promise;
|
|
39721
39721
|
var driver = {};
|
|
39722
39722
|
var map8 = [];
|
|
@@ -39739,7 +39739,7 @@ var require_shared = __commonJS({
|
|
|
39739
39739
|
map8.register(Boolean, TYPES.Bit);
|
|
39740
39740
|
map8.register(Date, TYPES.DateTime);
|
|
39741
39741
|
map8.register(Buffer, TYPES.VarBinary);
|
|
39742
|
-
map8.register(
|
|
39742
|
+
map8.register(Table6, TYPES.TVP);
|
|
39743
39743
|
var getTypeByValue = function(value) {
|
|
39744
39744
|
if (value === null || value === void 0) {
|
|
39745
39745
|
return TYPES.NVarChar;
|
|
@@ -41872,7 +41872,7 @@ var require_base = __commonJS({
|
|
|
41872
41872
|
var Transaction = require_transaction();
|
|
41873
41873
|
var { ConnectionError, TransactionError, RequestError, PreparedStatementError, MSSQLError } = require_error2();
|
|
41874
41874
|
var shared = require_shared();
|
|
41875
|
-
var
|
|
41875
|
+
var Table6 = require_table2();
|
|
41876
41876
|
var ISOLATION_LEVEL = require_isolationlevel();
|
|
41877
41877
|
var { TYPES } = require_datatypes();
|
|
41878
41878
|
var { connect, close, on, off, removeListener, query, batch } = require_global_connection();
|
|
@@ -41893,7 +41893,7 @@ var require_base = __commonJS({
|
|
|
41893
41893
|
RequestError,
|
|
41894
41894
|
PreparedStatementError,
|
|
41895
41895
|
MSSQLError,
|
|
41896
|
-
Table:
|
|
41896
|
+
Table: Table6,
|
|
41897
41897
|
ISOLATION_LEVEL,
|
|
41898
41898
|
TYPES,
|
|
41899
41899
|
MAX: 65535,
|
|
@@ -52396,7 +52396,7 @@ var require_msal_node = __commonJS({
|
|
|
52396
52396
|
var crypto5 = require("crypto");
|
|
52397
52397
|
var msalCommon = require_lib6();
|
|
52398
52398
|
var jwt2 = require_jsonwebtoken();
|
|
52399
|
-
var
|
|
52399
|
+
var fs15 = require("fs");
|
|
52400
52400
|
var path5 = require("path");
|
|
52401
52401
|
var Serializer = class {
|
|
52402
52402
|
/**
|
|
@@ -62095,7 +62095,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
62095
62095
|
if (!identityEndpoint || !imdsEndpoint) {
|
|
62096
62096
|
const fileDetectionPath = AZURE_ARC_FILE_DETECTION[process.platform];
|
|
62097
62097
|
try {
|
|
62098
|
-
|
|
62098
|
+
fs15.accessSync(fileDetectionPath, fs15.constants.F_OK | fs15.constants.R_OK);
|
|
62099
62099
|
identityEndpoint = DEFAULT_AZURE_ARC_IDENTITY_ENDPOINT;
|
|
62100
62100
|
imdsEndpoint = HIMDS_EXECUTABLE_HELPER_STRING;
|
|
62101
62101
|
} catch (err) {
|
|
@@ -62207,7 +62207,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
62207
62207
|
}
|
|
62208
62208
|
let secretFileSize;
|
|
62209
62209
|
try {
|
|
62210
|
-
secretFileSize = await
|
|
62210
|
+
secretFileSize = await fs15.statSync(secretFilePath).size;
|
|
62211
62211
|
} catch (e) {
|
|
62212
62212
|
throw createManagedIdentityError(unableToReadSecretFile);
|
|
62213
62213
|
}
|
|
@@ -62216,7 +62216,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
62216
62216
|
}
|
|
62217
62217
|
let secret;
|
|
62218
62218
|
try {
|
|
62219
|
-
secret =
|
|
62219
|
+
secret = fs15.readFileSync(secretFilePath, EncodingTypes.UTF8);
|
|
62220
62220
|
} catch (e) {
|
|
62221
62221
|
throw createManagedIdentityError(unableToReadSecretFile);
|
|
62222
62222
|
}
|
|
@@ -63573,22 +63573,22 @@ var require_utils7 = __commonJS({
|
|
|
63573
63573
|
}
|
|
63574
63574
|
return [];
|
|
63575
63575
|
}
|
|
63576
|
-
var defaultLoggerCallback = (credLogger,
|
|
63576
|
+
var defaultLoggerCallback = (credLogger, platform3 = core_util_1.isNode ? "Node" : "Browser") => (level, message, containsPii) => {
|
|
63577
63577
|
if (containsPii) {
|
|
63578
63578
|
return;
|
|
63579
63579
|
}
|
|
63580
63580
|
switch (level) {
|
|
63581
63581
|
case msal_js_1.msalCommon.LogLevel.Error:
|
|
63582
|
-
credLogger.info(`MSAL ${
|
|
63582
|
+
credLogger.info(`MSAL ${platform3} V2 error: ${message}`);
|
|
63583
63583
|
return;
|
|
63584
63584
|
case msal_js_1.msalCommon.LogLevel.Info:
|
|
63585
|
-
credLogger.info(`MSAL ${
|
|
63585
|
+
credLogger.info(`MSAL ${platform3} V2 info message: ${message}`);
|
|
63586
63586
|
return;
|
|
63587
63587
|
case msal_js_1.msalCommon.LogLevel.Verbose:
|
|
63588
|
-
credLogger.info(`MSAL ${
|
|
63588
|
+
credLogger.info(`MSAL ${platform3} V2 verbose message: ${message}`);
|
|
63589
63589
|
return;
|
|
63590
63590
|
case msal_js_1.msalCommon.LogLevel.Warning:
|
|
63591
|
-
credLogger.info(`MSAL ${
|
|
63591
|
+
credLogger.info(`MSAL ${platform3} V2 warning: ${message}`);
|
|
63592
63592
|
return;
|
|
63593
63593
|
}
|
|
63594
63594
|
};
|
|
@@ -71103,16 +71103,16 @@ function detectArchBinary(binary) {
|
|
|
71103
71103
|
}
|
|
71104
71104
|
return archBinary;
|
|
71105
71105
|
}
|
|
71106
|
-
function detectPlatformBinary({ [
|
|
71106
|
+
function detectPlatformBinary({ [platform2]: platformBinary }, { wsl }) {
|
|
71107
71107
|
if (wsl && is_wsl_default) {
|
|
71108
71108
|
return detectArchBinary(wsl);
|
|
71109
71109
|
}
|
|
71110
71110
|
if (!platformBinary) {
|
|
71111
|
-
throw new Error(`${
|
|
71111
|
+
throw new Error(`${platform2} is not supported`);
|
|
71112
71112
|
}
|
|
71113
71113
|
return detectArchBinary(platformBinary);
|
|
71114
71114
|
}
|
|
71115
|
-
var import_node_process14, import_node_buffer, import_node_path3, import_node_url3, import_node_util5, import_node_child_process5, import_promises3, import_meta, execFile5, __dirname2, localXdgOpenPath,
|
|
71115
|
+
var import_node_process14, import_node_buffer, import_node_path3, import_node_url3, import_node_util5, import_node_child_process5, import_promises3, import_meta, execFile5, __dirname2, localXdgOpenPath, platform2, arch, pTryEach, baseOpen, open, openApp, apps, open_default;
|
|
71116
71116
|
var init_open = __esm({
|
|
71117
71117
|
"node_modules/open/index.js"() {
|
|
71118
71118
|
"use strict";
|
|
@@ -71131,7 +71131,7 @@ var init_open = __esm({
|
|
|
71131
71131
|
execFile5 = (0, import_node_util5.promisify)(import_node_child_process5.default.execFile);
|
|
71132
71132
|
__dirname2 = import_node_path3.default.dirname((0, import_node_url3.fileURLToPath)(import_meta.url));
|
|
71133
71133
|
localXdgOpenPath = import_node_path3.default.join(__dirname2, "xdg-open");
|
|
71134
|
-
({ platform, arch } = import_node_process14.default);
|
|
71134
|
+
({ platform: platform2, arch } = import_node_process14.default);
|
|
71135
71135
|
pTryEach = async (array, mapper) => {
|
|
71136
71136
|
let latestError;
|
|
71137
71137
|
for (const item of array) {
|
|
@@ -71205,7 +71205,7 @@ var init_open = __esm({
|
|
|
71205
71205
|
let command;
|
|
71206
71206
|
const cliArguments = [];
|
|
71207
71207
|
const childProcessOptions = {};
|
|
71208
|
-
if (
|
|
71208
|
+
if (platform2 === "darwin") {
|
|
71209
71209
|
command = "open";
|
|
71210
71210
|
if (options.wait) {
|
|
71211
71211
|
cliArguments.push("--wait-apps");
|
|
@@ -71219,7 +71219,7 @@ var init_open = __esm({
|
|
|
71219
71219
|
if (app) {
|
|
71220
71220
|
cliArguments.push("-a", app);
|
|
71221
71221
|
}
|
|
71222
|
-
} else if (
|
|
71222
|
+
} else if (platform2 === "win32" || is_wsl_default && !isInsideContainer() && !app) {
|
|
71223
71223
|
command = await powerShellPath();
|
|
71224
71224
|
cliArguments.push(
|
|
71225
71225
|
"-NoProfile",
|
|
@@ -71259,7 +71259,7 @@ var init_open = __esm({
|
|
|
71259
71259
|
exeLocalXdgOpen = true;
|
|
71260
71260
|
} catch {
|
|
71261
71261
|
}
|
|
71262
|
-
const useSystemXdgOpen = import_node_process14.default.versions.electron ?? (
|
|
71262
|
+
const useSystemXdgOpen = import_node_process14.default.versions.electron ?? (platform2 === "android" || isBundled || !exeLocalXdgOpen);
|
|
71263
71263
|
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
71264
71264
|
}
|
|
71265
71265
|
if (appArguments.length > 0) {
|
|
@@ -71270,7 +71270,7 @@ var init_open = __esm({
|
|
|
71270
71270
|
childProcessOptions.detached = true;
|
|
71271
71271
|
}
|
|
71272
71272
|
}
|
|
71273
|
-
if (
|
|
71273
|
+
if (platform2 === "darwin" && appArguments.length > 0) {
|
|
71274
71274
|
cliArguments.push("--args", ...appArguments);
|
|
71275
71275
|
}
|
|
71276
71276
|
if (options.target) {
|
|
@@ -108014,7 +108014,7 @@ var require_request3 = __commonJS({
|
|
|
108014
108014
|
var RequestError = require_request_error();
|
|
108015
108015
|
var { IDS, objectHasProperty } = require_utils6();
|
|
108016
108016
|
var { TYPES, DECLARATIONS, declare, cast } = require_datatypes();
|
|
108017
|
-
var
|
|
108017
|
+
var Table6 = require_table2();
|
|
108018
108018
|
var { PARSERS: UDT } = require_udt2();
|
|
108019
108019
|
var { valueHandler } = require_shared();
|
|
108020
108020
|
var JSON_COLUMN_ID = "JSON_F52E2B61-18A1-11d1-B105-00805F49916B";
|
|
@@ -108239,7 +108239,7 @@ var require_request3 = __commonJS({
|
|
|
108239
108239
|
}
|
|
108240
108240
|
};
|
|
108241
108241
|
var parameterCorrection = function(value) {
|
|
108242
|
-
if (value instanceof
|
|
108242
|
+
if (value instanceof Table6) {
|
|
108243
108243
|
const tvp = {
|
|
108244
108244
|
name: value.name,
|
|
108245
108245
|
schema: value.schema,
|
|
@@ -108553,7 +108553,7 @@ var require_request3 = __commonJS({
|
|
|
108553
108553
|
enumerable: false,
|
|
108554
108554
|
configurable: true,
|
|
108555
108555
|
value(name) {
|
|
108556
|
-
return
|
|
108556
|
+
return Table6.fromRecordset(this, name);
|
|
108557
108557
|
}
|
|
108558
108558
|
});
|
|
108559
108559
|
recordsets.push(recordset);
|
|
@@ -108865,7 +108865,7 @@ var require_request3 = __commonJS({
|
|
|
108865
108865
|
enumerable: false,
|
|
108866
108866
|
configurable: true,
|
|
108867
108867
|
value(name) {
|
|
108868
|
-
return
|
|
108868
|
+
return Table6.fromRecordset(this, name);
|
|
108869
108869
|
}
|
|
108870
108870
|
});
|
|
108871
108871
|
recordsets.push(recordset);
|
|
@@ -112183,19 +112183,331 @@ var logger = {
|
|
|
112183
112183
|
};
|
|
112184
112184
|
|
|
112185
112185
|
// src/lib/installer.ts
|
|
112186
|
+
var import_path2 = require("path");
|
|
112187
|
+
var import_os2 = require("os");
|
|
112188
|
+
var import_child_process2 = require("child_process");
|
|
112189
|
+
var import_fs_extra2 = __toESM(require_lib());
|
|
112190
|
+
|
|
112191
|
+
// src/lib/vscode-settings.ts
|
|
112186
112192
|
var import_path = require("path");
|
|
112187
112193
|
var import_os = require("os");
|
|
112188
|
-
var import_child_process = require("child_process");
|
|
112189
112194
|
var import_fs_extra = __toESM(require_lib());
|
|
112190
|
-
|
|
112191
|
-
|
|
112195
|
+
function getVsCodeSettingsPaths() {
|
|
112196
|
+
const paths = [];
|
|
112197
|
+
const home = (0, import_os.homedir)();
|
|
112198
|
+
const os5 = (0, import_os.platform)();
|
|
112199
|
+
if (os5 === "win32") {
|
|
112200
|
+
const appdata = process.env.APPDATA || (0, import_path.join)(home, "AppData", "Roaming");
|
|
112201
|
+
paths.push(
|
|
112202
|
+
{ path: (0, import_path.join)(appdata, "Code", "User", "settings.json"), variant: "Code" },
|
|
112203
|
+
{ path: (0, import_path.join)(appdata, "Code - Insiders", "User", "settings.json"), variant: "Code - Insiders" }
|
|
112204
|
+
);
|
|
112205
|
+
} else if (os5 === "darwin") {
|
|
112206
|
+
paths.push(
|
|
112207
|
+
{ path: (0, import_path.join)(home, "Library", "Application Support", "Code", "User", "settings.json"), variant: "Code" },
|
|
112208
|
+
{ path: (0, import_path.join)(home, "Library", "Application Support", "Code - Insiders", "User", "settings.json"), variant: "Code - Insiders" }
|
|
112209
|
+
);
|
|
112210
|
+
} else {
|
|
112211
|
+
paths.push(
|
|
112212
|
+
{ path: (0, import_path.join)(home, ".config", "Code", "User", "settings.json"), variant: "Code" },
|
|
112213
|
+
{ path: (0, import_path.join)(home, ".config", "Code - Insiders", "User", "settings.json"), variant: "Code - Insiders" }
|
|
112214
|
+
);
|
|
112215
|
+
}
|
|
112216
|
+
return paths;
|
|
112217
|
+
}
|
|
112218
|
+
async function findVsCodeSettings() {
|
|
112219
|
+
const candidates = getVsCodeSettingsPaths();
|
|
112220
|
+
for (const candidate of candidates) {
|
|
112221
|
+
if (await import_fs_extra.default.pathExists(candidate.path)) {
|
|
112222
|
+
return {
|
|
112223
|
+
found: true,
|
|
112224
|
+
path: candidate.path,
|
|
112225
|
+
variant: candidate.variant
|
|
112226
|
+
};
|
|
112227
|
+
}
|
|
112228
|
+
}
|
|
112229
|
+
return { found: false, path: null, variant: null };
|
|
112230
|
+
}
|
|
112231
|
+
function stripJsonComments(text) {
|
|
112232
|
+
let result = "";
|
|
112233
|
+
let inString = false;
|
|
112234
|
+
let stringChar = "";
|
|
112235
|
+
let i = 0;
|
|
112236
|
+
while (i < text.length) {
|
|
112237
|
+
if (inString) {
|
|
112238
|
+
if (text[i] === "\\") {
|
|
112239
|
+
result += text[i] + (text[i + 1] || "");
|
|
112240
|
+
i += 2;
|
|
112241
|
+
continue;
|
|
112242
|
+
}
|
|
112243
|
+
if (text[i] === stringChar) {
|
|
112244
|
+
inString = false;
|
|
112245
|
+
}
|
|
112246
|
+
result += text[i];
|
|
112247
|
+
i++;
|
|
112248
|
+
continue;
|
|
112249
|
+
}
|
|
112250
|
+
if (text[i] === '"' || text[i] === "'") {
|
|
112251
|
+
inString = true;
|
|
112252
|
+
stringChar = text[i];
|
|
112253
|
+
result += text[i];
|
|
112254
|
+
i++;
|
|
112255
|
+
continue;
|
|
112256
|
+
}
|
|
112257
|
+
if (text[i] === "/" && text[i + 1] === "/") {
|
|
112258
|
+
while (i < text.length && text[i] !== "\n") i++;
|
|
112259
|
+
continue;
|
|
112260
|
+
}
|
|
112261
|
+
if (text[i] === "/" && text[i + 1] === "*") {
|
|
112262
|
+
i += 2;
|
|
112263
|
+
while (i < text.length && !(text[i] === "*" && text[i + 1] === "/")) i++;
|
|
112264
|
+
i += 2;
|
|
112265
|
+
continue;
|
|
112266
|
+
}
|
|
112267
|
+
result += text[i];
|
|
112268
|
+
i++;
|
|
112269
|
+
}
|
|
112270
|
+
result = result.replace(/,\s*([\]}])/g, "$1");
|
|
112271
|
+
return result;
|
|
112272
|
+
}
|
|
112273
|
+
async function readVsCodeSettings(settingsPath) {
|
|
112274
|
+
try {
|
|
112275
|
+
const raw = await import_fs_extra.default.readFile(settingsPath, "utf-8");
|
|
112276
|
+
const cleaned = stripJsonComments(raw);
|
|
112277
|
+
return JSON.parse(cleaned);
|
|
112278
|
+
} catch {
|
|
112279
|
+
logger.warning(`Failed to parse VS Code settings: ${settingsPath}`);
|
|
112280
|
+
return null;
|
|
112281
|
+
}
|
|
112282
|
+
}
|
|
112283
|
+
async function writeVsCodeSettings(settingsPath, settings) {
|
|
112284
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
112285
|
+
const backupPath = settingsPath.replace(".json", `.backup-${timestamp}.json`);
|
|
112286
|
+
if (await import_fs_extra.default.pathExists(settingsPath)) {
|
|
112287
|
+
await import_fs_extra.default.copy(settingsPath, backupPath);
|
|
112288
|
+
}
|
|
112289
|
+
await import_fs_extra.default.writeFile(settingsPath, JSON.stringify(settings, null, 4), "utf-8");
|
|
112290
|
+
return { backupPath };
|
|
112291
|
+
}
|
|
112292
|
+
async function registerMcpInVsCode(servers) {
|
|
112293
|
+
const settingsResult = await findVsCodeSettings();
|
|
112294
|
+
if (!settingsResult.found || !settingsResult.path) {
|
|
112295
|
+
return { success: true, path: null, backupPath: null, skipped: true };
|
|
112296
|
+
}
|
|
112297
|
+
try {
|
|
112298
|
+
const settings = await readVsCodeSettings(settingsResult.path);
|
|
112299
|
+
if (!settings) {
|
|
112300
|
+
return {
|
|
112301
|
+
success: false,
|
|
112302
|
+
path: settingsResult.path,
|
|
112303
|
+
backupPath: null,
|
|
112304
|
+
error: "Failed to parse VS Code settings.json"
|
|
112305
|
+
};
|
|
112306
|
+
}
|
|
112307
|
+
const mcpServers = settings["claudeCode.mcpServers"] || {};
|
|
112308
|
+
for (const server of servers) {
|
|
112309
|
+
mcpServers[server.name] = {
|
|
112310
|
+
command: server.command,
|
|
112311
|
+
args: server.args
|
|
112312
|
+
};
|
|
112313
|
+
}
|
|
112314
|
+
settings["claudeCode.mcpServers"] = mcpServers;
|
|
112315
|
+
const { backupPath } = await writeVsCodeSettings(settingsResult.path, settings);
|
|
112316
|
+
return { success: true, path: settingsResult.path, backupPath };
|
|
112317
|
+
} catch (error) {
|
|
112318
|
+
return {
|
|
112319
|
+
success: false,
|
|
112320
|
+
path: settingsResult.path,
|
|
112321
|
+
backupPath: null,
|
|
112322
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
112323
|
+
};
|
|
112324
|
+
}
|
|
112325
|
+
}
|
|
112326
|
+
async function unregisterMcpFromVsCode(serverNames) {
|
|
112327
|
+
const settingsResult = await findVsCodeSettings();
|
|
112328
|
+
if (!settingsResult.found || !settingsResult.path) {
|
|
112329
|
+
return { success: true, path: null, backupPath: null, skipped: true };
|
|
112330
|
+
}
|
|
112331
|
+
try {
|
|
112332
|
+
const settings = await readVsCodeSettings(settingsResult.path);
|
|
112333
|
+
if (!settings) {
|
|
112334
|
+
return { success: false, path: settingsResult.path, backupPath: null, error: "Failed to parse" };
|
|
112335
|
+
}
|
|
112336
|
+
const mcpServers = settings["claudeCode.mcpServers"] || {};
|
|
112337
|
+
for (const name of serverNames) {
|
|
112338
|
+
delete mcpServers[name];
|
|
112339
|
+
}
|
|
112340
|
+
if (Object.keys(mcpServers).length === 0) {
|
|
112341
|
+
delete settings["claudeCode.mcpServers"];
|
|
112342
|
+
} else {
|
|
112343
|
+
settings["claudeCode.mcpServers"] = mcpServers;
|
|
112344
|
+
}
|
|
112345
|
+
const { backupPath } = await writeVsCodeSettings(settingsResult.path, settings);
|
|
112346
|
+
return { success: true, path: settingsResult.path, backupPath };
|
|
112347
|
+
} catch (error) {
|
|
112348
|
+
return {
|
|
112349
|
+
success: false,
|
|
112350
|
+
path: settingsResult.path,
|
|
112351
|
+
backupPath: null,
|
|
112352
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
112353
|
+
};
|
|
112354
|
+
}
|
|
112355
|
+
}
|
|
112356
|
+
async function getVsCodeMcpServers() {
|
|
112357
|
+
const settingsResult = await findVsCodeSettings();
|
|
112358
|
+
if (!settingsResult.found || !settingsResult.path) {
|
|
112359
|
+
return { found: false, path: null, servers: {} };
|
|
112360
|
+
}
|
|
112361
|
+
const settings = await readVsCodeSettings(settingsResult.path);
|
|
112362
|
+
if (!settings) {
|
|
112363
|
+
return { found: true, path: settingsResult.path, servers: {} };
|
|
112364
|
+
}
|
|
112365
|
+
const mcpServers = settings["claudeCode.mcpServers"] || {};
|
|
112366
|
+
return { found: true, path: settingsResult.path, servers: mcpServers };
|
|
112367
|
+
}
|
|
112368
|
+
|
|
112369
|
+
// src/lib/mcp-checker.ts
|
|
112370
|
+
var import_child_process = require("child_process");
|
|
112371
|
+
var REQUIRED_MCP_SERVERS = [
|
|
112372
|
+
{
|
|
112373
|
+
name: "context7",
|
|
112374
|
+
description: "Library documentation and code examples",
|
|
112375
|
+
command: "npx",
|
|
112376
|
+
args: ["-y", "@upstash/context7-mcp"],
|
|
112377
|
+
installCommand: "claude mcp add context7 -- npx -y @upstash/context7-mcp"
|
|
112378
|
+
},
|
|
112379
|
+
{
|
|
112380
|
+
name: "smartstack",
|
|
112381
|
+
description: "SmartStack validation and scaffolding (bundled)",
|
|
112382
|
+
command: "npx",
|
|
112383
|
+
args: ["-y", "-p", "@atlashub/smartstack-cli", "smartstack-mcp"],
|
|
112384
|
+
installCommand: "claude mcp add smartstack -- npx -y -p @atlashub/smartstack-cli smartstack-mcp"
|
|
112385
|
+
}
|
|
112386
|
+
];
|
|
112387
|
+
function getInstalledMcpServers() {
|
|
112388
|
+
try {
|
|
112389
|
+
const output = (0, import_child_process.execSync)("claude mcp list", {
|
|
112390
|
+
encoding: "utf-8",
|
|
112391
|
+
timeout: 1e4,
|
|
112392
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
112393
|
+
});
|
|
112394
|
+
const servers = [];
|
|
112395
|
+
const lines = output.split("\n").filter((line) => line.trim());
|
|
112396
|
+
for (const line of lines) {
|
|
112397
|
+
if (line.startsWith("\u2500") || line.startsWith("\u2502") || !line.trim()) {
|
|
112398
|
+
continue;
|
|
112399
|
+
}
|
|
112400
|
+
const match2 = line.match(/^[\s│]*([a-zA-Z0-9_-]+)/);
|
|
112401
|
+
if (match2 && match2[1]) {
|
|
112402
|
+
const serverName = match2[1].toLowerCase();
|
|
112403
|
+
if (!["name", "status", "server", "mcp", "installed"].includes(serverName)) {
|
|
112404
|
+
servers.push(serverName);
|
|
112405
|
+
}
|
|
112406
|
+
}
|
|
112407
|
+
}
|
|
112408
|
+
return servers;
|
|
112409
|
+
} catch (error) {
|
|
112410
|
+
return [];
|
|
112411
|
+
}
|
|
112412
|
+
}
|
|
112413
|
+
function isClaudeCodeInstalled() {
|
|
112414
|
+
try {
|
|
112415
|
+
(0, import_child_process.execSync)("claude --version", {
|
|
112416
|
+
encoding: "utf-8",
|
|
112417
|
+
timeout: 5e3,
|
|
112418
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
112419
|
+
});
|
|
112420
|
+
return true;
|
|
112421
|
+
} catch {
|
|
112422
|
+
return false;
|
|
112423
|
+
}
|
|
112424
|
+
}
|
|
112425
|
+
function getClaudeCodeVersion() {
|
|
112426
|
+
try {
|
|
112427
|
+
const output = (0, import_child_process.execSync)("claude --version", {
|
|
112428
|
+
encoding: "utf-8",
|
|
112429
|
+
timeout: 5e3,
|
|
112430
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
112431
|
+
});
|
|
112432
|
+
return output.trim();
|
|
112433
|
+
} catch {
|
|
112434
|
+
return null;
|
|
112435
|
+
}
|
|
112436
|
+
}
|
|
112437
|
+
function checkRequiredMcpServers(requiredServers = REQUIRED_MCP_SERVERS) {
|
|
112438
|
+
const installedServers = getInstalledMcpServers();
|
|
112439
|
+
const servers = [];
|
|
112440
|
+
const missingServers = [];
|
|
112441
|
+
for (const required of requiredServers) {
|
|
112442
|
+
const isInstalled = installedServers.some(
|
|
112443
|
+
(s) => s.toLowerCase() === required.name.toLowerCase() || s.toLowerCase().includes(required.name.toLowerCase())
|
|
112444
|
+
);
|
|
112445
|
+
servers.push({
|
|
112446
|
+
name: required.name,
|
|
112447
|
+
installed: isInstalled,
|
|
112448
|
+
description: required.description,
|
|
112449
|
+
installCommand: required.installCommand
|
|
112450
|
+
});
|
|
112451
|
+
if (!isInstalled) {
|
|
112452
|
+
missingServers.push(required.name);
|
|
112453
|
+
}
|
|
112454
|
+
}
|
|
112455
|
+
return {
|
|
112456
|
+
allInstalled: missingServers.length === 0,
|
|
112457
|
+
servers,
|
|
112458
|
+
missingServers
|
|
112459
|
+
};
|
|
112460
|
+
}
|
|
112461
|
+
async function installMcpServer(serverName) {
|
|
112462
|
+
const required = REQUIRED_MCP_SERVERS.find((s) => s.name.toLowerCase() === serverName.toLowerCase());
|
|
112463
|
+
if (!required) {
|
|
112464
|
+
logger.error(`Unknown MCP server: ${serverName}`);
|
|
112465
|
+
return false;
|
|
112466
|
+
}
|
|
112467
|
+
const spinner = logger.spinner(`Installing ${serverName}...`);
|
|
112468
|
+
try {
|
|
112469
|
+
(0, import_child_process.execSync)(required.installCommand, {
|
|
112470
|
+
encoding: "utf-8",
|
|
112471
|
+
timeout: 6e4,
|
|
112472
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
112473
|
+
});
|
|
112474
|
+
spinner.succeed(`${serverName} installed successfully`);
|
|
112475
|
+
return true;
|
|
112476
|
+
} catch (error) {
|
|
112477
|
+
spinner.fail(`Failed to install ${serverName}`);
|
|
112478
|
+
if (error instanceof Error) {
|
|
112479
|
+
logger.error(error.message);
|
|
112480
|
+
}
|
|
112481
|
+
return false;
|
|
112482
|
+
}
|
|
112483
|
+
}
|
|
112484
|
+
async function installMissingMcpServers() {
|
|
112485
|
+
const result = checkRequiredMcpServers();
|
|
112486
|
+
if (result.allInstalled) {
|
|
112487
|
+
logger.success("All MCP servers already installed");
|
|
112488
|
+
return true;
|
|
112489
|
+
}
|
|
112490
|
+
logger.info(`Installing ${result.missingServers.length} missing MCP server(s)...`);
|
|
112491
|
+
let allSuccess = true;
|
|
112492
|
+
for (const serverName of result.missingServers) {
|
|
112493
|
+
const success = await installMcpServer(serverName);
|
|
112494
|
+
if (!success) {
|
|
112495
|
+
allSuccess = false;
|
|
112496
|
+
}
|
|
112497
|
+
}
|
|
112498
|
+
return allSuccess;
|
|
112499
|
+
}
|
|
112500
|
+
|
|
112501
|
+
// src/lib/installer.ts
|
|
112502
|
+
var PACKAGE_ROOT = (0, import_path2.join)(__dirname, "..");
|
|
112503
|
+
var TEMPLATES_DIR = (0, import_path2.join)(PACKAGE_ROOT, "templates");
|
|
112192
112504
|
var INSTALL_DIRS = ["agents", "hooks", "skills", "scripts"];
|
|
112193
112505
|
var MANIFEST_FILE = ".smartstack-manifest.json";
|
|
112194
112506
|
async function readManifest(claudeDir) {
|
|
112195
|
-
const manifestPath = (0,
|
|
112507
|
+
const manifestPath = (0, import_path2.join)(claudeDir, MANIFEST_FILE);
|
|
112196
112508
|
try {
|
|
112197
|
-
if (await
|
|
112198
|
-
const content = await
|
|
112509
|
+
if (await import_fs_extra2.default.pathExists(manifestPath)) {
|
|
112510
|
+
const content = await import_fs_extra2.default.readFile(manifestPath, "utf-8");
|
|
112199
112511
|
return JSON.parse(content);
|
|
112200
112512
|
}
|
|
112201
112513
|
} catch {
|
|
@@ -112203,13 +112515,13 @@ async function readManifest(claudeDir) {
|
|
|
112203
112515
|
return null;
|
|
112204
112516
|
}
|
|
112205
112517
|
async function writeManifest(claudeDir, manifest) {
|
|
112206
|
-
const manifestPath = (0,
|
|
112207
|
-
await
|
|
112518
|
+
const manifestPath = (0, import_path2.join)(claudeDir, MANIFEST_FILE);
|
|
112519
|
+
await import_fs_extra2.default.writeFile(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
|
|
112208
112520
|
}
|
|
112209
112521
|
function getPackageVersion() {
|
|
112210
112522
|
try {
|
|
112211
|
-
const packagePath = (0,
|
|
112212
|
-
const pkg2 = JSON.parse(
|
|
112523
|
+
const packagePath = (0, import_path2.join)(PACKAGE_ROOT, "package.json");
|
|
112524
|
+
const pkg2 = JSON.parse(import_fs_extra2.default.readFileSync(packagePath, "utf-8"));
|
|
112213
112525
|
return pkg2.version || "0.0.0";
|
|
112214
112526
|
} catch {
|
|
112215
112527
|
return "0.0.0";
|
|
@@ -112222,18 +112534,18 @@ function processTemplateVariables(content, version2) {
|
|
|
112222
112534
|
var DEFAULT_PLUGINS = [];
|
|
112223
112535
|
function getClaudeDir(global3) {
|
|
112224
112536
|
if (global3) {
|
|
112225
|
-
return (0,
|
|
112537
|
+
return (0, import_path2.join)((0, import_os2.homedir)(), ".claude");
|
|
112226
112538
|
} else {
|
|
112227
|
-
return (0,
|
|
112539
|
+
return (0, import_path2.join)(process.cwd(), ".claude");
|
|
112228
112540
|
}
|
|
112229
112541
|
}
|
|
112230
112542
|
async function getTemplateFiles(dir, baseDir = "") {
|
|
112231
112543
|
const files = [];
|
|
112232
|
-
const entries = await
|
|
112544
|
+
const entries = await import_fs_extra2.default.readdir(dir, { withFileTypes: true });
|
|
112233
112545
|
for (const entry of entries) {
|
|
112234
|
-
const relativePath = baseDir ? (0,
|
|
112546
|
+
const relativePath = baseDir ? (0, import_path2.join)(baseDir, entry.name) : entry.name;
|
|
112235
112547
|
if (entry.isDirectory()) {
|
|
112236
|
-
const subFiles = await getTemplateFiles((0,
|
|
112548
|
+
const subFiles = await getTemplateFiles((0, import_path2.join)(dir, entry.name), relativePath);
|
|
112237
112549
|
files.push(...subFiles);
|
|
112238
112550
|
} else if (entry.isFile() && !entry.name.startsWith(".")) {
|
|
112239
112551
|
files.push(relativePath);
|
|
@@ -112256,31 +112568,31 @@ async function installCommands(options = {}) {
|
|
|
112256
112568
|
const dirsToInstall = installAll ? INSTALL_DIRS : INSTALL_DIRS.filter((d) => components.includes(d));
|
|
112257
112569
|
const version2 = getPackageVersion();
|
|
112258
112570
|
for (const dir of dirsToInstall) {
|
|
112259
|
-
const sourceDir = (0,
|
|
112260
|
-
const targetDir = (0,
|
|
112261
|
-
if (!await
|
|
112571
|
+
const sourceDir = (0, import_path2.join)(TEMPLATES_DIR, dir);
|
|
112572
|
+
const targetDir = (0, import_path2.join)(claudeDir, dir);
|
|
112573
|
+
if (!await import_fs_extra2.default.pathExists(sourceDir)) {
|
|
112262
112574
|
logger.warning(`Source directory not found: ${dir}`);
|
|
112263
112575
|
continue;
|
|
112264
112576
|
}
|
|
112265
112577
|
const files = await getTemplateFiles(sourceDir);
|
|
112266
112578
|
for (const file of files) {
|
|
112267
|
-
const src = (0,
|
|
112268
|
-
const dest = (0,
|
|
112269
|
-
const relativePath = (0,
|
|
112579
|
+
const src = (0, import_path2.join)(sourceDir, file);
|
|
112580
|
+
const dest = (0, import_path2.join)(targetDir, file);
|
|
112581
|
+
const relativePath = (0, import_path2.join)(dir, file);
|
|
112270
112582
|
try {
|
|
112271
|
-
const exists = await
|
|
112583
|
+
const exists = await import_fs_extra2.default.pathExists(dest);
|
|
112272
112584
|
if (exists && !options.force) {
|
|
112273
112585
|
result.skipped++;
|
|
112274
112586
|
result.installedFiles.push(relativePath);
|
|
112275
112587
|
continue;
|
|
112276
112588
|
}
|
|
112277
|
-
await
|
|
112589
|
+
await import_fs_extra2.default.ensureDir((0, import_path2.dirname)(dest));
|
|
112278
112590
|
if (file.endsWith(".md")) {
|
|
112279
|
-
const content = await
|
|
112591
|
+
const content = await import_fs_extra2.default.readFile(src, "utf-8");
|
|
112280
112592
|
const processed = processTemplateVariables(content, version2);
|
|
112281
|
-
await
|
|
112593
|
+
await import_fs_extra2.default.writeFile(dest, processed, "utf-8");
|
|
112282
112594
|
} else {
|
|
112283
|
-
await
|
|
112595
|
+
await import_fs_extra2.default.copy(src, dest, { overwrite: options.force });
|
|
112284
112596
|
}
|
|
112285
112597
|
result.installed++;
|
|
112286
112598
|
result.installedFiles.push(relativePath);
|
|
@@ -112297,18 +112609,18 @@ async function installCommands(options = {}) {
|
|
|
112297
112609
|
logger.success(`Installed ${dir}/ (${dirFiles} files)`);
|
|
112298
112610
|
}
|
|
112299
112611
|
if (installAll || components.includes("commands")) {
|
|
112300
|
-
const gitflowDir = (0,
|
|
112301
|
-
await
|
|
112302
|
-
await
|
|
112303
|
-
await
|
|
112304
|
-
await
|
|
112305
|
-
await
|
|
112612
|
+
const gitflowDir = (0, import_path2.join)(claudeDir, "gitflow");
|
|
112613
|
+
await import_fs_extra2.default.ensureDir((0, import_path2.join)(gitflowDir, "plans"));
|
|
112614
|
+
await import_fs_extra2.default.ensureDir((0, import_path2.join)(gitflowDir, "logs"));
|
|
112615
|
+
await import_fs_extra2.default.ensureDir((0, import_path2.join)(gitflowDir, "migrations"));
|
|
112616
|
+
await import_fs_extra2.default.ensureDir((0, import_path2.join)(gitflowDir, "backup"));
|
|
112617
|
+
await import_fs_extra2.default.ensureDir((0, import_path2.join)(gitflowDir, "cache"));
|
|
112306
112618
|
if (!options.skipConfig) {
|
|
112307
|
-
const configSrc = (0,
|
|
112308
|
-
const configDest = (0,
|
|
112309
|
-
if (!await
|
|
112310
|
-
if (await
|
|
112311
|
-
await
|
|
112619
|
+
const configSrc = (0, import_path2.join)(PACKAGE_ROOT, "config", "default-config.json");
|
|
112620
|
+
const configDest = (0, import_path2.join)(gitflowDir, "config.json");
|
|
112621
|
+
if (!await import_fs_extra2.default.pathExists(configDest) || options.force) {
|
|
112622
|
+
if (await import_fs_extra2.default.pathExists(configSrc)) {
|
|
112623
|
+
await import_fs_extra2.default.copy(configSrc, configDest);
|
|
112312
112624
|
logger.success("Created gitflow/config.json");
|
|
112313
112625
|
}
|
|
112314
112626
|
}
|
|
@@ -112330,47 +112642,59 @@ async function installCommands(options = {}) {
|
|
|
112330
112642
|
}
|
|
112331
112643
|
async function registerMcpServer() {
|
|
112332
112644
|
try {
|
|
112333
|
-
const claudeAvailable = (0,
|
|
112645
|
+
const claudeAvailable = (0, import_child_process2.spawnSync)("claude", ["--version"], {
|
|
112334
112646
|
encoding: "utf-8",
|
|
112335
112647
|
shell: true,
|
|
112336
112648
|
timeout: 5e3
|
|
112337
112649
|
});
|
|
112338
112650
|
if (claudeAvailable.status !== 0) {
|
|
112339
|
-
logger.warning("Claude Code CLI not available - skipping MCP registration");
|
|
112340
|
-
|
|
112341
|
-
|
|
112342
|
-
const listResult = (0, import_child_process.spawnSync)("claude", ["mcp", "list"], {
|
|
112343
|
-
encoding: "utf-8",
|
|
112344
|
-
shell: true,
|
|
112345
|
-
timeout: 1e4
|
|
112346
|
-
});
|
|
112347
|
-
const mcpList = listResult.stdout || "";
|
|
112348
|
-
const hasSmartstack = mcpList.toLowerCase().includes("smartstack");
|
|
112349
|
-
if (hasSmartstack && mcpList.includes("@atlashub/smartstack-mcp")) {
|
|
112350
|
-
logger.info("Migrating from standalone @atlashub/smartstack-mcp to bundled version...");
|
|
112351
|
-
(0, import_child_process.spawnSync)("claude", ["mcp", "remove", "smartstack"], {
|
|
112651
|
+
logger.warning("Claude Code CLI not available - skipping CLI MCP registration");
|
|
112652
|
+
} else {
|
|
112653
|
+
const listResult = (0, import_child_process2.spawnSync)("claude", ["mcp", "list"], {
|
|
112352
112654
|
encoding: "utf-8",
|
|
112353
112655
|
shell: true,
|
|
112354
112656
|
timeout: 1e4
|
|
112355
112657
|
});
|
|
112356
|
-
|
|
112357
|
-
|
|
112358
|
-
|
|
112359
|
-
"
|
|
112360
|
-
|
|
112361
|
-
{
|
|
112658
|
+
const mcpList = listResult.stdout || "";
|
|
112659
|
+
const hasSmartstack = mcpList.toLowerCase().includes("smartstack");
|
|
112660
|
+
if (hasSmartstack && mcpList.includes("@atlashub/smartstack-mcp")) {
|
|
112661
|
+
logger.info("Migrating from standalone @atlashub/smartstack-mcp to bundled version...");
|
|
112662
|
+
(0, import_child_process2.spawnSync)("claude", ["mcp", "remove", "smartstack"], {
|
|
112362
112663
|
encoding: "utf-8",
|
|
112363
112664
|
shell: true,
|
|
112364
|
-
timeout:
|
|
112665
|
+
timeout: 1e4
|
|
112666
|
+
});
|
|
112667
|
+
}
|
|
112668
|
+
if (!hasSmartstack || mcpList.includes("@atlashub/smartstack-mcp")) {
|
|
112669
|
+
const addResult = (0, import_child_process2.spawnSync)(
|
|
112670
|
+
"claude",
|
|
112671
|
+
["mcp", "add", "smartstack", "--", "npx", "-y", "-p", "@atlashub/smartstack-cli", "smartstack-mcp"],
|
|
112672
|
+
{
|
|
112673
|
+
encoding: "utf-8",
|
|
112674
|
+
shell: true,
|
|
112675
|
+
timeout: 15e3
|
|
112676
|
+
}
|
|
112677
|
+
);
|
|
112678
|
+
if (addResult.status === 0) {
|
|
112679
|
+
logger.success("Registered SmartStack MCP server (bundled)");
|
|
112680
|
+
} else {
|
|
112681
|
+
logger.warning("Failed to register MCP server - register manually: claude mcp add smartstack -- npx -y -p @atlashub/smartstack-cli smartstack-mcp");
|
|
112365
112682
|
}
|
|
112366
|
-
);
|
|
112367
|
-
if (addResult.status === 0) {
|
|
112368
|
-
logger.success("Registered SmartStack MCP server (bundled)");
|
|
112369
112683
|
} else {
|
|
112370
|
-
logger.
|
|
112684
|
+
logger.info("SmartStack MCP server already registered");
|
|
112371
112685
|
}
|
|
112372
|
-
}
|
|
112373
|
-
|
|
112686
|
+
}
|
|
112687
|
+
try {
|
|
112688
|
+
const servers = REQUIRED_MCP_SERVERS.map((s) => ({
|
|
112689
|
+
name: s.name,
|
|
112690
|
+
command: s.command,
|
|
112691
|
+
args: s.args
|
|
112692
|
+
}));
|
|
112693
|
+
const vsResult = await registerMcpInVsCode(servers);
|
|
112694
|
+
if (vsResult.success && !vsResult.skipped) {
|
|
112695
|
+
logger.success("Registered MCP servers in VS Code settings");
|
|
112696
|
+
}
|
|
112697
|
+
} catch {
|
|
112374
112698
|
}
|
|
112375
112699
|
} catch {
|
|
112376
112700
|
logger.warning("MCP registration skipped (error occurred)");
|
|
@@ -112387,8 +112711,8 @@ async function uninstallCommands(options = {}) {
|
|
|
112387
112711
|
};
|
|
112388
112712
|
const dirsToRemove = removeAll ? INSTALL_DIRS : INSTALL_DIRS.filter((d) => components.includes(d));
|
|
112389
112713
|
for (const dir of dirsToRemove) {
|
|
112390
|
-
const targetDir = (0,
|
|
112391
|
-
if (await
|
|
112714
|
+
const targetDir = (0, import_path2.join)(claudeDir, dir);
|
|
112715
|
+
if (await import_fs_extra2.default.pathExists(targetDir)) {
|
|
112392
112716
|
try {
|
|
112393
112717
|
if (dir === "commands") {
|
|
112394
112718
|
const ourDirs = [
|
|
@@ -112414,15 +112738,15 @@ async function uninstallCommands(options = {}) {
|
|
|
112414
112738
|
"ralph-loop"
|
|
112415
112739
|
];
|
|
112416
112740
|
for (const item of ourDirs) {
|
|
112417
|
-
const itemPath = (0,
|
|
112418
|
-
if (await
|
|
112419
|
-
await
|
|
112741
|
+
const itemPath = (0, import_path2.join)(targetDir, item);
|
|
112742
|
+
if (await import_fs_extra2.default.pathExists(itemPath)) {
|
|
112743
|
+
await import_fs_extra2.default.remove(itemPath);
|
|
112420
112744
|
result.removed++;
|
|
112421
112745
|
}
|
|
112422
112746
|
}
|
|
112423
112747
|
logger.success(`Removed commands (SmartStack files only)`);
|
|
112424
112748
|
} else {
|
|
112425
|
-
await
|
|
112749
|
+
await import_fs_extra2.default.remove(targetDir);
|
|
112426
112750
|
result.removed++;
|
|
112427
112751
|
logger.success(`Removed ${dir}/`);
|
|
112428
112752
|
}
|
|
@@ -112434,9 +112758,9 @@ async function uninstallCommands(options = {}) {
|
|
|
112434
112758
|
}
|
|
112435
112759
|
}
|
|
112436
112760
|
if (!options.keepConfig && (removeAll || components.includes("commands"))) {
|
|
112437
|
-
const gitflowDir = (0,
|
|
112438
|
-
if (await
|
|
112439
|
-
await
|
|
112761
|
+
const gitflowDir = (0, import_path2.join)(claudeDir, "gitflow");
|
|
112762
|
+
if (await import_fs_extra2.default.pathExists(gitflowDir)) {
|
|
112763
|
+
await import_fs_extra2.default.remove(gitflowDir);
|
|
112440
112764
|
logger.success("Removed gitflow/");
|
|
112441
112765
|
result.removed++;
|
|
112442
112766
|
}
|
|
@@ -112476,10 +112800,10 @@ async function updateCommands(options = {}) {
|
|
|
112476
112800
|
}
|
|
112477
112801
|
}
|
|
112478
112802
|
for (const file of obsoleteFiles) {
|
|
112479
|
-
const filePath = (0,
|
|
112803
|
+
const filePath = (0, import_path2.join)(claudeDir, file);
|
|
112480
112804
|
try {
|
|
112481
|
-
if (await
|
|
112482
|
-
await
|
|
112805
|
+
if (await import_fs_extra2.default.pathExists(filePath)) {
|
|
112806
|
+
await import_fs_extra2.default.remove(filePath);
|
|
112483
112807
|
result.removed++;
|
|
112484
112808
|
result.removedFiles.push(file);
|
|
112485
112809
|
logger.warning(`Removed obsolete: ${file}`);
|
|
@@ -112494,11 +112818,11 @@ async function updateCommands(options = {}) {
|
|
|
112494
112818
|
} else {
|
|
112495
112819
|
const newFiles = /* @__PURE__ */ new Set();
|
|
112496
112820
|
for (const dir of INSTALL_DIRS) {
|
|
112497
|
-
const sourceDir = (0,
|
|
112498
|
-
if (await
|
|
112821
|
+
const sourceDir = (0, import_path2.join)(TEMPLATES_DIR, dir);
|
|
112822
|
+
if (await import_fs_extra2.default.pathExists(sourceDir)) {
|
|
112499
112823
|
const files = await getTemplateFiles(sourceDir);
|
|
112500
112824
|
for (const file of files) {
|
|
112501
|
-
newFiles.add((0,
|
|
112825
|
+
newFiles.add((0, import_path2.join)(dir, file));
|
|
112502
112826
|
}
|
|
112503
112827
|
}
|
|
112504
112828
|
}
|
|
@@ -112524,23 +112848,23 @@ Files that would be REMOVED (${wouldRemove.length}):`);
|
|
|
112524
112848
|
}
|
|
112525
112849
|
async function cleanEmptyDirectories(dir) {
|
|
112526
112850
|
for (const subDir of INSTALL_DIRS) {
|
|
112527
|
-
const targetDir = (0,
|
|
112528
|
-
if (await
|
|
112851
|
+
const targetDir = (0, import_path2.join)(dir, subDir);
|
|
112852
|
+
if (await import_fs_extra2.default.pathExists(targetDir)) {
|
|
112529
112853
|
await removeEmptyDirs(targetDir);
|
|
112530
112854
|
}
|
|
112531
112855
|
}
|
|
112532
112856
|
}
|
|
112533
112857
|
async function removeEmptyDirs(dir) {
|
|
112534
112858
|
try {
|
|
112535
|
-
const entries = await
|
|
112859
|
+
const entries = await import_fs_extra2.default.readdir(dir, { withFileTypes: true });
|
|
112536
112860
|
for (const entry of entries) {
|
|
112537
112861
|
if (entry.isDirectory()) {
|
|
112538
|
-
await removeEmptyDirs((0,
|
|
112862
|
+
await removeEmptyDirs((0, import_path2.join)(dir, entry.name));
|
|
112539
112863
|
}
|
|
112540
112864
|
}
|
|
112541
|
-
const remaining = await
|
|
112865
|
+
const remaining = await import_fs_extra2.default.readdir(dir);
|
|
112542
112866
|
if (remaining.length === 0) {
|
|
112543
|
-
await
|
|
112867
|
+
await import_fs_extra2.default.rmdir(dir);
|
|
112544
112868
|
return true;
|
|
112545
112869
|
}
|
|
112546
112870
|
} catch {
|
|
@@ -112564,36 +112888,36 @@ async function checkInstallation(options = {}) {
|
|
|
112564
112888
|
plansCount: 0
|
|
112565
112889
|
}
|
|
112566
112890
|
};
|
|
112567
|
-
const commandsDir = (0,
|
|
112568
|
-
if (await
|
|
112569
|
-
const gitflowExists = await
|
|
112570
|
-
const apexExists = await
|
|
112891
|
+
const commandsDir = (0, import_path2.join)(claudeDir, "commands");
|
|
112892
|
+
if (await import_fs_extra2.default.pathExists(commandsDir)) {
|
|
112893
|
+
const gitflowExists = await import_fs_extra2.default.pathExists((0, import_path2.join)(commandsDir, "gitflow.md"));
|
|
112894
|
+
const apexExists = await import_fs_extra2.default.pathExists((0, import_path2.join)(commandsDir, "apex.md"));
|
|
112571
112895
|
result.components.commands.installed = gitflowExists || apexExists;
|
|
112572
112896
|
const files = await getTemplateFiles(commandsDir);
|
|
112573
112897
|
result.components.commands.count = files.filter((f) => f.endsWith(".md")).length;
|
|
112574
112898
|
}
|
|
112575
|
-
const agentsDir = (0,
|
|
112576
|
-
if (await
|
|
112577
|
-
const files = await
|
|
112899
|
+
const agentsDir = (0, import_path2.join)(claudeDir, "agents");
|
|
112900
|
+
if (await import_fs_extra2.default.pathExists(agentsDir)) {
|
|
112901
|
+
const files = await import_fs_extra2.default.readdir(agentsDir);
|
|
112578
112902
|
result.components.agents.count = files.filter((f) => f.endsWith(".md")).length;
|
|
112579
112903
|
result.components.agents.installed = result.components.agents.count > 0;
|
|
112580
112904
|
}
|
|
112581
|
-
const hooksDir = (0,
|
|
112582
|
-
if (await
|
|
112583
|
-
result.components.hooks.installed = await
|
|
112905
|
+
const hooksDir = (0, import_path2.join)(claudeDir, "hooks");
|
|
112906
|
+
if (await import_fs_extra2.default.pathExists(hooksDir)) {
|
|
112907
|
+
result.components.hooks.installed = await import_fs_extra2.default.pathExists((0, import_path2.join)(hooksDir, "hooks.json"));
|
|
112584
112908
|
result.components.hooks.count = result.components.hooks.installed ? 1 : 0;
|
|
112585
112909
|
}
|
|
112586
|
-
const skillsDir = (0,
|
|
112587
|
-
if (await
|
|
112910
|
+
const skillsDir = (0, import_path2.join)(claudeDir, "skills");
|
|
112911
|
+
if (await import_fs_extra2.default.pathExists(skillsDir)) {
|
|
112588
112912
|
const files = await getTemplateFiles(skillsDir);
|
|
112589
112913
|
result.components.skills.count = files.filter((f) => f.endsWith(".md")).length;
|
|
112590
112914
|
result.components.skills.installed = result.components.skills.count > 0;
|
|
112591
112915
|
}
|
|
112592
|
-
const gitflowDir = (0,
|
|
112593
|
-
result.gitflow.configExists = await
|
|
112594
|
-
const plansDir = (0,
|
|
112595
|
-
if (await
|
|
112596
|
-
const plans = await
|
|
112916
|
+
const gitflowDir = (0, import_path2.join)(claudeDir, "gitflow");
|
|
112917
|
+
result.gitflow.configExists = await import_fs_extra2.default.pathExists((0, import_path2.join)(gitflowDir, "config.json"));
|
|
112918
|
+
const plansDir = (0, import_path2.join)(gitflowDir, "plans");
|
|
112919
|
+
if (await import_fs_extra2.default.pathExists(plansDir)) {
|
|
112920
|
+
const plans = await import_fs_extra2.default.readdir(plansDir);
|
|
112597
112921
|
result.gitflow.plansCount = plans.filter((f) => f.endsWith(".md")).length;
|
|
112598
112922
|
}
|
|
112599
112923
|
result.installed = result.components.commands.installed || result.components.agents.installed || result.components.hooks.installed || result.components.skills.installed;
|
|
@@ -112602,8 +112926,8 @@ async function checkInstallation(options = {}) {
|
|
|
112602
112926
|
async function listInstalledCommands(options = {}) {
|
|
112603
112927
|
const global3 = options.global ?? true;
|
|
112604
112928
|
const claudeDir = getClaudeDir(global3);
|
|
112605
|
-
const commandsDir = (0,
|
|
112606
|
-
if (!await
|
|
112929
|
+
const commandsDir = (0, import_path2.join)(claudeDir, "commands");
|
|
112930
|
+
if (!await import_fs_extra2.default.pathExists(commandsDir)) {
|
|
112607
112931
|
return [];
|
|
112608
112932
|
}
|
|
112609
112933
|
const files = await getTemplateFiles(commandsDir);
|
|
@@ -112611,7 +112935,7 @@ async function listInstalledCommands(options = {}) {
|
|
|
112611
112935
|
}
|
|
112612
112936
|
function isClaudeCliAvailable() {
|
|
112613
112937
|
try {
|
|
112614
|
-
const result = (0,
|
|
112938
|
+
const result = (0, import_child_process2.spawnSync)("claude", ["--version"], {
|
|
112615
112939
|
encoding: "utf-8",
|
|
112616
112940
|
shell: true,
|
|
112617
112941
|
timeout: 5e3
|
|
@@ -112626,13 +112950,13 @@ async function getInstalledPlugins() {
|
|
|
112626
112950
|
return [];
|
|
112627
112951
|
}
|
|
112628
112952
|
try {
|
|
112629
|
-
const result = (0,
|
|
112953
|
+
const result = (0, import_child_process2.spawnSync)("claude", ["plugin", "list", "--json"], {
|
|
112630
112954
|
encoding: "utf-8",
|
|
112631
112955
|
shell: true,
|
|
112632
112956
|
timeout: 1e4
|
|
112633
112957
|
});
|
|
112634
112958
|
if (result.status !== 0 || !result.stdout) {
|
|
112635
|
-
const textResult = (0,
|
|
112959
|
+
const textResult = (0, import_child_process2.spawnSync)("claude", ["plugin", "list"], {
|
|
112636
112960
|
encoding: "utf-8",
|
|
112637
112961
|
shell: true,
|
|
112638
112962
|
timeout: 1e4
|
|
@@ -112668,7 +112992,7 @@ async function installPlugin(plugin) {
|
|
|
112668
112992
|
}
|
|
112669
112993
|
const pluginRef = `${plugin.name}@${plugin.marketplace}`;
|
|
112670
112994
|
try {
|
|
112671
|
-
const result = (0,
|
|
112995
|
+
const result = (0, import_child_process2.spawnSync)("claude", ["plugin", "install", pluginRef], {
|
|
112672
112996
|
encoding: "utf-8",
|
|
112673
112997
|
shell: true,
|
|
112674
112998
|
timeout: 6e4
|
|
@@ -112703,7 +113027,7 @@ async function installDefaultPlugins(options) {
|
|
|
112703
113027
|
return result;
|
|
112704
113028
|
}
|
|
112705
113029
|
try {
|
|
112706
|
-
(0,
|
|
113030
|
+
(0, import_child_process2.spawnSync)("claude", ["plugin", "marketplace", "update"], {
|
|
112707
113031
|
encoding: "utf-8",
|
|
112708
113032
|
shell: true,
|
|
112709
113033
|
timeout: 3e4
|
|
@@ -112733,25 +113057,25 @@ function getDefaultPlugins() {
|
|
|
112733
113057
|
}
|
|
112734
113058
|
async function installRalphConfig(options = {}) {
|
|
112735
113059
|
const projectPath = options.projectPath || process.cwd();
|
|
112736
|
-
const ralphDir = (0,
|
|
112737
|
-
const logsDir = (0,
|
|
112738
|
-
const reportsDir = (0,
|
|
113060
|
+
const ralphDir = (0, import_path2.join)(projectPath, ".ralph");
|
|
113061
|
+
const logsDir = (0, import_path2.join)(ralphDir, "logs");
|
|
113062
|
+
const reportsDir = (0, import_path2.join)(ralphDir, "reports");
|
|
112739
113063
|
const result = {
|
|
112740
113064
|
success: false,
|
|
112741
|
-
configPath: (0,
|
|
113065
|
+
configPath: (0, import_path2.join)(ralphDir, "ralph.config.yaml"),
|
|
112742
113066
|
logsPath: logsDir,
|
|
112743
113067
|
reportsPath: reportsDir,
|
|
112744
113068
|
errors: []
|
|
112745
113069
|
};
|
|
112746
113070
|
try {
|
|
112747
|
-
await
|
|
112748
|
-
await
|
|
112749
|
-
await
|
|
112750
|
-
const configSrc = (0,
|
|
112751
|
-
const configDest = (0,
|
|
112752
|
-
if (await
|
|
112753
|
-
if (!await
|
|
112754
|
-
await
|
|
113071
|
+
await import_fs_extra2.default.ensureDir(ralphDir);
|
|
113072
|
+
await import_fs_extra2.default.ensureDir(logsDir);
|
|
113073
|
+
await import_fs_extra2.default.ensureDir(reportsDir);
|
|
113074
|
+
const configSrc = (0, import_path2.join)(TEMPLATES_DIR, "ralph", "ralph.config.yaml");
|
|
113075
|
+
const configDest = (0, import_path2.join)(ralphDir, "ralph.config.yaml");
|
|
113076
|
+
if (await import_fs_extra2.default.pathExists(configSrc)) {
|
|
113077
|
+
if (!await import_fs_extra2.default.pathExists(configDest) || options.force) {
|
|
113078
|
+
await import_fs_extra2.default.copy(configSrc, configDest);
|
|
112755
113079
|
logger.success("Created .ralph/ralph.config.yaml");
|
|
112756
113080
|
} else {
|
|
112757
113081
|
logger.info(".ralph/ralph.config.yaml already exists (use --force to overwrite)");
|
|
@@ -112760,18 +113084,18 @@ async function installRalphConfig(options = {}) {
|
|
|
112760
113084
|
result.errors.push("Ralph config template not found");
|
|
112761
113085
|
logger.warning("Ralph config template not found in package");
|
|
112762
113086
|
}
|
|
112763
|
-
const gitignoreSrc = (0,
|
|
112764
|
-
const gitignoreDest = (0,
|
|
112765
|
-
if (await
|
|
112766
|
-
if (!await
|
|
112767
|
-
await
|
|
113087
|
+
const gitignoreSrc = (0, import_path2.join)(TEMPLATES_DIR, "ralph", ".gitignore");
|
|
113088
|
+
const gitignoreDest = (0, import_path2.join)(ralphDir, ".gitignore");
|
|
113089
|
+
if (await import_fs_extra2.default.pathExists(gitignoreSrc)) {
|
|
113090
|
+
if (!await import_fs_extra2.default.pathExists(gitignoreDest) || options.force) {
|
|
113091
|
+
await import_fs_extra2.default.copy(gitignoreSrc, gitignoreDest);
|
|
112768
113092
|
}
|
|
112769
113093
|
}
|
|
112770
|
-
const readmeSrc = (0,
|
|
112771
|
-
const readmeDest = (0,
|
|
112772
|
-
if (await
|
|
112773
|
-
if (!await
|
|
112774
|
-
await
|
|
113094
|
+
const readmeSrc = (0, import_path2.join)(TEMPLATES_DIR, "ralph", "README.md");
|
|
113095
|
+
const readmeDest = (0, import_path2.join)(ralphDir, "README.md");
|
|
113096
|
+
if (await import_fs_extra2.default.pathExists(readmeSrc)) {
|
|
113097
|
+
if (!await import_fs_extra2.default.pathExists(readmeDest) || options.force) {
|
|
113098
|
+
await import_fs_extra2.default.copy(readmeSrc, readmeDest);
|
|
112775
113099
|
}
|
|
112776
113100
|
}
|
|
112777
113101
|
result.success = result.errors.length === 0;
|
|
@@ -112784,19 +113108,19 @@ async function installRalphConfig(options = {}) {
|
|
|
112784
113108
|
}
|
|
112785
113109
|
}
|
|
112786
113110
|
async function checkRalphInstallation(projectPath = process.cwd()) {
|
|
112787
|
-
const ralphDir = (0,
|
|
113111
|
+
const ralphDir = (0, import_path2.join)(projectPath, ".ralph");
|
|
112788
113112
|
return {
|
|
112789
|
-
installed: await
|
|
112790
|
-
configExists: await
|
|
112791
|
-
logsDir: await
|
|
112792
|
-
reportsDir: await
|
|
113113
|
+
installed: await import_fs_extra2.default.pathExists(ralphDir),
|
|
113114
|
+
configExists: await import_fs_extra2.default.pathExists((0, import_path2.join)(ralphDir, "ralph.config.yaml")),
|
|
113115
|
+
logsDir: await import_fs_extra2.default.pathExists((0, import_path2.join)(ralphDir, "logs")),
|
|
113116
|
+
reportsDir: await import_fs_extra2.default.pathExists((0, import_path2.join)(ralphDir, "reports"))
|
|
112793
113117
|
};
|
|
112794
113118
|
}
|
|
112795
113119
|
|
|
112796
113120
|
// src/lib/detector.ts
|
|
112797
|
-
var
|
|
112798
|
-
var
|
|
112799
|
-
var
|
|
113121
|
+
var import_path3 = require("path");
|
|
113122
|
+
var import_fs_extra3 = __toESM(require_lib());
|
|
113123
|
+
var import_child_process3 = require("child_process");
|
|
112800
113124
|
async function detectProject(cwd = process.cwd()) {
|
|
112801
113125
|
const info = {
|
|
112802
113126
|
isGitRepo: false,
|
|
@@ -112806,10 +113130,10 @@ async function detectProject(cwd = process.cwd()) {
|
|
|
112806
113130
|
csprojFiles: [],
|
|
112807
113131
|
dbContextName: null
|
|
112808
113132
|
};
|
|
112809
|
-
info.isGitRepo = await
|
|
113133
|
+
info.isGitRepo = await import_fs_extra3.default.pathExists((0, import_path3.join)(cwd, ".git"));
|
|
112810
113134
|
if (info.isGitRepo) {
|
|
112811
113135
|
try {
|
|
112812
|
-
info.currentBranch = (0,
|
|
113136
|
+
info.currentBranch = (0, import_child_process3.execSync)("git branch --show-current", {
|
|
112813
113137
|
cwd,
|
|
112814
113138
|
encoding: "utf-8"
|
|
112815
113139
|
}).trim();
|
|
@@ -112821,7 +113145,7 @@ async function detectProject(cwd = process.cwd()) {
|
|
|
112821
113145
|
info.csprojFiles = files;
|
|
112822
113146
|
info.hasDotNet = files.length > 0;
|
|
112823
113147
|
for (const csproj of files) {
|
|
112824
|
-
const content = await
|
|
113148
|
+
const content = await import_fs_extra3.default.readFile(csproj, "utf-8");
|
|
112825
113149
|
if (content.includes("Microsoft.EntityFrameworkCore")) {
|
|
112826
113150
|
info.hasEfCore = true;
|
|
112827
113151
|
const match2 = content.match(/Include="([^"]*DbContext[^"]*)"/);
|
|
@@ -112838,9 +113162,9 @@ async function findFiles(dir, extension, depth = 3) {
|
|
|
112838
113162
|
async function search(currentDir, currentDepth) {
|
|
112839
113163
|
if (currentDepth > depth) return;
|
|
112840
113164
|
try {
|
|
112841
|
-
const entries = await
|
|
113165
|
+
const entries = await import_fs_extra3.default.readdir(currentDir, { withFileTypes: true });
|
|
112842
113166
|
for (const entry of entries) {
|
|
112843
|
-
const fullPath = (0,
|
|
113167
|
+
const fullPath = (0, import_path3.join)(currentDir, entry.name);
|
|
112844
113168
|
if (entry.isDirectory() && !entry.name.startsWith(".") && entry.name !== "node_modules") {
|
|
112845
113169
|
await search(fullPath, currentDepth + 1);
|
|
112846
113170
|
} else if (entry.isFile() && entry.name.endsWith(extension)) {
|
|
@@ -114675,7 +114999,7 @@ var import_yoctocolors_cjs11 = __toESM(require_yoctocolors_cjs(), 1);
|
|
|
114675
114999
|
|
|
114676
115000
|
// node_modules/@inquirer/external-editor/dist/esm/index.js
|
|
114677
115001
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
114678
|
-
var
|
|
115002
|
+
var import_child_process4 = require("child_process");
|
|
114679
115003
|
var import_fs = require("fs");
|
|
114680
115004
|
var import_node_path = __toESM(require("path"), 1);
|
|
114681
115005
|
var import_node_os2 = __toESM(require("os"), 1);
|
|
@@ -114853,7 +115177,7 @@ var ExternalEditor = class {
|
|
|
114853
115177
|
}
|
|
114854
115178
|
launchEditor() {
|
|
114855
115179
|
try {
|
|
114856
|
-
const editorProcess = (0,
|
|
115180
|
+
const editorProcess = (0, import_child_process4.spawnSync)(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
|
|
114857
115181
|
this.lastExitStatus = editorProcess.status ?? 0;
|
|
114858
115182
|
} catch (launchError) {
|
|
114859
115183
|
throw new LaunchEditorError(launchError);
|
|
@@ -114861,7 +115185,7 @@ var ExternalEditor = class {
|
|
|
114861
115185
|
}
|
|
114862
115186
|
launchEditorAsync(callback) {
|
|
114863
115187
|
try {
|
|
114864
|
-
const editorProcess = (0,
|
|
115188
|
+
const editorProcess = (0, import_child_process4.spawn)(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
|
|
114865
115189
|
editorProcess.on("exit", (code) => {
|
|
114866
115190
|
this.lastExitStatus = code;
|
|
114867
115191
|
setImmediate(callback);
|
|
@@ -115461,7 +115785,7 @@ var updateCommand = new Command("update").description("Update commands to the la
|
|
|
115461
115785
|
});
|
|
115462
115786
|
|
|
115463
115787
|
// src/commands/docs.ts
|
|
115464
|
-
var
|
|
115788
|
+
var import_path4 = require("path");
|
|
115465
115789
|
var import_fs2 = require("fs");
|
|
115466
115790
|
var DOCS_PAGES = ["index", "installation", "init", "commands", "cli-commands", "agents", "apex", "business-analyse", "gitflow", "efcore", "hooks", "ralph-loop", "test-web"];
|
|
115467
115791
|
var docsCommand = new Command("docs").alias("d").description("Open SmartStack documentation in browser").argument("[page]", "Documentation page to open", "index").option("-l, --list", "List available documentation pages").action(async (page, options) => {
|
|
@@ -115481,7 +115805,7 @@ var docsCommand = new Command("docs").alias("d").description("Open SmartStack do
|
|
|
115481
115805
|
console.log(`Available pages: ${DOCS_PAGES.join(", ")}`);
|
|
115482
115806
|
return;
|
|
115483
115807
|
}
|
|
115484
|
-
const docsPath = (0,
|
|
115808
|
+
const docsPath = (0, import_path4.join)((0, import_path4.dirname)(__dirname), ".documentation", `${pageName}.html`);
|
|
115485
115809
|
if (!(0, import_fs2.existsSync)(docsPath)) {
|
|
115486
115810
|
logger.error("Documentation not found");
|
|
115487
115811
|
logger.info(`Expected at: ${docsPath}`);
|
|
@@ -115500,51 +115824,51 @@ var docsCommand = new Command("docs").alias("d").description("Open SmartStack do
|
|
|
115500
115824
|
});
|
|
115501
115825
|
|
|
115502
115826
|
// src/commands/init.ts
|
|
115503
|
-
var
|
|
115504
|
-
var
|
|
115505
|
-
var
|
|
115506
|
-
var
|
|
115827
|
+
var import_fs_extra5 = __toESM(require_lib());
|
|
115828
|
+
var import_path6 = require("path");
|
|
115829
|
+
var import_os3 = require("os");
|
|
115830
|
+
var import_child_process5 = require("child_process");
|
|
115507
115831
|
var import_crypto2 = require("crypto");
|
|
115508
115832
|
|
|
115509
115833
|
// src/lib/file-tracker.ts
|
|
115510
115834
|
var import_crypto = require("crypto");
|
|
115511
|
-
var
|
|
115512
|
-
var
|
|
115835
|
+
var import_path5 = require("path");
|
|
115836
|
+
var import_fs_extra4 = __toESM(require_lib());
|
|
115513
115837
|
var INIT_STATE_FILE = "init-state.json";
|
|
115514
115838
|
var SMARTSTACK_DIR = ".smartstack";
|
|
115515
115839
|
function computeHash(content) {
|
|
115516
115840
|
return (0, import_crypto.createHash)("sha256").update(content).digest("hex");
|
|
115517
115841
|
}
|
|
115518
115842
|
async function computeFileHash(filePath) {
|
|
115519
|
-
const content = await
|
|
115843
|
+
const content = await import_fs_extra4.default.readFile(filePath);
|
|
115520
115844
|
return computeHash(content);
|
|
115521
115845
|
}
|
|
115522
115846
|
async function safeWriteFile(filePath, content, knownHash) {
|
|
115523
115847
|
const newHash = computeHash(content);
|
|
115524
|
-
if (await
|
|
115848
|
+
if (await import_fs_extra4.default.pathExists(filePath)) {
|
|
115525
115849
|
const existingHash = await computeFileHash(filePath);
|
|
115526
115850
|
if (existingHash === newHash) {
|
|
115527
115851
|
return { action: "skipped_identical", hash: newHash };
|
|
115528
115852
|
}
|
|
115529
115853
|
if (knownHash) {
|
|
115530
115854
|
if (existingHash === knownHash) {
|
|
115531
|
-
await
|
|
115532
|
-
await
|
|
115855
|
+
await import_fs_extra4.default.ensureDir((0, import_path5.dirname)(filePath));
|
|
115856
|
+
await import_fs_extra4.default.writeFile(filePath, content);
|
|
115533
115857
|
return { action: "overwritten", hash: newHash };
|
|
115534
115858
|
}
|
|
115535
115859
|
return { action: "skipped_modified", hash: existingHash };
|
|
115536
115860
|
}
|
|
115537
115861
|
return { action: "skipped_modified", hash: existingHash };
|
|
115538
115862
|
}
|
|
115539
|
-
await
|
|
115540
|
-
await
|
|
115863
|
+
await import_fs_extra4.default.ensureDir((0, import_path5.dirname)(filePath));
|
|
115864
|
+
await import_fs_extra4.default.writeFile(filePath, content);
|
|
115541
115865
|
return { action: "created", hash: newHash };
|
|
115542
115866
|
}
|
|
115543
115867
|
async function loadInitState(projectDir) {
|
|
115544
|
-
const statePath = (0,
|
|
115868
|
+
const statePath = (0, import_path5.join)(projectDir, SMARTSTACK_DIR, INIT_STATE_FILE);
|
|
115545
115869
|
try {
|
|
115546
|
-
if (await
|
|
115547
|
-
const content = await
|
|
115870
|
+
if (await import_fs_extra4.default.pathExists(statePath)) {
|
|
115871
|
+
const content = await import_fs_extra4.default.readFile(statePath, "utf-8");
|
|
115548
115872
|
return JSON.parse(content);
|
|
115549
115873
|
}
|
|
115550
115874
|
} catch {
|
|
@@ -115552,10 +115876,10 @@ async function loadInitState(projectDir) {
|
|
|
115552
115876
|
return null;
|
|
115553
115877
|
}
|
|
115554
115878
|
async function saveInitState(projectDir, state) {
|
|
115555
|
-
const dir = (0,
|
|
115556
|
-
await
|
|
115557
|
-
const statePath = (0,
|
|
115558
|
-
await
|
|
115879
|
+
const dir = (0, import_path5.join)(projectDir, SMARTSTACK_DIR);
|
|
115880
|
+
await import_fs_extra4.default.ensureDir(dir);
|
|
115881
|
+
const statePath = (0, import_path5.join)(dir, INIT_STATE_FILE);
|
|
115882
|
+
await import_fs_extra4.default.writeFile(statePath, JSON.stringify(state, null, 2), "utf-8");
|
|
115559
115883
|
}
|
|
115560
115884
|
var INIT_STEPS = [
|
|
115561
115885
|
{ id: "config", name: "Configuration files" },
|
|
@@ -115683,10 +116007,10 @@ function displayResumeSummary(state) {
|
|
|
115683
116007
|
}
|
|
115684
116008
|
|
|
115685
116009
|
// src/commands/init.ts
|
|
115686
|
-
var TEMPLATES_DIR2 = (0,
|
|
116010
|
+
var TEMPLATES_DIR2 = (0, import_path6.join)((0, import_path6.dirname)(__dirname), "templates", "project");
|
|
115687
116011
|
function checkPrerequisites() {
|
|
115688
116012
|
try {
|
|
115689
|
-
const result = (0,
|
|
116013
|
+
const result = (0, import_child_process5.spawnSync)("dotnet", ["--version"], { encoding: "utf-8", shell: true, timeout: 1e4 });
|
|
115690
116014
|
if (result.status === 0 && result.stdout) {
|
|
115691
116015
|
return { dotnet: true, dotnetVersion: result.stdout.trim() };
|
|
115692
116016
|
}
|
|
@@ -115814,20 +116138,20 @@ function validateCSharpNamespace(name) {
|
|
|
115814
116138
|
async function detectProjectContext(name, here) {
|
|
115815
116139
|
const cwd = process.cwd();
|
|
115816
116140
|
if (name && name.trim() && !here) {
|
|
115817
|
-
const projectDir = (0,
|
|
115818
|
-
if (projectDir === cwd || (0,
|
|
116141
|
+
const projectDir = (0, import_path6.isAbsolute)(name) ? name : (0, import_path6.join)(cwd, name);
|
|
116142
|
+
if (projectDir === cwd || (0, import_path6.basename)(cwd) === name) {
|
|
115819
116143
|
} else {
|
|
115820
|
-
const projectName = (0,
|
|
116144
|
+
const projectName = (0, import_path6.basename)(name);
|
|
115821
116145
|
return { projectName, projectDir, inPlace: false };
|
|
115822
116146
|
}
|
|
115823
116147
|
}
|
|
115824
|
-
const parentDir = (0,
|
|
115825
|
-
const currentFolderName = (0,
|
|
116148
|
+
const parentDir = (0, import_path6.dirname)(cwd);
|
|
116149
|
+
const currentFolderName = (0, import_path6.basename)(cwd);
|
|
115826
116150
|
let detectedName;
|
|
115827
|
-
const gitflowConfigPath = (0,
|
|
115828
|
-
if (await
|
|
116151
|
+
const gitflowConfigPath = (0, import_path6.join)(cwd, ".claude", "gitflow", "config.json");
|
|
116152
|
+
if (await import_fs_extra5.default.pathExists(gitflowConfigPath)) {
|
|
115829
116153
|
try {
|
|
115830
|
-
const config = await
|
|
116154
|
+
const config = await import_fs_extra5.default.readJson(gitflowConfigPath);
|
|
115831
116155
|
if (config.repository?.name) {
|
|
115832
116156
|
detectedName = config.repository.name;
|
|
115833
116157
|
}
|
|
@@ -115835,15 +116159,15 @@ async function detectProjectContext(name, here) {
|
|
|
115835
116159
|
}
|
|
115836
116160
|
}
|
|
115837
116161
|
if (!detectedName) {
|
|
115838
|
-
const bareDir = (0,
|
|
115839
|
-
if (await
|
|
115840
|
-
detectedName = (0,
|
|
116162
|
+
const bareDir = (0, import_path6.join)(parentDir, ".bare");
|
|
116163
|
+
if (await import_fs_extra5.default.pathExists(bareDir)) {
|
|
116164
|
+
detectedName = (0, import_path6.basename)(parentDir);
|
|
115841
116165
|
}
|
|
115842
116166
|
}
|
|
115843
116167
|
if (!detectedName) {
|
|
115844
116168
|
const worktreePatterns = /^(\d+-)?(?:main|master|develop|development)$/i;
|
|
115845
116169
|
if (worktreePatterns.test(currentFolderName)) {
|
|
115846
|
-
detectedName = (0,
|
|
116170
|
+
detectedName = (0, import_path6.basename)(parentDir);
|
|
115847
116171
|
} else {
|
|
115848
116172
|
detectedName = currentFolderName;
|
|
115849
116173
|
}
|
|
@@ -115855,7 +116179,7 @@ async function detectProjectContext(name, here) {
|
|
|
115855
116179
|
};
|
|
115856
116180
|
}
|
|
115857
116181
|
async function validateInPlaceDirectory(projectDir) {
|
|
115858
|
-
const hasConfig = await
|
|
116182
|
+
const hasConfig = await import_fs_extra5.default.pathExists((0, import_path6.join)(projectDir, ".smartstack", "config.json"));
|
|
115859
116183
|
const existingState = await loadInitState(projectDir);
|
|
115860
116184
|
if (existingState && hasIncompleteSteps(existingState)) {
|
|
115861
116185
|
return { isResume: true, existingState };
|
|
@@ -115863,15 +116187,15 @@ async function validateInPlaceDirectory(projectDir) {
|
|
|
115863
116187
|
if (hasConfig) {
|
|
115864
116188
|
return { error: 'SmartStack is already initialized in this directory. Use "ss update" to update.', isResume: false };
|
|
115865
116189
|
}
|
|
115866
|
-
const files = await
|
|
116190
|
+
const files = await import_fs_extra5.default.readdir(projectDir);
|
|
115867
116191
|
const hasSln = files.some((f) => f.endsWith(".sln"));
|
|
115868
116192
|
if (hasSln) {
|
|
115869
116193
|
return { error: "A .NET solution already exists in this directory. Cannot initialize SmartStack here.", isResume: false };
|
|
115870
116194
|
}
|
|
115871
|
-
const srcDir = (0,
|
|
115872
|
-
if (await
|
|
115873
|
-
const srcFiles = await
|
|
115874
|
-
const hasCsproj = srcFiles.some((f) => f.endsWith(".csproj") ||
|
|
116195
|
+
const srcDir = (0, import_path6.join)(projectDir, "src");
|
|
116196
|
+
if (await import_fs_extra5.default.pathExists(srcDir)) {
|
|
116197
|
+
const srcFiles = await import_fs_extra5.default.readdir(srcDir);
|
|
116198
|
+
const hasCsproj = srcFiles.some((f) => f.endsWith(".csproj") || import_fs_extra5.default.statSync((0, import_path6.join)(srcDir, f)).isDirectory());
|
|
115875
116199
|
if (hasCsproj) {
|
|
115876
116200
|
return { error: "A src/ directory with projects already exists. Cannot initialize SmartStack here.", isResume: false };
|
|
115877
116201
|
}
|
|
@@ -115884,19 +116208,19 @@ async function checkMcpServers() {
|
|
|
115884
116208
|
context7: { installed: false }
|
|
115885
116209
|
};
|
|
115886
116210
|
const possiblePaths = [
|
|
115887
|
-
(0,
|
|
115888
|
-
(0,
|
|
115889
|
-
(0,
|
|
115890
|
-
(0,
|
|
116211
|
+
(0, import_path6.join)((0, import_os3.homedir)(), ".claude", "settings.json"),
|
|
116212
|
+
(0, import_path6.join)((0, import_os3.homedir)(), ".claude.json"),
|
|
116213
|
+
(0, import_path6.join)((0, import_os3.homedir)(), "AppData", "Roaming", "Claude", "settings.json"),
|
|
116214
|
+
(0, import_path6.join)((0, import_os3.homedir)(), "Library", "Application Support", "Claude", "settings.json")
|
|
115891
116215
|
];
|
|
115892
116216
|
const mcpSettingsPaths = [
|
|
115893
|
-
(0,
|
|
115894
|
-
(0,
|
|
116217
|
+
(0, import_path6.join)((0, import_os3.homedir)(), ".claude", "mcp_servers.json"),
|
|
116218
|
+
(0, import_path6.join)((0, import_os3.homedir)(), ".config", "claude-code", "mcp.json")
|
|
115895
116219
|
];
|
|
115896
116220
|
for (const settingsPath of [...possiblePaths, ...mcpSettingsPaths]) {
|
|
115897
116221
|
try {
|
|
115898
|
-
if (await
|
|
115899
|
-
const content = await
|
|
116222
|
+
if (await import_fs_extra5.default.pathExists(settingsPath)) {
|
|
116223
|
+
const content = await import_fs_extra5.default.readFile(settingsPath, "utf-8");
|
|
115900
116224
|
const settings = JSON.parse(content);
|
|
115901
116225
|
const mcpServers = settings.mcpServers || settings.mcp_servers || settings.servers || settings;
|
|
115902
116226
|
if (mcpServers) {
|
|
@@ -115914,7 +116238,7 @@ async function checkMcpServers() {
|
|
|
115914
116238
|
}
|
|
115915
116239
|
}
|
|
115916
116240
|
try {
|
|
115917
|
-
const claudeResult = (0,
|
|
116241
|
+
const claudeResult = (0, import_child_process5.spawnSync)("claude", ["mcp", "list"], {
|
|
115918
116242
|
encoding: "utf-8",
|
|
115919
116243
|
shell: true,
|
|
115920
116244
|
timeout: 1e4
|
|
@@ -115947,7 +116271,7 @@ function execCommand(command, cwd, dryRun = false) {
|
|
|
115947
116271
|
return;
|
|
115948
116272
|
}
|
|
115949
116273
|
try {
|
|
115950
|
-
(0,
|
|
116274
|
+
(0, import_child_process5.execSync)(command, {
|
|
115951
116275
|
cwd,
|
|
115952
116276
|
stdio: "inherit",
|
|
115953
116277
|
shell: true
|
|
@@ -115979,11 +116303,11 @@ async function getLatestNuGetVersion(packageName, prerelease) {
|
|
|
115979
116303
|
}
|
|
115980
116304
|
}
|
|
115981
116305
|
async function loadTemplate(templateName, projectName) {
|
|
115982
|
-
const templatePath = (0,
|
|
115983
|
-
if (!await
|
|
116306
|
+
const templatePath = (0, import_path6.join)(TEMPLATES_DIR2, templateName);
|
|
116307
|
+
if (!await import_fs_extra5.default.pathExists(templatePath)) {
|
|
115984
116308
|
throw new Error(`Template not found: ${templatePath}`);
|
|
115985
116309
|
}
|
|
115986
|
-
let content = await
|
|
116310
|
+
let content = await import_fs_extra5.default.readFile(templatePath, "utf-8");
|
|
115987
116311
|
content = content.replace(/\{\{ProjectName\}\}/g, projectName);
|
|
115988
116312
|
return content;
|
|
115989
116313
|
}
|
|
@@ -115992,37 +116316,37 @@ async function createDualDbContextStructure(projectDir, projectName, state, dryR
|
|
|
115992
116316
|
logger.info("[DRY RUN] Would create Dual-DbContext structure");
|
|
115993
116317
|
return;
|
|
115994
116318
|
}
|
|
115995
|
-
const srcDir = (0,
|
|
116319
|
+
const srcDir = (0, import_path6.join)(projectDir, "src");
|
|
115996
116320
|
const directories = [
|
|
115997
|
-
(0,
|
|
115998
|
-
(0,
|
|
115999
|
-
(0,
|
|
116000
|
-
(0,
|
|
116001
|
-
(0,
|
|
116321
|
+
(0, import_path6.join)(srcDir, `${projectName}.Application`, "Common", "Interfaces"),
|
|
116322
|
+
(0, import_path6.join)(srcDir, `${projectName}.Infrastructure`, "Persistence"),
|
|
116323
|
+
(0, import_path6.join)(srcDir, `${projectName}.Infrastructure`, "Persistence", "Configurations"),
|
|
116324
|
+
(0, import_path6.join)(srcDir, `${projectName}.Infrastructure`, "Services"),
|
|
116325
|
+
(0, import_path6.join)(srcDir, `${projectName}.Domain`, "Entities")
|
|
116002
116326
|
];
|
|
116003
116327
|
for (const dir of directories) {
|
|
116004
|
-
await
|
|
116328
|
+
await import_fs_extra5.default.ensureDir(dir);
|
|
116005
116329
|
}
|
|
116006
116330
|
const templateFiles = [
|
|
116007
116331
|
{
|
|
116008
116332
|
template: "IExtensionsDbContext.cs.template",
|
|
116009
|
-
destination: (0,
|
|
116333
|
+
destination: (0, import_path6.join)(srcDir, `${projectName}.Application`, "Common", "Interfaces", "IExtensionsDbContext.cs")
|
|
116010
116334
|
},
|
|
116011
116335
|
{
|
|
116012
116336
|
template: "DependencyInjection.Application.cs.template",
|
|
116013
|
-
destination: (0,
|
|
116337
|
+
destination: (0, import_path6.join)(srcDir, `${projectName}.Application`, "DependencyInjection.cs")
|
|
116014
116338
|
},
|
|
116015
116339
|
{
|
|
116016
116340
|
template: "ExtensionsDbContext.cs.template",
|
|
116017
|
-
destination: (0,
|
|
116341
|
+
destination: (0, import_path6.join)(srcDir, `${projectName}.Infrastructure`, "Persistence", "ExtensionsDbContext.cs")
|
|
116018
116342
|
},
|
|
116019
116343
|
{
|
|
116020
116344
|
template: "DesignTimeExtensionsDbContextFactory.cs.template",
|
|
116021
|
-
destination: (0,
|
|
116345
|
+
destination: (0, import_path6.join)(srcDir, `${projectName}.Infrastructure`, "Persistence", "DesignTimeExtensionsDbContextFactory.cs")
|
|
116022
116346
|
},
|
|
116023
116347
|
{
|
|
116024
116348
|
template: "DependencyInjection.Infrastructure.cs.template",
|
|
116025
|
-
destination: (0,
|
|
116349
|
+
destination: (0, import_path6.join)(srcDir, `${projectName}.Infrastructure`, "DependencyInjection.cs")
|
|
116026
116350
|
}
|
|
116027
116351
|
];
|
|
116028
116352
|
for (const { template, destination } of templateFiles) {
|
|
@@ -116040,18 +116364,18 @@ async function createDualDbContextStructure(projectDir, projectName, state, dryR
|
|
|
116040
116364
|
}
|
|
116041
116365
|
async function createBackendStructure(config, state, dryRun) {
|
|
116042
116366
|
const { name } = config;
|
|
116043
|
-
const projectDir = config.projectDir ?? ((0,
|
|
116044
|
-
const projectName = (0,
|
|
116045
|
-
const srcDir = (0,
|
|
116046
|
-
const slnPath = (0,
|
|
116367
|
+
const projectDir = config.projectDir ?? ((0, import_path6.isAbsolute)(name) ? name : (0, import_path6.join)(process.cwd(), name));
|
|
116368
|
+
const projectName = (0, import_path6.basename)(name);
|
|
116369
|
+
const srcDir = (0, import_path6.join)(projectDir, "src");
|
|
116370
|
+
const slnPath = (0, import_path6.join)(projectDir, `${projectName}.sln`);
|
|
116047
116371
|
logger.info("Creating .NET solution structure...");
|
|
116048
|
-
if (dryRun || !await
|
|
116372
|
+
if (dryRun || !await import_fs_extra5.default.pathExists(slnPath)) {
|
|
116049
116373
|
execCommand(`dotnet new sln -n "${projectName}" -o "${projectDir}"`, void 0, dryRun);
|
|
116050
116374
|
} else {
|
|
116051
116375
|
logger.info(source_default.gray("Solution already exists, skipping creation"));
|
|
116052
116376
|
}
|
|
116053
|
-
const slnxPath = (0,
|
|
116054
|
-
if (!dryRun && await
|
|
116377
|
+
const slnxPath = (0, import_path6.join)(projectDir, `${projectName}.slnx`);
|
|
116378
|
+
if (!dryRun && await import_fs_extra5.default.pathExists(slnxPath)) {
|
|
116055
116379
|
const slnContent = `Microsoft Visual Studio Solution File, Format Version 12.00
|
|
116056
116380
|
# Visual Studio Version 17
|
|
116057
116381
|
VisualStudioVersion = 17.0.31903.59
|
|
@@ -116063,8 +116387,8 @@ Global
|
|
|
116063
116387
|
EndGlobalSection
|
|
116064
116388
|
EndGlobal
|
|
116065
116389
|
`;
|
|
116066
|
-
await
|
|
116067
|
-
await
|
|
116390
|
+
await import_fs_extra5.default.writeFile(slnPath, slnContent);
|
|
116391
|
+
await import_fs_extra5.default.remove(slnxPath);
|
|
116068
116392
|
logger.info("Converted .slnx to .sln for VS Code compatibility");
|
|
116069
116393
|
}
|
|
116070
116394
|
const projects = [
|
|
@@ -116074,18 +116398,18 @@ EndGlobal
|
|
|
116074
116398
|
{ proj: `${projectName}.Api`, type: "webapi" }
|
|
116075
116399
|
];
|
|
116076
116400
|
for (const { proj, type } of projects) {
|
|
116077
|
-
const projDir = (0,
|
|
116078
|
-
const csprojPath = (0,
|
|
116079
|
-
if (dryRun || !await
|
|
116401
|
+
const projDir = (0, import_path6.join)(srcDir, proj);
|
|
116402
|
+
const csprojPath = (0, import_path6.join)(projDir, `${proj}.csproj`);
|
|
116403
|
+
if (dryRun || !await import_fs_extra5.default.pathExists(csprojPath)) {
|
|
116080
116404
|
execCommand(`dotnet new ${type} -n "${proj}" -o "${projDir}"`, void 0, dryRun);
|
|
116081
116405
|
execCommand(`dotnet sln "${slnPath}" add "${projDir}"`, void 0, dryRun);
|
|
116082
116406
|
} else {
|
|
116083
116407
|
logger.info(source_default.gray(`Project ${proj} already exists, skipping creation`));
|
|
116084
116408
|
}
|
|
116085
116409
|
}
|
|
116086
|
-
const apiDir = (0,
|
|
116410
|
+
const apiDir = (0, import_path6.join)(srcDir, `${projectName}.Api`);
|
|
116087
116411
|
if (!dryRun) {
|
|
116088
|
-
await
|
|
116412
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(apiDir, "wwwroot"));
|
|
116089
116413
|
}
|
|
116090
116414
|
const launchSettings = {
|
|
116091
116415
|
$schema: "https://json.schemastore.org/launchsettings.json",
|
|
@@ -116111,10 +116435,10 @@ EndGlobal
|
|
|
116111
116435
|
}
|
|
116112
116436
|
};
|
|
116113
116437
|
if (!dryRun) {
|
|
116114
|
-
await
|
|
116438
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(apiDir, "Properties"));
|
|
116115
116439
|
const launchRelPath = `src/${projectName}.Api/Properties/launchSettings.json`;
|
|
116116
116440
|
const launchResult = await safeWriteFile(
|
|
116117
|
-
(0,
|
|
116441
|
+
(0, import_path6.join)(apiDir, "Properties", "launchSettings.json"),
|
|
116118
116442
|
JSON.stringify(launchSettings, null, 2),
|
|
116119
116443
|
findKnownHash(state, "backend", launchRelPath)
|
|
116120
116444
|
);
|
|
@@ -116124,9 +116448,9 @@ EndGlobal
|
|
|
116124
116448
|
if (!dryRun) {
|
|
116125
116449
|
for (const { proj, type } of projects) {
|
|
116126
116450
|
if (type === "classlib") {
|
|
116127
|
-
const class1Path = (0,
|
|
116128
|
-
if (await
|
|
116129
|
-
await
|
|
116451
|
+
const class1Path = (0, import_path6.join)(srcDir, proj, "Class1.cs");
|
|
116452
|
+
if (await import_fs_extra5.default.pathExists(class1Path)) {
|
|
116453
|
+
await import_fs_extra5.default.remove(class1Path);
|
|
116130
116454
|
logger.info(`Removed placeholder: ${proj}/Class1.cs`);
|
|
116131
116455
|
}
|
|
116132
116456
|
}
|
|
@@ -116134,11 +116458,11 @@ EndGlobal
|
|
|
116134
116458
|
}
|
|
116135
116459
|
if (!dryRun) {
|
|
116136
116460
|
for (const { proj } of projects) {
|
|
116137
|
-
const csprojPath = (0,
|
|
116138
|
-
if (await
|
|
116139
|
-
let content = await
|
|
116461
|
+
const csprojPath = (0, import_path6.join)(srcDir, proj, `${proj}.csproj`);
|
|
116462
|
+
if (await import_fs_extra5.default.pathExists(csprojPath)) {
|
|
116463
|
+
let content = await import_fs_extra5.default.readFile(csprojPath, "utf-8");
|
|
116140
116464
|
content = content.replace(/\s*<TargetFramework>.*<\/TargetFramework>\s*/g, "\n ");
|
|
116141
|
-
await
|
|
116465
|
+
await import_fs_extra5.default.writeFile(csprojPath, content);
|
|
116142
116466
|
}
|
|
116143
116467
|
}
|
|
116144
116468
|
logger.info("Configured projects to inherit TargetFramework from Directory.Build.props");
|
|
@@ -116152,7 +116476,7 @@ EndGlobal
|
|
|
116152
116476
|
];
|
|
116153
116477
|
for (const { from: from3, to } of refs) {
|
|
116154
116478
|
execCommand(
|
|
116155
|
-
`dotnet add "${(0,
|
|
116479
|
+
`dotnet add "${(0, import_path6.join)(srcDir, from3)}" reference "${(0, import_path6.join)(srcDir, to)}"`,
|
|
116156
116480
|
void 0,
|
|
116157
116481
|
dryRun
|
|
116158
116482
|
);
|
|
@@ -116203,28 +116527,28 @@ EndGlobal
|
|
|
116203
116527
|
for (const { project, packages } of nugetPackages) {
|
|
116204
116528
|
for (const pkg2 of packages) {
|
|
116205
116529
|
if (pkg2 === "SmartStack" && smartstackVersion) {
|
|
116206
|
-
execCommand(`dotnet add "${(0,
|
|
116530
|
+
execCommand(`dotnet add "${(0, import_path6.join)(srcDir, project)}" package ${pkg2} --version ${smartstackVersion}`, void 0, dryRun);
|
|
116207
116531
|
} else {
|
|
116208
|
-
execCommand(`dotnet add "${(0,
|
|
116532
|
+
execCommand(`dotnet add "${(0, import_path6.join)(srcDir, project)}" package ${pkg2}${prereleaseFlag}`, void 0, dryRun);
|
|
116209
116533
|
}
|
|
116210
116534
|
}
|
|
116211
116535
|
}
|
|
116212
116536
|
if (!dryRun) {
|
|
116213
|
-
const apiDir2 = (0,
|
|
116537
|
+
const apiDir2 = (0, import_path6.join)(srcDir, `${projectName}.Api`);
|
|
116214
116538
|
const programCs = await loadTemplate("Program.cs.template", projectName);
|
|
116215
116539
|
const programRelPath = `src/${projectName}.Api/Program.cs`;
|
|
116216
116540
|
const programResult = await safeWriteFile(
|
|
116217
|
-
(0,
|
|
116541
|
+
(0, import_path6.join)(apiDir2, "Program.cs"),
|
|
116218
116542
|
programCs,
|
|
116219
116543
|
findKnownHash(state, "backend", programRelPath)
|
|
116220
116544
|
);
|
|
116221
116545
|
logSafeWriteResult(programRelPath, programResult);
|
|
116222
116546
|
recordFile(state, "backend", programRelPath, programResult.hash);
|
|
116223
|
-
const templatePath = (0,
|
|
116224
|
-
if (!await
|
|
116547
|
+
const templatePath = (0, import_path6.join)(TEMPLATES_DIR2, "appsettings.json.template");
|
|
116548
|
+
if (!await import_fs_extra5.default.pathExists(templatePath)) {
|
|
116225
116549
|
throw new Error(`Template not found: ${templatePath}`);
|
|
116226
116550
|
}
|
|
116227
|
-
let appSettingsContent = await
|
|
116551
|
+
let appSettingsContent = await import_fs_extra5.default.readFile(templatePath, "utf-8");
|
|
116228
116552
|
const randomSecret = (0, import_crypto2.randomBytes)(32).toString("hex");
|
|
116229
116553
|
appSettingsContent = appSettingsContent.replace(/\{\{ProjectName\}\}/g, projectName).replace(/\{\{GenerateRandomSecret\}\}/g, randomSecret).replace(/\{\{ProjectDomain\}\}/g, `${projectName.toLowerCase()}.app`).replace(/\{\{ProjectNameLower\}\}/g, projectName.toLowerCase());
|
|
116230
116554
|
const appSettings = JSON.parse(appSettingsContent);
|
|
@@ -116237,7 +116561,7 @@ EndGlobal
|
|
|
116237
116561
|
};
|
|
116238
116562
|
const appSettingsRelPath = `src/${projectName}.Api/appsettings.json`;
|
|
116239
116563
|
const appSettingsResult = await safeWriteFile(
|
|
116240
|
-
(0,
|
|
116564
|
+
(0, import_path6.join)(apiDir2, "appsettings.json"),
|
|
116241
116565
|
JSON.stringify(appSettings, null, 2),
|
|
116242
116566
|
findKnownHash(state, "backend", appSettingsRelPath)
|
|
116243
116567
|
);
|
|
@@ -116258,7 +116582,7 @@ EndGlobal
|
|
|
116258
116582
|
};
|
|
116259
116583
|
const appSettingsDevRelPath = `src/${projectName}.Api/appsettings.Development.json`;
|
|
116260
116584
|
const appSettingsDevResult = await safeWriteFile(
|
|
116261
|
-
(0,
|
|
116585
|
+
(0, import_path6.join)(apiDir2, "appsettings.Development.json"),
|
|
116262
116586
|
JSON.stringify(appSettingsDev, null, 2),
|
|
116263
116587
|
findKnownHash(state, "backend", appSettingsDevRelPath)
|
|
116264
116588
|
);
|
|
@@ -116270,13 +116594,13 @@ EndGlobal
|
|
|
116270
116594
|
}
|
|
116271
116595
|
async function createConfigFiles(config, state, dryRun) {
|
|
116272
116596
|
const { name } = config;
|
|
116273
|
-
const projectDir = config.projectDir ?? ((0,
|
|
116274
|
-
const projectName = (0,
|
|
116597
|
+
const projectDir = config.projectDir ?? ((0, import_path6.isAbsolute)(name) ? name : (0, import_path6.join)(process.cwd(), name));
|
|
116598
|
+
const projectName = (0, import_path6.basename)(name);
|
|
116275
116599
|
if (dryRun) {
|
|
116276
116600
|
logger.info("[DRY RUN] Would create configuration files");
|
|
116277
116601
|
return;
|
|
116278
116602
|
}
|
|
116279
|
-
await
|
|
116603
|
+
await import_fs_extra5.default.ensureDir(projectDir);
|
|
116280
116604
|
const targetFramework = "net10.0";
|
|
116281
116605
|
const buildProps = `<Project>
|
|
116282
116606
|
<PropertyGroup>
|
|
@@ -116288,7 +116612,7 @@ async function createConfigFiles(config, state, dryRun) {
|
|
|
116288
116612
|
</Project>
|
|
116289
116613
|
`;
|
|
116290
116614
|
const relPath1 = "Directory.Build.props";
|
|
116291
|
-
const result1 = await safeWriteFile((0,
|
|
116615
|
+
const result1 = await safeWriteFile((0, import_path6.join)(projectDir, relPath1), buildProps, findKnownHash(state, "config", relPath1));
|
|
116292
116616
|
logSafeWriteResult(relPath1, result1);
|
|
116293
116617
|
recordFile(state, "config", relPath1, result1.hash);
|
|
116294
116618
|
logger.info(`Target framework: ${source_default.cyan(targetFramework)}${config.preview ? " (preview)" : ""}`);
|
|
@@ -116321,10 +116645,10 @@ appsettings.*.Local.json
|
|
|
116321
116645
|
*.db-wal
|
|
116322
116646
|
`;
|
|
116323
116647
|
const relPath2 = ".gitignore";
|
|
116324
|
-
const result2 = await safeWriteFile((0,
|
|
116648
|
+
const result2 = await safeWriteFile((0, import_path6.join)(projectDir, relPath2), gitignore, findKnownHash(state, "config", relPath2));
|
|
116325
116649
|
logSafeWriteResult(relPath2, result2);
|
|
116326
116650
|
recordFile(state, "config", relPath2, result2.hash);
|
|
116327
|
-
await
|
|
116651
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(projectDir, ".smartstack"));
|
|
116328
116652
|
const smartstackConfig = {
|
|
116329
116653
|
projectType: "client",
|
|
116330
116654
|
dbContext: "extensions",
|
|
@@ -116334,13 +116658,13 @@ appsettings.*.Local.json
|
|
|
116334
116658
|
};
|
|
116335
116659
|
const relPath3 = ".smartstack/config.json";
|
|
116336
116660
|
const result3 = await safeWriteFile(
|
|
116337
|
-
(0,
|
|
116661
|
+
(0, import_path6.join)(projectDir, relPath3),
|
|
116338
116662
|
JSON.stringify(smartstackConfig, null, 2),
|
|
116339
116663
|
findKnownHash(state, "config", relPath3)
|
|
116340
116664
|
);
|
|
116341
116665
|
logSafeWriteResult(relPath3, result3);
|
|
116342
116666
|
recordFile(state, "config", relPath3, result3.hash);
|
|
116343
|
-
await
|
|
116667
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(projectDir, ".vscode"));
|
|
116344
116668
|
const launchJson = {
|
|
116345
116669
|
version: "0.2.0",
|
|
116346
116670
|
configurations: [
|
|
@@ -116370,7 +116694,7 @@ appsettings.*.Local.json
|
|
|
116370
116694
|
]
|
|
116371
116695
|
};
|
|
116372
116696
|
const relPath4 = ".vscode/launch.json";
|
|
116373
|
-
const result4 = await safeWriteFile((0,
|
|
116697
|
+
const result4 = await safeWriteFile((0, import_path6.join)(projectDir, relPath4), JSON.stringify(launchJson, null, 2), findKnownHash(state, "config", relPath4));
|
|
116374
116698
|
logSafeWriteResult(relPath4, result4);
|
|
116375
116699
|
recordFile(state, "config", relPath4, result4.hash);
|
|
116376
116700
|
const tasksJson = {
|
|
@@ -116425,7 +116749,7 @@ appsettings.*.Local.json
|
|
|
116425
116749
|
]
|
|
116426
116750
|
};
|
|
116427
116751
|
const relPath5 = ".vscode/tasks.json";
|
|
116428
|
-
const result5 = await safeWriteFile((0,
|
|
116752
|
+
const result5 = await safeWriteFile((0, import_path6.join)(projectDir, relPath5), JSON.stringify(tasksJson, null, 2), findKnownHash(state, "config", relPath5));
|
|
116429
116753
|
logSafeWriteResult(relPath5, result5);
|
|
116430
116754
|
recordFile(state, "config", relPath5, result5.hash);
|
|
116431
116755
|
const extensionsJson = {
|
|
@@ -116442,7 +116766,7 @@ appsettings.*.Local.json
|
|
|
116442
116766
|
]
|
|
116443
116767
|
};
|
|
116444
116768
|
const relPath6 = ".vscode/extensions.json";
|
|
116445
|
-
const result6 = await safeWriteFile((0,
|
|
116769
|
+
const result6 = await safeWriteFile((0, import_path6.join)(projectDir, relPath6), JSON.stringify(extensionsJson, null, 2), findKnownHash(state, "config", relPath6));
|
|
116446
116770
|
logSafeWriteResult(relPath6, result6);
|
|
116447
116771
|
recordFile(state, "config", relPath6, result6.hash);
|
|
116448
116772
|
const readme = `# ${projectName}
|
|
@@ -116517,30 +116841,30 @@ ${projectName}/
|
|
|
116517
116841
|
Generated with [SmartStack CLI](https://atlashub.io/products/smartstack-cli)
|
|
116518
116842
|
`;
|
|
116519
116843
|
const relPath7 = "README.md";
|
|
116520
|
-
const result7 = await safeWriteFile((0,
|
|
116844
|
+
const result7 = await safeWriteFile((0, import_path6.join)(projectDir, relPath7), readme, findKnownHash(state, "config", relPath7));
|
|
116521
116845
|
logSafeWriteResult(relPath7, result7);
|
|
116522
116846
|
recordFile(state, "config", relPath7, result7.hash);
|
|
116523
116847
|
}
|
|
116524
116848
|
async function createFrontendStructure(config, state, dryRun) {
|
|
116525
116849
|
const { name } = config;
|
|
116526
|
-
const projectDir = config.projectDir ?? ((0,
|
|
116527
|
-
const projectName = (0,
|
|
116528
|
-
const webDir = (0,
|
|
116850
|
+
const projectDir = config.projectDir ?? ((0, import_path6.isAbsolute)(name) ? name : (0, import_path6.join)(process.cwd(), name));
|
|
116851
|
+
const projectName = (0, import_path6.basename)(name);
|
|
116852
|
+
const webDir = (0, import_path6.join)(projectDir, "web", `${projectName.toLowerCase()}-web`);
|
|
116529
116853
|
const webRelPrefix = `web/${projectName.toLowerCase()}-web`;
|
|
116530
116854
|
logger.info("Creating React frontend structure...");
|
|
116531
116855
|
if (dryRun) {
|
|
116532
116856
|
logger.info("[DRY RUN] Would create React frontend at: " + webDir);
|
|
116533
116857
|
return;
|
|
116534
116858
|
}
|
|
116535
|
-
await
|
|
116536
|
-
await
|
|
116537
|
-
await
|
|
116538
|
-
await
|
|
116539
|
-
await
|
|
116540
|
-
await
|
|
116541
|
-
await
|
|
116542
|
-
await
|
|
116543
|
-
await
|
|
116859
|
+
await import_fs_extra5.default.ensureDir(webDir);
|
|
116860
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(webDir, "src"));
|
|
116861
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(webDir, "src", "components"));
|
|
116862
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(webDir, "src", "pages"));
|
|
116863
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(webDir, "src", "services"));
|
|
116864
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(webDir, "src", "hooks"));
|
|
116865
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(webDir, "src", "types"));
|
|
116866
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(webDir, "src", "i18n"));
|
|
116867
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(webDir, "public"));
|
|
116544
116868
|
const smartstackNpmTag = config.preview ? "next" : "latest";
|
|
116545
116869
|
const packageJson = {
|
|
116546
116870
|
name: `${projectName.toLowerCase()}-web`,
|
|
@@ -116587,7 +116911,7 @@ async function createFrontendStructure(config, state, dryRun) {
|
|
|
116587
116911
|
}
|
|
116588
116912
|
};
|
|
116589
116913
|
const pkg_relPath = `${webRelPrefix}/package.json`;
|
|
116590
|
-
const pkg_result = await safeWriteFile((0,
|
|
116914
|
+
const pkg_result = await safeWriteFile((0, import_path6.join)(webDir, "package.json"), JSON.stringify(packageJson, null, 2), findKnownHash(state, "frontend", pkg_relPath));
|
|
116591
116915
|
logSafeWriteResult(pkg_relPath, pkg_result);
|
|
116592
116916
|
recordFile(state, "frontend", pkg_relPath, pkg_result.hash);
|
|
116593
116917
|
const envFile = `# =============================================================================
|
|
@@ -116613,7 +116937,7 @@ VITE_PORT=3000
|
|
|
116613
116937
|
# VITE_ENABLE_DEVTOOLS=true
|
|
116614
116938
|
`;
|
|
116615
116939
|
const env_relPath = `${webRelPrefix}/.env`;
|
|
116616
|
-
const env_result = await safeWriteFile((0,
|
|
116940
|
+
const env_result = await safeWriteFile((0, import_path6.join)(webDir, ".env"), envFile, findKnownHash(state, "frontend", env_relPath));
|
|
116617
116941
|
logSafeWriteResult(env_relPath, env_result);
|
|
116618
116942
|
recordFile(state, "frontend", env_relPath, env_result.hash);
|
|
116619
116943
|
const envExampleFile = `# =============================================================================
|
|
@@ -116644,7 +116968,7 @@ VITE_PORT=3000
|
|
|
116644
116968
|
# VITE_ENABLE_DEVTOOLS=true
|
|
116645
116969
|
`;
|
|
116646
116970
|
const envEx_relPath = `${webRelPrefix}/.env.example`;
|
|
116647
|
-
const envEx_result = await safeWriteFile((0,
|
|
116971
|
+
const envEx_result = await safeWriteFile((0, import_path6.join)(webDir, ".env.example"), envExampleFile, findKnownHash(state, "frontend", envEx_relPath));
|
|
116648
116972
|
logSafeWriteResult(envEx_relPath, envEx_result);
|
|
116649
116973
|
recordFile(state, "frontend", envEx_relPath, envEx_result.hash);
|
|
116650
116974
|
const viteConfig = `import { defineConfig, loadEnv } from 'vite';
|
|
@@ -116687,7 +117011,7 @@ export default defineConfig(({ mode }) => {
|
|
|
116687
117011
|
});
|
|
116688
117012
|
`;
|
|
116689
117013
|
const vite_relPath = `${webRelPrefix}/vite.config.ts`;
|
|
116690
|
-
const vite_result = await safeWriteFile((0,
|
|
117014
|
+
const vite_result = await safeWriteFile((0, import_path6.join)(webDir, "vite.config.ts"), viteConfig, findKnownHash(state, "frontend", vite_relPath));
|
|
116691
117015
|
logSafeWriteResult(vite_relPath, vite_result);
|
|
116692
117016
|
recordFile(state, "frontend", vite_relPath, vite_result.hash);
|
|
116693
117017
|
const tsConfig = {
|
|
@@ -116716,7 +117040,7 @@ export default defineConfig(({ mode }) => {
|
|
|
116716
117040
|
include: ["src"]
|
|
116717
117041
|
};
|
|
116718
117042
|
const tsc_relPath = `${webRelPrefix}/tsconfig.json`;
|
|
116719
|
-
const tsc_result = await safeWriteFile((0,
|
|
117043
|
+
const tsc_result = await safeWriteFile((0, import_path6.join)(webDir, "tsconfig.json"), JSON.stringify(tsConfig, null, 2), findKnownHash(state, "frontend", tsc_relPath));
|
|
116720
117044
|
logSafeWriteResult(tsc_relPath, tsc_result);
|
|
116721
117045
|
recordFile(state, "frontend", tsc_relPath, tsc_result.hash);
|
|
116722
117046
|
const indexHtml = `<!doctype html>
|
|
@@ -116734,7 +117058,7 @@ export default defineConfig(({ mode }) => {
|
|
|
116734
117058
|
</html>
|
|
116735
117059
|
`;
|
|
116736
117060
|
const html_relPath = `${webRelPrefix}/index.html`;
|
|
116737
|
-
const html_result = await safeWriteFile((0,
|
|
117061
|
+
const html_result = await safeWriteFile((0, import_path6.join)(webDir, "index.html"), indexHtml, findKnownHash(state, "frontend", html_relPath));
|
|
116738
117062
|
logSafeWriteResult(html_relPath, html_result);
|
|
116739
117063
|
recordFile(state, "frontend", html_relPath, html_result.hash);
|
|
116740
117064
|
const mainTsx = `import { StrictMode } from 'react';
|
|
@@ -116762,7 +117086,7 @@ createRoot(document.getElementById('root')!).render(
|
|
|
116762
117086
|
);
|
|
116763
117087
|
`;
|
|
116764
117088
|
const main_relPath = `${webRelPrefix}/src/main.tsx`;
|
|
116765
|
-
const main_result = await safeWriteFile((0,
|
|
117089
|
+
const main_result = await safeWriteFile((0, import_path6.join)(webDir, "src", "main.tsx"), mainTsx, findKnownHash(state, "frontend", main_relPath));
|
|
116766
117090
|
logSafeWriteResult(main_relPath, main_result);
|
|
116767
117091
|
recordFile(state, "frontend", main_relPath, main_result.hash);
|
|
116768
117092
|
const appTsx = `import { useRoutes, Navigate } from 'react-router-dom';
|
|
@@ -116796,13 +117120,13 @@ function App() {
|
|
|
116796
117120
|
export default App;
|
|
116797
117121
|
`;
|
|
116798
117122
|
const app_relPath = `${webRelPrefix}/src/App.tsx`;
|
|
116799
|
-
const app_result = await safeWriteFile((0,
|
|
117123
|
+
const app_result = await safeWriteFile((0, import_path6.join)(webDir, "src", "App.tsx"), appTsx, findKnownHash(state, "frontend", app_relPath));
|
|
116800
117124
|
logSafeWriteResult(app_relPath, app_result);
|
|
116801
117125
|
recordFile(state, "frontend", app_relPath, app_result.hash);
|
|
116802
117126
|
const indexCss = `@import "tailwindcss";
|
|
116803
117127
|
`;
|
|
116804
117128
|
const css_relPath = `${webRelPrefix}/src/index.css`;
|
|
116805
|
-
const css_result = await safeWriteFile((0,
|
|
117129
|
+
const css_result = await safeWriteFile((0, import_path6.join)(webDir, "src", "index.css"), indexCss, findKnownHash(state, "frontend", css_relPath));
|
|
116806
117130
|
logSafeWriteResult(css_relPath, css_result);
|
|
116807
117131
|
recordFile(state, "frontend", css_relPath, css_result.hash);
|
|
116808
117132
|
const i18nConfig = `import i18n from 'i18next';
|
|
@@ -116836,24 +117160,24 @@ i18n
|
|
|
116836
117160
|
export default i18n;
|
|
116837
117161
|
`;
|
|
116838
117162
|
const i18n_relPath = `${webRelPrefix}/src/i18n/index.ts`;
|
|
116839
|
-
const i18n_result = await safeWriteFile((0,
|
|
117163
|
+
const i18n_result = await safeWriteFile((0, import_path6.join)(webDir, "src", "i18n", "index.ts"), i18nConfig, findKnownHash(state, "frontend", i18n_relPath));
|
|
116840
117164
|
logSafeWriteResult(i18n_relPath, i18n_result);
|
|
116841
117165
|
recordFile(state, "frontend", i18n_relPath, i18n_result.hash);
|
|
116842
117166
|
const apiService = await loadTemplate("api.ts.template", projectName);
|
|
116843
117167
|
const api_relPath = `${webRelPrefix}/src/services/api.ts`;
|
|
116844
|
-
const api_result = await safeWriteFile((0,
|
|
117168
|
+
const api_result = await safeWriteFile((0, import_path6.join)(webDir, "src", "services", "api.ts"), apiService, findKnownHash(state, "frontend", api_relPath));
|
|
116845
117169
|
logSafeWriteResult(api_relPath, api_result);
|
|
116846
117170
|
recordFile(state, "frontend", api_relPath, api_result.hash);
|
|
116847
117171
|
const viteEnvDts = `/// <reference types="vite/client" />
|
|
116848
117172
|
`;
|
|
116849
117173
|
const envDts_relPath = `${webRelPrefix}/src/vite-env.d.ts`;
|
|
116850
|
-
const envDts_result = await safeWriteFile((0,
|
|
117174
|
+
const envDts_result = await safeWriteFile((0, import_path6.join)(webDir, "src", "vite-env.d.ts"), viteEnvDts, findKnownHash(state, "frontend", envDts_relPath));
|
|
116851
117175
|
logSafeWriteResult(envDts_relPath, envDts_result);
|
|
116852
117176
|
recordFile(state, "frontend", envDts_relPath, envDts_result.hash);
|
|
116853
117177
|
const viteSvg = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFBD4F"></stop><stop offset="100%" stop-color="#FF980E"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
116854
117178
|
`;
|
|
116855
117179
|
const svg_relPath = `${webRelPrefix}/public/vite.svg`;
|
|
116856
|
-
const svg_result = await safeWriteFile((0,
|
|
117180
|
+
const svg_result = await safeWriteFile((0, import_path6.join)(webDir, "public", "vite.svg"), viteSvg, findKnownHash(state, "frontend", svg_relPath));
|
|
116857
117181
|
logSafeWriteResult(svg_relPath, svg_result);
|
|
116858
117182
|
recordFile(state, "frontend", svg_relPath, svg_result.hash);
|
|
116859
117183
|
const webGitignore = `# Dependencies
|
|
@@ -116881,7 +117205,7 @@ npm-debug.log*
|
|
|
116881
117205
|
Thumbs.db
|
|
116882
117206
|
`;
|
|
116883
117207
|
const gi_relPath = `${webRelPrefix}/.gitignore`;
|
|
116884
|
-
const gi_result = await safeWriteFile((0,
|
|
117208
|
+
const gi_result = await safeWriteFile((0, import_path6.join)(webDir, ".gitignore"), webGitignore, findKnownHash(state, "frontend", gi_relPath));
|
|
116885
117209
|
logSafeWriteResult(gi_relPath, gi_result);
|
|
116886
117210
|
recordFile(state, "frontend", gi_relPath, gi_result.hash);
|
|
116887
117211
|
logger.success("React frontend created at: " + webDir);
|
|
@@ -116889,7 +117213,7 @@ Thumbs.db
|
|
|
116889
117213
|
function checkGitIdentity(cwd) {
|
|
116890
117214
|
const check = (key) => {
|
|
116891
117215
|
try {
|
|
116892
|
-
const result = (0,
|
|
117216
|
+
const result = (0, import_child_process5.spawnSync)("git", ["config", key], { encoding: "utf-8", shell: true, cwd, timeout: 5e3 });
|
|
116893
117217
|
return result.status === 0 && !!result.stdout.trim();
|
|
116894
117218
|
} catch {
|
|
116895
117219
|
return false;
|
|
@@ -116939,9 +117263,9 @@ async function ensureGitIdentity(projectDir, dryRun) {
|
|
|
116939
117263
|
}
|
|
116940
117264
|
async function initializeGit(config, dryRun) {
|
|
116941
117265
|
const { name } = config;
|
|
116942
|
-
const projectDir = config.projectDir ?? ((0,
|
|
116943
|
-
const gitDir = (0,
|
|
116944
|
-
const isGitInitialized = await
|
|
117266
|
+
const projectDir = config.projectDir ?? ((0, import_path6.isAbsolute)(name) ? name : (0, import_path6.join)(process.cwd(), name));
|
|
117267
|
+
const gitDir = (0, import_path6.join)(projectDir, ".git");
|
|
117268
|
+
const isGitInitialized = await import_fs_extra5.default.pathExists(gitDir);
|
|
116945
117269
|
if (isGitInitialized) {
|
|
116946
117270
|
logger.info("Git repository already initialized, adding SmartStack files...");
|
|
116947
117271
|
} else {
|
|
@@ -116953,7 +117277,7 @@ async function initializeGit(config, dryRun) {
|
|
|
116953
117277
|
execCommand("git add .", projectDir, dryRun);
|
|
116954
117278
|
if (!dryRun) {
|
|
116955
117279
|
try {
|
|
116956
|
-
(0,
|
|
117280
|
+
(0, import_child_process5.execSync)("git diff --cached --quiet", { cwd: projectDir, shell: true });
|
|
116957
117281
|
logger.info(source_default.gray("No new changes to commit (already committed)"));
|
|
116958
117282
|
} catch {
|
|
116959
117283
|
execCommand(`git commit -m "${commitMsg}"`, projectDir, dryRun);
|
|
@@ -117049,7 +117373,7 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117049
117373
|
if (installChoice === "winget") {
|
|
117050
117374
|
logger.info(`Running: ${source_default.cyan(wingetCmd)}`);
|
|
117051
117375
|
try {
|
|
117052
|
-
(0,
|
|
117376
|
+
(0, import_child_process5.execSync)(wingetCmd, { stdio: "inherit", timeout: 3e5 });
|
|
117053
117377
|
const recheck = checkPrerequisites();
|
|
117054
117378
|
const recheckMajor = parseInt(recheck.dotnetVersion?.split(".")[0] ?? "0", 10);
|
|
117055
117379
|
if (recheck.dotnet && recheckMajor >= MIN_DOTNET_MAJOR) {
|
|
@@ -117076,7 +117400,7 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117076
117400
|
} else {
|
|
117077
117401
|
logger.info(`Installing .NET SDK ${MIN_DOTNET_MAJOR}.0 via winget...`);
|
|
117078
117402
|
try {
|
|
117079
|
-
(0,
|
|
117403
|
+
(0, import_child_process5.execSync)(`winget install Microsoft.DotNet.SDK.${MIN_DOTNET_MAJOR}`, { stdio: "inherit", timeout: 3e5 });
|
|
117080
117404
|
const recheck = checkPrerequisites();
|
|
117081
117405
|
const recheckMajor = parseInt(recheck.dotnetVersion?.split(".")[0] ?? "0", 10);
|
|
117082
117406
|
if (recheck.dotnet && recheckMajor >= MIN_DOTNET_MAJOR) {
|
|
@@ -117147,7 +117471,7 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117147
117471
|
}
|
|
117148
117472
|
}
|
|
117149
117473
|
} else {
|
|
117150
|
-
if (await
|
|
117474
|
+
if (await import_fs_extra5.default.pathExists(projectDir)) {
|
|
117151
117475
|
logger.error(`Directory '${projectDir}' already exists.`);
|
|
117152
117476
|
logger.info(`Tip: Use ${source_default.cyan("--here")} to initialize in the current directory instead.`);
|
|
117153
117477
|
process.exit(1);
|
|
@@ -117185,9 +117509,9 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117185
117509
|
}
|
|
117186
117510
|
if (!inPlace && finalProjectName !== projectName) {
|
|
117187
117511
|
const cwd = process.cwd();
|
|
117188
|
-
finalProjectDir = (0,
|
|
117512
|
+
finalProjectDir = (0, import_path6.isAbsolute)(finalProjectName) ? finalProjectName : (0, import_path6.join)(cwd, finalProjectName);
|
|
117189
117513
|
logger.info(`Project directory updated to: ${source_default.cyan(finalProjectDir)}`);
|
|
117190
|
-
if (await
|
|
117514
|
+
if (await import_fs_extra5.default.pathExists(finalProjectDir)) {
|
|
117191
117515
|
logger.error(`Directory '${finalProjectDir}' already exists.`);
|
|
117192
117516
|
process.exit(1);
|
|
117193
117517
|
}
|
|
@@ -117270,17 +117594,17 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117270
117594
|
try {
|
|
117271
117595
|
let cliVersion = "0.0.0";
|
|
117272
117596
|
try {
|
|
117273
|
-
const pkgPath = (0,
|
|
117274
|
-
const pkg2 = JSON.parse(await
|
|
117597
|
+
const pkgPath = (0, import_path6.join)((0, import_path6.dirname)((0, import_path6.dirname)(__dirname)), "package.json");
|
|
117598
|
+
const pkg2 = JSON.parse(await import_fs_extra5.default.readFile(pkgPath, "utf-8"));
|
|
117275
117599
|
cliVersion = pkg2.version || "0.0.0";
|
|
117276
117600
|
} catch {
|
|
117277
117601
|
}
|
|
117278
117602
|
const state = resumeState ?? createFreshInitState(config, cliVersion);
|
|
117279
117603
|
if (!dryRun && !inPlace) {
|
|
117280
|
-
await
|
|
117604
|
+
await import_fs_extra5.default.ensureDir(finalProjectDir);
|
|
117281
117605
|
}
|
|
117282
117606
|
if (!dryRun) {
|
|
117283
|
-
await
|
|
117607
|
+
await import_fs_extra5.default.ensureDir((0, import_path6.join)(finalProjectDir, ".smartstack"));
|
|
117284
117608
|
await saveInitState(finalProjectDir, state);
|
|
117285
117609
|
}
|
|
117286
117610
|
await executeStep(state, "config", finalProjectDir, dryRun, () => createConfigFiles(config, state, dryRun));
|
|
@@ -117342,9 +117666,9 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
117342
117666
|
});
|
|
117343
117667
|
|
|
117344
117668
|
// src/commands/upgrade.ts
|
|
117345
|
-
var
|
|
117346
|
-
var
|
|
117347
|
-
var
|
|
117669
|
+
var import_fs_extra6 = __toESM(require_lib());
|
|
117670
|
+
var import_path7 = require("path");
|
|
117671
|
+
var import_child_process6 = require("child_process");
|
|
117348
117672
|
|
|
117349
117673
|
// src/migrations/app-tsx-migration.ts
|
|
117350
117674
|
var appTsxMigration_v2_0_0_preview_381 = {
|
|
@@ -122408,8 +122732,8 @@ var PathScurryBase = class {
|
|
|
122408
122732
|
*
|
|
122409
122733
|
* @internal
|
|
122410
122734
|
*/
|
|
122411
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
122412
|
-
this.#fs = fsFromOption(
|
|
122735
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs15 = defaultFS } = {}) {
|
|
122736
|
+
this.#fs = fsFromOption(fs15);
|
|
122413
122737
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
122414
122738
|
cwd = (0, import_node_url.fileURLToPath)(cwd);
|
|
122415
122739
|
}
|
|
@@ -122967,8 +123291,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
122967
123291
|
/**
|
|
122968
123292
|
* @internal
|
|
122969
123293
|
*/
|
|
122970
|
-
newRoot(
|
|
122971
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
123294
|
+
newRoot(fs15) {
|
|
123295
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs15 });
|
|
122972
123296
|
}
|
|
122973
123297
|
/**
|
|
122974
123298
|
* Return true if the provided path string is an absolute path
|
|
@@ -122996,8 +123320,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
122996
123320
|
/**
|
|
122997
123321
|
* @internal
|
|
122998
123322
|
*/
|
|
122999
|
-
newRoot(
|
|
123000
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
123323
|
+
newRoot(fs15) {
|
|
123324
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs15 });
|
|
123001
123325
|
}
|
|
123002
123326
|
/**
|
|
123003
123327
|
* Return true if the provided path string is an absolute path
|
|
@@ -123030,7 +123354,7 @@ var Pattern = class _Pattern {
|
|
|
123030
123354
|
#isUNC;
|
|
123031
123355
|
#isAbsolute;
|
|
123032
123356
|
#followGlobstar = true;
|
|
123033
|
-
constructor(patternList, globList, index,
|
|
123357
|
+
constructor(patternList, globList, index, platform3) {
|
|
123034
123358
|
if (!isPatternList(patternList)) {
|
|
123035
123359
|
throw new TypeError("empty pattern list");
|
|
123036
123360
|
}
|
|
@@ -123047,7 +123371,7 @@ var Pattern = class _Pattern {
|
|
|
123047
123371
|
this.#patternList = patternList;
|
|
123048
123372
|
this.#globList = globList;
|
|
123049
123373
|
this.#index = index;
|
|
123050
|
-
this.#platform =
|
|
123374
|
+
this.#platform = platform3;
|
|
123051
123375
|
if (this.#index === 0) {
|
|
123052
123376
|
if (this.isUNC()) {
|
|
123053
123377
|
const [p0, p1, p2, p3, ...prest] = this.#patternList;
|
|
@@ -123189,12 +123513,12 @@ var Ignore = class {
|
|
|
123189
123513
|
absoluteChildren;
|
|
123190
123514
|
platform;
|
|
123191
123515
|
mmopts;
|
|
123192
|
-
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform:
|
|
123516
|
+
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform3 = defaultPlatform2 }) {
|
|
123193
123517
|
this.relative = [];
|
|
123194
123518
|
this.absolute = [];
|
|
123195
123519
|
this.relativeChildren = [];
|
|
123196
123520
|
this.absoluteChildren = [];
|
|
123197
|
-
this.platform =
|
|
123521
|
+
this.platform = platform3;
|
|
123198
123522
|
this.mmopts = {
|
|
123199
123523
|
dot: true,
|
|
123200
123524
|
nobrace,
|
|
@@ -123202,7 +123526,7 @@ var Ignore = class {
|
|
|
123202
123526
|
noext,
|
|
123203
123527
|
noglobstar,
|
|
123204
123528
|
optimizationLevel: 2,
|
|
123205
|
-
platform:
|
|
123529
|
+
platform: platform3,
|
|
123206
123530
|
nocomment: true,
|
|
123207
123531
|
nonegate: true
|
|
123208
123532
|
};
|
|
@@ -124122,12 +124446,12 @@ async function getLatestNpmVersion(packageName, prerelease) {
|
|
|
124122
124446
|
}
|
|
124123
124447
|
async function detectSmartStackProject() {
|
|
124124
124448
|
const cwd = process.cwd();
|
|
124125
|
-
const configPath = (0,
|
|
124126
|
-
if (!await
|
|
124449
|
+
const configPath = (0, import_path7.join)(cwd, ".smartstack", "config.json");
|
|
124450
|
+
if (!await import_fs_extra6.default.pathExists(configPath)) {
|
|
124127
124451
|
return { isProject: false, projectDir: cwd };
|
|
124128
124452
|
}
|
|
124129
124453
|
try {
|
|
124130
|
-
const config = await
|
|
124454
|
+
const config = await import_fs_extra6.default.readJson(configPath);
|
|
124131
124455
|
return { isProject: true, config, projectDir: cwd };
|
|
124132
124456
|
} catch (error) {
|
|
124133
124457
|
logger.warning("Could not read .smartstack/config.json");
|
|
@@ -124135,20 +124459,20 @@ async function detectSmartStackProject() {
|
|
|
124135
124459
|
}
|
|
124136
124460
|
}
|
|
124137
124461
|
async function findProjectsWithSmartStack(projectDir) {
|
|
124138
|
-
const srcDir = (0,
|
|
124139
|
-
if (!await
|
|
124462
|
+
const srcDir = (0, import_path7.join)(projectDir, "src");
|
|
124463
|
+
if (!await import_fs_extra6.default.pathExists(srcDir)) {
|
|
124140
124464
|
return [];
|
|
124141
124465
|
}
|
|
124142
124466
|
const projects = [];
|
|
124143
|
-
const folders = await
|
|
124467
|
+
const folders = await import_fs_extra6.default.readdir(srcDir);
|
|
124144
124468
|
for (const folder of folders) {
|
|
124145
|
-
const folderPath = (0,
|
|
124146
|
-
const stat = await
|
|
124469
|
+
const folderPath = (0, import_path7.join)(srcDir, folder);
|
|
124470
|
+
const stat = await import_fs_extra6.default.stat(folderPath);
|
|
124147
124471
|
if (stat.isDirectory()) {
|
|
124148
|
-
const csprojFiles = (await
|
|
124472
|
+
const csprojFiles = (await import_fs_extra6.default.readdir(folderPath)).filter((f) => f.endsWith(".csproj"));
|
|
124149
124473
|
for (const csproj of csprojFiles) {
|
|
124150
|
-
const csprojPath = (0,
|
|
124151
|
-
const content = await
|
|
124474
|
+
const csprojPath = (0, import_path7.join)(folderPath, csproj);
|
|
124475
|
+
const content = await import_fs_extra6.default.readFile(csprojPath, "utf-8");
|
|
124152
124476
|
if (content.includes("SmartStack")) {
|
|
124153
124477
|
projects.push(csprojPath);
|
|
124154
124478
|
}
|
|
@@ -124158,17 +124482,17 @@ async function findProjectsWithSmartStack(projectDir) {
|
|
|
124158
124482
|
return projects;
|
|
124159
124483
|
}
|
|
124160
124484
|
async function findFrontendDirectory(projectDir) {
|
|
124161
|
-
const webDir = (0,
|
|
124162
|
-
if (!await
|
|
124485
|
+
const webDir = (0, import_path7.join)(projectDir, "web");
|
|
124486
|
+
if (!await import_fs_extra6.default.pathExists(webDir)) {
|
|
124163
124487
|
return null;
|
|
124164
124488
|
}
|
|
124165
|
-
const folders = await
|
|
124489
|
+
const folders = await import_fs_extra6.default.readdir(webDir);
|
|
124166
124490
|
for (const folder of folders) {
|
|
124167
|
-
const packageJsonPath = (0,
|
|
124168
|
-
if (await
|
|
124169
|
-
const packageJson = await
|
|
124491
|
+
const packageJsonPath = (0, import_path7.join)(webDir, folder, "package.json");
|
|
124492
|
+
if (await import_fs_extra6.default.pathExists(packageJsonPath)) {
|
|
124493
|
+
const packageJson = await import_fs_extra6.default.readJson(packageJsonPath);
|
|
124170
124494
|
if (packageJson.dependencies?.["@atlashub/smartstack"]) {
|
|
124171
|
-
return (0,
|
|
124495
|
+
return (0, import_path7.join)(webDir, folder);
|
|
124172
124496
|
}
|
|
124173
124497
|
}
|
|
124174
124498
|
}
|
|
@@ -124180,7 +124504,7 @@ function execCommand2(command, cwd, dryRun = false) {
|
|
|
124180
124504
|
return;
|
|
124181
124505
|
}
|
|
124182
124506
|
try {
|
|
124183
|
-
(0,
|
|
124507
|
+
(0, import_child_process6.execSync)(command, {
|
|
124184
124508
|
cwd,
|
|
124185
124509
|
stdio: "inherit",
|
|
124186
124510
|
shell: true
|
|
@@ -124195,7 +124519,7 @@ function tryExecCommand(command, cwd, dryRun = false) {
|
|
|
124195
124519
|
return true;
|
|
124196
124520
|
}
|
|
124197
124521
|
try {
|
|
124198
|
-
(0,
|
|
124522
|
+
(0, import_child_process6.execSync)(command, {
|
|
124199
124523
|
cwd,
|
|
124200
124524
|
stdio: "inherit",
|
|
124201
124525
|
shell: true
|
|
@@ -124232,7 +124556,7 @@ async function executeMigrations(projectDir, fromVersion, toVersion, dryRun) {
|
|
|
124232
124556
|
});
|
|
124233
124557
|
for (const file of files) {
|
|
124234
124558
|
try {
|
|
124235
|
-
const content = await
|
|
124559
|
+
const content = await import_fs_extra6.default.readFile(file, "utf-8");
|
|
124236
124560
|
if (!fileMigration.detect(content, file)) {
|
|
124237
124561
|
results.push({
|
|
124238
124562
|
filePath: file.replace(projectDir, "").replace(/^[/\\]/, ""),
|
|
@@ -124243,7 +124567,7 @@ async function executeMigrations(projectDir, fromVersion, toVersion, dryRun) {
|
|
|
124243
124567
|
}
|
|
124244
124568
|
if (!dryRun) {
|
|
124245
124569
|
const transformed = fileMigration.transform(content, file);
|
|
124246
|
-
await
|
|
124570
|
+
await import_fs_extra6.default.writeFile(file, transformed, "utf-8");
|
|
124247
124571
|
}
|
|
124248
124572
|
results.push({
|
|
124249
124573
|
filePath: file.replace(projectDir, "").replace(/^[/\\]/, ""),
|
|
@@ -124375,8 +124699,8 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
124375
124699
|
}
|
|
124376
124700
|
if (!dryRun && nugetVersion) {
|
|
124377
124701
|
config.smartStackVersion = nugetVersion;
|
|
124378
|
-
const configPath = (0,
|
|
124379
|
-
await
|
|
124702
|
+
const configPath = (0, import_path7.join)(projectDir, ".smartstack", "config.json");
|
|
124703
|
+
await import_fs_extra6.default.writeJson(configPath, config, { spaces: 2 });
|
|
124380
124704
|
logger.success(`Updated project version to ${source_default.cyan(nugetVersion)}`);
|
|
124381
124705
|
console.log();
|
|
124382
124706
|
}
|
|
@@ -124401,7 +124725,7 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
124401
124725
|
|
|
124402
124726
|
// src/lib/license.ts
|
|
124403
124727
|
var jwt = __toESM(require_jsonwebtoken());
|
|
124404
|
-
var
|
|
124728
|
+
var fs7 = __toESM(require_lib());
|
|
124405
124729
|
var path3 = __toESM(require("path"));
|
|
124406
124730
|
var os3 = __toESM(require("os"));
|
|
124407
124731
|
var PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
|
@@ -124421,20 +124745,20 @@ function getLicenseFilePath() {
|
|
|
124421
124745
|
}
|
|
124422
124746
|
async function saveLicenseKey(licenseKey) {
|
|
124423
124747
|
const licensePath = getLicenseFilePath();
|
|
124424
|
-
await
|
|
124425
|
-
await
|
|
124748
|
+
await fs7.ensureDir(path3.dirname(licensePath));
|
|
124749
|
+
await fs7.writeFile(licensePath, licenseKey.trim(), "utf-8");
|
|
124426
124750
|
}
|
|
124427
124751
|
async function loadLicenseKey() {
|
|
124428
124752
|
const licensePath = getLicenseFilePath();
|
|
124429
|
-
if (await
|
|
124430
|
-
return (await
|
|
124753
|
+
if (await fs7.pathExists(licensePath)) {
|
|
124754
|
+
return (await fs7.readFile(licensePath, "utf-8")).trim();
|
|
124431
124755
|
}
|
|
124432
124756
|
return null;
|
|
124433
124757
|
}
|
|
124434
124758
|
async function removeLicenseKey() {
|
|
124435
124759
|
const licensePath = getLicenseFilePath();
|
|
124436
|
-
if (await
|
|
124437
|
-
await
|
|
124760
|
+
if (await fs7.pathExists(licensePath)) {
|
|
124761
|
+
await fs7.remove(licensePath);
|
|
124438
124762
|
}
|
|
124439
124763
|
}
|
|
124440
124764
|
function validateLicenseKey(licenseKey) {
|
|
@@ -124579,137 +124903,7 @@ function createLicenseCommand() {
|
|
|
124579
124903
|
|
|
124580
124904
|
// src/commands/check-mcp.ts
|
|
124581
124905
|
var import_cli_table32 = __toESM(require_cli_table3());
|
|
124582
|
-
|
|
124583
|
-
// src/lib/mcp-checker.ts
|
|
124584
|
-
var import_child_process6 = require("child_process");
|
|
124585
|
-
var REQUIRED_MCP_SERVERS = [
|
|
124586
|
-
{
|
|
124587
|
-
name: "context7",
|
|
124588
|
-
description: "Library documentation and code examples",
|
|
124589
|
-
installCommand: "npm install -g @upstash/context7-mcp && claude mcp add context7 -- npx @upstash/context7-mcp"
|
|
124590
|
-
},
|
|
124591
|
-
{
|
|
124592
|
-
name: "smartstack",
|
|
124593
|
-
description: "SmartStack validation and scaffolding (bundled)",
|
|
124594
|
-
installCommand: "claude mcp add smartstack -- npx --package @atlashub/smartstack-cli smartstack-mcp"
|
|
124595
|
-
}
|
|
124596
|
-
];
|
|
124597
|
-
function getInstalledMcpServers() {
|
|
124598
|
-
try {
|
|
124599
|
-
const output = (0, import_child_process6.execSync)("claude mcp list", {
|
|
124600
|
-
encoding: "utf-8",
|
|
124601
|
-
timeout: 1e4,
|
|
124602
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
124603
|
-
});
|
|
124604
|
-
const servers = [];
|
|
124605
|
-
const lines = output.split("\n").filter((line) => line.trim());
|
|
124606
|
-
for (const line of lines) {
|
|
124607
|
-
if (line.startsWith("\u2500") || line.startsWith("\u2502") || !line.trim()) {
|
|
124608
|
-
continue;
|
|
124609
|
-
}
|
|
124610
|
-
const match2 = line.match(/^[\s│]*([a-zA-Z0-9_-]+)/);
|
|
124611
|
-
if (match2 && match2[1]) {
|
|
124612
|
-
const serverName = match2[1].toLowerCase();
|
|
124613
|
-
if (!["name", "status", "server", "mcp", "installed"].includes(serverName)) {
|
|
124614
|
-
servers.push(serverName);
|
|
124615
|
-
}
|
|
124616
|
-
}
|
|
124617
|
-
}
|
|
124618
|
-
return servers;
|
|
124619
|
-
} catch (error) {
|
|
124620
|
-
return [];
|
|
124621
|
-
}
|
|
124622
|
-
}
|
|
124623
|
-
function isClaudeCodeInstalled() {
|
|
124624
|
-
try {
|
|
124625
|
-
(0, import_child_process6.execSync)("claude --version", {
|
|
124626
|
-
encoding: "utf-8",
|
|
124627
|
-
timeout: 5e3,
|
|
124628
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
124629
|
-
});
|
|
124630
|
-
return true;
|
|
124631
|
-
} catch {
|
|
124632
|
-
return false;
|
|
124633
|
-
}
|
|
124634
|
-
}
|
|
124635
|
-
function getClaudeCodeVersion() {
|
|
124636
|
-
try {
|
|
124637
|
-
const output = (0, import_child_process6.execSync)("claude --version", {
|
|
124638
|
-
encoding: "utf-8",
|
|
124639
|
-
timeout: 5e3,
|
|
124640
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
124641
|
-
});
|
|
124642
|
-
return output.trim();
|
|
124643
|
-
} catch {
|
|
124644
|
-
return null;
|
|
124645
|
-
}
|
|
124646
|
-
}
|
|
124647
|
-
function checkRequiredMcpServers(requiredServers = REQUIRED_MCP_SERVERS) {
|
|
124648
|
-
const installedServers = getInstalledMcpServers();
|
|
124649
|
-
const servers = [];
|
|
124650
|
-
const missingServers = [];
|
|
124651
|
-
for (const required of requiredServers) {
|
|
124652
|
-
const isInstalled = installedServers.some(
|
|
124653
|
-
(s) => s.toLowerCase() === required.name.toLowerCase() || s.toLowerCase().includes(required.name.toLowerCase())
|
|
124654
|
-
);
|
|
124655
|
-
servers.push({
|
|
124656
|
-
name: required.name,
|
|
124657
|
-
installed: isInstalled,
|
|
124658
|
-
description: required.description,
|
|
124659
|
-
installCommand: required.installCommand
|
|
124660
|
-
});
|
|
124661
|
-
if (!isInstalled) {
|
|
124662
|
-
missingServers.push(required.name);
|
|
124663
|
-
}
|
|
124664
|
-
}
|
|
124665
|
-
return {
|
|
124666
|
-
allInstalled: missingServers.length === 0,
|
|
124667
|
-
servers,
|
|
124668
|
-
missingServers
|
|
124669
|
-
};
|
|
124670
|
-
}
|
|
124671
|
-
async function installMcpServer(serverName) {
|
|
124672
|
-
const required = REQUIRED_MCP_SERVERS.find((s) => s.name.toLowerCase() === serverName.toLowerCase());
|
|
124673
|
-
if (!required) {
|
|
124674
|
-
logger.error(`Unknown MCP server: ${serverName}`);
|
|
124675
|
-
return false;
|
|
124676
|
-
}
|
|
124677
|
-
const spinner = logger.spinner(`Installing ${serverName}...`);
|
|
124678
|
-
try {
|
|
124679
|
-
(0, import_child_process6.execSync)(required.installCommand, {
|
|
124680
|
-
encoding: "utf-8",
|
|
124681
|
-
timeout: 6e4,
|
|
124682
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
124683
|
-
});
|
|
124684
|
-
spinner.succeed(`${serverName} installed successfully`);
|
|
124685
|
-
return true;
|
|
124686
|
-
} catch (error) {
|
|
124687
|
-
spinner.fail(`Failed to install ${serverName}`);
|
|
124688
|
-
if (error instanceof Error) {
|
|
124689
|
-
logger.error(error.message);
|
|
124690
|
-
}
|
|
124691
|
-
return false;
|
|
124692
|
-
}
|
|
124693
|
-
}
|
|
124694
|
-
async function installMissingMcpServers() {
|
|
124695
|
-
const result = checkRequiredMcpServers();
|
|
124696
|
-
if (result.allInstalled) {
|
|
124697
|
-
logger.success("All MCP servers already installed");
|
|
124698
|
-
return true;
|
|
124699
|
-
}
|
|
124700
|
-
logger.info(`Installing ${result.missingServers.length} missing MCP server(s)...`);
|
|
124701
|
-
let allSuccess = true;
|
|
124702
|
-
for (const serverName of result.missingServers) {
|
|
124703
|
-
const success = await installMcpServer(serverName);
|
|
124704
|
-
if (!success) {
|
|
124705
|
-
allSuccess = false;
|
|
124706
|
-
}
|
|
124707
|
-
}
|
|
124708
|
-
return allSuccess;
|
|
124709
|
-
}
|
|
124710
|
-
|
|
124711
|
-
// src/commands/check-mcp.ts
|
|
124712
|
-
var checkMcpCommand = new Command("check-mcp").description("Check MCP servers required for SmartStack/Ralph").option("--install", "Automatically install missing MCP servers").option("--json", "Output as JSON").action(async (options) => {
|
|
124906
|
+
var checkMcpCommand = new Command("check-mcp").description("Check MCP servers status (see also: ss mcp status)").option("--install", "Automatically install missing MCP servers").option("--json", "Output as JSON").action(async (options) => {
|
|
124713
124907
|
if (!isClaudeCodeInstalled()) {
|
|
124714
124908
|
if (options.json) {
|
|
124715
124909
|
console.log(JSON.stringify({
|
|
@@ -124805,24 +124999,24 @@ var checkMcpCommand = new Command("check-mcp").description("Check MCP servers re
|
|
|
124805
124999
|
|
|
124806
125000
|
// src/commands/ralph.ts
|
|
124807
125001
|
var import_cli_table33 = __toESM(require_cli_table3());
|
|
124808
|
-
var
|
|
124809
|
-
var
|
|
125002
|
+
var import_fs_extra7 = __toESM(require_lib());
|
|
125003
|
+
var import_path8 = require("path");
|
|
124810
125004
|
function getRalphDir() {
|
|
124811
|
-
return (0,
|
|
125005
|
+
return (0, import_path8.join)(process.cwd(), ".ralph");
|
|
124812
125006
|
}
|
|
124813
125007
|
async function readRalphLogs(limit = 50) {
|
|
124814
|
-
const logsDir = (0,
|
|
124815
|
-
if (!await
|
|
125008
|
+
const logsDir = (0, import_path8.join)(getRalphDir(), "logs");
|
|
125009
|
+
if (!await import_fs_extra7.default.pathExists(logsDir)) {
|
|
124816
125010
|
return [];
|
|
124817
125011
|
}
|
|
124818
125012
|
try {
|
|
124819
|
-
const files = await
|
|
125013
|
+
const files = await import_fs_extra7.default.readdir(logsDir);
|
|
124820
125014
|
const logFiles = files.filter((f) => f.endsWith(".log")).sort().reverse();
|
|
124821
125015
|
if (logFiles.length === 0) {
|
|
124822
125016
|
return [];
|
|
124823
125017
|
}
|
|
124824
|
-
const latestLog = (0,
|
|
124825
|
-
const content = await
|
|
125018
|
+
const latestLog = (0, import_path8.join)(logsDir, logFiles[0]);
|
|
125019
|
+
const content = await import_fs_extra7.default.readFile(latestLog, "utf-8");
|
|
124826
125020
|
const lines = content.split("\n");
|
|
124827
125021
|
return lines.slice(-limit);
|
|
124828
125022
|
} catch {
|
|
@@ -124830,17 +125024,17 @@ async function readRalphLogs(limit = 50) {
|
|
|
124830
125024
|
}
|
|
124831
125025
|
}
|
|
124832
125026
|
async function listReports() {
|
|
124833
|
-
const reportsDir = (0,
|
|
124834
|
-
if (!await
|
|
125027
|
+
const reportsDir = (0, import_path8.join)(getRalphDir(), "reports");
|
|
125028
|
+
if (!await import_fs_extra7.default.pathExists(reportsDir)) {
|
|
124835
125029
|
return [];
|
|
124836
125030
|
}
|
|
124837
125031
|
try {
|
|
124838
|
-
const files = await
|
|
125032
|
+
const files = await import_fs_extra7.default.readdir(reportsDir);
|
|
124839
125033
|
const reports = [];
|
|
124840
125034
|
for (const file of files) {
|
|
124841
125035
|
if (file.endsWith(".md") || file.endsWith(".json")) {
|
|
124842
|
-
const filePath = (0,
|
|
124843
|
-
const stat = await
|
|
125036
|
+
const filePath = (0, import_path8.join)(reportsDir, file);
|
|
125037
|
+
const stat = await import_fs_extra7.default.stat(filePath);
|
|
124844
125038
|
reports.push({
|
|
124845
125039
|
name: file,
|
|
124846
125040
|
date: stat.mtime,
|
|
@@ -124919,19 +125113,19 @@ ralphCommand.command("start").description("Verify prerequisites and prepare Ralp
|
|
|
124919
125113
|
}
|
|
124920
125114
|
}
|
|
124921
125115
|
logger.step(4, 5, "Checking logs directory...");
|
|
124922
|
-
const logsDir = (0,
|
|
124923
|
-
if (await
|
|
125116
|
+
const logsDir = (0, import_path8.join)(getRalphDir(), "logs");
|
|
125117
|
+
if (await import_fs_extra7.default.pathExists(logsDir)) {
|
|
124924
125118
|
logger.success("Logs directory ready");
|
|
124925
125119
|
} else {
|
|
124926
|
-
await
|
|
125120
|
+
await import_fs_extra7.default.ensureDir(logsDir);
|
|
124927
125121
|
logger.success("Logs directory created");
|
|
124928
125122
|
}
|
|
124929
125123
|
logger.step(5, 5, "Checking reports directory...");
|
|
124930
|
-
const reportsDir = (0,
|
|
124931
|
-
if (await
|
|
125124
|
+
const reportsDir = (0, import_path8.join)(getRalphDir(), "reports");
|
|
125125
|
+
if (await import_fs_extra7.default.pathExists(reportsDir)) {
|
|
124932
125126
|
logger.success("Reports directory ready");
|
|
124933
125127
|
} else {
|
|
124934
|
-
await
|
|
125128
|
+
await import_fs_extra7.default.ensureDir(reportsDir);
|
|
124935
125129
|
logger.success("Reports directory created");
|
|
124936
125130
|
}
|
|
124937
125131
|
console.log();
|
|
@@ -124987,9 +125181,9 @@ ralphCommand.command("status").description("Show Ralph status and configuration"
|
|
|
124987
125181
|
}
|
|
124988
125182
|
console.log();
|
|
124989
125183
|
}
|
|
124990
|
-
const logsDir = (0,
|
|
124991
|
-
if (await
|
|
124992
|
-
const logFiles = (await
|
|
125184
|
+
const logsDir = (0, import_path8.join)(getRalphDir(), "logs");
|
|
125185
|
+
if (await import_fs_extra7.default.pathExists(logsDir)) {
|
|
125186
|
+
const logFiles = (await import_fs_extra7.default.readdir(logsDir)).filter((f) => f.endsWith(".log"));
|
|
124993
125187
|
if (logFiles.length > 0) {
|
|
124994
125188
|
console.log(source_default.bold("Logs:"));
|
|
124995
125189
|
console.log(` ${logFiles.length} log file(s)`);
|
|
@@ -125066,7 +125260,7 @@ ralphCommand.command("report").description("List or view feature reports").optio
|
|
|
125066
125260
|
logger.header(`Report: ${reportToShow.name}`);
|
|
125067
125261
|
console.log(source_default.gray(`Date: ${reportToShow.date.toLocaleString()}`));
|
|
125068
125262
|
console.log(source_default.gray("\u2500".repeat(60)));
|
|
125069
|
-
const content = await
|
|
125263
|
+
const content = await import_fs_extra7.default.readFile(reportToShow.path, "utf-8");
|
|
125070
125264
|
console.log(content);
|
|
125071
125265
|
});
|
|
125072
125266
|
ralphCommand.command("init").description("Initialize Ralph in the current project").option("-f, --force", "Overwrite existing configuration").action(async (options) => {
|
|
@@ -125099,8 +125293,8 @@ ralphCommand.command("init").description("Initialize Ralph in the current projec
|
|
|
125099
125293
|
// src/commands/doctor.ts
|
|
125100
125294
|
var import_cli_table34 = __toESM(require_cli_table3());
|
|
125101
125295
|
var import_child_process7 = require("child_process");
|
|
125102
|
-
var
|
|
125103
|
-
var
|
|
125296
|
+
var import_fs_extra8 = __toESM(require_lib());
|
|
125297
|
+
var import_path9 = require("path");
|
|
125104
125298
|
function getNodeVersion() {
|
|
125105
125299
|
return process.version;
|
|
125106
125300
|
}
|
|
@@ -125142,7 +125336,7 @@ function getNpmVersion() {
|
|
|
125142
125336
|
}
|
|
125143
125337
|
var doctorCommand = new Command("doctor").description("Run diagnostics and check SmartStack health").option("--json", "Output as JSON").option("-v, --verbose", "Show detailed information").action(async (options) => {
|
|
125144
125338
|
const diagnostics = [];
|
|
125145
|
-
const pkg2 = JSON.parse(await
|
|
125339
|
+
const pkg2 = JSON.parse(await import_fs_extra8.default.readFile((0, import_path9.join)(__dirname, "..", "package.json"), "utf-8"));
|
|
125146
125340
|
if (!options.json) {
|
|
125147
125341
|
console.log(source_default.cyan(`
|
|
125148
125342
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
@@ -125349,7 +125543,7 @@ ${source_default.gray(item.details)}`;
|
|
|
125349
125543
|
var import_mssql = __toESM(require_mssql());
|
|
125350
125544
|
var import_bcryptjs = __toESM(require_bcryptjs());
|
|
125351
125545
|
var import_fs4 = require("fs");
|
|
125352
|
-
var
|
|
125546
|
+
var import_path10 = require("path");
|
|
125353
125547
|
var import_child_process8 = require("child_process");
|
|
125354
125548
|
function tryLoadNativeDriver() {
|
|
125355
125549
|
try {
|
|
@@ -125377,7 +125571,7 @@ function findAppSettings(apiFolder) {
|
|
|
125377
125571
|
return [];
|
|
125378
125572
|
}
|
|
125379
125573
|
const files = (0, import_fs4.readdirSync)(apiFolder);
|
|
125380
|
-
return files.filter((f) => f.startsWith("appsettings") && f.endsWith(".json")).map((f) => (0,
|
|
125574
|
+
return files.filter((f) => f.startsWith("appsettings") && f.endsWith(".json")).map((f) => (0, import_path10.join)(apiFolder, f));
|
|
125381
125575
|
}
|
|
125382
125576
|
function extractConnectionString(filePath) {
|
|
125383
125577
|
try {
|
|
@@ -125446,12 +125640,12 @@ async function promptSqlCredentials() {
|
|
|
125446
125640
|
}
|
|
125447
125641
|
function detectSmartStackApp() {
|
|
125448
125642
|
const cwd = process.cwd();
|
|
125449
|
-
const srcDir = (0,
|
|
125643
|
+
const srcDir = (0, import_path10.join)(cwd, "src");
|
|
125450
125644
|
if ((0, import_fs4.existsSync)(srcDir)) {
|
|
125451
125645
|
const folders = (0, import_fs4.readdirSync)(srcDir);
|
|
125452
125646
|
const apiFolder = folders.find((f) => f.endsWith(".Api"));
|
|
125453
125647
|
if (apiFolder) {
|
|
125454
|
-
return (0,
|
|
125648
|
+
return (0, import_path10.join)(srcDir, apiFolder);
|
|
125455
125649
|
}
|
|
125456
125650
|
}
|
|
125457
125651
|
const possiblePaths = [
|
|
@@ -125486,14 +125680,14 @@ adminCommand.command("reset").description("Reset the localAdmin account password
|
|
|
125486
125680
|
process.exit(1);
|
|
125487
125681
|
}
|
|
125488
125682
|
let selectedFile;
|
|
125489
|
-
const localFile = appSettingsFiles.find((f) => (0,
|
|
125683
|
+
const localFile = appSettingsFiles.find((f) => (0, import_path10.basename)(f) === "appsettings.Local.json");
|
|
125490
125684
|
if (localFile && extractConnectionString(localFile)) {
|
|
125491
125685
|
selectedFile = localFile;
|
|
125492
125686
|
} else if (appSettingsFiles.length === 1) {
|
|
125493
125687
|
selectedFile = appSettingsFiles[0];
|
|
125494
125688
|
} else {
|
|
125495
125689
|
const choices = appSettingsFiles.map((f) => ({
|
|
125496
|
-
name: (0,
|
|
125690
|
+
name: (0, import_path10.basename)(f),
|
|
125497
125691
|
value: f
|
|
125498
125692
|
}));
|
|
125499
125693
|
const { file } = await lib_default.prompt([
|
|
@@ -125509,10 +125703,10 @@ adminCommand.command("reset").description("Reset the localAdmin account password
|
|
|
125509
125703
|
}
|
|
125510
125704
|
connectionString = extractConnectionString(selectedFile);
|
|
125511
125705
|
if (!connectionString) {
|
|
125512
|
-
logger.error(`No connection string found in ${(0,
|
|
125706
|
+
logger.error(`No connection string found in ${(0, import_path10.basename)(selectedFile)}`);
|
|
125513
125707
|
process.exit(1);
|
|
125514
125708
|
}
|
|
125515
|
-
logger.info(`Using: ${source_default.cyan((0,
|
|
125709
|
+
logger.info(`Using: ${source_default.cyan((0, import_path10.basename)(selectedFile))}`);
|
|
125516
125710
|
}
|
|
125517
125711
|
const adminEmail = options.email;
|
|
125518
125712
|
if (!options.force) {
|
|
@@ -125661,10 +125855,213 @@ adminCommand.command("reset").description("Reset the localAdmin account password
|
|
|
125661
125855
|
}
|
|
125662
125856
|
});
|
|
125663
125857
|
|
|
125858
|
+
// src/commands/mcp.ts
|
|
125859
|
+
var import_cli_table35 = __toESM(require_cli_table3());
|
|
125860
|
+
var import_child_process9 = require("child_process");
|
|
125861
|
+
var mcpCommand = new Command("mcp").description("MCP server management (CLI + VS Code)").action(() => {
|
|
125862
|
+
console.log(source_default.cyan(`
|
|
125863
|
+
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
125864
|
+
\u2551 ${source_default.bold("MCP Server Manager")} - SmartStack \u2551
|
|
125865
|
+
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
125866
|
+
`));
|
|
125867
|
+
console.log("Available commands:");
|
|
125868
|
+
console.log(` ${source_default.cyan("smartstack mcp install")} - Register MCP servers (CLI + VS Code)`);
|
|
125869
|
+
console.log(` ${source_default.cyan("smartstack mcp status")} - Show MCP registration status`);
|
|
125870
|
+
console.log(` ${source_default.cyan("smartstack mcp remove")} - Unregister MCP servers`);
|
|
125871
|
+
console.log();
|
|
125872
|
+
});
|
|
125873
|
+
mcpCommand.command("install").description("Register MCP servers in Claude Code CLI and VS Code").option("--cli-only", "Only register in Claude Code CLI").option("--vscode-only", "Only register in VS Code settings").option("-f, --force", "Re-register even if already present").action(async (options) => {
|
|
125874
|
+
logger.header("MCP Server Installation");
|
|
125875
|
+
const doCli = !options.vscodeOnly;
|
|
125876
|
+
const doVsCode = !options.cliOnly;
|
|
125877
|
+
const totalSteps = (doCli ? 1 : 0) + (doVsCode ? 1 : 0);
|
|
125878
|
+
let currentStep = 0;
|
|
125879
|
+
let cliSuccess = true;
|
|
125880
|
+
let vscodeSuccess = true;
|
|
125881
|
+
if (doCli) {
|
|
125882
|
+
currentStep++;
|
|
125883
|
+
logger.step(currentStep, totalSteps, "Registering in Claude Code CLI...");
|
|
125884
|
+
if (!isClaudeCodeInstalled()) {
|
|
125885
|
+
logger.warning("Claude Code CLI not available - skipping CLI registration");
|
|
125886
|
+
if (options.cliOnly) {
|
|
125887
|
+
process.exit(1);
|
|
125888
|
+
}
|
|
125889
|
+
cliSuccess = false;
|
|
125890
|
+
} else {
|
|
125891
|
+
const cliResult = checkRequiredMcpServers();
|
|
125892
|
+
if (cliResult.allInstalled && !options.force) {
|
|
125893
|
+
logger.success("All MCP servers already registered in CLI");
|
|
125894
|
+
for (const server of cliResult.servers) {
|
|
125895
|
+
console.log(` ${source_default.green("\u2713")} ${server.name}`);
|
|
125896
|
+
}
|
|
125897
|
+
} else {
|
|
125898
|
+
const serversToInstall = options.force ? REQUIRED_MCP_SERVERS : REQUIRED_MCP_SERVERS.filter((s) => cliResult.missingServers.includes(s.name));
|
|
125899
|
+
for (const server of serversToInstall) {
|
|
125900
|
+
const spinner = logger.spinner(`Registering ${server.name} in CLI...`);
|
|
125901
|
+
const result = (0, import_child_process9.spawnSync)(
|
|
125902
|
+
"claude",
|
|
125903
|
+
["mcp", "add", server.name, "--", server.command, ...server.args],
|
|
125904
|
+
{ encoding: "utf-8", shell: true, timeout: 15e3 }
|
|
125905
|
+
);
|
|
125906
|
+
if (result.status === 0) {
|
|
125907
|
+
spinner.succeed(`${server.name} registered in CLI`);
|
|
125908
|
+
} else {
|
|
125909
|
+
spinner.fail(`Failed to register ${server.name} in CLI`);
|
|
125910
|
+
cliSuccess = false;
|
|
125911
|
+
}
|
|
125912
|
+
}
|
|
125913
|
+
}
|
|
125914
|
+
}
|
|
125915
|
+
console.log();
|
|
125916
|
+
}
|
|
125917
|
+
if (doVsCode) {
|
|
125918
|
+
currentStep++;
|
|
125919
|
+
logger.step(currentStep, totalSteps, "Registering in VS Code settings...");
|
|
125920
|
+
const servers = REQUIRED_MCP_SERVERS.map((s) => ({
|
|
125921
|
+
name: s.name,
|
|
125922
|
+
command: s.command,
|
|
125923
|
+
args: s.args
|
|
125924
|
+
}));
|
|
125925
|
+
const vsResult = await registerMcpInVsCode(servers);
|
|
125926
|
+
if (vsResult.skipped) {
|
|
125927
|
+
logger.warning("VS Code settings.json not found - skipping");
|
|
125928
|
+
logger.info("VS Code may not be installed or has not been configured yet");
|
|
125929
|
+
} else if (vsResult.success) {
|
|
125930
|
+
logger.success("MCP servers registered in VS Code");
|
|
125931
|
+
logger.info(`Settings: ${source_default.cyan(vsResult.path)}`);
|
|
125932
|
+
logger.info(`Backup: ${source_default.gray(vsResult.backupPath)}`);
|
|
125933
|
+
} else {
|
|
125934
|
+
logger.error(`Failed to register in VS Code: ${vsResult.error}`);
|
|
125935
|
+
vscodeSuccess = false;
|
|
125936
|
+
}
|
|
125937
|
+
console.log();
|
|
125938
|
+
}
|
|
125939
|
+
if (cliSuccess && vscodeSuccess) {
|
|
125940
|
+
const lines = ["MCP servers registered successfully!", ""];
|
|
125941
|
+
if (doCli) lines.push("CLI: claude mcp list");
|
|
125942
|
+
if (doVsCode) lines.push("VS Code: Check claudeCode.mcpServers in settings");
|
|
125943
|
+
logger.box(lines, "success");
|
|
125944
|
+
} else {
|
|
125945
|
+
logger.box([
|
|
125946
|
+
"Some registrations failed.",
|
|
125947
|
+
"",
|
|
125948
|
+
"Run ss mcp status for details."
|
|
125949
|
+
], "error");
|
|
125950
|
+
process.exit(1);
|
|
125951
|
+
}
|
|
125952
|
+
});
|
|
125953
|
+
mcpCommand.command("status").description("Show MCP server registration status").option("--json", "Output as JSON").action(async (options) => {
|
|
125954
|
+
const claudeInstalled = isClaudeCodeInstalled();
|
|
125955
|
+
const claudeVersion = claudeInstalled ? getClaudeCodeVersion() : null;
|
|
125956
|
+
const cliResult = claudeInstalled ? checkRequiredMcpServers() : null;
|
|
125957
|
+
const vsCodeResult = await getVsCodeMcpServers();
|
|
125958
|
+
const vsCodeSettings = await findVsCodeSettings();
|
|
125959
|
+
if (options.json) {
|
|
125960
|
+
console.log(JSON.stringify({
|
|
125961
|
+
claudeCode: {
|
|
125962
|
+
installed: claudeInstalled,
|
|
125963
|
+
version: claudeVersion,
|
|
125964
|
+
servers: cliResult?.servers || []
|
|
125965
|
+
},
|
|
125966
|
+
vscode: {
|
|
125967
|
+
found: vsCodeResult.found,
|
|
125968
|
+
path: vsCodeResult.path,
|
|
125969
|
+
variant: vsCodeSettings.variant,
|
|
125970
|
+
servers: vsCodeResult.servers
|
|
125971
|
+
}
|
|
125972
|
+
}, null, 2));
|
|
125973
|
+
process.exit(cliResult?.allInstalled ? 0 : 1);
|
|
125974
|
+
}
|
|
125975
|
+
logger.header("MCP Server Status");
|
|
125976
|
+
console.log(source_default.bold("Claude Code CLI"));
|
|
125977
|
+
if (claudeInstalled) {
|
|
125978
|
+
console.log(` ${source_default.green("\u2713")} Installed ${source_default.gray(`(${claudeVersion})`)}`);
|
|
125979
|
+
} else {
|
|
125980
|
+
console.log(` ${source_default.red("\u2717")} Not installed`);
|
|
125981
|
+
}
|
|
125982
|
+
console.log();
|
|
125983
|
+
const table = new import_cli_table35.default({
|
|
125984
|
+
head: [
|
|
125985
|
+
source_default.cyan("MCP Server"),
|
|
125986
|
+
source_default.cyan("CLI"),
|
|
125987
|
+
source_default.cyan("VS Code"),
|
|
125988
|
+
source_default.cyan("Description")
|
|
125989
|
+
],
|
|
125990
|
+
style: { head: [], border: [] },
|
|
125991
|
+
colWidths: [18, 15, 15, 40]
|
|
125992
|
+
});
|
|
125993
|
+
for (const server of REQUIRED_MCP_SERVERS) {
|
|
125994
|
+
const cliInstalled = cliResult?.servers.find((s) => s.name === server.name)?.installed ?? false;
|
|
125995
|
+
const vsInstalled = server.name in (vsCodeResult.servers || {});
|
|
125996
|
+
table.push([
|
|
125997
|
+
server.name,
|
|
125998
|
+
cliInstalled ? source_default.green("\u2713 Registered") : source_default.red("\u2717 Missing"),
|
|
125999
|
+
vsInstalled ? source_default.green("\u2713 Registered") : source_default.red("\u2717 Missing"),
|
|
126000
|
+
server.description
|
|
126001
|
+
]);
|
|
126002
|
+
}
|
|
126003
|
+
console.log(table.toString());
|
|
126004
|
+
console.log();
|
|
126005
|
+
console.log(source_default.bold("VS Code"));
|
|
126006
|
+
if (vsCodeResult.found) {
|
|
126007
|
+
console.log(` ${source_default.green("\u2713")} Settings found: ${source_default.gray(vsCodeResult.path)}`);
|
|
126008
|
+
} else {
|
|
126009
|
+
console.log(` ${source_default.yellow("\u26A0")} settings.json not found`);
|
|
126010
|
+
}
|
|
126011
|
+
console.log();
|
|
126012
|
+
const allCli = cliResult?.allInstalled ?? false;
|
|
126013
|
+
const allVsCode = REQUIRED_MCP_SERVERS.every((s) => s.name in (vsCodeResult.servers || {}));
|
|
126014
|
+
if (allCli && allVsCode) {
|
|
126015
|
+
logger.box(["All MCP servers registered in CLI and VS Code!"], "success");
|
|
126016
|
+
} else {
|
|
126017
|
+
logger.box([
|
|
126018
|
+
"Some MCP servers are not registered.",
|
|
126019
|
+
"",
|
|
126020
|
+
`Fix with: ${source_default.cyan("ss mcp install")}`
|
|
126021
|
+
], "warning");
|
|
126022
|
+
}
|
|
126023
|
+
});
|
|
126024
|
+
mcpCommand.command("remove").description("Unregister MCP servers from CLI and VS Code").option("--cli-only", "Only remove from Claude Code CLI").option("--vscode-only", "Only remove from VS Code settings").action(async (options) => {
|
|
126025
|
+
logger.header("MCP Server Removal");
|
|
126026
|
+
if (!options.vscodeOnly) {
|
|
126027
|
+
logger.info("Removing from Claude Code CLI...");
|
|
126028
|
+
for (const server of REQUIRED_MCP_SERVERS) {
|
|
126029
|
+
const result = (0, import_child_process9.spawnSync)("claude", ["mcp", "remove", server.name], {
|
|
126030
|
+
encoding: "utf-8",
|
|
126031
|
+
shell: true,
|
|
126032
|
+
timeout: 1e4
|
|
126033
|
+
});
|
|
126034
|
+
if (result.status === 0) {
|
|
126035
|
+
logger.success(`Removed ${server.name} from CLI`);
|
|
126036
|
+
} else {
|
|
126037
|
+
logger.warning(`${server.name} was not registered in CLI`);
|
|
126038
|
+
}
|
|
126039
|
+
}
|
|
126040
|
+
console.log();
|
|
126041
|
+
}
|
|
126042
|
+
if (!options.cliOnly) {
|
|
126043
|
+
logger.info("Removing from VS Code settings...");
|
|
126044
|
+
const serverNames = REQUIRED_MCP_SERVERS.map((s) => s.name);
|
|
126045
|
+
const result = await unregisterMcpFromVsCode(serverNames);
|
|
126046
|
+
if (result.skipped) {
|
|
126047
|
+
logger.warning("VS Code settings.json not found - skipping");
|
|
126048
|
+
} else if (result.success) {
|
|
126049
|
+
logger.success("Removed MCP servers from VS Code settings");
|
|
126050
|
+
if (result.backupPath) {
|
|
126051
|
+
logger.info(`Backup: ${source_default.gray(result.backupPath)}`);
|
|
126052
|
+
}
|
|
126053
|
+
} else {
|
|
126054
|
+
logger.error(`Failed to remove from VS Code: ${result.error}`);
|
|
126055
|
+
}
|
|
126056
|
+
console.log();
|
|
126057
|
+
}
|
|
126058
|
+
logger.box(["MCP servers unregistered.", "", "Re-register with: ss mcp install"], "info");
|
|
126059
|
+
});
|
|
126060
|
+
|
|
125664
126061
|
// src/index.ts
|
|
125665
126062
|
var import_fs5 = require("fs");
|
|
125666
|
-
var
|
|
125667
|
-
var pkg = JSON.parse((0, import_fs5.readFileSync)((0,
|
|
126063
|
+
var import_path11 = require("path");
|
|
126064
|
+
var pkg = JSON.parse((0, import_fs5.readFileSync)((0, import_path11.join)(__dirname, "..", "package.json"), "utf-8"));
|
|
125668
126065
|
var LICENSE_FREE_COMMANDS = ["license", "help", "--help", "-h", "--version", "-v"];
|
|
125669
126066
|
async function main2() {
|
|
125670
126067
|
const program2 = new Command();
|
|
@@ -125681,6 +126078,7 @@ async function main2() {
|
|
|
125681
126078
|
program2.addCommand(ralphCommand);
|
|
125682
126079
|
program2.addCommand(doctorCommand);
|
|
125683
126080
|
program2.addCommand(adminCommand);
|
|
126081
|
+
program2.addCommand(mcpCommand);
|
|
125684
126082
|
const args = process.argv.slice(2);
|
|
125685
126083
|
const commandName = args[0] || "";
|
|
125686
126084
|
const requiresLicense = !LICENSE_FREE_COMMANDS.some(
|