Skip to content

Commit 99b0936

Browse files
fix(cli): add missing getting started instructions to README (#793)
* docs: add missing getting started instructions to README * docs: port README improvements to template-generator - Improve Convex + Clerk setup instructions with better formatting - Add environment variable copy instructions - Add Git Hooks and Formatting section to README - Simplify deployment command labels (remove Web/Server prefix) - Remove old create-readme.ts file (logic moved to template-generator) * fix: correct Convex env vars instruction placement The environment variable copy instruction should appear for ALL Convex projects, not just those with Clerk auth. Moved it outside the Clerk conditional block. --------- Co-authored-by: Aman Varshney <amanvarshney.work@gmail.com>
1 parent 9595109 commit 99b0936

File tree

2 files changed

+46
-13
lines changed

2 files changed

+46
-13
lines changed

bun.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/template-generator/src/processors/readme-generator.ts

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,19 @@ This project uses Convex as a backend. You'll need to set up Convex before runni
6363
${packageManagerRunCmd} dev:setup
6464
\`\`\`
6565
66-
Follow the prompts to create a new Convex project and connect it to your application.${
67-
auth === "clerk"
68-
? " See [Convex + Clerk guide](https://docs.convex.dev/auth/clerk) for auth setup."
69-
: ""
70-
}`
66+
Follow the prompts to create a new Convex project and connect it to your application.
67+
68+
Copy environment variables from \`packages/backend/.env.local\` to \`apps/*/.env\`.
69+
${
70+
auth === "clerk"
71+
? `
72+
### Clerk Authentication Setup
73+
74+
- Follow the guide: [Convex + Clerk](https://docs.convex.dev/auth/clerk)
75+
- Set \`CLERK_JWT_ISSUER_DOMAIN\` in Convex Dashboard
76+
- Set \`CLERK_PUBLISHABLE_KEY\` in \`apps/*/.env\``
77+
: ""
78+
}`
7179
: generateDatabaseSetup(database, packageManagerRunCmd, orm, dbSetup, backend)
7280
}
7381
@@ -84,6 +92,7 @@ ${
8492
: ""
8593
}
8694
${generateDeploymentCommands(packageManagerRunCmd, webDeploy, serverDeploy)}
95+
${generateGitHooksSection(packageManagerRunCmd, addons)}
8796
8897
## Project Structure
8998
@@ -492,17 +501,17 @@ function generateDeploymentCommands(
492501

493502
if (webDeploy === "cloudflare" && serverDeploy !== "cloudflare") {
494503
lines.push(
495-
`- Web dev: cd apps/web && ${packageManagerRunCmd} dev`,
496-
`- Web deploy: cd apps/web && ${packageManagerRunCmd} deploy`,
497-
`- Web destroy: cd apps/web && ${packageManagerRunCmd} destroy`,
504+
`- Dev: cd apps/web && ${packageManagerRunCmd} alchemy dev`,
505+
`- Deploy: cd apps/web && ${packageManagerRunCmd} deploy`,
506+
`- Destroy: cd apps/web && ${packageManagerRunCmd} destroy`,
498507
);
499508
}
500509

501510
if (serverDeploy === "cloudflare" && webDeploy !== "cloudflare") {
502511
lines.push(
503-
`- Server dev: cd apps/server && ${packageManagerRunCmd} dev`,
504-
`- Server deploy: cd apps/server && ${packageManagerRunCmd} deploy`,
505-
`- Server destroy: cd apps/server && ${packageManagerRunCmd} destroy`,
512+
`- Dev: cd apps/server && ${packageManagerRunCmd} dev`,
513+
`- Deploy: cd apps/server && ${packageManagerRunCmd} deploy`,
514+
`- Destroy: cd apps/server && ${packageManagerRunCmd} destroy`,
506515
);
507516
}
508517

@@ -521,3 +530,27 @@ function generateDeploymentCommands(
521530

522531
return `${lines.join("\n")}\n`;
523532
}
533+
534+
function generateGitHooksSection(
535+
packageManagerRunCmd: string,
536+
addons: ProjectConfig["addons"],
537+
): string {
538+
const hasHusky = addons.includes("husky");
539+
const hasLinting = addons.includes("biome") || addons.includes("oxlint");
540+
541+
if (!hasHusky && !hasLinting) {
542+
return "";
543+
}
544+
545+
const lines: string[] = ["## Git Hooks and Formatting", ""];
546+
547+
if (hasHusky) {
548+
lines.push(`- Initialize hooks: \`${packageManagerRunCmd} prepare\``);
549+
}
550+
551+
if (hasLinting) {
552+
lines.push(`- Format and lint fix: \`${packageManagerRunCmd} check\``);
553+
}
554+
555+
return `${lines.join("\n")}\n\n`;
556+
}

0 commit comments

Comments
 (0)