@stacksjs/validation 0.61.23 → 0.62.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 +774 -753
- package/package.json +1 -1
- package/src/validator.ts +49 -11
package/dist/index.js
CHANGED
|
@@ -1265,8 +1265,8 @@ var require_isLocale = __commonJS((exports, module) => {
|
|
|
1265
1265
|
var singleton = "(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])";
|
|
1266
1266
|
var extension = "(".concat(singleton, "(-[A-Za-z0-9]{2,8})+)");
|
|
1267
1267
|
var privateuse = "(x(-[A-Za-z0-9]{1,8})+)";
|
|
1268
|
-
var irregular = "((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))";
|
|
1269
|
-
var regular = "((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))";
|
|
1268
|
+
var irregular = "((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|" + "(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|" + "(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))";
|
|
1269
|
+
var regular = "((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|" + "(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))";
|
|
1270
1270
|
var grandfathered = "(".concat(irregular, "|").concat(regular, ")");
|
|
1271
1271
|
var delimiter = "(-|_)";
|
|
1272
1272
|
var langtag = "".concat(language, "(").concat(delimiter).concat(script, ")?(").concat(delimiter).concat(region, ")?(").concat(delimiter).concat(variant, ")*(").concat(delimiter).concat(extension, ")*(").concat(delimiter).concat(privateuse, ")?");
|
|
@@ -6205,8 +6205,8 @@ var require_universalify = __commonJS((exports) => {
|
|
|
6205
6205
|
if (typeof args[args.length - 1] === "function")
|
|
6206
6206
|
fn.apply(this, args);
|
|
6207
6207
|
else {
|
|
6208
|
-
return new Promise((
|
|
6209
|
-
args.push((err, res) => err != null ? reject(err) :
|
|
6208
|
+
return new Promise((resolve, reject) => {
|
|
6209
|
+
args.push((err, res) => err != null ? reject(err) : resolve(res));
|
|
6210
6210
|
fn.apply(this, args);
|
|
6211
6211
|
});
|
|
6212
6212
|
}
|
|
@@ -6253,7 +6253,7 @@ var require_polyfills = __commonJS((exports, module) => {
|
|
|
6253
6253
|
fs.fstatSync = statFixSync(fs.fstatSync);
|
|
6254
6254
|
fs.lstatSync = statFixSync(fs.lstatSync);
|
|
6255
6255
|
if (fs.chmod && !fs.lchmod) {
|
|
6256
|
-
fs.lchmod = function(
|
|
6256
|
+
fs.lchmod = function(path, mode, cb) {
|
|
6257
6257
|
if (cb)
|
|
6258
6258
|
process.nextTick(cb);
|
|
6259
6259
|
};
|
|
@@ -6261,7 +6261,7 @@ var require_polyfills = __commonJS((exports, module) => {
|
|
|
6261
6261
|
};
|
|
6262
6262
|
}
|
|
6263
6263
|
if (fs.chown && !fs.lchown) {
|
|
6264
|
-
fs.lchown = function(
|
|
6264
|
+
fs.lchown = function(path, uid, gid, cb) {
|
|
6265
6265
|
if (cb)
|
|
6266
6266
|
process.nextTick(cb);
|
|
6267
6267
|
};
|
|
@@ -6332,8 +6332,8 @@ var require_polyfills = __commonJS((exports, module) => {
|
|
|
6332
6332
|
};
|
|
6333
6333
|
}(fs.readSync);
|
|
6334
6334
|
function patchLchmod(fs2) {
|
|
6335
|
-
fs2.lchmod = function(
|
|
6336
|
-
fs2.open(
|
|
6335
|
+
fs2.lchmod = function(path, mode, callback) {
|
|
6336
|
+
fs2.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
|
|
6337
6337
|
if (err) {
|
|
6338
6338
|
if (callback)
|
|
6339
6339
|
callback(err);
|
|
@@ -6347,8 +6347,8 @@ var require_polyfills = __commonJS((exports, module) => {
|
|
|
6347
6347
|
});
|
|
6348
6348
|
});
|
|
6349
6349
|
};
|
|
6350
|
-
fs2.lchmodSync = function(
|
|
6351
|
-
var fd = fs2.openSync(
|
|
6350
|
+
fs2.lchmodSync = function(path, mode) {
|
|
6351
|
+
var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
6352
6352
|
var threw = true;
|
|
6353
6353
|
var ret;
|
|
6354
6354
|
try {
|
|
@@ -6369,8 +6369,8 @@ var require_polyfills = __commonJS((exports, module) => {
|
|
|
6369
6369
|
}
|
|
6370
6370
|
function patchLutimes(fs2) {
|
|
6371
6371
|
if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
|
|
6372
|
-
fs2.lutimes = function(
|
|
6373
|
-
fs2.open(
|
|
6372
|
+
fs2.lutimes = function(path, at, mt, cb) {
|
|
6373
|
+
fs2.open(path, constants.O_SYMLINK, function(er, fd) {
|
|
6374
6374
|
if (er) {
|
|
6375
6375
|
if (cb)
|
|
6376
6376
|
cb(er);
|
|
@@ -6384,8 +6384,8 @@ var require_polyfills = __commonJS((exports, module) => {
|
|
|
6384
6384
|
});
|
|
6385
6385
|
});
|
|
6386
6386
|
};
|
|
6387
|
-
fs2.lutimesSync = function(
|
|
6388
|
-
var fd = fs2.openSync(
|
|
6387
|
+
fs2.lutimesSync = function(path, at, mt) {
|
|
6388
|
+
var fd = fs2.openSync(path, constants.O_SYMLINK);
|
|
6389
6389
|
var ret;
|
|
6390
6390
|
var threw = true;
|
|
6391
6391
|
try {
|
|
@@ -6541,12 +6541,12 @@ var require_legacy_streams = __commonJS((exports, module) => {
|
|
|
6541
6541
|
ReadStream,
|
|
6542
6542
|
WriteStream
|
|
6543
6543
|
};
|
|
6544
|
-
function ReadStream(
|
|
6544
|
+
function ReadStream(path, options) {
|
|
6545
6545
|
if (!(this instanceof ReadStream))
|
|
6546
|
-
return new ReadStream(
|
|
6546
|
+
return new ReadStream(path, options);
|
|
6547
6547
|
Stream.call(this);
|
|
6548
6548
|
var self2 = this;
|
|
6549
|
-
this.path =
|
|
6549
|
+
this.path = path;
|
|
6550
6550
|
this.fd = null;
|
|
6551
6551
|
this.readable = true;
|
|
6552
6552
|
this.paused = false;
|
|
@@ -6592,11 +6592,11 @@ var require_legacy_streams = __commonJS((exports, module) => {
|
|
|
6592
6592
|
self2._read();
|
|
6593
6593
|
});
|
|
6594
6594
|
}
|
|
6595
|
-
function WriteStream(
|
|
6595
|
+
function WriteStream(path, options) {
|
|
6596
6596
|
if (!(this instanceof WriteStream))
|
|
6597
|
-
return new WriteStream(
|
|
6597
|
+
return new WriteStream(path, options);
|
|
6598
6598
|
Stream.call(this);
|
|
6599
|
-
this.path =
|
|
6599
|
+
this.path = path;
|
|
6600
6600
|
this.fd = null;
|
|
6601
6601
|
this.writable = true;
|
|
6602
6602
|
this.flags = "w";
|
|
@@ -6669,14 +6669,14 @@ var require_graceful_fs = __commonJS((exports, module) => {
|
|
|
6669
6669
|
fs2.createWriteStream = createWriteStream;
|
|
6670
6670
|
var fs$readFile = fs2.readFile;
|
|
6671
6671
|
fs2.readFile = readFile;
|
|
6672
|
-
function readFile(
|
|
6672
|
+
function readFile(path, options, cb) {
|
|
6673
6673
|
if (typeof options === "function")
|
|
6674
6674
|
cb = options, options = null;
|
|
6675
|
-
return go$readFile(
|
|
6676
|
-
function go$readFile(
|
|
6677
|
-
return fs$readFile(
|
|
6675
|
+
return go$readFile(path, options, cb);
|
|
6676
|
+
function go$readFile(path2, options2, cb2, startTime) {
|
|
6677
|
+
return fs$readFile(path2, options2, function(err) {
|
|
6678
6678
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
6679
|
-
enqueue([go$readFile, [
|
|
6679
|
+
enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
6680
6680
|
else {
|
|
6681
6681
|
if (typeof cb2 === "function")
|
|
6682
6682
|
cb2.apply(this, arguments);
|
|
@@ -6686,14 +6686,14 @@ var require_graceful_fs = __commonJS((exports, module) => {
|
|
|
6686
6686
|
}
|
|
6687
6687
|
var fs$writeFile = fs2.writeFile;
|
|
6688
6688
|
fs2.writeFile = writeFile;
|
|
6689
|
-
function writeFile(
|
|
6689
|
+
function writeFile(path, data, options, cb) {
|
|
6690
6690
|
if (typeof options === "function")
|
|
6691
6691
|
cb = options, options = null;
|
|
6692
|
-
return go$writeFile(
|
|
6693
|
-
function go$writeFile(
|
|
6694
|
-
return fs$writeFile(
|
|
6692
|
+
return go$writeFile(path, data, options, cb);
|
|
6693
|
+
function go$writeFile(path2, data2, options2, cb2, startTime) {
|
|
6694
|
+
return fs$writeFile(path2, data2, options2, function(err) {
|
|
6695
6695
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
6696
|
-
enqueue([go$writeFile, [
|
|
6696
|
+
enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
6697
6697
|
else {
|
|
6698
6698
|
if (typeof cb2 === "function")
|
|
6699
6699
|
cb2.apply(this, arguments);
|
|
@@ -6704,14 +6704,14 @@ var require_graceful_fs = __commonJS((exports, module) => {
|
|
|
6704
6704
|
var fs$appendFile = fs2.appendFile;
|
|
6705
6705
|
if (fs$appendFile)
|
|
6706
6706
|
fs2.appendFile = appendFile;
|
|
6707
|
-
function appendFile(
|
|
6707
|
+
function appendFile(path, data, options, cb) {
|
|
6708
6708
|
if (typeof options === "function")
|
|
6709
6709
|
cb = options, options = null;
|
|
6710
|
-
return go$appendFile(
|
|
6711
|
-
function go$appendFile(
|
|
6712
|
-
return fs$appendFile(
|
|
6710
|
+
return go$appendFile(path, data, options, cb);
|
|
6711
|
+
function go$appendFile(path2, data2, options2, cb2, startTime) {
|
|
6712
|
+
return fs$appendFile(path2, data2, options2, function(err) {
|
|
6713
6713
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
6714
|
-
enqueue([go$appendFile, [
|
|
6714
|
+
enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
6715
6715
|
else {
|
|
6716
6716
|
if (typeof cb2 === "function")
|
|
6717
6717
|
cb2.apply(this, arguments);
|
|
@@ -6742,21 +6742,21 @@ var require_graceful_fs = __commonJS((exports, module) => {
|
|
|
6742
6742
|
var fs$readdir = fs2.readdir;
|
|
6743
6743
|
fs2.readdir = readdir;
|
|
6744
6744
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
6745
|
-
function readdir(
|
|
6745
|
+
function readdir(path, options, cb) {
|
|
6746
6746
|
if (typeof options === "function")
|
|
6747
6747
|
cb = options, options = null;
|
|
6748
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(
|
|
6749
|
-
return fs$readdir(
|
|
6750
|
-
} : function go$readdir(
|
|
6751
|
-
return fs$readdir(
|
|
6748
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(path2, options2, cb2, startTime) {
|
|
6749
|
+
return fs$readdir(path2, fs$readdirCallback(path2, options2, cb2, startTime));
|
|
6750
|
+
} : function go$readdir(path2, options2, cb2, startTime) {
|
|
6751
|
+
return fs$readdir(path2, options2, fs$readdirCallback(path2, options2, cb2, startTime));
|
|
6752
6752
|
};
|
|
6753
|
-
return go$readdir(
|
|
6754
|
-
function fs$readdirCallback(
|
|
6753
|
+
return go$readdir(path, options, cb);
|
|
6754
|
+
function fs$readdirCallback(path2, options2, cb2, startTime) {
|
|
6755
6755
|
return function(err, files) {
|
|
6756
6756
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
6757
6757
|
enqueue([
|
|
6758
6758
|
go$readdir,
|
|
6759
|
-
[
|
|
6759
|
+
[path2, options2, cb2],
|
|
6760
6760
|
err,
|
|
6761
6761
|
startTime || Date.now(),
|
|
6762
6762
|
Date.now()
|
|
@@ -6827,7 +6827,7 @@ var require_graceful_fs = __commonJS((exports, module) => {
|
|
|
6827
6827
|
enumerable: true,
|
|
6828
6828
|
configurable: true
|
|
6829
6829
|
});
|
|
6830
|
-
function ReadStream(
|
|
6830
|
+
function ReadStream(path, options) {
|
|
6831
6831
|
if (this instanceof ReadStream)
|
|
6832
6832
|
return fs$ReadStream.apply(this, arguments), this;
|
|
6833
6833
|
else
|
|
@@ -6847,7 +6847,7 @@ var require_graceful_fs = __commonJS((exports, module) => {
|
|
|
6847
6847
|
}
|
|
6848
6848
|
});
|
|
6849
6849
|
}
|
|
6850
|
-
function WriteStream(
|
|
6850
|
+
function WriteStream(path, options) {
|
|
6851
6851
|
if (this instanceof WriteStream)
|
|
6852
6852
|
return fs$WriteStream.apply(this, arguments), this;
|
|
6853
6853
|
else
|
|
@@ -6865,22 +6865,22 @@ var require_graceful_fs = __commonJS((exports, module) => {
|
|
|
6865
6865
|
}
|
|
6866
6866
|
});
|
|
6867
6867
|
}
|
|
6868
|
-
function createReadStream(
|
|
6869
|
-
return new fs2.ReadStream(
|
|
6868
|
+
function createReadStream(path, options) {
|
|
6869
|
+
return new fs2.ReadStream(path, options);
|
|
6870
6870
|
}
|
|
6871
|
-
function createWriteStream(
|
|
6872
|
-
return new fs2.WriteStream(
|
|
6871
|
+
function createWriteStream(path, options) {
|
|
6872
|
+
return new fs2.WriteStream(path, options);
|
|
6873
6873
|
}
|
|
6874
6874
|
var fs$open = fs2.open;
|
|
6875
6875
|
fs2.open = open;
|
|
6876
|
-
function open(
|
|
6876
|
+
function open(path, flags, mode, cb) {
|
|
6877
6877
|
if (typeof mode === "function")
|
|
6878
6878
|
cb = mode, mode = null;
|
|
6879
|
-
return go$open(
|
|
6880
|
-
function go$open(
|
|
6881
|
-
return fs$open(
|
|
6879
|
+
return go$open(path, flags, mode, cb);
|
|
6880
|
+
function go$open(path2, flags2, mode2, cb2, startTime) {
|
|
6881
|
+
return fs$open(path2, flags2, mode2, function(err, fd) {
|
|
6882
6882
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
6883
|
-
enqueue([go$open, [
|
|
6883
|
+
enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
6884
6884
|
else {
|
|
6885
6885
|
if (typeof cb2 === "function")
|
|
6886
6886
|
cb2.apply(this, arguments);
|
|
@@ -7059,19 +7059,19 @@ var require_fs = __commonJS((exports) => {
|
|
|
7059
7059
|
if (typeof callback === "function") {
|
|
7060
7060
|
return fs.exists(filename, callback);
|
|
7061
7061
|
}
|
|
7062
|
-
return new Promise((
|
|
7063
|
-
return fs.exists(filename,
|
|
7062
|
+
return new Promise((resolve) => {
|
|
7063
|
+
return fs.exists(filename, resolve);
|
|
7064
7064
|
});
|
|
7065
7065
|
};
|
|
7066
7066
|
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
7067
7067
|
if (typeof callback === "function") {
|
|
7068
7068
|
return fs.read(fd, buffer, offset, length, position, callback);
|
|
7069
7069
|
}
|
|
7070
|
-
return new Promise((
|
|
7070
|
+
return new Promise((resolve, reject) => {
|
|
7071
7071
|
fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
7072
7072
|
if (err)
|
|
7073
7073
|
return reject(err);
|
|
7074
|
-
|
|
7074
|
+
resolve({ bytesRead, buffer: buffer2 });
|
|
7075
7075
|
});
|
|
7076
7076
|
});
|
|
7077
7077
|
};
|
|
@@ -7079,11 +7079,11 @@ var require_fs = __commonJS((exports) => {
|
|
|
7079
7079
|
if (typeof args[args.length - 1] === "function") {
|
|
7080
7080
|
return fs.write(fd, buffer, ...args);
|
|
7081
7081
|
}
|
|
7082
|
-
return new Promise((
|
|
7082
|
+
return new Promise((resolve, reject) => {
|
|
7083
7083
|
fs.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
7084
7084
|
if (err)
|
|
7085
7085
|
return reject(err);
|
|
7086
|
-
|
|
7086
|
+
resolve({ bytesWritten, buffer: buffer2 });
|
|
7087
7087
|
});
|
|
7088
7088
|
});
|
|
7089
7089
|
};
|
|
@@ -7091,11 +7091,11 @@ var require_fs = __commonJS((exports) => {
|
|
|
7091
7091
|
if (typeof args[args.length - 1] === "function") {
|
|
7092
7092
|
return fs.readv(fd, buffers, ...args);
|
|
7093
7093
|
}
|
|
7094
|
-
return new Promise((
|
|
7094
|
+
return new Promise((resolve, reject) => {
|
|
7095
7095
|
fs.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
7096
7096
|
if (err)
|
|
7097
7097
|
return reject(err);
|
|
7098
|
-
|
|
7098
|
+
resolve({ bytesRead, buffers: buffers2 });
|
|
7099
7099
|
});
|
|
7100
7100
|
});
|
|
7101
7101
|
};
|
|
@@ -7103,11 +7103,11 @@ var require_fs = __commonJS((exports) => {
|
|
|
7103
7103
|
if (typeof args[args.length - 1] === "function") {
|
|
7104
7104
|
return fs.writev(fd, buffers, ...args);
|
|
7105
7105
|
}
|
|
7106
|
-
return new Promise((
|
|
7106
|
+
return new Promise((resolve, reject) => {
|
|
7107
7107
|
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
7108
7108
|
if (err)
|
|
7109
7109
|
return reject(err);
|
|
7110
|
-
|
|
7110
|
+
resolve({ bytesWritten, buffers: buffers2 });
|
|
7111
7111
|
});
|
|
7112
7112
|
});
|
|
7113
7113
|
};
|
|
@@ -7120,10 +7120,10 @@ var require_fs = __commonJS((exports) => {
|
|
|
7120
7120
|
|
|
7121
7121
|
// ../../../../node_modules/fs-extra/lib/mkdirs/utils.js
|
|
7122
7122
|
var require_utils = __commonJS((exports, module) => {
|
|
7123
|
-
var
|
|
7123
|
+
var path = import.meta.require("path");
|
|
7124
7124
|
exports.checkPath = function checkPath(pth) {
|
|
7125
7125
|
if (process.platform === "win32") {
|
|
7126
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
7126
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
|
|
7127
7127
|
if (pathHasInvalidWinCharacters) {
|
|
7128
7128
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
7129
7129
|
error.code = "EINVAL";
|
|
@@ -7176,8 +7176,8 @@ var require_mkdirs = __commonJS((exports, module) => {
|
|
|
7176
7176
|
|
|
7177
7177
|
// ../../../../node_modules/fs-extra/lib/path-exists/index.js
|
|
7178
7178
|
var require_path_exists = __commonJS((exports, module) => {
|
|
7179
|
-
var pathExists = function(
|
|
7180
|
-
return fs.access(
|
|
7179
|
+
var pathExists = function(path) {
|
|
7180
|
+
return fs.access(path).then(() => true).catch(() => false);
|
|
7181
7181
|
};
|
|
7182
7182
|
var u = require_universalify().fromPromise;
|
|
7183
7183
|
var fs = require_fs();
|
|
@@ -7189,8 +7189,8 @@ var require_path_exists = __commonJS((exports, module) => {
|
|
|
7189
7189
|
|
|
7190
7190
|
// ../../../../node_modules/fs-extra/lib/util/utimes.js
|
|
7191
7191
|
var require_utimes = __commonJS((exports, module) => {
|
|
7192
|
-
async function utimesMillis(
|
|
7193
|
-
const fd = await fs.open(
|
|
7192
|
+
async function utimesMillis(path, atime, mtime) {
|
|
7193
|
+
const fd = await fs.open(path, "r+");
|
|
7194
7194
|
let closeErr = null;
|
|
7195
7195
|
try {
|
|
7196
7196
|
await fs.futimes(fd, atime, mtime);
|
|
@@ -7205,8 +7205,8 @@ var require_utimes = __commonJS((exports, module) => {
|
|
|
7205
7205
|
throw closeErr;
|
|
7206
7206
|
}
|
|
7207
7207
|
}
|
|
7208
|
-
var utimesMillisSync = function(
|
|
7209
|
-
const fd = fs.openSync(
|
|
7208
|
+
var utimesMillisSync = function(path, atime, mtime) {
|
|
7209
|
+
const fd = fs.openSync(path, "r+");
|
|
7210
7210
|
fs.futimesSync(fd, atime, mtime);
|
|
7211
7211
|
return fs.closeSync(fd);
|
|
7212
7212
|
};
|
|
@@ -7248,8 +7248,8 @@ var require_stat = __commonJS((exports, module) => {
|
|
|
7248
7248
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
7249
7249
|
if (destStat) {
|
|
7250
7250
|
if (areIdentical(srcStat, destStat)) {
|
|
7251
|
-
const srcBaseName =
|
|
7252
|
-
const destBaseName =
|
|
7251
|
+
const srcBaseName = path.basename(src);
|
|
7252
|
+
const destBaseName = path.basename(dest);
|
|
7253
7253
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
7254
7254
|
return { srcStat, destStat, isChangingCase: true };
|
|
7255
7255
|
}
|
|
@@ -7271,8 +7271,8 @@ var require_stat = __commonJS((exports, module) => {
|
|
|
7271
7271
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
7272
7272
|
if (destStat) {
|
|
7273
7273
|
if (areIdentical(srcStat, destStat)) {
|
|
7274
|
-
const srcBaseName =
|
|
7275
|
-
const destBaseName =
|
|
7274
|
+
const srcBaseName = path.basename(src);
|
|
7275
|
+
const destBaseName = path.basename(dest);
|
|
7276
7276
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
7277
7277
|
return { srcStat, destStat, isChangingCase: true };
|
|
7278
7278
|
}
|
|
@@ -7291,9 +7291,9 @@ var require_stat = __commonJS((exports, module) => {
|
|
|
7291
7291
|
return { srcStat, destStat };
|
|
7292
7292
|
};
|
|
7293
7293
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
7294
|
-
const srcParent =
|
|
7295
|
-
const destParent =
|
|
7296
|
-
if (destParent === srcParent || destParent ===
|
|
7294
|
+
const srcParent = path.resolve(path.dirname(src));
|
|
7295
|
+
const destParent = path.resolve(path.dirname(dest));
|
|
7296
|
+
if (destParent === srcParent || destParent === path.parse(destParent).root)
|
|
7297
7297
|
return;
|
|
7298
7298
|
let destStat;
|
|
7299
7299
|
try {
|
|
@@ -7309,9 +7309,9 @@ var require_stat = __commonJS((exports, module) => {
|
|
|
7309
7309
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
7310
7310
|
}
|
|
7311
7311
|
var checkParentPathsSync = function(src, srcStat, dest, funcName) {
|
|
7312
|
-
const srcParent =
|
|
7313
|
-
const destParent =
|
|
7314
|
-
if (destParent === srcParent || destParent ===
|
|
7312
|
+
const srcParent = path.resolve(path.dirname(src));
|
|
7313
|
+
const destParent = path.resolve(path.dirname(dest));
|
|
7314
|
+
if (destParent === srcParent || destParent === path.parse(destParent).root)
|
|
7315
7315
|
return;
|
|
7316
7316
|
let destStat;
|
|
7317
7317
|
try {
|
|
@@ -7330,15 +7330,15 @@ var require_stat = __commonJS((exports, module) => {
|
|
|
7330
7330
|
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
7331
7331
|
};
|
|
7332
7332
|
var isSrcSubdir = function(src, dest) {
|
|
7333
|
-
const srcArr =
|
|
7334
|
-
const destArr =
|
|
7333
|
+
const srcArr = path.resolve(src).split(path.sep).filter((i) => i);
|
|
7334
|
+
const destArr = path.resolve(dest).split(path.sep).filter((i) => i);
|
|
7335
7335
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
7336
7336
|
};
|
|
7337
7337
|
var errMsg = function(src, dest, funcName) {
|
|
7338
7338
|
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
|
7339
7339
|
};
|
|
7340
7340
|
var fs = require_fs();
|
|
7341
|
-
var
|
|
7341
|
+
var path = import.meta.require("path");
|
|
7342
7342
|
var u = require_universalify().fromPromise;
|
|
7343
7343
|
module.exports = {
|
|
7344
7344
|
checkPaths: u(checkPaths),
|
|
@@ -7359,14 +7359,14 @@ var require_copy = __commonJS((exports, module) => {
|
|
|
7359
7359
|
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
7360
7360
|
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
7361
7361
|
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
7362
|
-
process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0001");
|
|
7362
|
+
process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n" + "\tsee https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0001");
|
|
7363
7363
|
}
|
|
7364
7364
|
const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
|
|
7365
7365
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
7366
7366
|
const include = await runFilter(src, dest, opts);
|
|
7367
7367
|
if (!include)
|
|
7368
7368
|
return;
|
|
7369
|
-
const destParent =
|
|
7369
|
+
const destParent = path.dirname(dest);
|
|
7370
7370
|
const dirExists = await pathExists(destParent);
|
|
7371
7371
|
if (!dirExists) {
|
|
7372
7372
|
await mkdirs(destParent);
|
|
@@ -7427,8 +7427,8 @@ var require_copy = __commonJS((exports, module) => {
|
|
|
7427
7427
|
}
|
|
7428
7428
|
const items = await fs.readdir(src);
|
|
7429
7429
|
await Promise.all(items.map(async (item) => {
|
|
7430
|
-
const srcItem =
|
|
7431
|
-
const destItem =
|
|
7430
|
+
const srcItem = path.join(src, item);
|
|
7431
|
+
const destItem = path.join(dest, item);
|
|
7432
7432
|
const include = await runFilter(srcItem, destItem, opts);
|
|
7433
7433
|
if (!include)
|
|
7434
7434
|
return;
|
|
@@ -7442,7 +7442,7 @@ var require_copy = __commonJS((exports, module) => {
|
|
|
7442
7442
|
async function onLink(destStat, src, dest, opts) {
|
|
7443
7443
|
let resolvedSrc = await fs.readlink(src);
|
|
7444
7444
|
if (opts.dereference) {
|
|
7445
|
-
resolvedSrc =
|
|
7445
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
|
7446
7446
|
}
|
|
7447
7447
|
if (!destStat) {
|
|
7448
7448
|
return fs.symlink(resolvedSrc, dest);
|
|
@@ -7456,7 +7456,7 @@ var require_copy = __commonJS((exports, module) => {
|
|
|
7456
7456
|
throw e;
|
|
7457
7457
|
}
|
|
7458
7458
|
if (opts.dereference) {
|
|
7459
|
-
resolvedDest =
|
|
7459
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
|
7460
7460
|
}
|
|
7461
7461
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
7462
7462
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -7468,7 +7468,7 @@ var require_copy = __commonJS((exports, module) => {
|
|
|
7468
7468
|
return fs.symlink(resolvedSrc, dest);
|
|
7469
7469
|
}
|
|
7470
7470
|
var fs = require_fs();
|
|
7471
|
-
var
|
|
7471
|
+
var path = import.meta.require("path");
|
|
7472
7472
|
var { mkdirs } = require_mkdirs();
|
|
7473
7473
|
var { pathExists } = require_path_exists();
|
|
7474
7474
|
var { utimesMillis } = require_utimes();
|
|
@@ -7486,13 +7486,13 @@ var require_copy_sync = __commonJS((exports, module) => {
|
|
|
7486
7486
|
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
7487
7487
|
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
7488
7488
|
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
7489
|
-
process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0002");
|
|
7489
|
+
process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n" + "\tsee https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0002");
|
|
7490
7490
|
}
|
|
7491
7491
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
7492
7492
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
7493
7493
|
if (opts.filter && !opts.filter(src, dest))
|
|
7494
7494
|
return;
|
|
7495
|
-
const destParent =
|
|
7495
|
+
const destParent = path.dirname(dest);
|
|
7496
7496
|
if (!fs.existsSync(destParent))
|
|
7497
7497
|
mkdirsSync(destParent);
|
|
7498
7498
|
return getStats(destStat, src, dest, opts);
|
|
@@ -7563,8 +7563,8 @@ var require_copy_sync = __commonJS((exports, module) => {
|
|
|
7563
7563
|
fs.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
|
7564
7564
|
};
|
|
7565
7565
|
var copyDirItem = function(item, src, dest, opts) {
|
|
7566
|
-
const srcItem =
|
|
7567
|
-
const destItem =
|
|
7566
|
+
const srcItem = path.join(src, item);
|
|
7567
|
+
const destItem = path.join(dest, item);
|
|
7568
7568
|
if (opts.filter && !opts.filter(srcItem, destItem))
|
|
7569
7569
|
return;
|
|
7570
7570
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
@@ -7573,7 +7573,7 @@ var require_copy_sync = __commonJS((exports, module) => {
|
|
|
7573
7573
|
var onLink = function(destStat, src, dest, opts) {
|
|
7574
7574
|
let resolvedSrc = fs.readlinkSync(src);
|
|
7575
7575
|
if (opts.dereference) {
|
|
7576
|
-
resolvedSrc =
|
|
7576
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
|
7577
7577
|
}
|
|
7578
7578
|
if (!destStat) {
|
|
7579
7579
|
return fs.symlinkSync(resolvedSrc, dest);
|
|
@@ -7587,7 +7587,7 @@ var require_copy_sync = __commonJS((exports, module) => {
|
|
|
7587
7587
|
throw err;
|
|
7588
7588
|
}
|
|
7589
7589
|
if (opts.dereference) {
|
|
7590
|
-
resolvedDest =
|
|
7590
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
|
7591
7591
|
}
|
|
7592
7592
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
7593
7593
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -7603,7 +7603,7 @@ var require_copy_sync = __commonJS((exports, module) => {
|
|
|
7603
7603
|
return fs.symlinkSync(resolvedSrc, dest);
|
|
7604
7604
|
};
|
|
7605
7605
|
var fs = require_graceful_fs();
|
|
7606
|
-
var
|
|
7606
|
+
var path = import.meta.require("path");
|
|
7607
7607
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
7608
7608
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
7609
7609
|
var stat = require_stat();
|
|
@@ -7621,11 +7621,11 @@ var require_copy2 = __commonJS((exports, module) => {
|
|
|
7621
7621
|
|
|
7622
7622
|
// ../../../../node_modules/fs-extra/lib/remove/index.js
|
|
7623
7623
|
var require_remove = __commonJS((exports, module) => {
|
|
7624
|
-
var remove = function(
|
|
7625
|
-
fs.rm(
|
|
7624
|
+
var remove = function(path, callback) {
|
|
7625
|
+
fs.rm(path, { recursive: true, force: true }, callback);
|
|
7626
7626
|
};
|
|
7627
|
-
var removeSync = function(
|
|
7628
|
-
fs.rmSync(
|
|
7627
|
+
var removeSync = function(path) {
|
|
7628
|
+
fs.rmSync(path, { recursive: true, force: true });
|
|
7629
7629
|
};
|
|
7630
7630
|
var fs = require_graceful_fs();
|
|
7631
7631
|
var u = require_universalify().fromCallback;
|
|
@@ -7645,13 +7645,13 @@ var require_empty = __commonJS((exports, module) => {
|
|
|
7645
7645
|
return mkdir.mkdirsSync(dir);
|
|
7646
7646
|
}
|
|
7647
7647
|
items.forEach((item) => {
|
|
7648
|
-
item =
|
|
7648
|
+
item = path.join(dir, item);
|
|
7649
7649
|
remove.removeSync(item);
|
|
7650
7650
|
});
|
|
7651
7651
|
};
|
|
7652
7652
|
var u = require_universalify().fromPromise;
|
|
7653
7653
|
var fs = require_fs();
|
|
7654
|
-
var
|
|
7654
|
+
var path = import.meta.require("path");
|
|
7655
7655
|
var mkdir = require_mkdirs();
|
|
7656
7656
|
var remove = require_remove();
|
|
7657
7657
|
var emptyDir = u(async function emptyDir(dir) {
|
|
@@ -7661,7 +7661,7 @@ var require_empty = __commonJS((exports, module) => {
|
|
|
7661
7661
|
} catch {
|
|
7662
7662
|
return mkdir.mkdirs(dir);
|
|
7663
7663
|
}
|
|
7664
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
7664
|
+
return Promise.all(items.map((item) => remove.remove(path.join(dir, item))));
|
|
7665
7665
|
});
|
|
7666
7666
|
module.exports = {
|
|
7667
7667
|
emptyDirSync,
|
|
@@ -7681,7 +7681,7 @@ var require_file = __commonJS((exports, module) => {
|
|
|
7681
7681
|
}
|
|
7682
7682
|
if (stats && stats.isFile())
|
|
7683
7683
|
return;
|
|
7684
|
-
const dir =
|
|
7684
|
+
const dir = path.dirname(file);
|
|
7685
7685
|
let dirStats = null;
|
|
7686
7686
|
try {
|
|
7687
7687
|
dirStats = await fs.stat(dir);
|
|
@@ -7708,7 +7708,7 @@ var require_file = __commonJS((exports, module) => {
|
|
|
7708
7708
|
}
|
|
7709
7709
|
if (stats && stats.isFile())
|
|
7710
7710
|
return;
|
|
7711
|
-
const dir =
|
|
7711
|
+
const dir = path.dirname(file);
|
|
7712
7712
|
try {
|
|
7713
7713
|
if (!fs.statSync(dir).isDirectory()) {
|
|
7714
7714
|
fs.readdirSync(dir);
|
|
@@ -7722,7 +7722,7 @@ var require_file = __commonJS((exports, module) => {
|
|
|
7722
7722
|
fs.writeFileSync(file, "");
|
|
7723
7723
|
};
|
|
7724
7724
|
var u = require_universalify().fromPromise;
|
|
7725
|
-
var
|
|
7725
|
+
var path = import.meta.require("path");
|
|
7726
7726
|
var fs = require_fs();
|
|
7727
7727
|
var mkdir = require_mkdirs();
|
|
7728
7728
|
module.exports = {
|
|
@@ -7748,7 +7748,7 @@ var require_link = __commonJS((exports, module) => {
|
|
|
7748
7748
|
}
|
|
7749
7749
|
if (dstStat && areIdentical(srcStat, dstStat))
|
|
7750
7750
|
return;
|
|
7751
|
-
const dir =
|
|
7751
|
+
const dir = path.dirname(dstpath);
|
|
7752
7752
|
const dirExists = await pathExists(dir);
|
|
7753
7753
|
if (!dirExists) {
|
|
7754
7754
|
await mkdir.mkdirs(dir);
|
|
@@ -7769,7 +7769,7 @@ var require_link = __commonJS((exports, module) => {
|
|
|
7769
7769
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
7770
7770
|
throw err;
|
|
7771
7771
|
}
|
|
7772
|
-
const dir =
|
|
7772
|
+
const dir = path.dirname(dstpath);
|
|
7773
7773
|
const dirExists = fs.existsSync(dir);
|
|
7774
7774
|
if (dirExists)
|
|
7775
7775
|
return fs.linkSync(srcpath, dstpath);
|
|
@@ -7777,7 +7777,7 @@ var require_link = __commonJS((exports, module) => {
|
|
|
7777
7777
|
return fs.linkSync(srcpath, dstpath);
|
|
7778
7778
|
};
|
|
7779
7779
|
var u = require_universalify().fromPromise;
|
|
7780
|
-
var
|
|
7780
|
+
var path = import.meta.require("path");
|
|
7781
7781
|
var fs = require_fs();
|
|
7782
7782
|
var mkdir = require_mkdirs();
|
|
7783
7783
|
var { pathExists } = require_path_exists();
|
|
@@ -7791,7 +7791,7 @@ var require_link = __commonJS((exports, module) => {
|
|
|
7791
7791
|
// ../../../../node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
7792
7792
|
var require_symlink_paths = __commonJS((exports, module) => {
|
|
7793
7793
|
async function symlinkPaths(srcpath, dstpath) {
|
|
7794
|
-
if (
|
|
7794
|
+
if (path.isAbsolute(srcpath)) {
|
|
7795
7795
|
try {
|
|
7796
7796
|
await fs.lstat(srcpath);
|
|
7797
7797
|
} catch (err) {
|
|
@@ -7803,8 +7803,8 @@ var require_symlink_paths = __commonJS((exports, module) => {
|
|
|
7803
7803
|
toDst: srcpath
|
|
7804
7804
|
};
|
|
7805
7805
|
}
|
|
7806
|
-
const dstdir =
|
|
7807
|
-
const relativeToDst =
|
|
7806
|
+
const dstdir = path.dirname(dstpath);
|
|
7807
|
+
const relativeToDst = path.join(dstdir, srcpath);
|
|
7808
7808
|
const exists = await pathExists(relativeToDst);
|
|
7809
7809
|
if (exists) {
|
|
7810
7810
|
return {
|
|
@@ -7820,11 +7820,11 @@ var require_symlink_paths = __commonJS((exports, module) => {
|
|
|
7820
7820
|
}
|
|
7821
7821
|
return {
|
|
7822
7822
|
toCwd: srcpath,
|
|
7823
|
-
toDst:
|
|
7823
|
+
toDst: path.relative(dstdir, srcpath)
|
|
7824
7824
|
};
|
|
7825
7825
|
}
|
|
7826
7826
|
var symlinkPathsSync = function(srcpath, dstpath) {
|
|
7827
|
-
if (
|
|
7827
|
+
if (path.isAbsolute(srcpath)) {
|
|
7828
7828
|
const exists2 = fs.existsSync(srcpath);
|
|
7829
7829
|
if (!exists2)
|
|
7830
7830
|
throw new Error("absolute srcpath does not exist");
|
|
@@ -7833,8 +7833,8 @@ var require_symlink_paths = __commonJS((exports, module) => {
|
|
|
7833
7833
|
toDst: srcpath
|
|
7834
7834
|
};
|
|
7835
7835
|
}
|
|
7836
|
-
const dstdir =
|
|
7837
|
-
const relativeToDst =
|
|
7836
|
+
const dstdir = path.dirname(dstpath);
|
|
7837
|
+
const relativeToDst = path.join(dstdir, srcpath);
|
|
7838
7838
|
const exists = fs.existsSync(relativeToDst);
|
|
7839
7839
|
if (exists) {
|
|
7840
7840
|
return {
|
|
@@ -7847,10 +7847,10 @@ var require_symlink_paths = __commonJS((exports, module) => {
|
|
|
7847
7847
|
throw new Error("relative srcpath does not exist");
|
|
7848
7848
|
return {
|
|
7849
7849
|
toCwd: srcpath,
|
|
7850
|
-
toDst:
|
|
7850
|
+
toDst: path.relative(dstdir, srcpath)
|
|
7851
7851
|
};
|
|
7852
7852
|
};
|
|
7853
|
-
var
|
|
7853
|
+
var path = import.meta.require("path");
|
|
7854
7854
|
var fs = require_fs();
|
|
7855
7855
|
var { pathExists } = require_path_exists();
|
|
7856
7856
|
var u = require_universalify().fromPromise;
|
|
@@ -7908,10 +7908,10 @@ var require_symlink = __commonJS((exports, module) => {
|
|
|
7908
7908
|
if (areIdentical(srcStat, dstStat))
|
|
7909
7909
|
return;
|
|
7910
7910
|
}
|
|
7911
|
-
const
|
|
7912
|
-
srcpath =
|
|
7913
|
-
const toType = await symlinkType(
|
|
7914
|
-
const dir =
|
|
7911
|
+
const relative = await symlinkPaths(srcpath, dstpath);
|
|
7912
|
+
srcpath = relative.toDst;
|
|
7913
|
+
const toType = await symlinkType(relative.toCwd, type);
|
|
7914
|
+
const dir = path.dirname(dstpath);
|
|
7915
7915
|
if (!await pathExists(dir)) {
|
|
7916
7916
|
await mkdirs(dir);
|
|
7917
7917
|
}
|
|
@@ -7929,10 +7929,10 @@ var require_symlink = __commonJS((exports, module) => {
|
|
|
7929
7929
|
if (areIdentical(srcStat, dstStat))
|
|
7930
7930
|
return;
|
|
7931
7931
|
}
|
|
7932
|
-
const
|
|
7933
|
-
srcpath =
|
|
7934
|
-
type = symlinkTypeSync(
|
|
7935
|
-
const dir =
|
|
7932
|
+
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
7933
|
+
srcpath = relative.toDst;
|
|
7934
|
+
type = symlinkTypeSync(relative.toCwd, type);
|
|
7935
|
+
const dir = path.dirname(dstpath);
|
|
7936
7936
|
const exists = fs.existsSync(dir);
|
|
7937
7937
|
if (exists)
|
|
7938
7938
|
return fs.symlinkSync(srcpath, dstpath, type);
|
|
@@ -7940,7 +7940,7 @@ var require_symlink = __commonJS((exports, module) => {
|
|
|
7940
7940
|
return fs.symlinkSync(srcpath, dstpath, type);
|
|
7941
7941
|
};
|
|
7942
7942
|
var u = require_universalify().fromPromise;
|
|
7943
|
-
var
|
|
7943
|
+
var path = import.meta.require("path");
|
|
7944
7944
|
var fs = require_fs();
|
|
7945
7945
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
7946
7946
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
@@ -8074,14 +8074,14 @@ var require_jsonfile2 = __commonJS((exports, module) => {
|
|
|
8074
8074
|
// ../../../../node_modules/fs-extra/lib/output-file/index.js
|
|
8075
8075
|
var require_output_file = __commonJS((exports, module) => {
|
|
8076
8076
|
async function outputFile(file, data, encoding = "utf-8") {
|
|
8077
|
-
const dir =
|
|
8077
|
+
const dir = path.dirname(file);
|
|
8078
8078
|
if (!await pathExists(dir)) {
|
|
8079
8079
|
await mkdir.mkdirs(dir);
|
|
8080
8080
|
}
|
|
8081
8081
|
return fs.writeFile(file, data, encoding);
|
|
8082
8082
|
}
|
|
8083
8083
|
var outputFileSync = function(file, ...args) {
|
|
8084
|
-
const dir =
|
|
8084
|
+
const dir = path.dirname(file);
|
|
8085
8085
|
if (!fs.existsSync(dir)) {
|
|
8086
8086
|
mkdir.mkdirsSync(dir);
|
|
8087
8087
|
}
|
|
@@ -8089,7 +8089,7 @@ var require_output_file = __commonJS((exports, module) => {
|
|
|
8089
8089
|
};
|
|
8090
8090
|
var u = require_universalify().fromPromise;
|
|
8091
8091
|
var fs = require_fs();
|
|
8092
|
-
var
|
|
8092
|
+
var path = import.meta.require("path");
|
|
8093
8093
|
var mkdir = require_mkdirs();
|
|
8094
8094
|
var pathExists = require_path_exists().pathExists;
|
|
8095
8095
|
module.exports = {
|
|
@@ -8141,8 +8141,8 @@ var require_move = __commonJS((exports, module) => {
|
|
|
8141
8141
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
8142
8142
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
8143
8143
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
8144
|
-
const destParent =
|
|
8145
|
-
const parsedParentPath =
|
|
8144
|
+
const destParent = path.dirname(dest);
|
|
8145
|
+
const parsedParentPath = path.parse(destParent);
|
|
8146
8146
|
if (parsedParentPath.root !== destParent) {
|
|
8147
8147
|
await mkdirp(destParent);
|
|
8148
8148
|
}
|
|
@@ -8175,7 +8175,7 @@ var require_move = __commonJS((exports, module) => {
|
|
|
8175
8175
|
return remove(src);
|
|
8176
8176
|
}
|
|
8177
8177
|
var fs = require_fs();
|
|
8178
|
-
var
|
|
8178
|
+
var path = import.meta.require("path");
|
|
8179
8179
|
var { copy } = require_copy2();
|
|
8180
8180
|
var { remove } = require_remove();
|
|
8181
8181
|
var { mkdirp } = require_mkdirs();
|
|
@@ -8192,12 +8192,12 @@ var require_move_sync = __commonJS((exports, module) => {
|
|
|
8192
8192
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
8193
8193
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
8194
8194
|
if (!isParentRoot(dest))
|
|
8195
|
-
mkdirpSync(
|
|
8195
|
+
mkdirpSync(path.dirname(dest));
|
|
8196
8196
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
8197
8197
|
};
|
|
8198
8198
|
var isParentRoot = function(dest) {
|
|
8199
|
-
const parent =
|
|
8200
|
-
const parsedPath =
|
|
8199
|
+
const parent = path.dirname(dest);
|
|
8200
|
+
const parsedPath = path.parse(parent);
|
|
8201
8201
|
return parsedPath.root === parent;
|
|
8202
8202
|
};
|
|
8203
8203
|
var doRename = function(src, dest, overwrite, isChangingCase) {
|
|
@@ -8230,7 +8230,7 @@ var require_move_sync = __commonJS((exports, module) => {
|
|
|
8230
8230
|
return removeSync(src);
|
|
8231
8231
|
};
|
|
8232
8232
|
var fs = require_graceful_fs();
|
|
8233
|
-
var
|
|
8233
|
+
var path = import.meta.require("path");
|
|
8234
8234
|
var copySync = require_copy2().copySync;
|
|
8235
8235
|
var removeSync = require_remove().removeSync;
|
|
8236
8236
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -8646,7 +8646,7 @@ var init_core = __esm(() => {
|
|
|
8646
8646
|
|
|
8647
8647
|
// ../../../../node_modules/consola/dist/shared/consola.06ad8a64.mjs
|
|
8648
8648
|
import {formatWithOptions} from "util";
|
|
8649
|
-
import {sep
|
|
8649
|
+
import {sep} from "path";
|
|
8650
8650
|
|
|
8651
8651
|
class BasicReporter {
|
|
8652
8652
|
formatStack(stack, opts) {
|
|
@@ -8693,7 +8693,7 @@ class BasicReporter {
|
|
|
8693
8693
|
var parseStack, writeStream, bracket;
|
|
8694
8694
|
var init_consola_06ad8a64 = __esm(() => {
|
|
8695
8695
|
parseStack = function(stack) {
|
|
8696
|
-
const cwd = process.cwd() +
|
|
8696
|
+
const cwd = process.cwd() + sep;
|
|
8697
8697
|
const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
|
|
8698
8698
|
return lines;
|
|
8699
8699
|
};
|
|
@@ -8920,11 +8920,7 @@ var init_utils = __esm(() => {
|
|
|
8920
8920
|
// ../../../../node_modules/consola/dist/chunks/prompt.mjs
|
|
8921
8921
|
var exports_prompt = {};
|
|
8922
8922
|
__export(exports_prompt, {
|
|
8923
|
-
prompt: () =>
|
|
8924
|
-
{
|
|
8925
|
-
return prompt;
|
|
8926
|
-
}
|
|
8927
|
-
}
|
|
8923
|
+
prompt: () => prompt
|
|
8928
8924
|
});
|
|
8929
8925
|
import {stdin, stdout} from "process";
|
|
8930
8926
|
import f from "readline";
|
|
@@ -10392,14 +10388,14 @@ var require_style = __commonJS((exports, module) => {
|
|
|
10392
10388
|
default: c2.cyan("?")
|
|
10393
10389
|
});
|
|
10394
10390
|
var symbol2 = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;
|
|
10395
|
-
var
|
|
10391
|
+
var delimiter = (completing) => c2.gray(completing ? figures.ellipsis : figures.pointerSmall);
|
|
10396
10392
|
var item = (expandable, expanded) => c2.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line);
|
|
10397
10393
|
module.exports = {
|
|
10398
10394
|
styles,
|
|
10399
10395
|
render,
|
|
10400
10396
|
symbols,
|
|
10401
10397
|
symbol: symbol2,
|
|
10402
|
-
delimiter
|
|
10398
|
+
delimiter,
|
|
10403
10399
|
item
|
|
10404
10400
|
};
|
|
10405
10401
|
});
|
|
@@ -10529,7 +10525,7 @@ var require_prompt = __commonJS((exports, module) => {
|
|
|
10529
10525
|
|
|
10530
10526
|
// ../../../../node_modules/prompts/dist/elements/text.js
|
|
10531
10527
|
var require_text = __commonJS((exports, module) => {
|
|
10532
|
-
var asyncGeneratorStep = function(gen,
|
|
10528
|
+
var asyncGeneratorStep = function(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10533
10529
|
try {
|
|
10534
10530
|
var info = gen[key](arg);
|
|
10535
10531
|
var value = info.value;
|
|
@@ -10538,7 +10534,7 @@ var require_text = __commonJS((exports, module) => {
|
|
|
10538
10534
|
return;
|
|
10539
10535
|
}
|
|
10540
10536
|
if (info.done) {
|
|
10541
|
-
|
|
10537
|
+
resolve(value);
|
|
10542
10538
|
} else {
|
|
10543
10539
|
Promise.resolve(value).then(_next, _throw);
|
|
10544
10540
|
}
|
|
@@ -10546,13 +10542,13 @@ var require_text = __commonJS((exports, module) => {
|
|
|
10546
10542
|
var _asyncToGenerator = function(fn) {
|
|
10547
10543
|
return function() {
|
|
10548
10544
|
var self2 = this, args = arguments;
|
|
10549
|
-
return new Promise(function(
|
|
10545
|
+
return new Promise(function(resolve, reject) {
|
|
10550
10546
|
var gen = fn.apply(self2, args);
|
|
10551
10547
|
function _next(value) {
|
|
10552
|
-
asyncGeneratorStep(gen,
|
|
10548
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
10553
10549
|
}
|
|
10554
10550
|
function _throw(err2) {
|
|
10555
|
-
asyncGeneratorStep(gen,
|
|
10551
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err2);
|
|
10556
10552
|
}
|
|
10557
10553
|
_next(undefined);
|
|
10558
10554
|
});
|
|
@@ -11258,7 +11254,7 @@ var require_dateparts = __commonJS((exports, module) => {
|
|
|
11258
11254
|
|
|
11259
11255
|
// ../../../../node_modules/prompts/dist/elements/date.js
|
|
11260
11256
|
var require_date = __commonJS((exports, module) => {
|
|
11261
|
-
var asyncGeneratorStep = function(gen,
|
|
11257
|
+
var asyncGeneratorStep = function(gen, resolve, reject, _next, _throw, key, arg) {
|
|
11262
11258
|
try {
|
|
11263
11259
|
var info = gen[key](arg);
|
|
11264
11260
|
var value = info.value;
|
|
@@ -11267,7 +11263,7 @@ var require_date = __commonJS((exports, module) => {
|
|
|
11267
11263
|
return;
|
|
11268
11264
|
}
|
|
11269
11265
|
if (info.done) {
|
|
11270
|
-
|
|
11266
|
+
resolve(value);
|
|
11271
11267
|
} else {
|
|
11272
11268
|
Promise.resolve(value).then(_next, _throw);
|
|
11273
11269
|
}
|
|
@@ -11275,13 +11271,13 @@ var require_date = __commonJS((exports, module) => {
|
|
|
11275
11271
|
var _asyncToGenerator = function(fn) {
|
|
11276
11272
|
return function() {
|
|
11277
11273
|
var self2 = this, args = arguments;
|
|
11278
|
-
return new Promise(function(
|
|
11274
|
+
return new Promise(function(resolve, reject) {
|
|
11279
11275
|
var gen = fn.apply(self2, args);
|
|
11280
11276
|
function _next(value) {
|
|
11281
|
-
asyncGeneratorStep(gen,
|
|
11277
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
11282
11278
|
}
|
|
11283
11279
|
function _throw(err2) {
|
|
11284
|
-
asyncGeneratorStep(gen,
|
|
11280
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err2);
|
|
11285
11281
|
}
|
|
11286
11282
|
_next(undefined);
|
|
11287
11283
|
});
|
|
@@ -11481,7 +11477,7 @@ var require_date = __commonJS((exports, module) => {
|
|
|
11481
11477
|
|
|
11482
11478
|
// ../../../../node_modules/prompts/dist/elements/number.js
|
|
11483
11479
|
var require_number = __commonJS((exports, module) => {
|
|
11484
|
-
var asyncGeneratorStep = function(gen,
|
|
11480
|
+
var asyncGeneratorStep = function(gen, resolve, reject, _next, _throw, key, arg) {
|
|
11485
11481
|
try {
|
|
11486
11482
|
var info = gen[key](arg);
|
|
11487
11483
|
var value = info.value;
|
|
@@ -11490,7 +11486,7 @@ var require_number = __commonJS((exports, module) => {
|
|
|
11490
11486
|
return;
|
|
11491
11487
|
}
|
|
11492
11488
|
if (info.done) {
|
|
11493
|
-
|
|
11489
|
+
resolve(value);
|
|
11494
11490
|
} else {
|
|
11495
11491
|
Promise.resolve(value).then(_next, _throw);
|
|
11496
11492
|
}
|
|
@@ -11498,13 +11494,13 @@ var require_number = __commonJS((exports, module) => {
|
|
|
11498
11494
|
var _asyncToGenerator = function(fn) {
|
|
11499
11495
|
return function() {
|
|
11500
11496
|
var self2 = this, args = arguments;
|
|
11501
|
-
return new Promise(function(
|
|
11497
|
+
return new Promise(function(resolve, reject) {
|
|
11502
11498
|
var gen = fn.apply(self2, args);
|
|
11503
11499
|
function _next(value) {
|
|
11504
|
-
asyncGeneratorStep(gen,
|
|
11500
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
11505
11501
|
}
|
|
11506
11502
|
function _throw(err2) {
|
|
11507
|
-
asyncGeneratorStep(gen,
|
|
11503
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err2);
|
|
11508
11504
|
}
|
|
11509
11505
|
_next(undefined);
|
|
11510
11506
|
});
|
|
@@ -11536,7 +11532,7 @@ var require_number = __commonJS((exports, module) => {
|
|
|
11536
11532
|
this.float = !!opts.float;
|
|
11537
11533
|
this.round = opts.round || 2;
|
|
11538
11534
|
this.inc = opts.increment || 1;
|
|
11539
|
-
this.min = isDef2(opts.min) ? opts.min :
|
|
11535
|
+
this.min = isDef2(opts.min) ? opts.min : -Infinity;
|
|
11540
11536
|
this.max = isDef2(opts.max) ? opts.max : Infinity;
|
|
11541
11537
|
this.errorMsg = opts.error || `Please Enter A Valid Value`;
|
|
11542
11538
|
this.validator = opts.validate || (() => true);
|
|
@@ -11926,7 +11922,7 @@ var require_multiselect = __commonJS((exports, module) => {
|
|
|
11926
11922
|
|
|
11927
11923
|
// ../../../../node_modules/prompts/dist/elements/autocomplete.js
|
|
11928
11924
|
var require_autocomplete = __commonJS((exports, module) => {
|
|
11929
|
-
var asyncGeneratorStep = function(gen,
|
|
11925
|
+
var asyncGeneratorStep = function(gen, resolve, reject, _next, _throw, key, arg) {
|
|
11930
11926
|
try {
|
|
11931
11927
|
var info = gen[key](arg);
|
|
11932
11928
|
var value = info.value;
|
|
@@ -11935,7 +11931,7 @@ var require_autocomplete = __commonJS((exports, module) => {
|
|
|
11935
11931
|
return;
|
|
11936
11932
|
}
|
|
11937
11933
|
if (info.done) {
|
|
11938
|
-
|
|
11934
|
+
resolve(value);
|
|
11939
11935
|
} else {
|
|
11940
11936
|
Promise.resolve(value).then(_next, _throw);
|
|
11941
11937
|
}
|
|
@@ -11943,13 +11939,13 @@ var require_autocomplete = __commonJS((exports, module) => {
|
|
|
11943
11939
|
var _asyncToGenerator = function(fn) {
|
|
11944
11940
|
return function() {
|
|
11945
11941
|
var self2 = this, args = arguments;
|
|
11946
|
-
return new Promise(function(
|
|
11942
|
+
return new Promise(function(resolve, reject) {
|
|
11947
11943
|
var gen = fn.apply(self2, args);
|
|
11948
11944
|
function _next(value) {
|
|
11949
|
-
asyncGeneratorStep(gen,
|
|
11945
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
11950
11946
|
}
|
|
11951
11947
|
function _throw(err2) {
|
|
11952
|
-
asyncGeneratorStep(gen,
|
|
11948
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err2);
|
|
11953
11949
|
}
|
|
11954
11950
|
_next(undefined);
|
|
11955
11951
|
});
|
|
@@ -12468,9 +12464,9 @@ var require_prompts = __commonJS((exports) => {
|
|
|
12468
12464
|
$2.date = (args) => toPrompt("DatePrompt", args);
|
|
12469
12465
|
$2.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
12470
12466
|
$2.list = (args) => {
|
|
12471
|
-
const
|
|
12467
|
+
const sep2 = args.separator || ",";
|
|
12472
12468
|
return toPrompt("TextPrompt", args, {
|
|
12473
|
-
onSubmit: (str) => str.split(
|
|
12469
|
+
onSubmit: (str) => str.split(sep2).map((s3) => s3.trim())
|
|
12474
12470
|
});
|
|
12475
12471
|
};
|
|
12476
12472
|
$2.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -12598,7 +12594,7 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12598
12594
|
arr2[i] = arr[i];
|
|
12599
12595
|
return arr2;
|
|
12600
12596
|
};
|
|
12601
|
-
var asyncGeneratorStep = function(gen,
|
|
12597
|
+
var asyncGeneratorStep = function(gen, resolve, reject, _next, _throw, key, arg) {
|
|
12602
12598
|
try {
|
|
12603
12599
|
var info = gen[key](arg);
|
|
12604
12600
|
var value = info.value;
|
|
@@ -12607,7 +12603,7 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12607
12603
|
return;
|
|
12608
12604
|
}
|
|
12609
12605
|
if (info.done) {
|
|
12610
|
-
|
|
12606
|
+
resolve(value);
|
|
12611
12607
|
} else {
|
|
12612
12608
|
Promise.resolve(value).then(_next, _throw);
|
|
12613
12609
|
}
|
|
@@ -12615,13 +12611,13 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12615
12611
|
var _asyncToGenerator = function(fn) {
|
|
12616
12612
|
return function() {
|
|
12617
12613
|
var self2 = this, args = arguments;
|
|
12618
|
-
return new Promise(function(
|
|
12614
|
+
return new Promise(function(resolve, reject) {
|
|
12619
12615
|
var gen = fn.apply(self2, args);
|
|
12620
12616
|
function _next(value) {
|
|
12621
|
-
asyncGeneratorStep(gen,
|
|
12617
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
12622
12618
|
}
|
|
12623
12619
|
function _throw(err2) {
|
|
12624
|
-
asyncGeneratorStep(gen,
|
|
12620
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err2);
|
|
12625
12621
|
}
|
|
12626
12622
|
_next(undefined);
|
|
12627
12623
|
});
|
|
@@ -12868,14 +12864,14 @@ var require_style2 = __commonJS((exports, module) => {
|
|
|
12868
12864
|
default: c2.cyan("?")
|
|
12869
12865
|
});
|
|
12870
12866
|
var symbol2 = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;
|
|
12871
|
-
var
|
|
12867
|
+
var delimiter = (completing) => c2.gray(completing ? figures.ellipsis : figures.pointerSmall);
|
|
12872
12868
|
var item = (expandable, expanded) => c2.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line);
|
|
12873
12869
|
module.exports = {
|
|
12874
12870
|
styles,
|
|
12875
12871
|
render,
|
|
12876
12872
|
symbols,
|
|
12877
12873
|
symbol: symbol2,
|
|
12878
|
-
delimiter
|
|
12874
|
+
delimiter,
|
|
12879
12875
|
item
|
|
12880
12876
|
};
|
|
12881
12877
|
});
|
|
@@ -13872,7 +13868,7 @@ var require_number2 = __commonJS((exports, module) => {
|
|
|
13872
13868
|
this.float = !!opts.float;
|
|
13873
13869
|
this.round = opts.round || 2;
|
|
13874
13870
|
this.inc = opts.increment || 1;
|
|
13875
|
-
this.min = isDef2(opts.min) ? opts.min :
|
|
13871
|
+
this.min = isDef2(opts.min) ? opts.min : -Infinity;
|
|
13876
13872
|
this.max = isDef2(opts.max) ? opts.max : Infinity;
|
|
13877
13873
|
this.errorMsg = opts.error || `Please Enter A Valid Value`;
|
|
13878
13874
|
this.validator = opts.validate || (() => true);
|
|
@@ -14751,9 +14747,9 @@ var require_prompts2 = __commonJS((exports) => {
|
|
|
14751
14747
|
$2.date = (args) => toPrompt("DatePrompt", args);
|
|
14752
14748
|
$2.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
14753
14749
|
$2.list = (args) => {
|
|
14754
|
-
const
|
|
14750
|
+
const sep2 = args.separator || ",";
|
|
14755
14751
|
return toPrompt("TextPrompt", args, {
|
|
14756
|
-
onSubmit: (str) => str.split(
|
|
14752
|
+
onSubmit: (str) => str.split(sep2).map((s3) => s3.trim())
|
|
14757
14753
|
});
|
|
14758
14754
|
};
|
|
14759
14755
|
$2.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -15358,7 +15354,7 @@ var require_countBy = __commonJS((exports, module) => {
|
|
|
15358
15354
|
// ../../../../node_modules/collect.js/dist/methods/crossJoin.js
|
|
15359
15355
|
var require_crossJoin = __commonJS((exports, module) => {
|
|
15360
15356
|
module.exports = function crossJoin() {
|
|
15361
|
-
function
|
|
15357
|
+
function join(collection, constructor, args) {
|
|
15362
15358
|
var current = args[0];
|
|
15363
15359
|
if (current instanceof constructor) {
|
|
15364
15360
|
current = current.all();
|
|
@@ -15372,7 +15368,7 @@ var require_crossJoin = __commonJS((exports, module) => {
|
|
|
15372
15368
|
if (last) {
|
|
15373
15369
|
result.push(collectionCopy);
|
|
15374
15370
|
} else {
|
|
15375
|
-
result = result.concat(
|
|
15371
|
+
result = result.concat(join(collectionCopy, constructor, rest));
|
|
15376
15372
|
}
|
|
15377
15373
|
}
|
|
15378
15374
|
return result;
|
|
@@ -15380,7 +15376,7 @@ var require_crossJoin = __commonJS((exports, module) => {
|
|
|
15380
15376
|
for (var _len = arguments.length, values = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
15381
15377
|
values[_key] = arguments[_key];
|
|
15382
15378
|
}
|
|
15383
|
-
return new this.constructor(
|
|
15379
|
+
return new this.constructor(join([], this.constructor, [].concat([this.items], values)));
|
|
15384
15380
|
};
|
|
15385
15381
|
});
|
|
15386
15382
|
|
|
@@ -18282,17 +18278,6 @@ VineBoolean as VineBoolean2,
|
|
|
18282
18278
|
VineNumber as VineNumber2,
|
|
18283
18279
|
VineString as VineString2
|
|
18284
18280
|
} from "@vinejs/vine";
|
|
18285
|
-
// ../../../../node_modules/cac/dist/index.mjs
|
|
18286
|
-
var processArgs = process.argv;
|
|
18287
|
-
var platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
|
|
18288
|
-
// ../cli/src/run.ts
|
|
18289
|
-
import {ExitCode as ExitCode4} from "@stacksjs/types";
|
|
18290
|
-
|
|
18291
|
-
// ../logging/src/index.ts
|
|
18292
|
-
import {appendFile, mkdir} from "fs/promises";
|
|
18293
|
-
import {dirname as dirname2} from "path";
|
|
18294
|
-
import process3 from "process";
|
|
18295
|
-
|
|
18296
18281
|
// ../path/src/paths.ts
|
|
18297
18282
|
import os from "os";
|
|
18298
18283
|
import {
|
|
@@ -18303,553 +18288,74 @@ extname,
|
|
|
18303
18288
|
isAbsolute,
|
|
18304
18289
|
join,
|
|
18305
18290
|
normalize,
|
|
18306
|
-
parse,
|
|
18291
|
+
parse as parse2,
|
|
18307
18292
|
relative,
|
|
18308
18293
|
resolve,
|
|
18309
|
-
sep,
|
|
18294
|
+
sep as sep2,
|
|
18310
18295
|
toNamespacedPath
|
|
18311
18296
|
} from "path";
|
|
18297
|
+
import process5 from "process";
|
|
18298
|
+
// ../../../../node_modules/cac/dist/index.mjs
|
|
18299
|
+
var processArgs = process.argv;
|
|
18300
|
+
var platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
|
|
18301
|
+
// ../cli/src/run.ts
|
|
18302
|
+
import {ExitCode as ExitCode4} from "@stacksjs/types";
|
|
18303
|
+
|
|
18304
|
+
// ../logging/src/index.ts
|
|
18305
|
+
import {appendFile, mkdir} from "fs/promises";
|
|
18306
|
+
import {dirname as dirname2} from "path";
|
|
18312
18307
|
import process2 from "process";
|
|
18313
|
-
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
function userActionsPath(path) {
|
|
18320
|
-
return appPath(`Actions/${path || ""}`);
|
|
18321
|
-
}
|
|
18322
|
-
function userComponentsPath(path) {
|
|
18323
|
-
return libsPath(`components/${path || ""}`);
|
|
18324
|
-
}
|
|
18325
|
-
function userViewsPath(path) {
|
|
18326
|
-
return resourcesPath(`views/${path || ""}`);
|
|
18327
|
-
}
|
|
18328
|
-
function userFunctionsPath(path) {
|
|
18329
|
-
return resourcesPath(`views/${path || ""}`);
|
|
18330
|
-
}
|
|
18331
|
-
function userJobsPath(path) {
|
|
18332
|
-
return appPath(`Jobs/${path || ""}`);
|
|
18333
|
-
}
|
|
18334
|
-
function userListenersPath(path) {
|
|
18335
|
-
return appPath(`Listeners/${path || ""}`);
|
|
18336
|
-
}
|
|
18337
|
-
function userMiddlewarePath(path) {
|
|
18338
|
-
return appPath(`Middleware/${path || ""}`);
|
|
18339
|
-
}
|
|
18340
|
-
function userModelsPath(path) {
|
|
18341
|
-
return appPath(`Models/${path || ""}`);
|
|
18342
|
-
}
|
|
18343
|
-
function userNotificationsPath(path) {
|
|
18344
|
-
return appPath(`Notifications/${path || ""}`);
|
|
18345
|
-
}
|
|
18346
|
-
function userDatabasePath(path) {
|
|
18347
|
-
return projectPath(`database/${path || ""}`);
|
|
18348
|
-
}
|
|
18349
|
-
function userMigrationsPath(path) {
|
|
18350
|
-
return userDatabasePath(`migrations/${path || ""}`);
|
|
18351
|
-
}
|
|
18352
|
-
function userEventsPath() {
|
|
18353
|
-
return appPath(`Events.ts`);
|
|
18354
|
-
}
|
|
18355
|
-
function aiPath(path) {
|
|
18356
|
-
return corePath(`ai/${path || ""}`);
|
|
18357
|
-
}
|
|
18358
|
-
function assetsPath(path) {
|
|
18359
|
-
return resourcesPath(`assets/${path || ""}`);
|
|
18360
|
-
}
|
|
18361
|
-
function aliasPath() {
|
|
18362
|
-
return corePath("alias/src/index.ts");
|
|
18363
|
-
}
|
|
18364
|
-
function buddyPath(path, options) {
|
|
18365
|
-
const absolutePath = corePath(`buddy/${path || ""}`);
|
|
18366
|
-
if (options?.relative)
|
|
18367
|
-
return relative(process2.cwd(), absolutePath);
|
|
18368
|
-
return absolutePath;
|
|
18369
|
-
}
|
|
18370
|
-
function runtimePath(path) {
|
|
18371
|
-
return frameworkPath(`buddy/${path || ""}`);
|
|
18372
|
-
}
|
|
18373
|
-
function analyticsPath(path) {
|
|
18374
|
-
return corePath(`analytics/${path || ""}`);
|
|
18375
|
-
}
|
|
18376
|
-
function arraysPath(path) {
|
|
18377
|
-
return corePath(`arrays/${path || ""}`);
|
|
18378
|
-
}
|
|
18379
|
-
function appPath(path) {
|
|
18380
|
-
return projectPath(`app/${path || ""}`);
|
|
18381
|
-
}
|
|
18382
|
-
function authPath(path) {
|
|
18383
|
-
return corePath(`auth/${path || ""}`);
|
|
18384
|
-
}
|
|
18385
|
-
function buildPath(path) {
|
|
18386
|
-
return corePath(`build/${path || ""}`);
|
|
18387
|
-
}
|
|
18388
|
-
function buildEnginePath(path) {
|
|
18389
|
-
return buildPath(`${path || ""}`);
|
|
18390
|
-
}
|
|
18391
|
-
function libsPath(path) {
|
|
18392
|
-
return frameworkPath(`libs/${path || ""}`);
|
|
18393
|
-
}
|
|
18394
|
-
function userLibsPath(path) {
|
|
18395
|
-
return projectPath(`libs/${path || ""}`);
|
|
18396
|
-
}
|
|
18397
|
-
function libsEntriesPath(path) {
|
|
18398
|
-
return libsPath(`entries/${path || ""}`);
|
|
18399
|
-
}
|
|
18400
|
-
function cachePath(path) {
|
|
18401
|
-
return corePath(`cache/${path || ""}`);
|
|
18402
|
-
}
|
|
18403
|
-
function chatPath(path) {
|
|
18404
|
-
return corePath(`chat/${path || ""}`);
|
|
18405
|
-
}
|
|
18406
|
-
function cliPath(path) {
|
|
18407
|
-
return corePath(`cli/${path || ""}`);
|
|
18408
|
-
}
|
|
18409
|
-
function cloudPath(path) {
|
|
18410
|
-
return corePath(`cloud/${path || ""}`);
|
|
18411
|
-
}
|
|
18412
|
-
function frameworkCloudPath(path) {
|
|
18413
|
-
return frameworkPath(`cloud/${path || ""}`);
|
|
18414
|
-
}
|
|
18415
|
-
function collectionsPath(path) {
|
|
18416
|
-
return corePath(`collections/${path || ""}`);
|
|
18417
|
-
}
|
|
18418
|
-
function commandsPath(path) {
|
|
18419
|
-
return appPath(`Commands/${path || ""}`);
|
|
18420
|
-
}
|
|
18421
|
-
function componentsPath(path) {
|
|
18422
|
-
return userLibsPath(`components/${path || ""}`);
|
|
18423
|
-
}
|
|
18424
|
-
function configPath(path) {
|
|
18425
|
-
return corePath(`config/${path || ""}`);
|
|
18426
|
-
}
|
|
18427
|
-
function corePath(path) {
|
|
18428
|
-
return frameworkPath(`core/${path || ""}`);
|
|
18429
|
-
}
|
|
18430
|
-
function customElementsDataPath() {
|
|
18431
|
-
return frameworkPath("core/custom-elements.json");
|
|
18432
|
-
}
|
|
18433
|
-
function databasePath(path) {
|
|
18434
|
-
return corePath(`database/${path || ""}`);
|
|
18435
|
-
}
|
|
18436
|
-
function datetimePath(path) {
|
|
18437
|
-
return corePath(`datetime/${path || ""}`);
|
|
18438
|
-
}
|
|
18439
|
-
function developmentPath(path) {
|
|
18440
|
-
return corePath(`development/${path || ""}`);
|
|
18441
|
-
}
|
|
18442
|
-
function desktopPath(path) {
|
|
18443
|
-
return corePath(`desktop/${path || ""}`);
|
|
18444
|
-
}
|
|
18445
|
-
function docsPath(path) {
|
|
18446
|
-
return corePath(`docs/${path || ""}`);
|
|
18447
|
-
}
|
|
18448
|
-
function dnsPath(path) {
|
|
18449
|
-
return corePath(`domains/${path || ""}`);
|
|
18450
|
-
}
|
|
18451
|
-
function emailPath(path) {
|
|
18452
|
-
return notificationsPath(`email/${path || ""}`);
|
|
18453
|
-
}
|
|
18454
|
-
function enumsPath(path) {
|
|
18455
|
-
return corePath(`enums/${path || ""}`);
|
|
18456
|
-
}
|
|
18457
|
-
function errorHandlingPath(path) {
|
|
18458
|
-
return corePath(`error-handling/${path || ""}`);
|
|
18459
|
-
}
|
|
18460
|
-
function eventsPath(path) {
|
|
18461
|
-
return corePath(`events/${path || ""}`);
|
|
18462
|
-
}
|
|
18463
|
-
function coreEnvPath(path) {
|
|
18464
|
-
return corePath(`env/${path || ""}`);
|
|
18465
|
-
}
|
|
18466
|
-
function examplesPath(type) {
|
|
18467
|
-
return frameworkPath(`examples/${type || ""}`);
|
|
18468
|
-
}
|
|
18469
|
-
function fakerPath(path) {
|
|
18470
|
-
return corePath(`faker/${path || ""}`);
|
|
18471
|
-
}
|
|
18472
|
-
function frameworkPath(path, options) {
|
|
18473
|
-
const absolutePath = projectStoragePath(`framework/${path || ""}`);
|
|
18474
|
-
if (options?.relative)
|
|
18475
|
-
return relative(options.cwd || process2.cwd(), absolutePath);
|
|
18476
|
-
return absolutePath;
|
|
18477
|
-
}
|
|
18478
|
-
function healthPath(path) {
|
|
18479
|
-
return corePath(`health/${path || ""}`);
|
|
18480
|
-
}
|
|
18481
|
-
function functionsPath(path) {
|
|
18482
|
-
return userLibsPath(`functions/${path || ""}`);
|
|
18483
|
-
}
|
|
18484
|
-
function gitPath(path) {
|
|
18485
|
-
return corePath(`git/${path || ""}`);
|
|
18486
|
-
}
|
|
18487
|
-
function langPath(path) {
|
|
18488
|
-
return resourcesPath(`lang/${path || ""}`);
|
|
18489
|
-
}
|
|
18490
|
-
function layoutsPath(path, options) {
|
|
18491
|
-
const absolutePath = resourcesPath(`layouts/${path || ""}`);
|
|
18492
|
-
if (options?.relative)
|
|
18493
|
-
return relative(process2.cwd(), absolutePath);
|
|
18494
|
-
return absolutePath;
|
|
18495
|
-
}
|
|
18496
|
-
function libraryEntryPath(type) {
|
|
18497
|
-
return libsEntriesPath(`${type}.ts`);
|
|
18498
|
-
}
|
|
18499
|
-
function lintPath(path) {
|
|
18500
|
-
return corePath(`lint/${path || ""}`);
|
|
18501
|
-
}
|
|
18502
|
-
function listenersPath(path) {
|
|
18503
|
-
return appPath(`Listeners/${path || ""}`);
|
|
18504
|
-
}
|
|
18505
|
-
function jobsPath(path) {
|
|
18506
|
-
return appPath(`Jobs/${path || ""}`);
|
|
18507
|
-
}
|
|
18508
|
-
function loggingPath(path) {
|
|
18509
|
-
return corePath(`logging/${path || ""}`);
|
|
18510
|
-
}
|
|
18511
|
-
function logsPath(path) {
|
|
18512
|
-
return projectStoragePath(`logs/${path || ""}`);
|
|
18513
|
-
}
|
|
18514
|
-
function modulesPath(path) {
|
|
18515
|
-
return resourcesPath(`modules/${path || ""}`);
|
|
18516
|
-
}
|
|
18517
|
-
function notificationsPath(path) {
|
|
18518
|
-
return corePath(`notifications/${path || ""}`);
|
|
18519
|
-
}
|
|
18520
|
-
function ormPath(path) {
|
|
18521
|
-
return corePath(`orm/${path || ""}`);
|
|
18522
|
-
}
|
|
18523
|
-
function objectsPath(path) {
|
|
18524
|
-
return corePath(`objects/${path || ""}`);
|
|
18525
|
-
}
|
|
18526
|
-
function onboardingPath(path) {
|
|
18527
|
-
return projectPath(`${path || "views/dashboard/onboarding"}`);
|
|
18528
|
-
}
|
|
18529
|
-
function packageJsonPath(type) {
|
|
18530
|
-
if (type === "vue-components")
|
|
18531
|
-
return frameworkPath("libs/components/vue/package.json");
|
|
18532
|
-
if (type === "web-components")
|
|
18533
|
-
return frameworkPath("libs/components/web/package.json");
|
|
18534
|
-
return frameworkPath(`libs/${type}/package.json`);
|
|
18535
|
-
}
|
|
18536
|
-
function viewsPath(path) {
|
|
18537
|
-
return resourcesPath(`views/${path || ""}`);
|
|
18538
|
-
}
|
|
18539
|
-
function pathPath(path) {
|
|
18540
|
-
return corePath(`path/${path || ""}`);
|
|
18541
|
-
}
|
|
18542
|
-
function paymentsPath(path) {
|
|
18543
|
-
return corePath(`payments/${path || ""}`);
|
|
18544
|
-
}
|
|
18545
|
-
function projectPath(filePath = "", options) {
|
|
18546
|
-
let path = process2.cwd();
|
|
18547
|
-
while (path.includes("storage"))
|
|
18548
|
-
path = resolve(path, "..");
|
|
18549
|
-
const finalPath = resolve(path, filePath);
|
|
18550
|
-
if (options?.relative)
|
|
18551
|
-
return relative(process2.cwd(), finalPath);
|
|
18552
|
-
return finalPath;
|
|
18553
|
-
}
|
|
18554
|
-
async function findProjectPath(project) {
|
|
18555
|
-
const projectList = await runCommandSync("buddy projects:list --quiet");
|
|
18556
|
-
log.debug("ProjectList in findProjectPath", projectList);
|
|
18557
|
-
const projects = projectList.split("\n").filter((line) => line.startsWith(" - ")).map((line) => line.trim().substring(4));
|
|
18558
|
-
log.debug("Projects in findProjectPath:", projects);
|
|
18559
|
-
const projectPath2 = projects.find((proj) => proj.includes(project));
|
|
18560
|
-
if (!projectPath2)
|
|
18561
|
-
throw new Error(`Could not find project with name: ${project}`);
|
|
18562
|
-
return projectPath2.startsWith("/") ? projectPath2 : `/${projectPath2}`;
|
|
18563
|
-
}
|
|
18564
|
-
function projectConfigPath(path) {
|
|
18565
|
-
return projectPath(`config/${path || ""}`);
|
|
18566
|
-
}
|
|
18567
|
-
function projectStoragePath(path) {
|
|
18568
|
-
return projectPath(`storage/${path || ""}`);
|
|
18569
|
-
}
|
|
18570
|
-
function publicPath(path) {
|
|
18571
|
-
return projectPath(`public/${path || ""}`);
|
|
18572
|
-
}
|
|
18573
|
-
function pushPath(path) {
|
|
18574
|
-
return notificationsPath(`push/${path || ""}`);
|
|
18575
|
-
}
|
|
18576
|
-
function queryBuilderPath(path) {
|
|
18577
|
-
return corePath(`query-builder/${path || ""}`);
|
|
18578
|
-
}
|
|
18579
|
-
function queuePath(path) {
|
|
18580
|
-
return corePath(`queue/${path || ""}`);
|
|
18581
|
-
}
|
|
18582
|
-
function realtimePath(path) {
|
|
18583
|
-
return corePath(`realtime/${path || ""}`);
|
|
18584
|
-
}
|
|
18585
|
-
function resourcesPath(path, options) {
|
|
18586
|
-
const absolutePath = projectStoragePath(`resources/${path || ""}`);
|
|
18587
|
-
if (options?.relative)
|
|
18588
|
-
return relative(process2.cwd(), absolutePath);
|
|
18589
|
-
return projectPath(`resources/${path || ""}`);
|
|
18590
|
-
}
|
|
18591
|
-
function replPath(path) {
|
|
18592
|
-
return corePath(`repl/${path || ""}`);
|
|
18593
|
-
}
|
|
18594
|
-
function routerPath(path) {
|
|
18595
|
-
return corePath(`router/${path || ""}`);
|
|
18596
|
-
}
|
|
18597
|
-
function routesPath(path, options) {
|
|
18598
|
-
const absolutePath = resourcesPath(`routes/${path || ""}`);
|
|
18599
|
-
if (options?.relative)
|
|
18600
|
-
return relative(process2.cwd(), absolutePath);
|
|
18601
|
-
return projectPath(`routes/${path || ""}`);
|
|
18602
|
-
}
|
|
18603
|
-
function searchEnginePath(path) {
|
|
18604
|
-
return corePath(`search-engine/${path || ""}`);
|
|
18605
|
-
}
|
|
18606
|
-
function settingsPath(path) {
|
|
18607
|
-
return projectPath(`${path || "views/dashboard/settings"}`);
|
|
18608
|
-
}
|
|
18609
|
-
function scriptsPath(path) {
|
|
18610
|
-
return frameworkPath(`scripts/${path || ""}`);
|
|
18611
|
-
}
|
|
18612
|
-
function schedulerPath(path) {
|
|
18613
|
-
return corePath(`scheduler/${path || ""}`);
|
|
18614
|
-
}
|
|
18615
|
-
function slugPath(path) {
|
|
18616
|
-
return corePath(`slug/${path || ""}`);
|
|
18617
|
-
}
|
|
18618
|
-
function smsPath(path) {
|
|
18619
|
-
return notificationsPath(`sms/${path || ""}`);
|
|
18620
|
-
}
|
|
18621
|
-
function storagePath(path) {
|
|
18622
|
-
return corePath(`storage/${path || ""}`);
|
|
18623
|
-
}
|
|
18624
|
-
function storesPath(path) {
|
|
18625
|
-
return resourcesPath(`stores/${path || ""}`);
|
|
18626
|
-
}
|
|
18627
|
-
function securityPath(path) {
|
|
18628
|
-
return corePath(`security/${path || ""}`);
|
|
18629
|
-
}
|
|
18630
|
-
function serverPath(path) {
|
|
18631
|
-
return corePath(`server/${path || ""}`);
|
|
18632
|
-
}
|
|
18633
|
-
function serverlessPath(path) {
|
|
18634
|
-
return corePath(`serverless/${path || ""}`);
|
|
18635
|
-
}
|
|
18636
|
-
function stacksPath(path) {
|
|
18637
|
-
return frameworkPath(`src/${path || ""}`);
|
|
18638
|
-
}
|
|
18639
|
-
function shellPath(path) {
|
|
18640
|
-
return corePath(`shell/${path || ""}`);
|
|
18641
|
-
}
|
|
18642
|
-
function stringsPath(path) {
|
|
18643
|
-
return corePath(`strings/${path || ""}`);
|
|
18644
|
-
}
|
|
18645
|
-
function testingPath(path) {
|
|
18646
|
-
return corePath(`testing/${path || ""}`);
|
|
18647
|
-
}
|
|
18648
|
-
function tinkerPath(path) {
|
|
18649
|
-
return corePath(`tinker/${path || ""}`);
|
|
18650
|
-
}
|
|
18651
|
-
function testsPath(path) {
|
|
18652
|
-
return frameworkPath(`tests/${path || ""}`);
|
|
18653
|
-
}
|
|
18654
|
-
function typesPath(path) {
|
|
18655
|
-
return corePath(`types/${path || ""}`);
|
|
18656
|
-
}
|
|
18657
|
-
function uiPath(path) {
|
|
18658
|
-
return corePath(`ui/${path || ""}`);
|
|
18659
|
-
}
|
|
18660
|
-
function utilsPath(path) {
|
|
18661
|
-
return corePath(`utils/${path || ""}`);
|
|
18662
|
-
}
|
|
18663
|
-
function validationPath(path) {
|
|
18664
|
-
return corePath(`validation/${path || ""}`);
|
|
18665
|
-
}
|
|
18666
|
-
function viteConfigPath(path) {
|
|
18667
|
-
return corePath(`vite-config/${path || ""}`);
|
|
18668
|
-
}
|
|
18669
|
-
function vitePluginPath(path) {
|
|
18670
|
-
return corePath(`vite-plugin/${path || ""}`);
|
|
18671
|
-
}
|
|
18672
|
-
function xRayPath(path) {
|
|
18673
|
-
return frameworkPath(`stacks/x-ray/${path || ""}`);
|
|
18308
|
+
|
|
18309
|
+
// ../error-handling/src/handler.ts
|
|
18310
|
+
var import_fs_extra = __toESM(require_lib(), 1);
|
|
18311
|
+
import {ExitCode} from "@stacksjs/types";
|
|
18312
|
+
function handleError(err, options) {
|
|
18313
|
+
return ErrorHandler.handle(err, options);
|
|
18674
18314
|
}
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
|
|
18683
|
-
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
developmentPath,
|
|
18711
|
-
desktopPath,
|
|
18712
|
-
docsPath,
|
|
18713
|
-
dnsPath,
|
|
18714
|
-
emailPath,
|
|
18715
|
-
enumsPath,
|
|
18716
|
-
errorHandlingPath,
|
|
18717
|
-
eventsPath,
|
|
18718
|
-
coreEnvPath,
|
|
18719
|
-
healthPath,
|
|
18720
|
-
examplesPath,
|
|
18721
|
-
fakerPath,
|
|
18722
|
-
frameworkPath,
|
|
18723
|
-
storagePath,
|
|
18724
|
-
functionsPath,
|
|
18725
|
-
gitPath,
|
|
18726
|
-
langPath,
|
|
18727
|
-
layoutsPath,
|
|
18728
|
-
libsPath,
|
|
18729
|
-
userLibsPath,
|
|
18730
|
-
libraryEntryPath,
|
|
18731
|
-
lintPath,
|
|
18732
|
-
listenersPath,
|
|
18733
|
-
loggingPath,
|
|
18734
|
-
logsPath,
|
|
18735
|
-
jobsPath,
|
|
18736
|
-
modulesPath,
|
|
18737
|
-
ormPath,
|
|
18738
|
-
objectsPath,
|
|
18739
|
-
onboardingPath,
|
|
18740
|
-
notificationsPath,
|
|
18741
|
-
packageJsonPath,
|
|
18742
|
-
viewsPath,
|
|
18743
|
-
pathPath,
|
|
18744
|
-
paymentsPath,
|
|
18745
|
-
projectPath,
|
|
18746
|
-
findProjectPath,
|
|
18747
|
-
projectStoragePath,
|
|
18748
|
-
publicPath,
|
|
18749
|
-
pushPath,
|
|
18750
|
-
queryBuilderPath,
|
|
18751
|
-
queuePath,
|
|
18752
|
-
realtimePath,
|
|
18753
|
-
resourcesPath,
|
|
18754
|
-
replPath,
|
|
18755
|
-
routerPath,
|
|
18756
|
-
routesPath,
|
|
18757
|
-
runtimePath,
|
|
18758
|
-
searchEnginePath,
|
|
18759
|
-
schedulerPath,
|
|
18760
|
-
settingsPath,
|
|
18761
|
-
smsPath,
|
|
18762
|
-
slugPath,
|
|
18763
|
-
scriptsPath,
|
|
18764
|
-
securityPath,
|
|
18765
|
-
serverPath,
|
|
18766
|
-
serverlessPath,
|
|
18767
|
-
stacksPath,
|
|
18768
|
-
stringsPath,
|
|
18769
|
-
shellPath,
|
|
18770
|
-
storesPath,
|
|
18771
|
-
testingPath,
|
|
18772
|
-
testsPath,
|
|
18773
|
-
tinkerPath,
|
|
18774
|
-
typesPath,
|
|
18775
|
-
uiPath,
|
|
18776
|
-
userDatabasePath,
|
|
18777
|
-
userMigrationsPath,
|
|
18778
|
-
userEventsPath,
|
|
18779
|
-
userJobsPath,
|
|
18780
|
-
userListenersPath,
|
|
18781
|
-
userMiddlewarePath,
|
|
18782
|
-
userModelsPath,
|
|
18783
|
-
userNotificationsPath,
|
|
18784
|
-
utilsPath,
|
|
18785
|
-
validationPath,
|
|
18786
|
-
viteConfigPath,
|
|
18787
|
-
vitePluginPath,
|
|
18788
|
-
xRayPath,
|
|
18789
|
-
homeDir,
|
|
18790
|
-
basename,
|
|
18791
|
-
delimiter,
|
|
18792
|
-
dirname,
|
|
18793
|
-
extname,
|
|
18794
|
-
isAbsolute,
|
|
18795
|
-
join,
|
|
18796
|
-
normalize,
|
|
18797
|
-
relative,
|
|
18798
|
-
resolve,
|
|
18799
|
-
parse,
|
|
18800
|
-
sep,
|
|
18801
|
-
toNamespacedPath
|
|
18802
|
-
};
|
|
18803
|
-
// ../error-handling/src/handler.ts
|
|
18804
|
-
var import_fs_extra = __toESM(require_lib(), 1);
|
|
18805
|
-
import {ExitCode} from "@stacksjs/types";
|
|
18806
|
-
function handleError(err, options) {
|
|
18807
|
-
return ErrorHandler.handle(err, options);
|
|
18808
|
-
}
|
|
18809
|
-
var StacksError = Error;
|
|
18810
|
-
|
|
18811
|
-
class ErrorHandler {
|
|
18812
|
-
static handle(err, options) {
|
|
18813
|
-
if (options?.silent !== false)
|
|
18814
|
-
this.writeErrorToConsole(err);
|
|
18815
|
-
if (typeof err === "string")
|
|
18816
|
-
err = new StacksError(err);
|
|
18817
|
-
this.writeErrorToFile(err).catch((e) => console.error(e));
|
|
18818
|
-
return err;
|
|
18819
|
-
}
|
|
18820
|
-
static handleError(err, options) {
|
|
18821
|
-
this.handle(err, options);
|
|
18822
|
-
return err;
|
|
18823
|
-
}
|
|
18824
|
-
static async writeErrorToFile(err) {
|
|
18825
|
-
if (!(err instanceof Error)) {
|
|
18826
|
-
console.error("Error is not an instance of Error:", err);
|
|
18827
|
-
return;
|
|
18828
|
-
}
|
|
18829
|
-
const formattedError = `[${new Date().toISOString()}] ${err.name}: ${err.message}\n`;
|
|
18830
|
-
const errorsLogFilePath = logsPath("errors.log");
|
|
18831
|
-
try {
|
|
18832
|
-
await import_fs_extra.default.mkdir(dirname(errorsLogFilePath), { recursive: true });
|
|
18833
|
-
await import_fs_extra.default.appendFile(errorsLogFilePath, formattedError);
|
|
18834
|
-
} catch (error) {
|
|
18835
|
-
console.error("Failed to write to error file:", error);
|
|
18836
|
-
}
|
|
18837
|
-
}
|
|
18838
|
-
static writeErrorToConsole(err) {
|
|
18839
|
-
if (err === "Failed to execute command: bunx biome check --fix" || err === "Failed to execute command: bun --bun storage/framework/core/actions/src/lint/fix.ts")
|
|
18840
|
-
console.error(err);
|
|
18841
|
-
process.exit(ExitCode.FatalError);
|
|
18842
|
-
console.error(err);
|
|
18843
|
-
}
|
|
18315
|
+
var StacksError = Error;
|
|
18316
|
+
|
|
18317
|
+
class ErrorHandler {
|
|
18318
|
+
static handle(err, options) {
|
|
18319
|
+
if (options?.silent !== false)
|
|
18320
|
+
this.writeErrorToConsole(err);
|
|
18321
|
+
if (typeof err === "string")
|
|
18322
|
+
err = new StacksError(err);
|
|
18323
|
+
this.writeErrorToFile(err).catch((e) => console.error(e));
|
|
18324
|
+
return err;
|
|
18325
|
+
}
|
|
18326
|
+
static handleError(err, options) {
|
|
18327
|
+
this.handle(err, options);
|
|
18328
|
+
return err;
|
|
18329
|
+
}
|
|
18330
|
+
static async writeErrorToFile(err) {
|
|
18331
|
+
if (!(err instanceof Error)) {
|
|
18332
|
+
console.error("Error is not an instance of Error:", err);
|
|
18333
|
+
return;
|
|
18334
|
+
}
|
|
18335
|
+
const formattedError = `[${new Date().toISOString()}] ${err.name}: ${err.message}\n`;
|
|
18336
|
+
const errorsLogFilePath = logsPath("errors.log");
|
|
18337
|
+
try {
|
|
18338
|
+
await import_fs_extra.default.mkdir(dirname(errorsLogFilePath), { recursive: true });
|
|
18339
|
+
await import_fs_extra.default.appendFile(errorsLogFilePath, formattedError);
|
|
18340
|
+
} catch (error) {
|
|
18341
|
+
console.error("Failed to write to error file:", error);
|
|
18342
|
+
}
|
|
18343
|
+
}
|
|
18344
|
+
static writeErrorToConsole(err) {
|
|
18345
|
+
if (err === "Failed to execute command: bunx biome check --fix" || err === "Failed to execute command: bun --bun storage/framework/core/actions/src/lint/fix.ts")
|
|
18346
|
+
console.error(err);
|
|
18347
|
+
process.exit(ExitCode.FatalError);
|
|
18348
|
+
console.error(err);
|
|
18349
|
+
}
|
|
18844
18350
|
}
|
|
18845
18351
|
// ../../../../node_modules/neverthrow/dist/index.es.js
|
|
18846
18352
|
var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
18847
18353
|
function adopt(value) {
|
|
18848
|
-
return value instanceof P ? value : new P(function(
|
|
18849
|
-
|
|
18354
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
18355
|
+
resolve(value);
|
|
18850
18356
|
});
|
|
18851
18357
|
}
|
|
18852
|
-
return new (P || (P = Promise))(function(
|
|
18358
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
18853
18359
|
function fulfilled(value) {
|
|
18854
18360
|
try {
|
|
18855
18361
|
step(generator.next(value));
|
|
@@ -18865,7 +18371,7 @@ var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
|
18865
18371
|
}
|
|
18866
18372
|
}
|
|
18867
18373
|
function step(result) {
|
|
18868
|
-
result.done ?
|
|
18374
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
18869
18375
|
}
|
|
18870
18376
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18871
18377
|
});
|
|
@@ -18945,14 +18451,14 @@ var __asyncValues = function(o) {
|
|
|
18945
18451
|
}, i);
|
|
18946
18452
|
function verb(n) {
|
|
18947
18453
|
i[n] = o[n] && function(v) {
|
|
18948
|
-
return new Promise(function(
|
|
18949
|
-
v = o[n](v), settle(
|
|
18454
|
+
return new Promise(function(resolve, reject) {
|
|
18455
|
+
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
|
18950
18456
|
});
|
|
18951
18457
|
};
|
|
18952
18458
|
}
|
|
18953
|
-
function settle(
|
|
18459
|
+
function settle(resolve, reject, d, v) {
|
|
18954
18460
|
Promise.resolve(v).then(function(v2) {
|
|
18955
|
-
|
|
18461
|
+
resolve({ value: v2, done: d });
|
|
18956
18462
|
}, reject);
|
|
18957
18463
|
}
|
|
18958
18464
|
};
|
|
@@ -19235,7 +18741,7 @@ function dump(...args) {
|
|
|
19235
18741
|
}
|
|
19236
18742
|
function dd(...args) {
|
|
19237
18743
|
args.forEach((arg) => log.debug(arg));
|
|
19238
|
-
|
|
18744
|
+
process2.exit(ExitCode2.FatalError);
|
|
19239
18745
|
}
|
|
19240
18746
|
function echo(...args) {
|
|
19241
18747
|
console.log(...args);
|
|
@@ -19266,7 +18772,7 @@ var log = {
|
|
|
19266
18772
|
await writeToLogFile(`WARN: ${arg}`);
|
|
19267
18773
|
},
|
|
19268
18774
|
async debug(...arg) {
|
|
19269
|
-
if (
|
|
18775
|
+
if (process2.env.APP_ENV === "production" || process2.env.APP_ENV === "prod")
|
|
19270
18776
|
return await writeToLogFile(`DEBUG: ${arg}`);
|
|
19271
18777
|
logger.debug(arg);
|
|
19272
18778
|
await writeToLogFile(`DEBUG: ${arg}`);
|
|
@@ -19375,7 +18881,7 @@ class Prompt {
|
|
|
19375
18881
|
var prompt2 = () => new Prompt;
|
|
19376
18882
|
|
|
19377
18883
|
// ../cli/src/exec.ts
|
|
19378
|
-
import
|
|
18884
|
+
import process3 from "process";
|
|
19379
18885
|
import {ExitCode as ExitCode3} from "@stacksjs/types";
|
|
19380
18886
|
async function execSync(command, options) {
|
|
19381
18887
|
log.debug("Running ExecSync:", command);
|
|
@@ -19383,14 +18889,14 @@ async function execSync(command, options) {
|
|
|
19383
18889
|
const cmd = Array.isArray(command) ? command : command.match(/(?:[^\s"]+|"[^"]*")+/g);
|
|
19384
18890
|
if (!cmd) {
|
|
19385
18891
|
log.error(`Failed to parse command: ${cmd}`, options);
|
|
19386
|
-
|
|
18892
|
+
process3.exit(ExitCode3.FatalError);
|
|
19387
18893
|
}
|
|
19388
18894
|
const proc = Bun.spawnSync(cmd, {
|
|
19389
18895
|
...options,
|
|
19390
18896
|
stdin: options?.stdin ?? "inherit",
|
|
19391
18897
|
stdout: options?.stdout ?? "pipe",
|
|
19392
18898
|
stderr: options?.stderr ?? "inherit",
|
|
19393
|
-
cwd: options?.cwd ??
|
|
18899
|
+
cwd: options?.cwd ?? process3.cwd(),
|
|
19394
18900
|
onExit(subprocess, exitCode, signalCode, error) {
|
|
19395
18901
|
exitHandler("spawnSync", subprocess, exitCode, signalCode, error);
|
|
19396
18902
|
}
|
|
@@ -19404,10 +18910,10 @@ var exitHandler = function(type, subprocess, exitCode, signalCode, error) {
|
|
|
19404
18910
|
log.debug("signalCode", signalCode);
|
|
19405
18911
|
if (error) {
|
|
19406
18912
|
log.error(error);
|
|
19407
|
-
|
|
18913
|
+
process3.exit(ExitCode3.FatalError);
|
|
19408
18914
|
}
|
|
19409
18915
|
if (exitCode !== ExitCode3.Success && exitCode)
|
|
19410
|
-
|
|
18916
|
+
process3.exit(exitCode);
|
|
19411
18917
|
};
|
|
19412
18918
|
|
|
19413
18919
|
// ../collections/src/index.ts
|
|
@@ -19535,34 +19041,549 @@ async function runCommandSync(command, options2) {
|
|
|
19535
19041
|
// ../cli/src/helpers.ts
|
|
19536
19042
|
import {ExitCode as ExitCode5} from "@stacksjs/types";
|
|
19537
19043
|
// ../cli/src/parse.ts
|
|
19538
|
-
import
|
|
19044
|
+
import process4 from "process";
|
|
19539
19045
|
function buddyOptions(options2) {
|
|
19540
19046
|
if (!options2) {
|
|
19541
|
-
options2 =
|
|
19047
|
+
options2 = process4.argv.slice(2);
|
|
19542
19048
|
options2 = Array.from(new Set(options2));
|
|
19543
19049
|
if (options2[0] && !options2[0].startsWith("-"))
|
|
19544
19050
|
options2.shift();
|
|
19545
19051
|
}
|
|
19546
19052
|
if (options2?.verbose) {
|
|
19547
|
-
log.debug("process.argv",
|
|
19548
|
-
log.debug("process.argv.slice(2)",
|
|
19053
|
+
log.debug("process.argv", process4.argv);
|
|
19054
|
+
log.debug("process.argv.slice(2)", process4.argv.slice(2));
|
|
19549
19055
|
log.debug("options inside buddyOptions", options2);
|
|
19550
19056
|
}
|
|
19551
19057
|
return options2.join(" ");
|
|
19552
19058
|
}
|
|
19059
|
+
// ../path/src/paths.ts
|
|
19060
|
+
function actionsPath(path2) {
|
|
19061
|
+
return corePath(`actions/${path2 || ""}`);
|
|
19062
|
+
}
|
|
19063
|
+
function relativeActionsPath(path2) {
|
|
19064
|
+
return relative(projectPath(), actionsPath(path2));
|
|
19065
|
+
}
|
|
19066
|
+
function userActionsPath(path2) {
|
|
19067
|
+
return appPath(`Actions/${path2 || ""}`);
|
|
19068
|
+
}
|
|
19069
|
+
function userComponentsPath(path2) {
|
|
19070
|
+
return libsPath(`components/${path2 || ""}`);
|
|
19071
|
+
}
|
|
19072
|
+
function userViewsPath(path2) {
|
|
19073
|
+
return resourcesPath(`views/${path2 || ""}`);
|
|
19074
|
+
}
|
|
19075
|
+
function userFunctionsPath(path2) {
|
|
19076
|
+
return resourcesPath(`functions/${path2 || ""}`);
|
|
19077
|
+
}
|
|
19078
|
+
function userJobsPath(path2) {
|
|
19079
|
+
return appPath(`Jobs/${path2 || ""}`);
|
|
19080
|
+
}
|
|
19081
|
+
function userListenersPath(path2) {
|
|
19082
|
+
return appPath(`Listeners/${path2 || ""}`);
|
|
19083
|
+
}
|
|
19084
|
+
function userMiddlewarePath(path2) {
|
|
19085
|
+
return appPath(`Middleware/${path2 || ""}`);
|
|
19086
|
+
}
|
|
19087
|
+
function userModelsPath(path2) {
|
|
19088
|
+
return appPath(`Models/${path2 || ""}`);
|
|
19089
|
+
}
|
|
19090
|
+
function userNotificationsPath(path2) {
|
|
19091
|
+
return appPath(`Notifications/${path2 || ""}`);
|
|
19092
|
+
}
|
|
19093
|
+
function userDatabasePath(path2) {
|
|
19094
|
+
return projectPath(`database/${path2 || ""}`);
|
|
19095
|
+
}
|
|
19096
|
+
function userMigrationsPath(path2) {
|
|
19097
|
+
return userDatabasePath(`migrations/${path2 || ""}`);
|
|
19098
|
+
}
|
|
19099
|
+
function userEventsPath() {
|
|
19100
|
+
return appPath(`Events.ts`);
|
|
19101
|
+
}
|
|
19102
|
+
function aiPath(path2) {
|
|
19103
|
+
return corePath(`ai/${path2 || ""}`);
|
|
19104
|
+
}
|
|
19105
|
+
function assetsPath(path2) {
|
|
19106
|
+
return resourcesPath(`assets/${path2 || ""}`);
|
|
19107
|
+
}
|
|
19108
|
+
function aliasPath() {
|
|
19109
|
+
return corePath("alias/src/index.ts");
|
|
19110
|
+
}
|
|
19111
|
+
function buddyPath(path2, options2) {
|
|
19112
|
+
const absolutePath = corePath(`buddy/${path2 || ""}`);
|
|
19113
|
+
if (options2?.relative)
|
|
19114
|
+
return relative(process5.cwd(), absolutePath);
|
|
19115
|
+
return absolutePath;
|
|
19116
|
+
}
|
|
19117
|
+
function runtimePath(path2) {
|
|
19118
|
+
return frameworkPath(`buddy/${path2 || ""}`);
|
|
19119
|
+
}
|
|
19120
|
+
function analyticsPath(path2) {
|
|
19121
|
+
return corePath(`analytics/${path2 || ""}`);
|
|
19122
|
+
}
|
|
19123
|
+
function arraysPath(path2) {
|
|
19124
|
+
return corePath(`arrays/${path2 || ""}`);
|
|
19125
|
+
}
|
|
19126
|
+
function appPath(path2) {
|
|
19127
|
+
return projectPath(`app/${path2 || ""}`);
|
|
19128
|
+
}
|
|
19129
|
+
function authPath(path2) {
|
|
19130
|
+
return corePath(`auth/${path2 || ""}`);
|
|
19131
|
+
}
|
|
19132
|
+
function buildPath(path2) {
|
|
19133
|
+
return corePath(`build/${path2 || ""}`);
|
|
19134
|
+
}
|
|
19135
|
+
function buildEnginePath(path2) {
|
|
19136
|
+
return buildPath(`${path2 || ""}`);
|
|
19137
|
+
}
|
|
19138
|
+
function libsPath(path2) {
|
|
19139
|
+
return frameworkPath(`libs/${path2 || ""}`);
|
|
19140
|
+
}
|
|
19141
|
+
function userLibsPath(path2) {
|
|
19142
|
+
return resourcesPath(`${path2 || ""}`);
|
|
19143
|
+
}
|
|
19144
|
+
function libsEntriesPath(path2) {
|
|
19145
|
+
return libsPath(`entries/${path2 || ""}`);
|
|
19146
|
+
}
|
|
19147
|
+
function cachePath(path2) {
|
|
19148
|
+
return corePath(`cache/${path2 || ""}`);
|
|
19149
|
+
}
|
|
19150
|
+
function chatPath(path2) {
|
|
19151
|
+
return corePath(`chat/${path2 || ""}`);
|
|
19152
|
+
}
|
|
19153
|
+
function cliPath(path2) {
|
|
19154
|
+
return corePath(`cli/${path2 || ""}`);
|
|
19155
|
+
}
|
|
19156
|
+
function cloudPath(path2) {
|
|
19157
|
+
return corePath(`cloud/${path2 || ""}`);
|
|
19158
|
+
}
|
|
19159
|
+
function frameworkCloudPath(path2) {
|
|
19160
|
+
return frameworkPath(`cloud/${path2 || ""}`);
|
|
19161
|
+
}
|
|
19162
|
+
function collectionsPath(path2) {
|
|
19163
|
+
return corePath(`collections/${path2 || ""}`);
|
|
19164
|
+
}
|
|
19165
|
+
function commandsPath(path2) {
|
|
19166
|
+
return appPath(`Commands/${path2 || ""}`);
|
|
19167
|
+
}
|
|
19168
|
+
function componentsPath(path2) {
|
|
19169
|
+
return userLibsPath(`components/${path2 || ""}`);
|
|
19170
|
+
}
|
|
19171
|
+
function configPath(path2) {
|
|
19172
|
+
return corePath(`config/${path2 || ""}`);
|
|
19173
|
+
}
|
|
19174
|
+
function corePath(path2) {
|
|
19175
|
+
return frameworkPath(`core/${path2 || ""}`);
|
|
19176
|
+
}
|
|
19177
|
+
function customElementsDataPath() {
|
|
19178
|
+
return frameworkPath("core/custom-elements.json");
|
|
19179
|
+
}
|
|
19180
|
+
function databasePath(path2) {
|
|
19181
|
+
return corePath(`database/${path2 || ""}`);
|
|
19182
|
+
}
|
|
19183
|
+
function datetimePath(path2) {
|
|
19184
|
+
return corePath(`datetime/${path2 || ""}`);
|
|
19185
|
+
}
|
|
19186
|
+
function developmentPath(path2) {
|
|
19187
|
+
return corePath(`development/${path2 || ""}`);
|
|
19188
|
+
}
|
|
19189
|
+
function desktopPath(path2) {
|
|
19190
|
+
return corePath(`desktop/${path2 || ""}`);
|
|
19191
|
+
}
|
|
19192
|
+
function docsPath(path2) {
|
|
19193
|
+
return corePath(`docs/${path2 || ""}`);
|
|
19194
|
+
}
|
|
19195
|
+
function dnsPath(path2) {
|
|
19196
|
+
return corePath(`domains/${path2 || ""}`);
|
|
19197
|
+
}
|
|
19198
|
+
function emailPath(path2) {
|
|
19199
|
+
return notificationsPath(`email/${path2 || ""}`);
|
|
19200
|
+
}
|
|
19201
|
+
function enumsPath(path2) {
|
|
19202
|
+
return corePath(`enums/${path2 || ""}`);
|
|
19203
|
+
}
|
|
19204
|
+
function errorHandlingPath(path2) {
|
|
19205
|
+
return corePath(`error-handling/${path2 || ""}`);
|
|
19206
|
+
}
|
|
19207
|
+
function eventsPath(path2) {
|
|
19208
|
+
return corePath(`events/${path2 || ""}`);
|
|
19209
|
+
}
|
|
19210
|
+
function coreEnvPath(path2) {
|
|
19211
|
+
return corePath(`env/${path2 || ""}`);
|
|
19212
|
+
}
|
|
19213
|
+
function examplesPath(type) {
|
|
19214
|
+
return frameworkPath(`examples/${type || ""}`);
|
|
19215
|
+
}
|
|
19216
|
+
function fakerPath(path2) {
|
|
19217
|
+
return corePath(`faker/${path2 || ""}`);
|
|
19218
|
+
}
|
|
19219
|
+
function frameworkPath(path2, options2) {
|
|
19220
|
+
const absolutePath = projectStoragePath(`framework/${path2 || ""}`);
|
|
19221
|
+
if (options2?.relative)
|
|
19222
|
+
return relative(options2.cwd || process5.cwd(), absolutePath);
|
|
19223
|
+
return absolutePath;
|
|
19224
|
+
}
|
|
19225
|
+
function healthPath(path2) {
|
|
19226
|
+
return corePath(`health/${path2 || ""}`);
|
|
19227
|
+
}
|
|
19228
|
+
function functionsPath(path2) {
|
|
19229
|
+
return userLibsPath(`functions/${path2 || ""}`);
|
|
19230
|
+
}
|
|
19231
|
+
function gitPath(path2) {
|
|
19232
|
+
return corePath(`git/${path2 || ""}`);
|
|
19233
|
+
}
|
|
19234
|
+
function langPath(path2) {
|
|
19235
|
+
return resourcesPath(`lang/${path2 || ""}`);
|
|
19236
|
+
}
|
|
19237
|
+
function layoutsPath(path2, options2) {
|
|
19238
|
+
const absolutePath = resourcesPath(`layouts/${path2 || ""}`);
|
|
19239
|
+
if (options2?.relative)
|
|
19240
|
+
return relative(process5.cwd(), absolutePath);
|
|
19241
|
+
return absolutePath;
|
|
19242
|
+
}
|
|
19243
|
+
function libraryEntryPath(type) {
|
|
19244
|
+
return libsEntriesPath(`${type}.ts`);
|
|
19245
|
+
}
|
|
19246
|
+
function lintPath(path2) {
|
|
19247
|
+
return corePath(`lint/${path2 || ""}`);
|
|
19248
|
+
}
|
|
19249
|
+
function listenersPath(path2) {
|
|
19250
|
+
return appPath(`Listeners/${path2 || ""}`);
|
|
19251
|
+
}
|
|
19252
|
+
function jobsPath(path2) {
|
|
19253
|
+
return appPath(`Jobs/${path2 || ""}`);
|
|
19254
|
+
}
|
|
19255
|
+
function loggingPath(path2) {
|
|
19256
|
+
return corePath(`logging/${path2 || ""}`);
|
|
19257
|
+
}
|
|
19258
|
+
function logsPath(path2) {
|
|
19259
|
+
return projectStoragePath(`logs/${path2 || ""}`);
|
|
19260
|
+
}
|
|
19261
|
+
function modulesPath(path2) {
|
|
19262
|
+
return resourcesPath(`modules/${path2 || ""}`);
|
|
19263
|
+
}
|
|
19264
|
+
function notificationsPath(path2) {
|
|
19265
|
+
return corePath(`notifications/${path2 || ""}`);
|
|
19266
|
+
}
|
|
19267
|
+
function ormPath(path2) {
|
|
19268
|
+
return corePath(`orm/${path2 || ""}`);
|
|
19269
|
+
}
|
|
19270
|
+
function objectsPath(path2) {
|
|
19271
|
+
return corePath(`objects/${path2 || ""}`);
|
|
19272
|
+
}
|
|
19273
|
+
function onboardingPath(path2) {
|
|
19274
|
+
return projectPath(`${path2 || "views/dashboard/onboarding"}`);
|
|
19275
|
+
}
|
|
19276
|
+
function packageJsonPath(type) {
|
|
19277
|
+
if (type === "vue-components")
|
|
19278
|
+
return frameworkPath("libs/components/vue/package.json");
|
|
19279
|
+
if (type === "web-components")
|
|
19280
|
+
return frameworkPath("libs/components/web/package.json");
|
|
19281
|
+
return frameworkPath(`libs/${type}/package.json`);
|
|
19282
|
+
}
|
|
19283
|
+
function viewsPath(path2) {
|
|
19284
|
+
return resourcesPath(`views/${path2 || ""}`);
|
|
19285
|
+
}
|
|
19286
|
+
function pathPath(path2) {
|
|
19287
|
+
return corePath(`path/${path2 || ""}`);
|
|
19288
|
+
}
|
|
19289
|
+
function paymentsPath(path2) {
|
|
19290
|
+
return corePath(`payments/${path2 || ""}`);
|
|
19291
|
+
}
|
|
19292
|
+
function projectPath(filePath = "", options2) {
|
|
19293
|
+
let path2 = process5.cwd();
|
|
19294
|
+
while (path2.includes("storage"))
|
|
19295
|
+
path2 = resolve(path2, "..");
|
|
19296
|
+
const finalPath = resolve(path2, filePath);
|
|
19297
|
+
if (options2?.relative)
|
|
19298
|
+
return relative(process5.cwd(), finalPath);
|
|
19299
|
+
return finalPath;
|
|
19300
|
+
}
|
|
19301
|
+
async function findProjectPath(project) {
|
|
19302
|
+
const projectList = await runCommandSync("buddy projects:list --quiet");
|
|
19303
|
+
log.debug("ProjectList in findProjectPath", projectList);
|
|
19304
|
+
const projects = projectList.split("\n").filter((line) => line.startsWith(" - ")).map((line) => line.trim().substring(4));
|
|
19305
|
+
log.debug("Projects in findProjectPath:", projects);
|
|
19306
|
+
const projectPath2 = projects.find((proj) => proj.includes(project));
|
|
19307
|
+
if (!projectPath2)
|
|
19308
|
+
throw new Error(`Could not find project with name: ${project}`);
|
|
19309
|
+
return projectPath2.startsWith("/") ? projectPath2 : `/${projectPath2}`;
|
|
19310
|
+
}
|
|
19311
|
+
function projectConfigPath(path2) {
|
|
19312
|
+
return projectPath(`config/${path2 || ""}`);
|
|
19313
|
+
}
|
|
19314
|
+
function projectStoragePath(path2) {
|
|
19315
|
+
return projectPath(`storage/${path2 || ""}`);
|
|
19316
|
+
}
|
|
19317
|
+
function publicPath(path2) {
|
|
19318
|
+
return projectPath(`public/${path2 || ""}`);
|
|
19319
|
+
}
|
|
19320
|
+
function pushPath(path2) {
|
|
19321
|
+
return notificationsPath(`push/${path2 || ""}`);
|
|
19322
|
+
}
|
|
19323
|
+
function queryBuilderPath(path2) {
|
|
19324
|
+
return corePath(`query-builder/${path2 || ""}`);
|
|
19325
|
+
}
|
|
19326
|
+
function queuePath(path2) {
|
|
19327
|
+
return corePath(`queue/${path2 || ""}`);
|
|
19328
|
+
}
|
|
19329
|
+
function realtimePath(path2) {
|
|
19330
|
+
return corePath(`realtime/${path2 || ""}`);
|
|
19331
|
+
}
|
|
19332
|
+
function resourcesPath(path2, options2) {
|
|
19333
|
+
const absolutePath = projectStoragePath(`resources/${path2 || ""}`);
|
|
19334
|
+
if (options2?.relative)
|
|
19335
|
+
return relative(process5.cwd(), absolutePath);
|
|
19336
|
+
return projectPath(`resources/${path2 || ""}`);
|
|
19337
|
+
}
|
|
19338
|
+
function replPath(path2) {
|
|
19339
|
+
return corePath(`repl/${path2 || ""}`);
|
|
19340
|
+
}
|
|
19341
|
+
function routerPath(path2) {
|
|
19342
|
+
return corePath(`router/${path2 || ""}`);
|
|
19343
|
+
}
|
|
19344
|
+
function routesPath(path2, options2) {
|
|
19345
|
+
const absolutePath = resourcesPath(`routes/${path2 || ""}`);
|
|
19346
|
+
if (options2?.relative)
|
|
19347
|
+
return relative(process5.cwd(), absolutePath);
|
|
19348
|
+
return projectPath(`routes/${path2 || ""}`);
|
|
19349
|
+
}
|
|
19350
|
+
function searchEnginePath(path2) {
|
|
19351
|
+
return corePath(`search-engine/${path2 || ""}`);
|
|
19352
|
+
}
|
|
19353
|
+
function settingsPath(path2) {
|
|
19354
|
+
return projectPath(`${path2 || "views/dashboard/settings"}`);
|
|
19355
|
+
}
|
|
19356
|
+
function scriptsPath(path2) {
|
|
19357
|
+
return frameworkPath(`scripts/${path2 || ""}`);
|
|
19358
|
+
}
|
|
19359
|
+
function schedulerPath(path2) {
|
|
19360
|
+
return corePath(`scheduler/${path2 || ""}`);
|
|
19361
|
+
}
|
|
19362
|
+
function slugPath(path2) {
|
|
19363
|
+
return corePath(`slug/${path2 || ""}`);
|
|
19364
|
+
}
|
|
19365
|
+
function smsPath(path2) {
|
|
19366
|
+
return notificationsPath(`sms/${path2 || ""}`);
|
|
19367
|
+
}
|
|
19368
|
+
function storagePath(path2) {
|
|
19369
|
+
return corePath(`storage/${path2 || ""}`);
|
|
19370
|
+
}
|
|
19371
|
+
function storesPath(path2) {
|
|
19372
|
+
return resourcesPath(`stores/${path2 || ""}`);
|
|
19373
|
+
}
|
|
19374
|
+
function securityPath(path2) {
|
|
19375
|
+
return corePath(`security/${path2 || ""}`);
|
|
19376
|
+
}
|
|
19377
|
+
function serverPath(path2) {
|
|
19378
|
+
return corePath(`server/${path2 || ""}`);
|
|
19379
|
+
}
|
|
19380
|
+
function serverlessPath(path2) {
|
|
19381
|
+
return corePath(`serverless/${path2 || ""}`);
|
|
19382
|
+
}
|
|
19383
|
+
function stacksPath(path2) {
|
|
19384
|
+
return frameworkPath(`src/${path2 || ""}`);
|
|
19385
|
+
}
|
|
19386
|
+
function shellPath(path2) {
|
|
19387
|
+
return corePath(`shell/${path2 || ""}`);
|
|
19388
|
+
}
|
|
19389
|
+
function stringsPath(path2) {
|
|
19390
|
+
return corePath(`strings/${path2 || ""}`);
|
|
19391
|
+
}
|
|
19392
|
+
function testingPath(path2) {
|
|
19393
|
+
return corePath(`testing/${path2 || ""}`);
|
|
19394
|
+
}
|
|
19395
|
+
function tinkerPath(path2) {
|
|
19396
|
+
return corePath(`tinker/${path2 || ""}`);
|
|
19397
|
+
}
|
|
19398
|
+
function testsPath(path2) {
|
|
19399
|
+
return frameworkPath(`tests/${path2 || ""}`);
|
|
19400
|
+
}
|
|
19401
|
+
function typesPath(path2) {
|
|
19402
|
+
return corePath(`types/${path2 || ""}`);
|
|
19403
|
+
}
|
|
19404
|
+
function uiPath(path2) {
|
|
19405
|
+
return corePath(`ui/${path2 || ""}`);
|
|
19406
|
+
}
|
|
19407
|
+
function utilsPath(path2) {
|
|
19408
|
+
return corePath(`utils/${path2 || ""}`);
|
|
19409
|
+
}
|
|
19410
|
+
function validationPath(path2) {
|
|
19411
|
+
return corePath(`validation/${path2 || ""}`);
|
|
19412
|
+
}
|
|
19413
|
+
function viteConfigPath(path2) {
|
|
19414
|
+
return corePath(`vite-config/${path2 || ""}`);
|
|
19415
|
+
}
|
|
19416
|
+
function vitePluginPath(path2) {
|
|
19417
|
+
return corePath(`vite-plugin/${path2 || ""}`);
|
|
19418
|
+
}
|
|
19419
|
+
function xRayPath(path2) {
|
|
19420
|
+
return frameworkPath(`stacks/x-ray/${path2 || ""}`);
|
|
19421
|
+
}
|
|
19422
|
+
function homeDir(path2) {
|
|
19423
|
+
return os.homedir() + (path2 ? (path2.startsWith("/") ? "" : "/") + path2 : "~");
|
|
19424
|
+
}
|
|
19425
|
+
var path2 = {
|
|
19426
|
+
actionsPath,
|
|
19427
|
+
userActionsPath,
|
|
19428
|
+
userComponentsPath,
|
|
19429
|
+
userViewsPath,
|
|
19430
|
+
userFunctionsPath,
|
|
19431
|
+
aiPath,
|
|
19432
|
+
assetsPath,
|
|
19433
|
+
relativeActionsPath,
|
|
19434
|
+
aliasPath,
|
|
19435
|
+
analyticsPath,
|
|
19436
|
+
arraysPath,
|
|
19437
|
+
appPath,
|
|
19438
|
+
authPath,
|
|
19439
|
+
buddyPath,
|
|
19440
|
+
buildEnginePath,
|
|
19441
|
+
libsEntriesPath,
|
|
19442
|
+
buildPath,
|
|
19443
|
+
cachePath,
|
|
19444
|
+
chatPath,
|
|
19445
|
+
cliPath,
|
|
19446
|
+
cloudPath,
|
|
19447
|
+
frameworkCloudPath,
|
|
19448
|
+
collectionsPath,
|
|
19449
|
+
commandsPath,
|
|
19450
|
+
componentsPath,
|
|
19451
|
+
configPath,
|
|
19452
|
+
projectConfigPath,
|
|
19453
|
+
corePath,
|
|
19454
|
+
customElementsDataPath,
|
|
19455
|
+
databasePath,
|
|
19456
|
+
datetimePath,
|
|
19457
|
+
developmentPath,
|
|
19458
|
+
desktopPath,
|
|
19459
|
+
docsPath,
|
|
19460
|
+
dnsPath,
|
|
19461
|
+
emailPath,
|
|
19462
|
+
enumsPath,
|
|
19463
|
+
errorHandlingPath,
|
|
19464
|
+
eventsPath,
|
|
19465
|
+
coreEnvPath,
|
|
19466
|
+
healthPath,
|
|
19467
|
+
examplesPath,
|
|
19468
|
+
fakerPath,
|
|
19469
|
+
frameworkPath,
|
|
19470
|
+
storagePath,
|
|
19471
|
+
functionsPath,
|
|
19472
|
+
gitPath,
|
|
19473
|
+
langPath,
|
|
19474
|
+
layoutsPath,
|
|
19475
|
+
libsPath,
|
|
19476
|
+
userLibsPath,
|
|
19477
|
+
libraryEntryPath,
|
|
19478
|
+
lintPath,
|
|
19479
|
+
listenersPath,
|
|
19480
|
+
loggingPath,
|
|
19481
|
+
logsPath,
|
|
19482
|
+
jobsPath,
|
|
19483
|
+
modulesPath,
|
|
19484
|
+
ormPath,
|
|
19485
|
+
objectsPath,
|
|
19486
|
+
onboardingPath,
|
|
19487
|
+
notificationsPath,
|
|
19488
|
+
packageJsonPath,
|
|
19489
|
+
viewsPath,
|
|
19490
|
+
pathPath,
|
|
19491
|
+
paymentsPath,
|
|
19492
|
+
projectPath,
|
|
19493
|
+
findProjectPath,
|
|
19494
|
+
projectStoragePath,
|
|
19495
|
+
publicPath,
|
|
19496
|
+
pushPath,
|
|
19497
|
+
queryBuilderPath,
|
|
19498
|
+
queuePath,
|
|
19499
|
+
realtimePath,
|
|
19500
|
+
resourcesPath,
|
|
19501
|
+
replPath,
|
|
19502
|
+
routerPath,
|
|
19503
|
+
routesPath,
|
|
19504
|
+
runtimePath,
|
|
19505
|
+
searchEnginePath,
|
|
19506
|
+
schedulerPath,
|
|
19507
|
+
settingsPath,
|
|
19508
|
+
smsPath,
|
|
19509
|
+
slugPath,
|
|
19510
|
+
scriptsPath,
|
|
19511
|
+
securityPath,
|
|
19512
|
+
serverPath,
|
|
19513
|
+
serverlessPath,
|
|
19514
|
+
stacksPath,
|
|
19515
|
+
stringsPath,
|
|
19516
|
+
shellPath,
|
|
19517
|
+
storesPath,
|
|
19518
|
+
testingPath,
|
|
19519
|
+
testsPath,
|
|
19520
|
+
tinkerPath,
|
|
19521
|
+
typesPath,
|
|
19522
|
+
uiPath,
|
|
19523
|
+
userDatabasePath,
|
|
19524
|
+
userMigrationsPath,
|
|
19525
|
+
userEventsPath,
|
|
19526
|
+
userJobsPath,
|
|
19527
|
+
userListenersPath,
|
|
19528
|
+
userMiddlewarePath,
|
|
19529
|
+
userModelsPath,
|
|
19530
|
+
userNotificationsPath,
|
|
19531
|
+
utilsPath,
|
|
19532
|
+
validationPath,
|
|
19533
|
+
viteConfigPath,
|
|
19534
|
+
vitePluginPath,
|
|
19535
|
+
xRayPath,
|
|
19536
|
+
homeDir,
|
|
19537
|
+
basename,
|
|
19538
|
+
delimiter,
|
|
19539
|
+
dirname,
|
|
19540
|
+
extname,
|
|
19541
|
+
isAbsolute,
|
|
19542
|
+
join,
|
|
19543
|
+
normalize,
|
|
19544
|
+
relative,
|
|
19545
|
+
resolve,
|
|
19546
|
+
parse: parse2,
|
|
19547
|
+
sep: sep2,
|
|
19548
|
+
toNamespacedPath
|
|
19549
|
+
};
|
|
19553
19550
|
// src/validator.ts
|
|
19554
19551
|
async function validateField(modelFile, params) {
|
|
19555
|
-
const model = (await import(
|
|
19552
|
+
const model = (await import(path2.userModelsPath(`${modelFile}.ts`))).default;
|
|
19556
19553
|
const attributes = model.attributes;
|
|
19557
19554
|
const ruleObject = {};
|
|
19558
19555
|
const messageObject = {};
|
|
19559
19556
|
for (const key in attributes) {
|
|
19560
19557
|
if (attributes.hasOwnProperty(key)) {
|
|
19561
|
-
ruleObject[key] =
|
|
19562
|
-
const validatorMessages =
|
|
19558
|
+
ruleObject[key] = attributes[key]?.validation?.rule;
|
|
19559
|
+
const validatorMessages = attributes[key]?.validation?.message;
|
|
19560
|
+
for (const validatorMessageKey in validatorMessages) {
|
|
19561
|
+
const validatorMessageString = `${key}.${validatorMessageKey}`;
|
|
19562
|
+
messageObject[validatorMessageString] = attributes[key]?.validation?.message[validatorMessageKey] || "";
|
|
19563
|
+
}
|
|
19564
|
+
}
|
|
19565
|
+
}
|
|
19566
|
+
schema.messagesProvider = new SimpleMessagesProvider(messageObject);
|
|
19567
|
+
try {
|
|
19568
|
+
const vineSchema = schema.object(ruleObject);
|
|
19569
|
+
const validator = schema.compile(vineSchema);
|
|
19570
|
+
await validator.validate(params);
|
|
19571
|
+
} catch (error) {
|
|
19572
|
+
if (error instanceof VineError.E_VALIDATION_ERROR)
|
|
19573
|
+
reportError(error.messages);
|
|
19574
|
+
throw { status: 422, errors: error.messages };
|
|
19575
|
+
}
|
|
19576
|
+
}
|
|
19577
|
+
async function customValidate(attributes, params) {
|
|
19578
|
+
const ruleObject = {};
|
|
19579
|
+
const messageObject = {};
|
|
19580
|
+
for (const key in attributes) {
|
|
19581
|
+
if (attributes.hasOwnProperty(key)) {
|
|
19582
|
+
ruleObject[key] = attributes[key]?.validation?.rule;
|
|
19583
|
+
const validatorMessages = attributes[key]?.validation?.message;
|
|
19563
19584
|
for (const validatorMessageKey in validatorMessages) {
|
|
19564
19585
|
const validatorMessageString = `${key}.${validatorMessageKey}`;
|
|
19565
|
-
messageObject[validatorMessageString] =
|
|
19586
|
+
messageObject[validatorMessageString] = attributes[key]?.validation?.message[validatorMessageKey] || "";
|
|
19566
19587
|
}
|
|
19567
19588
|
}
|
|
19568
19589
|
}
|
|
@@ -19574,8 +19595,7 @@ async function validateField(modelFile, params) {
|
|
|
19574
19595
|
} catch (error) {
|
|
19575
19596
|
if (error instanceof VineError.E_VALIDATION_ERROR)
|
|
19576
19597
|
reportError(error.messages);
|
|
19577
|
-
|
|
19578
|
-
throw error;
|
|
19598
|
+
throw { status: 422, errors: error.messages };
|
|
19579
19599
|
}
|
|
19580
19600
|
}
|
|
19581
19601
|
var export_rule = import_validator.default;
|
|
@@ -19616,6 +19636,7 @@ export {
|
|
|
19616
19636
|
isBoolean,
|
|
19617
19637
|
isArray,
|
|
19618
19638
|
getErrors,
|
|
19639
|
+
customValidate,
|
|
19619
19640
|
VineString,
|
|
19620
19641
|
VineNumber,
|
|
19621
19642
|
VineError,
|