Package Exports
- commit-context
- commit-context/bin/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (commit-context) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
commit-context
Gives context to commit messages from branch name
- Supports Git flow branch naming conventions
- Builds commit message based on conventional commits
How it works?
You need to have a branch name following the pattern: type/ticketId (example: "feature/ID-1422"). So after you commit your changes with a message "My last changes", it will auto-prefix it based on your type and ticketId, resulting in? "feat: [ID-1422] My last changes".
Setup with Husky
- Install commit-context and husky
npm install husky commit-context- Init husky
npx husky-init && npm install Note: This step will create a pre-commit git hook. You can remove it from .husky/pre-commit.
- Add a commit-msg git hook
npx husky add .husky/commit-msg 'npx commit-context $1'