Commits & Changelog
Conventional Commits
We use conventional commits for our commit messages. The main advantage is two fold - firstly, it encourages atomic commits, that is that commits should be small and targeted - a single feature, change or fix. This makes them easier to reason about and reverse. Secondly, it means that commit messages are parsable, which allows us to automate changelogs with git cliff (see below!)
Automating Changelogs
We use git cliff to turn our conventional commit messages into CHANGELOG.md
.
You can run the following before you create and push a new tag.
# replace with whatever the new tag is
git cliff -o CHANGELOG.md -t v0.1.57
# commit your changelog
git commit -a
# then run your tag update - we're using bit here for convenience - it increments tag automatically
# this is the same as running e.g. git tag v0.1.57 && git push --tags
bit release bump
Alternatively the codegen also has a convenience bump
command which will bump your semver version tag, update the version number in your plugin main file or theme style.css, render a new changelog, commit and push for you all in one line.
# default to patch
forme bump
# you can also specify major, minor or patch
forme bump minor