create-absolutejs 0.3.1 → 0.3.3

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.
Files changed (47) hide show
  1. package/dist/commands/formatProject.d.ts +4 -2
  2. package/dist/commands/formatProject.js +21 -0
  3. package/dist/commands/installDependencies.js +19 -0
  4. package/dist/constants.js +4 -0
  5. package/dist/data.js +125 -0
  6. package/dist/generators/configurations/addConfigurationFiles.js +21 -0
  7. package/dist/generators/configurations/generateDrizzleConfig.js +11 -0
  8. package/dist/generators/configurations/generatePackageJson.js +74 -0
  9. package/dist/generators/configurations/generatePrettierrc.js +13 -0
  10. package/dist/generators/configurations/initializeRoot.js +26 -0
  11. package/dist/generators/db/scaffoldDatabase.js +16 -0
  12. package/dist/generators/html/scaffoldHTML.js +14 -0
  13. package/dist/generators/htmx/scaffoldHTMX.js +15 -0
  14. package/dist/generators/project/generateMarkupCSS.js +133 -0
  15. package/dist/generators/project/generateServer.js +159 -0
  16. package/dist/generators/project/scaffoldFrontends.js +71 -0
  17. package/dist/generators/react/scaffoldReact.js +14 -0
  18. package/dist/generators/svelte/scaffoldSvelte.js +13 -0
  19. package/dist/generators/vue/scaffoldVue.js +8 -0
  20. package/dist/index.js +23 -2464
  21. package/dist/messages.js +84 -0
  22. package/dist/prompt.js +84 -0
  23. package/dist/questions/authProvider.js +15 -0
  24. package/dist/questions/codeQualityTool.js +18 -0
  25. package/dist/questions/configurationType.js +15 -0
  26. package/dist/questions/databaseEngine.js +24 -0
  27. package/dist/questions/databaseHost.js +51 -0
  28. package/dist/questions/directoryConfiguration.js +77 -0
  29. package/dist/questions/frontendDirectoryConfigurations.js +29 -0
  30. package/dist/questions/frontends.js +16 -0
  31. package/dist/questions/htmlScriptingOption.js +10 -0
  32. package/dist/questions/initializeGitNow.js +10 -0
  33. package/dist/questions/installDependenciesNow.js +10 -0
  34. package/dist/questions/orm.js +16 -0
  35. package/dist/questions/plugins.js +13 -0
  36. package/dist/questions/projectName.js +11 -0
  37. package/dist/questions/useTailwind.js +8 -0
  38. package/dist/scaffold.js +70 -0
  39. package/dist/typeGuards.js +24 -0
  40. package/dist/types.js +1 -0
  41. package/dist/utils/abort.js +8 -0
  42. package/dist/utils/commandMaps.d.ts +3 -1
  43. package/dist/utils/commandMaps.js +18 -0
  44. package/dist/utils/getPackageVersion.js +12 -0
  45. package/dist/utils/parseCommandLineOptions.js +170 -0
  46. package/dist/utils/t3-utils.js +24 -0
  47. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,2469 +1,28 @@
1
1
  #!/usr/bin/env bun
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
-
149
- // src/index.ts
150
- import { exit as exit5 } from "process";
151
-
152
- // node_modules/@clack/core/dist/index.mjs
153
- var import_sisteransi = __toESM(require_src(), 1);
154
- var import_picocolors = __toESM(require_picocolors(), 1);
155
- import { stdin as j, stdout as M } from "node:process";
156
- import * as g from "node:readline";
157
- import O from "node:readline";
158
- import { Writable as X } from "node:stream";
159
- function DD({ onlyFirst: e = false } = {}) {
160
- const t = ["[\\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("|");
161
- return new RegExp(t, e ? undefined : "g");
162
- }
163
- var uD = DD();
164
- function P(e) {
165
- if (typeof e != "string")
166
- throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
167
- return e.replace(uD, "");
168
- }
169
- function L(e) {
170
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
171
- }
172
- var W = { exports: {} };
173
- (function(e) {
174
- var u = {};
175
- e.exports = u, u.eastAsianWidth = function(F) {
176
- var s = F.charCodeAt(0), i = F.length == 2 ? F.charCodeAt(1) : 0, D = s;
177
- 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";
178
- }, u.characterLength = function(F) {
179
- var s = this.eastAsianWidth(F);
180
- return s == "F" || s == "W" || s == "A" ? 2 : 1;
181
- };
182
- function t(F) {
183
- return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
184
- }
185
- u.length = function(F) {
186
- for (var s = t(F), i = 0, D = 0;D < s.length; D++)
187
- i = i + this.characterLength(s[D]);
188
- return i;
189
- }, u.slice = function(F, s, i) {
190
- textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
191
- for (var D = "", C = 0, n = t(F), E = 0;E < n.length; E++) {
192
- var a = n[E], o = u.length(a);
193
- if (C >= s - (o == 2 ? 1 : 0))
194
- if (C + o <= i)
195
- D += a;
196
- else
197
- break;
198
- C += o;
199
- }
200
- return D;
201
- };
202
- })(W);
203
- var tD = W.exports;
204
- var eD = L(tD);
205
- var FD = function() {
206
- 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;
207
- };
208
- var sD = L(FD);
209
- function p(e, u = {}) {
210
- if (typeof e != "string" || e.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, e = P(e), e.length === 0))
211
- return 0;
212
- e = e.replace(sD(), " ");
213
- const t = u.ambiguousIsNarrow ? 1 : 2;
214
- let F = 0;
215
- for (const s of e) {
216
- const i = s.codePointAt(0);
217
- if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879)
218
- continue;
219
- switch (eD.eastAsianWidth(s)) {
220
- case "F":
221
- case "W":
222
- F += 2;
223
- break;
224
- case "A":
225
- F += t;
226
- break;
227
- default:
228
- F += 1;
229
- }
230
- }
231
- return F;
232
- }
233
- var w = 10;
234
- var N = (e = 0) => (u) => `\x1B[${u + e}m`;
235
- var I = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`;
236
- var R = (e = 0) => (u, t, F) => `\x1B[${38 + e};2;${u};${t};${F}m`;
237
- 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] } };
238
- Object.keys(r.modifier);
239
- var iD = Object.keys(r.color);
240
- var CD = Object.keys(r.bgColor);
241
- [...iD];
242
- function rD() {
243
- const e = new Map;
244
- for (const [u, t] of Object.entries(r)) {
245
- for (const [F, s] of Object.entries(t))
246
- r[F] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F] = r[F], e.set(s[0], s[1]);
247
- Object.defineProperty(r, u, { value: t, enumerable: false });
248
- }
249
- return Object.defineProperty(r, "codes", { value: e, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, { rgbToAnsi256: { value: (u, t, F) => u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
250
- const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
251
- if (!t)
252
- return [0, 0, 0];
253
- let [F] = t;
254
- F.length === 3 && (F = [...F].map((i) => i + i).join(""));
255
- const s = Number.parseInt(F, 16);
256
- return [s >> 16 & 255, s >> 8 & 255, s & 255];
257
- }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
258
- if (u < 8)
259
- return 30 + u;
260
- if (u < 16)
261
- return 90 + (u - 8);
262
- let t, F, s;
263
- if (u >= 232)
264
- t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
265
- else {
266
- u -= 16;
267
- const C = u % 36;
268
- t = Math.floor(u / 36) / 5, F = Math.floor(C / 6) / 5, s = C % 6 / 5;
269
- }
270
- const i = Math.max(t, F, s) * 2;
271
- if (i === 0)
272
- return 30;
273
- let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
274
- return i === 2 && (D += 60), D;
275
- }, enumerable: false }, rgbToAnsi: { value: (u, t, F) => r.ansi256ToAnsi(r.rgbToAnsi256(u, t, F)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
276
- }
277
- var ED = rD();
278
- var d = new Set(["\x1B", "›"]);
279
- var oD = 39;
280
- var y = "\x07";
281
- var V = "[";
282
- var nD = "]";
283
- var G = "m";
284
- var _ = `${nD}8;;`;
285
- var z = (e) => `${d.values().next().value}${V}${e}${G}`;
286
- var K = (e) => `${d.values().next().value}${_}${e}${y}`;
287
- var aD = (e) => e.split(" ").map((u) => p(u));
288
- var k = (e, u, t) => {
289
- const F = [...u];
290
- let s = false, i = false, D = p(P(e[e.length - 1]));
291
- for (const [C, n] of F.entries()) {
292
- const E = p(n);
293
- if (D + E <= t ? e[e.length - 1] += n : (e.push(n), D = 0), d.has(n) && (s = true, i = F.slice(C + 1).join("").startsWith(_)), s) {
294
- i ? n === y && (s = false, i = false) : n === G && (s = false);
295
- continue;
296
- }
297
- D += E, D === t && C < F.length - 1 && (e.push(""), D = 0);
298
- }
299
- !D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
300
- };
301
- var hD = (e) => {
302
- const u = e.split(" ");
303
- let t = u.length;
304
- for (;t > 0 && !(p(u[t - 1]) > 0); )
305
- t--;
306
- return t === u.length ? e : u.slice(0, t).join(" ") + u.slice(t).join("");
307
- };
308
- var lD = (e, u, t = {}) => {
309
- if (t.trim !== false && e.trim() === "")
310
- return "";
311
- let F = "", s, i;
312
- const D = aD(e);
313
- let C = [""];
314
- for (const [E, a] of e.split(" ").entries()) {
315
- t.trim !== false && (C[C.length - 1] = C[C.length - 1].trimStart());
316
- let o = p(C[C.length - 1]);
317
- if (E !== 0 && (o >= u && (t.wordWrap === false || t.trim === false) && (C.push(""), o = 0), (o > 0 || t.trim === false) && (C[C.length - 1] += " ", o++)), t.hard && D[E] > u) {
318
- const c = u - o, f = 1 + Math.floor((D[E] - c - 1) / u);
319
- Math.floor((D[E] - 1) / u) < f && C.push(""), k(C, a, u);
320
- continue;
321
- }
322
- if (o + D[E] > u && o > 0 && D[E] > 0) {
323
- if (t.wordWrap === false && o < u) {
324
- k(C, a, u);
325
- continue;
326
- }
327
- C.push("");
328
- }
329
- if (o + D[E] > u && t.wordWrap === false) {
330
- k(C, a, u);
331
- continue;
332
- }
333
- C[C.length - 1] += a;
334
- }
335
- t.trim !== false && (C = C.map((E) => hD(E)));
336
- const n = [...C.join(`
337
- `)];
338
- for (const [E, a] of n.entries()) {
339
- if (F += a, d.has(a)) {
340
- const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
341
- if (c.code !== undefined) {
342
- const f = Number.parseFloat(c.code);
343
- s = f === oD ? undefined : f;
344
- } else
345
- c.uri !== undefined && (i = c.uri.length === 0 ? undefined : c.uri);
346
- }
347
- const o = ED.codes.get(Number(s));
348
- n[E + 1] === `
349
- ` ? (i && (F += K("")), s && o && (F += z(o))) : a === `
350
- ` && (s && o && (F += z(s)), i && (F += K(i)));
351
- }
352
- return F;
353
- };
354
- function Y(e, u, t) {
355
- return String(e).normalize().replace(/\r\n/g, `
356
- `).split(`
357
- `).map((F) => lD(F, u, t)).join(`
358
- `);
359
- }
360
- var xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
361
- var B = { actions: new Set(xD), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]) };
362
- function $(e, u) {
363
- if (typeof e == "string")
364
- return B.aliases.get(e) === u;
365
- for (const t of e)
366
- if (t !== undefined && $(t, u))
367
- return true;
368
- return false;
369
- }
370
- function BD(e, u) {
371
- if (e === u)
372
- return;
373
- const t = e.split(`
374
- `), F = u.split(`
375
- `), s = [];
376
- for (let i = 0;i < Math.max(t.length, F.length); i++)
377
- t[i] !== F[i] && s.push(i);
378
- return s;
379
- }
380
- var AD = globalThis.process.platform.startsWith("win");
381
- var S = Symbol("clack:cancel");
382
- function pD(e) {
383
- return e === S;
384
- }
385
- function m(e, u) {
386
- const t = e;
387
- t.isTTY && t.setRawMode(u);
388
- }
389
- function fD({ input: e = j, output: u = M, overwrite: t = true, hideCursor: F = true } = {}) {
390
- const s = g.createInterface({ input: e, output: u, prompt: "", tabSize: 1 });
391
- g.emitKeypressEvents(e, s), e.isTTY && e.setRawMode(true);
392
- const i = (D, { name: C, sequence: n }) => {
393
- const E = String(D);
394
- if ($([E, C, n], "cancel")) {
395
- F && u.write(import_sisteransi.cursor.show), process.exit(0);
396
- return;
397
- }
398
- if (!t)
399
- return;
400
- const a = C === "return" ? 0 : -1, o = C === "return" ? -1 : 0;
401
- g.moveCursor(u, a, o, () => {
402
- g.clearLine(u, 1, () => {
403
- e.once("keypress", i);
404
- });
405
- });
406
- };
407
- return F && u.write(import_sisteransi.cursor.hide), e.once("keypress", i), () => {
408
- e.off("keypress", i), F && u.write(import_sisteransi.cursor.show), e.isTTY && !AD && e.setRawMode(false), s.terminal = false, s.close();
409
- };
410
- }
411
- var gD = Object.defineProperty;
412
- var vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
413
- var h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t);
414
-
415
- class x {
416
- constructor(u, t = true) {
417
- 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");
418
- const { input: F = j, output: s = M, render: i, signal: D, ...C } = u;
419
- 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 = t, this._abortSignal = D, this.input = F, this.output = s;
420
- }
421
- unsubscribe() {
422
- this._subscribers.clear();
423
- }
424
- setSubscriber(u, t) {
425
- const F = this._subscribers.get(u) ?? [];
426
- F.push(t), this._subscribers.set(u, F);
427
- }
428
- on(u, t) {
429
- this.setSubscriber(u, { cb: t });
430
- }
431
- once(u, t) {
432
- this.setSubscriber(u, { cb: t, once: true });
433
- }
434
- emit(u, ...t) {
435
- const F = this._subscribers.get(u) ?? [], s = [];
436
- for (const i of F)
437
- i.cb(...t), i.once && s.push(() => F.splice(F.indexOf(i), 1));
438
- for (const i of s)
439
- i();
440
- }
441
- prompt() {
442
- return new Promise((u, t) => {
443
- if (this._abortSignal) {
444
- if (this._abortSignal.aborted)
445
- return this.state = "cancel", this.close(), u(S);
446
- this._abortSignal.addEventListener("abort", () => {
447
- this.state = "cancel", this.close();
448
- }, { once: true });
449
- }
450
- const F = new X;
451
- F._write = (s, i, D) => {
452
- this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
453
- }, this.input.pipe(F), this.rl = O.createInterface({ input: this.input, output: F, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.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), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
454
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(this.value);
455
- }), this.once("cancel", () => {
456
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(S);
457
- });
458
- });
459
- }
460
- onKeypress(u, t) {
461
- if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.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()), t?.name === "return") {
462
- if (this.opts.validate) {
463
- const F = this.opts.validate(this.value);
464
- F && (this.error = F instanceof Error ? F.message : F, this.state = "error", this.rl?.write(this.value));
465
- }
466
- this.state !== "error" && (this.state = "submit");
467
- }
468
- $([u, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
469
- }
470
- close() {
471
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
472
- `), m(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
473
- }
474
- restoreCursor() {
475
- const u = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
476
- `).length - 1;
477
- this.output.write(import_sisteransi.cursor.move(-999, u * -1));
478
- }
479
- render() {
480
- const u = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
481
- if (u !== this._prevFrame) {
482
- if (this.state === "initial")
483
- this.output.write(import_sisteransi.cursor.hide);
484
- else {
485
- const t = BD(this._prevFrame, u);
486
- if (this.restoreCursor(), t && t?.length === 1) {
487
- const F = t[0];
488
- this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.lines(1));
489
- const s = u.split(`
490
- `);
491
- this.output.write(s[F]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - F - 1));
492
- return;
493
- }
494
- if (t && t?.length > 1) {
495
- const F = t[0];
496
- this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.down());
497
- const s = u.split(`
498
- `).slice(F);
499
- this.output.write(s.join(`
500
- `)), this._prevFrame = u;
501
- return;
502
- }
503
- this.output.write(import_sisteransi.erase.down());
504
- }
505
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
506
- }
507
- }
508
- }
509
-
510
- class dD extends x {
511
- get cursor() {
512
- return this.value ? 0 : 1;
513
- }
514
- get _value() {
515
- return this.cursor === 0;
516
- }
517
- constructor(u) {
518
- super(u, false), this.value = !!u.initialValue, this.on("value", () => {
519
- this.value = this._value;
520
- }), this.on("confirm", (t) => {
521
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
522
- }), this.on("cursor", () => {
523
- this.value = !this.value;
524
- });
525
- }
526
- }
527
- var A;
528
- A = new WeakMap;
529
- var kD = Object.defineProperty;
530
- var $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
531
- var H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t);
532
- var SD = class extends x {
533
- constructor(u) {
534
- super(u, false), H(this, "options"), H(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u.cursorAt), 0), this.on("key", (t) => {
535
- t === "a" && this.toggleAll();
536
- }), this.on("cursor", (t) => {
537
- switch (t) {
538
- case "left":
539
- case "up":
540
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
541
- break;
542
- case "down":
543
- case "right":
544
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
545
- break;
546
- case "space":
547
- this.toggleValue();
548
- break;
549
- }
550
- });
551
- }
552
- get _value() {
553
- return this.options[this.cursor].value;
554
- }
555
- toggleAll() {
556
- const u = this.value.length === this.options.length;
557
- this.value = u ? [] : this.options.map((t) => t.value);
558
- }
559
- toggleValue() {
560
- const u = this.value.includes(this._value);
561
- this.value = u ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
562
- }
563
- };
564
- var OD = Object.defineProperty;
565
- var PD = (e, u, t) => (u in e) ? OD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
566
- var J = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t);
567
-
568
- class LD extends x {
569
- constructor(u) {
570
- super(u, false), J(this, "options"), J(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t }) => t === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
571
- switch (t) {
572
- case "left":
573
- case "up":
574
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
575
- break;
576
- case "down":
577
- case "right":
578
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
579
- break;
580
- }
581
- this.changeValue();
582
- });
583
- }
584
- get _value() {
585
- return this.options[this.cursor];
586
- }
587
- changeValue() {
588
- this.value = this._value.value;
589
- }
590
- }
591
- class RD extends x {
592
- get valueWithCursor() {
593
- if (this.state === "submit")
594
- return this.value;
595
- if (this.cursor >= this.value.length)
596
- return `${this.value}█`;
597
- const u = this.value.slice(0, this.cursor), [t, ...F] = this.value.slice(this.cursor);
598
- return `${u}${import_picocolors.default.inverse(t)}${F.join("")}`;
599
- }
600
- get cursor() {
601
- return this._cursor;
602
- }
603
- constructor(u) {
604
- super(u), this.on("finalize", () => {
605
- this.value || (this.value = u.defaultValue);
606
- });
607
- }
608
- }
609
-
610
- // node_modules/@clack/prompts/dist/index.mjs
611
- var import_picocolors2 = __toESM(require_picocolors(), 1);
612
- var import_sisteransi2 = __toESM(require_src(), 1);
613
- import y2 from "node:process";
614
- function ce() {
615
- return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
616
- }
617
- var V2 = ce();
618
- var u = (t, n) => V2 ? t : n;
619
- var le = u("◆", "*");
620
- var L2 = u("■", "x");
621
- var W2 = u("▲", "x");
622
- var C = u("◇", "o");
623
- var ue = u("┌", "T");
624
- var o = u("│", "|");
625
- var d2 = u("└", "—");
626
- var k2 = u("●", ">");
627
- var P2 = u("○", " ");
628
- var A2 = u("◻", "[•]");
629
- var T = u("◼", "[+]");
630
- var F = u("◻", "[ ]");
631
- var $e = u("▪", "•");
632
- var _2 = u("─", "-");
633
- var me = u("╮", "+");
634
- var de = u("├", "+");
635
- var pe = u("╯", "+");
636
- var q = u("●", "•");
637
- var D = u("◆", "*");
638
- var U = u("▲", "!");
639
- var K2 = u("■", "x");
640
- var Se = (t = "") => {
641
- process.stdout.write(`${import_picocolors2.default.gray(o)}
642
- ${import_picocolors2.default.gray(d2)} ${t}
643
-
644
- `);
645
- };
646
- var J2 = `${import_picocolors2.default.gray(o)} `;
647
-
648
- // src/messages.ts
649
- var import_picocolors4 = __toESM(require_picocolors(), 1);
650
-
651
- // src/data.ts
652
- var import_picocolors3 = __toESM(require_picocolors(), 1);
653
- var availableFrontends = [
654
- "react",
655
- "html",
656
- "svelte",
657
- "vue",
658
- "htmx"
659
- ];
660
- var availableAuthProviders = ["absoluteAuth", "none"];
661
- var availableDatabaseEngines = [
662
- "postgresql",
663
- "mysql",
664
- "sqlite",
665
- "mongodb",
666
- "redis",
667
- "singlestore",
668
- "cockroachdb",
669
- "mssql",
670
- "none"
671
- ];
672
- var availableDirectoryConfigurations = ["default", "custom"];
673
- var availableORMs = ["drizzle", "prisma", "none"];
674
- var availableDatabaseHosts = [
675
- "neon",
676
- "planetscale",
677
- "supabase",
678
- "turso",
679
- "vercel",
680
- "upstash",
681
- "atlas",
682
- "none"
683
- ];
684
- var availableCodeQualityTools = ["eslint+prettier", "biome"];
685
- var frontendLabels = {
686
- react: import_picocolors3.cyan("React"),
687
- html: "HTML",
688
- htmx: "HTMX",
689
- svelte: import_picocolors3.magenta("Svelte"),
690
- vue: import_picocolors3.green("Vue")
691
- };
692
- var availablePlugins = [
693
- {
694
- imports: [{ config: null, isPlugin: true, packageName: "cors" }],
695
- label: import_picocolors3.cyan("⚙️ @elysiajs/cors"),
696
- latestVersion: "1.3.3",
697
- value: "@elysiajs/cors"
698
- },
699
- {
700
- imports: [{ config: null, isPlugin: true, packageName: "swagger" }],
701
- label: import_picocolors3.cyan("\uD83D\uDCD1 @elysiajs/swagger"),
702
- latestVersion: "1.3.0",
703
- value: "@elysiajs/swagger"
704
- },
705
- {
706
- imports: [{ config: null, isPlugin: true, packageName: "rateLimit" }],
707
- label: import_picocolors3.green("\uD83D\uDEE0️ elysia-rate-limit"),
708
- latestVersion: "4.3.0",
709
- value: "elysia-rate-limit"
710
- }
711
- ];
712
- var absoluteAuthPlugin = {
713
- imports: [
714
- {
715
- config: { providersConfiguration: {} },
716
- isPlugin: true,
717
- packageName: "absoluteAuth"
718
- }
719
- ],
720
- latestVersion: "0.3.2",
721
- value: "@absolutejs/auth"
722
- };
723
- var scopedStatePlugin = {
724
- imports: [
725
- {
726
- config: { count: { value: 0 } },
727
- isPlugin: true,
728
- packageName: "scopedState"
729
- }
730
- ],
731
- latestVersion: "0.1.1",
732
- value: "elysia-scoped-state"
733
- };
734
- var eslintAndPrettierDependencies = [
735
- {
736
- latestVersion: "9.27.0",
737
- value: "eslint"
738
- },
739
- {
740
- latestVersion: "3.5.3",
741
- value: "prettier"
742
- }
743
- ];
744
- var defaultDependencies = [
745
- {
746
- imports: [{ isPlugin: false, packageName: "Elysia" }],
747
- latestVersion: "1.3.1",
748
- value: "elysia"
749
- }
750
- ];
751
- var defaultPlugins = [
752
- {
753
- imports: [
754
- { isPlugin: false, packageName: "asset" },
755
- { isPlugin: false, packageName: "build" },
756
- { isPlugin: true, packageName: "networking" }
757
- ],
758
- latestVersion: "0.11.1",
759
- value: "@absolutejs/absolute"
760
- },
761
- {
762
- imports: [
763
- {
764
- config: { assets: "./build", prefix: "" },
765
- isPlugin: true,
766
- packageName: "staticPlugin"
767
- }
768
- ],
769
- latestVersion: "1.3.0",
770
- value: "@elysiajs/static"
771
- }
772
- ];
773
-
774
- // src/messages.ts
775
- var helpMessage = `
776
- Usage: create-absolute [options] [${import_picocolors4.magenta("project-name")}]
777
-
778
- Arguments:
779
- ${import_picocolors4.magenta("project-name")} Name of the application to create.
780
- If omitted, you'll be prompted to enter one.
781
-
782
- Options:
783
- ${import_picocolors4.cyan("--help, -h")} Show this help message and exit
784
- ${import_picocolors4.cyan("--debug, -d")} Display a summary of the project configuration after creation
785
-
786
- ${import_picocolors4.cyan("--angular")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Directory name for an Angular frontend
787
- ${import_picocolors4.cyan("--assets")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Directory name for your static assets
788
- ${import_picocolors4.cyan("--auth")} ${import_picocolors4.dim(import_picocolors4.cyan("<plugin>"))} Preconfigured auth plugin (currently only "absolute-auth") or 'none' to skip auth setup
789
- ${import_picocolors4.cyan("--build")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Output directory for build artifacts
790
- ${import_picocolors4.cyan("--database")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Directory name for your database files
791
- ${import_picocolors4.cyan("--directory")} ${import_picocolors4.dim(import_picocolors4.cyan("<mode>"))} Directory-naming strategy: "default" or "custom"
792
- ${import_picocolors4.cyan("--engine")} ${import_picocolors4.dim(import_picocolors4.cyan("<engine>"))} Database engine (postgresql | mysql | sqlite | mongodb | redis | singlestore | cockroachdb | mssql) or 'none' to skip database setup
793
- ${import_picocolors4.cyan("--frontend")} ${import_picocolors4.dim(import_picocolors4.cyan("<name>"))} Frontend framework(s) to include: one or more of "react", "svelte", "html", "htmx", "vue", "angular"
794
- ${import_picocolors4.cyan("--git")} Initialize a Git repository
795
- ${import_picocolors4.cyan("--host")} ${import_picocolors4.dim(import_picocolors4.cyan("<host>"))} Database host provider (neon | planetscale | supabase | turso | vercel | upstash | atlas) or 'none' to skip database host setup
796
- ${import_picocolors4.cyan("--html")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Directory name for an HTML frontend
797
- ${import_picocolors4.cyan("--htmx")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Directory name for an HTMX frontend
798
- ${import_picocolors4.cyan("--lts")} Use LTS versions of required packages
799
- ${import_picocolors4.cyan("--npm")} Use the package manager that invoked this command to install dependencies
800
- ${import_picocolors4.cyan("--orm")} ${import_picocolors4.dim(import_picocolors4.cyan("<orm>"))} ORM to configure: "drizzle" or "prisma" or 'none' to skip ORM setup
801
- ${import_picocolors4.cyan("--plugin")} ${import_picocolors4.dim(import_picocolors4.cyan("<plugin>"))} Elysia plugin(s) to include (can be specified multiple times), passing 'none' will skip plugin setup and ignore any other plugin options
802
- ${import_picocolors4.cyan("--quality")} ${import_picocolors4.dim(import_picocolors4.cyan("<tool>"))} Code quality tool: "eslint+prettier" or "biome"
803
- ${import_picocolors4.cyan("--react")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Directory name for a React frontend
804
- ${import_picocolors4.cyan("--html-script")} ${import_picocolors4.dim(import_picocolors4.cyan("<option>"))} Enable HTML scripting with TypeScript
805
- ${import_picocolors4.cyan("--skip")} Skips non required prompts and uses 'none' for all optional configurations
806
- ${import_picocolors4.cyan("--svelte")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Directory name for a Svelte frontend
807
- ${import_picocolors4.cyan("--tailwind")} Include Tailwind CSS setup
808
- ${import_picocolors4.cyan("--tailwind-input")} ${import_picocolors4.dim(import_picocolors4.cyan("<file>"))} Path to your Tailwind CSS entry file
809
- ${import_picocolors4.cyan("--tailwind-output")} ${import_picocolors4.dim(import_picocolors4.cyan("<file>"))} Path for the generated Tailwind CSS bundle
810
- ${import_picocolors4.cyan("--vue")} ${import_picocolors4.dim(import_picocolors4.cyan("<dir>"))} Directory name for a Vue frontend
811
- `;
812
- var getOutroMessage = ({
813
- projectName,
814
- packageManager,
815
- installDependenciesNow
816
- }) => `${import_picocolors4.green("Created successfully")}, you can now run:
817
-
818
- ` + `${import_picocolors4.cyan("cd")} ${projectName}
819
- ` + `${installDependenciesNow ? "" : `${import_picocolors4.cyan(`${packageManager} install`)}
820
- `}` + `${import_picocolors4.cyan(`${packageManager} dev`)}`;
821
- var getDebugMessage = ({
822
- response: {
823
- projectName,
824
- codeQualityTool,
825
- directoryConfig,
826
- useTailwind,
827
- tailwind,
828
- frontends,
829
- useHTMLScripts,
830
- frontendDirectories,
831
- buildDirectory,
832
- assetsDirectory,
833
- databaseEngine,
834
- databaseHost,
835
- databaseDirectory,
836
- orm,
837
- authProvider,
838
- plugins,
839
- initializeGitNow,
840
- installDependenciesNow
841
- },
842
- packageManager
843
- }) => {
844
- const htmlScriptingValue = useHTMLScripts ? import_picocolors4.blueBright("TypeScript") : import_picocolors4.dim("None");
845
- const frameworkConfig = frontends.map((name) => `${frontendLabels[name]}: src/frontend/${frontendDirectories[name]}`).join(`
846
- `);
847
- const tailwindSection = useTailwind && tailwind ? `Input: ${tailwind.input}
848
- Output: ${tailwind.output}` : import_picocolors4.dim("None");
849
- const isCustomConfig = directoryConfig === "custom";
850
- const lines = [
851
- ["Project Name", projectName],
852
- ["Package Manager", packageManager],
853
- ["Config Type", isCustomConfig ? import_picocolors4.green("Custom") : import_picocolors4.dim("Default")],
854
- ["Linting", codeQualityTool === "eslint+prettier" ? "ESLint + Prettier" : "Biome"],
855
- ["Tailwind Configuration", tailwindSection],
856
- [frontends.length === 1 ? "Frontend" : "Frontends", frontends.map((name) => frontendLabels[name]).join(", ")],
857
- ["HTML Scripting", frontends.includes("html") ? htmlScriptingValue : import_picocolors4.dim("None")],
858
- ["Build Directory", buildDirectory],
859
- ["Assets Directory", assetsDirectory],
860
- ["Database Engine", databaseEngine && databaseEngine !== "none" ? databaseEngine : import_picocolors4.dim("None")],
861
- ["Database Host", databaseHost && databaseHost !== "none" ? databaseHost : import_picocolors4.dim("None")],
862
- ["Database Directory", databaseDirectory ?? import_picocolors4.dim("None")],
863
- ["ORM", orm ?? import_picocolors4.dim("None")],
864
- ["Auth Provider", authProvider && authProvider !== "none" ? authProvider : import_picocolors4.dim("None")],
865
- ["Plugins", plugins.length && !plugins.includes("none") ? plugins.join(", ") : import_picocolors4.dim("None")],
866
- ["Initialize Git", initializeGitNow ? import_picocolors4.green("Yes") : import_picocolors4.red("No")],
867
- ["Install Dependencies", installDependenciesNow ? import_picocolors4.green("Yes") : import_picocolors4.red("No")],
868
- ["Framework Config", frameworkConfig]
869
- ];
870
- const maxLabelLength = Math.max(...lines.map(([label]) => label.length));
871
- const body = `
872
-
873
- ${lines.map(([label, value]) => {
874
- const gap = " ".repeat(maxLabelLength - label.length);
875
- return `${import_picocolors4.magenta(label)}:${gap} ${value}`;
876
- }).join(`
877
- `)}`;
878
- return body;
879
- };
880
-
881
- // node_modules/@clack/prompts/dist/index.mjs
882
- var import_picocolors5 = __toESM(require_picocolors(), 1);
883
- var import_sisteransi3 = __toESM(require_src(), 1);
884
- import y3 from "node:process";
885
- function ce2() {
886
- return y3.platform !== "win32" ? y3.env.TERM !== "linux" : !!y3.env.CI || !!y3.env.WT_SESSION || !!y3.env.TERMINUS_SUBLIME || y3.env.ConEmuTask === "{cmd::Cmder}" || y3.env.TERM_PROGRAM === "Terminus-Sublime" || y3.env.TERM_PROGRAM === "vscode" || y3.env.TERM === "xterm-256color" || y3.env.TERM === "alacritty" || y3.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
887
- }
888
- var V3 = ce2();
889
- var u2 = (t, n) => V3 ? t : n;
890
- var le2 = u2("◆", "*");
891
- var L3 = u2("■", "x");
892
- var W3 = u2("▲", "x");
893
- var C2 = u2("◇", "o");
894
- var ue2 = u2("┌", "T");
895
- var o2 = u2("│", "|");
896
- var d3 = u2("└", "—");
897
- var k3 = u2("●", ">");
898
- var P3 = u2("○", " ");
899
- var A3 = u2("◻", "[•]");
900
- var T2 = u2("◼", "[+]");
901
- var F2 = u2("◻", "[ ]");
902
- var $e2 = u2("▪", "•");
903
- var _3 = u2("─", "-");
904
- var me2 = u2("╮", "+");
905
- var de2 = u2("├", "+");
906
- var pe2 = u2("╯", "+");
907
- var q2 = u2("●", "•");
908
- var D2 = u2("◆", "*");
909
- var U2 = u2("▲", "!");
910
- var K3 = u2("■", "x");
911
- var b2 = (t) => {
912
- switch (t) {
913
- case "initial":
914
- case "active":
915
- return import_picocolors5.default.cyan(le2);
916
- case "cancel":
917
- return import_picocolors5.default.red(L3);
918
- case "error":
919
- return import_picocolors5.default.yellow(W3);
920
- case "submit":
921
- return import_picocolors5.default.green(C2);
922
- }
923
- };
924
- var G2 = (t) => {
925
- const { cursor: n, options: r2, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
926
- let l2 = 0;
927
- n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r2.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
928
- const $2 = a < r2.length && l2 > 0, g2 = a < r2.length && l2 + a < r2.length;
929
- return r2.slice(l2, l2 + a).map((p2, v2, f) => {
930
- const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
931
- return j2 || E ? import_picocolors5.default.dim("...") : i(p2, v2 + l2 === n);
932
- });
933
- };
934
- var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
935
- const n = `${import_picocolors5.default.gray(o2)}
936
- ${b2(this.state)} ${t.message}
937
- `, r2 = t.placeholder ? import_picocolors5.default.inverse(t.placeholder[0]) + import_picocolors5.default.dim(t.placeholder.slice(1)) : import_picocolors5.default.inverse(import_picocolors5.default.hidden("_")), i = this.value ? this.valueWithCursor : r2;
938
- switch (this.state) {
939
- case "error":
940
- return `${n.trim()}
941
- ${import_picocolors5.default.yellow(o2)} ${i}
942
- ${import_picocolors5.default.yellow(d3)} ${import_picocolors5.default.yellow(this.error)}
943
- `;
944
- case "submit":
945
- return `${n}${import_picocolors5.default.gray(o2)} ${import_picocolors5.default.dim(this.value || t.placeholder)}`;
946
- case "cancel":
947
- return `${n}${import_picocolors5.default.gray(o2)} ${import_picocolors5.default.strikethrough(import_picocolors5.default.dim(this.value ?? ""))}${this.value?.trim() ? `
948
- ${import_picocolors5.default.gray(o2)}` : ""}`;
949
- default:
950
- return `${n}${import_picocolors5.default.cyan(o2)} ${i}
951
- ${import_picocolors5.default.cyan(d3)}
952
- `;
953
- }
954
- } }).prompt();
955
- var ye = (t) => {
956
- const n = t.active ?? "Yes", r2 = t.inactive ?? "No";
957
- return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? true, render() {
958
- const i = `${import_picocolors5.default.gray(o2)}
959
- ${b2(this.state)} ${t.message}
960
- `, s = this.value ? n : r2;
961
- switch (this.state) {
962
- case "submit":
963
- return `${i}${import_picocolors5.default.gray(o2)} ${import_picocolors5.default.dim(s)}`;
964
- case "cancel":
965
- return `${i}${import_picocolors5.default.gray(o2)} ${import_picocolors5.default.strikethrough(import_picocolors5.default.dim(s))}
966
- ${import_picocolors5.default.gray(o2)}`;
967
- default:
968
- return `${i}${import_picocolors5.default.cyan(o2)} ${this.value ? `${import_picocolors5.default.green(k3)} ${n}` : `${import_picocolors5.default.dim(P3)} ${import_picocolors5.default.dim(n)}`} ${import_picocolors5.default.dim("/")} ${this.value ? `${import_picocolors5.default.dim(P3)} ${import_picocolors5.default.dim(r2)}` : `${import_picocolors5.default.green(k3)} ${r2}`}
969
- ${import_picocolors5.default.cyan(d3)}
970
- `;
971
- }
972
- } }).prompt();
973
- };
974
- var ve = (t) => {
975
- const n = (r2, i) => {
976
- const s = r2.label ?? String(r2.value);
977
- switch (i) {
978
- case "selected":
979
- return `${import_picocolors5.default.dim(s)}`;
980
- case "active":
981
- return `${import_picocolors5.default.green(k3)} ${s} ${r2.hint ? import_picocolors5.default.dim(`(${r2.hint})`) : ""}`;
982
- case "cancelled":
983
- return `${import_picocolors5.default.strikethrough(import_picocolors5.default.dim(s))}`;
984
- default:
985
- return `${import_picocolors5.default.dim(P3)} ${import_picocolors5.default.dim(s)}`;
986
- }
987
- };
988
- return new LD({ options: t.options, initialValue: t.initialValue, render() {
989
- const r2 = `${import_picocolors5.default.gray(o2)}
990
- ${b2(this.state)} ${t.message}
991
- `;
992
- switch (this.state) {
993
- case "submit":
994
- return `${r2}${import_picocolors5.default.gray(o2)} ${n(this.options[this.cursor], "selected")}`;
995
- case "cancel":
996
- return `${r2}${import_picocolors5.default.gray(o2)} ${n(this.options[this.cursor], "cancelled")}
997
- ${import_picocolors5.default.gray(o2)}`;
998
- default:
999
- return `${r2}${import_picocolors5.default.cyan(o2)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
1000
- ${import_picocolors5.default.cyan(o2)} `)}
1001
- ${import_picocolors5.default.cyan(d3)}
1002
- `;
1003
- }
1004
- } }).prompt();
1005
- };
1006
- var fe = (t) => {
1007
- const n = (r2, i) => {
1008
- const s = r2.label ?? String(r2.value);
1009
- return i === "active" ? `${import_picocolors5.default.cyan(A3)} ${s} ${r2.hint ? import_picocolors5.default.dim(`(${r2.hint})`) : ""}` : i === "selected" ? `${import_picocolors5.default.green(T2)} ${import_picocolors5.default.dim(s)} ${r2.hint ? import_picocolors5.default.dim(`(${r2.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors5.default.strikethrough(import_picocolors5.default.dim(s))}` : i === "active-selected" ? `${import_picocolors5.default.green(T2)} ${s} ${r2.hint ? import_picocolors5.default.dim(`(${r2.hint})`) : ""}` : i === "submitted" ? `${import_picocolors5.default.dim(s)}` : `${import_picocolors5.default.dim(F2)} ${import_picocolors5.default.dim(s)}`;
1010
- };
1011
- return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r2) {
1012
- if (this.required && r2.length === 0)
1013
- return `Please select at least one option.
1014
- ${import_picocolors5.default.reset(import_picocolors5.default.dim(`Press ${import_picocolors5.default.gray(import_picocolors5.default.bgWhite(import_picocolors5.default.inverse(" space ")))} to select, ${import_picocolors5.default.gray(import_picocolors5.default.bgWhite(import_picocolors5.default.inverse(" enter ")))} to submit`))}`;
1015
- }, render() {
1016
- const r2 = `${import_picocolors5.default.gray(o2)}
1017
- ${b2(this.state)} ${t.message}
1018
- `, i = (s, c) => {
1019
- const a = this.value.includes(s.value);
1020
- return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
1021
- };
1022
- switch (this.state) {
1023
- case "submit":
1024
- return `${r2}${import_picocolors5.default.gray(o2)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors5.default.dim(", ")) || import_picocolors5.default.dim("none")}`;
1025
- case "cancel": {
1026
- const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors5.default.dim(", "));
1027
- return `${r2}${import_picocolors5.default.gray(o2)} ${s.trim() ? `${s}
1028
- ${import_picocolors5.default.gray(o2)}` : ""}`;
1029
- }
1030
- case "error": {
1031
- const s = this.error.split(`
1032
- `).map((c, a) => a === 0 ? `${import_picocolors5.default.yellow(d3)} ${import_picocolors5.default.yellow(c)}` : ` ${c}`).join(`
1033
- `);
1034
- return `${r2 + import_picocolors5.default.yellow(o2)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
1035
- ${import_picocolors5.default.yellow(o2)} `)}
1036
- ${s}
1037
- `;
1038
- }
1039
- default:
1040
- return `${r2}${import_picocolors5.default.cyan(o2)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
1041
- ${import_picocolors5.default.cyan(o2)} `)}
1042
- ${import_picocolors5.default.cyan(d3)}
1043
- `;
1044
- }
1045
- } }).prompt();
1046
- };
1047
- var xe = (t = "") => {
1048
- process.stdout.write(`${import_picocolors5.default.gray(d3)} ${import_picocolors5.default.red(t)}
1049
-
1050
- `);
1051
- };
1052
- var J3 = `${import_picocolors5.default.gray(o2)} `;
1053
- var Y2 = ({ indicator: t = "dots" } = {}) => {
1054
- const n = V3 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"], r2 = V3 ? 80 : 120, i = process.env.CI === "true";
1055
- let s, c, a = false, l2 = "", $2, g2 = performance.now();
1056
- const p2 = (m2) => {
1057
- const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
1058
- a && N2(h2, m2);
1059
- }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
1060
- process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
1061
- }, E = () => {
1062
- process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
1063
- }, B2 = () => {
1064
- if ($2 === undefined)
1065
- return;
1066
- i && process.stdout.write(`
1067
- `);
1068
- const m2 = $2.split(`
1069
- `);
1070
- process.stdout.write(import_sisteransi3.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi3.erase.down(m2.length));
1071
- }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
1072
- const h2 = (performance.now() - m2) / 1000, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
1073
- return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
1074
- }, H2 = (m2 = "") => {
1075
- a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors5.default.gray(o2)}
1076
- `);
1077
- let h2 = 0, w2 = 0;
1078
- j2(), c = setInterval(() => {
1079
- if (i && l2 === $2)
1080
- return;
1081
- B2(), $2 = l2;
1082
- const I2 = import_picocolors5.default.magenta(n[h2]);
1083
- if (i)
1084
- process.stdout.write(`${I2} ${l2}...`);
1085
- else if (t === "timer")
1086
- process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
1087
- else {
1088
- const z2 = ".".repeat(Math.floor(w2)).slice(0, 3);
1089
- process.stdout.write(`${I2} ${l2}${z2}`);
1090
- }
1091
- h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
1092
- }, r2);
1093
- }, N2 = (m2 = "", h2 = 0) => {
1094
- a = false, clearInterval(c), B2();
1095
- const w2 = h2 === 0 ? import_picocolors5.default.green(C2) : h2 === 1 ? import_picocolors5.default.red(L3) : import_picocolors5.default.red(W3);
1096
- l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
1097
- `) : process.stdout.write(`${w2} ${l2}
1098
- `), E(), s();
1099
- };
1100
- return { start: H2, stop: N2, message: (m2 = "") => {
1101
- l2 = R2(m2 ?? l2);
1102
- } };
1103
- };
1104
-
1105
- // src/questions/authProvider.ts
1106
- var import_picocolors6 = __toESM(require_picocolors(), 1);
1107
-
1108
- // src/utils/abort.ts
1109
- import { exit } from "node:process";
1110
- function abort() {
1111
- xe("Operation cancelled");
1112
- exit(0);
1113
- }
1114
-
1115
- // src/questions/authProvider.ts
1116
- var getAuthProvider = async () => {
1117
- const authProvider = await ve({
1118
- message: "Auth provider:",
1119
- options: [
1120
- { label: "None", value: "none" },
1121
- { label: import_picocolors6.cyan("Absolute Auth"), value: "absoluteAuth" }
1122
- ]
1123
- });
1124
- if (pD(authProvider))
1125
- abort();
1126
- return authProvider === "none" ? undefined : authProvider;
1127
- };
1128
-
1129
- // src/questions/codeQualityTool.ts
1130
- var import_picocolors7 = __toESM(require_picocolors(), 1);
1131
- var getCodeQualityTool = async () => {
1132
- const codeQualityTool = await ve({
1133
- message: "Choose linting and formatting tool:",
1134
- options: [
1135
- {
1136
- label: import_picocolors7.blueBright("ESLint + Prettier"),
1137
- value: "eslint+prettier"
1138
- },
1139
- { label: import_picocolors7.yellow("Biome"), value: "biome" }
1140
- ]
1141
- });
1142
- if (pD(codeQualityTool))
1143
- abort();
1144
- return codeQualityTool;
1145
- };
1146
-
1147
- // src/questions/configurationType.ts
1148
- var import_picocolors8 = __toESM(require_picocolors(), 1);
1149
- var getConfigurationType = async () => {
1150
- const directoryConfig = await ve({
1151
- message: "Choose folder naming configuration:",
1152
- options: [
1153
- { label: import_picocolors8.blueBright("Default"), value: "default" },
1154
- { label: import_picocolors8.yellow("Custom"), value: "custom" }
1155
- ]
1156
- });
1157
- if (pD(directoryConfig))
1158
- abort();
1159
- return directoryConfig;
1160
- };
1161
-
1162
- // src/questions/databaseEngine.ts
1163
- var import_picocolors9 = __toESM(require_picocolors(), 1);
1164
- var getDatabaseEngine = async () => {
1165
- const databaseDialectResponse = await ve({
1166
- message: "Database engine:",
1167
- options: [
1168
- { label: "None", value: "none" },
1169
- { label: import_picocolors9.cyan("PostgreSQL"), value: "postgresql" },
1170
- { label: import_picocolors9.magenta("SQLite"), value: "sqlite" },
1171
- { label: import_picocolors9.green("MySQL"), value: "mysql" },
1172
- { label: import_picocolors9.red("Redis"), value: "redis" },
1173
- { label: import_picocolors9.green("MongoDB"), value: "mongodb" },
1174
- { label: import_picocolors9.magenta("SingleStore"), value: "singlestore" },
1175
- { label: import_picocolors9.yellow("SQL Server"), value: "mssql" },
1176
- { label: import_picocolors9.cyan("CockroachDB"), value: "cockroachdb" }
1177
- ]
1178
- });
1179
- if (pD(databaseDialectResponse))
1180
- abort();
1181
- return databaseDialectResponse === "none" ? undefined : databaseDialectResponse;
1182
- };
1183
-
1184
- // src/questions/databaseHost.ts
1185
- var import_picocolors10 = __toESM(require_picocolors(), 1);
1186
- var getDatabaseHost = async (databaseEngine) => {
1187
- if (databaseEngine === "postgresql") {
1188
- const databaseHost = await ve({
1189
- message: "Select database host:",
1190
- options: [
1191
- { label: import_picocolors10.cyan("Neon"), value: "neon" },
1192
- { label: import_picocolors10.cyan("Supabase"), value: "supabase" },
1193
- { label: "None", value: "none" }
1194
- ]
1195
- });
1196
- if (pD(databaseHost))
1197
- abort();
1198
- return databaseHost === "none" ? undefined : databaseHost;
1199
- }
1200
- if (databaseEngine === "mysql") {
1201
- const databaseHost = await ye({
1202
- message: "Are you using PlanetScale?"
1203
- });
1204
- if (pD(databaseHost))
1205
- abort();
1206
- return databaseHost ? "planetscale" : undefined;
1207
- }
1208
- if (databaseEngine === "sqlite") {
1209
- const databaseHost = await ye({
1210
- message: "Are you using Turso?"
1211
- });
1212
- if (pD(databaseHost))
1213
- abort();
1214
- return databaseHost ? "turso" : undefined;
1215
- }
1216
- if (databaseEngine === "mongodb") {
1217
- const databaseHost = await ye({
1218
- message: "Are you using Atlas?"
1219
- });
1220
- if (pD(databaseHost))
1221
- abort();
1222
- return databaseHost ? "atlas" : undefined;
1223
- }
1224
- if (databaseEngine === "redis") {
1225
- const databaseHost = await ye({
1226
- message: "Are you using Upstash?"
1227
- });
1228
- if (pD(databaseHost))
1229
- abort();
1230
- return databaseHost ? "upstash" : undefined;
1231
- }
1232
- return;
1233
- };
1234
-
1235
- // src/questions/directoryConfiguration.ts
1236
- var getDirectoryConfiguration = async ({
1237
- directoryConfig,
1238
- useTailwind,
1239
- databaseEngine,
1240
- argumentConfiguration
1241
- }) => {
1242
- if (directoryConfig === "default") {
1243
- return {
1244
- assetsDirectory: argumentConfiguration.assetsDirectory ?? "src/backend/assets",
1245
- buildDirectory: argumentConfiguration.buildDirectory ?? "build",
1246
- databaseDirectory: databaseEngine ? argumentConfiguration.databaseDirectory ?? "db" : undefined,
1247
- tailwind: useTailwind ? {
1248
- input: argumentConfiguration.tailwind?.input ?? "./src/frontend/styles/tailwind.css",
1249
- output: argumentConfiguration.tailwind?.output ?? "/assets/css/tailwind.generated.css"
1250
- } : undefined
1251
- };
1252
- }
1253
- const buildDirectory = argumentConfiguration.buildDirectory ?? await he({
1254
- message: "Build directory:",
1255
- placeholder: "build"
1256
- });
1257
- if (pD(buildDirectory))
1258
- abort();
1259
- const assetsDirectory = argumentConfiguration.assetsDirectory ?? await he({
1260
- message: "Assets directory:",
1261
- placeholder: "src/backend/assets"
1262
- });
1263
- if (pD(assetsDirectory))
1264
- abort();
1265
- let tailwind;
1266
- if (useTailwind) {
1267
- const input = argumentConfiguration.tailwind?.input ?? await he({
1268
- message: "Tailwind input CSS file:",
1269
- placeholder: "./src/frontend/styles/tailwind.css"
1270
- });
1271
- if (pD(input))
1272
- abort();
1273
- const output = argumentConfiguration.tailwind?.output ?? await he({
1274
- message: "Tailwind output CSS file:",
1275
- placeholder: "/assets/css/tailwind.generated.css"
1276
- });
1277
- if (pD(output))
1278
- abort();
1279
- tailwind = { input, output };
1280
- } else {
1281
- tailwind = undefined;
1282
- }
1283
- let databaseDirectory;
1284
- if (databaseEngine !== undefined) {
1285
- databaseDirectory = argumentConfiguration.databaseDirectory ?? await he({
1286
- message: "Database directory:",
1287
- placeholder: "db"
1288
- });
1289
- if (pD(databaseDirectory))
1290
- abort();
1291
- }
1292
- return {
1293
- assetsDirectory,
1294
- buildDirectory,
1295
- databaseDirectory,
1296
- tailwind
1297
- };
1298
- };
1299
-
1300
- // src/questions/frontendDirectoryConfigurations.ts
1301
- var getDirectoryForFrontend = async (directoryConfiguration, frontend, isSingleFrontend) => {
1302
- if (directoryConfiguration !== "custom")
1303
- return isSingleFrontend ? "" : frontend;
1304
- const response = await he({
1305
- message: `${frontendLabels[frontend]} directory:`,
1306
- placeholder: isSingleFrontend ? "" : frontend
1307
- });
1308
- if (pD(response))
1309
- abort();
1310
- return response;
1311
- };
1312
- var getFrontendDirectoryConfigurations = async (directoryConfiguration, frontends, passedFrontendDirectories) => {
1313
- const isSingleFrontend = frontends.length === 1;
1314
- const frontendDirectories = {};
1315
- const frontendsToPrompt = [];
1316
- for (const frontend of frontends) {
1317
- const prefilled = passedFrontendDirectories?.[frontend];
1318
- if (prefilled === undefined)
1319
- frontendsToPrompt.push(frontend);
1320
- else
1321
- frontendDirectories[frontend] = prefilled;
1322
- }
1323
- const promptedDirectories = await Promise.all(frontendsToPrompt.map((name) => getDirectoryForFrontend(directoryConfiguration, name, isSingleFrontend)));
1324
- frontendsToPrompt.forEach((name, index) => frontendDirectories[name] = promptedDirectories[index]);
1325
- return frontendDirectories;
1326
- };
1327
-
1328
- // src/typeGuards.ts
1329
- var isAuthProvider = (value) => value === "absoluteAuth" || value === "none" || value === undefined;
1330
- var isDirectoryConfig = (value) => value === "default" || value === "custom";
1331
- var isDatabaseEngine = (value) => value === "postgresql" || value === "mysql" || value === "sqlite" || value === "mongodb" || value === "redis" || value === "singlestore" || value === "cockroachdb" || value === "mssql" || value === "none" || value === undefined;
1332
- var isDatabaseHost = (value) => value === "neon" || value === "planetscale" || value === "supabase" || value === "turso" || value === "vercel" || value === "upstash" || value === "atlas" || value === undefined;
1333
- var isORM = (value) => value === "drizzle" || value === "prisma" || value === undefined;
1334
- var isCodeQualityTool = (value) => value === "eslint+prettier" || value === "biome" || value === undefined;
1335
- var isFrontend = (value) => value !== undefined && Object.keys(frontendLabels).includes(value);
1336
-
1337
- // src/questions/frontends.ts
1338
- var getFrontends = async () => {
1339
- const frontends = await fe({
1340
- message: "Frontend(s) (space to select, enter to finish):",
1341
- options: Object.entries(frontendLabels).map(([value, label]) => ({
1342
- label,
1343
- value
1344
- }))
1345
- });
1346
- if (pD(frontends))
1347
- abort();
1348
- return frontends.filter(isFrontend);
1349
- };
1350
-
1351
- // src/questions/htmlScriptingOption.ts
1352
- var getHtmlScriptingOption = async () => {
1353
- const useScripts = await ye({
1354
- message: "Would you like to use scripts for your HTML pages?"
1355
- });
1356
- if (pD(useScripts))
1357
- abort();
1358
- return useScripts;
1359
- };
1360
-
1361
- // src/questions/initializeGitNow.ts
1362
- var getInitializeGit = async () => {
1363
- const initializeGitNow = await ye({
1364
- message: "Initialize a git repository?"
1365
- });
1366
- if (pD(initializeGitNow))
1367
- abort();
1368
- return initializeGitNow;
1369
- };
1370
-
1371
- // src/questions/installDependenciesNow.ts
1372
- var getInstallDependencies = async () => {
1373
- const installDependenciesNow = await ye({
1374
- message: "Install dependencies now?"
1375
- });
1376
- if (pD(installDependenciesNow))
1377
- abort();
1378
- return installDependenciesNow;
1379
- };
1380
-
1381
- // src/questions/orm.ts
1382
- var import_picocolors11 = __toESM(require_picocolors(), 1);
1383
- var getORM = async () => {
1384
- const orm = await ve({
1385
- message: "Choose an ORM (optional):",
1386
- options: [
1387
- { label: "None", value: "none" },
1388
- { label: import_picocolors11.cyan("Drizzle"), value: "drizzle" },
1389
- { label: import_picocolors11.magenta("Prisma"), value: "prisma" }
1390
- ]
1391
- });
1392
- if (pD(orm))
1393
- abort();
1394
- return orm === "none" ? undefined : orm;
1395
- };
1396
-
1397
- // src/questions/plugins.ts
1398
- var getPlugins = async () => {
1399
- const plugins = await fe({
1400
- message: "Select additional Elysia plugins (space to select, enter to submit):",
1401
- options: availablePlugins,
1402
- required: false
1403
- });
1404
- if (pD(plugins))
1405
- abort();
1406
- return plugins;
1407
- };
1408
-
1409
- // src/questions/projectName.ts
1410
- var getProjectName = async () => {
1411
- const projectName = await he({
1412
- message: "Project name:",
1413
- placeholder: "absolutejs-project"
1414
- });
1415
- if (pD(projectName))
1416
- abort();
1417
- return projectName ?? "absolutejs-project";
1418
- };
1419
-
1420
- // src/questions/useTailwind.ts
1421
- var getUseTailwind = async () => {
1422
- const useTailwind = await ye({ message: "Add Tailwind support?" });
1423
- if (pD(useTailwind))
1424
- abort();
1425
- return useTailwind;
1426
- };
1427
-
1428
- // src/prompt.ts
1429
- var prompt = async (argumentConfiguration) => {
1430
- const projectName = argumentConfiguration.projectName ?? await getProjectName();
1431
- const codeQualityTool = argumentConfiguration.codeQualityTool ?? await getCodeQualityTool();
1432
- const useTailwind = argumentConfiguration.useTailwind ?? await getUseTailwind();
1433
- const frontends = argumentConfiguration.frontends?.filter((frontend) => frontend !== undefined) ?? await getFrontends();
1434
- const useHTMLScripts = !frontends.includes("html") || argumentConfiguration.useHTMLScripts === undefined ? false : argumentConfiguration.useHTMLScripts ?? await getHtmlScriptingOption();
1435
- const databaseEngine = argumentConfiguration.databaseEngine ?? await getDatabaseEngine();
1436
- const databaseHost = argumentConfiguration.databaseHost ?? await getDatabaseHost(databaseEngine);
1437
- const orm = databaseEngine !== undefined && databaseEngine !== "none" ? argumentConfiguration.orm ?? await getORM() : undefined;
1438
- let directoryConfig = argumentConfiguration.directoryConfig ?? await getConfigurationType();
1439
- const { buildDirectory, assetsDirectory, tailwind, databaseDirectory } = await getDirectoryConfiguration({
1440
- argumentConfiguration,
1441
- databaseEngine,
1442
- directoryConfig,
1443
- useTailwind
1444
- });
1445
- const frontendDirectories = await getFrontendDirectoryConfigurations(directoryConfig, frontends, argumentConfiguration.frontendDirectories);
1446
- if (argumentConfiguration.frontendDirectories !== undefined)
1447
- directoryConfig = "custom";
1448
- const authProvider = argumentConfiguration.authProvider ?? await getAuthProvider();
1449
- const plugins = argumentConfiguration.plugins?.filter((plugin) => plugin !== undefined) ?? await getPlugins();
1450
- const initializeGitNow = argumentConfiguration.initializeGitNow ?? await getInitializeGit();
1451
- const installDependenciesNow = argumentConfiguration.installDependenciesNow ?? await getInstallDependencies();
1452
- const values = {
1453
- assetsDirectory,
1454
- authProvider,
1455
- buildDirectory,
1456
- codeQualityTool,
1457
- databaseDirectory,
1458
- databaseEngine,
1459
- databaseHost,
1460
- directoryConfig,
1461
- frontendDirectories,
1462
- frontends,
1463
- initializeGitNow,
1464
- installDependenciesNow,
1465
- orm,
1466
- plugins,
1467
- projectName,
1468
- tailwind,
1469
- useHTMLScripts,
1470
- useTailwind
1471
- };
1472
- return values;
1473
- };
1474
-
1475
- // src/scaffold.ts
1476
- import { copyFileSync as copyFileSync8 } from "node:fs";
1477
- import { join as join12, dirname } from "node:path";
1478
- import { fileURLToPath } from "node:url";
1479
-
1480
- // src/commands/formatProject.ts
1481
- import { execSync } from "child_process";
1482
- import { exit as exit2 } from "process";
1483
- var import_picocolors12 = __toESM(require_picocolors(), 1);
1484
-
1485
- // src/utils/commandMaps.ts
1486
- var formatCommands = {
1487
- bun: "bun run format",
1488
- npm: "npm run format",
1489
- pnpm: "pnpm run format",
1490
- yarn: "yarn format"
1491
- };
1492
- var installCommands = {
1493
- bun: "bun install",
1494
- npm: "npm install",
1495
- pnpm: "pnpm install",
1496
- yarn: "yarn install"
1497
- };
1498
-
1499
- // src/commands/formatProject.ts
1500
- var formatProject = ({
1501
- projectName,
1502
- packageManager
1503
- }) => {
1504
- const spin = Y2();
1505
- try {
1506
- const fmt = formatCommands[packageManager] ?? "bun run format";
1507
- spin.start("Formatting files…");
1508
- execSync(fmt, { cwd: projectName, stdio: "pipe" });
1509
- spin.stop(import_picocolors12.green("Files formatted"));
1510
- } catch (err) {
1511
- spin.stop(import_picocolors12.red("Failed to format files"), 1);
1512
- console.error("Error formatting:", err);
1513
- exit2(1);
1514
- }
1515
- };
1516
-
1517
- // src/commands/installDependencies.ts
1518
- import { execSync as execSync2 } from "child_process";
1519
- import { exit as exit3 } from "process";
1520
- var import_picocolors13 = __toESM(require_picocolors(), 1);
1521
- var installDependencies = async ({
1522
- projectName,
1523
- packageManager
1524
- }) => {
1525
- const spin = Y2();
1526
- const cmd = installCommands[packageManager] ?? "bun install";
1527
- try {
1528
- spin.start("Installing dependencies…");
1529
- execSync2(cmd, { cwd: projectName, stdio: "pipe" });
1530
- spin.stop(import_picocolors13.green("Dependencies installed"));
1531
- } catch (err) {
1532
- spin.stop(import_picocolors13.red("Installation failed"), 1);
1533
- console.error("Error installing dependencies:", err);
1534
- exit3(1);
1535
- }
1536
- };
1537
-
1538
- // src/generators/configurations/addConfigurationFiles.ts
1539
- var import_picocolors14 = __toESM(require_picocolors(), 1);
1540
- import { copyFileSync, writeFileSync } from "fs";
1541
- import { join } from "path";
1542
-
1543
- // src/generators/configurations/generatePrettierrc.ts
1544
- var generatePrettierrc = (frontends) => {
1545
- const usesSvelte = frontends.some((frontend) => frontend === "svelte");
1546
- return `{
1547
- "endOfLine": "auto",
1548
- "printWidth": 80,
1549
- "semi": true,
1550
- "singleQuote": true,
1551
- "tabWidth": 4,
1552
- "trailingComma": "none",
1553
- "useTabs": true
1554
- ${usesSvelte ? `,"plugins": ["prettier-plugin-svelte"],
1555
- "overrides": [{"files": "*.svelte", "options": {"parser": "svelte"}}]` : ""}
1556
- }`;
1557
- };
1558
-
1559
- // src/generators/configurations/addConfigurationFiles.ts
1560
- var addConfigurationFiles = ({
1561
- tailwind,
1562
- templatesDirectory,
1563
- codeQualityTool,
1564
- frontends,
1565
- initializeGitNow,
1566
- projectName
1567
- }) => {
1568
- copyFileSync(join(templatesDirectory, "configurations", "tsconfig.example.json"), join(projectName, "tsconfig.json"));
1569
- if (tailwind) {
1570
- copyFileSync(join(templatesDirectory, "tailwind", "postcss.config.ts"), join(projectName, "postcss.config.ts"));
1571
- copyFileSync(join(templatesDirectory, "tailwind", "tailwind.config.ts"), join(projectName, "tailwind.config.ts"));
1572
- }
1573
- if (initializeGitNow)
1574
- copyFileSync(join(templatesDirectory, "git", "gitignore"), join(projectName, ".gitignore"));
1575
- if (codeQualityTool === "eslint+prettier") {
1576
- copyFileSync(join(templatesDirectory, "configurations", "eslint.config.mjs"), join(projectName, "eslint.config.mjs"));
1577
- copyFileSync(join(templatesDirectory, "configurations", ".prettierignore"), join(projectName, ".prettierignore"));
1578
- const prettierrc = generatePrettierrc(frontends);
1579
- writeFileSync(join(projectName, ".prettierrc.json"), prettierrc);
1580
- } else
1581
- console.warn(`${import_picocolors14.dim("│")}
1582
- ${import_picocolors14.yellow("▲")} Biome support not implemented yet`);
1583
- };
1584
-
1585
- // src/generators/configurations/generatePackageJson.ts
1586
- import { writeFileSync as writeFileSync2 } from "fs";
1587
- import { join as join2 } from "path";
1588
- var import_picocolors15 = __toESM(require_picocolors(), 1);
1589
-
1590
- // src/utils/getPackageVersion.ts
1591
- import { execSync as execSync3 } from "child_process";
1592
- var getPackageVersion = (packageName) => {
1593
- try {
1594
- const raw = execSync3(`curl -s https://registry.npmjs.org/${packageName}/latest`);
1595
- const { version } = JSON.parse(raw.toString());
1596
- return version;
1597
- } catch (err) {
1598
- console.error(`Error fetching version for ${packageName}:`, err);
1599
- return null;
1600
- }
1601
- };
1602
-
1603
- // src/generators/configurations/generatePackageJson.ts
1604
- var createPackageJson = ({
1605
- projectName,
1606
- authProvider,
1607
- plugins,
1608
- useTailwind,
1609
- latest,
1610
- frontendDirectories,
1611
- codeQualityTool
1612
- }) => {
1613
- const s = Y2();
1614
- latest && s.start("Resolving package versions…");
1615
- const resolveVersion = (name, listed) => latest ? getPackageVersion(name) ?? listed : listed;
1616
- const dependencies = {};
1617
- const devDependencies = {};
1618
- const requiresReact = frontendDirectories["react"] !== undefined;
1619
- const requiresSvelte = frontendDirectories["svelte"] !== undefined;
1620
- const requiresVue = frontendDirectories["vue"] !== undefined;
1621
- const requiresHtmx = frontendDirectories["htmx"] !== undefined;
1622
- for (const p2 of defaultPlugins) {
1623
- dependencies[p2.value] = resolveVersion(p2.value, p2.latestVersion);
1624
- }
1625
- if (authProvider === "absoluteAuth") {
1626
- dependencies[absoluteAuthPlugin.value] = resolveVersion(absoluteAuthPlugin.value, absoluteAuthPlugin.latestVersion);
1627
- }
1628
- for (const pluginValue of plugins) {
1629
- const meta = availablePlugins.find((p2) => p2.value === pluginValue);
1630
- if (!meta)
1631
- continue;
1632
- dependencies[meta.value] = resolveVersion(meta.value, meta.latestVersion);
1633
- }
1634
- if (codeQualityTool === "eslint+prettier") {
1635
- eslintAndPrettierDependencies.forEach((dep) => {
1636
- devDependencies[dep.value] = resolveVersion(dep.value, dep.latestVersion);
1637
- });
1638
- }
1639
- if (useTailwind) {
1640
- devDependencies["autoprefixer"] = resolveVersion("autoprefixer", "10.4.21");
1641
- devDependencies["postcss"] = resolveVersion("postcss", "8.5.3");
1642
- devDependencies["tailwindcss"] = resolveVersion("tailwindcss", "4.1.7");
1643
- devDependencies["@tailwindcss/cli"] = resolveVersion("@tailwindcss/cli", "4.1.7");
1644
- }
1645
- if (requiresReact) {
1646
- dependencies["react"] = resolveVersion("react", "19.1.0");
1647
- dependencies["react-dom"] = resolveVersion("react-dom", "19.1.0");
1648
- devDependencies["@types/react"] = resolveVersion("@types/react", "19.1.5");
1649
- devDependencies["@types/react-dom"] = resolveVersion("@types/react-dom", "19.1.5");
1650
- }
1651
- if (requiresSvelte) {
1652
- dependencies["svelte"] = resolveVersion("svelte", "5.34.7");
1653
- codeQualityTool === "eslint+prettier" && (devDependencies["prettier-plugin-svelte"] = resolveVersion("prettier-plugin-svelte", "3.4.0"));
1654
- }
1655
- if (requiresVue) {
1656
- dependencies["vue"] = resolveVersion("vue", "3.5.17");
1657
- }
1658
- if (requiresHtmx) {
1659
- dependencies["elysia-scoped-state"] = resolveVersion("elysia-scoped-state", "0.1.1");
1660
- }
1661
- latest && s.stop(import_picocolors15.green("Package versions resolved"));
1662
- const scripts = {
1663
- dev: "bun run --watch src/backend/server.ts",
1664
- format: `prettier --write "./**/*.{js,ts,css,json,mjs,md${requiresReact ? ",jsx,tsx" : ""}${requiresSvelte ? ",svelte" : ""}${requiresVue ? ",vue" : ""}}"`,
1665
- lint: "eslint ./src",
1666
- test: 'echo "Error: no test specified" && exit 1',
1667
- typecheck: "bun run tsc --noEmit"
1668
- };
1669
- const packageJson = {
1670
- dependencies,
1671
- devDependencies,
1672
- name: projectName,
1673
- scripts,
1674
- type: "module",
1675
- version: "0.0.0"
1676
- };
1677
- writeFileSync2(join2(projectName, "package.json"), JSON.stringify(packageJson));
1678
- };
1679
-
1680
- // src/generators/configurations/initializeRoot.ts
1681
- import { copyFileSync as copyFileSync2, existsSync, mkdirSync } from "node:fs";
1682
- import { join as join3 } from "node:path";
1683
- var initalizeRoot = (projectName, templatesDirectory) => {
1684
- if (existsSync(projectName)) {
1685
- throw new Error(`Cannot create project "${projectName}": directory already exists.`);
1686
- }
1687
- mkdirSync(projectName);
1688
- const srcDir = join3(projectName, "src");
1689
- mkdirSync(srcDir);
1690
- mkdirSync(join3(srcDir, "types"));
1691
- const constantsSrc = join3(templatesDirectory, "constants.ts");
1692
- const constantsDest = join3(srcDir, "constants.ts");
1693
- copyFileSync2(constantsSrc, constantsDest);
1694
- const frontendDirectory = join3(srcDir, "frontend");
1695
- const backendDirectory = join3(srcDir, "backend");
1696
- mkdirSync(frontendDirectory);
1697
- mkdirSync(backendDirectory);
1698
- const projectAssetsDirectory = join3(backendDirectory, "assets");
1699
- mkdirSync(projectAssetsDirectory);
1700
- mkdirSync(join3(projectAssetsDirectory, "ico"), { recursive: true });
1701
- mkdirSync(join3(projectAssetsDirectory, "png"), { recursive: true });
1702
- mkdirSync(join3(projectAssetsDirectory, "svg"), { recursive: true });
1703
- copyFileSync2(join3(templatesDirectory, "assets", "ico", "favicon.ico"), join3(projectAssetsDirectory, "ico", "favicon.ico"));
1704
- copyFileSync2(join3(templatesDirectory, "assets", "png", "absolutejs-temp.png"), join3(projectAssetsDirectory, "png", "absolutejs-temp.png"));
1705
- return { backendDirectory, frontendDirectory, projectAssetsDirectory };
1706
- };
1707
-
1708
- // src/generators/db/scaffoldDatabase.ts
1709
- var import_picocolors16 = __toESM(require_picocolors(), 1);
1710
- import { mkdirSync as mkdirSync2 } from "fs";
1711
- import { join as join5 } from "path";
1712
-
1713
- // src/generators/configurations/generateDrizzleConfig.ts
1714
- import { writeFileSync as writeFileSync3 } from "fs";
1715
- import { join as join4 } from "path";
1716
- var createDrizzleConfig = ({
1717
- projectName,
1718
- databaseEngine
1719
- }) => {
1720
- const drizzleConfig = `import { defineConfig } from "drizzle-kit";
1721
-
1722
- export default defineConfig({
1723
- dialect: '${databaseEngine}'
1724
- });
1725
- `;
1726
- writeFileSync3(join4(projectName, "drizzle.config.ts"), drizzleConfig);
1727
- };
1728
-
1729
- // src/generators/db/scaffoldDatabase.ts
1730
- var scaffoldDatabase = ({
1731
- projectName,
1732
- databaseEngine,
1733
- databaseDirectory,
1734
- orm
1735
- }) => {
1736
- mkdirSync2(join5(projectName, databaseDirectory), { recursive: true });
1737
- if (databaseEngine !== "postgresql" && databaseEngine !== "none") {
1738
- console.warn(`${import_picocolors16.dim("│")}
1739
- ${import_picocolors16.yellow("▲")} Only PostgreSQL support is implemented so far`);
1740
- }
1741
- if (orm === "drizzle") {
1742
- createDrizzleConfig({ databaseEngine, projectName });
1743
- }
1744
- if (orm === "prisma") {
1745
- console.warn(`${import_picocolors16.dim("│")}
1746
- ${import_picocolors16.yellow("▲")} Prisma support is not implemented yet`);
1747
- }
1748
- };
1749
-
1750
- // src/generators/project/generateServer.ts
1751
- import { writeFileSync as writeFileSync4 } from "fs";
1752
-
1753
- // src/constants.ts
1754
- var UNFOUND_INDEX = -1;
1755
- var DEFAULT_ARG_LENGTH = 2;
1756
- var TWO_THIRDS = 2 / 3;
1757
-
1758
- // src/generators/project/generateServer.ts
1759
- var createServerFile = ({
1760
- tailwind,
1761
- frontendDirectories,
1762
- serverFilePath,
1763
- authProvider,
1764
- availablePlugins: availablePlugins2,
1765
- buildDirectory,
1766
- assetsDirectory,
1767
- plugins
1768
- }) => {
1769
- const htmlDirectory = frontendDirectories["html"];
1770
- const reactDirectory = frontendDirectories["react"];
1771
- const svelteDirectory = frontendDirectories["svelte"];
1772
- const vueDirectory = frontendDirectories["vue"];
1773
- const htmxDirectory = frontendDirectories["htmx"];
1774
- const requiresHtml = htmlDirectory !== undefined;
1775
- const requiresReact = reactDirectory !== undefined;
1776
- const requiresSvelte = svelteDirectory !== undefined;
1777
- const requiresVue = vueDirectory !== undefined;
1778
- const requiresHtmx = htmxDirectory !== undefined;
1779
- const nonFrameworkOnly = (requiresHtml || requiresHtmx) && !requiresReact && !requiresSvelte && !requiresVue;
1780
- const selectedCustomPlugins = availablePlugins2.filter(({ value }) => plugins.indexOf(value) !== UNFOUND_INDEX);
1781
- const authenticationPlugins = authProvider === "absoluteAuth" ? [absoluteAuthPlugin] : [];
1782
- const htmxPlugins = requiresHtmx ? [scopedStatePlugin] : [];
1783
- const allDependencies = [
1784
- ...defaultDependencies,
1785
- ...defaultPlugins,
1786
- ...selectedCustomPlugins,
1787
- ...authenticationPlugins,
1788
- ...htmxPlugins
1789
- ];
1790
- const uniqueDependencies = Array.from(new Map(allDependencies.map((dependency) => [dependency.value, dependency])).values()).sort((a, b3) => a.value.localeCompare(b3.value));
1791
- const importLines = uniqueDependencies.flatMap(({ value, imports }) => {
1792
- const filteredImports = nonFrameworkOnly && imports ? imports.filter(({ packageName }) => packageName !== "asset") : imports;
1793
- return filteredImports && filteredImports.length > 0 ? [
1794
- `import { ${filteredImports.map(({ packageName }) => packageName).join(", ")} } from '${value}';`
1795
- ] : [];
1796
- });
1797
- const absoluteImportIdx = importLines.findIndex((line) => line.includes("from '@absolutejs/absolute'"));
1798
- if (absoluteImportIdx !== UNFOUND_INDEX && importLines[absoluteImportIdx]) {
1799
- const existingItems = importLines[absoluteImportIdx].replace(/import\s*\{\s*|\}\s*from.*$/g, "").split(",").map((item) => item.trim()).filter((value) => value.length > 0);
1800
- const additionalItems = [
1801
- requiresHtml && !existingItems.includes("handleHTMLPageRequest") && "handleHTMLPageRequest",
1802
- requiresReact && !existingItems.includes("handleReactPageRequest") && "handleReactPageRequest",
1803
- requiresSvelte && !existingItems.includes("handleSveltePageRequest") && "handleSveltePageRequest",
1804
- requiresVue && !existingItems.includes("handleVuePageRequest") && "handleVuePageRequest",
1805
- requiresVue && !existingItems.includes("generateHeadElement") && "generateHeadElement",
1806
- requiresHtmx && !existingItems.includes("handleHTMXPageRequest") && "handleHTMXPageRequest"
1807
- ].filter((value) => typeof value === "string");
1808
- importLines[absoluteImportIdx] = `import { ${[
1809
- ...existingItems,
1810
- ...additionalItems
1811
- ].join(", ")} } from '@absolutejs/absolute';`;
1812
- }
1813
- if (reactDirectory !== undefined) {
1814
- const reactImportSource = reactDirectory === "" ? "../frontend/pages/ReactExample" : `../frontend/${reactDirectory}/pages/ReactExample`;
1815
- importLines.push(`import { ReactExample } from '${reactImportSource}';`);
1816
- }
1817
- if (requiresSvelte) {
1818
- const svelteImportSource = svelteDirectory === "" ? "../frontend/pages/SvelteExample" : `../frontend/${svelteDirectory}/pages/SvelteExample`;
1819
- importLines.push(`import SvelteExample from '${svelteImportSource}.svelte';`);
1820
- }
1821
- if (requiresVue) {
1822
- const vueImportSource = vueDirectory === "" ? "../frontend/pages/VueExample" : `../frontend/${vueDirectory}/pages/VueExample`;
1823
- importLines.push(`import VueExample from '${vueImportSource}.vue';`);
1824
- }
1825
- const useStatements = uniqueDependencies.flatMap(({ imports }) => imports ?? []).filter((entry) => entry.isPlugin).map((entry) => {
1826
- if (entry.config === undefined)
1827
- return `.use(${entry.packageName})`;
1828
- if (entry.config === null)
1829
- return `.use(${entry.packageName}())`;
1830
- return `.use(${entry.packageName}(${JSON.stringify(entry.config)}))`;
1831
- });
1832
- const manifestOptions = [
1833
- `assetsDirectory: '${assetsDirectory}'`,
1834
- `buildDirectory: '${buildDirectory}'`,
1835
- ...Object.entries(frontendDirectories).map(([frameworkName, directory]) => `${frameworkName}Directory: './src/frontend/${directory}'`),
1836
- tailwind ? `tailwind: ${JSON.stringify(tailwind)}` : ""
1837
- ].filter(Boolean);
1838
- const manifestDeclaration = `${nonFrameworkOnly ? "" : "const manifest = "}await build({
1839
- ${manifestOptions.join(`,
1840
- `)}
1841
- });`;
1842
- const routesData = Object.entries(frontendDirectories).reduce((acc, [frameworkName, directory], index) => {
1843
- let handler;
1844
- switch (frameworkName) {
1845
- case "html":
1846
- handler = `handleHTMLPageRequest(\`${buildDirectory}${directory ? `/${directory}` : ""}/pages/HTMLExample.html\`)`;
1847
- break;
1848
- case "react":
1849
- handler = `handleReactPageRequest(ReactExample, asset(manifest, 'ReactExampleIndex'), { initialCount: 0, cssPath: asset(manifest, 'ReactExampleCSS') })`;
1850
- break;
1851
- case "svelte":
1852
- handler = `handleSveltePageRequest(SvelteExample, asset(manifest, 'SvelteExample'), asset(manifest, 'SvelteExampleIndex'), { initialCount: 0, cssPath: asset(manifest, 'SvelteExampleCSS') })`;
1853
- break;
1854
- case "vue":
1855
- handler = `handleVuePageRequest(VueExample, asset(manifest, 'VueExample'), asset(manifest, 'VueExampleIndex'), generateHeadElement({ cssPath: asset(manifest, 'VueExampleCSS'), title: 'AbsoluteJS + Vue' }), { initialCount: 0 })`;
1856
- break;
1857
- case "htmx":
1858
- handler = `handleHTMXPageRequest(\`${buildDirectory}${directory ? `/${directory}` : ""}/pages/HTMXExample.html\`)`;
1859
- if (index === 0) {
1860
- acc.indexRoute = `.get('/', () => ${handler})`;
1861
- }
1862
- acc.otherRoutes.push(`.post('/htmx/reset', ({ resetScopedStore }) => resetScopedStore())`, `.get('/htmx/count', ({ scopedStore }) => scopedStore.count)`, `.post('/htmx/increment', ({ scopedStore }) => ++scopedStore.count)`, `.get('htmx', () => ${handler})`);
1863
- return acc;
1864
- default:
1865
- return acc;
1866
- }
1867
- if (index === 0) {
1868
- acc.indexRoute = `.get('/', () => ${handler})`;
1869
- }
1870
- acc.otherRoutes.push(`.get('${frameworkName}', () => ${handler})`);
1871
- return acc;
1872
- }, { indexRoute: null, otherRoutes: [] });
1873
- const routes = [routesData.indexRoute ?? "", ...routesData.otherRoutes].filter(Boolean).join(`
1874
- `);
1875
- const useLines = useStatements.map((s) => ` ${s}`).join(`
1876
- `);
1877
- const serverFileContent = `${importLines.join(`
1878
- `)}
1879
-
1880
- ${manifestDeclaration}
1881
-
1882
- new Elysia()
1883
- ${useLines}
1884
- ${routes}
1885
- .on('error', (err) => {
1886
- const { request } = err;
1887
- console.error(\`Server error on \${request.method} \${request.url}: \${err.message}\`);
1888
- });
1889
- `;
1890
- writeFileSync4(serverFilePath, serverFileContent);
1891
- };
1892
-
1893
- // src/generators/project/scaffoldFrontends.ts
1894
- import { cpSync as cpSync6, mkdirSync as mkdirSync7 } from "node:fs";
1895
- import { join as join11 } from "node:path";
1896
-
1897
- // src/generators/html/scaffoldHTML.ts
1898
- import { copyFileSync as copyFileSync3, cpSync, mkdirSync as mkdirSync3, writeFileSync as writeFileSync5 } from "node:fs";
1899
- import { join as join6 } from "node:path";
1900
-
1901
- // src/generators/project/generateMarkupCSS.ts
1902
- var generateMarkupCSS = (isSingleFrontend) => `@import url('${isSingleFrontend ? "../styles/reset.css" : "../../styles/reset.css"}');
1903
-
1904
- header {
1905
- align-items: center;
1906
- background-color: #1a1a1a;
1907
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
1908
- display: flex;
1909
- justify-content: space-between;
1910
- padding: 2rem;
1911
- text-align: center;
1912
- }
1913
-
1914
- header a {
1915
- position: relative;
1916
- color: #5fbeeb;
1917
- text-decoration: none;
1918
- }
1919
-
1920
- header a::after {
1921
- content: '';
1922
- position: absolute;
1923
- left: 0;
1924
- bottom: 0;
1925
- width: 100%;
1926
- height: 2px;
1927
- background: linear-gradient(90deg, #5fbeeb 0%, #35d5a2 50%, #ff4b91 100%);
1928
- transform: scaleX(0);
1929
- transform-origin: left;
1930
- transition: transform 0.25s ease-in-out;
1931
- }
1932
-
1933
- header a:hover::after {
1934
- transform: scaleX(1);
1935
- }
1936
-
1937
- h1 {
1938
- font-size: 2.5rem;
1939
- margin-top: 2rem;
1940
- }
1941
-
1942
- .logo {
1943
- height: 8rem;
1944
- width: 8rem;
1945
- will-change: filter;
1946
- transition: filter 300ms;
1947
- }
1948
-
1949
- .logo:hover {
1950
- filter: drop-shadow(0 0 2rem #5fbeeb);
1951
- }
1952
-
1953
- .logo.html:hover {
1954
- filter: drop-shadow(0 0 2rem #e34f26);
1955
- }
1956
-
1957
- nav {
1958
- display: flex;
1959
- gap: 4rem;
1960
- justify-content: center;
1961
- }
1962
-
1963
- header details {
1964
- position: relative;
1965
- }
1966
-
1967
- header details summary {
1968
- list-style: none;
1969
- appearance: none;
1970
- -webkit-appearance: none;
1971
- cursor: pointer;
1972
- user-select: none;
1973
- color: #5fbeeb;
1974
- font-size: 1.5rem;
1975
- font-weight: 500;
1976
- padding: 0.5rem 1rem;
1977
- }
1978
-
1979
- header summary::after {
1980
- content: '▼';
1981
- display: inline-block;
1982
- margin-left: 0.5rem;
1983
- font-size: 0.75rem;
1984
- transition: transform 0.3s ease;
1985
- }
1986
-
1987
- header details[open] summary::after {
1988
- transform: rotate(180deg);
1989
- }
1990
-
1991
- header details nav {
1992
- position: absolute;
1993
- top: 100%;
1994
- right: -0.5rem;
1995
- display: flex;
1996
- flex-direction: column;
1997
- gap: 0.75rem;
1998
- background: rgba(185, 185, 185, 0.1);
1999
- backdrop-filter: blur(4px);
2000
- border: 1px solid #5fbeeb;
2001
- border-radius: 1rem;
2002
- padding: 1rem 1.5rem;
2003
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
2004
- opacity: 0;
2005
- transform: translateY(-8px);
2006
- pointer-events: none;
2007
- transition:
2008
- opacity 0.3s ease,
2009
- transform 0.3s ease;
2010
- z-index: 1000;
2011
- }
2012
-
2013
- header details[open] nav {
2014
- opacity: 1;
2015
- transform: translateY(0);
2016
- pointer-events: auto;
2017
- }
2018
-
2019
- header details nav a {
2020
- font-size: 1.1rem;
2021
- padding: 0.25rem 0;
2022
- white-space: nowrap;
2023
- }
2024
-
2025
- @media (prefers-color-scheme: light) {
2026
- header {
2027
- background-color: #ffffff;
2028
- }
2029
-
2030
- button {
2031
- background-color: #ffffff;
2032
- }
2033
- }
2034
- `;
2035
-
2036
- // src/generators/html/scaffoldHTML.ts
2037
- var scaffoldHTML = ({
2038
- isSingleFrontend,
2039
- targetDirectory,
2040
- useHTMLScripts,
2041
- templatesDirectory,
2042
- projectAssetsDirectory
2043
- }) => {
2044
- copyFileSync3(join6(templatesDirectory, "assets", "svg", "HTML5_Badge.svg"), join6(projectAssetsDirectory, "svg", "HTML5_Badge.svg"));
2045
- cpSync(join6(templatesDirectory, "html"), targetDirectory, {
2046
- recursive: true
2047
- });
2048
- const cssOutputDir = join6(targetDirectory, "styles");
2049
- mkdirSync3(cssOutputDir, { recursive: true });
2050
- const cssOutputFile = join6(cssOutputDir, "html-example.css");
2051
- const htmlCSS = generateMarkupCSS(isSingleFrontend);
2052
- writeFileSync5(cssOutputFile, htmlCSS, "utf-8");
2053
- };
2054
-
2055
- // src/generators/htmx/scaffoldHTMX.ts
2056
- import { copyFileSync as copyFileSync4, cpSync as cpSync2, mkdirSync as mkdirSync4, writeFileSync as writeFileSync6 } from "fs";
2057
- import { join as join7 } from "path";
2058
- var scaffoldHTMX = ({
2059
- targetDirectory,
2060
- templatesDirectory,
2061
- projectAssetsDirectory,
2062
- isSingleFrontend
2063
- }) => {
2064
- copyFileSync4(join7(templatesDirectory, "assets", "svg", "htmx-logo-black.svg"), join7(projectAssetsDirectory, "svg", "htmx-logo-black.svg"));
2065
- copyFileSync4(join7(templatesDirectory, "assets", "svg", "htmx-logo-white.svg"), join7(projectAssetsDirectory, "svg", "htmx-logo-white.svg"));
2066
- cpSync2(join7(templatesDirectory, "htmx"), targetDirectory, {
2067
- recursive: true
2068
- });
2069
- const cssOutputDir = join7(targetDirectory, "styles");
2070
- mkdirSync4(cssOutputDir, { recursive: true });
2071
- const cssOutputFile = join7(cssOutputDir, "htmx-example.css");
2072
- const htmxCSS = generateMarkupCSS(isSingleFrontend);
2073
- writeFileSync6(cssOutputFile, htmxCSS, "utf-8");
2074
- };
2075
-
2076
- // src/generators/react/scaffoldReact.ts
2077
- import { copyFileSync as copyFileSync5, cpSync as cpSync3, mkdirSync as mkdirSync5, writeFileSync as writeFileSync7 } from "fs";
2078
- import { join as join8 } from "path";
2079
- var scaffoldReact = ({
2080
- isSingleFrontend,
2081
- targetDirectory,
2082
- templatesDirectory,
2083
- projectAssetsDirectory
2084
- }) => {
2085
- copyFileSync5(join8(templatesDirectory, "assets", "svg", "react.svg"), join8(projectAssetsDirectory, "svg", "react.svg"));
2086
- cpSync3(join8(templatesDirectory, "react"), targetDirectory, {
2087
- recursive: true
2088
- });
2089
- const cssOutputDir = join8(targetDirectory, "styles");
2090
- mkdirSync5(cssOutputDir, { recursive: true });
2091
- const cssOutputFile = join8(cssOutputDir, "react-example.css");
2092
- const reactCSS = generateMarkupCSS(isSingleFrontend);
2093
- writeFileSync7(cssOutputFile, reactCSS, "utf-8");
2094
- };
2095
-
2096
- // src/generators/svelte/scaffoldSvelte.ts
2097
- import { copyFileSync as copyFileSync6, cpSync as cpSync4, mkdirSync as mkdirSync6, writeFileSync as writeFileSync8 } from "fs";
2098
- import { join as join9 } from "path";
2099
- var scaffoldSvelte = ({
2100
- isSingleFrontend,
2101
- targetDirectory,
2102
- templatesDirectory,
2103
- projectAssetsDirectory
2104
- }) => {
2105
- copyFileSync6(join9(templatesDirectory, "assets", "svg", "svelte-logo.svg"), join9(projectAssetsDirectory, "svg", "svelte-logo.svg"));
2106
- cpSync4(join9(templatesDirectory, "svelte"), targetDirectory, {
2107
- recursive: true
2108
- });
2109
- const cssOutputDirectory = join9(targetDirectory, "styles");
2110
- mkdirSync6(cssOutputDirectory, { recursive: true });
2111
- const cssOutputFile = join9(cssOutputDirectory, "svelte-example.css");
2112
- const svelteCSS = `@import url('${isSingleFrontend ? "../" : "../../"}styles/reset.css');`;
2113
- writeFileSync8(cssOutputFile, svelteCSS, "utf-8");
2114
- };
2115
-
2116
- // src/generators/vue/scaffoldVue.ts
2117
- import { cpSync as cpSync5, copyFileSync as copyFileSync7 } from "fs";
2118
- import { join as join10 } from "path";
2119
- var scaffoldVue = ({
2120
- targetDirectory,
2121
- templatesDirectory,
2122
- projectAssetsDirectory
2123
- }) => {
2124
- copyFileSync7(join10(templatesDirectory, "assets", "svg", "vue-logo.svg"), join10(projectAssetsDirectory, "svg", "vue-logo.svg"));
2125
- cpSync5(join10(templatesDirectory, "vue"), targetDirectory, {
2126
- recursive: true
2127
- });
2128
- };
2129
-
2130
- // src/generators/project/scaffoldFrontends.ts
2131
- var scaffoldFrontends = ({
2132
- frontendDirectory,
2133
- templatesDirectory,
2134
- projectAssetsDirectory,
2135
- useHTMLScripts,
2136
- frontendDirectories
2137
- }) => {
2138
- const stylesTargetDirectory = join11(frontendDirectory, "styles");
2139
- cpSync6(join11(templatesDirectory, "styles"), stylesTargetDirectory, {
2140
- recursive: true
2141
- });
2142
- const frontendEntries = Object.entries(frontendDirectories);
2143
- const isSingleFrontend = frontendEntries.length === 1;
2144
- const directoryMap = new Map;
2145
- for (const [frontendName, rawDirectory] of frontendEntries) {
2146
- const directory = rawDirectory?.trim() ?? (isSingleFrontend ? "" : frontendName);
2147
- if (directoryMap.has(directory)) {
2148
- throw new Error(`Frontend directory collision: "${directory}" is assigned to both "${directoryMap.get(directory)}" and "${frontendName}". Please pick unique directories.`);
2149
- }
2150
- directoryMap.set(directory, frontendName);
2151
- const targetDirectory = join11(frontendDirectory, directory);
2152
- if (!isSingleFrontend)
2153
- mkdirSync7(targetDirectory);
2154
- switch (frontendName) {
2155
- case "react":
2156
- scaffoldReact({
2157
- isSingleFrontend,
2158
- projectAssetsDirectory,
2159
- targetDirectory,
2160
- templatesDirectory
2161
- });
2162
- break;
2163
- case "svelte":
2164
- scaffoldSvelte({
2165
- isSingleFrontend,
2166
- projectAssetsDirectory,
2167
- targetDirectory,
2168
- templatesDirectory
2169
- });
2170
- break;
2171
- case "vue":
2172
- scaffoldVue({
2173
- projectAssetsDirectory,
2174
- targetDirectory,
2175
- templatesDirectory
2176
- });
2177
- break;
2178
- case "angular":
2179
- console.warn("Angular is not yet supported. Refer to the documentation for more information.");
2180
- break;
2181
- case "html":
2182
- scaffoldHTML({
2183
- isSingleFrontend,
2184
- projectAssetsDirectory,
2185
- targetDirectory,
2186
- templatesDirectory,
2187
- useHTMLScripts
2188
- });
2189
- break;
2190
- case "htmx":
2191
- scaffoldHTMX({
2192
- isSingleFrontend,
2193
- projectAssetsDirectory,
2194
- targetDirectory,
2195
- templatesDirectory
2196
- });
2197
- break;
2198
- }
2199
- }
2200
- };
2201
-
2202
- // src/scaffold.ts
2203
- var scaffold = ({
2204
- response: {
2205
- projectName,
2206
- codeQualityTool,
2207
- initializeGitNow,
2208
- databaseEngine,
2209
- useHTMLScripts,
2210
- useTailwind,
2211
- databaseDirectory,
2212
- orm,
2213
- frontends,
2214
- plugins,
2215
- authProvider,
2216
- buildDirectory,
2217
- assetsDirectory,
2218
- tailwind,
2219
- installDependenciesNow,
2220
- frontendDirectories
2221
- },
2222
- latest,
2223
- packageManager
2224
- }) => {
2225
- const __dirname2 = dirname(fileURLToPath(import.meta.url));
2226
- const templatesDirectory = join12(__dirname2, "/templates");
2227
- const { frontendDirectory, backendDirectory, projectAssetsDirectory } = initalizeRoot(projectName, templatesDirectory);
2228
- copyFileSync8(join12(templatesDirectory, "README.md"), join12(projectName, "README.md"));
2229
- addConfigurationFiles({
2230
- codeQualityTool,
2231
- frontends,
2232
- initializeGitNow,
2233
- projectName,
2234
- tailwind,
2235
- templatesDirectory
2236
- });
2237
- createPackageJson({
2238
- authProvider,
2239
- codeQualityTool,
2240
- frontendDirectories,
2241
- latest,
2242
- plugins,
2243
- projectName,
2244
- useTailwind
2245
- });
2246
- const serverFilePath = join12(backendDirectory, "server.ts");
2247
- createServerFile({
2248
- assetsDirectory,
2249
- authProvider,
2250
- availablePlugins,
2251
- buildDirectory,
2252
- frontendDirectories,
2253
- plugins,
2254
- serverFilePath,
2255
- tailwind
2256
- });
2257
- databaseDirectory !== undefined && scaffoldDatabase({
2258
- databaseDirectory,
2259
- databaseEngine,
2260
- orm,
2261
- projectName
2262
- });
2263
- scaffoldFrontends({
2264
- frontendDirectories,
2265
- frontendDirectory,
2266
- projectAssetsDirectory,
2267
- templatesDirectory,
2268
- useHTMLScripts
2269
- });
2270
- if (installDependenciesNow) {
2271
- installDependencies({ packageManager, projectName });
2272
- }
2273
- formatProject({
2274
- packageManager,
2275
- projectName
2276
- });
2277
- };
2278
-
2279
- // src/utils/parseCommandLineOptions.ts
2280
- import { argv, exit as exit4 } from "node:process";
2281
- import { parseArgs } from "node:util";
2282
- var parseCommandLineOptions = () => {
2283
- const { values, positionals } = parseArgs({
2284
- allowNegative: true,
2285
- allowPositionals: true,
2286
- args: argv.slice(DEFAULT_ARG_LENGTH),
2287
- options: {
2288
- angular: { type: "string" },
2289
- assets: { type: "string" },
2290
- auth: { type: "string" },
2291
- build: { type: "string" },
2292
- database: { type: "string" },
2293
- debug: { default: false, short: "d", type: "boolean" },
2294
- directory: { type: "string" },
2295
- engine: { type: "string" },
2296
- frontend: { multiple: true, type: "string" },
2297
- git: { type: "boolean" },
2298
- help: { default: false, short: "h", type: "boolean" },
2299
- host: { type: "string" },
2300
- html: { type: "string" },
2301
- "html-script": { type: "boolean" },
2302
- htmx: { type: "string" },
2303
- lts: { default: false, type: "boolean" },
2304
- npm: { type: "boolean" },
2305
- orm: { type: "string" },
2306
- plugin: { multiple: true, type: "string" },
2307
- quality: { type: "string" },
2308
- react: { type: "string" },
2309
- skip: { type: "boolean" },
2310
- svelte: { type: "string" },
2311
- tailwind: { type: "boolean" },
2312
- "tailwind-input": { type: "string" },
2313
- "tailwind-output": { type: "string" },
2314
- vue: { type: "string" }
2315
- }
2316
- });
2317
- const errors = [];
2318
- const projectName = positionals[0] ?? values.skip ? "absolutejs-project" : undefined;
2319
- let authProvider;
2320
- if (values.auth !== undefined && !isAuthProvider(values.auth)) {
2321
- errors.push(`Invalid auth provider: "${values.auth}". Expected: [ ${availableAuthProviders.join(", ")} ]`);
2322
- } else if (values.auth !== undefined) {
2323
- authProvider = values.auth;
2324
- } else if (values.skip) {
2325
- authProvider = "none";
2326
- }
2327
- let databaseEngine;
2328
- if (values.engine !== undefined && !isDatabaseEngine(values.engine)) {
2329
- errors.push(`Invalid database engine: "${values.engine}". Expected: [ ${availableDatabaseEngines.join(", ")} ]`);
2330
- } else if (values.engine !== undefined) {
2331
- databaseEngine = values.engine;
2332
- } else if (values.skip) {
2333
- databaseEngine = "none";
2334
- }
2335
- let databaseHost;
2336
- if (values.host !== undefined && !isDatabaseHost(values.host)) {
2337
- errors.push(`Invalid database host: "${values.host}". Expected: [ ${availableDatabaseHosts.join(", ")} ]`);
2338
- } else if (values.host !== undefined) {
2339
- databaseHost = values.host;
2340
- } else if (values.skip) {
2341
- databaseHost = "none";
2342
- }
2343
- const { orm: ormValue } = values;
2344
- let orm;
2345
- if (ormValue !== undefined && !isORM(ormValue)) {
2346
- errors.push(`Invalid ORM: "${values.orm}". Expected: [ ${availableORMs.join(", ")} ]`);
2347
- } else if (ormValue !== undefined) {
2348
- orm = ormValue;
2349
- } else if (values.skip) {
2350
- orm = "none";
2351
- }
2352
- const codeQualityTool = isCodeQualityTool(values.quality) ? values.quality : undefined;
2353
- if (values.quality !== undefined && codeQualityTool === undefined) {
2354
- errors.push(`Invalid code quality tool: "${values.quality}". Expected: [ ${availableCodeQualityTools.join(", ")} ]`);
2355
- }
2356
- const directoryConfig = values.directory !== undefined && isDirectoryConfig(values.directory) ? values.directory : undefined;
2357
- if (values.directory !== undefined && directoryConfig === undefined) {
2358
- errors.push(`Invalid directory configuration: "${values.directory}". Expected: [ ${availableDirectoryConfigurations.join(", ")} ]`);
2359
- }
2360
- for (const f of values.frontend || []) {
2361
- if (isFrontend(f))
2362
- continue;
2363
- errors.push(`Invalid frontend: "${f}". Expected: [ ${availableFrontends.join(", ")} ]`);
2364
- }
2365
- if (errors.length > 0) {
2366
- console.error(errors.join(`
2367
- `));
2368
- exit4(1);
2369
- }
2370
- if (databaseEngine === "none" && databaseHost !== "none") {
2371
- console.warn("Warning: Setting the database host without a database engine has no effect.");
2372
- }
2373
- if (databaseEngine === "none" && orm !== "none") {
2374
- console.warn("Warning: Setting an ORM without a database engine has no effect.");
2375
- }
2376
- let databaseDirectory = values.database;
2377
- if (databaseEngine === "none" && databaseDirectory !== undefined) {
2378
- console.warn("Warning: Setting a database directory without a database engine has no effect.");
2379
- databaseDirectory = undefined;
2380
- }
2381
- const frontendsWithDirectory = availableFrontends.filter((f) => values[f] !== undefined);
2382
- const frontendDirectories = {};
2383
- for (const frontend of frontendsWithDirectory) {
2384
- frontendDirectories[frontend] = values[frontend];
2385
- }
2386
- const originalFrontends = values.frontend;
2387
- const collector = new Set(originalFrontends ?? []);
2388
- for (const frontend of frontendsWithDirectory) {
2389
- collector.add(frontend);
2390
- }
2391
- values.frontend = collector.size > 0 ? Array.from(collector) : undefined;
2392
- if (values.plugin === undefined && values.skip) {
2393
- values.plugin = ["none"];
2394
- }
2395
- const plugins = values.plugin && values.plugin[0] === "none" ? [] : values.plugin;
2396
- const hasTailwindFiles = values["tailwind-input"] !== undefined || values["tailwind-output"] !== undefined;
2397
- let tailwind = hasTailwindFiles ? {
2398
- input: values["tailwind-input"],
2399
- output: values["tailwind-output"]
2400
- } : undefined;
2401
- const useTailwind = values.tailwind ?? (hasTailwindFiles ? true : undefined);
2402
- if (useTailwind === false && hasTailwindFiles) {
2403
- console.warn("Warning: Tailwind CSS input/output files are specified but Tailwind is disabled.");
2404
- tailwind = undefined;
2405
- }
2406
- const argumentConfiguration = {
2407
- assetsDirectory: values.assets,
2408
- authProvider,
2409
- buildDirectory: values.build,
2410
- codeQualityTool,
2411
- databaseDirectory,
2412
- databaseEngine,
2413
- databaseHost,
2414
- directoryConfig,
2415
- frontendDirectories,
2416
- frontends: values.frontend?.filter(isFrontend),
2417
- initializeGitNow: values.git,
2418
- installDependenciesNow: values.npm,
2419
- orm,
2420
- plugins,
2421
- projectName,
2422
- tailwind,
2423
- useHTMLScripts: values["html-script"],
2424
- useTailwind
2425
- };
2426
- return {
2427
- argumentConfiguration,
2428
- debug: values.debug,
2429
- help: values.help,
2430
- latest: values.lts
2431
- };
2432
- };
2433
-
2434
- // src/utils/t3-utils.ts
2435
- import { env } from "node:process";
2436
- var getUserPackageManager = () => {
2437
- const userAgent = env.npm_config_user_agent;
2438
- if (userAgent) {
2439
- if (userAgent.startsWith("yarn")) {
2440
- return "yarn";
2441
- } else if (userAgent.startsWith("pnpm")) {
2442
- return "pnpm";
2443
- } else if (userAgent.startsWith("bun")) {
2444
- return "bun";
2445
- }
2446
- return "npm";
2447
- }
2448
- return "npm";
2449
- };
2450
-
2451
- // src/index.ts
2452
- var packageManager = getUserPackageManager();
2453
- var { help, argumentConfiguration, latest, debug } = parseCommandLineOptions();
2
+ import { exit } from 'node:process';
3
+ import { outro } from '@clack/prompts';
4
+ import { getDebugMessage, getOutroMessage, helpMessage } from './messages';
5
+ import { prompt } from './prompt';
6
+ import { scaffold } from './scaffold';
7
+ import { parseCommandLineOptions } from './utils/parseCommandLineOptions';
8
+ import { getUserPackageManager } from './utils/t3-utils';
9
+ const packageManager = getUserPackageManager();
10
+ const { help, argumentConfiguration, latest, debug } = parseCommandLineOptions();
2454
11
  if (help === true) {
2455
- console.log(helpMessage);
2456
- exit5(0);
12
+ console.log(helpMessage);
13
+ exit(0);
2457
14
  }
2458
- var response = await prompt(argumentConfiguration);
15
+ const response = await prompt(argumentConfiguration);
2459
16
  scaffold({ latest, packageManager, response });
2460
- var debugMessage = debug !== false ? getDebugMessage({
2461
- packageManager,
2462
- response
2463
- }) : "";
2464
- var outroMessage = getOutroMessage({
2465
- installDependenciesNow: response.installDependenciesNow,
2466
- packageManager,
2467
- projectName: response.projectName
17
+ const debugMessage = debug !== false
18
+ ? getDebugMessage({
19
+ packageManager,
20
+ response
21
+ })
22
+ : '';
23
+ const outroMessage = getOutroMessage({
24
+ installDependenciesNow: response.installDependenciesNow,
25
+ packageManager,
26
+ projectName: response.projectName
2468
27
  });
2469
- Se(outroMessage + debugMessage);
28
+ outro(outroMessage + debugMessage);