create-absolutejs 0.2.0 → 0.2.1

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 (3) hide show
  1. package/README.md +125 -5
  2. package/dist/index.js +269 -235
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,15 +1,135 @@
1
1
  # create-absolutejs
2
2
 
3
- To install dependencies:
3
+ A CLI tool to scaffold new AbsoluteJS projects quickly and effortlessly.
4
+
5
+ ## Usage
6
+
7
+ Scaffold a new project called `<project-name>`:
4
8
 
5
9
  ```bash
6
- bun install
10
+ bun create absolutejs my-app
11
+ ```
12
+
13
+ Alternatively, using npm, Yarn, or pnpm:
14
+
15
+ ```bash
16
+ npm create absolutejs my-app
17
+ yarn create absolutejs my-app
18
+ pnpm create absolutejs my-app
19
+ ```
20
+
21
+ By default, the CLI will interactively prompt you for any missing configuration values. You can also supply flags to skip those prompts:
22
+
23
+ - To skip **all** optional prompts and use `none` for every optional configuration:
24
+ ```bash
25
+ bun create absolutejs my-app --skip
26
+ ```
27
+ - To skip **one** optional prompt without providing a real value, pass `none` to that flag:
28
+ ```bash
29
+ bun create absolutejs my-app --auth none --engine none
30
+ ```
31
+
32
+ ## Options
33
+
34
+ ```text
35
+ Usage: create-absolute [options] [project-name]
36
+ ```
37
+
38
+ ### Arguments
39
+
40
+ - `project-name`
41
+ Name of the application to create. If omitted, you'll be prompted to enter one.
42
+
43
+ ### Options
44
+
45
+ - `--help`, `-h`
46
+ Show the help message and exit.
47
+ - `--debug`, `-d`
48
+ Display a summary of the project configuration after creation.
49
+ - `--angular <name>`
50
+ Directory name for an Angular frontend.
51
+ - `--assets <name>`
52
+ Directory name for your static assets.
53
+ - `--auth <provider|none>`
54
+ Preconfigured auth plugin or `none` to skip auth setup.
55
+ - `--build <dir>`
56
+ Output directory for build artifacts.
57
+ - `--database <name>`
58
+ Directory name for your database files.
59
+ - `--directory <default|custom>`
60
+ Directory-naming strategy: `default` or `custom`.
61
+ - `--engine <engine|none>`
62
+ Database engine (`postgresql` | `mysql` | `sqlite` | `mongodb` | `redis` | `singlestore` | `cockroachdb` | `mssql`) or `none`.
63
+ - `--frontend <framework>`
64
+ Frontend framework(s) to include: one or more of `react`, `svelte`, `html`, `htmx`, `vue`, `angular`.
65
+ - `--git`
66
+ Initialize a Git repository.
67
+ - `--host <provider|none>`
68
+ Database host provider (`neon` | `planetscale` | `supabase` | `turso` | `vercel` | `upstash` | `atlas`) or `none`.
69
+ - `--html <name>`
70
+ Directory name for an HTML frontend.
71
+ - `--htmx <name>`
72
+ Directory name for an HTMX frontend.
73
+ - `--lang <ts|js>`
74
+ Language: `ts` or `js`.
75
+ - `--lts`
76
+ Use the latest published versions of required packages.
77
+ - `--npm`
78
+ Use the package manager that invoked this command to install dependencies.
79
+ - `--orm <drizzle|prisma|none>`
80
+ ORM to configure: `drizzle`, `prisma`, or `none`.
81
+ - `--plugin <plugin>`
82
+ Elysia plugin(s) to include (can be specified multiple times), or `none` to skip plugins.
83
+ - `--quality <eslint+prettier|biome>`
84
+ Code quality tool: `eslint+prettier` or `biome`.
85
+ - `--react <name>`
86
+ Directory name for a React frontend.
87
+ - `--script <ts|js|none>`
88
+ HTML scripting option: `ts`, `js`, or `none`.
89
+ - `--skip`
90
+ Skip **all** non-required prompts and use `none` for every optional configuration.
91
+ - `--svelte <name>`
92
+ Directory name for a Svelte frontend.
93
+ - `--tailwind`
94
+ Include Tailwind CSS setup.
95
+ - `--tailwind-input <path>`
96
+ Path to your Tailwind CSS entry file.
97
+ - `--tailwind-output <path>`
98
+ Path for the generated Tailwind CSS bundle.
99
+ - `--vue <name>`
100
+ Directory name for a Vue frontend.
101
+
102
+ ## Directory Configuration
103
+
104
+ Choose between the **default** layout (pre-configured folder names) or **custom**, which prompts you to specify each directory name yourself:
105
+
106
+ ```bash
107
+ bun create absolutejs my-app --directory custom
7
108
  ```
8
109
 
9
- To run:
110
+ ## Debug & LTS Flags
111
+
112
+ - `--debug`, `-d`
113
+ After scaffolding, prints a detailed summary of your configuration (language, frontends, directories, etc.).
114
+ - `--lts`
115
+ Instructs the CLI to fetch and pin the latest published versions of your dependencies instead of its default pinned versions.
116
+
117
+ ## Getting Started
118
+
119
+ Once the scaffold completes, you’re ready to go:
10
120
 
11
121
  ```bash
12
- bun run index.ts
122
+ cd my-app
123
+ # (If you skipped automated install)
124
+ bun install
125
+ # Then start the dev server
126
+ bun run dev
13
127
  ```
14
128
 
15
- This project was created using `bun init` in bun v1.2.13. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
129
+ ## Contributing
130
+
131
+ Contributions are welcome! Feel free to open issues or submit pull requests to improve the CLI.
132
+
133
+ ## License
134
+
135
+ Licensed under CC BY-NC 4.0.
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
1
3
  var __create = Object.create;
2
4
  var __getProtoOf = Object.getPrototypeOf;
3
5
  var __defProp = Object.defineProperty;
@@ -145,7 +147,7 @@ var require_picocolors = __commonJS((exports, module) => {
145
147
  });
146
148
 
147
149
  // src/index.ts
148
- import { exit as exit5 } from "node:process";
150
+ import { exit as exit5 } from "process";
149
151
 
150
152
  // node_modules/@clack/core/dist/index.mjs
151
153
  var import_sisteransi = __toESM(require_src(), 1);
@@ -635,147 +637,6 @@ var q = u("●", "•");
635
637
  var D = u("◆", "*");
636
638
  var U = u("▲", "!");
637
639
  var K2 = u("■", "x");
638
- var b2 = (t) => {
639
- switch (t) {
640
- case "initial":
641
- case "active":
642
- return import_picocolors2.default.cyan(le);
643
- case "cancel":
644
- return import_picocolors2.default.red(L2);
645
- case "error":
646
- return import_picocolors2.default.yellow(W2);
647
- case "submit":
648
- return import_picocolors2.default.green(C2);
649
- }
650
- };
651
- var G2 = (t) => {
652
- const { cursor: n, options: r, 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));
653
- let l2 = 0;
654
- n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
655
- const $2 = a < r.length && l2 > 0, g2 = a < r.length && l2 + a < r.length;
656
- return r.slice(l2, l2 + a).map((p2, v2, f) => {
657
- const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
658
- return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
659
- });
660
- };
661
- var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
662
- const n = `${import_picocolors2.default.gray(o)}
663
- ${b2(this.state)} ${t.message}
664
- `, r = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r;
665
- switch (this.state) {
666
- case "error":
667
- return `${n.trim()}
668
- ${import_picocolors2.default.yellow(o)} ${i}
669
- ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
670
- `;
671
- case "submit":
672
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
673
- case "cancel":
674
- return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
675
- ${import_picocolors2.default.gray(o)}` : ""}`;
676
- default:
677
- return `${n}${import_picocolors2.default.cyan(o)} ${i}
678
- ${import_picocolors2.default.cyan(d2)}
679
- `;
680
- }
681
- } }).prompt();
682
- var ye = (t) => {
683
- const n = t.active ?? "Yes", r = t.inactive ?? "No";
684
- return new dD({ active: n, inactive: r, initialValue: t.initialValue ?? true, render() {
685
- const i = `${import_picocolors2.default.gray(o)}
686
- ${b2(this.state)} ${t.message}
687
- `, s = this.value ? n : r;
688
- switch (this.state) {
689
- case "submit":
690
- return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
691
- case "cancel":
692
- return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
693
- ${import_picocolors2.default.gray(o)}`;
694
- default:
695
- return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r)}` : `${import_picocolors2.default.green(k2)} ${r}`}
696
- ${import_picocolors2.default.cyan(d2)}
697
- `;
698
- }
699
- } }).prompt();
700
- };
701
- var ve = (t) => {
702
- const n = (r, i) => {
703
- const s = r.label ?? String(r.value);
704
- switch (i) {
705
- case "selected":
706
- return `${import_picocolors2.default.dim(s)}`;
707
- case "active":
708
- return `${import_picocolors2.default.green(k2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
709
- case "cancelled":
710
- return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
711
- default:
712
- return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}`;
713
- }
714
- };
715
- return new LD({ options: t.options, initialValue: t.initialValue, render() {
716
- const r = `${import_picocolors2.default.gray(o)}
717
- ${b2(this.state)} ${t.message}
718
- `;
719
- switch (this.state) {
720
- case "submit":
721
- return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
722
- case "cancel":
723
- return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
724
- ${import_picocolors2.default.gray(o)}`;
725
- default:
726
- return `${r}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
727
- ${import_picocolors2.default.cyan(o)} `)}
728
- ${import_picocolors2.default.cyan(d2)}
729
- `;
730
- }
731
- } }).prompt();
732
- };
733
- var fe = (t) => {
734
- const n = (r, i) => {
735
- const s = r.label ?? String(r.value);
736
- return i === "active" ? `${import_picocolors2.default.cyan(A2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(T)} ${import_picocolors2.default.dim(s)} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active-selected" ? `${import_picocolors2.default.green(T)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.dim(F)} ${import_picocolors2.default.dim(s)}`;
737
- };
738
- return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r) {
739
- if (this.required && r.length === 0)
740
- return `Please select at least one option.
741
- ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
742
- }, render() {
743
- const r = `${import_picocolors2.default.gray(o)}
744
- ${b2(this.state)} ${t.message}
745
- `, i = (s, c) => {
746
- const a = this.value.includes(s.value);
747
- return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
748
- };
749
- switch (this.state) {
750
- case "submit":
751
- return `${r}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
752
- case "cancel": {
753
- const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors2.default.dim(", "));
754
- return `${r}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
755
- ${import_picocolors2.default.gray(o)}` : ""}`;
756
- }
757
- case "error": {
758
- const s = this.error.split(`
759
- `).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
760
- `);
761
- return `${r + import_picocolors2.default.yellow(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
762
- ${import_picocolors2.default.yellow(o)} `)}
763
- ${s}
764
- `;
765
- }
766
- default:
767
- return `${r}${import_picocolors2.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
768
- ${import_picocolors2.default.cyan(o)} `)}
769
- ${import_picocolors2.default.cyan(d2)}
770
- `;
771
- }
772
- } }).prompt();
773
- };
774
- var xe = (t = "") => {
775
- process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(t)}
776
-
777
- `);
778
- };
779
640
  var Se = (t = "") => {
780
641
  process.stdout.write(`${import_picocolors2.default.gray(o)}
781
642
  ${import_picocolors2.default.gray(d2)} ${t}
@@ -783,57 +644,6 @@ ${import_picocolors2.default.gray(d2)} ${t}
783
644
  `);
784
645
  };
785
646
  var J2 = `${import_picocolors2.default.gray(o)} `;
786
- var Y2 = ({ indicator: t = "dots" } = {}) => {
787
- const n = V2 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"], r = V2 ? 80 : 120, i = process.env.CI === "true";
788
- let s, c, a = false, l2 = "", $2, g2 = performance.now();
789
- const p2 = (m2) => {
790
- const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
791
- a && N2(h2, m2);
792
- }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
793
- process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
794
- }, E = () => {
795
- process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
796
- }, B2 = () => {
797
- if ($2 === undefined)
798
- return;
799
- i && process.stdout.write(`
800
- `);
801
- const m2 = $2.split(`
802
- `);
803
- process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
804
- }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
805
- const h2 = (performance.now() - m2) / 1000, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
806
- return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
807
- }, H2 = (m2 = "") => {
808
- a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
809
- `);
810
- let h2 = 0, w2 = 0;
811
- j2(), c = setInterval(() => {
812
- if (i && l2 === $2)
813
- return;
814
- B2(), $2 = l2;
815
- const I2 = import_picocolors2.default.magenta(n[h2]);
816
- if (i)
817
- process.stdout.write(`${I2} ${l2}...`);
818
- else if (t === "timer")
819
- process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
820
- else {
821
- const z2 = ".".repeat(Math.floor(w2)).slice(0, 3);
822
- process.stdout.write(`${I2} ${l2}${z2}`);
823
- }
824
- h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
825
- }, r);
826
- }, N2 = (m2 = "", h2 = 0) => {
827
- a = false, clearInterval(c), B2();
828
- const w2 = h2 === 0 ? import_picocolors2.default.green(C2) : h2 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
829
- l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
830
- `) : process.stdout.write(`${w2} ${l2}
831
- `), E(), s();
832
- };
833
- return { start: H2, stop: N2, message: (m2 = "") => {
834
- l2 = R2(m2 ?? l2);
835
- } };
836
- };
837
647
 
838
648
  // src/messages.ts
839
649
  var import_picocolors4 = __toESM(require_picocolors(), 1);
@@ -1064,8 +874,232 @@ ${lines.map(([label, value]) => {
1064
874
  return body;
1065
875
  };
1066
876
 
1067
- // src/questions/authProvider.ts
877
+ // node_modules/@clack/prompts/dist/index.mjs
1068
878
  var import_picocolors5 = __toESM(require_picocolors(), 1);
879
+ var import_sisteransi3 = __toESM(require_src(), 1);
880
+ import y3 from "node:process";
881
+ function ce2() {
882
+ 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";
883
+ }
884
+ var V3 = ce2();
885
+ var u2 = (t, n) => V3 ? t : n;
886
+ var le2 = u2("◆", "*");
887
+ var L3 = u2("■", "x");
888
+ var W3 = u2("▲", "x");
889
+ var C3 = u2("◇", "o");
890
+ var ue2 = u2("┌", "T");
891
+ var o2 = u2("│", "|");
892
+ var d3 = u2("└", "—");
893
+ var k3 = u2("●", ">");
894
+ var P3 = u2("○", " ");
895
+ var A3 = u2("◻", "[•]");
896
+ var T2 = u2("◼", "[+]");
897
+ var F2 = u2("◻", "[ ]");
898
+ var $e2 = u2("▪", "•");
899
+ var _3 = u2("─", "-");
900
+ var me2 = u2("╮", "+");
901
+ var de2 = u2("├", "+");
902
+ var pe2 = u2("╯", "+");
903
+ var q2 = u2("●", "•");
904
+ var D2 = u2("◆", "*");
905
+ var U2 = u2("▲", "!");
906
+ var K3 = u2("■", "x");
907
+ var b2 = (t) => {
908
+ switch (t) {
909
+ case "initial":
910
+ case "active":
911
+ return import_picocolors5.default.cyan(le2);
912
+ case "cancel":
913
+ return import_picocolors5.default.red(L3);
914
+ case "error":
915
+ return import_picocolors5.default.yellow(W3);
916
+ case "submit":
917
+ return import_picocolors5.default.green(C3);
918
+ }
919
+ };
920
+ var G2 = (t) => {
921
+ const { cursor: n, options: r, 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));
922
+ let l2 = 0;
923
+ n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
924
+ const $2 = a < r.length && l2 > 0, g2 = a < r.length && l2 + a < r.length;
925
+ return r.slice(l2, l2 + a).map((p2, v2, f) => {
926
+ const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
927
+ return j2 || E ? import_picocolors5.default.dim("...") : i(p2, v2 + l2 === n);
928
+ });
929
+ };
930
+ var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
931
+ const n = `${import_picocolors5.default.gray(o2)}
932
+ ${b2(this.state)} ${t.message}
933
+ `, r = 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 : r;
934
+ switch (this.state) {
935
+ case "error":
936
+ return `${n.trim()}
937
+ ${import_picocolors5.default.yellow(o2)} ${i}
938
+ ${import_picocolors5.default.yellow(d3)} ${import_picocolors5.default.yellow(this.error)}
939
+ `;
940
+ case "submit":
941
+ return `${n}${import_picocolors5.default.gray(o2)} ${import_picocolors5.default.dim(this.value || t.placeholder)}`;
942
+ case "cancel":
943
+ return `${n}${import_picocolors5.default.gray(o2)} ${import_picocolors5.default.strikethrough(import_picocolors5.default.dim(this.value ?? ""))}${this.value?.trim() ? `
944
+ ${import_picocolors5.default.gray(o2)}` : ""}`;
945
+ default:
946
+ return `${n}${import_picocolors5.default.cyan(o2)} ${i}
947
+ ${import_picocolors5.default.cyan(d3)}
948
+ `;
949
+ }
950
+ } }).prompt();
951
+ var ye = (t) => {
952
+ const n = t.active ?? "Yes", r = t.inactive ?? "No";
953
+ return new dD({ active: n, inactive: r, initialValue: t.initialValue ?? true, render() {
954
+ const i = `${import_picocolors5.default.gray(o2)}
955
+ ${b2(this.state)} ${t.message}
956
+ `, s = this.value ? n : r;
957
+ switch (this.state) {
958
+ case "submit":
959
+ return `${i}${import_picocolors5.default.gray(o2)} ${import_picocolors5.default.dim(s)}`;
960
+ case "cancel":
961
+ return `${i}${import_picocolors5.default.gray(o2)} ${import_picocolors5.default.strikethrough(import_picocolors5.default.dim(s))}
962
+ ${import_picocolors5.default.gray(o2)}`;
963
+ default:
964
+ 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(r)}` : `${import_picocolors5.default.green(k3)} ${r}`}
965
+ ${import_picocolors5.default.cyan(d3)}
966
+ `;
967
+ }
968
+ } }).prompt();
969
+ };
970
+ var ve = (t) => {
971
+ const n = (r, i) => {
972
+ const s = r.label ?? String(r.value);
973
+ switch (i) {
974
+ case "selected":
975
+ return `${import_picocolors5.default.dim(s)}`;
976
+ case "active":
977
+ return `${import_picocolors5.default.green(k3)} ${s} ${r.hint ? import_picocolors5.default.dim(`(${r.hint})`) : ""}`;
978
+ case "cancelled":
979
+ return `${import_picocolors5.default.strikethrough(import_picocolors5.default.dim(s))}`;
980
+ default:
981
+ return `${import_picocolors5.default.dim(P3)} ${import_picocolors5.default.dim(s)}`;
982
+ }
983
+ };
984
+ return new LD({ options: t.options, initialValue: t.initialValue, render() {
985
+ const r = `${import_picocolors5.default.gray(o2)}
986
+ ${b2(this.state)} ${t.message}
987
+ `;
988
+ switch (this.state) {
989
+ case "submit":
990
+ return `${r}${import_picocolors5.default.gray(o2)} ${n(this.options[this.cursor], "selected")}`;
991
+ case "cancel":
992
+ return `${r}${import_picocolors5.default.gray(o2)} ${n(this.options[this.cursor], "cancelled")}
993
+ ${import_picocolors5.default.gray(o2)}`;
994
+ default:
995
+ return `${r}${import_picocolors5.default.cyan(o2)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
996
+ ${import_picocolors5.default.cyan(o2)} `)}
997
+ ${import_picocolors5.default.cyan(d3)}
998
+ `;
999
+ }
1000
+ } }).prompt();
1001
+ };
1002
+ var fe = (t) => {
1003
+ const n = (r, i) => {
1004
+ const s = r.label ?? String(r.value);
1005
+ return i === "active" ? `${import_picocolors5.default.cyan(A3)} ${s} ${r.hint ? import_picocolors5.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors5.default.green(T2)} ${import_picocolors5.default.dim(s)} ${r.hint ? import_picocolors5.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors5.default.strikethrough(import_picocolors5.default.dim(s))}` : i === "active-selected" ? `${import_picocolors5.default.green(T2)} ${s} ${r.hint ? import_picocolors5.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors5.default.dim(s)}` : `${import_picocolors5.default.dim(F2)} ${import_picocolors5.default.dim(s)}`;
1006
+ };
1007
+ return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r) {
1008
+ if (this.required && r.length === 0)
1009
+ return `Please select at least one option.
1010
+ ${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`))}`;
1011
+ }, render() {
1012
+ const r = `${import_picocolors5.default.gray(o2)}
1013
+ ${b2(this.state)} ${t.message}
1014
+ `, i = (s, c) => {
1015
+ const a = this.value.includes(s.value);
1016
+ return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
1017
+ };
1018
+ switch (this.state) {
1019
+ case "submit":
1020
+ return `${r}${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")}`;
1021
+ case "cancel": {
1022
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors5.default.dim(", "));
1023
+ return `${r}${import_picocolors5.default.gray(o2)} ${s.trim() ? `${s}
1024
+ ${import_picocolors5.default.gray(o2)}` : ""}`;
1025
+ }
1026
+ case "error": {
1027
+ const s = this.error.split(`
1028
+ `).map((c, a) => a === 0 ? `${import_picocolors5.default.yellow(d3)} ${import_picocolors5.default.yellow(c)}` : ` ${c}`).join(`
1029
+ `);
1030
+ return `${r + import_picocolors5.default.yellow(o2)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
1031
+ ${import_picocolors5.default.yellow(o2)} `)}
1032
+ ${s}
1033
+ `;
1034
+ }
1035
+ default:
1036
+ return `${r}${import_picocolors5.default.cyan(o2)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
1037
+ ${import_picocolors5.default.cyan(o2)} `)}
1038
+ ${import_picocolors5.default.cyan(d3)}
1039
+ `;
1040
+ }
1041
+ } }).prompt();
1042
+ };
1043
+ var xe = (t = "") => {
1044
+ process.stdout.write(`${import_picocolors5.default.gray(d3)} ${import_picocolors5.default.red(t)}
1045
+
1046
+ `);
1047
+ };
1048
+ var J3 = `${import_picocolors5.default.gray(o2)} `;
1049
+ var Y2 = ({ indicator: t = "dots" } = {}) => {
1050
+ const n = V3 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"], r = V3 ? 80 : 120, i = process.env.CI === "true";
1051
+ let s, c, a = false, l2 = "", $2, g2 = performance.now();
1052
+ const p2 = (m2) => {
1053
+ const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
1054
+ a && N2(h2, m2);
1055
+ }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
1056
+ process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
1057
+ }, E = () => {
1058
+ process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
1059
+ }, B2 = () => {
1060
+ if ($2 === undefined)
1061
+ return;
1062
+ i && process.stdout.write(`
1063
+ `);
1064
+ const m2 = $2.split(`
1065
+ `);
1066
+ process.stdout.write(import_sisteransi3.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi3.erase.down(m2.length));
1067
+ }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
1068
+ const h2 = (performance.now() - m2) / 1000, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
1069
+ return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
1070
+ }, H2 = (m2 = "") => {
1071
+ a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors5.default.gray(o2)}
1072
+ `);
1073
+ let h2 = 0, w2 = 0;
1074
+ j2(), c = setInterval(() => {
1075
+ if (i && l2 === $2)
1076
+ return;
1077
+ B2(), $2 = l2;
1078
+ const I2 = import_picocolors5.default.magenta(n[h2]);
1079
+ if (i)
1080
+ process.stdout.write(`${I2} ${l2}...`);
1081
+ else if (t === "timer")
1082
+ process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
1083
+ else {
1084
+ const z2 = ".".repeat(Math.floor(w2)).slice(0, 3);
1085
+ process.stdout.write(`${I2} ${l2}${z2}`);
1086
+ }
1087
+ h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
1088
+ }, r);
1089
+ }, N2 = (m2 = "", h2 = 0) => {
1090
+ a = false, clearInterval(c), B2();
1091
+ const w2 = h2 === 0 ? import_picocolors5.default.green(C3) : h2 === 1 ? import_picocolors5.default.red(L3) : import_picocolors5.default.red(W3);
1092
+ l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
1093
+ `) : process.stdout.write(`${w2} ${l2}
1094
+ `), E(), s();
1095
+ };
1096
+ return { start: H2, stop: N2, message: (m2 = "") => {
1097
+ l2 = R2(m2 ?? l2);
1098
+ } };
1099
+ };
1100
+
1101
+ // src/questions/authProvider.ts
1102
+ var import_picocolors6 = __toESM(require_picocolors(), 1);
1069
1103
 
1070
1104
  // src/utils/abort.ts
1071
1105
  import { exit } from "node:process";
@@ -1080,7 +1114,7 @@ var getAuthProvider = async () => {
1080
1114
  message: "Auth provider:",
1081
1115
  options: [
1082
1116
  { label: "None", value: "none" },
1083
- { label: import_picocolors5.cyan("Absolute Auth"), value: "absoluteAuth" }
1117
+ { label: import_picocolors6.cyan("Absolute Auth"), value: "absoluteAuth" }
1084
1118
  ]
1085
1119
  });
1086
1120
  if (pD(authProvider))
@@ -1089,16 +1123,16 @@ var getAuthProvider = async () => {
1089
1123
  };
1090
1124
 
1091
1125
  // src/questions/codeQualityTool.ts
1092
- var import_picocolors6 = __toESM(require_picocolors(), 1);
1126
+ var import_picocolors7 = __toESM(require_picocolors(), 1);
1093
1127
  var getCodeQualityTool = async () => {
1094
1128
  const codeQualityTool = await ve({
1095
1129
  message: "Choose linting and formatting tool:",
1096
1130
  options: [
1097
1131
  {
1098
- label: import_picocolors6.blueBright("ESLint + Prettier"),
1132
+ label: import_picocolors7.blueBright("ESLint + Prettier"),
1099
1133
  value: "eslint+prettier"
1100
1134
  },
1101
- { label: import_picocolors6.yellow("Biome"), value: "biome" }
1135
+ { label: import_picocolors7.yellow("Biome"), value: "biome" }
1102
1136
  ]
1103
1137
  });
1104
1138
  if (pD(codeQualityTool))
@@ -1107,13 +1141,13 @@ var getCodeQualityTool = async () => {
1107
1141
  };
1108
1142
 
1109
1143
  // src/questions/configurationType.ts
1110
- var import_picocolors7 = __toESM(require_picocolors(), 1);
1144
+ var import_picocolors8 = __toESM(require_picocolors(), 1);
1111
1145
  var getConfigurationType = async () => {
1112
1146
  const directoryConfig = await ve({
1113
1147
  message: "Choose folder naming configuration:",
1114
1148
  options: [
1115
- { label: import_picocolors7.blueBright("Default"), value: "default" },
1116
- { label: import_picocolors7.yellow("Custom"), value: "custom" }
1149
+ { label: import_picocolors8.blueBright("Default"), value: "default" },
1150
+ { label: import_picocolors8.yellow("Custom"), value: "custom" }
1117
1151
  ]
1118
1152
  });
1119
1153
  if (pD(directoryConfig))
@@ -1122,20 +1156,20 @@ var getConfigurationType = async () => {
1122
1156
  };
1123
1157
 
1124
1158
  // src/questions/databaseEngine.ts
1125
- var import_picocolors8 = __toESM(require_picocolors(), 1);
1159
+ var import_picocolors9 = __toESM(require_picocolors(), 1);
1126
1160
  var getDatabaseEngine = async () => {
1127
1161
  const databaseDialectResponse = await ve({
1128
1162
  message: "Database engine:",
1129
1163
  options: [
1130
1164
  { label: "None", value: "none" },
1131
- { label: import_picocolors8.cyan("PostgreSQL"), value: "postgresql" },
1132
- { label: import_picocolors8.magenta("SQLite"), value: "sqlite" },
1133
- { label: import_picocolors8.green("MySQL"), value: "mysql" },
1134
- { label: import_picocolors8.red("Redis"), value: "redis" },
1135
- { label: import_picocolors8.green("MongoDB"), value: "mongodb" },
1136
- { label: import_picocolors8.magenta("SingleStore"), value: "singlestore" },
1137
- { label: import_picocolors8.yellow("SQL Server"), value: "mssql" },
1138
- { label: import_picocolors8.cyan("CockroachDB"), value: "cockroachdb" }
1165
+ { label: import_picocolors9.cyan("PostgreSQL"), value: "postgresql" },
1166
+ { label: import_picocolors9.magenta("SQLite"), value: "sqlite" },
1167
+ { label: import_picocolors9.green("MySQL"), value: "mysql" },
1168
+ { label: import_picocolors9.red("Redis"), value: "redis" },
1169
+ { label: import_picocolors9.green("MongoDB"), value: "mongodb" },
1170
+ { label: import_picocolors9.magenta("SingleStore"), value: "singlestore" },
1171
+ { label: import_picocolors9.yellow("SQL Server"), value: "mssql" },
1172
+ { label: import_picocolors9.cyan("CockroachDB"), value: "cockroachdb" }
1139
1173
  ]
1140
1174
  });
1141
1175
  if (pD(databaseDialectResponse))
@@ -1144,14 +1178,14 @@ var getDatabaseEngine = async () => {
1144
1178
  };
1145
1179
 
1146
1180
  // src/questions/databaseHost.ts
1147
- var import_picocolors9 = __toESM(require_picocolors(), 1);
1181
+ var import_picocolors10 = __toESM(require_picocolors(), 1);
1148
1182
  var getDatabaseHost = async (databaseEngine) => {
1149
1183
  if (databaseEngine === "postgresql") {
1150
1184
  const databaseHost = await ve({
1151
1185
  message: "Select database host:",
1152
1186
  options: [
1153
- { label: import_picocolors9.cyan("Neon"), value: "neon" },
1154
- { label: import_picocolors9.cyan("Supabase"), value: "supabase" },
1187
+ { label: import_picocolors10.cyan("Neon"), value: "neon" },
1188
+ { label: import_picocolors10.cyan("Supabase"), value: "supabase" },
1155
1189
  { label: "None", value: "none" }
1156
1190
  ]
1157
1191
  });
@@ -1343,13 +1377,13 @@ var getInstallDependencies = async () => {
1343
1377
  };
1344
1378
 
1345
1379
  // src/questions/language.ts
1346
- var import_picocolors10 = __toESM(require_picocolors(), 1);
1380
+ var import_picocolors11 = __toESM(require_picocolors(), 1);
1347
1381
  var getLanguage = async () => {
1348
1382
  const language = await ve({
1349
1383
  message: "Language:",
1350
1384
  options: [
1351
- { label: import_picocolors10.blueBright("TypeScript"), value: "ts" },
1352
- { label: import_picocolors10.yellow("JavaScript"), value: "js" }
1385
+ { label: import_picocolors11.blueBright("TypeScript"), value: "ts" },
1386
+ { label: import_picocolors11.yellow("JavaScript"), value: "js" }
1353
1387
  ]
1354
1388
  });
1355
1389
  if (pD(language))
@@ -1358,14 +1392,14 @@ var getLanguage = async () => {
1358
1392
  };
1359
1393
 
1360
1394
  // src/questions/orm.ts
1361
- var import_picocolors11 = __toESM(require_picocolors(), 1);
1395
+ var import_picocolors12 = __toESM(require_picocolors(), 1);
1362
1396
  var getORM = async () => {
1363
1397
  const orm = await ve({
1364
1398
  message: "Choose an ORM (optional):",
1365
1399
  options: [
1366
1400
  { label: "None", value: "none" },
1367
- { label: import_picocolors11.cyan("Drizzle"), value: "drizzle" },
1368
- { label: import_picocolors11.magenta("Prisma"), value: "prisma" }
1401
+ { label: import_picocolors12.cyan("Drizzle"), value: "drizzle" },
1402
+ { label: import_picocolors12.magenta("Prisma"), value: "prisma" }
1369
1403
  ]
1370
1404
  });
1371
1405
  if (pD(orm))
@@ -1461,7 +1495,7 @@ import { fileURLToPath } from "node:url";
1461
1495
  // src/commands/formatProject.ts
1462
1496
  import { execSync } from "child_process";
1463
1497
  import { exit as exit2 } from "process";
1464
- var import_picocolors12 = __toESM(require_picocolors(), 1);
1498
+ var import_picocolors13 = __toESM(require_picocolors(), 1);
1465
1499
 
1466
1500
  // src/utils/commandMaps.ts
1467
1501
  var formatCommands = {
@@ -1487,9 +1521,9 @@ var formatProject = ({
1487
1521
  const fmt = formatCommands[packageManager] ?? "bun run format";
1488
1522
  spin.start("Formatting files…");
1489
1523
  execSync(fmt, { cwd: projectName, stdio: "pipe" });
1490
- spin.stop(import_picocolors12.green("Files formatted"));
1524
+ spin.stop(import_picocolors13.green("Files formatted"));
1491
1525
  } catch (err) {
1492
- spin.stop(import_picocolors12.red("Failed to format files"), 1);
1526
+ spin.stop(import_picocolors13.red("Failed to format files"), 1);
1493
1527
  console.error("Error formatting:", err);
1494
1528
  exit2(1);
1495
1529
  }
@@ -1498,7 +1532,7 @@ var formatProject = ({
1498
1532
  // src/commands/installDependencies.ts
1499
1533
  import { execSync as execSync2 } from "child_process";
1500
1534
  import { exit as exit3 } from "process";
1501
- var import_picocolors13 = __toESM(require_picocolors(), 1);
1535
+ var import_picocolors14 = __toESM(require_picocolors(), 1);
1502
1536
  var installDependencies = async ({
1503
1537
  projectName,
1504
1538
  packageManager
@@ -1508,16 +1542,16 @@ var installDependencies = async ({
1508
1542
  try {
1509
1543
  spin.start("Installing dependencies…");
1510
1544
  execSync2(cmd, { cwd: projectName, stdio: "pipe" });
1511
- spin.stop(import_picocolors13.green("Dependencies installed"));
1545
+ spin.stop(import_picocolors14.green("Dependencies installed"));
1512
1546
  } catch (err) {
1513
- spin.stop(import_picocolors13.red("Installation failed"), 1);
1547
+ spin.stop(import_picocolors14.red("Installation failed"), 1);
1514
1548
  console.error("Error installing dependencies:", err);
1515
1549
  exit3(1);
1516
1550
  }
1517
1551
  };
1518
1552
 
1519
1553
  // src/generators/configurations/addConfigurationFiles.ts
1520
- var import_picocolors14 = __toESM(require_picocolors(), 1);
1554
+ var import_picocolors15 = __toESM(require_picocolors(), 1);
1521
1555
  import { copyFileSync, writeFileSync } from "fs";
1522
1556
  import { join } from "path";
1523
1557
 
@@ -1561,14 +1595,14 @@ var addConfigurationFiles = ({
1561
1595
  const prettierrc = generatePrettierrc(frontends);
1562
1596
  writeFileSync(join(projectName, ".prettierrc.json"), prettierrc);
1563
1597
  } else
1564
- console.warn(`${import_picocolors14.dim("│")}
1565
- ${import_picocolors14.yellow("▲")} Biome support not implemented yet`);
1598
+ console.warn(`${import_picocolors15.dim("│")}
1599
+ ${import_picocolors15.yellow("▲")} Biome support not implemented yet`);
1566
1600
  };
1567
1601
 
1568
1602
  // src/generators/configurations/generatePackageJson.ts
1569
1603
  import { writeFileSync as writeFileSync2 } from "fs";
1570
1604
  import { join as join2 } from "path";
1571
- var import_picocolors15 = __toESM(require_picocolors(), 1);
1605
+ var import_picocolors16 = __toESM(require_picocolors(), 1);
1572
1606
 
1573
1607
  // src/utils/getPackageVersion.ts
1574
1608
  import { execSync as execSync3 } from "child_process";
@@ -1633,7 +1667,7 @@ var createPackageJson = ({
1633
1667
  dependencies["svelte"] = resolveVersion("svelte", "5.34.7");
1634
1668
  codeQualityTool === "eslint+prettier" && (devDependencies["prettier-plugin-svelte"] = resolveVersion("prettier-plugin-svelte", "3.4.0"));
1635
1669
  }
1636
- latest && s.stop(import_picocolors15.green("Package versions resolved"));
1670
+ latest && s.stop(import_picocolors16.green("Package versions resolved"));
1637
1671
  const scripts = {
1638
1672
  dev: "bun run src/backend/server.ts",
1639
1673
  format: `prettier --write "./**/*.{js,ts,css,json,mjs,md${usesReact ? ",jsx,tsx" : ""}${usesSvelte ? ",svelte" : ""}}"`,
@@ -1675,7 +1709,7 @@ var initalizeRoot = (projectName, templatesDirectory) => {
1675
1709
  };
1676
1710
 
1677
1711
  // src/generators/db/scaffoldDatabase.ts
1678
- var import_picocolors16 = __toESM(require_picocolors(), 1);
1712
+ var import_picocolors17 = __toESM(require_picocolors(), 1);
1679
1713
  import { mkdirSync as mkdirSync2 } from "fs";
1680
1714
  import { join as join5 } from "path";
1681
1715
 
@@ -1704,15 +1738,15 @@ var scaffoldDatabase = ({
1704
1738
  }) => {
1705
1739
  mkdirSync2(join5(projectName, databaseDirectory), { recursive: true });
1706
1740
  if (databaseEngine !== "postgresql" && databaseEngine !== "none") {
1707
- console.warn(`${import_picocolors16.dim("│")}
1708
- ${import_picocolors16.yellow("▲")} Only PostgreSQL support is implemented so far`);
1741
+ console.warn(`${import_picocolors17.dim("│")}
1742
+ ${import_picocolors17.yellow("▲")} Only PostgreSQL support is implemented so far`);
1709
1743
  }
1710
1744
  if (orm === "drizzle") {
1711
1745
  createDrizzleConfig({ databaseEngine, projectName });
1712
1746
  }
1713
1747
  if (orm === "prisma") {
1714
- console.warn(`${import_picocolors16.dim("│")}
1715
- ${import_picocolors16.yellow("▲")} Prisma support is not implemented yet`);
1748
+ console.warn(`${import_picocolors17.dim("│")}
1749
+ ${import_picocolors17.yellow("▲")} Prisma support is not implemented yet`);
1716
1750
  }
1717
1751
  };
1718
1752
 
package/package.json CHANGED
@@ -46,5 +46,5 @@
46
46
  "typecheck": "bun run tsc --noEmit"
47
47
  },
48
48
  "type": "module",
49
- "version": "0.2.0"
49
+ "version": "0.2.1"
50
50
  }