Skip to content

Commit

Permalink
feat: replace lefthook by hk
Browse files Browse the repository at this point in the history
  • Loading branch information
sripwoud committed Feb 18, 2025
1 parent 6351561 commit 3114573
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 30 deletions.
13 changes: 0 additions & 13 deletions .lefthook.yml

This file was deleted.

32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

![main GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/sripwoud/web-app-template/main.yml?branch=main&label=main)

| Feature | With | Configuration File |
| ---------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Build tool | [vite](https://vite.dev/) | [vite.config.ts](./web/vite.config.ts) |
| Routing | [@tanstack/react-router](https://tanstack.com/router/latest) | |
| Form | [@tanstack/react-form](https://tanstack.com/form/latest) | |
| State management | [jotai](https://jotai.org/) | |
| Css | [tailwind](https://tailwindcss.com/) | |
| Runtime, tests runner | [bun](https://bun.sh) | [bunfig.toml](./bunfig.toml) |
| Tasks runner, environment & runtime management | [mise](https://mise.dev/) | [mise.toml](./mise.toml) |
| Typings | [typescript](https://www.typescriptlang.org/) | [tsconfig.json](./tsconfig.json) |
| Formatting | [dprint](https://dprint.dev/) | [.dprint.jsonc](./.biome.json) |
| Linting | [biome](https://biomejs.dev/) | [.biome.jsonc](./.biome.jsonc) |
| Continuous Integration | [github workflow](https://docs.github.com/en/actions/using-workflows) | [.github/workflows](./.github/workflows) |
| Import aliases | [typescript paths](https://www.typescriptlang.org/tsconfig#paths) | [tsconfig.json](https://github.com/r1oga/ts-template/blob/5d6983a6d28429b9dd256edf40bad5ee48c33d9c/tsconfig.json#L26) |
| Git hooks management | [lefthook](https://github.com/evilmartians/lefthook/) | [.lefthook.yml](./.lefthook.yml) |
| Conventional Commits | [convco](https://github.com/convco/convco) | [.convco](./.convco) |
| Feature | With | Configuration File |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Build | [vite](https://vite.dev/) | [vite.config.ts](./web/vite.config.ts) |
| Css | [tailwind](https://tailwindcss.com/) | |
| Continuous Integration | [github workflow](https://docs.github.com/en/actions/using-workflows) | [.github/workflows](./.github/workflows) |
| Conventional Commits | [convco](https://github.com/convco/convco) | [.convco](./.convco) |
| Git Hooks | [hk](https://hk.jdx.dev/) | [hk.pkl](./hk.pkl) |
| Formatting | [dprint](https://dprint.dev/) | [.dprint.jsonc](./.biome.json) |
| Form | [@tanstack/react-form](https://tanstack.com/form/latest) | |
| Import Aliases | [typescript paths](https://www.typescriptlang.org/tsconfig#paths), [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) | [tsconfig.json](./web/tsconfig.json), [tsconfig.app.json](./web/tsconfig.app.json), [vite.config.ts](./web/vite.config.ts) |
| Linting | [biome](https://biomejs.dev/) | [.biome.jsonc](./.biome.jsonc) |
| Routing | [@tanstack/react-router](https://tanstack.com/router/latest) | [router.ts](./web/src/lib/router.ts) |
| Runtime, tests runner | [bun](https://bun.sh) | [bunfig.toml](./bunfig.toml) |
| State | [jotai](https://jotai.org/) | |
| Tasks Runner, Environment & Runtime Management | [mise](https://mise.dev/) | [mise.toml](./mise.toml) |
| Typings | [typescript](https://www.typescriptlang.org/) | [tsconfig.json](./tsconfig.json) |

## Develop

Expand Down
17 changes: 17 additions & 0 deletions hk.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
amends "https://hk.jdx.dev/v0/hk.pkl"
// import "https://hk.jdx.dev/v0/builtins/prettier.pkl"

min_hk_version = "0.2.3"

`pre-commit` {
["format"] {
fix_all = "bun dprint fmt"
}
["lint"] {
check = "bun biome lint --config-path=.biome.jsonc --no-errors-on-unmatched {{files}}"
}

["typecheck"] {
check_all = "bun tsc-files web/src/**/*.{ts,tsx} --noEmit -p web/tsconfig.json -p web/tsconfig.app.json -p web/tsconfig.node.json"
}
}
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ quiet = true
[tools]
bun = "latest"
"cargo:convco" = "latest"
hk = "latest"
lefthook = "latest"
pkl = "latest"
2 changes: 1 addition & 1 deletion setup
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ main() {
maybe_install_mise
mise install
integrate_convco_with_git
lefthook install >/dev/null && log "✅ Configured git hooks"
hk install >/dev/null && log "✅ Configured git hooks"
}

main

0 comments on commit 3114573

Please sign in to comment.