|
| 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. |
0 commit comments