@capgo/cli 4.12.1 → 4.12.3-beta.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/CHANGELOG.md +14 -0
- package/bun.lockb +0 -0
- package/dist/index.js +49 -1199
- package/package.json +1 -3
- package/src/bundle/upload.ts +10 -9
- package/src/utils.ts +33 -17
package/dist/index.js
CHANGED
|
@@ -4207,9 +4207,9 @@ var require_graceful_fs = __commonJS({
|
|
|
4207
4207
|
}
|
|
4208
4208
|
}
|
|
4209
4209
|
var fs$readdir = fs7.readdir;
|
|
4210
|
-
fs7.readdir =
|
|
4210
|
+
fs7.readdir = readdir2;
|
|
4211
4211
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
4212
|
-
function
|
|
4212
|
+
function readdir2(path3, options, cb) {
|
|
4213
4213
|
if (typeof options === "function")
|
|
4214
4214
|
cb = options, options = null;
|
|
4215
4215
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path4, options2, cb2, startTime) {
|
|
@@ -6147,14 +6147,14 @@ var require_safe = __commonJS({
|
|
|
6147
6147
|
}
|
|
6148
6148
|
}
|
|
6149
6149
|
exports2.stat = stat;
|
|
6150
|
-
async function
|
|
6150
|
+
async function readdir2(dir) {
|
|
6151
6151
|
try {
|
|
6152
6152
|
return await fs6.readdir(dir);
|
|
6153
6153
|
} catch (e2) {
|
|
6154
6154
|
return [];
|
|
6155
6155
|
}
|
|
6156
6156
|
}
|
|
6157
|
-
exports2.readdir =
|
|
6157
|
+
exports2.readdir = readdir2;
|
|
6158
6158
|
}
|
|
6159
6159
|
});
|
|
6160
6160
|
|
|
@@ -20999,14 +20999,14 @@ var require_safe2 = __commonJS({
|
|
|
20999
20999
|
}
|
|
21000
21000
|
}
|
|
21001
21001
|
exports2.stat = stat;
|
|
21002
|
-
async function
|
|
21002
|
+
async function readdir2(dir) {
|
|
21003
21003
|
try {
|
|
21004
21004
|
return await fs6.readdir(dir);
|
|
21005
21005
|
} catch (e2) {
|
|
21006
21006
|
return [];
|
|
21007
21007
|
}
|
|
21008
21008
|
}
|
|
21009
|
-
exports2.readdir =
|
|
21009
|
+
exports2.readdir = readdir2;
|
|
21010
21010
|
}
|
|
21011
21011
|
});
|
|
21012
21012
|
|
|
@@ -45503,1168 +45503,6 @@ var require_dist12 = __commonJS({
|
|
|
45503
45503
|
}
|
|
45504
45504
|
});
|
|
45505
45505
|
|
|
45506
|
-
// node_modules/node-dir/lib/paths.js
|
|
45507
|
-
var require_paths = __commonJS({
|
|
45508
|
-
"node_modules/node-dir/lib/paths.js"(exports2) {
|
|
45509
|
-
var fs6 = require("fs");
|
|
45510
|
-
var path3 = require("path");
|
|
45511
|
-
exports2.promiseFiles = function promiseFiles2(dir, type, options) {
|
|
45512
|
-
type = type || "file";
|
|
45513
|
-
var processor = function(res, rej) {
|
|
45514
|
-
var cb = function(err, data) {
|
|
45515
|
-
if (err) return rej(err);
|
|
45516
|
-
res(data);
|
|
45517
|
-
};
|
|
45518
|
-
exports2.files(dir, type, cb, options);
|
|
45519
|
-
};
|
|
45520
|
-
return new Promise(processor);
|
|
45521
|
-
};
|
|
45522
|
-
exports2.files = function files(dir, type, callback, options) {
|
|
45523
|
-
var ofType = typeof type;
|
|
45524
|
-
if (ofType == "object") {
|
|
45525
|
-
options = options || type;
|
|
45526
|
-
type = "file";
|
|
45527
|
-
callback = function() {
|
|
45528
|
-
};
|
|
45529
|
-
} else if (ofType !== "string") {
|
|
45530
|
-
callback = type;
|
|
45531
|
-
type = "file";
|
|
45532
|
-
}
|
|
45533
|
-
options = options || {};
|
|
45534
|
-
var pending, results = {
|
|
45535
|
-
files: [],
|
|
45536
|
-
dirs: []
|
|
45537
|
-
};
|
|
45538
|
-
var done = function() {
|
|
45539
|
-
if (type === "combine") {
|
|
45540
|
-
results = results.files.concat(results.dirs);
|
|
45541
|
-
} else if (!type || options.ignoreType || ["all", "combine"].indexOf(type) >= 0) {
|
|
45542
|
-
results = results;
|
|
45543
|
-
} else {
|
|
45544
|
-
results = results[type + "s"];
|
|
45545
|
-
}
|
|
45546
|
-
if (options.sync) return;
|
|
45547
|
-
callback(null, results);
|
|
45548
|
-
};
|
|
45549
|
-
var getStatHandler = function(statPath, name, lstatCalled) {
|
|
45550
|
-
return function(err, stat) {
|
|
45551
|
-
if (err) {
|
|
45552
|
-
if (!lstatCalled) {
|
|
45553
|
-
return fs6.lstat(statPath, getStatHandler(statPath, name, true));
|
|
45554
|
-
}
|
|
45555
|
-
return callback(err);
|
|
45556
|
-
}
|
|
45557
|
-
var pushVal = options.shortName ? name : statPath;
|
|
45558
|
-
if (stat && stat.isDirectory() && stat.mode !== 17115) {
|
|
45559
|
-
if (type !== "file") {
|
|
45560
|
-
results.dirs.push(pushVal);
|
|
45561
|
-
}
|
|
45562
|
-
if (options.recursive == null || options.recursive) {
|
|
45563
|
-
var subloop = function(err2, res) {
|
|
45564
|
-
if (err2) {
|
|
45565
|
-
return callback(err2);
|
|
45566
|
-
}
|
|
45567
|
-
if (type === "combine") {
|
|
45568
|
-
results.files = results.files.concat(res);
|
|
45569
|
-
} else if (type === "all") {
|
|
45570
|
-
results.files = results.files.concat(res.files);
|
|
45571
|
-
results.dirs = results.dirs.concat(res.dirs);
|
|
45572
|
-
} else if (type === "file") {
|
|
45573
|
-
results.files = results.files.concat(res.files);
|
|
45574
|
-
} else {
|
|
45575
|
-
results.dirs = results.dirs.concat(res.dirs);
|
|
45576
|
-
}
|
|
45577
|
-
if (!--pending) {
|
|
45578
|
-
done();
|
|
45579
|
-
}
|
|
45580
|
-
};
|
|
45581
|
-
var newOptions = Object.assign({}, options);
|
|
45582
|
-
newOptions.ignoreType = true;
|
|
45583
|
-
var moreResults = files(statPath, type, subloop, newOptions);
|
|
45584
|
-
if (options.sync) {
|
|
45585
|
-
subloop(null, moreResults);
|
|
45586
|
-
}
|
|
45587
|
-
} else if (!--pending) {
|
|
45588
|
-
done();
|
|
45589
|
-
}
|
|
45590
|
-
} else {
|
|
45591
|
-
if (type !== "dir") {
|
|
45592
|
-
results.files.push(pushVal);
|
|
45593
|
-
}
|
|
45594
|
-
if (!--pending) {
|
|
45595
|
-
done();
|
|
45596
|
-
}
|
|
45597
|
-
}
|
|
45598
|
-
};
|
|
45599
|
-
};
|
|
45600
|
-
var bufdir = Buffer.from(dir);
|
|
45601
|
-
const onDirRead = function(err, list) {
|
|
45602
|
-
if (err) return callback(err);
|
|
45603
|
-
pending = list.length;
|
|
45604
|
-
if (!pending) return done();
|
|
45605
|
-
for (var file, i = 0, l = list.length; i < l; i++) {
|
|
45606
|
-
var fname = list[i].toString();
|
|
45607
|
-
file = path3.join(dir, fname);
|
|
45608
|
-
var buffile = Buffer.concat([bufdir, Buffer.from(path3.sep), list[i]]);
|
|
45609
|
-
if (options.sync) {
|
|
45610
|
-
var res = fs6.statSync(buffile);
|
|
45611
|
-
getStatHandler(file, fname)(null, res);
|
|
45612
|
-
} else {
|
|
45613
|
-
fs6.stat(buffile, getStatHandler(file, fname));
|
|
45614
|
-
}
|
|
45615
|
-
}
|
|
45616
|
-
return results;
|
|
45617
|
-
};
|
|
45618
|
-
const onStat = function(err, stat) {
|
|
45619
|
-
if (err) return callback(err);
|
|
45620
|
-
if (stat && stat.mode === 17115) return done();
|
|
45621
|
-
if (options.sync) {
|
|
45622
|
-
const list = fs6.readdirSync(bufdir, { encoding: "buffer" });
|
|
45623
|
-
return onDirRead(null, list);
|
|
45624
|
-
} else {
|
|
45625
|
-
fs6.readdir(bufdir, { encoding: "buffer" }, onDirRead);
|
|
45626
|
-
}
|
|
45627
|
-
};
|
|
45628
|
-
if (options.sync) {
|
|
45629
|
-
const stat = fs6.statSync(bufdir);
|
|
45630
|
-
return onStat(null, stat);
|
|
45631
|
-
} else {
|
|
45632
|
-
fs6.stat(bufdir, onStat);
|
|
45633
|
-
}
|
|
45634
|
-
};
|
|
45635
|
-
exports2.paths = function paths(dir, combine, callback) {
|
|
45636
|
-
var type;
|
|
45637
|
-
if (typeof combine === "function") {
|
|
45638
|
-
callback = combine;
|
|
45639
|
-
combine = false;
|
|
45640
|
-
}
|
|
45641
|
-
exports2.files(dir, "all", function(err, results) {
|
|
45642
|
-
if (err) return callback(err);
|
|
45643
|
-
if (combine) {
|
|
45644
|
-
callback(null, results.files.concat(results.dirs));
|
|
45645
|
-
} else {
|
|
45646
|
-
callback(null, results);
|
|
45647
|
-
}
|
|
45648
|
-
});
|
|
45649
|
-
};
|
|
45650
|
-
exports2.subdirs = function subdirs(dir, callback, type, options) {
|
|
45651
|
-
options = options || {};
|
|
45652
|
-
const iCallback = function(err, subdirs2) {
|
|
45653
|
-
if (err) return callback(err);
|
|
45654
|
-
if (type == "combine") {
|
|
45655
|
-
subdirs2 = subdirs2.files.concat(subdirs2.dirs);
|
|
45656
|
-
}
|
|
45657
|
-
if (options.sync) return subdirs2;
|
|
45658
|
-
callback(null, subdirs2);
|
|
45659
|
-
};
|
|
45660
|
-
const res = exports2.files(dir, "dir", iCallback, options);
|
|
45661
|
-
if (options && options.sync) {
|
|
45662
|
-
return iCallback(null, res);
|
|
45663
|
-
}
|
|
45664
|
-
};
|
|
45665
|
-
}
|
|
45666
|
-
});
|
|
45667
|
-
|
|
45668
|
-
// node_modules/node-dir/lib/readfiles.js
|
|
45669
|
-
var require_readfiles = __commonJS({
|
|
45670
|
-
"node_modules/node-dir/lib/readfiles.js"(exports2, module2) {
|
|
45671
|
-
var fs6 = require("fs");
|
|
45672
|
-
var path3 = require("path");
|
|
45673
|
-
function extend(target, source, modify) {
|
|
45674
|
-
var result = target ? modify ? target : extend({}, target, true) : {};
|
|
45675
|
-
if (!source) return result;
|
|
45676
|
-
for (var key2 in source) {
|
|
45677
|
-
if (source.hasOwnProperty(key2) && source[key2] !== void 0) {
|
|
45678
|
-
result[key2] = source[key2];
|
|
45679
|
-
}
|
|
45680
|
-
}
|
|
45681
|
-
return result;
|
|
45682
|
-
}
|
|
45683
|
-
function matches(str, match) {
|
|
45684
|
-
if (Array.isArray(match)) return match.indexOf(str) > -1;
|
|
45685
|
-
return match.test(str);
|
|
45686
|
-
}
|
|
45687
|
-
function readFiles(dir, options, callback, complete) {
|
|
45688
|
-
if (typeof options === "function") {
|
|
45689
|
-
complete = callback;
|
|
45690
|
-
callback = options;
|
|
45691
|
-
options = {};
|
|
45692
|
-
}
|
|
45693
|
-
if (typeof options === "string") options = {
|
|
45694
|
-
encoding: options
|
|
45695
|
-
};
|
|
45696
|
-
options = extend({
|
|
45697
|
-
recursive: true,
|
|
45698
|
-
encoding: "utf8",
|
|
45699
|
-
doneOnErr: true
|
|
45700
|
-
}, options);
|
|
45701
|
-
var files = [];
|
|
45702
|
-
var done = function(err) {
|
|
45703
|
-
if (typeof complete === "function") {
|
|
45704
|
-
if (err) return complete(err);
|
|
45705
|
-
complete(null, files);
|
|
45706
|
-
}
|
|
45707
|
-
};
|
|
45708
|
-
fs6.readdir(dir, function(err, list) {
|
|
45709
|
-
if (err) {
|
|
45710
|
-
if (options.doneOnErr === true) {
|
|
45711
|
-
if (err.code === "EACCES") return done();
|
|
45712
|
-
return done(err);
|
|
45713
|
-
}
|
|
45714
|
-
}
|
|
45715
|
-
var i = 0;
|
|
45716
|
-
if (options.reverse === true || typeof options.sort == "string" && /reverse|desc/i.test(options.sort)) {
|
|
45717
|
-
list = list.reverse();
|
|
45718
|
-
} else if (options.sort !== false) list = list.sort();
|
|
45719
|
-
(function next() {
|
|
45720
|
-
var filename = list[i++];
|
|
45721
|
-
if (!filename) return done(null, files);
|
|
45722
|
-
var file = path3.join(dir, filename);
|
|
45723
|
-
fs6.stat(file, function(err2, stat) {
|
|
45724
|
-
if (err2 && options.doneOnErr === true) return done(err2);
|
|
45725
|
-
if (stat && stat.isDirectory()) {
|
|
45726
|
-
if (options.recursive) {
|
|
45727
|
-
if (options.matchDir && !matches(filename, options.matchDir)) return next();
|
|
45728
|
-
if (options.excludeDir && matches(filename, options.excludeDir)) return next();
|
|
45729
|
-
readFiles(file, options, callback, function(err3, sfiles) {
|
|
45730
|
-
if (err3 && options.doneOnErr === true) return done(err3);
|
|
45731
|
-
files = files.concat(sfiles);
|
|
45732
|
-
next();
|
|
45733
|
-
});
|
|
45734
|
-
} else next();
|
|
45735
|
-
} else if (stat && stat.isFile()) {
|
|
45736
|
-
if (options.match && !matches(filename, options.match)) return next();
|
|
45737
|
-
if (options.exclude && matches(filename, options.exclude)) return next();
|
|
45738
|
-
if (options.filter && !options.filter(filename)) return next();
|
|
45739
|
-
if (options.shortName) files.push(filename);
|
|
45740
|
-
else files.push(file);
|
|
45741
|
-
fs6.readFile(file, options.encoding, function(err3, data) {
|
|
45742
|
-
if (err3) {
|
|
45743
|
-
if (err3.code === "EACCES") return next();
|
|
45744
|
-
if (options.doneOnErr === true) {
|
|
45745
|
-
return done(err3);
|
|
45746
|
-
}
|
|
45747
|
-
}
|
|
45748
|
-
if (callback.length > 3)
|
|
45749
|
-
if (options.shortName) callback(null, data, filename, next);
|
|
45750
|
-
else callback(null, data, file, next);
|
|
45751
|
-
else callback(null, data, next);
|
|
45752
|
-
});
|
|
45753
|
-
} else {
|
|
45754
|
-
next();
|
|
45755
|
-
}
|
|
45756
|
-
});
|
|
45757
|
-
})();
|
|
45758
|
-
});
|
|
45759
|
-
}
|
|
45760
|
-
module2.exports = readFiles;
|
|
45761
|
-
}
|
|
45762
|
-
});
|
|
45763
|
-
|
|
45764
|
-
// node_modules/concat-map/index.js
|
|
45765
|
-
var require_concat_map = __commonJS({
|
|
45766
|
-
"node_modules/concat-map/index.js"(exports2, module2) {
|
|
45767
|
-
module2.exports = function(xs, fn) {
|
|
45768
|
-
var res = [];
|
|
45769
|
-
for (var i = 0; i < xs.length; i++) {
|
|
45770
|
-
var x3 = fn(xs[i], i);
|
|
45771
|
-
if (isArray(x3)) res.push.apply(res, x3);
|
|
45772
|
-
else res.push(x3);
|
|
45773
|
-
}
|
|
45774
|
-
return res;
|
|
45775
|
-
};
|
|
45776
|
-
var isArray = Array.isArray || function(xs) {
|
|
45777
|
-
return Object.prototype.toString.call(xs) === "[object Array]";
|
|
45778
|
-
};
|
|
45779
|
-
}
|
|
45780
|
-
});
|
|
45781
|
-
|
|
45782
|
-
// node_modules/balanced-match/index.js
|
|
45783
|
-
var require_balanced_match = __commonJS({
|
|
45784
|
-
"node_modules/balanced-match/index.js"(exports2, module2) {
|
|
45785
|
-
"use strict";
|
|
45786
|
-
module2.exports = balanced;
|
|
45787
|
-
function balanced(a2, b3, str) {
|
|
45788
|
-
if (a2 instanceof RegExp) a2 = maybeMatch(a2, str);
|
|
45789
|
-
if (b3 instanceof RegExp) b3 = maybeMatch(b3, str);
|
|
45790
|
-
var r2 = range(a2, b3, str);
|
|
45791
|
-
return r2 && {
|
|
45792
|
-
start: r2[0],
|
|
45793
|
-
end: r2[1],
|
|
45794
|
-
pre: str.slice(0, r2[0]),
|
|
45795
|
-
body: str.slice(r2[0] + a2.length, r2[1]),
|
|
45796
|
-
post: str.slice(r2[1] + b3.length)
|
|
45797
|
-
};
|
|
45798
|
-
}
|
|
45799
|
-
function maybeMatch(reg, str) {
|
|
45800
|
-
var m2 = str.match(reg);
|
|
45801
|
-
return m2 ? m2[0] : null;
|
|
45802
|
-
}
|
|
45803
|
-
balanced.range = range;
|
|
45804
|
-
function range(a2, b3, str) {
|
|
45805
|
-
var begs, beg, left, right, result;
|
|
45806
|
-
var ai = str.indexOf(a2);
|
|
45807
|
-
var bi = str.indexOf(b3, ai + 1);
|
|
45808
|
-
var i = ai;
|
|
45809
|
-
if (ai >= 0 && bi > 0) {
|
|
45810
|
-
if (a2 === b3) {
|
|
45811
|
-
return [ai, bi];
|
|
45812
|
-
}
|
|
45813
|
-
begs = [];
|
|
45814
|
-
left = str.length;
|
|
45815
|
-
while (i >= 0 && !result) {
|
|
45816
|
-
if (i == ai) {
|
|
45817
|
-
begs.push(i);
|
|
45818
|
-
ai = str.indexOf(a2, i + 1);
|
|
45819
|
-
} else if (begs.length == 1) {
|
|
45820
|
-
result = [begs.pop(), bi];
|
|
45821
|
-
} else {
|
|
45822
|
-
beg = begs.pop();
|
|
45823
|
-
if (beg < left) {
|
|
45824
|
-
left = beg;
|
|
45825
|
-
right = bi;
|
|
45826
|
-
}
|
|
45827
|
-
bi = str.indexOf(b3, i + 1);
|
|
45828
|
-
}
|
|
45829
|
-
i = ai < bi && ai >= 0 ? ai : bi;
|
|
45830
|
-
}
|
|
45831
|
-
if (begs.length) {
|
|
45832
|
-
result = [left, right];
|
|
45833
|
-
}
|
|
45834
|
-
}
|
|
45835
|
-
return result;
|
|
45836
|
-
}
|
|
45837
|
-
}
|
|
45838
|
-
});
|
|
45839
|
-
|
|
45840
|
-
// node_modules/brace-expansion/index.js
|
|
45841
|
-
var require_brace_expansion = __commonJS({
|
|
45842
|
-
"node_modules/brace-expansion/index.js"(exports2, module2) {
|
|
45843
|
-
var concatMap = require_concat_map();
|
|
45844
|
-
var balanced = require_balanced_match();
|
|
45845
|
-
module2.exports = expandTop;
|
|
45846
|
-
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
45847
|
-
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
45848
|
-
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
45849
|
-
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
45850
|
-
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
45851
|
-
function numeric(str) {
|
|
45852
|
-
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
45853
|
-
}
|
|
45854
|
-
function escapeBraces(str) {
|
|
45855
|
-
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
45856
|
-
}
|
|
45857
|
-
function unescapeBraces(str) {
|
|
45858
|
-
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
45859
|
-
}
|
|
45860
|
-
function parseCommaParts(str) {
|
|
45861
|
-
if (!str)
|
|
45862
|
-
return [""];
|
|
45863
|
-
var parts = [];
|
|
45864
|
-
var m2 = balanced("{", "}", str);
|
|
45865
|
-
if (!m2)
|
|
45866
|
-
return str.split(",");
|
|
45867
|
-
var pre = m2.pre;
|
|
45868
|
-
var body = m2.body;
|
|
45869
|
-
var post = m2.post;
|
|
45870
|
-
var p2 = pre.split(",");
|
|
45871
|
-
p2[p2.length - 1] += "{" + body + "}";
|
|
45872
|
-
var postParts = parseCommaParts(post);
|
|
45873
|
-
if (post.length) {
|
|
45874
|
-
p2[p2.length - 1] += postParts.shift();
|
|
45875
|
-
p2.push.apply(p2, postParts);
|
|
45876
|
-
}
|
|
45877
|
-
parts.push.apply(parts, p2);
|
|
45878
|
-
return parts;
|
|
45879
|
-
}
|
|
45880
|
-
function expandTop(str) {
|
|
45881
|
-
if (!str)
|
|
45882
|
-
return [];
|
|
45883
|
-
if (str.substr(0, 2) === "{}") {
|
|
45884
|
-
str = "\\{\\}" + str.substr(2);
|
|
45885
|
-
}
|
|
45886
|
-
return expand(escapeBraces(str), true).map(unescapeBraces);
|
|
45887
|
-
}
|
|
45888
|
-
function embrace(str) {
|
|
45889
|
-
return "{" + str + "}";
|
|
45890
|
-
}
|
|
45891
|
-
function isPadded(el) {
|
|
45892
|
-
return /^-?0\d/.test(el);
|
|
45893
|
-
}
|
|
45894
|
-
function lte(i, y3) {
|
|
45895
|
-
return i <= y3;
|
|
45896
|
-
}
|
|
45897
|
-
function gte(i, y3) {
|
|
45898
|
-
return i >= y3;
|
|
45899
|
-
}
|
|
45900
|
-
function expand(str, isTop) {
|
|
45901
|
-
var expansions = [];
|
|
45902
|
-
var m2 = balanced("{", "}", str);
|
|
45903
|
-
if (!m2 || /\$$/.test(m2.pre)) return [str];
|
|
45904
|
-
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m2.body);
|
|
45905
|
-
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m2.body);
|
|
45906
|
-
var isSequence = isNumericSequence || isAlphaSequence;
|
|
45907
|
-
var isOptions = m2.body.indexOf(",") >= 0;
|
|
45908
|
-
if (!isSequence && !isOptions) {
|
|
45909
|
-
if (m2.post.match(/,.*\}/)) {
|
|
45910
|
-
str = m2.pre + "{" + m2.body + escClose + m2.post;
|
|
45911
|
-
return expand(str);
|
|
45912
|
-
}
|
|
45913
|
-
return [str];
|
|
45914
|
-
}
|
|
45915
|
-
var n;
|
|
45916
|
-
if (isSequence) {
|
|
45917
|
-
n = m2.body.split(/\.\./);
|
|
45918
|
-
} else {
|
|
45919
|
-
n = parseCommaParts(m2.body);
|
|
45920
|
-
if (n.length === 1) {
|
|
45921
|
-
n = expand(n[0], false).map(embrace);
|
|
45922
|
-
if (n.length === 1) {
|
|
45923
|
-
var post = m2.post.length ? expand(m2.post, false) : [""];
|
|
45924
|
-
return post.map(function(p2) {
|
|
45925
|
-
return m2.pre + n[0] + p2;
|
|
45926
|
-
});
|
|
45927
|
-
}
|
|
45928
|
-
}
|
|
45929
|
-
}
|
|
45930
|
-
var pre = m2.pre;
|
|
45931
|
-
var post = m2.post.length ? expand(m2.post, false) : [""];
|
|
45932
|
-
var N2;
|
|
45933
|
-
if (isSequence) {
|
|
45934
|
-
var x3 = numeric(n[0]);
|
|
45935
|
-
var y3 = numeric(n[1]);
|
|
45936
|
-
var width = Math.max(n[0].length, n[1].length);
|
|
45937
|
-
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
45938
|
-
var test = lte;
|
|
45939
|
-
var reverse = y3 < x3;
|
|
45940
|
-
if (reverse) {
|
|
45941
|
-
incr *= -1;
|
|
45942
|
-
test = gte;
|
|
45943
|
-
}
|
|
45944
|
-
var pad = n.some(isPadded);
|
|
45945
|
-
N2 = [];
|
|
45946
|
-
for (var i = x3; test(i, y3); i += incr) {
|
|
45947
|
-
var c2;
|
|
45948
|
-
if (isAlphaSequence) {
|
|
45949
|
-
c2 = String.fromCharCode(i);
|
|
45950
|
-
if (c2 === "\\")
|
|
45951
|
-
c2 = "";
|
|
45952
|
-
} else {
|
|
45953
|
-
c2 = String(i);
|
|
45954
|
-
if (pad) {
|
|
45955
|
-
var need = width - c2.length;
|
|
45956
|
-
if (need > 0) {
|
|
45957
|
-
var z3 = new Array(need + 1).join("0");
|
|
45958
|
-
if (i < 0)
|
|
45959
|
-
c2 = "-" + z3 + c2.slice(1);
|
|
45960
|
-
else
|
|
45961
|
-
c2 = z3 + c2;
|
|
45962
|
-
}
|
|
45963
|
-
}
|
|
45964
|
-
}
|
|
45965
|
-
N2.push(c2);
|
|
45966
|
-
}
|
|
45967
|
-
} else {
|
|
45968
|
-
N2 = concatMap(n, function(el) {
|
|
45969
|
-
return expand(el, false);
|
|
45970
|
-
});
|
|
45971
|
-
}
|
|
45972
|
-
for (var j2 = 0; j2 < N2.length; j2++) {
|
|
45973
|
-
for (var k2 = 0; k2 < post.length; k2++) {
|
|
45974
|
-
var expansion = pre + N2[j2] + post[k2];
|
|
45975
|
-
if (!isTop || isSequence || expansion)
|
|
45976
|
-
expansions.push(expansion);
|
|
45977
|
-
}
|
|
45978
|
-
}
|
|
45979
|
-
return expansions;
|
|
45980
|
-
}
|
|
45981
|
-
}
|
|
45982
|
-
});
|
|
45983
|
-
|
|
45984
|
-
// node_modules/node-dir/node_modules/minimatch/minimatch.js
|
|
45985
|
-
var require_minimatch = __commonJS({
|
|
45986
|
-
"node_modules/node-dir/node_modules/minimatch/minimatch.js"(exports2, module2) {
|
|
45987
|
-
module2.exports = minimatch;
|
|
45988
|
-
minimatch.Minimatch = Minimatch;
|
|
45989
|
-
var path3 = function() {
|
|
45990
|
-
try {
|
|
45991
|
-
return require("path");
|
|
45992
|
-
} catch (e2) {
|
|
45993
|
-
}
|
|
45994
|
-
}() || {
|
|
45995
|
-
sep: "/"
|
|
45996
|
-
};
|
|
45997
|
-
minimatch.sep = path3.sep;
|
|
45998
|
-
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
|
|
45999
|
-
var expand = require_brace_expansion();
|
|
46000
|
-
var plTypes = {
|
|
46001
|
-
"!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
|
|
46002
|
-
"?": { open: "(?:", close: ")?" },
|
|
46003
|
-
"+": { open: "(?:", close: ")+" },
|
|
46004
|
-
"*": { open: "(?:", close: ")*" },
|
|
46005
|
-
"@": { open: "(?:", close: ")" }
|
|
46006
|
-
};
|
|
46007
|
-
var qmark = "[^/]";
|
|
46008
|
-
var star = qmark + "*?";
|
|
46009
|
-
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
46010
|
-
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
46011
|
-
var reSpecials = charSet("().*{}+?[]^$\\!");
|
|
46012
|
-
function charSet(s) {
|
|
46013
|
-
return s.split("").reduce(function(set, c2) {
|
|
46014
|
-
set[c2] = true;
|
|
46015
|
-
return set;
|
|
46016
|
-
}, {});
|
|
46017
|
-
}
|
|
46018
|
-
var slashSplit = /\/+/;
|
|
46019
|
-
minimatch.filter = filter;
|
|
46020
|
-
function filter(pattern, options) {
|
|
46021
|
-
options = options || {};
|
|
46022
|
-
return function(p2, i, list) {
|
|
46023
|
-
return minimatch(p2, pattern, options);
|
|
46024
|
-
};
|
|
46025
|
-
}
|
|
46026
|
-
function ext(a2, b3) {
|
|
46027
|
-
b3 = b3 || {};
|
|
46028
|
-
var t = {};
|
|
46029
|
-
Object.keys(a2).forEach(function(k2) {
|
|
46030
|
-
t[k2] = a2[k2];
|
|
46031
|
-
});
|
|
46032
|
-
Object.keys(b3).forEach(function(k2) {
|
|
46033
|
-
t[k2] = b3[k2];
|
|
46034
|
-
});
|
|
46035
|
-
return t;
|
|
46036
|
-
}
|
|
46037
|
-
minimatch.defaults = function(def) {
|
|
46038
|
-
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
46039
|
-
return minimatch;
|
|
46040
|
-
}
|
|
46041
|
-
var orig = minimatch;
|
|
46042
|
-
var m2 = function minimatch2(p2, pattern, options) {
|
|
46043
|
-
return orig(p2, pattern, ext(def, options));
|
|
46044
|
-
};
|
|
46045
|
-
m2.Minimatch = function Minimatch2(pattern, options) {
|
|
46046
|
-
return new orig.Minimatch(pattern, ext(def, options));
|
|
46047
|
-
};
|
|
46048
|
-
m2.Minimatch.defaults = function defaults(options) {
|
|
46049
|
-
return orig.defaults(ext(def, options)).Minimatch;
|
|
46050
|
-
};
|
|
46051
|
-
m2.filter = function filter2(pattern, options) {
|
|
46052
|
-
return orig.filter(pattern, ext(def, options));
|
|
46053
|
-
};
|
|
46054
|
-
m2.defaults = function defaults(options) {
|
|
46055
|
-
return orig.defaults(ext(def, options));
|
|
46056
|
-
};
|
|
46057
|
-
m2.makeRe = function makeRe2(pattern, options) {
|
|
46058
|
-
return orig.makeRe(pattern, ext(def, options));
|
|
46059
|
-
};
|
|
46060
|
-
m2.braceExpand = function braceExpand2(pattern, options) {
|
|
46061
|
-
return orig.braceExpand(pattern, ext(def, options));
|
|
46062
|
-
};
|
|
46063
|
-
m2.match = function(list, pattern, options) {
|
|
46064
|
-
return orig.match(list, pattern, ext(def, options));
|
|
46065
|
-
};
|
|
46066
|
-
return m2;
|
|
46067
|
-
};
|
|
46068
|
-
Minimatch.defaults = function(def) {
|
|
46069
|
-
return minimatch.defaults(def).Minimatch;
|
|
46070
|
-
};
|
|
46071
|
-
function minimatch(p2, pattern, options) {
|
|
46072
|
-
assertValidPattern(pattern);
|
|
46073
|
-
if (!options) options = {};
|
|
46074
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
46075
|
-
return false;
|
|
46076
|
-
}
|
|
46077
|
-
return new Minimatch(pattern, options).match(p2);
|
|
46078
|
-
}
|
|
46079
|
-
function Minimatch(pattern, options) {
|
|
46080
|
-
if (!(this instanceof Minimatch)) {
|
|
46081
|
-
return new Minimatch(pattern, options);
|
|
46082
|
-
}
|
|
46083
|
-
assertValidPattern(pattern);
|
|
46084
|
-
if (!options) options = {};
|
|
46085
|
-
pattern = pattern.trim();
|
|
46086
|
-
if (path3.sep !== "/") {
|
|
46087
|
-
pattern = pattern.split(path3.sep).join("/");
|
|
46088
|
-
}
|
|
46089
|
-
this.options = options;
|
|
46090
|
-
this.set = [];
|
|
46091
|
-
this.pattern = pattern;
|
|
46092
|
-
this.regexp = null;
|
|
46093
|
-
this.negate = false;
|
|
46094
|
-
this.comment = false;
|
|
46095
|
-
this.empty = false;
|
|
46096
|
-
this.partial = !!options.partial;
|
|
46097
|
-
this.make();
|
|
46098
|
-
}
|
|
46099
|
-
Minimatch.prototype.debug = function() {
|
|
46100
|
-
};
|
|
46101
|
-
Minimatch.prototype.make = make;
|
|
46102
|
-
function make() {
|
|
46103
|
-
var pattern = this.pattern;
|
|
46104
|
-
var options = this.options;
|
|
46105
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
46106
|
-
this.comment = true;
|
|
46107
|
-
return;
|
|
46108
|
-
}
|
|
46109
|
-
if (!pattern) {
|
|
46110
|
-
this.empty = true;
|
|
46111
|
-
return;
|
|
46112
|
-
}
|
|
46113
|
-
this.parseNegate();
|
|
46114
|
-
var set = this.globSet = this.braceExpand();
|
|
46115
|
-
if (options.debug) this.debug = function debug() {
|
|
46116
|
-
console.error.apply(console, arguments);
|
|
46117
|
-
};
|
|
46118
|
-
this.debug(this.pattern, set);
|
|
46119
|
-
set = this.globParts = set.map(function(s) {
|
|
46120
|
-
return s.split(slashSplit);
|
|
46121
|
-
});
|
|
46122
|
-
this.debug(this.pattern, set);
|
|
46123
|
-
set = set.map(function(s, si, set2) {
|
|
46124
|
-
return s.map(this.parse, this);
|
|
46125
|
-
}, this);
|
|
46126
|
-
this.debug(this.pattern, set);
|
|
46127
|
-
set = set.filter(function(s) {
|
|
46128
|
-
return s.indexOf(false) === -1;
|
|
46129
|
-
});
|
|
46130
|
-
this.debug(this.pattern, set);
|
|
46131
|
-
this.set = set;
|
|
46132
|
-
}
|
|
46133
|
-
Minimatch.prototype.parseNegate = parseNegate;
|
|
46134
|
-
function parseNegate() {
|
|
46135
|
-
var pattern = this.pattern;
|
|
46136
|
-
var negate = false;
|
|
46137
|
-
var options = this.options;
|
|
46138
|
-
var negateOffset = 0;
|
|
46139
|
-
if (options.nonegate) return;
|
|
46140
|
-
for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
|
|
46141
|
-
negate = !negate;
|
|
46142
|
-
negateOffset++;
|
|
46143
|
-
}
|
|
46144
|
-
if (negateOffset) this.pattern = pattern.substr(negateOffset);
|
|
46145
|
-
this.negate = negate;
|
|
46146
|
-
}
|
|
46147
|
-
minimatch.braceExpand = function(pattern, options) {
|
|
46148
|
-
return braceExpand(pattern, options);
|
|
46149
|
-
};
|
|
46150
|
-
Minimatch.prototype.braceExpand = braceExpand;
|
|
46151
|
-
function braceExpand(pattern, options) {
|
|
46152
|
-
if (!options) {
|
|
46153
|
-
if (this instanceof Minimatch) {
|
|
46154
|
-
options = this.options;
|
|
46155
|
-
} else {
|
|
46156
|
-
options = {};
|
|
46157
|
-
}
|
|
46158
|
-
}
|
|
46159
|
-
pattern = typeof pattern === "undefined" ? this.pattern : pattern;
|
|
46160
|
-
assertValidPattern(pattern);
|
|
46161
|
-
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
46162
|
-
return [pattern];
|
|
46163
|
-
}
|
|
46164
|
-
return expand(pattern);
|
|
46165
|
-
}
|
|
46166
|
-
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
46167
|
-
var assertValidPattern = function(pattern) {
|
|
46168
|
-
if (typeof pattern !== "string") {
|
|
46169
|
-
throw new TypeError("invalid pattern");
|
|
46170
|
-
}
|
|
46171
|
-
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
46172
|
-
throw new TypeError("pattern is too long");
|
|
46173
|
-
}
|
|
46174
|
-
};
|
|
46175
|
-
Minimatch.prototype.parse = parse;
|
|
46176
|
-
var SUBPARSE = {};
|
|
46177
|
-
function parse(pattern, isSub) {
|
|
46178
|
-
assertValidPattern(pattern);
|
|
46179
|
-
var options = this.options;
|
|
46180
|
-
if (pattern === "**") {
|
|
46181
|
-
if (!options.noglobstar)
|
|
46182
|
-
return GLOBSTAR;
|
|
46183
|
-
else
|
|
46184
|
-
pattern = "*";
|
|
46185
|
-
}
|
|
46186
|
-
if (pattern === "") return "";
|
|
46187
|
-
var re = "";
|
|
46188
|
-
var hasMagic = !!options.nocase;
|
|
46189
|
-
var escaping = false;
|
|
46190
|
-
var patternListStack = [];
|
|
46191
|
-
var negativeLists = [];
|
|
46192
|
-
var stateChar;
|
|
46193
|
-
var inClass = false;
|
|
46194
|
-
var reClassStart = -1;
|
|
46195
|
-
var classStart = -1;
|
|
46196
|
-
var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
|
46197
|
-
var self2 = this;
|
|
46198
|
-
function clearStateChar() {
|
|
46199
|
-
if (stateChar) {
|
|
46200
|
-
switch (stateChar) {
|
|
46201
|
-
case "*":
|
|
46202
|
-
re += star;
|
|
46203
|
-
hasMagic = true;
|
|
46204
|
-
break;
|
|
46205
|
-
case "?":
|
|
46206
|
-
re += qmark;
|
|
46207
|
-
hasMagic = true;
|
|
46208
|
-
break;
|
|
46209
|
-
default:
|
|
46210
|
-
re += "\\" + stateChar;
|
|
46211
|
-
break;
|
|
46212
|
-
}
|
|
46213
|
-
self2.debug("clearStateChar %j %j", stateChar, re);
|
|
46214
|
-
stateChar = false;
|
|
46215
|
-
}
|
|
46216
|
-
}
|
|
46217
|
-
for (var i = 0, len = pattern.length, c2; i < len && (c2 = pattern.charAt(i)); i++) {
|
|
46218
|
-
this.debug("%s %s %s %j", pattern, i, re, c2);
|
|
46219
|
-
if (escaping && reSpecials[c2]) {
|
|
46220
|
-
re += "\\" + c2;
|
|
46221
|
-
escaping = false;
|
|
46222
|
-
continue;
|
|
46223
|
-
}
|
|
46224
|
-
switch (c2) {
|
|
46225
|
-
case "/": {
|
|
46226
|
-
return false;
|
|
46227
|
-
}
|
|
46228
|
-
case "\\":
|
|
46229
|
-
clearStateChar();
|
|
46230
|
-
escaping = true;
|
|
46231
|
-
continue;
|
|
46232
|
-
case "?":
|
|
46233
|
-
case "*":
|
|
46234
|
-
case "+":
|
|
46235
|
-
case "@":
|
|
46236
|
-
case "!":
|
|
46237
|
-
this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c2);
|
|
46238
|
-
if (inClass) {
|
|
46239
|
-
this.debug(" in class");
|
|
46240
|
-
if (c2 === "!" && i === classStart + 1) c2 = "^";
|
|
46241
|
-
re += c2;
|
|
46242
|
-
continue;
|
|
46243
|
-
}
|
|
46244
|
-
self2.debug("call clearStateChar %j", stateChar);
|
|
46245
|
-
clearStateChar();
|
|
46246
|
-
stateChar = c2;
|
|
46247
|
-
if (options.noext) clearStateChar();
|
|
46248
|
-
continue;
|
|
46249
|
-
case "(":
|
|
46250
|
-
if (inClass) {
|
|
46251
|
-
re += "(";
|
|
46252
|
-
continue;
|
|
46253
|
-
}
|
|
46254
|
-
if (!stateChar) {
|
|
46255
|
-
re += "\\(";
|
|
46256
|
-
continue;
|
|
46257
|
-
}
|
|
46258
|
-
patternListStack.push({
|
|
46259
|
-
type: stateChar,
|
|
46260
|
-
start: i - 1,
|
|
46261
|
-
reStart: re.length,
|
|
46262
|
-
open: plTypes[stateChar].open,
|
|
46263
|
-
close: plTypes[stateChar].close
|
|
46264
|
-
});
|
|
46265
|
-
re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
|
|
46266
|
-
this.debug("plType %j %j", stateChar, re);
|
|
46267
|
-
stateChar = false;
|
|
46268
|
-
continue;
|
|
46269
|
-
case ")":
|
|
46270
|
-
if (inClass || !patternListStack.length) {
|
|
46271
|
-
re += "\\)";
|
|
46272
|
-
continue;
|
|
46273
|
-
}
|
|
46274
|
-
clearStateChar();
|
|
46275
|
-
hasMagic = true;
|
|
46276
|
-
var pl = patternListStack.pop();
|
|
46277
|
-
re += pl.close;
|
|
46278
|
-
if (pl.type === "!") {
|
|
46279
|
-
negativeLists.push(pl);
|
|
46280
|
-
}
|
|
46281
|
-
pl.reEnd = re.length;
|
|
46282
|
-
continue;
|
|
46283
|
-
case "|":
|
|
46284
|
-
if (inClass || !patternListStack.length || escaping) {
|
|
46285
|
-
re += "\\|";
|
|
46286
|
-
escaping = false;
|
|
46287
|
-
continue;
|
|
46288
|
-
}
|
|
46289
|
-
clearStateChar();
|
|
46290
|
-
re += "|";
|
|
46291
|
-
continue;
|
|
46292
|
-
case "[":
|
|
46293
|
-
clearStateChar();
|
|
46294
|
-
if (inClass) {
|
|
46295
|
-
re += "\\" + c2;
|
|
46296
|
-
continue;
|
|
46297
|
-
}
|
|
46298
|
-
inClass = true;
|
|
46299
|
-
classStart = i;
|
|
46300
|
-
reClassStart = re.length;
|
|
46301
|
-
re += c2;
|
|
46302
|
-
continue;
|
|
46303
|
-
case "]":
|
|
46304
|
-
if (i === classStart + 1 || !inClass) {
|
|
46305
|
-
re += "\\" + c2;
|
|
46306
|
-
escaping = false;
|
|
46307
|
-
continue;
|
|
46308
|
-
}
|
|
46309
|
-
var cs = pattern.substring(classStart + 1, i);
|
|
46310
|
-
try {
|
|
46311
|
-
RegExp("[" + cs + "]");
|
|
46312
|
-
} catch (er) {
|
|
46313
|
-
var sp = this.parse(cs, SUBPARSE);
|
|
46314
|
-
re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
|
|
46315
|
-
hasMagic = hasMagic || sp[1];
|
|
46316
|
-
inClass = false;
|
|
46317
|
-
continue;
|
|
46318
|
-
}
|
|
46319
|
-
hasMagic = true;
|
|
46320
|
-
inClass = false;
|
|
46321
|
-
re += c2;
|
|
46322
|
-
continue;
|
|
46323
|
-
default:
|
|
46324
|
-
clearStateChar();
|
|
46325
|
-
if (escaping) {
|
|
46326
|
-
escaping = false;
|
|
46327
|
-
} else if (reSpecials[c2] && !(c2 === "^" && inClass)) {
|
|
46328
|
-
re += "\\";
|
|
46329
|
-
}
|
|
46330
|
-
re += c2;
|
|
46331
|
-
}
|
|
46332
|
-
}
|
|
46333
|
-
if (inClass) {
|
|
46334
|
-
cs = pattern.substr(classStart + 1);
|
|
46335
|
-
sp = this.parse(cs, SUBPARSE);
|
|
46336
|
-
re = re.substr(0, reClassStart) + "\\[" + sp[0];
|
|
46337
|
-
hasMagic = hasMagic || sp[1];
|
|
46338
|
-
}
|
|
46339
|
-
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
|
|
46340
|
-
var tail = re.slice(pl.reStart + pl.open.length);
|
|
46341
|
-
this.debug("setting tail", re, pl);
|
|
46342
|
-
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_3, $1, $2) {
|
|
46343
|
-
if (!$2) {
|
|
46344
|
-
$2 = "\\";
|
|
46345
|
-
}
|
|
46346
|
-
return $1 + $1 + $2 + "|";
|
|
46347
|
-
});
|
|
46348
|
-
this.debug("tail=%j\n %s", tail, tail, pl, re);
|
|
46349
|
-
var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
|
|
46350
|
-
hasMagic = true;
|
|
46351
|
-
re = re.slice(0, pl.reStart) + t + "\\(" + tail;
|
|
46352
|
-
}
|
|
46353
|
-
clearStateChar();
|
|
46354
|
-
if (escaping) {
|
|
46355
|
-
re += "\\\\";
|
|
46356
|
-
}
|
|
46357
|
-
var addPatternStart = false;
|
|
46358
|
-
switch (re.charAt(0)) {
|
|
46359
|
-
case "[":
|
|
46360
|
-
case ".":
|
|
46361
|
-
case "(":
|
|
46362
|
-
addPatternStart = true;
|
|
46363
|
-
}
|
|
46364
|
-
for (var n = negativeLists.length - 1; n > -1; n--) {
|
|
46365
|
-
var nl = negativeLists[n];
|
|
46366
|
-
var nlBefore = re.slice(0, nl.reStart);
|
|
46367
|
-
var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
|
|
46368
|
-
var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
|
|
46369
|
-
var nlAfter = re.slice(nl.reEnd);
|
|
46370
|
-
nlLast += nlAfter;
|
|
46371
|
-
var openParensBefore = nlBefore.split("(").length - 1;
|
|
46372
|
-
var cleanAfter = nlAfter;
|
|
46373
|
-
for (i = 0; i < openParensBefore; i++) {
|
|
46374
|
-
cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
|
|
46375
|
-
}
|
|
46376
|
-
nlAfter = cleanAfter;
|
|
46377
|
-
var dollar = "";
|
|
46378
|
-
if (nlAfter === "" && isSub !== SUBPARSE) {
|
|
46379
|
-
dollar = "$";
|
|
46380
|
-
}
|
|
46381
|
-
var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
|
|
46382
|
-
re = newRe;
|
|
46383
|
-
}
|
|
46384
|
-
if (re !== "" && hasMagic) {
|
|
46385
|
-
re = "(?=.)" + re;
|
|
46386
|
-
}
|
|
46387
|
-
if (addPatternStart) {
|
|
46388
|
-
re = patternStart + re;
|
|
46389
|
-
}
|
|
46390
|
-
if (isSub === SUBPARSE) {
|
|
46391
|
-
return [re, hasMagic];
|
|
46392
|
-
}
|
|
46393
|
-
if (!hasMagic) {
|
|
46394
|
-
return globUnescape(pattern);
|
|
46395
|
-
}
|
|
46396
|
-
var flags = options.nocase ? "i" : "";
|
|
46397
|
-
try {
|
|
46398
|
-
var regExp = new RegExp("^" + re + "$", flags);
|
|
46399
|
-
} catch (er) {
|
|
46400
|
-
return new RegExp("$.");
|
|
46401
|
-
}
|
|
46402
|
-
regExp._glob = pattern;
|
|
46403
|
-
regExp._src = re;
|
|
46404
|
-
return regExp;
|
|
46405
|
-
}
|
|
46406
|
-
minimatch.makeRe = function(pattern, options) {
|
|
46407
|
-
return new Minimatch(pattern, options || {}).makeRe();
|
|
46408
|
-
};
|
|
46409
|
-
Minimatch.prototype.makeRe = makeRe;
|
|
46410
|
-
function makeRe() {
|
|
46411
|
-
if (this.regexp || this.regexp === false) return this.regexp;
|
|
46412
|
-
var set = this.set;
|
|
46413
|
-
if (!set.length) {
|
|
46414
|
-
this.regexp = false;
|
|
46415
|
-
return this.regexp;
|
|
46416
|
-
}
|
|
46417
|
-
var options = this.options;
|
|
46418
|
-
var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
|
46419
|
-
var flags = options.nocase ? "i" : "";
|
|
46420
|
-
var re = set.map(function(pattern) {
|
|
46421
|
-
return pattern.map(function(p2) {
|
|
46422
|
-
return p2 === GLOBSTAR ? twoStar : typeof p2 === "string" ? regExpEscape(p2) : p2._src;
|
|
46423
|
-
}).join("\\/");
|
|
46424
|
-
}).join("|");
|
|
46425
|
-
re = "^(?:" + re + ")$";
|
|
46426
|
-
if (this.negate) re = "^(?!" + re + ").*$";
|
|
46427
|
-
try {
|
|
46428
|
-
this.regexp = new RegExp(re, flags);
|
|
46429
|
-
} catch (ex) {
|
|
46430
|
-
this.regexp = false;
|
|
46431
|
-
}
|
|
46432
|
-
return this.regexp;
|
|
46433
|
-
}
|
|
46434
|
-
minimatch.match = function(list, pattern, options) {
|
|
46435
|
-
options = options || {};
|
|
46436
|
-
var mm = new Minimatch(pattern, options);
|
|
46437
|
-
list = list.filter(function(f3) {
|
|
46438
|
-
return mm.match(f3);
|
|
46439
|
-
});
|
|
46440
|
-
if (mm.options.nonull && !list.length) {
|
|
46441
|
-
list.push(pattern);
|
|
46442
|
-
}
|
|
46443
|
-
return list;
|
|
46444
|
-
};
|
|
46445
|
-
Minimatch.prototype.match = function match(f3, partial) {
|
|
46446
|
-
if (typeof partial === "undefined") partial = this.partial;
|
|
46447
|
-
this.debug("match", f3, this.pattern);
|
|
46448
|
-
if (this.comment) return false;
|
|
46449
|
-
if (this.empty) return f3 === "";
|
|
46450
|
-
if (f3 === "/" && partial) return true;
|
|
46451
|
-
var options = this.options;
|
|
46452
|
-
if (path3.sep !== "/") {
|
|
46453
|
-
f3 = f3.split(path3.sep).join("/");
|
|
46454
|
-
}
|
|
46455
|
-
f3 = f3.split(slashSplit);
|
|
46456
|
-
this.debug(this.pattern, "split", f3);
|
|
46457
|
-
var set = this.set;
|
|
46458
|
-
this.debug(this.pattern, "set", set);
|
|
46459
|
-
var filename;
|
|
46460
|
-
var i;
|
|
46461
|
-
for (i = f3.length - 1; i >= 0; i--) {
|
|
46462
|
-
filename = f3[i];
|
|
46463
|
-
if (filename) break;
|
|
46464
|
-
}
|
|
46465
|
-
for (i = 0; i < set.length; i++) {
|
|
46466
|
-
var pattern = set[i];
|
|
46467
|
-
var file = f3;
|
|
46468
|
-
if (options.matchBase && pattern.length === 1) {
|
|
46469
|
-
file = [filename];
|
|
46470
|
-
}
|
|
46471
|
-
var hit = this.matchOne(file, pattern, partial);
|
|
46472
|
-
if (hit) {
|
|
46473
|
-
if (options.flipNegate) return true;
|
|
46474
|
-
return !this.negate;
|
|
46475
|
-
}
|
|
46476
|
-
}
|
|
46477
|
-
if (options.flipNegate) return false;
|
|
46478
|
-
return this.negate;
|
|
46479
|
-
};
|
|
46480
|
-
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
|
46481
|
-
var options = this.options;
|
|
46482
|
-
this.debug(
|
|
46483
|
-
"matchOne",
|
|
46484
|
-
{ "this": this, file, pattern }
|
|
46485
|
-
);
|
|
46486
|
-
this.debug("matchOne", file.length, pattern.length);
|
|
46487
|
-
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
46488
|
-
this.debug("matchOne loop");
|
|
46489
|
-
var p2 = pattern[pi];
|
|
46490
|
-
var f3 = file[fi];
|
|
46491
|
-
this.debug(pattern, p2, f3);
|
|
46492
|
-
if (p2 === false) return false;
|
|
46493
|
-
if (p2 === GLOBSTAR) {
|
|
46494
|
-
this.debug("GLOBSTAR", [pattern, p2, f3]);
|
|
46495
|
-
var fr = fi;
|
|
46496
|
-
var pr = pi + 1;
|
|
46497
|
-
if (pr === pl) {
|
|
46498
|
-
this.debug("** at the end");
|
|
46499
|
-
for (; fi < fl; fi++) {
|
|
46500
|
-
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false;
|
|
46501
|
-
}
|
|
46502
|
-
return true;
|
|
46503
|
-
}
|
|
46504
|
-
while (fr < fl) {
|
|
46505
|
-
var swallowee = file[fr];
|
|
46506
|
-
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
46507
|
-
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
46508
|
-
this.debug("globstar found match!", fr, fl, swallowee);
|
|
46509
|
-
return true;
|
|
46510
|
-
} else {
|
|
46511
|
-
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
46512
|
-
this.debug("dot detected!", file, fr, pattern, pr);
|
|
46513
|
-
break;
|
|
46514
|
-
}
|
|
46515
|
-
this.debug("globstar swallow a segment, and continue");
|
|
46516
|
-
fr++;
|
|
46517
|
-
}
|
|
46518
|
-
}
|
|
46519
|
-
if (partial) {
|
|
46520
|
-
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
46521
|
-
if (fr === fl) return true;
|
|
46522
|
-
}
|
|
46523
|
-
return false;
|
|
46524
|
-
}
|
|
46525
|
-
var hit;
|
|
46526
|
-
if (typeof p2 === "string") {
|
|
46527
|
-
hit = f3 === p2;
|
|
46528
|
-
this.debug("string match", p2, f3, hit);
|
|
46529
|
-
} else {
|
|
46530
|
-
hit = f3.match(p2);
|
|
46531
|
-
this.debug("pattern match", p2, f3, hit);
|
|
46532
|
-
}
|
|
46533
|
-
if (!hit) return false;
|
|
46534
|
-
}
|
|
46535
|
-
if (fi === fl && pi === pl) {
|
|
46536
|
-
return true;
|
|
46537
|
-
} else if (fi === fl) {
|
|
46538
|
-
return partial;
|
|
46539
|
-
} else if (pi === pl) {
|
|
46540
|
-
return fi === fl - 1 && file[fi] === "";
|
|
46541
|
-
}
|
|
46542
|
-
throw new Error("wtf?");
|
|
46543
|
-
};
|
|
46544
|
-
function globUnescape(s) {
|
|
46545
|
-
return s.replace(/\\(.)/g, "$1");
|
|
46546
|
-
}
|
|
46547
|
-
function regExpEscape(s) {
|
|
46548
|
-
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
46549
|
-
}
|
|
46550
|
-
}
|
|
46551
|
-
});
|
|
46552
|
-
|
|
46553
|
-
// node_modules/node-dir/lib/readfilesstream.js
|
|
46554
|
-
var require_readfilesstream = __commonJS({
|
|
46555
|
-
"node_modules/node-dir/lib/readfilesstream.js"(exports2, module2) {
|
|
46556
|
-
var fs6 = require("fs");
|
|
46557
|
-
var mm = require_minimatch();
|
|
46558
|
-
var path3 = require("path");
|
|
46559
|
-
function extend(target, source, modify) {
|
|
46560
|
-
var result = target ? modify ? target : extend({}, target, true) : {};
|
|
46561
|
-
if (!source) return result;
|
|
46562
|
-
for (var key2 in source) {
|
|
46563
|
-
if (source.hasOwnProperty(key2) && source[key2] !== void 0) {
|
|
46564
|
-
result[key2] = source[key2];
|
|
46565
|
-
}
|
|
46566
|
-
}
|
|
46567
|
-
return result;
|
|
46568
|
-
}
|
|
46569
|
-
function matches(str, match) {
|
|
46570
|
-
if (Array.isArray(match)) {
|
|
46571
|
-
var l = match.length;
|
|
46572
|
-
for (var s = 0; s < l; s++) {
|
|
46573
|
-
if (mm(str, match[s])) {
|
|
46574
|
-
return true;
|
|
46575
|
-
}
|
|
46576
|
-
}
|
|
46577
|
-
return false;
|
|
46578
|
-
}
|
|
46579
|
-
return match.test(str);
|
|
46580
|
-
}
|
|
46581
|
-
function readFilesStream(dir, options, callback, complete) {
|
|
46582
|
-
if (typeof options === "function") {
|
|
46583
|
-
complete = callback;
|
|
46584
|
-
callback = options;
|
|
46585
|
-
options = {};
|
|
46586
|
-
}
|
|
46587
|
-
if (typeof options === "string") options = {
|
|
46588
|
-
encoding: options
|
|
46589
|
-
};
|
|
46590
|
-
options = extend({
|
|
46591
|
-
recursive: true,
|
|
46592
|
-
encoding: "utf8",
|
|
46593
|
-
doneOnErr: true
|
|
46594
|
-
}, options);
|
|
46595
|
-
var files = [];
|
|
46596
|
-
var done = function(err) {
|
|
46597
|
-
if (typeof complete === "function") {
|
|
46598
|
-
if (err) return complete(err);
|
|
46599
|
-
complete(null, files);
|
|
46600
|
-
}
|
|
46601
|
-
};
|
|
46602
|
-
fs6.readdir(dir, function(err, list) {
|
|
46603
|
-
if (err) {
|
|
46604
|
-
if (options.doneOnErr === true) {
|
|
46605
|
-
if (err.code === "EACCES") return done();
|
|
46606
|
-
return done(err);
|
|
46607
|
-
}
|
|
46608
|
-
}
|
|
46609
|
-
var i = 0;
|
|
46610
|
-
if (options.reverse === true || typeof options.sort == "string" && /reverse|desc/i.test(options.sort)) {
|
|
46611
|
-
list = list.reverse();
|
|
46612
|
-
} else if (options.sort !== false) list = list.sort();
|
|
46613
|
-
(function next() {
|
|
46614
|
-
var filename = list[i++];
|
|
46615
|
-
if (!filename) return done(null, files);
|
|
46616
|
-
var file = path3.join(dir, filename);
|
|
46617
|
-
fs6.stat(file, function(err2, stat) {
|
|
46618
|
-
if (err2 && options.doneOnErr === true) return done(err2);
|
|
46619
|
-
if (stat && stat.isDirectory()) {
|
|
46620
|
-
if (options.recursive) {
|
|
46621
|
-
if (options.matchDir && !matches(filename, options.matchDir)) return next();
|
|
46622
|
-
if (options.excludeDir && matches(filename, options.excludeDir)) return next();
|
|
46623
|
-
readFilesStream(file, options, callback, function(err3, sfiles) {
|
|
46624
|
-
if (err3 && options.doneOnErr === true) return done(err3);
|
|
46625
|
-
files = files.concat(sfiles);
|
|
46626
|
-
next();
|
|
46627
|
-
});
|
|
46628
|
-
} else next();
|
|
46629
|
-
} else if (stat && stat.isFile()) {
|
|
46630
|
-
if (options.match && !matches(filename, options.match)) return next();
|
|
46631
|
-
if (options.exclude && matches(filename, options.exclude)) return next();
|
|
46632
|
-
if (options.filter && !options.filter(filename)) return next();
|
|
46633
|
-
if (options.shortName) files.push(filename);
|
|
46634
|
-
else files.push(file);
|
|
46635
|
-
var stream = fs6.createReadStream(file);
|
|
46636
|
-
if (options.encoding !== null) {
|
|
46637
|
-
stream.setEncoding(options.encoding);
|
|
46638
|
-
}
|
|
46639
|
-
stream.on("error", function(err3) {
|
|
46640
|
-
if (options.doneOnErr === true) return done(err3);
|
|
46641
|
-
next();
|
|
46642
|
-
});
|
|
46643
|
-
if (callback.length > 3)
|
|
46644
|
-
if (options.shortName) callback(null, stream, filename, next);
|
|
46645
|
-
else callback(null, stream, file, next);
|
|
46646
|
-
else callback(null, stream, next);
|
|
46647
|
-
} else {
|
|
46648
|
-
next();
|
|
46649
|
-
}
|
|
46650
|
-
});
|
|
46651
|
-
})();
|
|
46652
|
-
});
|
|
46653
|
-
}
|
|
46654
|
-
module2.exports = readFilesStream;
|
|
46655
|
-
}
|
|
46656
|
-
});
|
|
46657
|
-
|
|
46658
|
-
// node_modules/node-dir/index.js
|
|
46659
|
-
var require_node_dir = __commonJS({
|
|
46660
|
-
"node_modules/node-dir/index.js"(exports2) {
|
|
46661
|
-
var dirpaths = require_paths();
|
|
46662
|
-
Object.assign(exports2, dirpaths);
|
|
46663
|
-
exports2.readFiles = require_readfiles();
|
|
46664
|
-
exports2.readFilesStream = require_readfilesstream();
|
|
46665
|
-
}
|
|
46666
|
-
});
|
|
46667
|
-
|
|
46668
45506
|
// node_modules/p-try/index.js
|
|
46669
45507
|
var require_p_try = __commonJS({
|
|
46670
45508
|
"node_modules/p-try/index.js"(exports2, module2) {
|
|
@@ -54442,7 +53280,7 @@ var require_async2 = __commonJS({
|
|
|
54442
53280
|
readdirWithFileTypes(directory, settings, callback);
|
|
54443
53281
|
return;
|
|
54444
53282
|
}
|
|
54445
|
-
|
|
53283
|
+
readdir2(directory, settings, callback);
|
|
54446
53284
|
}
|
|
54447
53285
|
exports2.read = read;
|
|
54448
53286
|
function readdirWithFileTypes(directory, settings, callback) {
|
|
@@ -54491,7 +53329,7 @@ var require_async2 = __commonJS({
|
|
|
54491
53329
|
});
|
|
54492
53330
|
};
|
|
54493
53331
|
}
|
|
54494
|
-
function
|
|
53332
|
+
function readdir2(directory, settings, callback) {
|
|
54495
53333
|
settings.fs.readdir(directory, (readdirError, names) => {
|
|
54496
53334
|
if (readdirError !== null) {
|
|
54497
53335
|
callFailureCallback(callback, readdirError);
|
|
@@ -54526,7 +53364,7 @@ var require_async2 = __commonJS({
|
|
|
54526
53364
|
});
|
|
54527
53365
|
});
|
|
54528
53366
|
}
|
|
54529
|
-
exports2.readdir =
|
|
53367
|
+
exports2.readdir = readdir2;
|
|
54530
53368
|
function callFailureCallback(callback, error) {
|
|
54531
53369
|
callback(error);
|
|
54532
53370
|
}
|
|
@@ -54550,7 +53388,7 @@ var require_sync2 = __commonJS({
|
|
|
54550
53388
|
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
54551
53389
|
return readdirWithFileTypes(directory, settings);
|
|
54552
53390
|
}
|
|
54553
|
-
return
|
|
53391
|
+
return readdir2(directory, settings);
|
|
54554
53392
|
}
|
|
54555
53393
|
exports2.read = read;
|
|
54556
53394
|
function readdirWithFileTypes(directory, settings) {
|
|
@@ -54575,7 +53413,7 @@ var require_sync2 = __commonJS({
|
|
|
54575
53413
|
});
|
|
54576
53414
|
}
|
|
54577
53415
|
exports2.readdirWithFileTypes = readdirWithFileTypes;
|
|
54578
|
-
function
|
|
53416
|
+
function readdir2(directory, settings) {
|
|
54579
53417
|
const names = settings.fs.readdirSync(directory);
|
|
54580
53418
|
return names.map((name) => {
|
|
54581
53419
|
const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
@@ -54591,7 +53429,7 @@ var require_sync2 = __commonJS({
|
|
|
54591
53429
|
return entry;
|
|
54592
53430
|
});
|
|
54593
53431
|
}
|
|
54594
|
-
exports2.readdir =
|
|
53432
|
+
exports2.readdir = readdir2;
|
|
54595
53433
|
}
|
|
54596
53434
|
});
|
|
54597
53435
|
|
|
@@ -81713,9 +80551,9 @@ var require_graceful_fs2 = __commonJS({
|
|
|
81713
80551
|
}
|
|
81714
80552
|
}
|
|
81715
80553
|
var fs$readdir = fs7.readdir;
|
|
81716
|
-
fs7.readdir =
|
|
80554
|
+
fs7.readdir = readdir2;
|
|
81717
80555
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
81718
|
-
function
|
|
80556
|
+
function readdir2(path3, options, cb) {
|
|
81719
80557
|
if (typeof options === "function")
|
|
81720
80558
|
cb = options, options = null;
|
|
81721
80559
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path4, options2, cb2, startTime) {
|
|
@@ -87381,7 +86219,7 @@ var {
|
|
|
87381
86219
|
// package.json
|
|
87382
86220
|
var package_default = {
|
|
87383
86221
|
name: "@capgo/cli",
|
|
87384
|
-
version: "4.12.
|
|
86222
|
+
version: "4.12.3-beta.0",
|
|
87385
86223
|
description: "A CLI to upload to capgo servers",
|
|
87386
86224
|
author: "github.com/riderx",
|
|
87387
86225
|
license: "Apache 2.0",
|
|
@@ -87442,7 +86280,6 @@ var package_default = {
|
|
|
87442
86280
|
ky: "^1.3.0",
|
|
87443
86281
|
logsnag: "1.0.0",
|
|
87444
86282
|
mime: "^4.0.3",
|
|
87445
|
-
"node-dir": "^0.1.17",
|
|
87446
86283
|
open: "^10.1.0",
|
|
87447
86284
|
prettyjson: "^1.2.5",
|
|
87448
86285
|
semver: "^7.6.2",
|
|
@@ -87453,7 +86290,6 @@ var package_default = {
|
|
|
87453
86290
|
"@types/adm-zip": "0.5.5",
|
|
87454
86291
|
"@types/mime": "^4.0.0",
|
|
87455
86292
|
"@types/node": "^20.14.7",
|
|
87456
|
-
"@types/node-dir": "^0.0.37",
|
|
87457
86293
|
"@types/npmcli__ci-detect": "^2.0.3",
|
|
87458
86294
|
"@types/prettyjson": "^0.0.33",
|
|
87459
86295
|
"@types/prompt-sync": "^4.2.3",
|
|
@@ -88504,7 +87340,6 @@ var ky = createInstance();
|
|
|
88504
87340
|
var distribution_default = ky;
|
|
88505
87341
|
|
|
88506
87342
|
// src/utils.ts
|
|
88507
|
-
var import_node_dir = __toESM(require_node_dir());
|
|
88508
87343
|
var import_find_root = __toESM(require_manypkg_find_root_cjs());
|
|
88509
87344
|
|
|
88510
87345
|
// node_modules/@capgo/find-package-manager/main.js
|
|
@@ -89127,15 +87962,28 @@ function getPMAndCommand() {
|
|
|
89127
87962
|
pmRunner = findPackageManagerRunner(dir.rootDir);
|
|
89128
87963
|
return { pm, command: pmCommand, installCommand: `${pm} ${pmCommand}`, runner: pmRunner };
|
|
89129
87964
|
}
|
|
87965
|
+
function readDirRecursively(dir) {
|
|
87966
|
+
const entries = (0, import_node_fs4.readdirSync)(dir, { withFileTypes: true });
|
|
87967
|
+
const files = entries.flatMap((entry) => {
|
|
87968
|
+
const fullPath = (0, import_node_path2.join)(dir, entry.name);
|
|
87969
|
+
if (entry.isDirectory()) {
|
|
87970
|
+
return readDirRecursively(fullPath);
|
|
87971
|
+
} else {
|
|
87972
|
+
return fullPath.split(`node_modules${import_node_path2.sep}`)[1] || fullPath;
|
|
87973
|
+
}
|
|
87974
|
+
});
|
|
87975
|
+
return files;
|
|
87976
|
+
}
|
|
89130
87977
|
async function getLocalDepenencies() {
|
|
89131
87978
|
const dir = (0, import_find_root.findRootSync)(import_node_process8.default.cwd());
|
|
89132
|
-
|
|
87979
|
+
const packageJsonPath = (0, import_node_path2.join)(import_node_process8.default.cwd(), "package.json");
|
|
87980
|
+
if (!(0, import_node_fs4.existsSync)(packageJsonPath)) {
|
|
89133
87981
|
f2.error("Missing package.json, you need to be in a capacitor project");
|
|
89134
87982
|
program.error("");
|
|
89135
87983
|
}
|
|
89136
87984
|
let packageJson;
|
|
89137
87985
|
try {
|
|
89138
|
-
packageJson = JSON.parse((0, import_node_fs4.readFileSync)(
|
|
87986
|
+
packageJson = JSON.parse((0, import_node_fs4.readFileSync)(packageJsonPath, "utf8"));
|
|
89139
87987
|
} catch (err) {
|
|
89140
87988
|
f2.error("Invalid package.json, JSON parsing failed");
|
|
89141
87989
|
console.error("json parse error: ", err);
|
|
@@ -89152,7 +88000,8 @@ async function getLocalDepenencies() {
|
|
|
89152
88000
|
program.error("");
|
|
89153
88001
|
}
|
|
89154
88002
|
}
|
|
89155
|
-
|
|
88003
|
+
const nodeModulesPath = (0, import_node_path2.join)(import_node_process8.default.cwd(), "node_modules");
|
|
88004
|
+
if (!(0, import_node_fs4.existsSync)(nodeModulesPath)) {
|
|
89156
88005
|
const pm2 = findPackageManagerType(dir.rootDir, "npm");
|
|
89157
88006
|
const installCmd = findInstallCommand(pm2);
|
|
89158
88007
|
f2.error(`Missing node_modules folder, please run ${pm2} ${installCmd}`);
|
|
@@ -89160,7 +88009,8 @@ async function getLocalDepenencies() {
|
|
|
89160
88009
|
}
|
|
89161
88010
|
let anyInvalid = false;
|
|
89162
88011
|
const dependenciesObject = await Promise.all(Object.entries(dependencies).map(async ([key2, value]) => {
|
|
89163
|
-
const
|
|
88012
|
+
const dependencyFolderPath = (0, import_node_path2.join)(nodeModulesPath, key2);
|
|
88013
|
+
const dependencyFolderExists = (0, import_node_fs4.existsSync)(dependencyFolderPath);
|
|
89164
88014
|
if (!dependencyFolderExists) {
|
|
89165
88015
|
anyInvalid = true;
|
|
89166
88016
|
const pm2 = findPackageManagerType(dir.rootDir, "npm");
|
|
@@ -89169,14 +88019,14 @@ async function getLocalDepenencies() {
|
|
|
89169
88019
|
return { name: key2, version: value };
|
|
89170
88020
|
}
|
|
89171
88021
|
let hasNativeFiles = false;
|
|
89172
|
-
|
|
89173
|
-
|
|
89174
|
-
|
|
89175
|
-
}
|
|
89176
|
-
f2.error(`Error reading
|
|
88022
|
+
try {
|
|
88023
|
+
const files = readDirRecursively(dependencyFolderPath);
|
|
88024
|
+
hasNativeFiles = files.some((fileName) => nativeFileRegex.test(fileName));
|
|
88025
|
+
} catch (error) {
|
|
88026
|
+
f2.error(`Error reading node_modules files for ${key2} package`);
|
|
89177
88027
|
console.error(error);
|
|
89178
88028
|
program.error("");
|
|
89179
|
-
}
|
|
88029
|
+
}
|
|
89180
88030
|
return {
|
|
89181
88031
|
name: key2,
|
|
89182
88032
|
version: value,
|
|
@@ -90225,8 +89075,8 @@ async function uploadBundleToCapgoCloud(supabase, appid, bundle2, orgId, zipped,
|
|
|
90225
89075
|
const uploadTime = ((endTime - startTime) / 1e3).toFixed(2);
|
|
90226
89076
|
spinner.stop(`Bundle Uploaded \u{1F4AA} (${uploadTime} seconds)`);
|
|
90227
89077
|
}
|
|
90228
|
-
async function setVersionInChannel(supabase,
|
|
90229
|
-
const { data: versionId } = await supabase.rpc("get_app_versions", { apikey
|
|
89078
|
+
async function setVersionInChannel(supabase, apikey, displayBundleUrl, bundle2, channel2, userId, orgId, appid, localConfig, permissions) {
|
|
89079
|
+
const { data: versionId } = await supabase.rpc("get_app_versions", { apikey, name_version: bundle2, appid }).single();
|
|
90230
89080
|
if (versionId && hasOrganizationPerm(permissions, 3 /* write */)) {
|
|
90231
89081
|
const { error: dbError3, data } = await updateOrCreateChannel(supabase, {
|
|
90232
89082
|
name: channel2,
|
|
@@ -90245,7 +89095,7 @@ async function setVersionInChannel(supabase, options, bundle2, channel2, userId,
|
|
|
90245
89095
|
f2.info("Your update is now available in your public channel \u{1F389}");
|
|
90246
89096
|
else if (data?.id)
|
|
90247
89097
|
f2.info(`Link device to this bundle to try it: ${bundleUrl}`);
|
|
90248
|
-
if (
|
|
89098
|
+
if (displayBundleUrl) {
|
|
90249
89099
|
f2.info(`Bundle url: ${bundleUrl}`);
|
|
90250
89100
|
} else if (!versionId) {
|
|
90251
89101
|
f2.warn("Cannot set bundle with upload key, use key with more rights for that");
|
|
@@ -90285,7 +89135,7 @@ async function uploadBundle(preAppid, options, shouldExit = true) {
|
|
|
90285
89135
|
const userId = await verifyUser(supabase, apikey, ["write", "all", "upload"]);
|
|
90286
89136
|
const permissions = await checkAppExistsAndHasPermissionOrgErr(supabase, apikey, appid, 2 /* upload */);
|
|
90287
89137
|
const orgId = await getOrganizationId(supabase, appid);
|
|
90288
|
-
await checkPlanValid(supabase, orgId,
|
|
89138
|
+
await checkPlanValid(supabase, orgId, apikey, appid, true);
|
|
90289
89139
|
await checkTrial(supabase, orgId, localConfig);
|
|
90290
89140
|
const { nativePackages, minUpdateVersion } = await verifyCompatibility(supabase, pm2, options, channel2, appid, bundle2);
|
|
90291
89141
|
await checkVersionExists(supabase, appid, bundle2);
|
|
@@ -90330,7 +89180,7 @@ async function uploadBundle(preAppid, options, shouldExit = true) {
|
|
|
90330
89180
|
program.error("");
|
|
90331
89181
|
}
|
|
90332
89182
|
}
|
|
90333
|
-
await setVersionInChannel(supabase, options, bundle2, channel2, userId, orgId, appid, localConfig, permissions);
|
|
89183
|
+
await setVersionInChannel(supabase, apikey, !!options.bundleUrl, bundle2, channel2, userId, orgId, appid, localConfig, permissions);
|
|
90334
89184
|
await snag.track({
|
|
90335
89185
|
channel: "app",
|
|
90336
89186
|
event: "App Uploaded",
|
|
@@ -90347,19 +89197,19 @@ async function uploadBundle(preAppid, options, shouldExit = true) {
|
|
|
90347
89197
|
}
|
|
90348
89198
|
return true;
|
|
90349
89199
|
}
|
|
90350
|
-
async function uploadCommand(
|
|
89200
|
+
async function uploadCommand(appid, options) {
|
|
90351
89201
|
try {
|
|
90352
|
-
await uploadBundle(
|
|
89202
|
+
await uploadBundle(appid, options, true);
|
|
90353
89203
|
} catch (error) {
|
|
90354
89204
|
f2.error(formatError(error));
|
|
90355
89205
|
program.error("");
|
|
90356
89206
|
}
|
|
90357
89207
|
}
|
|
90358
|
-
async function uploadDeprecatedCommand(
|
|
89208
|
+
async function uploadDeprecatedCommand(appid, options) {
|
|
90359
89209
|
const pm2 = getPMAndCommand();
|
|
90360
89210
|
f2.warn(`\u26A0\uFE0F This command is deprecated, use "${pm2.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);
|
|
90361
89211
|
try {
|
|
90362
|
-
await uploadBundle(
|
|
89212
|
+
await uploadBundle(appid, options, true);
|
|
90363
89213
|
} catch (error) {
|
|
90364
89214
|
f2.error(formatError(error));
|
|
90365
89215
|
program.error("");
|