create-whop-kit 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-create.js +36 -39
- package/package.json +1 -1
package/dist/cli-create.js
CHANGED
|
@@ -17,38 +17,62 @@ import pc5 from "picocolors";
|
|
|
17
17
|
import { defineCommand } from "citty";
|
|
18
18
|
|
|
19
19
|
// src/templates.ts
|
|
20
|
-
var
|
|
20
|
+
var FRAMEWORKS = {
|
|
21
21
|
nextjs: {
|
|
22
22
|
name: "Next.js",
|
|
23
23
|
description: "Full-stack React with App Router, SSR, and API routes",
|
|
24
|
-
repo: "colinmcdermott/whop-saas-starter-v2",
|
|
25
24
|
available: true
|
|
26
25
|
},
|
|
27
26
|
astro: {
|
|
28
27
|
name: "Astro",
|
|
29
28
|
description: "Content-focused with islands architecture",
|
|
30
|
-
repo: "colinmcdermott/whop-astro-starter",
|
|
31
29
|
available: true
|
|
32
30
|
},
|
|
33
31
|
tanstack: {
|
|
34
32
|
name: "TanStack Start",
|
|
35
33
|
description: "Full-stack React with TanStack Router",
|
|
36
|
-
repo: "",
|
|
37
34
|
available: false
|
|
38
35
|
},
|
|
39
36
|
vite: {
|
|
40
37
|
name: "Vite + React",
|
|
41
38
|
description: "Lightweight SPA with Vite bundler",
|
|
42
|
-
repo: "",
|
|
43
39
|
available: false
|
|
44
40
|
}
|
|
45
41
|
};
|
|
42
|
+
var TEMPLATES = {
|
|
43
|
+
"saas:nextjs": {
|
|
44
|
+
name: "Next.js SaaS",
|
|
45
|
+
description: "Full SaaS with dashboard, pricing, billing, and docs",
|
|
46
|
+
repo: "colinmcdermott/whop-saas-starter-v2",
|
|
47
|
+
available: true
|
|
48
|
+
},
|
|
49
|
+
"saas:astro": {
|
|
50
|
+
name: "Astro SaaS",
|
|
51
|
+
description: "SaaS with auth, payments, and webhooks",
|
|
52
|
+
repo: "colinmcdermott/whop-astro-starter",
|
|
53
|
+
available: true
|
|
54
|
+
},
|
|
55
|
+
"blank:nextjs": {
|
|
56
|
+
name: "Next.js Blank",
|
|
57
|
+
description: "Just auth + webhooks \u2014 build anything",
|
|
58
|
+
repo: "colinmcdermott/whop-blank-starter",
|
|
59
|
+
available: true
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function getTemplate(appType, framework) {
|
|
63
|
+
return TEMPLATES[`${appType}:${framework}`] ?? null;
|
|
64
|
+
}
|
|
46
65
|
var APP_TYPES = {
|
|
47
66
|
saas: {
|
|
48
67
|
name: "SaaS",
|
|
49
68
|
description: "Subscription tiers, dashboard, billing portal",
|
|
50
69
|
available: true
|
|
51
70
|
},
|
|
71
|
+
blank: {
|
|
72
|
+
name: "Blank",
|
|
73
|
+
description: "Just auth + payments, you build the rest",
|
|
74
|
+
available: true
|
|
75
|
+
},
|
|
52
76
|
course: {
|
|
53
77
|
name: "Course",
|
|
54
78
|
description: "Lessons, progress tracking, drip content",
|
|
@@ -58,33 +82,6 @@ var APP_TYPES = {
|
|
|
58
82
|
name: "Community",
|
|
59
83
|
description: "Member feeds, gated content, roles",
|
|
60
84
|
available: false
|
|
61
|
-
},
|
|
62
|
-
blank: {
|
|
63
|
-
name: "Blank",
|
|
64
|
-
description: "Just auth + payments, you build the rest",
|
|
65
|
-
available: false
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var DB_OPTIONS = {
|
|
69
|
-
neon: {
|
|
70
|
-
name: "Neon",
|
|
71
|
-
description: "Serverless Postgres (recommended)",
|
|
72
|
-
envVarHint: "postgresql://user:pass@ep-xxx.us-east-2.aws.neon.tech/dbname?sslmode=require"
|
|
73
|
-
},
|
|
74
|
-
supabase: {
|
|
75
|
-
name: "Supabase",
|
|
76
|
-
description: "Open-source Firebase alternative",
|
|
77
|
-
envVarHint: "postgresql://postgres.xxx:pass@aws-0-us-east-1.pooler.supabase.com:6543/postgres"
|
|
78
|
-
},
|
|
79
|
-
local: {
|
|
80
|
-
name: "Local PostgreSQL",
|
|
81
|
-
description: "Your own Postgres instance",
|
|
82
|
-
envVarHint: "postgresql://postgres:postgres@localhost:5432/myapp"
|
|
83
|
-
},
|
|
84
|
-
later: {
|
|
85
|
-
name: "Configure later",
|
|
86
|
-
description: "Skip database setup for now",
|
|
87
|
-
envVarHint: ""
|
|
88
85
|
}
|
|
89
86
|
};
|
|
90
87
|
|
|
@@ -546,11 +543,11 @@ var init_default = defineCommand({
|
|
|
546
543
|
if (!framework) {
|
|
547
544
|
const result = await p5.select({
|
|
548
545
|
message: "Which framework?",
|
|
549
|
-
options: Object.entries(
|
|
546
|
+
options: Object.entries(FRAMEWORKS).map(([value, f]) => ({
|
|
550
547
|
value,
|
|
551
|
-
label:
|
|
552
|
-
hint:
|
|
553
|
-
disabled: !
|
|
548
|
+
label: f.available ? f.name : `${f.name} ${pc5.dim("(coming soon)")}`,
|
|
549
|
+
hint: f.description,
|
|
550
|
+
disabled: !f.available
|
|
554
551
|
}))
|
|
555
552
|
});
|
|
556
553
|
if (isCancelled(result)) {
|
|
@@ -559,9 +556,9 @@ var init_default = defineCommand({
|
|
|
559
556
|
}
|
|
560
557
|
framework = result;
|
|
561
558
|
}
|
|
562
|
-
const template =
|
|
559
|
+
const template = getTemplate(appType, framework);
|
|
563
560
|
if (!template || !template.available) {
|
|
564
|
-
p5.log.error(`
|
|
561
|
+
p5.log.error(`No template available for ${appType} + ${framework}. Try a different combination.`);
|
|
565
562
|
process.exit(1);
|
|
566
563
|
}
|
|
567
564
|
let database = args.db;
|
|
@@ -667,7 +664,7 @@ var init_default = defineCommand({
|
|
|
667
664
|
console.log(` ${pc5.bold("Project:")} ${projectName}`);
|
|
668
665
|
console.log(` ${pc5.bold("Framework:")} ${template.name}`);
|
|
669
666
|
console.log(` ${pc5.bold("App type:")} ${APP_TYPES[appType]?.name ?? appType}`);
|
|
670
|
-
console.log(` ${pc5.bold("Database:")} ${
|
|
667
|
+
console.log(` ${pc5.bold("Database:")} ${database}`);
|
|
671
668
|
console.log(` ${pc5.bold("Template:")} github.com/${template.repo}`);
|
|
672
669
|
if (dbUrl) console.log(` ${pc5.bold("DB URL:")} ${dbUrl.substring(0, 30)}...`);
|
|
673
670
|
if (appId) console.log(` ${pc5.bold("Whop App:")} ${appId}`);
|