Scoped Commits in Changelogs
Learn how scoped Conventional Commits like feat(auth) and fix(ui) are rendered with bold scope prefixes in the generated changelog.
Detailed Explanation
Understanding Scoped Commits
In Conventional Commits, the scope is an optional parenthetical identifier that narrows the area of the codebase affected by the change. Common scopes include module names (auth, api, ui), package names in a monorepo, or feature areas (billing, search).
How Scopes Are Rendered
When the generator encounters a scoped commit like feat(auth): add OAuth2 login, it renders it as:
- **auth:** add OAuth2 login
The scope becomes a bold prefix, making it easy to scan which part of the codebase changed. Unscoped commits like feat: add dark mode are rendered without a prefix:
- add dark mode
Mixing Scoped and Unscoped
Within a single section, both scoped and unscoped commits coexist naturally:
### Added
- **auth:** add OAuth2 login with Google
- **api:** implement rate limiting middleware
- add dark mode toggle to settings page
Scope Naming Conventions
While the generator accepts any scope string, common conventions include:
| Convention | Example | Description |
|---|---|---|
| Module name | feat(auth): |
Affected module or package |
| Layer | fix(ui): |
Application layer (ui, api, db) |
| Feature area | perf(search): |
Business domain feature |
| Package | build(eslint): |
Dependency or tool name |
Benefits of Scopes
Scopes make changelogs scannable. A reader looking for authentication changes can quickly scan for the bold auth: prefix across all sections, rather than reading every line item.
Use Case
Essential for medium-to-large projects with multiple modules or packages. Scoped commits help readers filter the changelog mentally and find changes relevant to their area of responsibility.