@hype-stack/cli 0.5.14 → 0.5.15
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.
|
@@ -13,7 +13,7 @@ import { Prompt as O } from "@clack/core";
|
|
|
13
13
|
import { styleText as k } from "node:util";
|
|
14
14
|
import { downloadTemplate as ee } from "giget";
|
|
15
15
|
//#region src/constants/constants.ts
|
|
16
|
-
var A = "0.5.
|
|
16
|
+
var A = "0.5.15", te = "gh:BetterTyped/hype-stack", ne = "stack.json", re = "/schema/stack.json", j = "https://api.hype-stack.dev", M = "HYPE_STACK_API_URL", N = "https://www.hype-stack.dev", ie = /^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/, P = [
|
|
17
17
|
{
|
|
18
18
|
value: "cursor",
|
|
19
19
|
label: "Cursor",
|
|
@@ -3596,13 +3596,41 @@ async function va(e, t, n) {
|
|
|
3596
3596
|
"up",
|
|
3597
3597
|
"-d"
|
|
3598
3598
|
], { cwd: `${e}/apps/backend` });
|
|
3599
|
-
return o.exitCode === 0 ? (a.stop(L.success("Docker services started")), !0) : (a.error("Failed to start Docker services"),
|
|
3599
|
+
return o.exitCode === 0 ? (a.stop(L.success("Docker services started")), !0) : (a.error("Failed to start Docker services"), Ca(o), !1);
|
|
3600
3600
|
}
|
|
3601
3601
|
function ya(e) {
|
|
3602
3602
|
let t = (e.stderr || e.stdout).trim();
|
|
3603
3603
|
t && s.log.warn(L.muted(t));
|
|
3604
3604
|
}
|
|
3605
|
-
|
|
3605
|
+
function ba(e) {
|
|
3606
|
+
return /is already in use by container|Conflict\. The container name/i.test(e) ? "container" : /port is already allocated|address already in use|Bind for .+ failed|failed to (?:bind|set up) .*port/i.test(e) ? "port" : null;
|
|
3607
|
+
}
|
|
3608
|
+
function xa(e) {
|
|
3609
|
+
return e.match(/container name "\/?([^"]+)"/i)?.[1] ?? null;
|
|
3610
|
+
}
|
|
3611
|
+
function Sa(e) {
|
|
3612
|
+
return e.match(/Bind for [^:]*:(\d{2,5})/i)?.[1] ?? e.match(/:(\d{2,5})(?:->|\b)[^\n]*(?:already allocated|already in use)/i)?.[1] ?? null;
|
|
3613
|
+
}
|
|
3614
|
+
function Ca(e) {
|
|
3615
|
+
let t = (e.stderr || e.stdout).trim(), n = ba(t);
|
|
3616
|
+
if (!n) {
|
|
3617
|
+
t && s.log.warn(L.muted(t));
|
|
3618
|
+
return;
|
|
3619
|
+
}
|
|
3620
|
+
if (n === "container") {
|
|
3621
|
+
let e = xa(t);
|
|
3622
|
+
s.log.warn(L.muted(`${e ? `Container ${L.command(e)}` : "One of this project's containers"} is already running, most likely from another Hype Stack project. The template uses fixed container names, so two projects can't run their services at the same time.`));
|
|
3623
|
+
} else {
|
|
3624
|
+
let e = Sa(t);
|
|
3625
|
+
s.log.warn(L.muted(`${e ? `Host port ${L.command(e)}` : "A host port this project needs"} is already taken, most likely by another Hype Stack project. The template uses fixed ports, so two projects can't run their services at the same time.`));
|
|
3626
|
+
}
|
|
3627
|
+
z([
|
|
3628
|
+
`${L.command("docker ps")} ${L.muted("see what's already running")}`,
|
|
3629
|
+
`${L.command("docker compose down")} ${L.muted("run in the other project's apps/backend to free its services")}`,
|
|
3630
|
+
L.muted("then re-run this command and start Docker again")
|
|
3631
|
+
].join("\n"), "Free up Docker, then retry"), t && s.log.warn(L.muted(t));
|
|
3632
|
+
}
|
|
3633
|
+
async function wa(e, t = 15, n = 2e3) {
|
|
3606
3634
|
for (let r = 0; r < t; r++) {
|
|
3607
3635
|
if ((await J("docker", [
|
|
3608
3636
|
"compose",
|
|
@@ -3617,8 +3645,8 @@ async function ba(e, t = 15, n = 2e3) {
|
|
|
3617
3645
|
}
|
|
3618
3646
|
return !1;
|
|
3619
3647
|
}
|
|
3620
|
-
var
|
|
3621
|
-
async function
|
|
3648
|
+
var Ta = "Database schema is up to date";
|
|
3649
|
+
async function Ea(e) {
|
|
3622
3650
|
let t = await J("pnpm", [
|
|
3623
3651
|
"--filter",
|
|
3624
3652
|
"@internal/backend",
|
|
@@ -3627,9 +3655,9 @@ async function Sa(e) {
|
|
|
3627
3655
|
"migrate",
|
|
3628
3656
|
"status"
|
|
3629
3657
|
], { cwd: e });
|
|
3630
|
-
return t.exitCode === 0 ? `${t.stdout}\n${t.stderr}`.includes(
|
|
3658
|
+
return t.exitCode === 0 ? `${t.stdout}\n${t.stderr}`.includes(Ta) : !1;
|
|
3631
3659
|
}
|
|
3632
|
-
async function
|
|
3660
|
+
async function Da(e) {
|
|
3633
3661
|
let t = s.spinner();
|
|
3634
3662
|
t.start("Running database migrations...");
|
|
3635
3663
|
let n = await J("pnpm", [
|
|
@@ -3639,13 +3667,13 @@ async function Ca(e) {
|
|
|
3639
3667
|
], { cwd: e });
|
|
3640
3668
|
return n.exitCode === 0 ? (t.stop(L.success("Database migrations applied")), !0) : (t.error("Migrations failed"), ya(n), s.log.warn(L.muted("Run `pnpm --filter @internal/backend migration:latest` manually to apply migrations.")), !1);
|
|
3641
3669
|
}
|
|
3642
|
-
async function
|
|
3670
|
+
async function Oa(e, t, n = {}) {
|
|
3643
3671
|
if (!await va(e, t, await ga())) return !1;
|
|
3644
3672
|
let r = s.spinner();
|
|
3645
|
-
return r.start("Waiting for Postgres to be ready..."), await
|
|
3673
|
+
return r.start("Waiting for Postgres to be ready..."), await wa(e, n.postgresMaxAttempts ?? 15, n.postgresCheckIntervalMs ?? 2e3) ? (r.stop(L.success("Postgres is ready")), !0) : (r.error("Postgres health check timed out"), s.log.warn(L.muted("Run migrations manually once Postgres is ready: pnpm --filter @internal/backend migration:latest")), !1);
|
|
3646
3674
|
}
|
|
3647
|
-
async function
|
|
3648
|
-
if (!await
|
|
3675
|
+
async function ka(e, t, n = {}) {
|
|
3676
|
+
if (!await Oa(e, t, n)) return;
|
|
3649
3677
|
let r = t ? !0 : await s.confirm({
|
|
3650
3678
|
message: `Run database migrations with ${L.command("prisma migrate deploy")}?`,
|
|
3651
3679
|
initialValue: !0
|
|
@@ -3654,21 +3682,21 @@ async function Ta(e, t, n = {}) {
|
|
|
3654
3682
|
s.log.info(L.muted("Skipping database migrations."));
|
|
3655
3683
|
return;
|
|
3656
3684
|
}
|
|
3657
|
-
await
|
|
3685
|
+
await Da(e);
|
|
3658
3686
|
}
|
|
3659
|
-
async function
|
|
3687
|
+
async function Aa(e, t, n = {}) {
|
|
3660
3688
|
if (!await _a(e)) {
|
|
3661
3689
|
s.log.warn(`${L.path(".env")} not found in ${L.path("apps/backend")}. Skipping Docker and migrations - configure it first.`);
|
|
3662
3690
|
return;
|
|
3663
3691
|
}
|
|
3664
|
-
await
|
|
3692
|
+
await ka(e, t, n);
|
|
3665
3693
|
}
|
|
3666
|
-
async function
|
|
3667
|
-
return await _a(e) ?
|
|
3694
|
+
async function ja(e, t, n = {}) {
|
|
3695
|
+
return await _a(e) ? Oa(e, t, n) : (s.log.warn(`${L.path(".env")} not found in ${L.path("apps/backend")}. Skipping Docker - configure it first.`), !1);
|
|
3668
3696
|
}
|
|
3669
3697
|
//#endregion
|
|
3670
3698
|
//#region src/core/resolve.ts
|
|
3671
|
-
function
|
|
3699
|
+
function Ma(e) {
|
|
3672
3700
|
let t = /* @__PURE__ */ new Map();
|
|
3673
3701
|
for (let n of e) t.set(n.name, {
|
|
3674
3702
|
name: n.name,
|
|
@@ -3676,7 +3704,7 @@ function Oa(e) {
|
|
|
3676
3704
|
});
|
|
3677
3705
|
return t;
|
|
3678
3706
|
}
|
|
3679
|
-
function
|
|
3707
|
+
function Na(e, t, n = /* @__PURE__ */ new Set()) {
|
|
3680
3708
|
let r = /* @__PURE__ */ new Set();
|
|
3681
3709
|
function i(e) {
|
|
3682
3710
|
if (n.has(e)) return [];
|
|
@@ -3690,10 +3718,10 @@ function ka(e, t, n = /* @__PURE__ */ new Set()) {
|
|
|
3690
3718
|
}
|
|
3691
3719
|
return i(e);
|
|
3692
3720
|
}
|
|
3693
|
-
function
|
|
3721
|
+
function Pa(e, t, n = []) {
|
|
3694
3722
|
let r = new Set(n), i = new Set(n), a = [];
|
|
3695
3723
|
for (let n of e) {
|
|
3696
|
-
let e =
|
|
3724
|
+
let e = Na(n, t, new Set(i));
|
|
3697
3725
|
for (let t of e) i.has(t) || (i.add(t), a.push(t));
|
|
3698
3726
|
}
|
|
3699
3727
|
return {
|
|
@@ -3701,7 +3729,7 @@ function Aa(e, t, n = []) {
|
|
|
3701
3729
|
alreadyInstalled: e.filter((e) => r.has(e))
|
|
3702
3730
|
};
|
|
3703
3731
|
}
|
|
3704
|
-
function
|
|
3732
|
+
function Fa(e) {
|
|
3705
3733
|
let { order: t, graph: n, isLocked: r, installed: i = [] } = e, a = new Set(i), o = /* @__PURE__ */ new Set();
|
|
3706
3734
|
for (let e of t) {
|
|
3707
3735
|
let t = n.get(e)?.dependencies.some((e) => !a.has(e) && o.has(e)) ?? !1;
|
|
@@ -3714,7 +3742,7 @@ function ja(e) {
|
|
|
3714
3742
|
}
|
|
3715
3743
|
//#endregion
|
|
3716
3744
|
//#region src/core/variants.ts
|
|
3717
|
-
function
|
|
3745
|
+
function Ia(e, t = {}) {
|
|
3718
3746
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
3719
3747
|
for (let i of e) {
|
|
3720
3748
|
let e = t[i.family] ?? i.default;
|
|
@@ -3726,14 +3754,14 @@ function Ma(e, t = {}) {
|
|
|
3726
3754
|
familyOf: r
|
|
3727
3755
|
};
|
|
3728
3756
|
}
|
|
3729
|
-
function
|
|
3757
|
+
function La(e, t, n) {
|
|
3730
3758
|
return [...e.map((e) => n.chosen.get(e.family) ?? e.default), ...t];
|
|
3731
3759
|
}
|
|
3732
|
-
function
|
|
3760
|
+
function Ra(e, t) {
|
|
3733
3761
|
let n = t.familyOf.get(e);
|
|
3734
3762
|
return n ? t.chosen.get(n) ?? e : e;
|
|
3735
3763
|
}
|
|
3736
|
-
function
|
|
3764
|
+
function za(e, t) {
|
|
3737
3765
|
let n = /* @__PURE__ */ new Map();
|
|
3738
3766
|
for (let t of e) t.family && n.set(t.name, t.family);
|
|
3739
3767
|
let r = new Set(t), i = /* @__PURE__ */ new Map();
|
|
@@ -3749,65 +3777,65 @@ function Fa(e, t) {
|
|
|
3749
3777
|
familyOf: n
|
|
3750
3778
|
};
|
|
3751
3779
|
}
|
|
3752
|
-
function
|
|
3780
|
+
function Ba(e, t) {
|
|
3753
3781
|
return e.map((e) => ({
|
|
3754
3782
|
...e,
|
|
3755
|
-
dependencies: e.dependencies.map((e) =>
|
|
3783
|
+
dependencies: e.dependencies.map((e) => Ra(e, t))
|
|
3756
3784
|
}));
|
|
3757
3785
|
}
|
|
3758
3786
|
//#endregion
|
|
3759
3787
|
//#region src/ui/banner.ts
|
|
3760
|
-
var
|
|
3788
|
+
var Va = [
|
|
3761
3789
|
" ██╗ ██╗ ██╗ ██╗ ██████╗ ███████╗",
|
|
3762
3790
|
" ██║ ██║ ╚██╗ ██╔╝ ██╔══██╗ ██╔════╝",
|
|
3763
3791
|
" ███████║ ╚████╔╝ ██████╔╝ █████╗ ",
|
|
3764
3792
|
" ██╔══██║ ╚██╔╝ ██╔═══╝ ██╔══╝ ",
|
|
3765
3793
|
" ██║ ██║ ██║ ██║ ███████╗",
|
|
3766
3794
|
" ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝"
|
|
3767
|
-
],
|
|
3795
|
+
], Ha = [
|
|
3768
3796
|
" ███████╗ ████████╗ █████╗ ██████╗ ██╗ ██╗",
|
|
3769
3797
|
" ██╔════╝ ╚══██╔══╝ ██╔══██╗ ██╔════╝ ██║ ██╔╝",
|
|
3770
3798
|
" ███████╗ ██║ ███████║ ██║ █████╔╝ ",
|
|
3771
3799
|
" ╚════██║ ██║ ██╔══██║ ██║ ██╔═██╗ ",
|
|
3772
3800
|
" ███████║ ██║ ██║ ██║ ╚██████╗ ██║ ██╗",
|
|
3773
3801
|
" ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝"
|
|
3774
|
-
],
|
|
3802
|
+
], Ua = [
|
|
3775
3803
|
253,
|
|
3776
3804
|
176,
|
|
3777
3805
|
21
|
|
3778
|
-
],
|
|
3806
|
+
], Wa = [
|
|
3779
3807
|
245,
|
|
3780
3808
|
76,
|
|
3781
3809
|
2
|
|
3782
|
-
],
|
|
3810
|
+
], Ga = 5, Ka = [
|
|
3783
3811
|
17,
|
|
3784
3812
|
103,
|
|
3785
3813
|
248
|
|
3786
|
-
],
|
|
3814
|
+
], qa = [
|
|
3787
3815
|
42,
|
|
3788
3816
|
160,
|
|
3789
3817
|
250
|
|
3790
|
-
],
|
|
3791
|
-
function
|
|
3818
|
+
], Ja = .2;
|
|
3819
|
+
function Ya() {
|
|
3792
3820
|
console.log();
|
|
3793
|
-
for (let e of Se(
|
|
3794
|
-
start:
|
|
3795
|
-
end:
|
|
3796
|
-
angle:
|
|
3821
|
+
for (let e of Se(Va, {
|
|
3822
|
+
start: Ua,
|
|
3823
|
+
end: Wa,
|
|
3824
|
+
angle: Ga
|
|
3797
3825
|
})) console.log(b.bold(e));
|
|
3798
|
-
for (let e of Se(
|
|
3799
|
-
start:
|
|
3800
|
-
end:
|
|
3801
|
-
angle:
|
|
3826
|
+
for (let e of Se(Ha, {
|
|
3827
|
+
start: Ka,
|
|
3828
|
+
end: qa,
|
|
3829
|
+
angle: Ja
|
|
3802
3830
|
})) console.log(b.bold(e));
|
|
3803
3831
|
console.log(), console.log(` ${R.spark} ${b.dim("v" + A)} ${b.dim("·")} ${be("Ship web + desktop apps from one codebase")}`), console.log();
|
|
3804
3832
|
}
|
|
3805
|
-
function
|
|
3833
|
+
function Xa() {
|
|
3806
3834
|
console.log(), console.log(` ${R.bolt} ${_e.orange("Hype")}${_e.skyBlue("Stack")} ${b.dim("v" + A)}`), console.log();
|
|
3807
3835
|
}
|
|
3808
3836
|
//#endregion
|
|
3809
3837
|
//#region src/ui/pack-multiselect.ts
|
|
3810
|
-
var
|
|
3838
|
+
var Za = class extends O {
|
|
3811
3839
|
options;
|
|
3812
3840
|
cursor = 0;
|
|
3813
3841
|
selected;
|
|
@@ -3911,64 +3939,64 @@ var qa = class extends O {
|
|
|
3911
3939
|
}
|
|
3912
3940
|
}
|
|
3913
3941
|
};
|
|
3914
|
-
function
|
|
3915
|
-
return new
|
|
3942
|
+
function Qa(e) {
|
|
3943
|
+
return new Za(e).prompt();
|
|
3916
3944
|
}
|
|
3917
3945
|
//#endregion
|
|
3918
3946
|
//#region src/utils/naming.ts
|
|
3919
|
-
function
|
|
3947
|
+
function $a(e) {
|
|
3920
3948
|
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
3921
3949
|
}
|
|
3922
|
-
function
|
|
3950
|
+
function eo(e) {
|
|
3923
3951
|
return e.split(/[-_]/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
3924
3952
|
}
|
|
3925
3953
|
//#endregion
|
|
3926
3954
|
//#region src/utils/validate.ts
|
|
3927
|
-
function
|
|
3955
|
+
function to(e) {
|
|
3928
3956
|
if (!e.trim()) return "Project name cannot be empty";
|
|
3929
3957
|
if (e.length > 214) return "Project name is too long (max 214 characters)";
|
|
3930
|
-
let t =
|
|
3958
|
+
let t = $a(e);
|
|
3931
3959
|
if (!ie.test(t)) return "Project name must contain at least one letter or number";
|
|
3932
3960
|
}
|
|
3933
3961
|
//#endregion
|
|
3934
3962
|
//#region src/core/apply-mode.ts
|
|
3935
|
-
var
|
|
3936
|
-
function
|
|
3937
|
-
return e.replace(
|
|
3963
|
+
var no = "src/hooks/use-theme.ts", ro = /(\bexport\s+const\s+defaultTheme\s*=\s*)(["'])(?:light|dark)\2/;
|
|
3964
|
+
function io(e, t) {
|
|
3965
|
+
return e.replace(ro, (e, n, r) => `${n}${r}${t}${r}`);
|
|
3938
3966
|
}
|
|
3939
|
-
async function
|
|
3940
|
-
let n = T.resolve(e,
|
|
3967
|
+
async function ao(e, t) {
|
|
3968
|
+
let n = T.resolve(e, no), r;
|
|
3941
3969
|
try {
|
|
3942
3970
|
r = await y.readFile(n, "utf-8");
|
|
3943
3971
|
} catch {
|
|
3944
3972
|
return !1;
|
|
3945
3973
|
}
|
|
3946
|
-
let i =
|
|
3974
|
+
let i = io(r, t);
|
|
3947
3975
|
return i === r || await y.writeFile(n, i, "utf-8"), !0;
|
|
3948
3976
|
}
|
|
3949
3977
|
//#endregion
|
|
3950
3978
|
//#region src/core/apply-radius.ts
|
|
3951
|
-
var
|
|
3952
|
-
function
|
|
3979
|
+
var oo = /(^[ \t]*--radius(?![\w-])[ \t]*:[ \t]*)([^;\n]*);/gm;
|
|
3980
|
+
function so(e) {
|
|
3953
3981
|
return /^[0-9]*\.?[0-9]+(rem|em|px)$/.test(e.trim());
|
|
3954
3982
|
}
|
|
3955
|
-
function
|
|
3956
|
-
return e.replace(
|
|
3983
|
+
function co(e, t) {
|
|
3984
|
+
return e.replace(oo, (e, n) => `${n}${t};`);
|
|
3957
3985
|
}
|
|
3958
|
-
var
|
|
3959
|
-
async function
|
|
3960
|
-
let n = T.resolve(e,
|
|
3986
|
+
var lo = "assets/styles.css";
|
|
3987
|
+
async function uo(e, t) {
|
|
3988
|
+
let n = T.resolve(e, lo), r;
|
|
3961
3989
|
try {
|
|
3962
3990
|
r = await y.readFile(n, "utf-8");
|
|
3963
3991
|
} catch {
|
|
3964
3992
|
return !1;
|
|
3965
3993
|
}
|
|
3966
|
-
let i =
|
|
3994
|
+
let i = co(r, t);
|
|
3967
3995
|
return i === r || await y.writeFile(n, i, "utf-8"), !0;
|
|
3968
3996
|
}
|
|
3969
3997
|
//#endregion
|
|
3970
3998
|
//#region src/core/apply-theme.ts
|
|
3971
|
-
function
|
|
3999
|
+
function fo(e, t) {
|
|
3972
4000
|
let n = 0;
|
|
3973
4001
|
for (; n < e.length;) {
|
|
3974
4002
|
let r = e.indexOf(t, n);
|
|
@@ -3991,46 +4019,46 @@ function so(e, t) {
|
|
|
3991
4019
|
}
|
|
3992
4020
|
return null;
|
|
3993
4021
|
}
|
|
3994
|
-
function
|
|
4022
|
+
function po(e, t) {
|
|
3995
4023
|
let n = e;
|
|
3996
4024
|
for (let [e, r] of Object.entries(t)) {
|
|
3997
|
-
let t = RegExp(`(^[ \\t]*--${
|
|
4025
|
+
let t = RegExp(`(^[ \\t]*--${mo(e)}[ \\t]*:[ \\t]*)([^;\\n]*);`, "m");
|
|
3998
4026
|
n = n.replace(t, (e, t) => `${t}${r};`);
|
|
3999
4027
|
}
|
|
4000
4028
|
return n;
|
|
4001
4029
|
}
|
|
4002
|
-
function
|
|
4030
|
+
function mo(e) {
|
|
4003
4031
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4004
4032
|
}
|
|
4005
|
-
function
|
|
4006
|
-
let n =
|
|
4033
|
+
function ho(e, t) {
|
|
4034
|
+
let n = fo(e, ":root"), r = fo(e, ".dark"), i = e;
|
|
4007
4035
|
if (n) {
|
|
4008
4036
|
let e = i.slice(0, n.bodyStart), r = i.slice(n.bodyStart, n.bodyEnd), a = i.slice(n.bodyEnd);
|
|
4009
|
-
i = e +
|
|
4037
|
+
i = e + po(r, t.light) + a;
|
|
4010
4038
|
}
|
|
4011
4039
|
if (r) {
|
|
4012
|
-
let e =
|
|
4040
|
+
let e = fo(i, ".dark");
|
|
4013
4041
|
if (e) {
|
|
4014
4042
|
let n = i.slice(0, e.bodyStart), r = i.slice(e.bodyStart, e.bodyEnd), a = i.slice(e.bodyEnd);
|
|
4015
|
-
i = n +
|
|
4043
|
+
i = n + po(r, t.dark) + a;
|
|
4016
4044
|
}
|
|
4017
4045
|
}
|
|
4018
4046
|
return i;
|
|
4019
4047
|
}
|
|
4020
|
-
var
|
|
4021
|
-
async function
|
|
4022
|
-
let n = T.resolve(e,
|
|
4048
|
+
var go = "assets/styles.css";
|
|
4049
|
+
async function _o(e, t) {
|
|
4050
|
+
let n = T.resolve(e, go), r;
|
|
4023
4051
|
try {
|
|
4024
4052
|
r = await y.readFile(n, "utf-8");
|
|
4025
4053
|
} catch {
|
|
4026
4054
|
return !1;
|
|
4027
4055
|
}
|
|
4028
|
-
let i =
|
|
4056
|
+
let i = ho(r, t);
|
|
4029
4057
|
return i === r || await y.writeFile(n, i, "utf-8"), !0;
|
|
4030
4058
|
}
|
|
4031
4059
|
//#endregion
|
|
4032
4060
|
//#region src/core/clone.ts
|
|
4033
|
-
async function
|
|
4061
|
+
async function vo(e) {
|
|
4034
4062
|
let t = await ee(te, {
|
|
4035
4063
|
dir: e,
|
|
4036
4064
|
force: !0
|
|
@@ -4042,7 +4070,7 @@ async function mo(e) {
|
|
|
4042
4070
|
}
|
|
4043
4071
|
//#endregion
|
|
4044
4072
|
//#region src/core/editor-config.ts
|
|
4045
|
-
function
|
|
4073
|
+
function yo(e) {
|
|
4046
4074
|
let t = {
|
|
4047
4075
|
globs: [],
|
|
4048
4076
|
alwaysApply: !1
|
|
@@ -4077,10 +4105,10 @@ function ho(e) {
|
|
|
4077
4105
|
content: i
|
|
4078
4106
|
};
|
|
4079
4107
|
}
|
|
4080
|
-
function
|
|
4108
|
+
function bo(e) {
|
|
4081
4109
|
return e.frontmatter.globs.length > 0 ? `---\npaths:\n${e.frontmatter.globs.map((e) => ` - "${e}"`).join("\n")}\n---\n\n${e.content}` : e.content;
|
|
4082
4110
|
}
|
|
4083
|
-
function
|
|
4111
|
+
function xo(e) {
|
|
4084
4112
|
let t;
|
|
4085
4113
|
t = e.frontmatter.alwaysApply ? "always_on" : e.frontmatter.globs.length > 0 ? "glob" : "model_decision";
|
|
4086
4114
|
let n = [`trigger: ${t}`];
|
|
@@ -4090,30 +4118,30 @@ function _o(e) {
|
|
|
4090
4118
|
}
|
|
4091
4119
|
return e.frontmatter.description && n.push(`description: ${e.frontmatter.description}`), `---\n${n.join("\n")}\n---\n\n${e.content}`;
|
|
4092
4120
|
}
|
|
4093
|
-
function
|
|
4121
|
+
function So(e) {
|
|
4094
4122
|
return e.frontmatter.globs.length > 0 ? `---\napplyTo: "${e.frontmatter.globs.join(", ")}"\n---\n\n${e.content}` : e.content;
|
|
4095
4123
|
}
|
|
4096
|
-
var
|
|
4124
|
+
var Co = {
|
|
4097
4125
|
claude: {
|
|
4098
4126
|
rulesDir: ".claude/rules",
|
|
4099
4127
|
extension: ".md",
|
|
4100
|
-
convert:
|
|
4128
|
+
convert: bo
|
|
4101
4129
|
},
|
|
4102
4130
|
windsurf: {
|
|
4103
4131
|
rulesDir: ".windsurf/rules",
|
|
4104
4132
|
extension: ".md",
|
|
4105
|
-
convert:
|
|
4133
|
+
convert: xo
|
|
4106
4134
|
},
|
|
4107
4135
|
copilot: {
|
|
4108
4136
|
rulesDir: ".github/instructions",
|
|
4109
4137
|
extension: ".instructions.md",
|
|
4110
|
-
convert:
|
|
4138
|
+
convert: So
|
|
4111
4139
|
}
|
|
4112
4140
|
};
|
|
4113
|
-
async function
|
|
4141
|
+
async function wo(e) {
|
|
4114
4142
|
let t = T.join(e, oe), n = (await y.readdir(t, { withFileTypes: !0 }).catch(() => [])).filter((e) => e.isFile() && e.name.endsWith(".mdc"));
|
|
4115
4143
|
return await Promise.all(n.map(async (e) => {
|
|
4116
|
-
let n = T.join(t, e.name), { frontmatter: r, content: i } =
|
|
4144
|
+
let n = T.join(t, e.name), { frontmatter: r, content: i } = yo(await y.readFile(n, "utf-8"));
|
|
4117
4145
|
return {
|
|
4118
4146
|
frontmatter: r,
|
|
4119
4147
|
content: i,
|
|
@@ -4121,9 +4149,9 @@ async function bo(e) {
|
|
|
4121
4149
|
};
|
|
4122
4150
|
}));
|
|
4123
4151
|
}
|
|
4124
|
-
async function
|
|
4152
|
+
async function To(e, t) {
|
|
4125
4153
|
if (t === "cursor") return;
|
|
4126
|
-
let n =
|
|
4154
|
+
let n = Co[t], r = await wo(e), i = T.join(e, n.rulesDir);
|
|
4127
4155
|
await y.mkdir(i, { recursive: !0 }), await Promise.all(r.map((e) => {
|
|
4128
4156
|
let t = n.convert(e), r = e.filename.replace(/\.mdc$/, n.extension);
|
|
4129
4157
|
return y.writeFile(T.join(i, r), t, "utf-8");
|
|
@@ -4131,21 +4159,21 @@ async function xo(e, t) {
|
|
|
4131
4159
|
}
|
|
4132
4160
|
//#endregion
|
|
4133
4161
|
//#region src/core/env-files.ts
|
|
4134
|
-
var
|
|
4162
|
+
var Eo = [
|
|
4135
4163
|
"apps",
|
|
4136
4164
|
"packages",
|
|
4137
4165
|
"libs",
|
|
4138
4166
|
"shared"
|
|
4139
4167
|
];
|
|
4140
|
-
async function
|
|
4141
|
-
let t = await
|
|
4168
|
+
async function Do(e) {
|
|
4169
|
+
let t = await Oo(e);
|
|
4142
4170
|
return (await Promise.all(t.map(async (t) => {
|
|
4143
4171
|
let n = T.join(T.dirname(t), ".env");
|
|
4144
4172
|
return await Y(n) ? null : (await y.copyFile(t, n), T.relative(e, n));
|
|
4145
4173
|
}))).filter((e) => e !== null).sort();
|
|
4146
4174
|
}
|
|
4147
|
-
async function
|
|
4148
|
-
let t = [T.join(e, ".env.example")], n = await Promise.all(
|
|
4175
|
+
async function Oo(e) {
|
|
4176
|
+
let t = [T.join(e, ".env.example")], n = await Promise.all(Eo.map(async (t) => {
|
|
4149
4177
|
let n = T.join(e, t);
|
|
4150
4178
|
return (await y.readdir(n, { withFileTypes: !0 }).catch(() => [])).filter((e) => e.isDirectory()).map((e) => T.join(n, e.name, ".env.example"));
|
|
4151
4179
|
}));
|
|
@@ -4153,11 +4181,11 @@ async function wo(e) {
|
|
|
4153
4181
|
}
|
|
4154
4182
|
//#endregion
|
|
4155
4183
|
//#region src/core/post-clone.ts
|
|
4156
|
-
var Q = "@hype-stack/",
|
|
4157
|
-
async function
|
|
4184
|
+
var Q = "@hype-stack/", ko = "hype-stack", Ao = "@hype-stack/cli";
|
|
4185
|
+
async function jo(e) {
|
|
4158
4186
|
await mr(T.join(e, ".git"));
|
|
4159
4187
|
}
|
|
4160
|
-
async function
|
|
4188
|
+
async function Mo(e) {
|
|
4161
4189
|
await J("git", ["init"], { cwd: e }), await J("git", ["add", "."], { cwd: e }), await J("git", [
|
|
4162
4190
|
"-c",
|
|
4163
4191
|
"user.name=Hype Stack CLI",
|
|
@@ -4168,19 +4196,19 @@ async function Oo(e) {
|
|
|
4168
4196
|
"Initial commit from Hype Stack CLI"
|
|
4169
4197
|
], { cwd: e });
|
|
4170
4198
|
}
|
|
4171
|
-
async function
|
|
4172
|
-
let n = `@${t}/`, r = await
|
|
4199
|
+
async function No(e, t) {
|
|
4200
|
+
let n = `@${t}/`, r = await Vo(e);
|
|
4173
4201
|
for (let e of r) {
|
|
4174
4202
|
let t = await dr(e);
|
|
4175
4203
|
if (!t) continue;
|
|
4176
4204
|
let r = !1;
|
|
4177
|
-
t.name?.startsWith(Q) && (t.name = t.name.replace(Q, n), r = !0),
|
|
4205
|
+
t.name?.startsWith(Q) && (t.name = t.name.replace(Q, n), r = !0), Ro(t.dependencies, n) && (r = !0), Ro(t.devDependencies, n) && (r = !0), t.nx && zo(t.nx, n) && (r = !0);
|
|
4178
4206
|
let i = await y.readFile(e, "utf-8"), a = qr(i, n);
|
|
4179
4207
|
a === i ? r && await fr(e, t) : await y.writeFile(e, a, "utf-8");
|
|
4180
4208
|
}
|
|
4181
|
-
await qi(e, t), await
|
|
4209
|
+
await qi(e, t), await Io(e, t), await Bo(e, t);
|
|
4182
4210
|
}
|
|
4183
|
-
var
|
|
4211
|
+
var Po = new Set([
|
|
4184
4212
|
".git",
|
|
4185
4213
|
"node_modules",
|
|
4186
4214
|
"dist",
|
|
@@ -4188,10 +4216,10 @@ var Ao = new Set([
|
|
|
4188
4216
|
".nx",
|
|
4189
4217
|
".next",
|
|
4190
4218
|
"coverage"
|
|
4191
|
-
]),
|
|
4192
|
-
async function
|
|
4193
|
-
if (t ===
|
|
4194
|
-
let n = await
|
|
4219
|
+
]), Fo = /^(docker-compose|compose)(\.[\w.-]+)?\.ya?ml$/;
|
|
4220
|
+
async function Io(e, t) {
|
|
4221
|
+
if (t === ko) return;
|
|
4222
|
+
let n = await Lo(e);
|
|
4195
4223
|
await Promise.all(n.map(async (e) => {
|
|
4196
4224
|
let n = await y.readFile(e, "utf-8").catch(() => null);
|
|
4197
4225
|
if (!n || !/^name:[ \t]*hype-stack/m.test(n)) return;
|
|
@@ -4199,23 +4227,23 @@ async function Mo(e, t) {
|
|
|
4199
4227
|
await y.writeFile(e, r, "utf-8");
|
|
4200
4228
|
}));
|
|
4201
4229
|
}
|
|
4202
|
-
async function
|
|
4230
|
+
async function Lo(e) {
|
|
4203
4231
|
let t = await y.readdir(e, { withFileTypes: !0 }).catch(() => []);
|
|
4204
4232
|
return (await Promise.all(t.map(async (t) => {
|
|
4205
4233
|
let n = T.join(e, t.name);
|
|
4206
|
-
return t.isDirectory() ?
|
|
4234
|
+
return t.isDirectory() ? Po.has(t.name) ? [] : Lo(n) : t.isFile() && Fo.test(t.name) ? [n] : [];
|
|
4207
4235
|
}))).flat();
|
|
4208
4236
|
}
|
|
4209
|
-
function
|
|
4237
|
+
function Ro(e, t) {
|
|
4210
4238
|
if (!e) return !1;
|
|
4211
4239
|
let n = !1;
|
|
4212
|
-
for (let r of Object.keys(e)) if (r !==
|
|
4240
|
+
for (let r of Object.keys(e)) if (r !== Ao && r.startsWith(Q)) {
|
|
4213
4241
|
let i = r.replace(Q, t);
|
|
4214
4242
|
e[i] = e[r], delete e[r], n = !0;
|
|
4215
4243
|
}
|
|
4216
4244
|
return n;
|
|
4217
4245
|
}
|
|
4218
|
-
function
|
|
4246
|
+
function zo(e, t) {
|
|
4219
4247
|
if (!e) return !1;
|
|
4220
4248
|
let n = !1;
|
|
4221
4249
|
if (e.implicitDependencies &&= e.implicitDependencies.map((e) => e.startsWith(Q) ? (n = !0, e.replace(Q, t)) : e), e.targets) {
|
|
@@ -4223,13 +4251,13 @@ function Fo(e, t) {
|
|
|
4223
4251
|
}
|
|
4224
4252
|
return n;
|
|
4225
4253
|
}
|
|
4226
|
-
async function
|
|
4254
|
+
async function Bo(e, t) {
|
|
4227
4255
|
let n = T.join(e, "packages/enums/src/app/index.ts"), r = await y.readFile(n, "utf-8").catch(() => null);
|
|
4228
4256
|
if (!r) return;
|
|
4229
|
-
let i =
|
|
4257
|
+
let i = eo(t), a = r.replaceAll(`id: "${ko}"`, `id: "${t}"`).replaceAll(`name: "${ko}"`, `name: "${t}"`).replace(/name: "Hype Stack"/, `name: "${i}"`).replace(/description: ".*?"/, `description: "${i} application"`);
|
|
4230
4258
|
await y.writeFile(n, a, "utf-8");
|
|
4231
4259
|
}
|
|
4232
|
-
async function
|
|
4260
|
+
async function Vo(e) {
|
|
4233
4261
|
let t = [], n = T.join(e, "package.json");
|
|
4234
4262
|
(await y.stat(n).catch(() => null))?.isFile() && t.push(n);
|
|
4235
4263
|
for (let n of [
|
|
@@ -4249,7 +4277,7 @@ async function Lo(e) {
|
|
|
4249
4277
|
}
|
|
4250
4278
|
//#endregion
|
|
4251
4279
|
//#region src/core/readme.ts
|
|
4252
|
-
var
|
|
4280
|
+
var Ho = {
|
|
4253
4281
|
cursor: {
|
|
4254
4282
|
label: "Cursor",
|
|
4255
4283
|
rulesDir: ".cursor/rules"
|
|
@@ -4266,21 +4294,21 @@ var Ro = {
|
|
|
4266
4294
|
label: "GitHub Copilot",
|
|
4267
4295
|
rulesDir: ".github/instructions"
|
|
4268
4296
|
}
|
|
4269
|
-
},
|
|
4297
|
+
}, Uo = {
|
|
4270
4298
|
backend: "Hono API server (Postgres, Prisma, Kysely, Valkey cache, WorkOS auth)",
|
|
4271
4299
|
frontend: "React + Vite app talking to the backend through the typed HyperFetch SDK"
|
|
4272
|
-
},
|
|
4300
|
+
}, Wo = {
|
|
4273
4301
|
enums: "Shared enums and app config used across apps",
|
|
4274
4302
|
cli: "Project tooling and code generators"
|
|
4275
4303
|
};
|
|
4276
|
-
function
|
|
4304
|
+
function Go(e, t) {
|
|
4277
4305
|
return Object.entries(e).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, n]) => {
|
|
4278
4306
|
let r = t[e];
|
|
4279
4307
|
return r ? `- \`${n}\` - ${r}` : `- \`${n}\``;
|
|
4280
4308
|
});
|
|
4281
4309
|
}
|
|
4282
|
-
function
|
|
4283
|
-
let { projectName: t, editor: n, workspace: r } = e, i =
|
|
4310
|
+
function Ko(e) {
|
|
4311
|
+
let { projectName: t, editor: n, workspace: r } = e, i = eo(t), a = Ho[n], o = !!r.apps.backend, s = Go(r.apps, Uo), c = Go(r.packages, Wo), l = [];
|
|
4284
4312
|
s.length > 0 && l.push(...s), c.length > 0 && l.push(...c), l.push("- `stack.json` - Hype Stack workspace config (apps, paths, installed packs)");
|
|
4285
4313
|
let u = [];
|
|
4286
4314
|
u.push(`# ${i}`), u.push([
|
|
@@ -4383,13 +4411,13 @@ function Ho(e) {
|
|
|
4383
4411
|
"stays useful."
|
|
4384
4412
|
].join("\n")), u.join("\n\n") + "\n";
|
|
4385
4413
|
}
|
|
4386
|
-
async function
|
|
4414
|
+
async function qo(e, t) {
|
|
4387
4415
|
let n = T.join(e, "README.md");
|
|
4388
|
-
await y.writeFile(n,
|
|
4416
|
+
await y.writeFile(n, Ko(t), "utf-8");
|
|
4389
4417
|
}
|
|
4390
4418
|
//#endregion
|
|
4391
4419
|
//#region src/core/tracking.ts
|
|
4392
|
-
async function
|
|
4420
|
+
async function Jo(e) {
|
|
4393
4421
|
try {
|
|
4394
4422
|
let t = {
|
|
4395
4423
|
"X-Device-Id": er(),
|
|
@@ -4403,7 +4431,7 @@ async function Wo(e) {
|
|
|
4403
4431
|
}
|
|
4404
4432
|
//#endregion
|
|
4405
4433
|
//#region src/core/npm-deps.ts
|
|
4406
|
-
function
|
|
4434
|
+
function Yo(e, t) {
|
|
4407
4435
|
let n = [], r = [];
|
|
4408
4436
|
if (!e) return {
|
|
4409
4437
|
errors: n,
|
|
@@ -4434,7 +4462,7 @@ function Go(e, t) {
|
|
|
4434
4462
|
operations: r
|
|
4435
4463
|
};
|
|
4436
4464
|
}
|
|
4437
|
-
function
|
|
4465
|
+
function Xo(e) {
|
|
4438
4466
|
let t = {};
|
|
4439
4467
|
for (let n of e) if (n) for (let [e, r] of Object.entries(n)) t[e] = {
|
|
4440
4468
|
...t[e],
|
|
@@ -4442,7 +4470,7 @@ function Ko(e) {
|
|
|
4442
4470
|
};
|
|
4443
4471
|
return t;
|
|
4444
4472
|
}
|
|
4445
|
-
async function
|
|
4473
|
+
async function Zo(e, t, n = J) {
|
|
4446
4474
|
let r = [];
|
|
4447
4475
|
for (let i of e) {
|
|
4448
4476
|
let e = T.join(t, i.relativeDir);
|
|
@@ -4478,14 +4506,14 @@ async function qo(e, t, n = J) {
|
|
|
4478
4506
|
function $(e) {
|
|
4479
4507
|
return e instanceof Error ? e.message : String(e);
|
|
4480
4508
|
}
|
|
4481
|
-
async function
|
|
4509
|
+
async function Qo(e, t, n) {
|
|
4482
4510
|
let r = e.filter((e) => e.tier === "paid" && !t.has(e.name)).map((e) => e.name);
|
|
4483
4511
|
return r.length === 0 ? {} : Wr(r, n).catch(() => ({}));
|
|
4484
4512
|
}
|
|
4485
|
-
function
|
|
4513
|
+
function $o(e, t) {
|
|
4486
4514
|
return e === "free" ? L.success("free") : e === "owned" ? L.accent("owned") : `${L.highlight(`$${t}`)} ${L.muted("locked")}`;
|
|
4487
4515
|
}
|
|
4488
|
-
async function
|
|
4516
|
+
async function es(e, t, n) {
|
|
4489
4517
|
let r = e.filter((e) => t(e)), i = e.filter((e) => !t(e));
|
|
4490
4518
|
i.length > 0 && s.log.warning(`Skipping ${i.join(", ")} because ${i.length === 1 ? "it depends" : "they depend"} on a pack you don't own yet.`), await sr(r.map((e) => n.get(e)).filter((e) => e !== void 0).map((e) => ({
|
|
4491
4519
|
name: e.name,
|
|
@@ -4493,7 +4521,7 @@ async function Xo(e, t, n) {
|
|
|
4493
4521
|
price: e.price
|
|
4494
4522
|
})));
|
|
4495
4523
|
}
|
|
4496
|
-
function
|
|
4524
|
+
function ts(e, t) {
|
|
4497
4525
|
z([
|
|
4498
4526
|
"These packs will be installed, in order:",
|
|
4499
4527
|
"",
|
|
@@ -4503,7 +4531,7 @@ function Zo(e, t) {
|
|
|
4503
4531
|
})
|
|
4504
4532
|
].join("\n"), "Install Plan");
|
|
4505
4533
|
}
|
|
4506
|
-
async function
|
|
4534
|
+
async function ns(e, t) {
|
|
4507
4535
|
let n = [];
|
|
4508
4536
|
for (let r of e) {
|
|
4509
4537
|
let e = await Rr(r), i = await zr(r, t);
|
|
@@ -4515,18 +4543,18 @@ async function Qo(e, t) {
|
|
|
4515
4543
|
}
|
|
4516
4544
|
return n;
|
|
4517
4545
|
}
|
|
4518
|
-
async function
|
|
4519
|
-
let { prepared: t, paths: n, cwd: r, spinner: i } = e, a =
|
|
4546
|
+
async function rs(e) {
|
|
4547
|
+
let { prepared: t, paths: n, cwd: r, spinner: i } = e, a = Yo(Xo(t.map((e) => e.manifest.dependencies_npm)), n);
|
|
4520
4548
|
if (a.errors.length > 0) {
|
|
4521
4549
|
for (let e of a.errors) s.log.error(e);
|
|
4522
4550
|
return;
|
|
4523
4551
|
}
|
|
4524
4552
|
if (a.operations.length === 0) return;
|
|
4525
4553
|
i.start("Installing npm dependencies...");
|
|
4526
|
-
let o = await
|
|
4554
|
+
let o = await Zo(a.operations, r);
|
|
4527
4555
|
if (i.stop(o.ok ? "npm dependencies installed" : "npm dependency installation failed"), !o.ok) for (let e of o.errors) s.log.error(e);
|
|
4528
4556
|
}
|
|
4529
|
-
function
|
|
4557
|
+
function is() {
|
|
4530
4558
|
Te([{
|
|
4531
4559
|
command: "npx @hype-stack/cli onboard",
|
|
4532
4560
|
hint: "(set up env vars + run migrations)"
|
|
@@ -4535,7 +4563,7 @@ function es() {
|
|
|
4535
4563
|
hint: "(start frontend + backend)"
|
|
4536
4564
|
}]);
|
|
4537
4565
|
}
|
|
4538
|
-
function
|
|
4566
|
+
function as(e) {
|
|
4539
4567
|
if (e.length === 0) return;
|
|
4540
4568
|
let t = e.map((e) => {
|
|
4541
4569
|
let t = e.replace(/^\{\{[^}]+\}\}\//, "");
|
|
@@ -4543,7 +4571,7 @@ function ts(e) {
|
|
|
4543
4571
|
});
|
|
4544
4572
|
s.note(t.join("\n"), "Skipped (already exist)");
|
|
4545
4573
|
}
|
|
4546
|
-
async function
|
|
4574
|
+
async function os(e) {
|
|
4547
4575
|
let { prepared: t, config: n, cwd: r, force: i, yes: a, slotsByPack: o } = e, c = /* @__PURE__ */ new Set();
|
|
4548
4576
|
if (i) return c;
|
|
4549
4577
|
let l = await na({
|
|
@@ -4573,7 +4601,7 @@ async function ns(e) {
|
|
|
4573
4601
|
}
|
|
4574
4602
|
//#endregion
|
|
4575
4603
|
//#region src/ui/swatch.ts
|
|
4576
|
-
function
|
|
4604
|
+
function ss(e) {
|
|
4577
4605
|
let t = e.trim().match(/^oklch\(([^)]+)\)$/i);
|
|
4578
4606
|
if (!t) return null;
|
|
4579
4607
|
let n = t[1].trim().split(/\s+/);
|
|
@@ -4592,56 +4620,56 @@ function rs(e) {
|
|
|
4592
4620
|
h: a
|
|
4593
4621
|
};
|
|
4594
4622
|
}
|
|
4595
|
-
function
|
|
4623
|
+
function cs(e) {
|
|
4596
4624
|
return Math.min(255, Math.max(0, Math.round(e)));
|
|
4597
4625
|
}
|
|
4598
|
-
function
|
|
4626
|
+
function ls(e) {
|
|
4599
4627
|
return e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055;
|
|
4600
4628
|
}
|
|
4601
|
-
function
|
|
4629
|
+
function us({ l: e, c: t, h: n }) {
|
|
4602
4630
|
let r = n * Math.PI / 180, i = t * Math.cos(r), a = t * Math.sin(r), o = e + .3963377774 * i + .2158037573 * a, s = e - .1055613458 * i - .0638541728 * a, c = e - .0894841775 * i - 1.291485548 * a, l = o ** 3, u = s ** 3, d = c ** 3, f = 4.0767416621 * l - 3.3077115913 * u + .2309699292 * d, p = -1.2684380042 * l + 2.6097570613 * u - .3413193965 * d, m = -.0041960863 * l - .7034186147 * u + 1.7076146937 * d;
|
|
4603
4631
|
return [
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4632
|
+
cs(ls(f) * 255),
|
|
4633
|
+
cs(ls(p) * 255),
|
|
4634
|
+
cs(ls(m) * 255)
|
|
4607
4635
|
];
|
|
4608
4636
|
}
|
|
4609
|
-
var
|
|
4610
|
-
function
|
|
4637
|
+
var ds = "\x1B[49m";
|
|
4638
|
+
function fs(e, t) {
|
|
4611
4639
|
let n = e[t];
|
|
4612
4640
|
if (!n) return b.dim(" ");
|
|
4613
|
-
let r =
|
|
4641
|
+
let r = ss(n);
|
|
4614
4642
|
if (!r) return b.dim(" ");
|
|
4615
|
-
let [i, a, o] =
|
|
4616
|
-
return `\x1b[48;2;${i};${a};${o}m ${
|
|
4643
|
+
let [i, a, o] = us(r);
|
|
4644
|
+
return `\x1b[48;2;${i};${a};${o}m ${ds}`;
|
|
4617
4645
|
}
|
|
4618
|
-
var
|
|
4646
|
+
var ps = [
|
|
4619
4647
|
"primary",
|
|
4620
4648
|
"secondary",
|
|
4621
4649
|
"accent"
|
|
4622
4650
|
];
|
|
4623
|
-
function
|
|
4624
|
-
return
|
|
4651
|
+
function ms(e) {
|
|
4652
|
+
return ps.map((t) => fs(e, t)).join("");
|
|
4625
4653
|
}
|
|
4626
|
-
function
|
|
4627
|
-
return `${
|
|
4654
|
+
function hs(e) {
|
|
4655
|
+
return `${ms(e.light)} ${b.dim("·")} ${ms(e.dark)}`;
|
|
4628
4656
|
}
|
|
4629
4657
|
//#endregion
|
|
4630
4658
|
//#region src/commands/create.ts
|
|
4631
|
-
async function
|
|
4632
|
-
e.skipBanner ||
|
|
4659
|
+
async function gs(e) {
|
|
4660
|
+
e.skipBanner || Ya(), s.intro(L.brandBold("Create a new Hype Stack project"));
|
|
4633
4661
|
let o = e.yes === !0, c, l;
|
|
4634
4662
|
if (o && e.name) {
|
|
4635
|
-
let t =
|
|
4636
|
-
t && (s.log.error(t), B()), l = e.name, c =
|
|
4663
|
+
let t = to(e.name);
|
|
4664
|
+
t && (s.log.error(t), B()), l = e.name, c = $a(e.name);
|
|
4637
4665
|
} else {
|
|
4638
4666
|
let t = await s.text({
|
|
4639
4667
|
message: "What is your project named?",
|
|
4640
4668
|
placeholder: "my-app",
|
|
4641
4669
|
initialValue: e.name ?? "",
|
|
4642
|
-
validate: (e) =>
|
|
4670
|
+
validate: (e) => to(e ?? "")
|
|
4643
4671
|
});
|
|
4644
|
-
s.isCancel(t) && B(), l = t, c =
|
|
4672
|
+
s.isCancel(t) && B(), l = t, c = $a(l);
|
|
4645
4673
|
}
|
|
4646
4674
|
l.trim() !== c && s.log.info(L.muted(`Using "${L.highlight(c)}" as the project name`));
|
|
4647
4675
|
let u;
|
|
@@ -4685,7 +4713,7 @@ async function fs(e) {
|
|
|
4685
4713
|
message: "Pick a color theme",
|
|
4686
4714
|
options: r.map((e) => ({
|
|
4687
4715
|
value: e.name,
|
|
4688
|
-
label: `${
|
|
4716
|
+
label: `${hs(e)} ${e.label}`
|
|
4689
4717
|
})),
|
|
4690
4718
|
initialValue: h
|
|
4691
4719
|
});
|
|
@@ -4703,24 +4731,24 @@ async function fs(e) {
|
|
|
4703
4731
|
(s.isCancel(e) || !e) && B();
|
|
4704
4732
|
}
|
|
4705
4733
|
let _ = s.spinner();
|
|
4706
|
-
_.start("Cloning Hype Stack template..."), await
|
|
4734
|
+
_.start("Cloning Hype Stack template..."), await vo(d), _.stop(L.success("Template cloned"));
|
|
4707
4735
|
let v = s.spinner();
|
|
4708
|
-
v.start("Setting up project..."), await
|
|
4736
|
+
v.start("Setting up project..."), await jo(d), await No(d, c), await To(d, p);
|
|
4709
4737
|
let y = await Pr(d), b = Ir(c, y);
|
|
4710
|
-
await Nr(d, b), await
|
|
4738
|
+
await Nr(d, b), await qo(d, {
|
|
4711
4739
|
projectName: c,
|
|
4712
4740
|
editor: p,
|
|
4713
4741
|
workspace: y
|
|
4714
4742
|
});
|
|
4715
4743
|
let x = T.resolve(d, b.paths?.frontend.root ?? "apps/frontend");
|
|
4716
|
-
a(g) && (await
|
|
4744
|
+
a(g) && (await _o(x, i(g)) || s.log.warn(L.muted(`Could not find ${L.path("assets/styles.css")} to apply the ${g} theme`))), e.radius !== void 0 && so(e.radius) && (await uo(x, e.radius) || s.log.warn(L.muted(`Could not find ${L.path("assets/styles.css")} to set the corner radius`))), await ao(x, e.defaultMode === "dark" || e.defaultMode === "light" ? e.defaultMode : "light") || s.log.warn(L.muted(`Could not find ${L.path("src/hooks/use-theme.ts")} to set the default color mode`)), v.stop(L.success("Project configured"));
|
|
4717
4745
|
let S = s.spinner();
|
|
4718
4746
|
S.start("Installing dependencies..."), (await J("pnpm", ["install"], { cwd: d })).exitCode === 0 ? S.stop(L.success("Dependencies installed")) : (S.stop(L.warning("Dependencies installed with warnings")), s.log.warn(L.muted("You may need to run `pnpm install` manually to resolve issues.")));
|
|
4719
4747
|
let C = s.spinner();
|
|
4720
|
-
C.start("Initializing git repository..."), await
|
|
4748
|
+
C.start("Initializing git repository..."), await Mo(d), C.stop(L.success("Git repository initialized with clean history"));
|
|
4721
4749
|
let w = s.spinner();
|
|
4722
4750
|
w.start("Creating .env files from examples...");
|
|
4723
|
-
let E = await
|
|
4751
|
+
let E = await Do(d);
|
|
4724
4752
|
if (E.length > 0) {
|
|
4725
4753
|
let e = E.length;
|
|
4726
4754
|
w.stop(L.success(`Created ${e} .env file${e === 1 ? "" : "s"} from examples`));
|
|
@@ -4735,15 +4763,15 @@ async function fs(e) {
|
|
|
4735
4763
|
message: "Would you like to start Docker services and run database migrations now?",
|
|
4736
4764
|
initialValue: !0
|
|
4737
4765
|
}));
|
|
4738
|
-
s.isCancel(e) && B(), e ? await
|
|
4766
|
+
s.isCancel(e) && B(), e ? await Aa(d, o) : s.log.info(L.muted("Docker and migrations can run later via `npx @hype-stack/cli onboard`.")), is();
|
|
4739
4767
|
}
|
|
4740
|
-
return await
|
|
4768
|
+
return await Jo("project_create"), s.outro(L.muted("Happy building!")), d;
|
|
4741
4769
|
}
|
|
4742
4770
|
//#endregion
|
|
4743
4771
|
//#region src/commands/init.ts
|
|
4744
|
-
async function
|
|
4772
|
+
async function _s(e) {
|
|
4745
4773
|
let t = e.cwd ?? process.cwd(), n = e.silent ?? !1;
|
|
4746
|
-
if (n || (
|
|
4774
|
+
if (n || (Xa(), s.intro(L.brandBold("Initialize Hype Stack configuration"))), !await Lr(t)) {
|
|
4747
4775
|
s.log.error(`This doesn't look like a Hype Stack project. ${L.muted("Expected apps/ directory and package.json")}`), s.outro(L.muted(`Run ${L.command("npx @hype-stack/cli create")} to scaffold a new project.`));
|
|
4748
4776
|
return;
|
|
4749
4777
|
}
|
|
@@ -4780,21 +4808,21 @@ async function ps(e) {
|
|
|
4780
4808
|
message: "Project name for stack.json?",
|
|
4781
4809
|
placeholder: i,
|
|
4782
4810
|
initialValue: i,
|
|
4783
|
-
validate: (e) =>
|
|
4811
|
+
validate: (e) => to(e ?? "")
|
|
4784
4812
|
});
|
|
4785
|
-
s.isCancel(e) && B(), a =
|
|
4813
|
+
s.isCancel(e) && B(), a = $a(e);
|
|
4786
4814
|
}
|
|
4787
4815
|
await Nr(t, Ir(a, r)), n || (s.log.success(`${L.path("stack.json")} written successfully`), s.outro(L.muted("Your project is mapped and ready for Hype Stack CLI commands.")));
|
|
4788
4816
|
}
|
|
4789
|
-
async function
|
|
4817
|
+
async function vs(e, t = {}, n) {
|
|
4790
4818
|
if (await Mr(e)) return {
|
|
4791
4819
|
projectRoot: e,
|
|
4792
4820
|
scaffolded: !1
|
|
4793
4821
|
};
|
|
4794
|
-
let r = t.runInit ?? ((e) =>
|
|
4822
|
+
let r = t.runInit ?? ((e) => _s({
|
|
4795
4823
|
cwd: e,
|
|
4796
4824
|
silent: !0
|
|
4797
|
-
})), i = t.runCreate ?? ((e, t) =>
|
|
4825
|
+
})), i = t.runCreate ?? ((e, t) => gs({
|
|
4798
4826
|
parentDirectory: e,
|
|
4799
4827
|
deferSetup: !0,
|
|
4800
4828
|
skipBanner: !0,
|
|
@@ -4835,10 +4863,10 @@ async function ms(e, t = {}, n) {
|
|
|
4835
4863
|
}
|
|
4836
4864
|
//#endregion
|
|
4837
4865
|
//#region src/commands/compose.ts
|
|
4838
|
-
async function
|
|
4866
|
+
async function ys(e = {}) {
|
|
4839
4867
|
let t = e.cwd ?? process.cwd();
|
|
4840
|
-
|
|
4841
|
-
let n = await
|
|
4868
|
+
Ya();
|
|
4869
|
+
let n = await vs(t), r = n?.projectRoot ?? null, i = n?.scaffolded ?? !1, a;
|
|
4842
4870
|
try {
|
|
4843
4871
|
a = await jr(r ?? t);
|
|
4844
4872
|
} catch (e) {
|
|
@@ -4856,13 +4884,13 @@ async function hs(e = {}) {
|
|
|
4856
4884
|
c.stop("Failed to load packs"), s.cancel(`Could not reach Hype Stack. Check your connection and try again.\n${$(e)}`), process.exit(1);
|
|
4857
4885
|
}
|
|
4858
4886
|
c.stop("Packs loaded");
|
|
4859
|
-
let u = a.installedPacks ?? [], d = new Set(u), f = new Map(l.map((e) => [e.name, e])), p = e.licenseKey ?? a.licenseKey ?? null, m = (await Xn(F()))?.token ?? null, h = await
|
|
4887
|
+
let u = a.installedPacks ?? [], d = new Set(u), f = new Map(l.map((e) => [e.name, e])), p = e.licenseKey ?? a.licenseKey ?? null, m = (await Xn(F()))?.token ?? null, h = await Qo(l, d, {
|
|
4860
4888
|
token: m,
|
|
4861
4889
|
key: p
|
|
4862
4890
|
}), g = (e) => {
|
|
4863
4891
|
let t = f.get(e);
|
|
4864
4892
|
return !t || t.tier === "free" ? "free" : h[e]?.owned ? "owned" : "locked";
|
|
4865
|
-
}, _ = (e) => !d.has(e) && g(e) === "locked", v = await
|
|
4893
|
+
}, _ = (e) => !d.has(e) && g(e) === "locked", v = await bs({
|
|
4866
4894
|
packs: l,
|
|
4867
4895
|
installedSet: d,
|
|
4868
4896
|
stateOf: g,
|
|
@@ -4873,9 +4901,9 @@ async function hs(e = {}) {
|
|
|
4873
4901
|
s.outro(L.muted("No packs selected. Nothing to do."));
|
|
4874
4902
|
return;
|
|
4875
4903
|
}
|
|
4876
|
-
let b =
|
|
4904
|
+
let b = Cs(v), x = ws(v), S = za(l, b), C = Ma(Ba(l, S)), w;
|
|
4877
4905
|
try {
|
|
4878
|
-
w =
|
|
4906
|
+
w = Pa(b, C, u);
|
|
4879
4907
|
} catch (e) {
|
|
4880
4908
|
s.cancel($(e)), process.exit(1);
|
|
4881
4909
|
}
|
|
@@ -4883,7 +4911,7 @@ async function hs(e = {}) {
|
|
|
4883
4911
|
z(`${w.alreadyInstalled.join(", ")} already installed.`, "Nothing to do"), s.outro(L.muted("Your selection is already part of the project."));
|
|
4884
4912
|
return;
|
|
4885
4913
|
}
|
|
4886
|
-
let T =
|
|
4914
|
+
let T = Fa({
|
|
4887
4915
|
order: w.order,
|
|
4888
4916
|
graph: C,
|
|
4889
4917
|
isLocked: _,
|
|
@@ -4891,28 +4919,28 @@ async function hs(e = {}) {
|
|
|
4891
4919
|
});
|
|
4892
4920
|
if (T.blocked.length > 0 && !m && !p) {
|
|
4893
4921
|
let e = await or();
|
|
4894
|
-
e && (m = e, h = await
|
|
4922
|
+
e && (m = e, h = await Qo(l, d, {
|
|
4895
4923
|
token: m,
|
|
4896
4924
|
key: p
|
|
4897
|
-
}), T =
|
|
4925
|
+
}), T = Fa({
|
|
4898
4926
|
order: w.order,
|
|
4899
4927
|
graph: C,
|
|
4900
4928
|
isLocked: _,
|
|
4901
4929
|
installed: u
|
|
4902
4930
|
}));
|
|
4903
4931
|
}
|
|
4904
|
-
if (T.blocked.length > 0 && await
|
|
4932
|
+
if (T.blocked.length > 0 && await es(T.blocked, _, f), T.installable.length === 0) {
|
|
4905
4933
|
s.outro(L.muted("Nothing left to install once locked packs are removed."));
|
|
4906
4934
|
return;
|
|
4907
4935
|
}
|
|
4908
|
-
if (
|
|
4936
|
+
if (ts(T.installable, f), !e.yes) {
|
|
4909
4937
|
let e = await s.confirm({ message: `Install ${T.installable.length} pack${T.installable.length === 1 ? "" : "s"}?` });
|
|
4910
4938
|
(s.isCancel(e) || !e) && (s.cancel("Installation cancelled."), process.exit(0));
|
|
4911
4939
|
}
|
|
4912
4940
|
c.start("Downloading packs...");
|
|
4913
4941
|
let E;
|
|
4914
4942
|
try {
|
|
4915
|
-
E = await
|
|
4943
|
+
E = await ns(T.installable, {
|
|
4916
4944
|
token: m,
|
|
4917
4945
|
key: p
|
|
4918
4946
|
});
|
|
@@ -4920,7 +4948,7 @@ async function hs(e = {}) {
|
|
|
4920
4948
|
c.stop("Download failed"), s.cancel($(e)), process.exit(1);
|
|
4921
4949
|
}
|
|
4922
4950
|
c.stop(`Downloaded ${E.length} pack${E.length === 1 ? "" : "s"}`);
|
|
4923
|
-
let D = await
|
|
4951
|
+
let D = await os({
|
|
4924
4952
|
prepared: E,
|
|
4925
4953
|
config: a,
|
|
4926
4954
|
cwd: o,
|
|
@@ -4943,22 +4971,22 @@ async function hs(e = {}) {
|
|
|
4943
4971
|
for (let e of t.errors) s.log.error(e);
|
|
4944
4972
|
s.cancel("No files were written. Fix the errors above (or pass --force for existing files) and try again."), process.exit(1);
|
|
4945
4973
|
}
|
|
4946
|
-
c.stop("Files installed"), t.installed.length > 0 && s.log.success(`${L.highlight(String(t.installed.length))} files installed`), t.skipped.length > 0 && (s.log.warning(`${t.skipped.length} files skipped (use --force to overwrite)`),
|
|
4974
|
+
c.stop("Files installed"), t.installed.length > 0 && s.log.success(`${L.highlight(String(t.installed.length))} files installed`), t.skipped.length > 0 && (s.log.warning(`${t.skipped.length} files skipped (use --force to overwrite)`), as(t.skipped));
|
|
4947
4975
|
for (let e of t.errors) s.log.error(e);
|
|
4948
|
-
await
|
|
4976
|
+
await rs({
|
|
4949
4977
|
prepared: E,
|
|
4950
4978
|
paths: a.paths,
|
|
4951
4979
|
cwd: o,
|
|
4952
4980
|
spinner: c
|
|
4953
4981
|
});
|
|
4954
4982
|
let n;
|
|
4955
|
-
i && (n = await
|
|
4983
|
+
i && (n = await ja(o, e.yes ?? !1)), await _r({
|
|
4956
4984
|
projectRoot: o,
|
|
4957
4985
|
paths: a.paths,
|
|
4958
4986
|
skipPrompts: e.yes ?? !1,
|
|
4959
4987
|
dbReady: n,
|
|
4960
4988
|
freshScaffold: i
|
|
4961
|
-
}),
|
|
4989
|
+
}), is(), s.outro(L.brand(`Installed ${t.appliedPacks.join(", ")}.`));
|
|
4962
4990
|
} finally {
|
|
4963
4991
|
await Promise.all(E.map((e) => y.rm(e.packDir, {
|
|
4964
4992
|
recursive: !0,
|
|
@@ -4966,10 +4994,10 @@ async function hs(e = {}) {
|
|
|
4966
4994
|
})));
|
|
4967
4995
|
}
|
|
4968
4996
|
}
|
|
4969
|
-
async function
|
|
4997
|
+
async function bs(e) {
|
|
4970
4998
|
let { packs: t, installedSet: n, stateOf: r, options: i, adminAvailable: a } = e;
|
|
4971
4999
|
if (i.packs && i.packs.length > 0) {
|
|
4972
|
-
let e = i.packs.map(
|
|
5000
|
+
let e = i.packs.map(Ss), n = e.filter((e) => !t.some((t) => t.name === e.name));
|
|
4973
5001
|
return n.length > 0 && (s.cancel(`Unknown pack${n.length === 1 ? "" : "s"}: ${n.map((e) => e.name).join(", ")}`), process.exit(1)), e;
|
|
4974
5002
|
}
|
|
4975
5003
|
let o = t.filter((e) => n.has(e.name));
|
|
@@ -4984,7 +5012,7 @@ async function gs(e) {
|
|
|
4984
5012
|
let t = r(e.name);
|
|
4985
5013
|
return {
|
|
4986
5014
|
value: e.name,
|
|
4987
|
-
label: `${e.displayName} ${
|
|
5015
|
+
label: `${e.displayName} ${$o(t, e.price)}`,
|
|
4988
5016
|
hint: e.description
|
|
4989
5017
|
};
|
|
4990
5018
|
});
|
|
@@ -5001,7 +5029,7 @@ async function gs(e) {
|
|
|
5001
5029
|
});
|
|
5002
5030
|
continue;
|
|
5003
5031
|
}
|
|
5004
|
-
let n = await
|
|
5032
|
+
let n = await Qa({
|
|
5005
5033
|
message: `Select ${e.label.toLowerCase()} to add (optional)`,
|
|
5006
5034
|
options: t,
|
|
5007
5035
|
required: !1
|
|
@@ -5011,20 +5039,20 @@ async function gs(e) {
|
|
|
5011
5039
|
}
|
|
5012
5040
|
return d;
|
|
5013
5041
|
}
|
|
5014
|
-
var
|
|
5015
|
-
function
|
|
5016
|
-
let t = e.match(
|
|
5042
|
+
var xs = /@(frontend|admin)$/;
|
|
5043
|
+
function Ss(e) {
|
|
5044
|
+
let t = e.match(xs);
|
|
5017
5045
|
return t ? {
|
|
5018
5046
|
name: e.slice(0, -t[0].length),
|
|
5019
5047
|
slot: t[1]
|
|
5020
5048
|
} : { name: e };
|
|
5021
5049
|
}
|
|
5022
|
-
function
|
|
5050
|
+
function Cs(e) {
|
|
5023
5051
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5024
5052
|
for (let r of e) t.has(r.name) || (t.add(r.name), n.push(r.name));
|
|
5025
5053
|
return n;
|
|
5026
5054
|
}
|
|
5027
|
-
function
|
|
5055
|
+
function ws(e) {
|
|
5028
5056
|
let t = /* @__PURE__ */ new Map();
|
|
5029
5057
|
for (let n of e) {
|
|
5030
5058
|
if (!n.slot) continue;
|
|
@@ -5035,8 +5063,8 @@ function bs(e) {
|
|
|
5035
5063
|
}
|
|
5036
5064
|
//#endregion
|
|
5037
5065
|
//#region src/commands/login.ts
|
|
5038
|
-
async function
|
|
5039
|
-
|
|
5066
|
+
async function Ts() {
|
|
5067
|
+
Xa(), s.intro(L.brandBold("Log in to Hype Stack")), s.log.step("Opening your browser to sign in...");
|
|
5040
5068
|
let e;
|
|
5041
5069
|
try {
|
|
5042
5070
|
e = await ar({ onUrl: (e) => {
|
|
@@ -5049,8 +5077,8 @@ async function xs() {
|
|
|
5049
5077
|
}
|
|
5050
5078
|
//#endregion
|
|
5051
5079
|
//#region src/commands/logout.ts
|
|
5052
|
-
async function
|
|
5053
|
-
|
|
5080
|
+
async function Es() {
|
|
5081
|
+
Xa(), s.intro(L.brandBold("Log out of Hype Stack"));
|
|
5054
5082
|
let e = F(), t = await Xn(e);
|
|
5055
5083
|
if (!t) {
|
|
5056
5084
|
s.outro(L.muted("You're not logged in."));
|
|
@@ -5060,7 +5088,7 @@ async function Ss() {
|
|
|
5060
5088
|
}
|
|
5061
5089
|
//#endregion
|
|
5062
5090
|
//#region src/core/onboard-env.ts
|
|
5063
|
-
function
|
|
5091
|
+
function Ds(e) {
|
|
5064
5092
|
let t = [], n = "";
|
|
5065
5093
|
for (let r of e.split(/\r?\n/)) {
|
|
5066
5094
|
let e = r.trim();
|
|
@@ -5086,14 +5114,14 @@ function Cs(e) {
|
|
|
5086
5114
|
}
|
|
5087
5115
|
return t;
|
|
5088
5116
|
}
|
|
5089
|
-
function
|
|
5117
|
+
function Os(e) {
|
|
5090
5118
|
let t = e.trim();
|
|
5091
5119
|
if (t === "") return "";
|
|
5092
5120
|
if (t.length <= 4) return "•".repeat(t.length);
|
|
5093
5121
|
let n = Math.min(t.length - 4, 8);
|
|
5094
5122
|
return `${"•".repeat(n)}${t.slice(-4)}`;
|
|
5095
5123
|
}
|
|
5096
|
-
function
|
|
5124
|
+
function ks(e, t, n) {
|
|
5097
5125
|
let r = e.split(/\r?\n/), i = !1, a = r.map((e) => {
|
|
5098
5126
|
if (i) return e;
|
|
5099
5127
|
let r = e.trim();
|
|
@@ -5103,22 +5131,22 @@ function Ts(e, t, n) {
|
|
|
5103
5131
|
});
|
|
5104
5132
|
return i ? a.join("\n") : e + `${e.length > 0 && !e.endsWith("\n") ? "\n" : ""}${t}=${n}\n`;
|
|
5105
5133
|
}
|
|
5106
|
-
async function
|
|
5134
|
+
async function As(e) {
|
|
5107
5135
|
return await Y(e) ? y.readFile(e, "utf-8") : "";
|
|
5108
5136
|
}
|
|
5109
|
-
async function
|
|
5137
|
+
async function js(e) {
|
|
5110
5138
|
let t = T.join(T.dirname(e), ".env");
|
|
5111
5139
|
return await Y(t) || await y.copyFile(e, t), t;
|
|
5112
5140
|
}
|
|
5113
|
-
async function
|
|
5114
|
-
let r =
|
|
5141
|
+
async function Ms(e, t, n) {
|
|
5142
|
+
let r = ks(await As(e), t, n);
|
|
5115
5143
|
await y.writeFile(e, r, "utf-8");
|
|
5116
5144
|
}
|
|
5117
5145
|
//#endregion
|
|
5118
5146
|
//#region src/commands/onboard.ts
|
|
5119
|
-
async function
|
|
5147
|
+
async function Ns(e = {}) {
|
|
5120
5148
|
let t = e.cwd ?? process.cwd();
|
|
5121
|
-
|
|
5149
|
+
Ya(), s.intro(L.brandBold("Onboard your stack"));
|
|
5122
5150
|
let n;
|
|
5123
5151
|
try {
|
|
5124
5152
|
n = await jr(t);
|
|
@@ -5126,19 +5154,19 @@ async function ks(e = {}) {
|
|
|
5126
5154
|
n = null;
|
|
5127
5155
|
}
|
|
5128
5156
|
n || (s.cancel(`${L.path("stack.json")} not found. Run ${L.command("npx @hype-stack/cli init")} first.`), process.exit(1));
|
|
5129
|
-
let r = n.installedPacks ?? [], i = n.onboarding?.envSections ?? [], a = await
|
|
5157
|
+
let r = n.installedPacks ?? [], i = n.onboarding?.envSections ?? [], a = await Oo(t);
|
|
5130
5158
|
a.length === 0 && s.log.warn(L.muted("No .env.example files found; skipping env setup."));
|
|
5131
|
-
for (let n of a) await
|
|
5159
|
+
for (let n of a) await Ps({
|
|
5132
5160
|
examplePath: n,
|
|
5133
5161
|
projectRoot: t,
|
|
5134
5162
|
skipPrompts: e.yes ?? !1,
|
|
5135
5163
|
installedEnvSections: i
|
|
5136
5164
|
});
|
|
5137
5165
|
let o = Ar(r);
|
|
5138
|
-
o.length > 0 && z(o.map((e) => ` ${L.muted("·")} ${e}`).join("\n"), "Tips"), e.skipMigrations || await
|
|
5166
|
+
o.length > 0 && z(o.map((e) => ` ${L.muted("·")} ${e}`).join("\n"), "Tips"), e.skipMigrations || await Ls(t, e.yes ?? !1), s.outro(L.brand(`All set. Run ${L.command("pnpm dev")} to start your app.`));
|
|
5139
5167
|
}
|
|
5140
|
-
async function
|
|
5141
|
-
let { examplePath: t, projectRoot: n, skipPrompts: r, installedEnvSections: i } = e, a = T.relative(n, t) || t, o = await
|
|
5168
|
+
async function Ps(e) {
|
|
5169
|
+
let { examplePath: t, projectRoot: n, skipPrompts: r, installedEnvSections: i } = e, a = T.relative(n, t) || t, o = await js(t), c = await As(o), l = Ds(await y.readFile(t, "utf-8")), u = L.path(a);
|
|
5142
5170
|
s.log.step(`Env: ${u}`);
|
|
5143
5171
|
for (let e of l) {
|
|
5144
5172
|
if (e.vars.length === 0) continue;
|
|
@@ -5154,7 +5182,7 @@ async function As(e) {
|
|
|
5154
5182
|
s.log.info(`${L.label(n.key)} ${L.muted("skipped (non-interactive)")}`);
|
|
5155
5183
|
continue;
|
|
5156
5184
|
}
|
|
5157
|
-
let e =
|
|
5185
|
+
let e = Os(Fs(c, n.key)), i = await s.text({
|
|
5158
5186
|
message: `${L.label(n.key)}`,
|
|
5159
5187
|
placeholder: e ? `${e} ${L.muted("(Enter keeps this)")}` : t.hint
|
|
5160
5188
|
});
|
|
@@ -5164,31 +5192,31 @@ async function As(e) {
|
|
|
5164
5192
|
s.log.info(L.muted(`${n.key} unchanged.`));
|
|
5165
5193
|
continue;
|
|
5166
5194
|
}
|
|
5167
|
-
await
|
|
5195
|
+
await Ms(o, n.key, a), s.log.success(`${n.key} saved`);
|
|
5168
5196
|
}
|
|
5169
5197
|
}
|
|
5170
5198
|
}
|
|
5171
|
-
function
|
|
5199
|
+
function Fs(e, t) {
|
|
5172
5200
|
for (let n of e.split(/\r?\n/)) {
|
|
5173
|
-
let e = n.match(RegExp(`^${
|
|
5201
|
+
let e = n.match(RegExp(`^${Is(t)}\\s*=\\s*(.*)$`));
|
|
5174
5202
|
if (e) return e[1].trim();
|
|
5175
5203
|
}
|
|
5176
5204
|
return "";
|
|
5177
5205
|
}
|
|
5178
|
-
function
|
|
5206
|
+
function Is(e) {
|
|
5179
5207
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
5180
5208
|
}
|
|
5181
|
-
async function
|
|
5209
|
+
async function Ls(e, t) {
|
|
5182
5210
|
if (!await ga() && !await va(e, t, !1)) {
|
|
5183
5211
|
s.log.info(L.muted(`Start services later with ${L.command("docker compose up -d")} (in apps/backend), then ${L.command("pnpm --filter @internal/backend migration:latest")}.`));
|
|
5184
5212
|
return;
|
|
5185
5213
|
}
|
|
5186
5214
|
let n = s.spinner();
|
|
5187
|
-
if (n.start("Waiting for Postgres to be ready..."), !await
|
|
5215
|
+
if (n.start("Waiting for Postgres to be ready..."), !await wa(e)) {
|
|
5188
5216
|
n.error("Postgres health check timed out"), s.log.warn(L.muted(`Run migrations manually once Postgres is ready: ${L.command("pnpm --filter @internal/backend migration:latest")}`));
|
|
5189
5217
|
return;
|
|
5190
5218
|
}
|
|
5191
|
-
if (n.stop(L.success("Postgres is ready")), await
|
|
5219
|
+
if (n.stop(L.success("Postgres is ready")), await Ea(e)) {
|
|
5192
5220
|
s.log.info(L.muted("Migrations already applied, skipping."));
|
|
5193
5221
|
return;
|
|
5194
5222
|
}
|
|
@@ -5200,20 +5228,20 @@ async function Ns(e, t) {
|
|
|
5200
5228
|
s.log.info(L.muted("Skipping database migrations."));
|
|
5201
5229
|
return;
|
|
5202
5230
|
}
|
|
5203
|
-
await
|
|
5231
|
+
await Da(e);
|
|
5204
5232
|
}
|
|
5205
5233
|
//#endregion
|
|
5206
5234
|
//#region src/core/templates.ts
|
|
5207
|
-
var
|
|
5235
|
+
var Rs = q.createRequest()({
|
|
5208
5236
|
endpoint: "/templates/list",
|
|
5209
5237
|
method: "GET"
|
|
5210
5238
|
});
|
|
5211
|
-
async function
|
|
5212
|
-
let { data: e, error: t } = await
|
|
5239
|
+
async function zs() {
|
|
5240
|
+
let { data: e, error: t } = await Rs.send();
|
|
5213
5241
|
if (t || !e) throw Error(`Failed to fetch template list: ${String(t)}`);
|
|
5214
5242
|
return e.templates;
|
|
5215
5243
|
}
|
|
5216
|
-
async function
|
|
5244
|
+
async function Bs(e) {
|
|
5217
5245
|
let { data: t, error: n, status: r } = await q.createRequest()({
|
|
5218
5246
|
endpoint: `/templates/${encodeURIComponent(e)}/manifest`,
|
|
5219
5247
|
method: "GET"
|
|
@@ -5222,7 +5250,7 @@ async function Is(e) {
|
|
|
5222
5250
|
if (n || !t) throw Error(`Failed to load manifest for template "${e}": ${String(n)}`);
|
|
5223
5251
|
return t;
|
|
5224
5252
|
}
|
|
5225
|
-
async function
|
|
5253
|
+
async function Vs(e, t = {}) {
|
|
5226
5254
|
let n = q.createRequest()({
|
|
5227
5255
|
endpoint: `/templates/${encodeURIComponent(e)}/download`,
|
|
5228
5256
|
method: "POST"
|
|
@@ -5250,9 +5278,9 @@ async function Ls(e, t = {}) {
|
|
|
5250
5278
|
}
|
|
5251
5279
|
//#endregion
|
|
5252
5280
|
//#region src/commands/template.ts
|
|
5253
|
-
async function
|
|
5281
|
+
async function Hs(t = {}) {
|
|
5254
5282
|
let n = t.cwd ?? process.cwd();
|
|
5255
|
-
|
|
5283
|
+
Ya();
|
|
5256
5284
|
let r = s.spinner();
|
|
5257
5285
|
r.start("Loading packs...");
|
|
5258
5286
|
let o;
|
|
@@ -5264,7 +5292,7 @@ async function Rs(t = {}) {
|
|
|
5264
5292
|
r.stop("Packs loaded"), r.start("Loading templates...");
|
|
5265
5293
|
let c;
|
|
5266
5294
|
try {
|
|
5267
|
-
c = await
|
|
5295
|
+
c = await zs();
|
|
5268
5296
|
} catch (e) {
|
|
5269
5297
|
r.stop("Failed to load templates"), s.cancel(`Could not reach Hype Stack. Check your connection and try again.\n${$(e)}`), process.exit(1);
|
|
5270
5298
|
}
|
|
@@ -5287,11 +5315,11 @@ async function Rs(t = {}) {
|
|
|
5287
5315
|
u || (r.stop("Template not found"), s.cancel(`Template "${l}" not found. Available: ${c.map((e) => e.id).join(", ") || "(none)"}`), process.exit(1)), r.stop(`Template: ${u.name}`);
|
|
5288
5316
|
let d;
|
|
5289
5317
|
try {
|
|
5290
|
-
d = await
|
|
5318
|
+
d = await Bs(u.id);
|
|
5291
5319
|
} catch (e) {
|
|
5292
5320
|
s.cancel($(e)), process.exit(1);
|
|
5293
5321
|
}
|
|
5294
|
-
let f = await
|
|
5322
|
+
let f = await vs(n, {}, {
|
|
5295
5323
|
defaultTheme: d.theme,
|
|
5296
5324
|
defaultMode: d.defaultMode,
|
|
5297
5325
|
radius: d.radius
|
|
@@ -5304,16 +5332,16 @@ async function Rs(t = {}) {
|
|
|
5304
5332
|
h || (s.cancel(p ? `Could not read ${L.path("stack.json")}. Run 'npx @hype-stack/cli init' to regenerate it, then run 'npx @hype-stack/cli template' again.` : `No ${L.path("stack.json")}. Run 'npx @hype-stack/cli init' first, then 'npx @hype-stack/cli template'.`), process.exit(1)), h.paths || (s.cancel(`${L.path("stack.json")} is missing ${L.path("paths")}. Run 'npx @hype-stack/cli init' again to regenerate it.`), process.exit(1));
|
|
5305
5333
|
let g = p ?? n;
|
|
5306
5334
|
s.intro(L.brandBold("Install a template"));
|
|
5307
|
-
let _ = h.installedPacks ?? [], v = new Set(_), b = new Map(o.map((e) => [e.name, e])), x = t.licenseKey ?? h.licenseKey ?? null, S = (await Xn(F()))?.token ?? null, C = await
|
|
5335
|
+
let _ = h.installedPacks ?? [], v = new Set(_), b = new Map(o.map((e) => [e.name, e])), x = t.licenseKey ?? h.licenseKey ?? null, S = (await Xn(F()))?.token ?? null, C = await Us(u, t.variants, t.yes ?? !1), w = Ia(u.slots, C), E = La(u.slots, u.packs, w), D = await Ws({
|
|
5308
5336
|
packs: o,
|
|
5309
5337
|
templatePacks: E,
|
|
5310
5338
|
installedSet: v,
|
|
5311
5339
|
options: t
|
|
5312
5340
|
}), O = [...E, ...D.filter((e) => !E.includes(e))], k = O.filter((e) => !b.has(e));
|
|
5313
5341
|
k.length > 0 && (s.cancel(`Unknown pack${k.length === 1 ? "" : "s"}: ${k.join(", ")}`), process.exit(1));
|
|
5314
|
-
let ee =
|
|
5342
|
+
let ee = Ba(o, w), A = Ma(ee), te;
|
|
5315
5343
|
try {
|
|
5316
|
-
te =
|
|
5344
|
+
te = Pa(O, A, _);
|
|
5317
5345
|
} catch (e) {
|
|
5318
5346
|
s.cancel($(e)), process.exit(1);
|
|
5319
5347
|
}
|
|
@@ -5321,13 +5349,13 @@ async function Rs(t = {}) {
|
|
|
5321
5349
|
s.outro(L.muted("Every pack in this template is already installed."));
|
|
5322
5350
|
return;
|
|
5323
5351
|
}
|
|
5324
|
-
let ne = await
|
|
5352
|
+
let ne = await Qo(ee, v, {
|
|
5325
5353
|
token: S,
|
|
5326
5354
|
key: x
|
|
5327
5355
|
}), re = (e) => {
|
|
5328
5356
|
let t = b.get(e);
|
|
5329
5357
|
return !t || t.tier === "free" ? "free" : ne[e]?.owned ? "owned" : "locked";
|
|
5330
|
-
}, j = (e) => !v.has(e) && re(e) === "locked", M =
|
|
5358
|
+
}, j = (e) => !v.has(e) && re(e) === "locked", M = Fa({
|
|
5331
5359
|
order: te.order,
|
|
5332
5360
|
graph: A,
|
|
5333
5361
|
isLocked: j,
|
|
@@ -5335,28 +5363,28 @@ async function Rs(t = {}) {
|
|
|
5335
5363
|
});
|
|
5336
5364
|
if (M.blocked.length > 0 && !S && !x) {
|
|
5337
5365
|
let e = await or();
|
|
5338
|
-
e && (S = e, ne = await
|
|
5366
|
+
e && (S = e, ne = await Qo(ee, v, {
|
|
5339
5367
|
token: S,
|
|
5340
5368
|
key: x
|
|
5341
|
-
}), M =
|
|
5369
|
+
}), M = Fa({
|
|
5342
5370
|
order: te.order,
|
|
5343
5371
|
graph: A,
|
|
5344
5372
|
isLocked: j,
|
|
5345
5373
|
installed: _
|
|
5346
5374
|
}));
|
|
5347
5375
|
}
|
|
5348
|
-
if (M.blocked.length > 0 && await
|
|
5376
|
+
if (M.blocked.length > 0 && await es(M.blocked, j, b), M.installable.length === 0) {
|
|
5349
5377
|
s.outro(L.muted("Nothing left to install once locked packs are removed."));
|
|
5350
5378
|
return;
|
|
5351
5379
|
}
|
|
5352
|
-
if (
|
|
5380
|
+
if (ts(M.installable, b), !t.yes) {
|
|
5353
5381
|
let e = await s.confirm({ message: `Install template ${L.brandBold(u.name)} (${M.installable.length} pack${M.installable.length === 1 ? "" : "s"})?` });
|
|
5354
5382
|
(s.isCancel(e) || !e) && (s.cancel("Installation cancelled."), process.exit(0));
|
|
5355
5383
|
}
|
|
5356
5384
|
r.start("Downloading packs...");
|
|
5357
5385
|
let N;
|
|
5358
5386
|
try {
|
|
5359
|
-
N = await
|
|
5387
|
+
N = await ns(M.installable, {
|
|
5360
5388
|
token: S,
|
|
5361
5389
|
key: x
|
|
5362
5390
|
});
|
|
@@ -5364,7 +5392,7 @@ async function Rs(t = {}) {
|
|
|
5364
5392
|
r.stop("Download failed"), s.cancel($(e)), process.exit(1);
|
|
5365
5393
|
}
|
|
5366
5394
|
r.stop(`Downloaded ${N.length} pack${N.length === 1 ? "" : "s"}`);
|
|
5367
|
-
let ie = await
|
|
5395
|
+
let ie = await os({
|
|
5368
5396
|
prepared: N,
|
|
5369
5397
|
config: h,
|
|
5370
5398
|
cwd: g,
|
|
@@ -5385,10 +5413,10 @@ async function Rs(t = {}) {
|
|
|
5385
5413
|
for (let e of n.errors) s.log.error(e);
|
|
5386
5414
|
s.cancel("No files were written. Fix the errors above (or pass --force for existing files) and try again."), process.exit(1);
|
|
5387
5415
|
}
|
|
5388
|
-
r.stop("Files installed"), n.installed.length > 0 && s.log.success(`${L.highlight(String(n.installed.length))} files installed`), n.skipped.length > 0 && (s.log.warning(`${n.skipped.length} files skipped (use --force to overwrite)`),
|
|
5416
|
+
r.stop("Files installed"), n.installed.length > 0 && s.log.success(`${L.highlight(String(n.installed.length))} files installed`), n.skipped.length > 0 && (s.log.warning(`${n.skipped.length} files skipped (use --force to overwrite)`), as(n.skipped));
|
|
5389
5417
|
for (let e of n.errors) s.log.error(e);
|
|
5390
5418
|
r.start("Applying template overrides...");
|
|
5391
|
-
let o = await
|
|
5419
|
+
let o = await Vs(u.id, {
|
|
5392
5420
|
token: S,
|
|
5393
5421
|
licenseKey: x
|
|
5394
5422
|
});
|
|
@@ -5403,11 +5431,11 @@ async function Rs(t = {}) {
|
|
|
5403
5431
|
for (let e of c.errors) s.log.error(e);
|
|
5404
5432
|
if (!m) {
|
|
5405
5433
|
let t = T.resolve(g, h.paths?.frontend.root ?? "apps/frontend"), n = d.theme ?? "zinc-mono";
|
|
5406
|
-
a(n) && (await
|
|
5434
|
+
a(n) && (await _o(t, i(n)) ? s.log.success(`Applied the ${i(n).label} theme`) : s.log.warning(L.muted(`Could not find ${L.path("assets/styles.css")} to apply the theme`))), d.radius !== void 0 && so(d.radius) && (await uo(t, d.radius) ? s.log.success(`Set the corner radius to ${d.radius}`) : s.log.warning(L.muted(`Could not find ${L.path("assets/styles.css")} to set the corner radius`)));
|
|
5407
5435
|
let r = d.defaultMode === "dark" || d.defaultMode === "light" ? d.defaultMode : e;
|
|
5408
|
-
await
|
|
5436
|
+
await ao(t, r) ? s.log.success(`Default color mode set to ${r}`) : s.log.warning(L.muted(`Could not find ${L.path("src/hooks/use-theme.ts")} to set the default color mode`));
|
|
5409
5437
|
}
|
|
5410
|
-
await
|
|
5438
|
+
await Gs({
|
|
5411
5439
|
prepared: N,
|
|
5412
5440
|
templateNpm: d.dependencies_npm,
|
|
5413
5441
|
paths: h.paths,
|
|
@@ -5415,13 +5443,13 @@ async function Rs(t = {}) {
|
|
|
5415
5443
|
spinner: r
|
|
5416
5444
|
});
|
|
5417
5445
|
let l;
|
|
5418
|
-
m && (l = await
|
|
5446
|
+
m && (l = await ja(g, t.yes ?? !1)), await _r({
|
|
5419
5447
|
projectRoot: g,
|
|
5420
5448
|
paths: h.paths,
|
|
5421
5449
|
skipPrompts: t.yes ?? !1,
|
|
5422
5450
|
dbReady: l,
|
|
5423
5451
|
freshScaffold: m
|
|
5424
|
-
}),
|
|
5452
|
+
}), is(), s.outro(L.brand(`Installed template ${u.name}.`));
|
|
5425
5453
|
} finally {
|
|
5426
5454
|
await Promise.all(N.map((e) => y.rm(e.packDir, {
|
|
5427
5455
|
recursive: !0,
|
|
@@ -5432,7 +5460,7 @@ async function Rs(t = {}) {
|
|
|
5432
5460
|
});
|
|
5433
5461
|
}
|
|
5434
5462
|
}
|
|
5435
|
-
async function
|
|
5463
|
+
async function Us(e, t, n) {
|
|
5436
5464
|
let r = {};
|
|
5437
5465
|
for (let i of e.slots) {
|
|
5438
5466
|
if (t?.[i.family]) {
|
|
@@ -5456,7 +5484,7 @@ async function zs(e, t, n) {
|
|
|
5456
5484
|
}
|
|
5457
5485
|
return r;
|
|
5458
5486
|
}
|
|
5459
|
-
async function
|
|
5487
|
+
async function Ws(e) {
|
|
5460
5488
|
let { packs: t, templatePacks: n, installedSet: r, options: i } = e, a = new Set(n);
|
|
5461
5489
|
if (i.packs && i.packs.length > 0) {
|
|
5462
5490
|
let e = i.packs.filter((e) => !t.some((t) => t.name === e));
|
|
@@ -5467,7 +5495,7 @@ async function Bs(e) {
|
|
|
5467
5495
|
if (o.length === 0) return [];
|
|
5468
5496
|
let c = le();
|
|
5469
5497
|
z(o.map((e) => ` ${R.arrow} ${L.highlight(e.displayName)} ${ve(`${c}/packs/${e.name}`)}`).join("\n"), "Browse packs");
|
|
5470
|
-
let l = await
|
|
5498
|
+
let l = await Qa({
|
|
5471
5499
|
message: "Add extra packs on top of the template (optional)",
|
|
5472
5500
|
options: o.map((e) => ({
|
|
5473
5501
|
value: e.name,
|
|
@@ -5478,25 +5506,25 @@ async function Bs(e) {
|
|
|
5478
5506
|
});
|
|
5479
5507
|
return m(l) && (s.cancel("Cancelled."), process.exit(0)), l;
|
|
5480
5508
|
}
|
|
5481
|
-
async function
|
|
5482
|
-
let { prepared: t, templateNpm: n, paths: r, cwd: i, spinner: a } = e, o =
|
|
5509
|
+
async function Gs(e) {
|
|
5510
|
+
let { prepared: t, templateNpm: n, paths: r, cwd: i, spinner: a } = e, o = Xo(t.map((e) => e.manifest.dependencies_npm)), c = Yo(n ? Xo([o, n]) : o, r);
|
|
5483
5511
|
if (c.errors.length > 0) {
|
|
5484
5512
|
for (let e of c.errors) s.log.error(e);
|
|
5485
5513
|
return;
|
|
5486
5514
|
}
|
|
5487
5515
|
if (c.operations.length === 0) return;
|
|
5488
5516
|
a.start("Installing npm dependencies...");
|
|
5489
|
-
let l = await
|
|
5517
|
+
let l = await Zo(c.operations, i);
|
|
5490
5518
|
if (a.stop(l.ok ? "npm dependencies installed" : "npm dependency installation failed"), !l.ok) for (let e of l.errors) s.log.error(e);
|
|
5491
5519
|
}
|
|
5492
5520
|
//#endregion
|
|
5493
5521
|
//#region src/cli.ts
|
|
5494
|
-
function
|
|
5522
|
+
function Ks(e) {
|
|
5495
5523
|
if (!e) return;
|
|
5496
5524
|
let t = e.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
|
|
5497
5525
|
return t.length > 0 ? t : void 0;
|
|
5498
5526
|
}
|
|
5499
|
-
function
|
|
5527
|
+
function qs(e) {
|
|
5500
5528
|
if (!e) return;
|
|
5501
5529
|
let t = {};
|
|
5502
5530
|
for (let n of e.split(",")) {
|
|
@@ -5505,10 +5533,10 @@ function Us(e) {
|
|
|
5505
5533
|
}
|
|
5506
5534
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
5507
5535
|
}
|
|
5508
|
-
function
|
|
5536
|
+
function Js() {
|
|
5509
5537
|
let e = new o();
|
|
5510
5538
|
return e.name("hype-stack").description("Build with Hype Stack -- templates, components, modules, and more").version(A, "-v, --version"), e.command("create").description("Create a new Hype Stack project").option("-n, --name <name>", "Project name").option("-d, --directory <path>", "Target directory").option("-e, --editor <editor>", "Code editor (cursor, claude, windsurf, copilot)").option("-t, --theme <theme>", "Color theme (default, slate, rose, emerald, violet, amber, ocean, zinc-mono, crimson, midnight)").option("--no-install", "Skip dependency installation").option("--no-setup", "Skip Docker services and database migrations after create").option("-y, --yes", "Skip confirmation prompts (requires --name)").action(async (e) => {
|
|
5511
|
-
await
|
|
5539
|
+
await gs({
|
|
5512
5540
|
name: e.name,
|
|
5513
5541
|
directory: e.directory,
|
|
5514
5542
|
install: e.install,
|
|
@@ -5518,38 +5546,38 @@ function Ws() {
|
|
|
5518
5546
|
setup: e.setup
|
|
5519
5547
|
});
|
|
5520
5548
|
}), e.command("init").description("Initialize stack.json in the current project").action(async () => {
|
|
5521
|
-
await
|
|
5549
|
+
await _s({});
|
|
5522
5550
|
}), e.command("onboard").description("Set up env vars, run migrations, and get the start command").option("-y, --yes", "Skip prompts, accept defaults").option("--skip-migrations", "Skip Docker services and database migrations").option("--cwd <path>", "Working directory").action(async (e) => {
|
|
5523
|
-
await
|
|
5551
|
+
await Ns({
|
|
5524
5552
|
cwd: e.cwd,
|
|
5525
5553
|
yes: e.yes,
|
|
5526
5554
|
skipMigrations: e.skipMigrations
|
|
5527
5555
|
});
|
|
5528
5556
|
}), e.command("compose").description("Choose feature packs to add to your project").option("--packs <list>", "Comma-separated pack names (non-interactive). Append @frontend or @admin to a layout pack to target that app shell, e.g. layout-basic@frontend,layout-native-app-shell@admin").option("--force", "Overwrite existing files").option("-y, --yes", "Skip confirmation prompts").option("-k, --key <key>", "License key").option("--license-key <key>", "License key (alias for --key)").option("--cwd <path>", "Working directory").action(async (e) => {
|
|
5529
|
-
await
|
|
5530
|
-
packs:
|
|
5557
|
+
await ys({
|
|
5558
|
+
packs: Ks(e.packs),
|
|
5531
5559
|
force: e.force,
|
|
5532
5560
|
yes: e.yes,
|
|
5533
5561
|
licenseKey: e.key ?? e.licenseKey,
|
|
5534
5562
|
cwd: e.cwd
|
|
5535
5563
|
});
|
|
5536
5564
|
}), e.command("template").description("Install a template by id, with starter/layout variant swaps and extra packs on top").argument("[id]", "Template id (omit to pick interactively)").option("--variants <map>", "Preselect slot variants, e.g. starter-saas=starter-saas-better-auth,layout=layout-basic").option("--packs <list>", "Extra packs to add on top of the template (comma-separated)").option("--force", "Overwrite existing files").option("-y, --yes", "Skip confirmation prompts (requires <id>)").option("-k, --key <key>", "License key").option("--license-key <key>", "License key (alias for --key)").option("--cwd <path>", "Working directory").action(async (e, t) => {
|
|
5537
|
-
await
|
|
5565
|
+
await Hs({
|
|
5538
5566
|
templateId: e,
|
|
5539
|
-
variants:
|
|
5540
|
-
packs:
|
|
5567
|
+
variants: qs(t.variants),
|
|
5568
|
+
packs: Ks(t.packs),
|
|
5541
5569
|
force: t.force,
|
|
5542
5570
|
yes: t.yes,
|
|
5543
5571
|
licenseKey: t.key ?? t.licenseKey,
|
|
5544
5572
|
cwd: t.cwd
|
|
5545
5573
|
});
|
|
5546
5574
|
}), e.command("login").description("Log in via your browser to install packs your organization owns").action(async () => {
|
|
5547
|
-
await
|
|
5575
|
+
await Ts();
|
|
5548
5576
|
}), e.command("logout").description("Log out and remove the saved CLI token").action(async () => {
|
|
5549
|
-
await
|
|
5577
|
+
await Es();
|
|
5550
5578
|
}), e.command("auth").description("Alias for `login`").action(async () => {
|
|
5551
|
-
await
|
|
5579
|
+
await Ts();
|
|
5552
5580
|
}), e;
|
|
5553
5581
|
}
|
|
5554
5582
|
//#endregion
|
|
5555
|
-
export {
|
|
5583
|
+
export { vs as a, ys as i, Es as n, _s as o, Ts as r, gs as s, Js as t };
|