@capgo/cli 4.12.3 → 4.12.5
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 +17 -0
- package/bun.lockb +0 -0
- package/dist/index.js +16 -1170
- package/package.json +1 -3
- package/src/app/debug.ts +2 -3
- package/src/utils.ts +17 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [4.12.5](https://github.com/Cap-go/CLI/compare/v4.12.4...v4.12.5) (2024-07-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* lint ([01e0f31](https://github.com/Cap-go/CLI/commit/01e0f31b20232578e47cc886be729e7e4e4885ed))
|
|
11
|
+
* remove preprod url ([0d8672a](https://github.com/Cap-go/CLI/commit/0d8672a1534a5e88260cbbad7eb10821d07e6cba))
|
|
12
|
+
|
|
13
|
+
### [4.12.4](https://github.com/Cap-go/CLI/compare/v4.12.3...v4.12.4) (2024-07-09)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* make better compression on windows ([dc93876](https://github.com/Cap-go/CLI/commit/dc9387649ae6cdfa09172e2e806d834787cb2fd0))
|
|
19
|
+
* use custom function to read recurst dir to fix windows issue ([cbd2217](https://github.com/Cap-go/CLI/commit/cbd2217ab877a40179f65be217e915fcbf7d0be1))
|
|
20
|
+
* version error ([6ec20c7](https://github.com/Cap-go/CLI/commit/6ec20c7195cfe454ef5bfa258163088c14231647))
|
|
21
|
+
|
|
5
22
|
### [4.12.3](https://github.com/Cap-go/CLI/compare/v4.12.2...v4.12.3) (2024-07-08)
|
|
6
23
|
|
|
7
24
|
|
package/bun.lockb
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -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) {
|
|
@@ -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.5",
|
|
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
|
|
@@ -88945,7 +87780,7 @@ async function zipFileWindows(filePath) {
|
|
|
88945
87780
|
}
|
|
88946
87781
|
};
|
|
88947
87782
|
await addToZip(filePath, "");
|
|
88948
|
-
const zipBuffer = await zip.generateAsync({ type: "nodebuffer", platform: "UNIX", compression: "DEFLATE" });
|
|
87783
|
+
const zipBuffer = await zip.generateAsync({ type: "nodebuffer", platform: "UNIX", compression: "DEFLATE", compressionOptions: { level: 6 } });
|
|
88949
87784
|
return zipBuffer;
|
|
88950
87785
|
}
|
|
88951
87786
|
async function finishMultipartDownload(key2, uploadId, url, parts) {
|
|
@@ -89127,6 +87962,18 @@ 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");
|
|
@@ -89173,7 +88020,7 @@ async function getLocalDepenencies() {
|
|
|
89173
88020
|
}
|
|
89174
88021
|
let hasNativeFiles = false;
|
|
89175
88022
|
try {
|
|
89176
|
-
const files =
|
|
88023
|
+
const files = readDirRecursively(dependencyFolderPath);
|
|
89177
88024
|
hasNativeFiles = files.some((fileName) => nativeFileRegex.test(fileName));
|
|
89178
88025
|
} catch (error) {
|
|
89179
88026
|
f2.error(`Error reading node_modules files for ${key2} package`);
|
|
@@ -89521,8 +88368,7 @@ async function cancelCommand(channel2, command, orgId, snag) {
|
|
|
89521
88368
|
}
|
|
89522
88369
|
async function getStats(apikey, query, after) {
|
|
89523
88370
|
try {
|
|
89524
|
-
const
|
|
89525
|
-
const dataD = await distribution_default.post(`${defaultApiHostPreprod}/private/stats`, {
|
|
88371
|
+
const dataD = await distribution_default.post(`${defaultApiHost}/private/stats`, {
|
|
89526
88372
|
headers: {
|
|
89527
88373
|
"Content-Type": "application/json",
|
|
89528
88374
|
"capgkey": apikey
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.5",
|
|
4
4
|
"description": "A CLI to upload to capgo servers",
|
|
5
5
|
"author": "github.com/riderx",
|
|
6
6
|
"license": "Apache 2.0",
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"ky": "^1.3.0",
|
|
62
62
|
"logsnag": "1.0.0",
|
|
63
63
|
"mime": "^4.0.3",
|
|
64
|
-
"node-dir": "^0.1.17",
|
|
65
64
|
"open": "^10.1.0",
|
|
66
65
|
"prettyjson": "^1.2.5",
|
|
67
66
|
"semver": "^7.6.2",
|
|
@@ -72,7 +71,6 @@
|
|
|
72
71
|
"@types/adm-zip": "0.5.5",
|
|
73
72
|
"@types/mime": "^4.0.0",
|
|
74
73
|
"@types/node": "^20.14.7",
|
|
75
|
-
"@types/node-dir": "^0.0.37",
|
|
76
74
|
"@types/npmcli__ci-detect": "^2.0.3",
|
|
77
75
|
"@types/prettyjson": "^0.0.33",
|
|
78
76
|
"@types/prompt-sync": "^4.2.3",
|
package/src/app/debug.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type LogSnag from 'logsnag'
|
|
|
6
6
|
import type { Database } from '../types/supabase.types'
|
|
7
7
|
import { checkAppExistsAndHasPermissionOrgErr } from '../api/app'
|
|
8
8
|
import { checkLatest } from '../api/update'
|
|
9
|
-
import { OrganizationPerm, convertAppName, createSupabaseClient, findSavedKey, formatError, getConfig, getLocalConfig, getOrganizationId, useLogSnag, verifyUser } from '../utils'
|
|
9
|
+
import { OrganizationPerm, convertAppName, createSupabaseClient, defaultApiHost, findSavedKey, formatError, getConfig, getLocalConfig, getOrganizationId, useLogSnag, verifyUser } from '../utils'
|
|
10
10
|
|
|
11
11
|
function wait(ms: number) {
|
|
12
12
|
return new Promise((resolve) => {
|
|
@@ -60,9 +60,8 @@ interface LogData {
|
|
|
60
60
|
}
|
|
61
61
|
export async function getStats(apikey: string, query: QueryStats, after: string | null): Promise<LogData | null> {
|
|
62
62
|
try {
|
|
63
|
-
const defaultApiHostPreprod = 'https://api-preprod.capgo.app'
|
|
64
63
|
const dataD = await ky
|
|
65
|
-
.post(`${
|
|
64
|
+
.post(`${defaultApiHost}/private/stats`, {
|
|
66
65
|
headers: {
|
|
67
66
|
'Content-Type': 'application/json',
|
|
68
67
|
'capgkey': apikey,
|
package/src/utils.ts
CHANGED
|
@@ -11,7 +11,6 @@ import prettyjson from 'prettyjson'
|
|
|
11
11
|
import { LogSnag } from 'logsnag'
|
|
12
12
|
import * as p from '@clack/prompts'
|
|
13
13
|
import ky from 'ky'
|
|
14
|
-
import { promiseFiles } from 'node-dir'
|
|
15
14
|
import { findRootSync } from '@manypkg/find-root'
|
|
16
15
|
import type { InstallCommand, PackageManagerRunner, PackageManagerType } from '@capgo/find-package-manager'
|
|
17
16
|
import { findInstallCommand, findPackageManagerRunner, findPackageManagerType } from '@capgo/find-package-manager'
|
|
@@ -559,7 +558,7 @@ export async function zipFileWindows(filePath: string): Promise<Buffer> {
|
|
|
559
558
|
await addToZip(filePath, '')
|
|
560
559
|
|
|
561
560
|
// Generate the ZIP file as a Buffer
|
|
562
|
-
const zipBuffer = await zip.generateAsync({ type: 'nodebuffer', platform: 'UNIX', compression: 'DEFLATE' })
|
|
561
|
+
const zipBuffer = await zip.generateAsync({ type: 'nodebuffer', platform: 'UNIX', compression: 'DEFLATE', compressionOptions: { level: 6 } })
|
|
563
562
|
return zipBuffer
|
|
564
563
|
}
|
|
565
564
|
|
|
@@ -840,6 +839,21 @@ export function getPMAndCommand() {
|
|
|
840
839
|
return { pm, command: pmCommand, installCommand: `${pm} ${pmCommand}`, runner: pmRunner }
|
|
841
840
|
}
|
|
842
841
|
|
|
842
|
+
function readDirRecursively(dir: string): string[] {
|
|
843
|
+
const entries = readdirSync(dir, { withFileTypes: true })
|
|
844
|
+
const files = entries.flatMap((entry) => {
|
|
845
|
+
const fullPath = join(dir, entry.name)
|
|
846
|
+
if (entry.isDirectory()) {
|
|
847
|
+
return readDirRecursively(fullPath)
|
|
848
|
+
}
|
|
849
|
+
else {
|
|
850
|
+
// Use relative path to avoid issues with long paths on Windows
|
|
851
|
+
return fullPath.split(`node_modules${sep}`)[1] || fullPath
|
|
852
|
+
}
|
|
853
|
+
})
|
|
854
|
+
return files
|
|
855
|
+
}
|
|
856
|
+
|
|
843
857
|
export async function getLocalDepenencies() {
|
|
844
858
|
const dir = findRootSync(process.cwd())
|
|
845
859
|
const packageJsonPath = join(process.cwd(), 'package.json')
|
|
@@ -897,7 +911,7 @@ export async function getLocalDepenencies() {
|
|
|
897
911
|
|
|
898
912
|
let hasNativeFiles = false
|
|
899
913
|
try {
|
|
900
|
-
const files =
|
|
914
|
+
const files = readDirRecursively(dependencyFolderPath)
|
|
901
915
|
hasNativeFiles = files.some(fileName => nativeFileRegex.test(fileName))
|
|
902
916
|
}
|
|
903
917
|
catch (error) {
|