This repository contains a collection of packages used by Top Hat to enforce our commitlint convention and use it to automatically generate changelogs.
Usage
All packages are published to npm, however if using Yarn Berry, it is possible to install a package directly from git. This is useful for debugging.
yarn add -D @tophat/commitizen-adapter@tophat/commit-utils#workspace=@tophat/commitizen-adapteryarn add -D @tophat/commit-utils-core@tophat/commit-utils#workspace=@tophat/commit-utils-coreyarn add -D @tophat/commitlint-config@tophat/commit-utils#workspace=@tophat/commitlint-configyarn add -D @tophat/conventional-changelog-config@tophat/commit-utils#workspace=@tophat/conventional-changelog-configyarn add -D commit-watch@tophat/commit-utils#workspace=commit-watch
Packages
The following packages are provided:
- @tophat/commitlint-config: A config for commitlint that enforces Top Hat's style guide
- @tophat/commitizen-adapter: An adapter for commitizen that helps you interactively build semantic commit messages
- @tophat/conventional-changelog-config: A preset for conventional-changelog built on Top Hat's style guide
- @tophat/commit-utils-core: A package containing code that is shared between all our config packages. This package is meant for internal use only.
- commit-watch: Ensure your commit messages are formatted based on your commitlint config
Commit Convention
Top Hat uses the following commit types as part of our development flow. Note that some of the commit types are automatically added to the changelog using @tophat/conventional-changelog-config
Commit Type | Title | Description | Added to changelog? |
---|---|---|---|
wip | Work in Progress | Changes that are part of some work in progress | No |
feat | Features | A new feature | Yes |
fix | Bug Fixes | A bugfix | Yes |
refactor | Code Refactoring | Changes that neither fix a bug nor add a feature | No |
docs | Documentation | Changes to documentation only | No |
test | Tests | Adding missing tests or correcting existing tests | No |
revert | Reverts | Reverts a previous commit | Yes |
o11y | Observability & Analytics | Improvements to o11y | Yes |
deps | Dependencies | Dependency updates | Yes |
Contributing
To report bugs, please a create a new issue.
Making changes to the config
This configuration specified in these packages are for Top Hat's open source and internal use, so we generally won't be accepting external contributions.
If you are an external contributor and you have changes that you really feel should be included in our global config, feel free to make a suggestion, but please don't take it personally if we decide not to adopt the rule. These configs are really easy to extend, so feel free to do exactly that with this one and make your own based off of it! You can learn more from the commitlint docs for creating shareable configs.