Repository navigation
feat: Add lefthook to addons #711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a76e423
0356aa6
9630225
25de9d6
a255b0f
2d8916f
8a2e864
74ef0e5
a38915d
6fc2f40
f5ebc14
d48afc9
2c6c649
4e53c72
6015238
8b87414
5000e14
3877c38
fb8c776
11aaae9
246ea17
69e4c7c
2461e98
561b4ff
357ba6a
475d87d
b9fce67
5ffb73a
286dc2d
cb9a1b2
b7d335a
d68c268
b7f886e
e7199f9
700ad84
b22990e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,12 @@ export async function displayPostInstallInstructions( | |
| packageManager === "npm" ? "npm run" : packageManager === "pnpm" ? "pnpm run" : "bun run"; | ||
| const cdCmd = `cd ${relativePath}`; | ||
| const hasHusky = addons?.includes("husky"); | ||
| const hasLinting = addons?.includes("biome") || addons?.includes("oxlint"); | ||
| const hasLefthook = addons?.includes("lefthook"); | ||
| const hasGitHooksOrLinting = | ||
| addons?.includes("husky") || | ||
| addons?.includes("biome") || | ||
| addons?.includes("lefthook") || | ||
| addons?.includes("oxlint"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instructions reference non-existent check scriptMedium Severity The Additional Locations (1) |
||
|
|
||
| const databaseInstructions = | ||
| !isConvex && database !== "none" | ||
|
|
@@ -56,7 +61,8 @@ export async function displayPostInstallInstructions( | |
|
|
||
| const tauriInstructions = addons?.includes("tauri") ? getTauriInstructions(runCmd) : ""; | ||
| const huskyInstructions = hasHusky ? getHuskyInstructions(runCmd) : ""; | ||
| const lintingInstructions = hasLinting ? getLintingInstructions(runCmd) : ""; | ||
| const lefthookInstructions = hasLefthook ? getLefthookInstructions(packageManager) : ""; | ||
| const lintingInstructions = hasGitHooksOrLinting ? getLintingInstructions(runCmd) : ""; | ||
|
AmanVarshney01 marked this conversation as resolved.
Resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Linting instructions shown when no linter is configuredMedium Severity The variable |
||
| const nativeInstructions = | ||
| (frontend?.includes("native-bare") || | ||
| frontend?.includes("native-uniwind") || | ||
|
|
@@ -184,6 +190,7 @@ export async function displayPostInstallInstructions( | |
| if (databaseInstructions) output += `\n${databaseInstructions.trim()}\n`; | ||
| if (tauriInstructions) output += `\n${tauriInstructions.trim()}\n`; | ||
| if (huskyInstructions) output += `\n${huskyInstructions.trim()}\n`; | ||
| if (lefthookInstructions) output += `\n${lefthookInstructions.trim()}\n`; | ||
| if (lintingInstructions) output += `\n${lintingInstructions.trim()}\n`; | ||
| if (pwaInstructions) output += `\n${pwaInstructions.trim()}\n`; | ||
| if (alchemyDeployInstructions) output += `\n${alchemyDeployInstructions.trim()}\n`; | ||
|
|
@@ -250,6 +257,13 @@ function getLintingInstructions(runCmd: string) { | |
| )} Format and lint fix: ${`${runCmd} check`}\n`; | ||
| } | ||
|
|
||
| function getLefthookInstructions(packageManager: string) { | ||
| const cmd = packageManager === "npm" ? "npx" : packageManager; | ||
| return `${pc.bold("Git hooks with Lefthook:")}\n${pc.cyan( | ||
| "•", | ||
| )} Install hooks: ${cmd} lefthook install\n`; | ||
| } | ||
|
AmanVarshney01 marked this conversation as resolved.
Resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect package manager commands for lefthook installationMedium Severity The |
||
|
|
||
| async function getDatabaseInstructions( | ||
| database: Database, | ||
| orm: ORM, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lefthook missing prepare script for automatic hook installation
Medium Severity
The
setupLefthookfunction only adds the lefthook dependency but doesn't add apreparescript to package.json. In contrast,setupHuskyaddsprepare: "husky"which ensures hooks are installed automatically when users runnpm install. Without this, lefthook users must manually runlefthook installevery time they clone the repo. The PR description claims apreparescript withlefthook installis added to the template, but the implementation is missing this functionality.