Skip to content

Commit 64e7b59

Browse files
committed
docs: adds helpful docs to reference for pre-commit hooks
1 parent 0f098db commit 64e7b59

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

COMMIT_CONVENTION.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Conventional Commit Reference Guide
2+
3+
This project follows [Conventional Commits](https://www.conventionalcommits.org/) to automate versioning and release notes.
4+
5+
## Basic Format
6+
7+
```text
8+
<type>[optional scope]: <description>
9+
10+
[optional body]
11+
12+
[optional footer(s)]
13+
```
14+
15+
## Types
16+
17+
| Type | Description | Triggers Version Bump |
18+
|------------|-----------------------------------------------------|----------------------|
19+
| `feat` | ✨ A new feature | Minor ✅ |
20+
| `fix` | 🐛 A bug fix | Patch ✅ |
21+
| `docs` | 📝 Documentation only changes | None |
22+
| `style` | 💄 Changes that don't affect code logic | None |
23+
| `refactor` | ♻️ Code changes that neither fix bugs nor add features | None |
24+
| `perf` | ⚡ Performance improvements | None |
25+
| `test` | 🧪 Adding or correcting tests | None |
26+
| `build` | 📦 Changes to build system or dependencies | None |
27+
| `ci` | 👷 Changes to CI configuration | None |
28+
| `chore` | 🧹 Other changes that don't modify source/test files | None |
29+
30+
## Breaking Changes
31+
32+
For breaking changes, either:
33+
34+
1. Add an exclamation mark after the type:
35+
36+
```text
37+
feat!: introduce a breaking API change
38+
```
39+
40+
2. Or include a BREAKING CHANGE footer:
41+
42+
```text
43+
feat: add new feature
44+
45+
BREAKING CHANGE: this change breaks the existing API
46+
```
47+
48+
Both methods will trigger a major version bump.
49+
50+
## Examples
51+
52+
### Feature
53+
54+
```text
55+
feat: add template for Serverless Framework
56+
```
57+
58+
### Bug Fix
59+
60+
```text
61+
fix: correct path resolution in generator
62+
```
63+
64+
### Documentation Change
65+
66+
```text
67+
docs: update README with PowerTools usage examples
68+
```
69+
70+
### Breaking Change
71+
72+
```text
73+
feat!: require Node.js 22 for all projects
74+
```
75+
76+
### With Scope
77+
78+
```text
79+
feat(templates): add SAM template with container images
80+
```
81+
82+
### With Body
83+
84+
```text
85+
fix: handle empty project name input
86+
87+
This change prevents crashes when users press enter without providing
88+
a project name during the interactive prompt.
89+
```
90+
91+
### With Footer
92+
93+
```text
94+
feat: implement Jest template
95+
96+
Refs: #123
97+
```
98+
99+
## Pre-commit Hook
100+
101+
A pre-commit hook has been set up using husky and commitlint to enforce this format. If your commit message doesn't follow the conventional format, the commit will be rejected.

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ pnpm deploy # or npm run deploy or yarn deploy
105105

106106
I was tired of repeating the same setup steps for every new Lambda project and wanted to codify my preferred patterns into something reusable. This tool embodies what I believe to be the ideal starting point for modern serverless Node.js applications on AWS.
107107

108+
## Contributing
109+
110+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automated versioning and release notes generation. A pre-commit hook is set up to enforce this format.
111+
112+
See [COMMIT_CONVENTION.md](./COMMIT_CONVENTION.md) for a quick reference guide to the commit format.
113+
114+
For more details on the release process, see [RELEASING.md](./RELEASING.md).
115+
108116
## License
109117

110118
```md

0 commit comments

Comments
 (0)