#react #frontend #security
Conventional Commits is a specification for writing human and machine-readable commit messages. It makes it easier to understand the history of a project and automate processes like versioning.
Commit structure
A commit message follows this structure:
<type>[optional scope]: <description>
Example:
feat(auth): add OAuth support
Commit types
Here’s a list of common commit types and their purposes:
- feat: Introduce a new feature.
- fix: Fix a bug.
- chore: Perform maintenance tasks.
- docs: Update or add documentation.
- style: Make code style changes (e.g., formatting).
- refactor: Refactor code without adding features or fixing bugs.
- revert: Revert a previous commit.
- test: Add or update tests.
- build: Changes related to the build system or external dependencies.
- ci: Update CI configuration or scripts.
- perf: Improve performance.
Handling breaking changes
Breaking changes require special attention in your commit messages. They can be indicated in two ways:
-
In the commit body:
feat(auth): add OAuth support BREAKING CHANGE: API keys will no longer work. Users must migrate to OAuth tokens.
-
With a shorthand
!
in the type:feat!: remove support for legacy authentication
By adopting the Conventional Commits standard, you ensure clarity in your commit history, making it easier for everyone in your team (and automation tools) to understand the intent behind each change.