create-githat-app 1.0.16 → 1.0.17
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.js +24 -20
- package/package.json +1 -1
- package/templates/base/.env.local.hbs +11 -0
- package/templates/base/.gitignore.hbs +17 -2
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ import gradient from "gradient-string";
|
|
|
11
11
|
import chalk from "chalk";
|
|
12
12
|
|
|
13
13
|
// src/constants.ts
|
|
14
|
-
var VERSION = "1.0.
|
|
14
|
+
var VERSION = "1.0.17";
|
|
15
15
|
var DEFAULT_API_URL = "https://api.githat.io";
|
|
16
16
|
var DASHBOARD_URL = "https://githat.io/dashboard/apps";
|
|
17
17
|
var BRAND_COLORS = ["#7c3aed", "#6366f1", "#8b5cf6"];
|
|
@@ -167,6 +167,16 @@ function sectionHeader(title) {
|
|
|
167
167
|
console.log(dim(` \u2500\u2500\u2500 ${title} ${"\u2500".repeat(lineLen)}`));
|
|
168
168
|
console.log("");
|
|
169
169
|
}
|
|
170
|
+
function keyNextSteps() {
|
|
171
|
+
return [
|
|
172
|
+
chalk.bold("Next:") + " add your GitHat key",
|
|
173
|
+
` 1. Open ${violet(".env.local")}`,
|
|
174
|
+
` 2. Paste your key from ${violet("https://githat.io/dashboard/apps")}`,
|
|
175
|
+
` 3. Run ${violet("npm run dev")} again`,
|
|
176
|
+
dim(" (.env.local is gitignored \u2014 your key never gets committed.)"),
|
|
177
|
+
""
|
|
178
|
+
];
|
|
179
|
+
}
|
|
170
180
|
function displaySuccess(projectName, packageManager, framework, hasPublishableKey = true, isFullstack = false) {
|
|
171
181
|
const devCmd = packageManager === "npm" ? "npm run dev" : `${packageManager} dev`;
|
|
172
182
|
const port = framework === "react-vite" ? "5173" : "3000";
|
|
@@ -186,11 +196,7 @@ function displaySuccess(projectName, packageManager, framework, hasPublishableKe
|
|
|
186
196
|
`${violet("apps/api")} API backend`,
|
|
187
197
|
`${violet("packages/")} Shared code`,
|
|
188
198
|
"",
|
|
189
|
-
...hasPublishableKey ? [] :
|
|
190
|
-
chalk.yellow("No key configured \u2014 auth works on localhost."),
|
|
191
|
-
`For production: ${violet("githat.io/dashboard/apps")}`,
|
|
192
|
-
""
|
|
193
|
-
],
|
|
199
|
+
...hasPublishableKey ? [] : keyNextSteps(),
|
|
194
200
|
dim("Docs \u2192 https://githat.io/docs/sdk")
|
|
195
201
|
]);
|
|
196
202
|
} else {
|
|
@@ -207,11 +213,7 @@ function displaySuccess(projectName, packageManager, framework, hasPublishableKe
|
|
|
207
213
|
`${violet("/sign-up")} Create account`,
|
|
208
214
|
`${violet("/dashboard")} Protected dashboard`,
|
|
209
215
|
"",
|
|
210
|
-
...hasPublishableKey ? [] :
|
|
211
|
-
chalk.yellow("No key configured \u2014 auth works on localhost."),
|
|
212
|
-
`For production: ${violet("githat.io/dashboard/apps")}`,
|
|
213
|
-
""
|
|
214
|
-
],
|
|
216
|
+
...hasPublishableKey ? [] : keyNextSteps(),
|
|
215
217
|
dim("Docs \u2192 https://githat.io/docs/sdk")
|
|
216
218
|
]);
|
|
217
219
|
}
|
|
@@ -1640,23 +1642,25 @@ skillsCommand.action(() => {
|
|
|
1640
1642
|
// src/cli.ts
|
|
1641
1643
|
var program = new Command7();
|
|
1642
1644
|
program.name("githat").description("GitHat CLI - Scaffold apps and manage skills").version(VERSION);
|
|
1643
|
-
program.command("create [project-name]", { isDefault: true }).description("Scaffold a new GitHat app").option("--key <key>", "
|
|
1645
|
+
program.command("create [project-name]", { isDefault: true }).description("Scaffold a new GitHat app").option("--key <key>", "CI only: bake key into .env.local. Default flow is paste into .env.local after scaffold.").option("--ts", "Use TypeScript (default)").option("--js", "Use JavaScript").option("--plain", "Smallest scaffold: auth + a homepage. No dashboard.").option("--saas", "B2B starter: orgs, teams, RBAC, subscription billing.").option("--marketplace", "Multi-vendor commerce: anonymous-first browsing, Sebastn Connect.").option("--agent", "Web4 wallet-bound autonomous agent + MCP server registration.").option("--content", "Paywalled posts, newsletter, one-time purchases via Sebastn.").option("--dashboard", "Admin UI over your existing database, auth-gated.").option("--portfolio", "Personal portfolio: public projects, auth-gated editor.").option("--classroom", "Live student presentations with real-time audience feedback.").option("--fullstack", "Create fullstack project (Turborepo)").option("--backend <framework>", "Backend framework (hono, express, fastify)").option("-y, --yes", "Skip prompts and use defaults").action(async (projectName, opts) => {
|
|
1644
1646
|
try {
|
|
1645
1647
|
displayBanner();
|
|
1646
1648
|
if (!opts.yes && !opts.key) {
|
|
1647
1649
|
p12.note(
|
|
1648
1650
|
[
|
|
1649
|
-
chalk10.bold("
|
|
1651
|
+
chalk10.bold("How the GitHat key flow works:"),
|
|
1652
|
+
"",
|
|
1653
|
+
` ${chalk10.cyan("1.")} We'll scaffold your project with a placeholder`,
|
|
1654
|
+
` in ${chalk10.bold(".env.local")} (gitignored \u2014 safe to keep secrets here)`,
|
|
1650
1655
|
"",
|
|
1651
|
-
` ${chalk10.cyan("
|
|
1652
|
-
`
|
|
1653
|
-
` Get the key at ${chalk10.cyan("https://githat.io/dashboard/apps")}`,
|
|
1656
|
+
` ${chalk10.cyan("2.")} You open ${chalk10.cyan("https://githat.io/dashboard/apps")}`,
|
|
1657
|
+
` and copy your publishable key`,
|
|
1654
1658
|
"",
|
|
1655
|
-
` ${chalk10.cyan("
|
|
1656
|
-
`
|
|
1657
|
-
` and the key is stitched in for you.`,
|
|
1659
|
+
` ${chalk10.cyan("3.")} You paste it into ${chalk10.bold(".env.local")} and run`,
|
|
1660
|
+
` ${chalk10.dim("npm run dev")}`,
|
|
1658
1661
|
"",
|
|
1659
|
-
chalk10.dim("
|
|
1662
|
+
chalk10.dim("Why not pass the key on the command line? Shell"),
|
|
1663
|
+
chalk10.dim("history is forever. .env.local is more secure.")
|
|
1660
1664
|
].join("\n"),
|
|
1661
1665
|
"First time with GitHat?"
|
|
1662
1666
|
);
|
package/package.json
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
{{#ifNext framework}}
|
|
2
|
+
# ─── GitHat publishable key ──────────────────────────────────────────────
|
|
3
|
+
# Paste your key from https://githat.io/dashboard/apps below.
|
|
4
|
+
# This file is gitignored — your key never gets committed by accident.
|
|
5
|
+
# (Don't put real keys on the command line. Shell history is forever.)
|
|
2
6
|
NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY={{publishableKey}}
|
|
3
7
|
NEXT_PUBLIC_GITHAT_API_URL={{apiUrl}}
|
|
4
8
|
{{else}}
|
|
9
|
+
# ─── GitHat publishable key ──────────────────────────────────────────────
|
|
10
|
+
# Paste your key from https://githat.io/dashboard/apps below.
|
|
11
|
+
# This file is gitignored — your key never gets committed by accident.
|
|
12
|
+
# (Don't put real keys on the command line. Shell history is forever.)
|
|
5
13
|
VITE_GITHAT_PUBLISHABLE_KEY={{publishableKey}}
|
|
6
14
|
VITE_GITHAT_API_URL={{apiUrl}}
|
|
7
15
|
{{/ifNext}}
|
|
8
16
|
{{#if useDatabase}}
|
|
17
|
+
|
|
18
|
+
# ─── Database ────────────────────────────────────────────────────────────
|
|
19
|
+
# Replace with your real connection string.
|
|
9
20
|
DATABASE_URL="postgresql://user:password@localhost:5432/{{projectName}}"
|
|
10
21
|
{{/if}}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
node_modules
|
|
2
|
-
{{#
|
|
2
|
+
{{#ifNext framework}}
|
|
3
3
|
.next
|
|
4
4
|
out
|
|
5
5
|
{{else}}
|
|
6
6
|
dist
|
|
7
|
-
{{/
|
|
7
|
+
{{/ifNext}}
|
|
8
|
+
|
|
9
|
+
# Environment files — NEVER commit these. Real keys live here.
|
|
10
|
+
# `.env.local`, `.env.development.local`, `.env.production.local`,
|
|
11
|
+
# and any per-package `.env*.local` are matched by the patterns below.
|
|
8
12
|
.env
|
|
13
|
+
.env.local
|
|
9
14
|
.env*.local
|
|
15
|
+
.env.*.local
|
|
16
|
+
|
|
17
|
+
# OS / editor
|
|
10
18
|
.DS_Store
|
|
11
19
|
*.tgz
|
|
20
|
+
.idea/
|
|
21
|
+
.vscode/
|
|
22
|
+
|
|
23
|
+
# Logs / coverage
|
|
24
|
+
*.log
|
|
25
|
+
.turbo/
|
|
26
|
+
coverage/
|