The release-please package was used to automatically update the changelog.md file. According to this package, commit messages must be in the Conventional Commits standard. Thanks to commit messages written according to the Conventional Commits standard, the changelog.md file is dynamically updated and major.minor.patch versions are changed.
Conventional Commits Structure:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
The most important prefixes you should have in mind are:
- fix: which represents bug fixes, and correlates to a SemVer patch.
- feat: which represents a new feature, and correlates to a SemVer minor.
- feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
- types other than fix: and feat: are allowed. build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, revert:
- You can add any type you want to the release-please.yml file.
Why Use Conventional Commits:
- Automatically generating CHANGELOGs.
- Automatically determining a semantic version bump (based on the types of commits landed).
- Communicating the nature of changes to teammates, the public, and other stakeholders.
- Triggering build and publish processes.
- Making it easier for people to contribute to your projects, by allowing them to explore a more structured commit history.
Example Conventional Commit Messages:
- Fixing a Bug
- Correct: fix: resolve login page crash on invalid input v.1.0.0 => v.1.0.1
- Incorrect: resolve login page crash on invalid input
- Adding a New Feature
- Correct: feat: introduce comment section v.1.0.1 => v1.1.0
- Incorrect: added comments section
- Making a Breaking Change
- Correct: feat!: remove deprecated "user" API v.1.1.0 => v.2.0.0
- Incorrect: removed old user API
- Improving Performance
- Correct: perf: enhance image loading speed v.2.0.0 => v.2.0.1
- Incorrect: faster image loading
- Refactoring Code
- Correct: refactor: streamline user authentication flow v.2.0.0 => v.2.0.2
- Incorrect: cleaned up authentication process