Skip to content

Commit 911c4ec

Browse files
authored
Merge pull request #16 from phishy/build/conventional-commits
build: sets up conventional commits
2 parents d7ebb84 + 384b5c6 commit 911c4ec

6 files changed

Lines changed: 1727 additions & 12 deletions

File tree

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npm run web:build

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ Affero
225225

226226
Contributions welcome! This is an open-source project.
227227

228+
### 🧾 Conventional Commits & Workflow
229+
230+
- Run `npm run commit` (Commitizen) to get a guided prompt for the conventional commit message (`type(scope): subject`). Keep scopes aligned with top-level folders (e.g., `types`, `supabase`, `services`) so shared types stay centralized in `types/index.ts`.
231+
- Husky automatically runs `commitlint` via the `commit-msg` hook, so commits created outside Commitizen (Cursor’s commit composer, VS Code Source Control, etc.) are still validated.
232+
- Recommended editor add-ons: *Conventional Commits* and *GitLens* (VS Code/Cursor) for inline history + message templates, plus keep ESLint warnings visible before committing.
233+
- Typical flow: `git pull` → build/test changes → `npm run lint` → stage files → `npm run commit` → push + open PR. Cursor users can also bind a custom slash command to `npm run commit` for quick access.
234+
228235
## 📞 Support
229236

230237
Open an issue on GitHub for bug reports or feature requests.

commitlint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/** @type {import('@commitlint/types').UserConfig} */
2+
module.exports = {
3+
extends: ['@commitlint/config-conventional'],
4+
rules: {
5+
// Keep commit scopes aligned with the main directories (types stay centralized)
6+
'scope-enum': [
7+
2,
8+
'always',
9+
[
10+
'app',
11+
'assets',
12+
'components',
13+
'constants',
14+
'hooks',
15+
'lib',
16+
'providers',
17+
'services',
18+
'supabase',
19+
'scripts',
20+
'types',
21+
'deps',
22+
'docs',
23+
'infra'
24+
]
25+
]
26+
}
27+
};
28+

0 commit comments

Comments
 (0)