vlt 0.0.0-3 → 0.0.0-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/README.md +2 -1
- package/package.json +17 -10
- package/postinstall.cjs +56 -0
- package/vlix +25 -0
- package/vlr +25 -0
- package/vlrx +25 -0
- package/vlt +25 -0
- package/vlx +25 -0
- package/cache-unzip-src-unzip.js +0 -7896
- package/cache-unzip-src-unzip.js.map +0 -7
- package/chunk-227OF2U2.js +0 -1183
- package/chunk-227OF2U2.js.map +0 -7
- package/chunk-3HXIYJS2.js +0 -54
- package/chunk-3HXIYJS2.js.map +0 -7
- package/chunk-AA6MVXJX.js +0 -19823
- package/chunk-AA6MVXJX.js.map +0 -7
- package/chunk-BCK4ZGNG.js +0 -41
- package/chunk-BCK4ZGNG.js.map +0 -7
- package/chunk-DH36SF3E.js +0 -35
- package/chunk-DH36SF3E.js.map +0 -7
- package/chunk-FNKWJ7AZ.js +0 -1379
- package/chunk-FNKWJ7AZ.js.map +0 -7
- package/chunk-H77UDCL3.js +0 -9820
- package/chunk-H77UDCL3.js.map +0 -7
- package/chunk-HL76E44L.js +0 -73
- package/chunk-HL76E44L.js.map +0 -7
- package/chunk-IN7DEH7F.js +0 -44
- package/chunk-IN7DEH7F.js.map +0 -7
- package/chunk-JLP2QDXQ.js +0 -1137
- package/chunk-JLP2QDXQ.js.map +0 -7
- package/chunk-JMGSFQ32.js +0 -969
- package/chunk-JMGSFQ32.js.map +0 -7
- package/chunk-JQRUGUZ3.js +0 -512
- package/chunk-JQRUGUZ3.js.map +0 -7
- package/chunk-K2BYYPM7.js +0 -8656
- package/chunk-K2BYYPM7.js.map +0 -7
- package/chunk-LNUDEBGP.js +0 -2071
- package/chunk-LNUDEBGP.js.map +0 -7
- package/chunk-MV5ZQ3LW.js +0 -1105
- package/chunk-MV5ZQ3LW.js.map +0 -7
- package/chunk-O7CDQZDW.js +0 -5234
- package/chunk-O7CDQZDW.js.map +0 -7
- package/chunk-OFW7MWFP.js +0 -82
- package/chunk-OFW7MWFP.js.map +0 -7
- package/chunk-PGDJ2ZZ6.js +0 -4810
- package/chunk-PGDJ2ZZ6.js.map +0 -7
- package/chunk-POVPHE2F.js +0 -1864
- package/chunk-POVPHE2F.js.map +0 -7
- package/chunk-PTVPYZHU.js +0 -72
- package/chunk-PTVPYZHU.js.map +0 -7
- package/chunk-SXBMMXTY.js +0 -11837
- package/chunk-SXBMMXTY.js.map +0 -7
- package/chunk-UZZ72UON.js +0 -152
- package/chunk-UZZ72UON.js.map +0 -7
- package/chunk-V7KRP7IO.js +0 -481
- package/chunk-V7KRP7IO.js.map +0 -7
- package/chunk-WVNUD273.js +0 -83
- package/chunk-WVNUD273.js.map +0 -7
- package/chunk-WYPE3MV4.js +0 -62
- package/chunk-WYPE3MV4.js.map +0 -7
- package/chunk-ZRNJWPYC.js +0 -37
- package/chunk-ZRNJWPYC.js.map +0 -7
- package/cli-package.json +0 -107
- package/config-3QQHUYLI.js +0 -179
- package/config-3QQHUYLI.js.map +0 -7
- package/devtools-5BBQJTDW.js +0 -16682
- package/devtools-5BBQJTDW.js.map +0 -7
- package/exec-C6GK336U.js +0 -50
- package/exec-C6GK336U.js.map +0 -7
- package/gui-IQ4M4K5X.js +0 -46
- package/gui-IQ4M4K5X.js.map +0 -7
- package/gui-assets/favicon.ico +0 -0
- package/gui-assets/fonts/geist-mono.ttf +0 -0
- package/gui-assets/fonts/inter.ttf +0 -0
- package/gui-assets/images/folder.png +0 -0
- package/gui-assets/index.html +0 -34
- package/gui-assets/index.js +0 -1549
- package/gui-assets/index.js.map +0 -7
- package/gui-assets/main.css +0 -1
- package/help-R6TSKVEA.js +0 -25
- package/help-R6TSKVEA.js.map +0 -7
- package/init-UTJGYULC.js +0 -25
- package/init-UTJGYULC.js.map +0 -7
- package/install-5XDTGLAU.js +0 -56
- package/install-5XDTGLAU.js.map +0 -7
- package/install-exec-VMPN3JE7.js +0 -28
- package/install-exec-VMPN3JE7.js.map +0 -7
- package/list-Q7IANZ3I.js +0 -129
- package/list-Q7IANZ3I.js.map +0 -7
- package/login-VHJEIRVU.js +0 -36
- package/login-VHJEIRVU.js.map +0 -7
- package/logout-5KMCSSR4.js +0 -36
- package/logout-5KMCSSR4.js.map +0 -7
- package/pkg-WYFDWETL.js +0 -364
- package/pkg-WYFDWETL.js.map +0 -7
- package/query-KP4F5D2Y.js +0 -117
- package/query-KP4F5D2Y.js.map +0 -7
- package/registry-client-package.json +0 -85
- package/reporter-LFGXWL6N.js +0 -18
- package/reporter-LFGXWL6N.js.map +0 -7
- package/rollback-remove-src-remove.js +0 -7398
- package/rollback-remove-src-remove.js.map +0 -7
- package/run-XNDZH72D.js +0 -68
- package/run-XNDZH72D.js.map +0 -7
- package/run-exec-NXA33NXJ.js +0 -41
- package/run-exec-NXA33NXJ.js.map +0 -7
- package/source-JWPG6PR3.js +0 -33
- package/source-JWPG6PR3.js.map +0 -7
- package/token-6IJNGEMI.js +0 -86
- package/token-6IJNGEMI.js.map +0 -7
- package/uninstall-MI7NFD27.js +0 -45
- package/uninstall-MI7NFD27.js.map +0 -7
- package/vlix.js +0 -25
- package/vlix.js.map +0 -7
- package/vlr.js +0 -25
- package/vlr.js.map +0 -7
- package/vlrx.js +0 -25
- package/vlrx.js.map +0 -7
- package/vlt.js +0 -24
- package/vlt.js.map +0 -7
- package/vlx.js +0 -25
- package/vlx.js.map +0 -7
- package/whoami-3IEXJF3U.js +0 -46
- package/whoami-3IEXJF3U.js.map +0 -7
- package/yoga.wasm +0 -0
package/chunk-LNUDEBGP.js
DELETED
|
@@ -1,2071 +0,0 @@
|
|
|
1
|
-
var global = globalThis;
|
|
2
|
-
import {Buffer} from "node:buffer";
|
|
3
|
-
import {setImmediate, clearImmediate} from "node:timers";
|
|
4
|
-
import {createRequire as _vlt_createRequire} from 'node:module';
|
|
5
|
-
var require = _vlt_createRequire(import.meta.filename);
|
|
6
|
-
import {
|
|
7
|
-
__commonJS,
|
|
8
|
-
__toESM
|
|
9
|
-
} from "./chunk-3HXIYJS2.js";
|
|
10
|
-
|
|
11
|
-
// ../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js
|
|
12
|
-
var require_eastasianwidth = __commonJS({
|
|
13
|
-
"../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports, module) {
|
|
14
|
-
var eaw = {};
|
|
15
|
-
if ("undefined" == typeof module) {
|
|
16
|
-
window.eastasianwidth = eaw;
|
|
17
|
-
} else {
|
|
18
|
-
module.exports = eaw;
|
|
19
|
-
}
|
|
20
|
-
eaw.eastAsianWidth = function(character) {
|
|
21
|
-
var x = character.charCodeAt(0);
|
|
22
|
-
var y = character.length == 2 ? character.charCodeAt(1) : 0;
|
|
23
|
-
var codePoint = x;
|
|
24
|
-
if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
|
|
25
|
-
x &= 1023;
|
|
26
|
-
y &= 1023;
|
|
27
|
-
codePoint = x << 10 | y;
|
|
28
|
-
codePoint += 65536;
|
|
29
|
-
}
|
|
30
|
-
if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
|
|
31
|
-
return "F";
|
|
32
|
-
}
|
|
33
|
-
if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
|
|
34
|
-
return "H";
|
|
35
|
-
}
|
|
36
|
-
if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
|
|
37
|
-
return "W";
|
|
38
|
-
}
|
|
39
|
-
if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
|
|
40
|
-
return "Na";
|
|
41
|
-
}
|
|
42
|
-
if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
|
|
43
|
-
return "A";
|
|
44
|
-
}
|
|
45
|
-
return "N";
|
|
46
|
-
};
|
|
47
|
-
eaw.characterLength = function(character) {
|
|
48
|
-
var code = this.eastAsianWidth(character);
|
|
49
|
-
if (code == "F" || code == "W" || code == "A") {
|
|
50
|
-
return 2;
|
|
51
|
-
} else {
|
|
52
|
-
return 1;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
function stringToArray(string) {
|
|
56
|
-
return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
57
|
-
}
|
|
58
|
-
eaw.length = function(string) {
|
|
59
|
-
var characters = stringToArray(string);
|
|
60
|
-
var len = 0;
|
|
61
|
-
for (var i = 0; i < characters.length; i++) {
|
|
62
|
-
len = len + this.characterLength(characters[i]);
|
|
63
|
-
}
|
|
64
|
-
return len;
|
|
65
|
-
};
|
|
66
|
-
eaw.slice = function(text, start, end) {
|
|
67
|
-
textLen = eaw.length(text);
|
|
68
|
-
start = start ? start : 0;
|
|
69
|
-
end = end ? end : 1;
|
|
70
|
-
if (start < 0) {
|
|
71
|
-
start = textLen + start;
|
|
72
|
-
}
|
|
73
|
-
if (end < 0) {
|
|
74
|
-
end = textLen + end;
|
|
75
|
-
}
|
|
76
|
-
var result = "";
|
|
77
|
-
var eawLen = 0;
|
|
78
|
-
var chars = stringToArray(text);
|
|
79
|
-
for (var i = 0; i < chars.length; i++) {
|
|
80
|
-
var char = chars[i];
|
|
81
|
-
var charLen = eaw.length(char);
|
|
82
|
-
if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
|
|
83
|
-
if (eawLen + charLen <= end) {
|
|
84
|
-
result += char;
|
|
85
|
-
} else {
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
eawLen += charLen;
|
|
90
|
-
}
|
|
91
|
-
return result;
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// ../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js
|
|
97
|
-
var require_emoji_regex = __commonJS({
|
|
98
|
-
"../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports, module) {
|
|
99
|
-
"use strict";
|
|
100
|
-
module.exports = function() {
|
|
101
|
-
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
// ../../src/xdg/src/index.ts
|
|
107
|
-
import { homedir, tmpdir } from "node:os";
|
|
108
|
-
import { resolve } from "node:path";
|
|
109
|
-
var root = homedir();
|
|
110
|
-
var path = (p) => resolve(root, p);
|
|
111
|
-
var defaults = process.platform === "darwin" ? (which) => {
|
|
112
|
-
switch (which) {
|
|
113
|
-
case "config":
|
|
114
|
-
return path("Library/Preferences");
|
|
115
|
-
case "cache":
|
|
116
|
-
return path("Library/Caches");
|
|
117
|
-
case "data":
|
|
118
|
-
return path("Library/Application Support");
|
|
119
|
-
case "state":
|
|
120
|
-
return path("Library/State");
|
|
121
|
-
case "runtime":
|
|
122
|
-
return resolve(
|
|
123
|
-
tmpdir(),
|
|
124
|
-
/* c8 ignore next */
|
|
125
|
-
String(process.getuid?.() ?? ""),
|
|
126
|
-
".run"
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
} : process.platform === "win32" ? (which) => {
|
|
130
|
-
const ad = process.env.APPDATA ?? path("AppData/Roaming");
|
|
131
|
-
const lad = process.env.LOCALAPPDATA ?? path("AppData/Local");
|
|
132
|
-
switch (which) {
|
|
133
|
-
case "config":
|
|
134
|
-
return resolve(ad, "xdg.config");
|
|
135
|
-
case "cache":
|
|
136
|
-
return resolve(lad, "xdg.cache");
|
|
137
|
-
case "data":
|
|
138
|
-
return resolve(ad, "xdg.data");
|
|
139
|
-
case "state":
|
|
140
|
-
return resolve(lad, "xdg.state");
|
|
141
|
-
case "runtime":
|
|
142
|
-
return resolve(tmpdir(), "xdg.run");
|
|
143
|
-
}
|
|
144
|
-
} : (which) => {
|
|
145
|
-
switch (which) {
|
|
146
|
-
case "config":
|
|
147
|
-
return path(".config");
|
|
148
|
-
case "cache":
|
|
149
|
-
return path(".cache");
|
|
150
|
-
case "data":
|
|
151
|
-
return path(".local/share");
|
|
152
|
-
case "state":
|
|
153
|
-
return path(".local/state");
|
|
154
|
-
case "runtime":
|
|
155
|
-
return resolve(
|
|
156
|
-
tmpdir(),
|
|
157
|
-
/* c8 ignore next */
|
|
158
|
-
String(process.getuid?.() ?? ""),
|
|
159
|
-
".run"
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
var {
|
|
164
|
-
XDG_CONFIG_HOME = defaults("config"),
|
|
165
|
-
XDG_CACHE_HOME = defaults("cache"),
|
|
166
|
-
XDG_DATA_HOME = defaults("data"),
|
|
167
|
-
XDG_STATE_HOME = defaults("state"),
|
|
168
|
-
XDG_RUNTIME_DIR = defaults("runtime")
|
|
169
|
-
} = process.env;
|
|
170
|
-
var XDG = class {
|
|
171
|
-
name;
|
|
172
|
-
base = {
|
|
173
|
-
config: XDG_CONFIG_HOME,
|
|
174
|
-
cache: XDG_CACHE_HOME,
|
|
175
|
-
data: XDG_DATA_HOME,
|
|
176
|
-
state: XDG_STATE_HOME,
|
|
177
|
-
runtime: XDG_RUNTIME_DIR
|
|
178
|
-
};
|
|
179
|
-
constructor(name) {
|
|
180
|
-
this.name = name;
|
|
181
|
-
}
|
|
182
|
-
config(p = "") {
|
|
183
|
-
return resolve(this.base.config, this.name, p);
|
|
184
|
-
}
|
|
185
|
-
cache(p = "") {
|
|
186
|
-
return resolve(this.base.cache, this.name, p);
|
|
187
|
-
}
|
|
188
|
-
data(p = "") {
|
|
189
|
-
return resolve(this.base.data, this.name, p);
|
|
190
|
-
}
|
|
191
|
-
state(p = "") {
|
|
192
|
-
return resolve(this.base.state, this.name, p);
|
|
193
|
-
}
|
|
194
|
-
runtime(p = "") {
|
|
195
|
-
return resolve(this.base.runtime, this.name, p);
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
// ../../node_modules/.pnpm/jackspeak@4.0.3/node_modules/jackspeak/dist/esm/index.js
|
|
200
|
-
import { inspect, parseArgs } from "node:util";
|
|
201
|
-
|
|
202
|
-
// ../../node_modules/.pnpm/@isaacs+cliui@8.0.2/node_modules/@isaacs/cliui/build/lib/index.js
|
|
203
|
-
var align = {
|
|
204
|
-
right: alignRight,
|
|
205
|
-
center: alignCenter
|
|
206
|
-
};
|
|
207
|
-
var top = 0;
|
|
208
|
-
var right = 1;
|
|
209
|
-
var bottom = 2;
|
|
210
|
-
var left = 3;
|
|
211
|
-
var UI = class {
|
|
212
|
-
constructor(opts) {
|
|
213
|
-
var _a;
|
|
214
|
-
this.width = opts.width;
|
|
215
|
-
this.wrap = (_a = opts.wrap) !== null && _a !== void 0 ? _a : true;
|
|
216
|
-
this.rows = [];
|
|
217
|
-
}
|
|
218
|
-
span(...args) {
|
|
219
|
-
const cols = this.div(...args);
|
|
220
|
-
cols.span = true;
|
|
221
|
-
}
|
|
222
|
-
resetOutput() {
|
|
223
|
-
this.rows = [];
|
|
224
|
-
}
|
|
225
|
-
div(...args) {
|
|
226
|
-
if (args.length === 0) {
|
|
227
|
-
this.div("");
|
|
228
|
-
}
|
|
229
|
-
if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") {
|
|
230
|
-
return this.applyLayoutDSL(args[0]);
|
|
231
|
-
}
|
|
232
|
-
const cols = args.map((arg) => {
|
|
233
|
-
if (typeof arg === "string") {
|
|
234
|
-
return this.colFromString(arg);
|
|
235
|
-
}
|
|
236
|
-
return arg;
|
|
237
|
-
});
|
|
238
|
-
this.rows.push(cols);
|
|
239
|
-
return cols;
|
|
240
|
-
}
|
|
241
|
-
shouldApplyLayoutDSL(...args) {
|
|
242
|
-
return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]);
|
|
243
|
-
}
|
|
244
|
-
applyLayoutDSL(str) {
|
|
245
|
-
const rows = str.split("\n").map((row) => row.split(" "));
|
|
246
|
-
let leftColumnWidth = 0;
|
|
247
|
-
rows.forEach((columns) => {
|
|
248
|
-
if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
|
|
249
|
-
leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0]));
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
rows.forEach((columns) => {
|
|
253
|
-
this.div(...columns.map((r, i) => {
|
|
254
|
-
return {
|
|
255
|
-
text: r.trim(),
|
|
256
|
-
padding: this.measurePadding(r),
|
|
257
|
-
width: i === 0 && columns.length > 1 ? leftColumnWidth : void 0
|
|
258
|
-
};
|
|
259
|
-
}));
|
|
260
|
-
});
|
|
261
|
-
return this.rows[this.rows.length - 1];
|
|
262
|
-
}
|
|
263
|
-
colFromString(text) {
|
|
264
|
-
return {
|
|
265
|
-
text,
|
|
266
|
-
padding: this.measurePadding(text)
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
measurePadding(str) {
|
|
270
|
-
const noAnsi = mixin.stripAnsi(str);
|
|
271
|
-
return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
|
|
272
|
-
}
|
|
273
|
-
toString() {
|
|
274
|
-
const lines = [];
|
|
275
|
-
this.rows.forEach((row) => {
|
|
276
|
-
this.rowToString(row, lines);
|
|
277
|
-
});
|
|
278
|
-
return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n");
|
|
279
|
-
}
|
|
280
|
-
rowToString(row, lines) {
|
|
281
|
-
this.rasterize(row).forEach((rrow, r) => {
|
|
282
|
-
let str = "";
|
|
283
|
-
rrow.forEach((col, c) => {
|
|
284
|
-
const { width: width2 } = row[c];
|
|
285
|
-
const wrapWidth = this.negatePadding(row[c]);
|
|
286
|
-
let ts = col;
|
|
287
|
-
if (wrapWidth > mixin.stringWidth(col)) {
|
|
288
|
-
ts += " ".repeat(wrapWidth - mixin.stringWidth(col));
|
|
289
|
-
}
|
|
290
|
-
if (row[c].align && row[c].align !== "left" && this.wrap) {
|
|
291
|
-
const fn = align[row[c].align];
|
|
292
|
-
ts = fn(ts, wrapWidth);
|
|
293
|
-
if (mixin.stringWidth(ts) < wrapWidth) {
|
|
294
|
-
const w = width2 || 0;
|
|
295
|
-
ts += " ".repeat(w - mixin.stringWidth(ts) - 1);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
const padding = row[c].padding || [0, 0, 0, 0];
|
|
299
|
-
if (padding[left]) {
|
|
300
|
-
str += " ".repeat(padding[left]);
|
|
301
|
-
}
|
|
302
|
-
str += addBorder(row[c], ts, "| ");
|
|
303
|
-
str += ts;
|
|
304
|
-
str += addBorder(row[c], ts, " |");
|
|
305
|
-
if (padding[right]) {
|
|
306
|
-
str += " ".repeat(padding[right]);
|
|
307
|
-
}
|
|
308
|
-
if (r === 0 && lines.length > 0) {
|
|
309
|
-
str = this.renderInline(str, lines[lines.length - 1]);
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
lines.push({
|
|
313
|
-
text: str.replace(/ +$/, ""),
|
|
314
|
-
span: row.span
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
return lines;
|
|
318
|
-
}
|
|
319
|
-
// if the full 'source' can render in
|
|
320
|
-
// the target line, do so.
|
|
321
|
-
renderInline(source, previousLine) {
|
|
322
|
-
const match = source.match(/^ */);
|
|
323
|
-
const leadingWhitespace = match ? match[0].length : 0;
|
|
324
|
-
const target = previousLine.text;
|
|
325
|
-
const targetTextWidth = mixin.stringWidth(target.trimEnd());
|
|
326
|
-
if (!previousLine.span) {
|
|
327
|
-
return source;
|
|
328
|
-
}
|
|
329
|
-
if (!this.wrap) {
|
|
330
|
-
previousLine.hidden = true;
|
|
331
|
-
return target + source;
|
|
332
|
-
}
|
|
333
|
-
if (leadingWhitespace < targetTextWidth) {
|
|
334
|
-
return source;
|
|
335
|
-
}
|
|
336
|
-
previousLine.hidden = true;
|
|
337
|
-
return target.trimEnd() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimStart();
|
|
338
|
-
}
|
|
339
|
-
rasterize(row) {
|
|
340
|
-
const rrows = [];
|
|
341
|
-
const widths = this.columnWidths(row);
|
|
342
|
-
let wrapped;
|
|
343
|
-
row.forEach((col, c) => {
|
|
344
|
-
col.width = widths[c];
|
|
345
|
-
if (this.wrap) {
|
|
346
|
-
wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n");
|
|
347
|
-
} else {
|
|
348
|
-
wrapped = col.text.split("\n");
|
|
349
|
-
}
|
|
350
|
-
if (col.border) {
|
|
351
|
-
wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + ".");
|
|
352
|
-
wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'");
|
|
353
|
-
}
|
|
354
|
-
if (col.padding) {
|
|
355
|
-
wrapped.unshift(...new Array(col.padding[top] || 0).fill(""));
|
|
356
|
-
wrapped.push(...new Array(col.padding[bottom] || 0).fill(""));
|
|
357
|
-
}
|
|
358
|
-
wrapped.forEach((str, r) => {
|
|
359
|
-
if (!rrows[r]) {
|
|
360
|
-
rrows.push([]);
|
|
361
|
-
}
|
|
362
|
-
const rrow = rrows[r];
|
|
363
|
-
for (let i = 0; i < c; i++) {
|
|
364
|
-
if (rrow[i] === void 0) {
|
|
365
|
-
rrow.push("");
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
rrow.push(str);
|
|
369
|
-
});
|
|
370
|
-
});
|
|
371
|
-
return rrows;
|
|
372
|
-
}
|
|
373
|
-
negatePadding(col) {
|
|
374
|
-
let wrapWidth = col.width || 0;
|
|
375
|
-
if (col.padding) {
|
|
376
|
-
wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
|
|
377
|
-
}
|
|
378
|
-
if (col.border) {
|
|
379
|
-
wrapWidth -= 4;
|
|
380
|
-
}
|
|
381
|
-
return wrapWidth;
|
|
382
|
-
}
|
|
383
|
-
columnWidths(row) {
|
|
384
|
-
if (!this.wrap) {
|
|
385
|
-
return row.map((col) => {
|
|
386
|
-
return col.width || mixin.stringWidth(col.text);
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
let unset = row.length;
|
|
390
|
-
let remainingWidth = this.width;
|
|
391
|
-
const widths = row.map((col) => {
|
|
392
|
-
if (col.width) {
|
|
393
|
-
unset--;
|
|
394
|
-
remainingWidth -= col.width;
|
|
395
|
-
return col.width;
|
|
396
|
-
}
|
|
397
|
-
return void 0;
|
|
398
|
-
});
|
|
399
|
-
const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
|
|
400
|
-
return widths.map((w, i) => {
|
|
401
|
-
if (w === void 0) {
|
|
402
|
-
return Math.max(unsetWidth, _minWidth(row[i]));
|
|
403
|
-
}
|
|
404
|
-
return w;
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
function addBorder(col, ts, style) {
|
|
409
|
-
if (col.border) {
|
|
410
|
-
if (/[.']-+[.']/.test(ts)) {
|
|
411
|
-
return "";
|
|
412
|
-
}
|
|
413
|
-
if (ts.trim().length !== 0) {
|
|
414
|
-
return style;
|
|
415
|
-
}
|
|
416
|
-
return " ";
|
|
417
|
-
}
|
|
418
|
-
return "";
|
|
419
|
-
}
|
|
420
|
-
function _minWidth(col) {
|
|
421
|
-
const padding = col.padding || [];
|
|
422
|
-
const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
|
|
423
|
-
if (col.border) {
|
|
424
|
-
return minWidth + 4;
|
|
425
|
-
}
|
|
426
|
-
return minWidth;
|
|
427
|
-
}
|
|
428
|
-
function getWindowWidth() {
|
|
429
|
-
if (typeof process === "object" && process.stdout && process.stdout.columns) {
|
|
430
|
-
return process.stdout.columns;
|
|
431
|
-
}
|
|
432
|
-
return 80;
|
|
433
|
-
}
|
|
434
|
-
function alignRight(str, width2) {
|
|
435
|
-
str = str.trim();
|
|
436
|
-
const strWidth = mixin.stringWidth(str);
|
|
437
|
-
if (strWidth < width2) {
|
|
438
|
-
return " ".repeat(width2 - strWidth) + str;
|
|
439
|
-
}
|
|
440
|
-
return str;
|
|
441
|
-
}
|
|
442
|
-
function alignCenter(str, width2) {
|
|
443
|
-
str = str.trim();
|
|
444
|
-
const strWidth = mixin.stringWidth(str);
|
|
445
|
-
if (strWidth >= width2) {
|
|
446
|
-
return str;
|
|
447
|
-
}
|
|
448
|
-
return " ".repeat(width2 - strWidth >> 1) + str;
|
|
449
|
-
}
|
|
450
|
-
var mixin;
|
|
451
|
-
function cliui(opts, _mixin) {
|
|
452
|
-
mixin = _mixin;
|
|
453
|
-
return new UI({
|
|
454
|
-
/* c8 ignore start */
|
|
455
|
-
width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
|
|
456
|
-
wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
|
|
457
|
-
/* c8 ignore stop */
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
// ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
|
|
462
|
-
function ansiRegex({ onlyFirst = false } = {}) {
|
|
463
|
-
const pattern = [
|
|
464
|
-
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
465
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
|
466
|
-
].join("|");
|
|
467
|
-
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
|
|
471
|
-
var regex = ansiRegex();
|
|
472
|
-
function stripAnsi(string) {
|
|
473
|
-
if (typeof string !== "string") {
|
|
474
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
475
|
-
}
|
|
476
|
-
return string.replace(regex, "");
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
// ../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js
|
|
480
|
-
var import_eastasianwidth = __toESM(require_eastasianwidth(), 1);
|
|
481
|
-
var import_emoji_regex = __toESM(require_emoji_regex(), 1);
|
|
482
|
-
function stringWidth(string, options = {}) {
|
|
483
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
484
|
-
return 0;
|
|
485
|
-
}
|
|
486
|
-
options = {
|
|
487
|
-
ambiguousIsNarrow: true,
|
|
488
|
-
...options
|
|
489
|
-
};
|
|
490
|
-
string = stripAnsi(string);
|
|
491
|
-
if (string.length === 0) {
|
|
492
|
-
return 0;
|
|
493
|
-
}
|
|
494
|
-
string = string.replace((0, import_emoji_regex.default)(), " ");
|
|
495
|
-
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
|
|
496
|
-
let width2 = 0;
|
|
497
|
-
for (const character of string) {
|
|
498
|
-
const codePoint = character.codePointAt(0);
|
|
499
|
-
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
500
|
-
continue;
|
|
501
|
-
}
|
|
502
|
-
if (codePoint >= 768 && codePoint <= 879) {
|
|
503
|
-
continue;
|
|
504
|
-
}
|
|
505
|
-
const code = import_eastasianwidth.default.eastAsianWidth(character);
|
|
506
|
-
switch (code) {
|
|
507
|
-
case "F":
|
|
508
|
-
case "W":
|
|
509
|
-
width2 += 2;
|
|
510
|
-
break;
|
|
511
|
-
case "A":
|
|
512
|
-
width2 += ambiguousCharacterWidth;
|
|
513
|
-
break;
|
|
514
|
-
default:
|
|
515
|
-
width2 += 1;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
return width2;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
// ../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js
|
|
522
|
-
var ANSI_BACKGROUND_OFFSET = 10;
|
|
523
|
-
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
524
|
-
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
525
|
-
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
526
|
-
var styles = {
|
|
527
|
-
modifier: {
|
|
528
|
-
reset: [0, 0],
|
|
529
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
530
|
-
bold: [1, 22],
|
|
531
|
-
dim: [2, 22],
|
|
532
|
-
italic: [3, 23],
|
|
533
|
-
underline: [4, 24],
|
|
534
|
-
overline: [53, 55],
|
|
535
|
-
inverse: [7, 27],
|
|
536
|
-
hidden: [8, 28],
|
|
537
|
-
strikethrough: [9, 29]
|
|
538
|
-
},
|
|
539
|
-
color: {
|
|
540
|
-
black: [30, 39],
|
|
541
|
-
red: [31, 39],
|
|
542
|
-
green: [32, 39],
|
|
543
|
-
yellow: [33, 39],
|
|
544
|
-
blue: [34, 39],
|
|
545
|
-
magenta: [35, 39],
|
|
546
|
-
cyan: [36, 39],
|
|
547
|
-
white: [37, 39],
|
|
548
|
-
// Bright color
|
|
549
|
-
blackBright: [90, 39],
|
|
550
|
-
gray: [90, 39],
|
|
551
|
-
// Alias of `blackBright`
|
|
552
|
-
grey: [90, 39],
|
|
553
|
-
// Alias of `blackBright`
|
|
554
|
-
redBright: [91, 39],
|
|
555
|
-
greenBright: [92, 39],
|
|
556
|
-
yellowBright: [93, 39],
|
|
557
|
-
blueBright: [94, 39],
|
|
558
|
-
magentaBright: [95, 39],
|
|
559
|
-
cyanBright: [96, 39],
|
|
560
|
-
whiteBright: [97, 39]
|
|
561
|
-
},
|
|
562
|
-
bgColor: {
|
|
563
|
-
bgBlack: [40, 49],
|
|
564
|
-
bgRed: [41, 49],
|
|
565
|
-
bgGreen: [42, 49],
|
|
566
|
-
bgYellow: [43, 49],
|
|
567
|
-
bgBlue: [44, 49],
|
|
568
|
-
bgMagenta: [45, 49],
|
|
569
|
-
bgCyan: [46, 49],
|
|
570
|
-
bgWhite: [47, 49],
|
|
571
|
-
// Bright color
|
|
572
|
-
bgBlackBright: [100, 49],
|
|
573
|
-
bgGray: [100, 49],
|
|
574
|
-
// Alias of `bgBlackBright`
|
|
575
|
-
bgGrey: [100, 49],
|
|
576
|
-
// Alias of `bgBlackBright`
|
|
577
|
-
bgRedBright: [101, 49],
|
|
578
|
-
bgGreenBright: [102, 49],
|
|
579
|
-
bgYellowBright: [103, 49],
|
|
580
|
-
bgBlueBright: [104, 49],
|
|
581
|
-
bgMagentaBright: [105, 49],
|
|
582
|
-
bgCyanBright: [106, 49],
|
|
583
|
-
bgWhiteBright: [107, 49]
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
var modifierNames = Object.keys(styles.modifier);
|
|
587
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
588
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
589
|
-
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
590
|
-
function assembleStyles() {
|
|
591
|
-
const codes = /* @__PURE__ */ new Map();
|
|
592
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
593
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
594
|
-
styles[styleName] = {
|
|
595
|
-
open: `\x1B[${style[0]}m`,
|
|
596
|
-
close: `\x1B[${style[1]}m`
|
|
597
|
-
};
|
|
598
|
-
group[styleName] = styles[styleName];
|
|
599
|
-
codes.set(style[0], style[1]);
|
|
600
|
-
}
|
|
601
|
-
Object.defineProperty(styles, groupName, {
|
|
602
|
-
value: group,
|
|
603
|
-
enumerable: false
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
Object.defineProperty(styles, "codes", {
|
|
607
|
-
value: codes,
|
|
608
|
-
enumerable: false
|
|
609
|
-
});
|
|
610
|
-
styles.color.close = "\x1B[39m";
|
|
611
|
-
styles.bgColor.close = "\x1B[49m";
|
|
612
|
-
styles.color.ansi = wrapAnsi16();
|
|
613
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
614
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
615
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
616
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
617
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
618
|
-
Object.defineProperties(styles, {
|
|
619
|
-
rgbToAnsi256: {
|
|
620
|
-
value: (red, green, blue) => {
|
|
621
|
-
if (red === green && green === blue) {
|
|
622
|
-
if (red < 8) {
|
|
623
|
-
return 16;
|
|
624
|
-
}
|
|
625
|
-
if (red > 248) {
|
|
626
|
-
return 231;
|
|
627
|
-
}
|
|
628
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
629
|
-
}
|
|
630
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
631
|
-
},
|
|
632
|
-
enumerable: false
|
|
633
|
-
},
|
|
634
|
-
hexToRgb: {
|
|
635
|
-
value: (hex) => {
|
|
636
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
637
|
-
if (!matches) {
|
|
638
|
-
return [0, 0, 0];
|
|
639
|
-
}
|
|
640
|
-
let [colorString] = matches;
|
|
641
|
-
if (colorString.length === 3) {
|
|
642
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
643
|
-
}
|
|
644
|
-
const integer = Number.parseInt(colorString, 16);
|
|
645
|
-
return [
|
|
646
|
-
/* eslint-disable no-bitwise */
|
|
647
|
-
integer >> 16 & 255,
|
|
648
|
-
integer >> 8 & 255,
|
|
649
|
-
integer & 255
|
|
650
|
-
/* eslint-enable no-bitwise */
|
|
651
|
-
];
|
|
652
|
-
},
|
|
653
|
-
enumerable: false
|
|
654
|
-
},
|
|
655
|
-
hexToAnsi256: {
|
|
656
|
-
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
657
|
-
enumerable: false
|
|
658
|
-
},
|
|
659
|
-
ansi256ToAnsi: {
|
|
660
|
-
value: (code) => {
|
|
661
|
-
if (code < 8) {
|
|
662
|
-
return 30 + code;
|
|
663
|
-
}
|
|
664
|
-
if (code < 16) {
|
|
665
|
-
return 90 + (code - 8);
|
|
666
|
-
}
|
|
667
|
-
let red;
|
|
668
|
-
let green;
|
|
669
|
-
let blue;
|
|
670
|
-
if (code >= 232) {
|
|
671
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
672
|
-
green = red;
|
|
673
|
-
blue = red;
|
|
674
|
-
} else {
|
|
675
|
-
code -= 16;
|
|
676
|
-
const remainder = code % 36;
|
|
677
|
-
red = Math.floor(code / 36) / 5;
|
|
678
|
-
green = Math.floor(remainder / 6) / 5;
|
|
679
|
-
blue = remainder % 6 / 5;
|
|
680
|
-
}
|
|
681
|
-
const value = Math.max(red, green, blue) * 2;
|
|
682
|
-
if (value === 0) {
|
|
683
|
-
return 30;
|
|
684
|
-
}
|
|
685
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
686
|
-
if (value === 2) {
|
|
687
|
-
result += 60;
|
|
688
|
-
}
|
|
689
|
-
return result;
|
|
690
|
-
},
|
|
691
|
-
enumerable: false
|
|
692
|
-
},
|
|
693
|
-
rgbToAnsi: {
|
|
694
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
695
|
-
enumerable: false
|
|
696
|
-
},
|
|
697
|
-
hexToAnsi: {
|
|
698
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
699
|
-
enumerable: false
|
|
700
|
-
}
|
|
701
|
-
});
|
|
702
|
-
return styles;
|
|
703
|
-
}
|
|
704
|
-
var ansiStyles = assembleStyles();
|
|
705
|
-
var ansi_styles_default = ansiStyles;
|
|
706
|
-
|
|
707
|
-
// ../../node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js
|
|
708
|
-
var ESCAPES = /* @__PURE__ */ new Set([
|
|
709
|
-
"\x1B",
|
|
710
|
-
"\x9B"
|
|
711
|
-
]);
|
|
712
|
-
var END_CODE = 39;
|
|
713
|
-
var ANSI_ESCAPE_BELL = "\x07";
|
|
714
|
-
var ANSI_CSI = "[";
|
|
715
|
-
var ANSI_OSC = "]";
|
|
716
|
-
var ANSI_SGR_TERMINATOR = "m";
|
|
717
|
-
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
718
|
-
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
719
|
-
var wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
|
|
720
|
-
var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
|
|
721
|
-
var wrapWord = (rows, word, columns) => {
|
|
722
|
-
const characters = [...word];
|
|
723
|
-
let isInsideEscape = false;
|
|
724
|
-
let isInsideLinkEscape = false;
|
|
725
|
-
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
|
|
726
|
-
for (const [index, character] of characters.entries()) {
|
|
727
|
-
const characterLength = stringWidth(character);
|
|
728
|
-
if (visible + characterLength <= columns) {
|
|
729
|
-
rows[rows.length - 1] += character;
|
|
730
|
-
} else {
|
|
731
|
-
rows.push(character);
|
|
732
|
-
visible = 0;
|
|
733
|
-
}
|
|
734
|
-
if (ESCAPES.has(character)) {
|
|
735
|
-
isInsideEscape = true;
|
|
736
|
-
isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK);
|
|
737
|
-
}
|
|
738
|
-
if (isInsideEscape) {
|
|
739
|
-
if (isInsideLinkEscape) {
|
|
740
|
-
if (character === ANSI_ESCAPE_BELL) {
|
|
741
|
-
isInsideEscape = false;
|
|
742
|
-
isInsideLinkEscape = false;
|
|
743
|
-
}
|
|
744
|
-
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
745
|
-
isInsideEscape = false;
|
|
746
|
-
}
|
|
747
|
-
continue;
|
|
748
|
-
}
|
|
749
|
-
visible += characterLength;
|
|
750
|
-
if (visible === columns && index < characters.length - 1) {
|
|
751
|
-
rows.push("");
|
|
752
|
-
visible = 0;
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
|
|
756
|
-
rows[rows.length - 2] += rows.pop();
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
var stringVisibleTrimSpacesRight = (string) => {
|
|
760
|
-
const words = string.split(" ");
|
|
761
|
-
let last = words.length;
|
|
762
|
-
while (last > 0) {
|
|
763
|
-
if (stringWidth(words[last - 1]) > 0) {
|
|
764
|
-
break;
|
|
765
|
-
}
|
|
766
|
-
last--;
|
|
767
|
-
}
|
|
768
|
-
if (last === words.length) {
|
|
769
|
-
return string;
|
|
770
|
-
}
|
|
771
|
-
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
772
|
-
};
|
|
773
|
-
var exec = (string, columns, options = {}) => {
|
|
774
|
-
if (options.trim !== false && string.trim() === "") {
|
|
775
|
-
return "";
|
|
776
|
-
}
|
|
777
|
-
let returnValue = "";
|
|
778
|
-
let escapeCode;
|
|
779
|
-
let escapeUrl;
|
|
780
|
-
const lengths = wordLengths(string);
|
|
781
|
-
let rows = [""];
|
|
782
|
-
for (const [index, word] of string.split(" ").entries()) {
|
|
783
|
-
if (options.trim !== false) {
|
|
784
|
-
rows[rows.length - 1] = rows[rows.length - 1].trimStart();
|
|
785
|
-
}
|
|
786
|
-
let rowLength = stringWidth(rows[rows.length - 1]);
|
|
787
|
-
if (index !== 0) {
|
|
788
|
-
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
789
|
-
rows.push("");
|
|
790
|
-
rowLength = 0;
|
|
791
|
-
}
|
|
792
|
-
if (rowLength > 0 || options.trim === false) {
|
|
793
|
-
rows[rows.length - 1] += " ";
|
|
794
|
-
rowLength++;
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
if (options.hard && lengths[index] > columns) {
|
|
798
|
-
const remainingColumns = columns - rowLength;
|
|
799
|
-
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
800
|
-
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
801
|
-
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
802
|
-
rows.push("");
|
|
803
|
-
}
|
|
804
|
-
wrapWord(rows, word, columns);
|
|
805
|
-
continue;
|
|
806
|
-
}
|
|
807
|
-
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
808
|
-
if (options.wordWrap === false && rowLength < columns) {
|
|
809
|
-
wrapWord(rows, word, columns);
|
|
810
|
-
continue;
|
|
811
|
-
}
|
|
812
|
-
rows.push("");
|
|
813
|
-
}
|
|
814
|
-
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
815
|
-
wrapWord(rows, word, columns);
|
|
816
|
-
continue;
|
|
817
|
-
}
|
|
818
|
-
rows[rows.length - 1] += word;
|
|
819
|
-
}
|
|
820
|
-
if (options.trim !== false) {
|
|
821
|
-
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
822
|
-
}
|
|
823
|
-
const pre = [...rows.join("\n")];
|
|
824
|
-
for (const [index, character] of pre.entries()) {
|
|
825
|
-
returnValue += character;
|
|
826
|
-
if (ESCAPES.has(character)) {
|
|
827
|
-
const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
|
|
828
|
-
if (groups.code !== void 0) {
|
|
829
|
-
const code2 = Number.parseFloat(groups.code);
|
|
830
|
-
escapeCode = code2 === END_CODE ? void 0 : code2;
|
|
831
|
-
} else if (groups.uri !== void 0) {
|
|
832
|
-
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
const code = ansi_styles_default.codes.get(Number(escapeCode));
|
|
836
|
-
if (pre[index + 1] === "\n") {
|
|
837
|
-
if (escapeUrl) {
|
|
838
|
-
returnValue += wrapAnsiHyperlink("");
|
|
839
|
-
}
|
|
840
|
-
if (escapeCode && code) {
|
|
841
|
-
returnValue += wrapAnsiCode(code);
|
|
842
|
-
}
|
|
843
|
-
} else if (character === "\n") {
|
|
844
|
-
if (escapeCode && code) {
|
|
845
|
-
returnValue += wrapAnsiCode(escapeCode);
|
|
846
|
-
}
|
|
847
|
-
if (escapeUrl) {
|
|
848
|
-
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
return returnValue;
|
|
853
|
-
};
|
|
854
|
-
function wrapAnsi(string, columns, options) {
|
|
855
|
-
return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
// ../../node_modules/.pnpm/@isaacs+cliui@8.0.2/node_modules/@isaacs/cliui/index.mjs
|
|
859
|
-
function ui(opts) {
|
|
860
|
-
return cliui(opts, {
|
|
861
|
-
stringWidth,
|
|
862
|
-
stripAnsi,
|
|
863
|
-
wrap: wrapAnsi
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
// ../../node_modules/.pnpm/jackspeak@4.0.3/node_modules/jackspeak/dist/esm/index.js
|
|
868
|
-
import { basename } from "node:path";
|
|
869
|
-
var isConfigType = (t) => typeof t === "string" && (t === "string" || t === "number" || t === "boolean");
|
|
870
|
-
var isValidValue = (v, type, multi) => {
|
|
871
|
-
if (multi) {
|
|
872
|
-
if (!Array.isArray(v))
|
|
873
|
-
return false;
|
|
874
|
-
return !v.some((v2) => !isValidValue(v2, type, false));
|
|
875
|
-
}
|
|
876
|
-
if (Array.isArray(v))
|
|
877
|
-
return false;
|
|
878
|
-
return typeof v === type;
|
|
879
|
-
};
|
|
880
|
-
var isValidOption = (v, vo) => !!vo && (Array.isArray(v) ? v.every((x) => isValidOption(x, vo)) : vo.includes(v));
|
|
881
|
-
var isConfigOptionOfType = (o, type, multi) => !!o && typeof o === "object" && isConfigType(o.type) && o.type === type && !!o.multiple === multi;
|
|
882
|
-
var isConfigOption = (o, type, multi) => isConfigOptionOfType(o, type, multi) && undefOrType(o.short, "string") && undefOrType(o.description, "string") && undefOrType(o.hint, "string") && undefOrType(o.validate, "function") && (o.type === "boolean" ? o.validOptions === void 0 : undefOrTypeArray(o.validOptions, o.type)) && (o.default === void 0 || isValidValue(o.default, type, multi));
|
|
883
|
-
var isHeading = (r) => r.type === "heading";
|
|
884
|
-
var isDescription = (r) => r.type === "description";
|
|
885
|
-
var width = Math.min(process?.stdout?.columns ?? 80, 80);
|
|
886
|
-
var indent = (n) => (n - 1) * 2;
|
|
887
|
-
var toEnvKey = (pref, key) => [pref, key.replace(/[^a-zA-Z0-9]+/g, " ")].join(" ").trim().toUpperCase().replace(/ /g, "_");
|
|
888
|
-
var toEnvVal = (value, delim = "\n") => {
|
|
889
|
-
const str = typeof value === "string" ? value : typeof value === "boolean" ? value ? "1" : "0" : typeof value === "number" ? String(value) : Array.isArray(value) ? value.map((v) => toEnvVal(v)).join(delim) : (
|
|
890
|
-
/* c8 ignore start */
|
|
891
|
-
void 0
|
|
892
|
-
);
|
|
893
|
-
if (typeof str !== "string") {
|
|
894
|
-
throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`, { cause: { code: "JACKSPEAK" } });
|
|
895
|
-
}
|
|
896
|
-
return str;
|
|
897
|
-
};
|
|
898
|
-
var fromEnvVal = (env, type, multiple, delim = "\n") => multiple ? env ? env.split(delim).map((v) => fromEnvVal(v, type, false)) : [] : type === "string" ? env : type === "boolean" ? env === "1" : +env.trim();
|
|
899
|
-
var undefOrType = (v, t) => v === void 0 || typeof v === t;
|
|
900
|
-
var undefOrTypeArray = (v, t) => v === void 0 || Array.isArray(v) && v.every((x) => typeof x === t);
|
|
901
|
-
var valueType = (v) => typeof v === "string" ? "string" : typeof v === "boolean" ? "boolean" : typeof v === "number" ? "number" : Array.isArray(v) ? `${joinTypes([...new Set(v.map((v2) => valueType(v2)))])}[]` : `${v.type}${v.multiple ? "[]" : ""}`;
|
|
902
|
-
var joinTypes = (types) => types.length === 1 && typeof types[0] === "string" ? types[0] : `(${types.join("|")})`;
|
|
903
|
-
var validateFieldMeta = (field, fieldMeta) => {
|
|
904
|
-
if (fieldMeta) {
|
|
905
|
-
if (field.type !== void 0 && field.type !== fieldMeta.type) {
|
|
906
|
-
throw new TypeError(`invalid type`, {
|
|
907
|
-
cause: {
|
|
908
|
-
found: field.type,
|
|
909
|
-
wanted: [fieldMeta.type, void 0]
|
|
910
|
-
}
|
|
911
|
-
});
|
|
912
|
-
}
|
|
913
|
-
if (field.multiple !== void 0 && !!field.multiple !== fieldMeta.multiple) {
|
|
914
|
-
throw new TypeError(`invalid multiple`, {
|
|
915
|
-
cause: {
|
|
916
|
-
found: field.multiple,
|
|
917
|
-
wanted: [fieldMeta.multiple, void 0]
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
return fieldMeta;
|
|
922
|
-
}
|
|
923
|
-
if (!isConfigType(field.type)) {
|
|
924
|
-
throw new TypeError(`invalid type`, {
|
|
925
|
-
cause: {
|
|
926
|
-
found: field.type,
|
|
927
|
-
wanted: ["string", "number", "boolean"]
|
|
928
|
-
}
|
|
929
|
-
});
|
|
930
|
-
}
|
|
931
|
-
return {
|
|
932
|
-
type: field.type,
|
|
933
|
-
multiple: !!field.multiple
|
|
934
|
-
};
|
|
935
|
-
};
|
|
936
|
-
var validateField = (o, type, multiple) => {
|
|
937
|
-
const validateValidOptions = (def, validOptions) => {
|
|
938
|
-
if (!undefOrTypeArray(validOptions, type)) {
|
|
939
|
-
throw new TypeError("invalid validOptions", {
|
|
940
|
-
cause: {
|
|
941
|
-
found: validOptions,
|
|
942
|
-
wanted: valueType({ type, multiple: true })
|
|
943
|
-
}
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
|
-
if (def !== void 0 && validOptions !== void 0) {
|
|
947
|
-
const valid = Array.isArray(def) ? def.every((v) => validOptions.includes(v)) : validOptions.includes(def);
|
|
948
|
-
if (!valid) {
|
|
949
|
-
throw new TypeError("invalid default value not in validOptions", {
|
|
950
|
-
cause: {
|
|
951
|
-
found: def,
|
|
952
|
-
wanted: validOptions
|
|
953
|
-
}
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
};
|
|
958
|
-
if (o.default !== void 0 && !isValidValue(o.default, type, multiple)) {
|
|
959
|
-
throw new TypeError("invalid default value", {
|
|
960
|
-
cause: {
|
|
961
|
-
found: o.default,
|
|
962
|
-
wanted: valueType({ type, multiple })
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
}
|
|
966
|
-
if (isConfigOptionOfType(o, "number", false) || isConfigOptionOfType(o, "number", true)) {
|
|
967
|
-
validateValidOptions(o.default, o.validOptions);
|
|
968
|
-
} else if (isConfigOptionOfType(o, "string", false) || isConfigOptionOfType(o, "string", true)) {
|
|
969
|
-
validateValidOptions(o.default, o.validOptions);
|
|
970
|
-
} else if (isConfigOptionOfType(o, "boolean", false) || isConfigOptionOfType(o, "boolean", true)) {
|
|
971
|
-
if (o.hint !== void 0) {
|
|
972
|
-
throw new TypeError("cannot provide hint for flag");
|
|
973
|
-
}
|
|
974
|
-
if (o.validOptions !== void 0) {
|
|
975
|
-
throw new TypeError("cannot provide validOptions for flag");
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
return o;
|
|
979
|
-
};
|
|
980
|
-
var toParseArgsOptionsConfig = (options) => {
|
|
981
|
-
return Object.entries(options).reduce((acc, [longOption, o]) => {
|
|
982
|
-
const p = {
|
|
983
|
-
type: "string",
|
|
984
|
-
multiple: !!o.multiple,
|
|
985
|
-
...typeof o.short === "string" ? { short: o.short } : void 0
|
|
986
|
-
};
|
|
987
|
-
const setNoBool = () => {
|
|
988
|
-
if (!longOption.startsWith("no-") && !options[`no-${longOption}`]) {
|
|
989
|
-
acc[`no-${longOption}`] = {
|
|
990
|
-
type: "boolean",
|
|
991
|
-
multiple: !!o.multiple
|
|
992
|
-
};
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
const setDefault = (def, fn) => {
|
|
996
|
-
if (def !== void 0) {
|
|
997
|
-
p.default = fn(def);
|
|
998
|
-
}
|
|
999
|
-
};
|
|
1000
|
-
if (isConfigOption(o, "number", false)) {
|
|
1001
|
-
setDefault(o.default, String);
|
|
1002
|
-
} else if (isConfigOption(o, "number", true)) {
|
|
1003
|
-
setDefault(o.default, (d) => d.map((v) => String(v)));
|
|
1004
|
-
} else if (isConfigOption(o, "string", false) || isConfigOption(o, "string", true)) {
|
|
1005
|
-
setDefault(o.default, (v) => v);
|
|
1006
|
-
} else if (isConfigOption(o, "boolean", false) || isConfigOption(o, "boolean", true)) {
|
|
1007
|
-
p.type = "boolean";
|
|
1008
|
-
setDefault(o.default, (v) => v);
|
|
1009
|
-
setNoBool();
|
|
1010
|
-
}
|
|
1011
|
-
acc[longOption] = p;
|
|
1012
|
-
return acc;
|
|
1013
|
-
}, {});
|
|
1014
|
-
};
|
|
1015
|
-
var Jack = class {
|
|
1016
|
-
#configSet;
|
|
1017
|
-
#shorts;
|
|
1018
|
-
#options;
|
|
1019
|
-
#fields = [];
|
|
1020
|
-
#env;
|
|
1021
|
-
#envPrefix;
|
|
1022
|
-
#allowPositionals;
|
|
1023
|
-
#usage;
|
|
1024
|
-
#usageMarkdown;
|
|
1025
|
-
constructor(options = {}) {
|
|
1026
|
-
this.#options = options;
|
|
1027
|
-
this.#allowPositionals = options.allowPositionals !== false;
|
|
1028
|
-
this.#env = this.#options.env === void 0 ? process.env : this.#options.env;
|
|
1029
|
-
this.#envPrefix = options.envPrefix;
|
|
1030
|
-
this.#configSet = /* @__PURE__ */ Object.create(null);
|
|
1031
|
-
this.#shorts = /* @__PURE__ */ Object.create(null);
|
|
1032
|
-
}
|
|
1033
|
-
/**
|
|
1034
|
-
* Set the default value (which will still be overridden by env or cli)
|
|
1035
|
-
* as if from a parsed config file. The optional `source` param, if
|
|
1036
|
-
* provided, will be included in error messages if a value is invalid or
|
|
1037
|
-
* unknown.
|
|
1038
|
-
*/
|
|
1039
|
-
setConfigValues(values, source = "") {
|
|
1040
|
-
try {
|
|
1041
|
-
this.validate(values);
|
|
1042
|
-
} catch (er) {
|
|
1043
|
-
if (source && er instanceof Error) {
|
|
1044
|
-
const cause = typeof er.cause === "object" ? er.cause : {};
|
|
1045
|
-
er.cause = { ...cause, path: source };
|
|
1046
|
-
}
|
|
1047
|
-
throw er;
|
|
1048
|
-
}
|
|
1049
|
-
for (const [field, value] of Object.entries(values)) {
|
|
1050
|
-
const my = this.#configSet[field];
|
|
1051
|
-
if (!my) {
|
|
1052
|
-
throw new Error("unexpected field in config set: " + field, {
|
|
1053
|
-
cause: {
|
|
1054
|
-
code: "JACKSPEAK",
|
|
1055
|
-
found: field
|
|
1056
|
-
}
|
|
1057
|
-
});
|
|
1058
|
-
}
|
|
1059
|
-
my.default = value;
|
|
1060
|
-
}
|
|
1061
|
-
return this;
|
|
1062
|
-
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Parse a string of arguments, and return the resulting
|
|
1065
|
-
* `{ values, positionals }` object.
|
|
1066
|
-
*
|
|
1067
|
-
* If an {@link JackOptions#envPrefix} is set, then it will read default
|
|
1068
|
-
* values from the environment, and write the resulting values back
|
|
1069
|
-
* to the environment as well.
|
|
1070
|
-
*
|
|
1071
|
-
* Environment values always take precedence over any other value, except
|
|
1072
|
-
* an explicit CLI setting.
|
|
1073
|
-
*/
|
|
1074
|
-
parse(args = process.argv) {
|
|
1075
|
-
this.loadEnvDefaults();
|
|
1076
|
-
const p = this.parseRaw(args);
|
|
1077
|
-
this.applyDefaults(p);
|
|
1078
|
-
this.writeEnv(p);
|
|
1079
|
-
return p;
|
|
1080
|
-
}
|
|
1081
|
-
loadEnvDefaults() {
|
|
1082
|
-
if (this.#envPrefix) {
|
|
1083
|
-
for (const [field, my] of Object.entries(this.#configSet)) {
|
|
1084
|
-
const ek = toEnvKey(this.#envPrefix, field);
|
|
1085
|
-
const env = this.#env[ek];
|
|
1086
|
-
if (env !== void 0) {
|
|
1087
|
-
my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim);
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
applyDefaults(p) {
|
|
1093
|
-
for (const [field, c] of Object.entries(this.#configSet)) {
|
|
1094
|
-
if (c.default !== void 0 && !(field in p.values)) {
|
|
1095
|
-
p.values[field] = c.default;
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
/**
|
|
1100
|
-
* Only parse the command line arguments passed in.
|
|
1101
|
-
* Does not strip off the `node script.js` bits, so it must be just the
|
|
1102
|
-
* arguments you wish to have parsed.
|
|
1103
|
-
* Does not read from or write to the environment, or set defaults.
|
|
1104
|
-
*/
|
|
1105
|
-
parseRaw(args) {
|
|
1106
|
-
if (args === process.argv) {
|
|
1107
|
-
args = args.slice(process._eval !== void 0 ? 1 : 2);
|
|
1108
|
-
}
|
|
1109
|
-
const result = parseArgs({
|
|
1110
|
-
args,
|
|
1111
|
-
options: toParseArgsOptionsConfig(this.#configSet),
|
|
1112
|
-
// always strict, but using our own logic
|
|
1113
|
-
strict: false,
|
|
1114
|
-
allowPositionals: this.#allowPositionals,
|
|
1115
|
-
tokens: true
|
|
1116
|
-
});
|
|
1117
|
-
const p = {
|
|
1118
|
-
values: {},
|
|
1119
|
-
positionals: []
|
|
1120
|
-
};
|
|
1121
|
-
for (const token of result.tokens) {
|
|
1122
|
-
if (token.kind === "positional") {
|
|
1123
|
-
p.positionals.push(token.value);
|
|
1124
|
-
if (this.#options.stopAtPositional || this.#options.stopAtPositionalTest?.(token.value)) {
|
|
1125
|
-
p.positionals.push(...args.slice(token.index + 1));
|
|
1126
|
-
break;
|
|
1127
|
-
}
|
|
1128
|
-
} else if (token.kind === "option") {
|
|
1129
|
-
let value = void 0;
|
|
1130
|
-
if (token.name.startsWith("no-")) {
|
|
1131
|
-
const my2 = this.#configSet[token.name];
|
|
1132
|
-
const pname = token.name.substring("no-".length);
|
|
1133
|
-
const pos = this.#configSet[pname];
|
|
1134
|
-
if (pos && pos.type === "boolean" && (!my2 || my2.type === "boolean" && !!my2.multiple === !!pos.multiple)) {
|
|
1135
|
-
value = false;
|
|
1136
|
-
token.name = pname;
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
const my = this.#configSet[token.name];
|
|
1140
|
-
if (!my) {
|
|
1141
|
-
throw new Error(`Unknown option '${token.rawName}'. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- ${token.rawName}'`, {
|
|
1142
|
-
cause: {
|
|
1143
|
-
code: "JACKSPEAK",
|
|
1144
|
-
found: token.rawName + (token.value ? `=${token.value}` : "")
|
|
1145
|
-
}
|
|
1146
|
-
});
|
|
1147
|
-
}
|
|
1148
|
-
if (value === void 0) {
|
|
1149
|
-
if (token.value === void 0) {
|
|
1150
|
-
if (my.type !== "boolean") {
|
|
1151
|
-
throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, {
|
|
1152
|
-
cause: {
|
|
1153
|
-
code: "JACKSPEAK",
|
|
1154
|
-
name: token.rawName,
|
|
1155
|
-
wanted: valueType(my)
|
|
1156
|
-
}
|
|
1157
|
-
});
|
|
1158
|
-
}
|
|
1159
|
-
value = true;
|
|
1160
|
-
} else {
|
|
1161
|
-
if (my.type === "boolean") {
|
|
1162
|
-
throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { code: "JACKSPEAK", found: token } });
|
|
1163
|
-
}
|
|
1164
|
-
if (my.type === "string") {
|
|
1165
|
-
value = token.value;
|
|
1166
|
-
} else {
|
|
1167
|
-
value = +token.value;
|
|
1168
|
-
if (value !== value) {
|
|
1169
|
-
throw new Error(`Invalid value '${token.value}' provided for '${token.rawName}' option, expected number`, {
|
|
1170
|
-
cause: {
|
|
1171
|
-
code: "JACKSPEAK",
|
|
1172
|
-
name: token.rawName,
|
|
1173
|
-
found: token.value,
|
|
1174
|
-
wanted: "number"
|
|
1175
|
-
}
|
|
1176
|
-
});
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
if (my.multiple) {
|
|
1182
|
-
const pv = p.values;
|
|
1183
|
-
const tn = pv[token.name] ?? [];
|
|
1184
|
-
pv[token.name] = tn;
|
|
1185
|
-
tn.push(value);
|
|
1186
|
-
} else {
|
|
1187
|
-
const pv = p.values;
|
|
1188
|
-
pv[token.name] = value;
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
for (const [field, value] of Object.entries(p.values)) {
|
|
1193
|
-
const valid = this.#configSet[field]?.validate;
|
|
1194
|
-
const validOptions = this.#configSet[field]?.validOptions;
|
|
1195
|
-
const cause = validOptions && !isValidOption(value, validOptions) ? { name: field, found: value, validOptions } : valid && !valid(value) ? { name: field, found: value } : void 0;
|
|
1196
|
-
if (cause) {
|
|
1197
|
-
throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause: { ...cause, code: "JACKSPEAK" } });
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
return p;
|
|
1201
|
-
}
|
|
1202
|
-
/**
|
|
1203
|
-
* do not set fields as 'no-foo' if 'foo' exists and both are bools
|
|
1204
|
-
* just set foo.
|
|
1205
|
-
*/
|
|
1206
|
-
#noNoFields(f, val, s = f) {
|
|
1207
|
-
if (!f.startsWith("no-") || typeof val !== "boolean")
|
|
1208
|
-
return;
|
|
1209
|
-
const yes = f.substring("no-".length);
|
|
1210
|
-
this.#noNoFields(yes, val, s);
|
|
1211
|
-
if (this.#configSet[yes]?.type === "boolean") {
|
|
1212
|
-
throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { code: "JACKSPEAK", found: s, wanted: yes } });
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
/**
|
|
1216
|
-
* Validate that any arbitrary object is a valid configuration `values`
|
|
1217
|
-
* object. Useful when loading config files or other sources.
|
|
1218
|
-
*/
|
|
1219
|
-
validate(o) {
|
|
1220
|
-
if (!o || typeof o !== "object") {
|
|
1221
|
-
throw new Error("Invalid config: not an object", {
|
|
1222
|
-
cause: { code: "JACKSPEAK", found: o }
|
|
1223
|
-
});
|
|
1224
|
-
}
|
|
1225
|
-
const opts = o;
|
|
1226
|
-
for (const field in o) {
|
|
1227
|
-
const value = opts[field];
|
|
1228
|
-
if (value === void 0)
|
|
1229
|
-
continue;
|
|
1230
|
-
this.#noNoFields(field, value);
|
|
1231
|
-
const config = this.#configSet[field];
|
|
1232
|
-
if (!config) {
|
|
1233
|
-
throw new Error(`Unknown config option: ${field}`, {
|
|
1234
|
-
cause: { code: "JACKSPEAK", found: field }
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
if (!isValidValue(value, config.type, !!config.multiple)) {
|
|
1238
|
-
throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, {
|
|
1239
|
-
cause: {
|
|
1240
|
-
code: "JACKSPEAK",
|
|
1241
|
-
name: field,
|
|
1242
|
-
found: value,
|
|
1243
|
-
wanted: valueType(config)
|
|
1244
|
-
}
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1247
|
-
const cause = config.validOptions && !isValidOption(value, config.validOptions) ? { name: field, found: value, validOptions: config.validOptions } : config.validate && !config.validate(value) ? { name: field, found: value } : void 0;
|
|
1248
|
-
if (cause) {
|
|
1249
|
-
throw new Error(`Invalid config value for ${field}: ${value}`, {
|
|
1250
|
-
cause: { ...cause, code: "JACKSPEAK" }
|
|
1251
|
-
});
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
writeEnv(p) {
|
|
1256
|
-
if (!this.#env || !this.#envPrefix)
|
|
1257
|
-
return;
|
|
1258
|
-
for (const [field, value] of Object.entries(p.values)) {
|
|
1259
|
-
const my = this.#configSet[field];
|
|
1260
|
-
this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my?.delim);
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
|
-
/**
|
|
1264
|
-
* Add a heading to the usage output banner
|
|
1265
|
-
*/
|
|
1266
|
-
heading(text, level, { pre = false } = {}) {
|
|
1267
|
-
if (level === void 0) {
|
|
1268
|
-
level = this.#fields.some((r) => isHeading(r)) ? 2 : 1;
|
|
1269
|
-
}
|
|
1270
|
-
this.#fields.push({ type: "heading", text, level, pre });
|
|
1271
|
-
return this;
|
|
1272
|
-
}
|
|
1273
|
-
/**
|
|
1274
|
-
* Add a long-form description to the usage output at this position.
|
|
1275
|
-
*/
|
|
1276
|
-
description(text, { pre } = {}) {
|
|
1277
|
-
this.#fields.push({ type: "description", text, pre });
|
|
1278
|
-
return this;
|
|
1279
|
-
}
|
|
1280
|
-
/**
|
|
1281
|
-
* Add one or more number fields.
|
|
1282
|
-
*/
|
|
1283
|
-
num(fields) {
|
|
1284
|
-
return this.#addFieldsWith(fields, "number", false);
|
|
1285
|
-
}
|
|
1286
|
-
/**
|
|
1287
|
-
* Add one or more multiple number fields.
|
|
1288
|
-
*/
|
|
1289
|
-
numList(fields) {
|
|
1290
|
-
return this.#addFieldsWith(fields, "number", true);
|
|
1291
|
-
}
|
|
1292
|
-
/**
|
|
1293
|
-
* Add one or more string option fields.
|
|
1294
|
-
*/
|
|
1295
|
-
opt(fields) {
|
|
1296
|
-
return this.#addFieldsWith(fields, "string", false);
|
|
1297
|
-
}
|
|
1298
|
-
/**
|
|
1299
|
-
* Add one or more multiple string option fields.
|
|
1300
|
-
*/
|
|
1301
|
-
optList(fields) {
|
|
1302
|
-
return this.#addFieldsWith(fields, "string", true);
|
|
1303
|
-
}
|
|
1304
|
-
/**
|
|
1305
|
-
* Add one or more flag fields.
|
|
1306
|
-
*/
|
|
1307
|
-
flag(fields) {
|
|
1308
|
-
return this.#addFieldsWith(fields, "boolean", false);
|
|
1309
|
-
}
|
|
1310
|
-
/**
|
|
1311
|
-
* Add one or more multiple flag fields.
|
|
1312
|
-
*/
|
|
1313
|
-
flagList(fields) {
|
|
1314
|
-
return this.#addFieldsWith(fields, "boolean", true);
|
|
1315
|
-
}
|
|
1316
|
-
/**
|
|
1317
|
-
* Generic field definition method. Similar to flag/flagList/number/etc,
|
|
1318
|
-
* but you must specify the `type` (and optionally `multiple` and `delim`)
|
|
1319
|
-
* fields on each one, or Jack won't know how to define them.
|
|
1320
|
-
*/
|
|
1321
|
-
addFields(fields) {
|
|
1322
|
-
return this.#addFields(this, fields);
|
|
1323
|
-
}
|
|
1324
|
-
#addFieldsWith(fields, type, multiple) {
|
|
1325
|
-
return this.#addFields(this, fields, {
|
|
1326
|
-
type,
|
|
1327
|
-
multiple
|
|
1328
|
-
});
|
|
1329
|
-
}
|
|
1330
|
-
#addFields(next, fields, opt) {
|
|
1331
|
-
Object.assign(next.#configSet, Object.fromEntries(Object.entries(fields).map(([name, field]) => {
|
|
1332
|
-
this.#validateName(name, field);
|
|
1333
|
-
const { type, multiple } = validateFieldMeta(field, opt);
|
|
1334
|
-
const value = { ...field, type, multiple };
|
|
1335
|
-
validateField(value, type, multiple);
|
|
1336
|
-
next.#fields.push({ type: "config", name, value });
|
|
1337
|
-
return [name, value];
|
|
1338
|
-
})));
|
|
1339
|
-
return next;
|
|
1340
|
-
}
|
|
1341
|
-
#validateName(name, field) {
|
|
1342
|
-
if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) {
|
|
1343
|
-
throw new TypeError(`Invalid option name: ${name}, must be '-' delimited ASCII alphanumeric`);
|
|
1344
|
-
}
|
|
1345
|
-
if (this.#configSet[name]) {
|
|
1346
|
-
throw new TypeError(`Cannot redefine option ${field}`);
|
|
1347
|
-
}
|
|
1348
|
-
if (this.#shorts[name]) {
|
|
1349
|
-
throw new TypeError(`Cannot redefine option ${name}, already in use for ${this.#shorts[name]}`);
|
|
1350
|
-
}
|
|
1351
|
-
if (field.short) {
|
|
1352
|
-
if (!/^[a-zA-Z0-9]$/.test(field.short)) {
|
|
1353
|
-
throw new TypeError(`Invalid ${name} short option: ${field.short}, must be 1 ASCII alphanumeric character`);
|
|
1354
|
-
}
|
|
1355
|
-
if (this.#shorts[field.short]) {
|
|
1356
|
-
throw new TypeError(`Invalid ${name} short option: ${field.short}, already in use for ${this.#shorts[field.short]}`);
|
|
1357
|
-
}
|
|
1358
|
-
this.#shorts[field.short] = name;
|
|
1359
|
-
this.#shorts[name] = name;
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
/**
|
|
1363
|
-
* Return the usage banner for the given configuration
|
|
1364
|
-
*/
|
|
1365
|
-
usage() {
|
|
1366
|
-
if (this.#usage)
|
|
1367
|
-
return this.#usage;
|
|
1368
|
-
let headingLevel = 1;
|
|
1369
|
-
const ui2 = ui({ width });
|
|
1370
|
-
const first = this.#fields[0];
|
|
1371
|
-
let start = first?.type === "heading" ? 1 : 0;
|
|
1372
|
-
if (first?.type === "heading") {
|
|
1373
|
-
ui2.div({
|
|
1374
|
-
padding: [0, 0, 0, 0],
|
|
1375
|
-
text: normalize(first.text)
|
|
1376
|
-
});
|
|
1377
|
-
}
|
|
1378
|
-
ui2.div({ padding: [0, 0, 0, 0], text: "Usage:" });
|
|
1379
|
-
if (this.#options.usage) {
|
|
1380
|
-
ui2.div({
|
|
1381
|
-
text: this.#options.usage,
|
|
1382
|
-
padding: [0, 0, 0, 2]
|
|
1383
|
-
});
|
|
1384
|
-
} else {
|
|
1385
|
-
const cmd = basename(String(process.argv[1]));
|
|
1386
|
-
const shortFlags = [];
|
|
1387
|
-
const shorts = [];
|
|
1388
|
-
const flags = [];
|
|
1389
|
-
const opts = [];
|
|
1390
|
-
for (const [field, config] of Object.entries(this.#configSet)) {
|
|
1391
|
-
if (config.short) {
|
|
1392
|
-
if (config.type === "boolean")
|
|
1393
|
-
shortFlags.push(config.short);
|
|
1394
|
-
else
|
|
1395
|
-
shorts.push([config.short, config.hint || field]);
|
|
1396
|
-
} else {
|
|
1397
|
-
if (config.type === "boolean")
|
|
1398
|
-
flags.push(field);
|
|
1399
|
-
else
|
|
1400
|
-
opts.push([field, config.hint || field]);
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
const sf = shortFlags.length ? " -" + shortFlags.join("") : "";
|
|
1404
|
-
const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join("");
|
|
1405
|
-
const lf = flags.map((k) => ` --${k}`).join("");
|
|
1406
|
-
const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join("");
|
|
1407
|
-
const usage = `${cmd}${sf}${so}${lf}${lo}`.trim();
|
|
1408
|
-
ui2.div({
|
|
1409
|
-
text: usage,
|
|
1410
|
-
padding: [0, 0, 0, 2]
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
ui2.div({ padding: [0, 0, 0, 0], text: "" });
|
|
1414
|
-
const maybeDesc = this.#fields[start];
|
|
1415
|
-
if (maybeDesc && isDescription(maybeDesc)) {
|
|
1416
|
-
const print = normalize(maybeDesc.text, maybeDesc.pre);
|
|
1417
|
-
start++;
|
|
1418
|
-
ui2.div({ padding: [0, 0, 0, 0], text: print });
|
|
1419
|
-
ui2.div({ padding: [0, 0, 0, 0], text: "" });
|
|
1420
|
-
}
|
|
1421
|
-
const { rows, maxWidth } = this.#usageRows(start);
|
|
1422
|
-
for (const row of rows) {
|
|
1423
|
-
if (row.left) {
|
|
1424
|
-
const configIndent = indent(Math.max(headingLevel, 2));
|
|
1425
|
-
if (row.left.length > maxWidth - 3) {
|
|
1426
|
-
ui2.div({ text: row.left, padding: [0, 0, 0, configIndent] });
|
|
1427
|
-
ui2.div({ text: row.text, padding: [0, 0, 0, maxWidth] });
|
|
1428
|
-
} else {
|
|
1429
|
-
ui2.div({
|
|
1430
|
-
text: row.left,
|
|
1431
|
-
padding: [0, 1, 0, configIndent],
|
|
1432
|
-
width: maxWidth
|
|
1433
|
-
}, { padding: [0, 0, 0, 0], text: row.text });
|
|
1434
|
-
}
|
|
1435
|
-
if (row.skipLine) {
|
|
1436
|
-
ui2.div({ padding: [0, 0, 0, 0], text: "" });
|
|
1437
|
-
}
|
|
1438
|
-
} else {
|
|
1439
|
-
if (isHeading(row)) {
|
|
1440
|
-
const { level } = row;
|
|
1441
|
-
headingLevel = level;
|
|
1442
|
-
const b = level <= 2 ? 1 : 0;
|
|
1443
|
-
ui2.div({ ...row, padding: [0, 0, b, indent(level)] });
|
|
1444
|
-
} else {
|
|
1445
|
-
ui2.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] });
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
return this.#usage = ui2.toString();
|
|
1450
|
-
}
|
|
1451
|
-
/**
|
|
1452
|
-
* Return the usage banner markdown for the given configuration
|
|
1453
|
-
*/
|
|
1454
|
-
usageMarkdown() {
|
|
1455
|
-
if (this.#usageMarkdown)
|
|
1456
|
-
return this.#usageMarkdown;
|
|
1457
|
-
const out = [];
|
|
1458
|
-
let headingLevel = 1;
|
|
1459
|
-
const first = this.#fields[0];
|
|
1460
|
-
let start = first?.type === "heading" ? 1 : 0;
|
|
1461
|
-
if (first?.type === "heading") {
|
|
1462
|
-
out.push(`# ${normalizeOneLine(first.text)}`);
|
|
1463
|
-
}
|
|
1464
|
-
out.push("Usage:");
|
|
1465
|
-
if (this.#options.usage) {
|
|
1466
|
-
out.push(normalizeMarkdown(this.#options.usage, true));
|
|
1467
|
-
} else {
|
|
1468
|
-
const cmd = basename(String(process.argv[1]));
|
|
1469
|
-
const shortFlags = [];
|
|
1470
|
-
const shorts = [];
|
|
1471
|
-
const flags = [];
|
|
1472
|
-
const opts = [];
|
|
1473
|
-
for (const [field, config] of Object.entries(this.#configSet)) {
|
|
1474
|
-
if (config.short) {
|
|
1475
|
-
if (config.type === "boolean")
|
|
1476
|
-
shortFlags.push(config.short);
|
|
1477
|
-
else
|
|
1478
|
-
shorts.push([config.short, config.hint || field]);
|
|
1479
|
-
} else {
|
|
1480
|
-
if (config.type === "boolean")
|
|
1481
|
-
flags.push(field);
|
|
1482
|
-
else
|
|
1483
|
-
opts.push([field, config.hint || field]);
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
const sf = shortFlags.length ? " -" + shortFlags.join("") : "";
|
|
1487
|
-
const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join("");
|
|
1488
|
-
const lf = flags.map((k) => ` --${k}`).join("");
|
|
1489
|
-
const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join("");
|
|
1490
|
-
const usage = `${cmd}${sf}${so}${lf}${lo}`.trim();
|
|
1491
|
-
out.push(normalizeMarkdown(usage, true));
|
|
1492
|
-
}
|
|
1493
|
-
const maybeDesc = this.#fields[start];
|
|
1494
|
-
if (maybeDesc && isDescription(maybeDesc)) {
|
|
1495
|
-
out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre));
|
|
1496
|
-
start++;
|
|
1497
|
-
}
|
|
1498
|
-
const { rows } = this.#usageRows(start);
|
|
1499
|
-
for (const row of rows) {
|
|
1500
|
-
if (row.left) {
|
|
1501
|
-
out.push("#".repeat(headingLevel + 1) + " " + normalizeOneLine(row.left, true));
|
|
1502
|
-
if (row.text)
|
|
1503
|
-
out.push(normalizeMarkdown(row.text));
|
|
1504
|
-
} else if (isHeading(row)) {
|
|
1505
|
-
const { level } = row;
|
|
1506
|
-
headingLevel = level;
|
|
1507
|
-
out.push(`${"#".repeat(headingLevel)} ${normalizeOneLine(row.text, row.pre)}`);
|
|
1508
|
-
} else {
|
|
1509
|
-
out.push(normalizeMarkdown(row.text, !!row.pre));
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
return this.#usageMarkdown = out.join("\n\n") + "\n";
|
|
1513
|
-
}
|
|
1514
|
-
#usageRows(start) {
|
|
1515
|
-
let maxMax = Math.max(12, Math.min(26, Math.floor(width / 3)));
|
|
1516
|
-
let maxWidth = 8;
|
|
1517
|
-
let prev = void 0;
|
|
1518
|
-
const rows = [];
|
|
1519
|
-
for (const field of this.#fields.slice(start)) {
|
|
1520
|
-
if (field.type !== "config") {
|
|
1521
|
-
if (prev?.type === "config")
|
|
1522
|
-
prev.skipLine = true;
|
|
1523
|
-
prev = void 0;
|
|
1524
|
-
field.text = normalize(field.text, !!field.pre);
|
|
1525
|
-
rows.push(field);
|
|
1526
|
-
continue;
|
|
1527
|
-
}
|
|
1528
|
-
const { value } = field;
|
|
1529
|
-
const desc = value.description || "";
|
|
1530
|
-
const mult = value.multiple ? "Can be set multiple times" : "";
|
|
1531
|
-
const opts = value.validOptions?.length ? `Valid options:${value.validOptions.map((v) => ` ${JSON.stringify(v)}`)}` : "";
|
|
1532
|
-
const dmDelim = desc.includes("\n") ? "\n\n" : "\n";
|
|
1533
|
-
const extra = [opts, mult].join(dmDelim).trim();
|
|
1534
|
-
const text = (normalize(desc) + dmDelim + extra).trim();
|
|
1535
|
-
const hint = value.hint || (value.type === "number" ? "n" : value.type === "string" ? field.name : void 0);
|
|
1536
|
-
const short = !value.short ? "" : value.type === "boolean" ? `-${value.short} ` : `-${value.short}<${hint}> `;
|
|
1537
|
-
const left2 = value.type === "boolean" ? `${short}--${field.name}` : `${short}--${field.name}=<${hint}>`;
|
|
1538
|
-
const row = { text, left: left2, type: "config" };
|
|
1539
|
-
if (text.length > width - maxMax) {
|
|
1540
|
-
row.skipLine = true;
|
|
1541
|
-
}
|
|
1542
|
-
if (prev && left2.length > maxMax)
|
|
1543
|
-
prev.skipLine = true;
|
|
1544
|
-
prev = row;
|
|
1545
|
-
const len = left2.length + 4;
|
|
1546
|
-
if (len > maxWidth && len < maxMax) {
|
|
1547
|
-
maxWidth = len;
|
|
1548
|
-
}
|
|
1549
|
-
rows.push(row);
|
|
1550
|
-
}
|
|
1551
|
-
return { rows, maxWidth };
|
|
1552
|
-
}
|
|
1553
|
-
/**
|
|
1554
|
-
* Return the configuration options as a plain object
|
|
1555
|
-
*/
|
|
1556
|
-
toJSON() {
|
|
1557
|
-
return Object.fromEntries(Object.entries(this.#configSet).map(([field, def]) => [
|
|
1558
|
-
field,
|
|
1559
|
-
{
|
|
1560
|
-
type: def.type,
|
|
1561
|
-
...def.multiple ? { multiple: true } : {},
|
|
1562
|
-
...def.delim ? { delim: def.delim } : {},
|
|
1563
|
-
...def.short ? { short: def.short } : {},
|
|
1564
|
-
...def.description ? { description: normalize(def.description) } : {},
|
|
1565
|
-
...def.validate ? { validate: def.validate } : {},
|
|
1566
|
-
...def.validOptions ? { validOptions: def.validOptions } : {},
|
|
1567
|
-
...def.default !== void 0 ? { default: def.default } : {},
|
|
1568
|
-
...def.hint ? { hint: def.hint } : {}
|
|
1569
|
-
}
|
|
1570
|
-
]));
|
|
1571
|
-
}
|
|
1572
|
-
/**
|
|
1573
|
-
* Custom printer for `util.inspect`
|
|
1574
|
-
*/
|
|
1575
|
-
[inspect.custom](_, options) {
|
|
1576
|
-
return `Jack ${inspect(this.toJSON(), options)}`;
|
|
1577
|
-
}
|
|
1578
|
-
};
|
|
1579
|
-
var jack = (options = {}) => new Jack(options);
|
|
1580
|
-
var normalize = (s, pre = false) => {
|
|
1581
|
-
if (pre)
|
|
1582
|
-
return s.split("\n").map((l) => `\u200B${l}`).join("\n");
|
|
1583
|
-
return s.split(/^\s*```\s*$/gm).map((s2, i) => {
|
|
1584
|
-
if (i % 2 === 1) {
|
|
1585
|
-
if (!s2.trim()) {
|
|
1586
|
-
return `\`\`\`
|
|
1587
|
-
\`\`\`
|
|
1588
|
-
`;
|
|
1589
|
-
}
|
|
1590
|
-
const split = s2.split("\n");
|
|
1591
|
-
split.pop();
|
|
1592
|
-
split.shift();
|
|
1593
|
-
const si = split.reduce((shortest, l) => {
|
|
1594
|
-
const ind = l.match(/^\s*/)?.[0] ?? "";
|
|
1595
|
-
if (ind.length)
|
|
1596
|
-
return Math.min(ind.length, shortest);
|
|
1597
|
-
else
|
|
1598
|
-
return shortest;
|
|
1599
|
-
}, Infinity);
|
|
1600
|
-
const i2 = isFinite(si) ? si : 0;
|
|
1601
|
-
return "\n```\n" + split.map((s3) => `\u200B${s3.substring(i2)}`).join("\n") + "\n```\n";
|
|
1602
|
-
}
|
|
1603
|
-
return s2.replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}
|
|
1604
|
-
${$2}`).replace(/([^\n])[ \t]+([^\n])/g, "$1 $2").replace(/\n{3,}/g, "\n\n").replace(/\n[ \t]+/g, "\n").trim();
|
|
1605
|
-
}).join("\n");
|
|
1606
|
-
};
|
|
1607
|
-
var normalizeMarkdown = (s, pre = false) => {
|
|
1608
|
-
const n = normalize(s, pre).replace(/\\/g, "\\\\");
|
|
1609
|
-
return pre ? `\`\`\`
|
|
1610
|
-
${n.replace(/\u200b/g, "")}
|
|
1611
|
-
\`\`\`` : n.replace(/\n +/g, "\n").trim();
|
|
1612
|
-
};
|
|
1613
|
-
var normalizeOneLine = (s, pre = false) => {
|
|
1614
|
-
const n = normalize(s, pre).replace(/[\s\u200b]+/g, " ").trim();
|
|
1615
|
-
return pre ? `\`${n}\`` : n;
|
|
1616
|
-
};
|
|
1617
|
-
|
|
1618
|
-
// ../../src/vlt/src/config/definition.ts
|
|
1619
|
-
var defaultView = process.stdout.isTTY ? "human" : "json";
|
|
1620
|
-
var canonicalCommands = {
|
|
1621
|
-
config: "config",
|
|
1622
|
-
exec: "exec",
|
|
1623
|
-
gui: "gui",
|
|
1624
|
-
help: "help",
|
|
1625
|
-
init: "init",
|
|
1626
|
-
"install-exec": "install-exec",
|
|
1627
|
-
install: "install",
|
|
1628
|
-
login: "login",
|
|
1629
|
-
logout: "logout",
|
|
1630
|
-
list: "list",
|
|
1631
|
-
ls: "ls",
|
|
1632
|
-
pkg: "pkg",
|
|
1633
|
-
query: "query",
|
|
1634
|
-
"run-exec": "run-exec",
|
|
1635
|
-
run: "run",
|
|
1636
|
-
token: "token",
|
|
1637
|
-
uninstall: "uninstall",
|
|
1638
|
-
whoami: "whoami"
|
|
1639
|
-
};
|
|
1640
|
-
var aliases = {
|
|
1641
|
-
i: "install",
|
|
1642
|
-
add: "install",
|
|
1643
|
-
rm: "uninstall",
|
|
1644
|
-
u: "uninstall",
|
|
1645
|
-
r: "run",
|
|
1646
|
-
"run-script": "run",
|
|
1647
|
-
rx: "run-exec",
|
|
1648
|
-
x: "exec",
|
|
1649
|
-
h: "help",
|
|
1650
|
-
"?": "help",
|
|
1651
|
-
conf: "config",
|
|
1652
|
-
ix: "install-exec",
|
|
1653
|
-
ls: "list"
|
|
1654
|
-
};
|
|
1655
|
-
var commands = {
|
|
1656
|
-
...canonicalCommands,
|
|
1657
|
-
...aliases
|
|
1658
|
-
};
|
|
1659
|
-
var commandAliases = Object.entries(aliases).reduce(
|
|
1660
|
-
(acc, [alias, canonical]) => {
|
|
1661
|
-
const commandAliases2 = acc.get(canonical);
|
|
1662
|
-
if (commandAliases2) {
|
|
1663
|
-
commandAliases2.push(alias);
|
|
1664
|
-
} else {
|
|
1665
|
-
acc.set(canonical, [alias]);
|
|
1666
|
-
}
|
|
1667
|
-
return acc;
|
|
1668
|
-
},
|
|
1669
|
-
/* @__PURE__ */ new Map()
|
|
1670
|
-
);
|
|
1671
|
-
var getCommand = (s) => s && s in commands ? commands[s] : void 0;
|
|
1672
|
-
var xdg = new XDG("vlt");
|
|
1673
|
-
var cacheDir = xdg.cache();
|
|
1674
|
-
var recordFields = [
|
|
1675
|
-
"git-hosts",
|
|
1676
|
-
"registries",
|
|
1677
|
-
"git-host-archives",
|
|
1678
|
-
"scope-registries"
|
|
1679
|
-
];
|
|
1680
|
-
var isRecordField = (s) => recordFields.includes(s);
|
|
1681
|
-
var stopParsingCommands = [
|
|
1682
|
-
"run",
|
|
1683
|
-
"run-exec",
|
|
1684
|
-
"exec",
|
|
1685
|
-
"install-exec"
|
|
1686
|
-
];
|
|
1687
|
-
var stopParsing = void 0;
|
|
1688
|
-
var j = jack({
|
|
1689
|
-
envPrefix: "VLT",
|
|
1690
|
-
allowPositionals: true,
|
|
1691
|
-
usage: `vlt [<options>] [<cmd> [<args> ...]]`,
|
|
1692
|
-
stopAtPositionalTest: (arg) => {
|
|
1693
|
-
if (stopParsing) return true;
|
|
1694
|
-
const a = arg;
|
|
1695
|
-
if (stopParsingCommands.includes(commands[a])) {
|
|
1696
|
-
stopParsing = true;
|
|
1697
|
-
}
|
|
1698
|
-
return false;
|
|
1699
|
-
}
|
|
1700
|
-
}).heading("vlt").description(
|
|
1701
|
-
`More documentation available at <https://docs.vlt.sh>`
|
|
1702
|
-
).heading("Subcommands");
|
|
1703
|
-
j.description(Object.keys(canonicalCommands).join(", "), {
|
|
1704
|
-
pre: true
|
|
1705
|
-
}).description(
|
|
1706
|
-
"Run `vlt <cmd> --help` for more information about a specific command"
|
|
1707
|
-
);
|
|
1708
|
-
var definition = j.heading("Configuration").description(
|
|
1709
|
-
`If a \`vlt.json\` file is present in the root of the current project,
|
|
1710
|
-
then that will be used as a source of configuration information.
|
|
1711
|
-
|
|
1712
|
-
Next, the \`vlt.json\` file in the XDG specified config directory
|
|
1713
|
-
will be checked, and loaded for any fields not set in the local project.
|
|
1714
|
-
|
|
1715
|
-
Object type values will be merged together. Set a field to \`null\` in
|
|
1716
|
-
the JSON configuration to explicitly remove it.
|
|
1717
|
-
|
|
1718
|
-
Command-specific fields may be set in a nested \`command\` object that
|
|
1719
|
-
overrides any options defined at the top level.
|
|
1720
|
-
`
|
|
1721
|
-
).flag({
|
|
1722
|
-
color: {
|
|
1723
|
-
short: "c",
|
|
1724
|
-
description: "Use colors (Default for TTY)"
|
|
1725
|
-
},
|
|
1726
|
-
"no-color": {
|
|
1727
|
-
short: "C",
|
|
1728
|
-
description: "Do not use colors (Default for non-TTY)"
|
|
1729
|
-
}
|
|
1730
|
-
}).opt({
|
|
1731
|
-
registry: {
|
|
1732
|
-
hint: "url",
|
|
1733
|
-
default: "https://registry.npmjs.org/",
|
|
1734
|
-
description: `Sets the registry for fetching packages, when no registry
|
|
1735
|
-
is explicitly set on a specifier.
|
|
1736
|
-
|
|
1737
|
-
For example, \`express@latest\` will be resolved by looking
|
|
1738
|
-
up the metadata from this registry.
|
|
1739
|
-
|
|
1740
|
-
Note that alias specifiers starting with \`npm:\` will
|
|
1741
|
-
still map to \`https://registry.npmjs.org/\` if this is
|
|
1742
|
-
changed, unless the a new mapping is created via the
|
|
1743
|
-
\`--registries\` option.
|
|
1744
|
-
`
|
|
1745
|
-
}
|
|
1746
|
-
}).optList({
|
|
1747
|
-
registries: {
|
|
1748
|
-
hint: "name=url",
|
|
1749
|
-
description: `Specify named registry hosts by their prefix. To set the
|
|
1750
|
-
default registry used for non-namespaced specifiers,
|
|
1751
|
-
use the \`--registry\` option.
|
|
1752
|
-
|
|
1753
|
-
Prefixes can be used as a package alias. For example:
|
|
1754
|
-
|
|
1755
|
-
\`\`\`
|
|
1756
|
-
vlt --registries loc=http://reg.local install foo@loc:foo@1.x
|
|
1757
|
-
\`\`\`
|
|
1758
|
-
|
|
1759
|
-
By default, the public npm registry is registered to the
|
|
1760
|
-
\`npm:\` prefix. It is not recommended to change this
|
|
1761
|
-
mapping in most cases.
|
|
1762
|
-
`
|
|
1763
|
-
},
|
|
1764
|
-
"scope-registries": {
|
|
1765
|
-
hint: "@scope=url",
|
|
1766
|
-
description: `Map package name scopes to registry URLs.
|
|
1767
|
-
|
|
1768
|
-
For example,
|
|
1769
|
-
\`--scope-registries @acme=https://registry.acme/\`
|
|
1770
|
-
would tell vlt to fetch any packages named
|
|
1771
|
-
\`@acme/...\` from the \`https://registry.acme/\`
|
|
1772
|
-
registry.
|
|
1773
|
-
|
|
1774
|
-
Note: this way of specifying registries is more ambiguous,
|
|
1775
|
-
compared with using the \`--registries\` field and explicit
|
|
1776
|
-
prefixes, because instead of failing when the configuration
|
|
1777
|
-
is absent, it will instead attempt to fetch from the
|
|
1778
|
-
default registry.
|
|
1779
|
-
|
|
1780
|
-
By comparison, using
|
|
1781
|
-
\`--registries acme=https://registry.acme/\` and then
|
|
1782
|
-
specifying dependencies such as \`"foo": "acme:foo@1.x"\`
|
|
1783
|
-
means that regardless of the name, the package will be
|
|
1784
|
-
fetched from the explicitly named registry, or fail if
|
|
1785
|
-
no registry is defined with that name.
|
|
1786
|
-
|
|
1787
|
-
However, custom registry aliases are not supported by other
|
|
1788
|
-
package managers.`
|
|
1789
|
-
},
|
|
1790
|
-
"git-hosts": {
|
|
1791
|
-
hint: `name=template`,
|
|
1792
|
-
short: "G",
|
|
1793
|
-
description: `Map a shorthand name to a git remote URL template.
|
|
1794
|
-
|
|
1795
|
-
The \`template\` may contain placeholders, which will be
|
|
1796
|
-
swapped with the relevant values.
|
|
1797
|
-
|
|
1798
|
-
\`$1\`, \`$2\`, etc. are replaced with the appropriate
|
|
1799
|
-
n-th path portion. For example, \`github:user/project\`
|
|
1800
|
-
would replace the \`$1\` in the template with \`user\`,
|
|
1801
|
-
and \`$2\` with \`project\`.`
|
|
1802
|
-
},
|
|
1803
|
-
"git-host-archives": {
|
|
1804
|
-
hint: `name=template`,
|
|
1805
|
-
short: "A",
|
|
1806
|
-
description: `Similar to the \`--git-host <name>=<template>\` option,
|
|
1807
|
-
this option can define a template string that will be
|
|
1808
|
-
expanded to provide the URL to download a pre-built
|
|
1809
|
-
tarball of the git repository.
|
|
1810
|
-
|
|
1811
|
-
In addition to the n-th path portion expansions performed
|
|
1812
|
-
by \`--git-host\`, this field will also expand the
|
|
1813
|
-
string \`$committish\` in the template, replacing it with
|
|
1814
|
-
the resolved git committish value to be fetched.`
|
|
1815
|
-
}
|
|
1816
|
-
}).opt({
|
|
1817
|
-
cache: {
|
|
1818
|
-
hint: "path",
|
|
1819
|
-
description: `
|
|
1820
|
-
Location of the vlt on-disk cache. Defaults to the platform-specific
|
|
1821
|
-
directory recommended by the XDG specification.
|
|
1822
|
-
`,
|
|
1823
|
-
default: cacheDir
|
|
1824
|
-
},
|
|
1825
|
-
tag: {
|
|
1826
|
-
description: `Default \`dist-tag\` to install`,
|
|
1827
|
-
default: "latest"
|
|
1828
|
-
},
|
|
1829
|
-
before: {
|
|
1830
|
-
hint: "date",
|
|
1831
|
-
description: `Do not install any packages published after this date`
|
|
1832
|
-
},
|
|
1833
|
-
os: {
|
|
1834
|
-
description: `The operating system to use as the selector when choosing
|
|
1835
|
-
packages based on their \`os\` value.`,
|
|
1836
|
-
default: process.platform
|
|
1837
|
-
},
|
|
1838
|
-
arch: {
|
|
1839
|
-
description: `CPU architecture to use as the selector when choosing
|
|
1840
|
-
packages based on their \`cpu\` value.`,
|
|
1841
|
-
default: process.arch
|
|
1842
|
-
},
|
|
1843
|
-
"node-version": {
|
|
1844
|
-
hint: "version",
|
|
1845
|
-
description: `Node version to use when choosing packages based on
|
|
1846
|
-
their \`engines.node\` value.`,
|
|
1847
|
-
default: process.version
|
|
1848
|
-
}
|
|
1849
|
-
}).flag({
|
|
1850
|
-
"git-shallow": {
|
|
1851
|
-
description: `Set to force \`--depth=1\` on all git clone actions.
|
|
1852
|
-
When set explicitly to false with --no-git-shallow,
|
|
1853
|
-
then \`--depth=1\` will not be used.
|
|
1854
|
-
|
|
1855
|
-
When not set explicitly, \`--depth=1\` will be used for
|
|
1856
|
-
git hosts known to support this behavior.`
|
|
1857
|
-
}
|
|
1858
|
-
}).num({
|
|
1859
|
-
"fetch-retries": {
|
|
1860
|
-
hint: "n",
|
|
1861
|
-
description: `Number of retries to perform when encountering network
|
|
1862
|
-
errors or likely-transient errors from git hosts.`,
|
|
1863
|
-
default: 3
|
|
1864
|
-
},
|
|
1865
|
-
"fetch-retry-factor": {
|
|
1866
|
-
hint: "n",
|
|
1867
|
-
description: `The exponential backoff factor to use when retrying
|
|
1868
|
-
requests due to network issues.`,
|
|
1869
|
-
default: 2
|
|
1870
|
-
},
|
|
1871
|
-
"fetch-retry-mintimeout": {
|
|
1872
|
-
hint: "n",
|
|
1873
|
-
description: `Number of milliseconds before starting first retry`,
|
|
1874
|
-
default: 0
|
|
1875
|
-
},
|
|
1876
|
-
"fetch-retry-maxtimeout": {
|
|
1877
|
-
hint: "n",
|
|
1878
|
-
description: `Maximum number of milliseconds between two retries`,
|
|
1879
|
-
default: 3e4
|
|
1880
|
-
}
|
|
1881
|
-
}).opt({
|
|
1882
|
-
identity: {
|
|
1883
|
-
short: "i",
|
|
1884
|
-
validate: (v) => typeof v === "string" && /^[a-z0-9]*$/.test(v),
|
|
1885
|
-
hint: "name",
|
|
1886
|
-
default: "",
|
|
1887
|
-
description: `Provide a string to define an identity for storing auth
|
|
1888
|
-
information when logging into registries.
|
|
1889
|
-
|
|
1890
|
-
Authentication tokens will be stored in the XDG data
|
|
1891
|
-
directory, in \`vlt/auth/\${identity}/keychain.json\`.
|
|
1892
|
-
|
|
1893
|
-
If no identity is provided, then the default \`''\` will
|
|
1894
|
-
be used, storing the file at \`vlt/auth/keychain.json\`.
|
|
1895
|
-
|
|
1896
|
-
May only contain lowercase alphanumeric characters.
|
|
1897
|
-
`
|
|
1898
|
-
}
|
|
1899
|
-
}).optList({
|
|
1900
|
-
workspace: {
|
|
1901
|
-
hint: "ws",
|
|
1902
|
-
short: "w",
|
|
1903
|
-
description: `Set to limit the spaces being worked on when working on
|
|
1904
|
-
workspaces.
|
|
1905
|
-
|
|
1906
|
-
Can be paths or glob patterns matching paths.
|
|
1907
|
-
|
|
1908
|
-
Specifying workspaces by package.json name is not
|
|
1909
|
-
supported.`
|
|
1910
|
-
},
|
|
1911
|
-
"workspace-group": {
|
|
1912
|
-
short: "g",
|
|
1913
|
-
description: `Specify named workspace group names to load and operate on
|
|
1914
|
-
when doing recursive operations on workspaces.`
|
|
1915
|
-
}
|
|
1916
|
-
}).flag({
|
|
1917
|
-
recursive: {
|
|
1918
|
-
short: "r",
|
|
1919
|
-
description: `Run an operation across multiple workspaces.
|
|
1920
|
-
|
|
1921
|
-
No effect when used in non-monorepo projects.
|
|
1922
|
-
|
|
1923
|
-
Implied by setting --workspace or --workspace-group. If
|
|
1924
|
-
not set, then the action is run on the project root.`
|
|
1925
|
-
},
|
|
1926
|
-
bail: {
|
|
1927
|
-
short: "b",
|
|
1928
|
-
description: `When running scripts across multiple workspaces, stop
|
|
1929
|
-
on the first failure.`,
|
|
1930
|
-
default: true
|
|
1931
|
-
},
|
|
1932
|
-
"no-bail": {
|
|
1933
|
-
short: "B",
|
|
1934
|
-
description: `When running scripts across multiple workspaces, continue
|
|
1935
|
-
on failure, running the script for all workspaces.`
|
|
1936
|
-
}
|
|
1937
|
-
}).opt({
|
|
1938
|
-
config: {
|
|
1939
|
-
hint: "user | project",
|
|
1940
|
-
description: `Specify whether to operate on user-level or project-level
|
|
1941
|
-
configuration files when running \`vlt config\` commands.`,
|
|
1942
|
-
validOptions: ["user", "project"],
|
|
1943
|
-
default: "project"
|
|
1944
|
-
},
|
|
1945
|
-
editor: {
|
|
1946
|
-
hint: "program",
|
|
1947
|
-
description: `The blocking editor to use for \`vlt config edit\` and
|
|
1948
|
-
any other cases where a file should be opened for
|
|
1949
|
-
editing.
|
|
1950
|
-
|
|
1951
|
-
Defaults to the \`EDITOR\` or \`VISUAL\` env if set, or
|
|
1952
|
-
\`notepad.exe\` on Windows, or \`vi\` elsewhere.`,
|
|
1953
|
-
default: process.env.EDITOR || process.env.VISUAL || (process.platform === "win32" ? `${process.env.SYSTEMROOT}\\notepad.exe` : "vi")
|
|
1954
|
-
},
|
|
1955
|
-
"script-shell": {
|
|
1956
|
-
hint: "program",
|
|
1957
|
-
description: `The shell to use when executing \`package.json#scripts\`
|
|
1958
|
-
(either as lifecycle scripts or explicitly with
|
|
1959
|
-
\`vlt run\`) and \`vlt exec\`.
|
|
1960
|
-
|
|
1961
|
-
If not set, defaults to \`/bin/sh\` on POSIX systems,
|
|
1962
|
-
and \`cmd.exe\` on Windows.
|
|
1963
|
-
|
|
1964
|
-
When no argument is provided to \`vlt exec\`, the \`SHELL\`
|
|
1965
|
-
environment variable takes precedence if set.`
|
|
1966
|
-
},
|
|
1967
|
-
"fallback-command": {
|
|
1968
|
-
hint: "command",
|
|
1969
|
-
description: `The command to run when the first argument doesn't
|
|
1970
|
-
match any known commands.
|
|
1971
|
-
|
|
1972
|
-
For pnpm-style behavior, set this to 'run-exec'. e.g:
|
|
1973
|
-
\`\`\`
|
|
1974
|
-
vlt config set fallback-command=run-exec
|
|
1975
|
-
\`\`\``,
|
|
1976
|
-
default: "help",
|
|
1977
|
-
validOptions: Object.keys(canonicalCommands)
|
|
1978
|
-
}
|
|
1979
|
-
}).opt({
|
|
1980
|
-
package: {
|
|
1981
|
-
hint: "p",
|
|
1982
|
-
description: `When running \`vlt install-exec\`, this allows you to
|
|
1983
|
-
explicitly set the package to search for bins. If not
|
|
1984
|
-
provided, then vlt will interpret the first argument as
|
|
1985
|
-
the package, and attempt to run the default executable.`
|
|
1986
|
-
}
|
|
1987
|
-
}).opt({
|
|
1988
|
-
view: {
|
|
1989
|
-
hint: "output",
|
|
1990
|
-
default: defaultView,
|
|
1991
|
-
description: `Configures the output format for commands.
|
|
1992
|
-
|
|
1993
|
-
Defaults to \`human\` if stdout is a TTY, or \`json\`
|
|
1994
|
-
if it is not.
|
|
1995
|
-
|
|
1996
|
-
- human: Maximally ergonomic output reporting for human
|
|
1997
|
-
consumption.
|
|
1998
|
-
- json: Parseable JSON output for machines.
|
|
1999
|
-
- inspect: Output results with \`util.inspect\`.
|
|
2000
|
-
- gui: Start a local web server and opens a browser to
|
|
2001
|
-
explore the results. (Only relevant for certain
|
|
2002
|
-
commands.)
|
|
2003
|
-
- mermaid: Output mermaid diagramming syntax. (Only
|
|
2004
|
-
relevant for certain commands.)
|
|
2005
|
-
|
|
2006
|
-
If the requested view format is not supported for the
|
|
2007
|
-
current command, or if no option is provided, then it
|
|
2008
|
-
will fall back to the default.
|
|
2009
|
-
`,
|
|
2010
|
-
validOptions: [
|
|
2011
|
-
"human",
|
|
2012
|
-
"json",
|
|
2013
|
-
"mermaid",
|
|
2014
|
-
"gui",
|
|
2015
|
-
"inspect"
|
|
2016
|
-
]
|
|
2017
|
-
}
|
|
2018
|
-
}).optList({
|
|
2019
|
-
"dashboard-root": {
|
|
2020
|
-
hint: "path",
|
|
2021
|
-
description: `The root directory to use for the dashboard GUI.
|
|
2022
|
-
If not set, the user home directory is used.`
|
|
2023
|
-
}
|
|
2024
|
-
}).flag({
|
|
2025
|
-
"save-dev": {
|
|
2026
|
-
short: "D",
|
|
2027
|
-
description: `Save installed packages to a package.json file as
|
|
2028
|
-
devDependencies`
|
|
2029
|
-
},
|
|
2030
|
-
"save-optional": {
|
|
2031
|
-
short: "O",
|
|
2032
|
-
description: `Save installed packages to a package.json file as
|
|
2033
|
-
optionalDependencies`
|
|
2034
|
-
},
|
|
2035
|
-
"save-peer": {
|
|
2036
|
-
description: `Save installed packages to a package.json file as
|
|
2037
|
-
peerDependencies`
|
|
2038
|
-
},
|
|
2039
|
-
"save-prod": {
|
|
2040
|
-
short: "P",
|
|
2041
|
-
description: `Save installed packages into dependencies specifically.
|
|
2042
|
-
This is useful if a package already exists in
|
|
2043
|
-
devDependencies or optionalDependencies, but you want to
|
|
2044
|
-
move it to be a non-optional production dependency.`
|
|
2045
|
-
}
|
|
2046
|
-
}).flag({
|
|
2047
|
-
version: {
|
|
2048
|
-
short: "v",
|
|
2049
|
-
description: "Print the version"
|
|
2050
|
-
}
|
|
2051
|
-
}).flag({
|
|
2052
|
-
help: {
|
|
2053
|
-
short: "h",
|
|
2054
|
-
description: "Print helpful information"
|
|
2055
|
-
}
|
|
2056
|
-
});
|
|
2057
|
-
|
|
2058
|
-
export {
|
|
2059
|
-
XDG,
|
|
2060
|
-
stripAnsi,
|
|
2061
|
-
ansi_styles_default,
|
|
2062
|
-
jack,
|
|
2063
|
-
defaultView,
|
|
2064
|
-
commands,
|
|
2065
|
-
commandAliases,
|
|
2066
|
-
getCommand,
|
|
2067
|
-
recordFields,
|
|
2068
|
-
isRecordField,
|
|
2069
|
-
definition
|
|
2070
|
-
};
|
|
2071
|
-
//# sourceMappingURL=chunk-LNUDEBGP.js.map
|