@jlmx/starter 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -830
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -1,820 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
-
for (let key of __getOwnPropNames(mod))
|
|
12
|
-
if (!__hasOwnProp.call(to, key))
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: () => mod[key],
|
|
15
|
-
enumerable: true
|
|
16
|
-
});
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
20
|
-
|
|
21
|
-
// node_modules/sisteransi/src/index.js
|
|
22
|
-
var require_src = __commonJS((exports, module) => {
|
|
23
|
-
var ESC = "\x1B";
|
|
24
|
-
var CSI = `${ESC}[`;
|
|
25
|
-
var beep = "\x07";
|
|
26
|
-
var cursor = {
|
|
27
|
-
to(x, y) {
|
|
28
|
-
if (!y)
|
|
29
|
-
return `${CSI}${x + 1}G`;
|
|
30
|
-
return `${CSI}${y + 1};${x + 1}H`;
|
|
31
|
-
},
|
|
32
|
-
move(x, y) {
|
|
33
|
-
let ret = "";
|
|
34
|
-
if (x < 0)
|
|
35
|
-
ret += `${CSI}${-x}D`;
|
|
36
|
-
else if (x > 0)
|
|
37
|
-
ret += `${CSI}${x}C`;
|
|
38
|
-
if (y < 0)
|
|
39
|
-
ret += `${CSI}${-y}A`;
|
|
40
|
-
else if (y > 0)
|
|
41
|
-
ret += `${CSI}${y}B`;
|
|
42
|
-
return ret;
|
|
43
|
-
},
|
|
44
|
-
up: (count = 1) => `${CSI}${count}A`,
|
|
45
|
-
down: (count = 1) => `${CSI}${count}B`,
|
|
46
|
-
forward: (count = 1) => `${CSI}${count}C`,
|
|
47
|
-
backward: (count = 1) => `${CSI}${count}D`,
|
|
48
|
-
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
49
|
-
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
50
|
-
left: `${CSI}G`,
|
|
51
|
-
hide: `${CSI}?25l`,
|
|
52
|
-
show: `${CSI}?25h`,
|
|
53
|
-
save: `${ESC}7`,
|
|
54
|
-
restore: `${ESC}8`
|
|
55
|
-
};
|
|
56
|
-
var scroll = {
|
|
57
|
-
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
58
|
-
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
59
|
-
};
|
|
60
|
-
var erase = {
|
|
61
|
-
screen: `${CSI}2J`,
|
|
62
|
-
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
63
|
-
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
64
|
-
line: `${CSI}2K`,
|
|
65
|
-
lineEnd: `${CSI}K`,
|
|
66
|
-
lineStart: `${CSI}1K`,
|
|
67
|
-
lines(count) {
|
|
68
|
-
let clear = "";
|
|
69
|
-
for (let i = 0;i < count; i++)
|
|
70
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
71
|
-
if (count)
|
|
72
|
-
clear += cursor.left;
|
|
73
|
-
return clear;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// node_modules/picocolors/picocolors.js
|
|
80
|
-
var require_picocolors = __commonJS((exports, module) => {
|
|
81
|
-
var p = process || {};
|
|
82
|
-
var argv = p.argv || [];
|
|
83
|
-
var env = p.env || {};
|
|
84
|
-
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
85
|
-
var formatter = (open, close, replace = open) => (input) => {
|
|
86
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
87
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
88
|
-
};
|
|
89
|
-
var replaceClose = (string, close, replace, index) => {
|
|
90
|
-
let result = "", cursor = 0;
|
|
91
|
-
do {
|
|
92
|
-
result += string.substring(cursor, index) + replace;
|
|
93
|
-
cursor = index + close.length;
|
|
94
|
-
index = string.indexOf(close, cursor);
|
|
95
|
-
} while (~index);
|
|
96
|
-
return result + string.substring(cursor);
|
|
97
|
-
};
|
|
98
|
-
var createColors = (enabled = isColorSupported) => {
|
|
99
|
-
let f = enabled ? formatter : () => String;
|
|
100
|
-
return {
|
|
101
|
-
isColorSupported: enabled,
|
|
102
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
103
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
104
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
105
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
106
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
107
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
108
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
109
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
110
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
111
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
112
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
113
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
114
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
115
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
116
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
117
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
118
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
119
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
120
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
121
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
122
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
123
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
124
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
125
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
126
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
127
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
128
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
129
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
130
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
131
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
132
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
133
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
134
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
135
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
136
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
137
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
138
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
139
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
140
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
141
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
142
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
module.exports = createColors();
|
|
146
|
-
module.exports.createColors = createColors;
|
|
147
|
-
});
|
|
148
3
|
|
|
149
4
|
// src/index.ts
|
|
150
5
|
import { cp, mkdir, readFile, symlink, writeFile } from "fs/promises";
|
|
151
6
|
import { dirname, join, resolve } from "path";
|
|
152
7
|
import { fileURLToPath } from "url";
|
|
153
|
-
|
|
154
|
-
// node_modules/@clack/core/dist/index.mjs
|
|
155
|
-
var import_sisteransi = __toESM(require_src(), 1);
|
|
156
|
-
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
157
|
-
import { stdin as $, stdout as j } from "node:process";
|
|
158
|
-
import * as f from "node:readline";
|
|
159
|
-
import M from "node:readline";
|
|
160
|
-
import { WriteStream as U } from "node:tty";
|
|
161
|
-
function J({ onlyFirst: t = false } = {}) {
|
|
162
|
-
const F = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
163
|
-
return new RegExp(F, t ? undefined : "g");
|
|
164
|
-
}
|
|
165
|
-
var Q = J();
|
|
166
|
-
function T(t) {
|
|
167
|
-
if (typeof t != "string")
|
|
168
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
169
|
-
return t.replace(Q, "");
|
|
170
|
-
}
|
|
171
|
-
function O(t) {
|
|
172
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
173
|
-
}
|
|
174
|
-
var P = { exports: {} };
|
|
175
|
-
(function(t) {
|
|
176
|
-
var u = {};
|
|
177
|
-
t.exports = u, u.eastAsianWidth = function(e) {
|
|
178
|
-
var s = e.charCodeAt(0), i = e.length == 2 ? e.charCodeAt(1) : 0, D = s;
|
|
179
|
-
return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
|
|
180
|
-
}, u.characterLength = function(e) {
|
|
181
|
-
var s = this.eastAsianWidth(e);
|
|
182
|
-
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
183
|
-
};
|
|
184
|
-
function F(e) {
|
|
185
|
-
return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
186
|
-
}
|
|
187
|
-
u.length = function(e) {
|
|
188
|
-
for (var s = F(e), i = 0, D = 0;D < s.length; D++)
|
|
189
|
-
i = i + this.characterLength(s[D]);
|
|
190
|
-
return i;
|
|
191
|
-
}, u.slice = function(e, s, i) {
|
|
192
|
-
textLen = u.length(e), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
|
|
193
|
-
for (var D = "", C = 0, o = F(e), E = 0;E < o.length; E++) {
|
|
194
|
-
var a = o[E], n = u.length(a);
|
|
195
|
-
if (C >= s - (n == 2 ? 1 : 0))
|
|
196
|
-
if (C + n <= i)
|
|
197
|
-
D += a;
|
|
198
|
-
else
|
|
199
|
-
break;
|
|
200
|
-
C += n;
|
|
201
|
-
}
|
|
202
|
-
return D;
|
|
203
|
-
};
|
|
204
|
-
})(P);
|
|
205
|
-
var X = P.exports;
|
|
206
|
-
var DD = O(X);
|
|
207
|
-
var uD = function() {
|
|
208
|
-
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;
|
|
209
|
-
};
|
|
210
|
-
var FD = O(uD);
|
|
211
|
-
function A(t, u = {}) {
|
|
212
|
-
if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = T(t), t.length === 0))
|
|
213
|
-
return 0;
|
|
214
|
-
t = t.replace(FD(), " ");
|
|
215
|
-
const F = u.ambiguousIsNarrow ? 1 : 2;
|
|
216
|
-
let e = 0;
|
|
217
|
-
for (const s of t) {
|
|
218
|
-
const i = s.codePointAt(0);
|
|
219
|
-
if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879)
|
|
220
|
-
continue;
|
|
221
|
-
switch (DD.eastAsianWidth(s)) {
|
|
222
|
-
case "F":
|
|
223
|
-
case "W":
|
|
224
|
-
e += 2;
|
|
225
|
-
break;
|
|
226
|
-
case "A":
|
|
227
|
-
e += F;
|
|
228
|
-
break;
|
|
229
|
-
default:
|
|
230
|
-
e += 1;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return e;
|
|
234
|
-
}
|
|
235
|
-
var m = 10;
|
|
236
|
-
var L = (t = 0) => (u) => `\x1B[${u + t}m`;
|
|
237
|
-
var N = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`;
|
|
238
|
-
var I = (t = 0) => (u, F, e) => `\x1B[${38 + t};2;${u};${F};${e}m`;
|
|
239
|
-
var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
240
|
-
Object.keys(r.modifier);
|
|
241
|
-
var tD = Object.keys(r.color);
|
|
242
|
-
var eD = Object.keys(r.bgColor);
|
|
243
|
-
[...tD, ...eD];
|
|
244
|
-
function sD() {
|
|
245
|
-
const t = new Map;
|
|
246
|
-
for (const [u, F] of Object.entries(r)) {
|
|
247
|
-
for (const [e, s] of Object.entries(F))
|
|
248
|
-
r[e] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F[e] = r[e], t.set(s[0], s[1]);
|
|
249
|
-
Object.defineProperty(r, u, { value: F, enumerable: false });
|
|
250
|
-
}
|
|
251
|
-
return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = N(), r.color.ansi16m = I(), r.bgColor.ansi = L(m), r.bgColor.ansi256 = N(m), r.bgColor.ansi16m = I(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e) => u === F && F === e ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
|
|
252
|
-
const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
|
|
253
|
-
if (!F)
|
|
254
|
-
return [0, 0, 0];
|
|
255
|
-
let [e] = F;
|
|
256
|
-
e.length === 3 && (e = [...e].map((i) => i + i).join(""));
|
|
257
|
-
const s = Number.parseInt(e, 16);
|
|
258
|
-
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
259
|
-
}, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
|
|
260
|
-
if (u < 8)
|
|
261
|
-
return 30 + u;
|
|
262
|
-
if (u < 16)
|
|
263
|
-
return 90 + (u - 8);
|
|
264
|
-
let F, e, s;
|
|
265
|
-
if (u >= 232)
|
|
266
|
-
F = ((u - 232) * 10 + 8) / 255, e = F, s = F;
|
|
267
|
-
else {
|
|
268
|
-
u -= 16;
|
|
269
|
-
const C = u % 36;
|
|
270
|
-
F = Math.floor(u / 36) / 5, e = Math.floor(C / 6) / 5, s = C % 6 / 5;
|
|
271
|
-
}
|
|
272
|
-
const i = Math.max(F, e, s) * 2;
|
|
273
|
-
if (i === 0)
|
|
274
|
-
return 30;
|
|
275
|
-
let D = 30 + (Math.round(s) << 2 | Math.round(e) << 1 | Math.round(F));
|
|
276
|
-
return i === 2 && (D += 60), D;
|
|
277
|
-
}, enumerable: false }, rgbToAnsi: { value: (u, F, e) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
|
|
278
|
-
}
|
|
279
|
-
var iD = sD();
|
|
280
|
-
var v = new Set(["\x1B", ""]);
|
|
281
|
-
var CD = 39;
|
|
282
|
-
var w = "\x07";
|
|
283
|
-
var W = "[";
|
|
284
|
-
var rD = "]";
|
|
285
|
-
var R = "m";
|
|
286
|
-
var y = `${rD}8;;`;
|
|
287
|
-
var V = (t) => `${v.values().next().value}${W}${t}${R}`;
|
|
288
|
-
var z = (t) => `${v.values().next().value}${y}${t}${w}`;
|
|
289
|
-
var ED = (t) => t.split(" ").map((u) => A(u));
|
|
290
|
-
var _ = (t, u, F) => {
|
|
291
|
-
const e = [...u];
|
|
292
|
-
let s = false, i = false, D = A(T(t[t.length - 1]));
|
|
293
|
-
for (const [C, o] of e.entries()) {
|
|
294
|
-
const E = A(o);
|
|
295
|
-
if (D + E <= F ? t[t.length - 1] += o : (t.push(o), D = 0), v.has(o) && (s = true, i = e.slice(C + 1).join("").startsWith(y)), s) {
|
|
296
|
-
i ? o === w && (s = false, i = false) : o === R && (s = false);
|
|
297
|
-
continue;
|
|
298
|
-
}
|
|
299
|
-
D += E, D === F && C < e.length - 1 && (t.push(""), D = 0);
|
|
300
|
-
}
|
|
301
|
-
!D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
302
|
-
};
|
|
303
|
-
var nD = (t) => {
|
|
304
|
-
const u = t.split(" ");
|
|
305
|
-
let F = u.length;
|
|
306
|
-
for (;F > 0 && !(A(u[F - 1]) > 0); )
|
|
307
|
-
F--;
|
|
308
|
-
return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
|
|
309
|
-
};
|
|
310
|
-
var oD = (t, u, F = {}) => {
|
|
311
|
-
if (F.trim !== false && t.trim() === "")
|
|
312
|
-
return "";
|
|
313
|
-
let e = "", s, i;
|
|
314
|
-
const D = ED(t);
|
|
315
|
-
let C = [""];
|
|
316
|
-
for (const [E, a] of t.split(" ").entries()) {
|
|
317
|
-
F.trim !== false && (C[C.length - 1] = C[C.length - 1].trimStart());
|
|
318
|
-
let n = A(C[C.length - 1]);
|
|
319
|
-
if (E !== 0 && (n >= u && (F.wordWrap === false || F.trim === false) && (C.push(""), n = 0), (n > 0 || F.trim === false) && (C[C.length - 1] += " ", n++)), F.hard && D[E] > u) {
|
|
320
|
-
const B = u - n, p = 1 + Math.floor((D[E] - B - 1) / u);
|
|
321
|
-
Math.floor((D[E] - 1) / u) < p && C.push(""), _(C, a, u);
|
|
322
|
-
continue;
|
|
323
|
-
}
|
|
324
|
-
if (n + D[E] > u && n > 0 && D[E] > 0) {
|
|
325
|
-
if (F.wordWrap === false && n < u) {
|
|
326
|
-
_(C, a, u);
|
|
327
|
-
continue;
|
|
328
|
-
}
|
|
329
|
-
C.push("");
|
|
330
|
-
}
|
|
331
|
-
if (n + D[E] > u && F.wordWrap === false) {
|
|
332
|
-
_(C, a, u);
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
|
-
C[C.length - 1] += a;
|
|
336
|
-
}
|
|
337
|
-
F.trim !== false && (C = C.map((E) => nD(E)));
|
|
338
|
-
const o = [...C.join(`
|
|
339
|
-
`)];
|
|
340
|
-
for (const [E, a] of o.entries()) {
|
|
341
|
-
if (e += a, v.has(a)) {
|
|
342
|
-
const { groups: B } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${y}(?<uri>.*)${w})`).exec(o.slice(E).join("")) || { groups: {} };
|
|
343
|
-
if (B.code !== undefined) {
|
|
344
|
-
const p = Number.parseFloat(B.code);
|
|
345
|
-
s = p === CD ? undefined : p;
|
|
346
|
-
} else
|
|
347
|
-
B.uri !== undefined && (i = B.uri.length === 0 ? undefined : B.uri);
|
|
348
|
-
}
|
|
349
|
-
const n = iD.codes.get(Number(s));
|
|
350
|
-
o[E + 1] === `
|
|
351
|
-
` ? (i && (e += z("")), s && n && (e += V(n))) : a === `
|
|
352
|
-
` && (s && n && (e += V(s)), i && (e += z(i)));
|
|
353
|
-
}
|
|
354
|
-
return e;
|
|
355
|
-
};
|
|
356
|
-
function G(t, u, F) {
|
|
357
|
-
return String(t).normalize().replace(/\r\n/g, `
|
|
358
|
-
`).split(`
|
|
359
|
-
`).map((e) => oD(e, u, F)).join(`
|
|
360
|
-
`);
|
|
361
|
-
}
|
|
362
|
-
var aD = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
363
|
-
var c = { actions: new Set(aD), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]) };
|
|
364
|
-
function k(t, u) {
|
|
365
|
-
if (typeof t == "string")
|
|
366
|
-
return c.aliases.get(t) === u;
|
|
367
|
-
for (const F of t)
|
|
368
|
-
if (F !== undefined && k(F, u))
|
|
369
|
-
return true;
|
|
370
|
-
return false;
|
|
371
|
-
}
|
|
372
|
-
function lD(t, u) {
|
|
373
|
-
if (t === u)
|
|
374
|
-
return;
|
|
375
|
-
const F = t.split(`
|
|
376
|
-
`), e = u.split(`
|
|
377
|
-
`), s = [];
|
|
378
|
-
for (let i = 0;i < Math.max(F.length, e.length); i++)
|
|
379
|
-
F[i] !== e[i] && s.push(i);
|
|
380
|
-
return s;
|
|
381
|
-
}
|
|
382
|
-
var xD = globalThis.process.platform.startsWith("win");
|
|
383
|
-
var S = Symbol("clack:cancel");
|
|
384
|
-
function BD(t) {
|
|
385
|
-
return t === S;
|
|
386
|
-
}
|
|
387
|
-
function d(t, u) {
|
|
388
|
-
const F = t;
|
|
389
|
-
F.isTTY && F.setRawMode(u);
|
|
390
|
-
}
|
|
391
|
-
function cD({ input: t = $, output: u = j, overwrite: F = true, hideCursor: e = true } = {}) {
|
|
392
|
-
const s = f.createInterface({ input: t, output: u, prompt: "", tabSize: 1 });
|
|
393
|
-
f.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(true);
|
|
394
|
-
const i = (D, { name: C, sequence: o }) => {
|
|
395
|
-
const E = String(D);
|
|
396
|
-
if (k([E, C, o], "cancel")) {
|
|
397
|
-
e && u.write(import_sisteransi.cursor.show), process.exit(0);
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
if (!F)
|
|
401
|
-
return;
|
|
402
|
-
const a = C === "return" ? 0 : -1, n = C === "return" ? -1 : 0;
|
|
403
|
-
f.moveCursor(u, a, n, () => {
|
|
404
|
-
f.clearLine(u, 1, () => {
|
|
405
|
-
t.once("keypress", i);
|
|
406
|
-
});
|
|
407
|
-
});
|
|
408
|
-
};
|
|
409
|
-
return e && u.write(import_sisteransi.cursor.hide), t.once("keypress", i), () => {
|
|
410
|
-
t.off("keypress", i), e && u.write(import_sisteransi.cursor.show), t.isTTY && !xD && t.setRawMode(false), s.terminal = false, s.close();
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
var AD = Object.defineProperty;
|
|
414
|
-
var pD = (t, u, F) => (u in t) ? AD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
|
|
415
|
-
var h = (t, u, F) => (pD(t, typeof u != "symbol" ? u + "" : u, F), F);
|
|
416
|
-
|
|
417
|
-
class x {
|
|
418
|
-
constructor(u, F = true) {
|
|
419
|
-
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", new Map), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
420
|
-
const { input: e = $, output: s = j, render: i, signal: D, ...C } = u;
|
|
421
|
-
this.opts = C, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = F, this._abortSignal = D, this.input = e, this.output = s;
|
|
422
|
-
}
|
|
423
|
-
unsubscribe() {
|
|
424
|
-
this._subscribers.clear();
|
|
425
|
-
}
|
|
426
|
-
setSubscriber(u, F) {
|
|
427
|
-
const e = this._subscribers.get(u) ?? [];
|
|
428
|
-
e.push(F), this._subscribers.set(u, e);
|
|
429
|
-
}
|
|
430
|
-
on(u, F) {
|
|
431
|
-
this.setSubscriber(u, { cb: F });
|
|
432
|
-
}
|
|
433
|
-
once(u, F) {
|
|
434
|
-
this.setSubscriber(u, { cb: F, once: true });
|
|
435
|
-
}
|
|
436
|
-
emit(u, ...F) {
|
|
437
|
-
const e = this._subscribers.get(u) ?? [], s = [];
|
|
438
|
-
for (const i of e)
|
|
439
|
-
i.cb(...F), i.once && s.push(() => e.splice(e.indexOf(i), 1));
|
|
440
|
-
for (const i of s)
|
|
441
|
-
i();
|
|
442
|
-
}
|
|
443
|
-
prompt() {
|
|
444
|
-
return new Promise((u, F) => {
|
|
445
|
-
if (this._abortSignal) {
|
|
446
|
-
if (this._abortSignal.aborted)
|
|
447
|
-
return this.state = "cancel", this.close(), u(S);
|
|
448
|
-
this._abortSignal.addEventListener("abort", () => {
|
|
449
|
-
this.state = "cancel", this.close();
|
|
450
|
-
}, { once: true });
|
|
451
|
-
}
|
|
452
|
-
const e = new U(0);
|
|
453
|
-
e._write = (s, i, D) => {
|
|
454
|
-
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
|
|
455
|
-
}, this.input.pipe(e), this.rl = M.createInterface({ input: this.input, output: e, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), M.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
456
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u(this.value);
|
|
457
|
-
}), this.once("cancel", () => {
|
|
458
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u(S);
|
|
459
|
-
});
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
onKeypress(u, F) {
|
|
463
|
-
if (this.state === "error" && (this.state = "active"), F?.name && (!this._track && c.aliases.has(F.name) && this.emit("cursor", c.aliases.get(F.name)), c.actions.has(F.name) && this.emit("cursor", F.name)), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === "\t" && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), F?.name === "return") {
|
|
464
|
-
if (this.opts.validate) {
|
|
465
|
-
const e = this.opts.validate(this.value);
|
|
466
|
-
e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.value));
|
|
467
|
-
}
|
|
468
|
-
this.state !== "error" && (this.state = "submit");
|
|
469
|
-
}
|
|
470
|
-
k([u, F?.name, F?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
471
|
-
}
|
|
472
|
-
close() {
|
|
473
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
474
|
-
`), d(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
475
|
-
}
|
|
476
|
-
restoreCursor() {
|
|
477
|
-
const u = G(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
478
|
-
`).length - 1;
|
|
479
|
-
this.output.write(import_sisteransi.cursor.move(-999, u * -1));
|
|
480
|
-
}
|
|
481
|
-
render() {
|
|
482
|
-
const u = G(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
483
|
-
if (u !== this._prevFrame) {
|
|
484
|
-
if (this.state === "initial")
|
|
485
|
-
this.output.write(import_sisteransi.cursor.hide);
|
|
486
|
-
else {
|
|
487
|
-
const F = lD(this._prevFrame, u);
|
|
488
|
-
if (this.restoreCursor(), F && F?.length === 1) {
|
|
489
|
-
const e = F[0];
|
|
490
|
-
this.output.write(import_sisteransi.cursor.move(0, e)), this.output.write(import_sisteransi.erase.lines(1));
|
|
491
|
-
const s = u.split(`
|
|
492
|
-
`);
|
|
493
|
-
this.output.write(s[e]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - e - 1));
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
if (F && F?.length > 1) {
|
|
497
|
-
const e = F[0];
|
|
498
|
-
this.output.write(import_sisteransi.cursor.move(0, e)), this.output.write(import_sisteransi.erase.down());
|
|
499
|
-
const s = u.split(`
|
|
500
|
-
`).slice(e);
|
|
501
|
-
this.output.write(s.join(`
|
|
502
|
-
`)), this._prevFrame = u;
|
|
503
|
-
return;
|
|
504
|
-
}
|
|
505
|
-
this.output.write(import_sisteransi.erase.down());
|
|
506
|
-
}
|
|
507
|
-
this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
var bD = Object.defineProperty;
|
|
512
|
-
var mD = (t, u, F) => (u in t) ? bD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
|
|
513
|
-
var Y = (t, u, F) => (mD(t, typeof u != "symbol" ? u + "" : u, F), F);
|
|
514
|
-
var wD = class extends x {
|
|
515
|
-
constructor(u) {
|
|
516
|
-
super(u, false), Y(this, "options"), Y(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
|
|
517
|
-
F === "a" && this.toggleAll();
|
|
518
|
-
}), this.on("cursor", (F) => {
|
|
519
|
-
switch (F) {
|
|
520
|
-
case "left":
|
|
521
|
-
case "up":
|
|
522
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
523
|
-
break;
|
|
524
|
-
case "down":
|
|
525
|
-
case "right":
|
|
526
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
527
|
-
break;
|
|
528
|
-
case "space":
|
|
529
|
-
this.toggleValue();
|
|
530
|
-
break;
|
|
531
|
-
}
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
get _value() {
|
|
535
|
-
return this.options[this.cursor].value;
|
|
536
|
-
}
|
|
537
|
-
toggleAll() {
|
|
538
|
-
const u = this.value.length === this.options.length;
|
|
539
|
-
this.value = u ? [] : this.options.map((F) => F.value);
|
|
540
|
-
}
|
|
541
|
-
toggleValue() {
|
|
542
|
-
const u = this.value.includes(this._value);
|
|
543
|
-
this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
var SD = Object.defineProperty;
|
|
547
|
-
var $D = (t, u, F) => (u in t) ? SD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
|
|
548
|
-
var q = (t, u, F) => ($D(t, typeof u != "symbol" ? u + "" : u, F), F);
|
|
549
|
-
|
|
550
|
-
class jD extends x {
|
|
551
|
-
constructor(u) {
|
|
552
|
-
super(u, false), q(this, "options"), q(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
|
|
553
|
-
switch (F) {
|
|
554
|
-
case "left":
|
|
555
|
-
case "up":
|
|
556
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
557
|
-
break;
|
|
558
|
-
case "down":
|
|
559
|
-
case "right":
|
|
560
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
561
|
-
break;
|
|
562
|
-
}
|
|
563
|
-
this.changeValue();
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
get _value() {
|
|
567
|
-
return this.options[this.cursor];
|
|
568
|
-
}
|
|
569
|
-
changeValue() {
|
|
570
|
-
this.value = this._value.value;
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
class PD extends x {
|
|
574
|
-
get valueWithCursor() {
|
|
575
|
-
if (this.state === "submit")
|
|
576
|
-
return this.value;
|
|
577
|
-
if (this.cursor >= this.value.length)
|
|
578
|
-
return `${this.value}█`;
|
|
579
|
-
const u = this.value.slice(0, this.cursor), [F, ...e] = this.value.slice(this.cursor);
|
|
580
|
-
return `${u}${import_picocolors.default.inverse(F)}${e.join("")}`;
|
|
581
|
-
}
|
|
582
|
-
get cursor() {
|
|
583
|
-
return this._cursor;
|
|
584
|
-
}
|
|
585
|
-
constructor(u) {
|
|
586
|
-
super(u), this.on("finalize", () => {
|
|
587
|
-
this.value || (this.value = u.defaultValue);
|
|
588
|
-
});
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
// node_modules/@clack/prompts/dist/index.mjs
|
|
593
|
-
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
594
|
-
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
595
|
-
import p from "node:process";
|
|
596
|
-
function X2() {
|
|
597
|
-
return p.platform !== "win32" ? p.env.TERM !== "linux" : !!p.env.CI || !!p.env.WT_SESSION || !!p.env.TERMINUS_SUBLIME || p.env.ConEmuTask === "{cmd::Cmder}" || p.env.TERM_PROGRAM === "Terminus-Sublime" || p.env.TERM_PROGRAM === "vscode" || p.env.TERM === "xterm-256color" || p.env.TERM === "alacritty" || p.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
598
|
-
}
|
|
599
|
-
var E = X2();
|
|
600
|
-
var u = (s, n) => E ? s : n;
|
|
601
|
-
var ee = u("◆", "*");
|
|
602
|
-
var A2 = u("■", "x");
|
|
603
|
-
var B = u("▲", "x");
|
|
604
|
-
var S2 = u("◇", "o");
|
|
605
|
-
var te = u("┌", "T");
|
|
606
|
-
var a = u("│", "|");
|
|
607
|
-
var m2 = u("└", "—");
|
|
608
|
-
var j2 = u("●", ">");
|
|
609
|
-
var R2 = u("○", " ");
|
|
610
|
-
var V2 = u("◻", "[•]");
|
|
611
|
-
var M2 = u("◼", "[+]");
|
|
612
|
-
var G2 = u("◻", "[ ]");
|
|
613
|
-
var se = u("▪", "•");
|
|
614
|
-
var N2 = u("─", "-");
|
|
615
|
-
var re = u("╮", "+");
|
|
616
|
-
var ie = u("├", "+");
|
|
617
|
-
var ne = u("╯", "+");
|
|
618
|
-
var ae = u("●", "•");
|
|
619
|
-
var oe = u("◆", "*");
|
|
620
|
-
var ce = u("▲", "!");
|
|
621
|
-
var le = u("■", "x");
|
|
622
|
-
var y2 = (s) => {
|
|
623
|
-
switch (s) {
|
|
624
|
-
case "initial":
|
|
625
|
-
case "active":
|
|
626
|
-
return import_picocolors2.default.cyan(ee);
|
|
627
|
-
case "cancel":
|
|
628
|
-
return import_picocolors2.default.red(A2);
|
|
629
|
-
case "error":
|
|
630
|
-
return import_picocolors2.default.yellow(B);
|
|
631
|
-
case "submit":
|
|
632
|
-
return import_picocolors2.default.green(S2);
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
var k2 = (s) => {
|
|
636
|
-
const { cursor: n, options: t, style: i } = s, r2 = s.maxItems ?? Number.POSITIVE_INFINITY, c2 = Math.max(process.stdout.rows - 4, 0), o = Math.min(c2, Math.max(r2, 5));
|
|
637
|
-
let l2 = 0;
|
|
638
|
-
n >= l2 + o - 3 ? l2 = Math.max(Math.min(n - o + 3, t.length - o), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
|
|
639
|
-
const $2 = o < t.length && l2 > 0, d2 = o < t.length && l2 + o < t.length;
|
|
640
|
-
return t.slice(l2, l2 + o).map((w2, b2, C) => {
|
|
641
|
-
const I2 = b2 === 0 && $2, x2 = b2 === C.length - 1 && d2;
|
|
642
|
-
return I2 || x2 ? import_picocolors2.default.dim("...") : i(w2, b2 + l2 === n);
|
|
643
|
-
});
|
|
644
|
-
};
|
|
645
|
-
var ue = (s) => new PD({ validate: s.validate, placeholder: s.placeholder, defaultValue: s.defaultValue, initialValue: s.initialValue, render() {
|
|
646
|
-
const n = `${import_picocolors2.default.gray(a)}
|
|
647
|
-
${y2(this.state)} ${s.message}
|
|
648
|
-
`, t = s.placeholder ? import_picocolors2.default.inverse(s.placeholder[0]) + import_picocolors2.default.dim(s.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : t;
|
|
649
|
-
switch (this.state) {
|
|
650
|
-
case "error":
|
|
651
|
-
return `${n.trim()}
|
|
652
|
-
${import_picocolors2.default.yellow(a)} ${i}
|
|
653
|
-
${import_picocolors2.default.yellow(m2)} ${import_picocolors2.default.yellow(this.error)}
|
|
654
|
-
`;
|
|
655
|
-
case "submit":
|
|
656
|
-
return `${n}${import_picocolors2.default.gray(a)} ${import_picocolors2.default.dim(this.value || s.placeholder)}`;
|
|
657
|
-
case "cancel":
|
|
658
|
-
return `${n}${import_picocolors2.default.gray(a)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
659
|
-
${import_picocolors2.default.gray(a)}` : ""}`;
|
|
660
|
-
default:
|
|
661
|
-
return `${n}${import_picocolors2.default.cyan(a)} ${i}
|
|
662
|
-
${import_picocolors2.default.cyan(m2)}
|
|
663
|
-
`;
|
|
664
|
-
}
|
|
665
|
-
} }).prompt();
|
|
666
|
-
var de = (s) => {
|
|
667
|
-
const n = (t, i) => {
|
|
668
|
-
const r2 = t.label ?? String(t.value);
|
|
669
|
-
switch (i) {
|
|
670
|
-
case "selected":
|
|
671
|
-
return `${import_picocolors2.default.dim(r2)}`;
|
|
672
|
-
case "active":
|
|
673
|
-
return `${import_picocolors2.default.green(j2)} ${r2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}`;
|
|
674
|
-
case "cancelled":
|
|
675
|
-
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(r2))}`;
|
|
676
|
-
default:
|
|
677
|
-
return `${import_picocolors2.default.dim(R2)} ${import_picocolors2.default.dim(r2)}`;
|
|
678
|
-
}
|
|
679
|
-
};
|
|
680
|
-
return new jD({ options: s.options, initialValue: s.initialValue, render() {
|
|
681
|
-
const t = `${import_picocolors2.default.gray(a)}
|
|
682
|
-
${y2(this.state)} ${s.message}
|
|
683
|
-
`;
|
|
684
|
-
switch (this.state) {
|
|
685
|
-
case "submit":
|
|
686
|
-
return `${t}${import_picocolors2.default.gray(a)} ${n(this.options[this.cursor], "selected")}`;
|
|
687
|
-
case "cancel":
|
|
688
|
-
return `${t}${import_picocolors2.default.gray(a)} ${n(this.options[this.cursor], "cancelled")}
|
|
689
|
-
${import_picocolors2.default.gray(a)}`;
|
|
690
|
-
default:
|
|
691
|
-
return `${t}${import_picocolors2.default.cyan(a)} ${k2({ cursor: this.cursor, options: this.options, maxItems: s.maxItems, style: (i, r2) => n(i, r2 ? "active" : "inactive") }).join(`
|
|
692
|
-
${import_picocolors2.default.cyan(a)} `)}
|
|
693
|
-
${import_picocolors2.default.cyan(m2)}
|
|
694
|
-
`;
|
|
695
|
-
}
|
|
696
|
-
} }).prompt();
|
|
697
|
-
};
|
|
698
|
-
var pe = (s) => {
|
|
699
|
-
const n = (t, i) => {
|
|
700
|
-
const r2 = t.label ?? String(t.value);
|
|
701
|
-
return i === "active" ? `${import_picocolors2.default.cyan(V2)} ${r2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(M2)} ${import_picocolors2.default.dim(r2)}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(r2))}` : i === "active-selected" ? `${import_picocolors2.default.green(M2)} ${r2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : i === "submitted" ? `${import_picocolors2.default.dim(r2)}` : `${import_picocolors2.default.dim(G2)} ${import_picocolors2.default.dim(r2)}`;
|
|
702
|
-
};
|
|
703
|
-
return new wD({ options: s.options, initialValues: s.initialValues, required: s.required ?? true, cursorAt: s.cursorAt, validate(t) {
|
|
704
|
-
if (this.required && t.length === 0)
|
|
705
|
-
return `Please select at least one option.
|
|
706
|
-
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
707
|
-
}, render() {
|
|
708
|
-
const t = `${import_picocolors2.default.gray(a)}
|
|
709
|
-
${y2(this.state)} ${s.message}
|
|
710
|
-
`, i = (r2, c2) => {
|
|
711
|
-
const o = this.value.includes(r2.value);
|
|
712
|
-
return c2 && o ? n(r2, "active-selected") : o ? n(r2, "selected") : n(r2, c2 ? "active" : "inactive");
|
|
713
|
-
};
|
|
714
|
-
switch (this.state) {
|
|
715
|
-
case "submit":
|
|
716
|
-
return `${t}${import_picocolors2.default.gray(a)} ${this.options.filter(({ value: r2 }) => this.value.includes(r2)).map((r2) => n(r2, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
|
|
717
|
-
case "cancel": {
|
|
718
|
-
const r2 = this.options.filter(({ value: c2 }) => this.value.includes(c2)).map((c2) => n(c2, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
719
|
-
return `${t}${import_picocolors2.default.gray(a)} ${r2.trim() ? `${r2}
|
|
720
|
-
${import_picocolors2.default.gray(a)}` : ""}`;
|
|
721
|
-
}
|
|
722
|
-
case "error": {
|
|
723
|
-
const r2 = this.error.split(`
|
|
724
|
-
`).map((c2, o) => o === 0 ? `${import_picocolors2.default.yellow(m2)} ${import_picocolors2.default.yellow(c2)}` : ` ${c2}`).join(`
|
|
725
|
-
`);
|
|
726
|
-
return `${t + import_picocolors2.default.yellow(a)} ${k2({ options: this.options, cursor: this.cursor, maxItems: s.maxItems, style: i }).join(`
|
|
727
|
-
${import_picocolors2.default.yellow(a)} `)}
|
|
728
|
-
${r2}
|
|
729
|
-
`;
|
|
730
|
-
}
|
|
731
|
-
default:
|
|
732
|
-
return `${t}${import_picocolors2.default.cyan(a)} ${k2({ options: this.options, cursor: this.cursor, maxItems: s.maxItems, style: i }).join(`
|
|
733
|
-
${import_picocolors2.default.cyan(a)} `)}
|
|
734
|
-
${import_picocolors2.default.cyan(m2)}
|
|
735
|
-
`;
|
|
736
|
-
}
|
|
737
|
-
} }).prompt();
|
|
738
|
-
};
|
|
739
|
-
var ve = (s = "") => {
|
|
740
|
-
process.stdout.write(`${import_picocolors2.default.gray(m2)} ${import_picocolors2.default.red(s)}
|
|
741
|
-
|
|
742
|
-
`);
|
|
743
|
-
};
|
|
744
|
-
var we = (s = "") => {
|
|
745
|
-
process.stdout.write(`${import_picocolors2.default.gray(te)} ${s}
|
|
746
|
-
`);
|
|
747
|
-
};
|
|
748
|
-
var fe = (s = "") => {
|
|
749
|
-
process.stdout.write(`${import_picocolors2.default.gray(a)}
|
|
750
|
-
${import_picocolors2.default.gray(m2)} ${s}
|
|
751
|
-
|
|
752
|
-
`);
|
|
753
|
-
};
|
|
754
|
-
var v2 = { message: (s = "", { symbol: n = import_picocolors2.default.gray(a) } = {}) => {
|
|
755
|
-
const t = [`${import_picocolors2.default.gray(a)}`];
|
|
756
|
-
if (s) {
|
|
757
|
-
const [i, ...r2] = s.split(`
|
|
758
|
-
`);
|
|
759
|
-
t.push(`${n} ${i}`, ...r2.map((c2) => `${import_picocolors2.default.gray(a)} ${c2}`));
|
|
760
|
-
}
|
|
761
|
-
process.stdout.write(`${t.join(`
|
|
762
|
-
`)}
|
|
763
|
-
`);
|
|
764
|
-
}, info: (s) => {
|
|
765
|
-
v2.message(s, { symbol: import_picocolors2.default.blue(ae) });
|
|
766
|
-
}, success: (s) => {
|
|
767
|
-
v2.message(s, { symbol: import_picocolors2.default.green(oe) });
|
|
768
|
-
}, step: (s) => {
|
|
769
|
-
v2.message(s, { symbol: import_picocolors2.default.green(S2) });
|
|
770
|
-
}, warn: (s) => {
|
|
771
|
-
v2.message(s, { symbol: import_picocolors2.default.yellow(ce) });
|
|
772
|
-
}, warning: (s) => {
|
|
773
|
-
v2.warn(s);
|
|
774
|
-
}, error: (s) => {
|
|
775
|
-
v2.message(s, { symbol: import_picocolors2.default.red(le) });
|
|
776
|
-
} };
|
|
777
|
-
var L2 = () => {
|
|
778
|
-
const s = E ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"], n = E ? 80 : 120, t = process.env.CI === "true";
|
|
779
|
-
let i, r2, c2 = false, o = "", l2;
|
|
780
|
-
const $2 = (h2) => {
|
|
781
|
-
const g2 = h2 > 1 ? "Something went wrong" : "Canceled";
|
|
782
|
-
c2 && P2(g2, h2);
|
|
783
|
-
}, d2 = () => $2(2), w2 = () => $2(1), b2 = () => {
|
|
784
|
-
process.on("uncaughtExceptionMonitor", d2), process.on("unhandledRejection", d2), process.on("SIGINT", w2), process.on("SIGTERM", w2), process.on("exit", $2);
|
|
785
|
-
}, C = () => {
|
|
786
|
-
process.removeListener("uncaughtExceptionMonitor", d2), process.removeListener("unhandledRejection", d2), process.removeListener("SIGINT", w2), process.removeListener("SIGTERM", w2), process.removeListener("exit", $2);
|
|
787
|
-
}, I2 = () => {
|
|
788
|
-
if (l2 === undefined)
|
|
789
|
-
return;
|
|
790
|
-
t && process.stdout.write(`
|
|
791
|
-
`);
|
|
792
|
-
const h2 = l2.split(`
|
|
793
|
-
`);
|
|
794
|
-
process.stdout.write(import_sisteransi2.cursor.move(-999, h2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(h2.length));
|
|
795
|
-
}, x2 = (h2) => h2.replace(/\.+$/, ""), O2 = (h2 = "") => {
|
|
796
|
-
c2 = true, i = cD(), o = x2(h2), process.stdout.write(`${import_picocolors2.default.gray(a)}
|
|
797
|
-
`);
|
|
798
|
-
let g2 = 0, f2 = 0;
|
|
799
|
-
b2(), r2 = setInterval(() => {
|
|
800
|
-
if (t && o === l2)
|
|
801
|
-
return;
|
|
802
|
-
I2(), l2 = o;
|
|
803
|
-
const W2 = import_picocolors2.default.magenta(s[g2]), _2 = t ? "..." : ".".repeat(Math.floor(f2)).slice(0, 3);
|
|
804
|
-
process.stdout.write(`${W2} ${o}${_2}`), g2 = g2 + 1 < s.length ? g2 + 1 : 0, f2 = f2 < s.length ? f2 + 0.125 : 0;
|
|
805
|
-
}, n);
|
|
806
|
-
}, P2 = (h2 = "", g2 = 0) => {
|
|
807
|
-
c2 = false, clearInterval(r2), I2();
|
|
808
|
-
const f2 = g2 === 0 ? import_picocolors2.default.green(S2) : g2 === 1 ? import_picocolors2.default.red(A2) : import_picocolors2.default.red(B);
|
|
809
|
-
o = x2(h2 ?? o), process.stdout.write(`${f2} ${o}
|
|
810
|
-
`), C(), i();
|
|
811
|
-
};
|
|
812
|
-
return { start: O2, stop: P2, message: (h2 = "") => {
|
|
813
|
-
o = x2(h2 ?? o);
|
|
814
|
-
} };
|
|
815
|
-
};
|
|
816
|
-
|
|
817
|
-
// src/index.ts
|
|
8
|
+
import * as p from "@clack/prompts";
|
|
818
9
|
var {spawn } = globalThis.Bun;
|
|
819
10
|
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
820
11
|
var templatesDir = join(__dirname2, "..", "templates");
|
|
@@ -1025,10 +216,10 @@ async function main() {
|
|
|
1025
216
|
process.exit(0);
|
|
1026
217
|
}
|
|
1027
218
|
console.clear();
|
|
1028
|
-
|
|
219
|
+
p.intro("@jlmx/starter");
|
|
1029
220
|
let projectName = args.find((arg) => !arg.startsWith("-"));
|
|
1030
221
|
if (!projectName) {
|
|
1031
|
-
const nameResult = await
|
|
222
|
+
const nameResult = await p.text({
|
|
1032
223
|
message: "Project name:",
|
|
1033
224
|
placeholder: "my-app",
|
|
1034
225
|
validate: (value) => {
|
|
@@ -1038,13 +229,13 @@ async function main() {
|
|
|
1038
229
|
return "Use lowercase letters, numbers, and hyphens only";
|
|
1039
230
|
}
|
|
1040
231
|
});
|
|
1041
|
-
if (
|
|
1042
|
-
|
|
232
|
+
if (p.isCancel(nameResult)) {
|
|
233
|
+
p.cancel("Cancelled");
|
|
1043
234
|
process.exit(0);
|
|
1044
235
|
}
|
|
1045
236
|
projectName = nameResult;
|
|
1046
237
|
}
|
|
1047
|
-
const template = await
|
|
238
|
+
const template = await p.select({
|
|
1048
239
|
message: "Select a template:",
|
|
1049
240
|
options: [
|
|
1050
241
|
{
|
|
@@ -1059,11 +250,11 @@ async function main() {
|
|
|
1059
250
|
}
|
|
1060
251
|
]
|
|
1061
252
|
});
|
|
1062
|
-
if (
|
|
1063
|
-
|
|
253
|
+
if (p.isCancel(template)) {
|
|
254
|
+
p.cancel("Cancelled");
|
|
1064
255
|
process.exit(0);
|
|
1065
256
|
}
|
|
1066
|
-
const features = await
|
|
257
|
+
const features = await p.multiselect({
|
|
1067
258
|
message: "Select features:",
|
|
1068
259
|
options: [
|
|
1069
260
|
{ value: "tailwind", label: "Tailwind CSS", hint: "design system + tailwindcss-animate" },
|
|
@@ -1073,8 +264,8 @@ async function main() {
|
|
|
1073
264
|
],
|
|
1074
265
|
initialValues: ["tailwind", "fonts", "cloudflare"]
|
|
1075
266
|
});
|
|
1076
|
-
if (
|
|
1077
|
-
|
|
267
|
+
if (p.isCancel(features)) {
|
|
268
|
+
p.cancel("Cancelled");
|
|
1078
269
|
process.exit(0);
|
|
1079
270
|
}
|
|
1080
271
|
const selectedFeatures = features;
|
|
@@ -1082,12 +273,12 @@ async function main() {
|
|
|
1082
273
|
if (selectedFeatures.includes("auth")) {
|
|
1083
274
|
if (!selectedFeatures.includes("cloudflare")) {
|
|
1084
275
|
selectedFeatures.push("cloudflare");
|
|
1085
|
-
|
|
276
|
+
p.log.info("Cloudflare Workers enabled (required for auth)");
|
|
1086
277
|
}
|
|
1087
278
|
}
|
|
1088
279
|
if (selectedFeatures.includes("cloudflare")) {
|
|
1089
280
|
const needsD1 = selectedFeatures.includes("auth");
|
|
1090
|
-
const bindings = await
|
|
281
|
+
const bindings = await p.multiselect({
|
|
1091
282
|
message: "Cloudflare platform features:",
|
|
1092
283
|
options: [
|
|
1093
284
|
{
|
|
@@ -1103,17 +294,17 @@ async function main() {
|
|
|
1103
294
|
initialValues: needsD1 ? ["d1"] : [],
|
|
1104
295
|
required: false
|
|
1105
296
|
});
|
|
1106
|
-
if (
|
|
1107
|
-
|
|
297
|
+
if (p.isCancel(bindings)) {
|
|
298
|
+
p.cancel("Cancelled");
|
|
1108
299
|
process.exit(0);
|
|
1109
300
|
}
|
|
1110
301
|
cfBindings = bindings;
|
|
1111
302
|
if (needsD1 && !cfBindings.includes("d1")) {
|
|
1112
303
|
cfBindings.push("d1");
|
|
1113
|
-
|
|
304
|
+
p.log.info("D1 Database enabled (required for auth)");
|
|
1114
305
|
}
|
|
1115
306
|
}
|
|
1116
|
-
const aiInstructions = await
|
|
307
|
+
const aiInstructions = await p.select({
|
|
1117
308
|
message: "AI coding assistant instructions:",
|
|
1118
309
|
options: [
|
|
1119
310
|
{
|
|
@@ -1138,14 +329,14 @@ async function main() {
|
|
|
1138
329
|
}
|
|
1139
330
|
]
|
|
1140
331
|
});
|
|
1141
|
-
if (
|
|
1142
|
-
|
|
332
|
+
if (p.isCancel(aiInstructions)) {
|
|
333
|
+
p.cancel("Cancelled");
|
|
1143
334
|
process.exit(0);
|
|
1144
335
|
}
|
|
1145
336
|
const selectedAiInstructions = aiInstructions;
|
|
1146
337
|
const projectPath = resolve(process.cwd(), projectName);
|
|
1147
338
|
const selectedTemplate = template;
|
|
1148
|
-
const s =
|
|
339
|
+
const s = p.spinner();
|
|
1149
340
|
if (selectedTemplate === "tanstack-start") {
|
|
1150
341
|
s.start("Creating TanStack Start project...");
|
|
1151
342
|
const proc = spawn({
|
|
@@ -1422,7 +613,7 @@ ${envVarPrefix}BETTER_AUTH_URL=http://localhost:3000
|
|
|
1422
613
|
Deploy to Cloudflare:
|
|
1423
614
|
bun run deploy:cf`;
|
|
1424
615
|
}
|
|
1425
|
-
|
|
616
|
+
p.outro(`Done! Next steps:
|
|
1426
617
|
|
|
1427
618
|
${nextSteps}`);
|
|
1428
619
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jlmx/starter",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Scaffold new projects with jlmx's preferred stack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"starter": "./dist/index.js",
|
|
8
8
|
"@jlmx/starter": "./dist/index.js"
|
|
9
9
|
},
|
|
10
|
-
"files": [
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"templates"
|
|
13
|
+
],
|
|
11
14
|
"scripts": {
|
|
12
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target
|
|
15
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target bun --packages external",
|
|
13
16
|
"dev": "bun run ./src/index.ts",
|
|
14
17
|
"lint": "biome check .",
|
|
15
18
|
"lint:fix": "biome check --write .",
|