Skip to content

Latest commit

 

History

History
180 lines (124 loc) · 4.76 KB

CONTRIBUTING.md

File metadata and controls

180 lines (124 loc) · 4.76 KB

Lint commit messages

commitlint

Yeay! You want to contribute to commitlint. That's amazing! To smoothen everyone's experience involved with the project please take note of the following guidelines and rules.

Found an Issue?

Thank you for reporting any issues you find. We do our best to test and make commitlint as solid as possible, but any reported issue is a real help.

commitlint issues

Please follow these guidelines when reporting issues:

  • Provide a title in the format of <Error> when <Task>
  • Tag your issue with the tag bug
  • Provide a short summary of what you are trying to do
  • Provide the log of the encountered error if applicable
  • Provide the exact version of commitlint. Check npm ls @commitlint/cli when in doubt
  • Be awesome and consider contributing a pull request

Want to contribute?

You consider contributing changes to commitlint – we dig that! Please consider these guidelines when filing a pull request:

commitlint pull requests

  • Follow the Coding Rules
  • Follow the Commit Rules
  • Make sure you rebased the current master branch when filing the pull request
  • Squash your commits when filing the pull request
  • Provide a short title with a maximum of 100 characters
  • Provide a more detailed description containing _ What you want to achieve _ What you changed _ What you added _ What you removed

Coding Rules

To keep the code base of commitlint neat and tidy the following rules apply to every change

Coding standards

  • prettier is king
  • Favor micro library over swiss army knives (rimraf, ncp vs. fs-extra)
  • Be awesome

Commit Rules

To help everyone with understanding the commit history of commitlint the following commit rules are enforced. To make your life easier commitlint is commitizen-friendly and provides the npm run-script commit.

Commit standards

  • conventional-changelog
  • husky commit message hook available
  • present tense
  • maximum of 100 characters
  • message format of $type($scope): $message

Environment setup

This project uses yarn, so be sure that it is available in your shell environment.

After cloning the repo run

yarn install

Testing

From the project root directory, use the following commands to run the test suite

yarn build
yarn test

Documentation updates

Documentation uses vitepress. To run and edit the documentation locally run:

yarn docs-dev

To have a preview of the deployed doc run:

yarn docs-build
yarn docs-serve

For more information refer to vitepress documentation.

Package dependency overview

commitlint-dependencies

(Partly outdated)

Publishing a release

npm login
nvm use (if you have nvm installed)
yarn clean
yarn install
yarn build
yarn test
yarn run publish --otp <one-time password>

If something in between fails (like a new package was added and needs to be published for the first time but you forgot) you can use lerna publish from-package to publish anything that has not been published yet.

Create GitHub release

  1. Copy changelog entry for the new version
  2. Create release for the new tag: https://github.com/conventional-changelog/commitlint/releases
  3. Post in the [commitlint Slack-channel][12]

Publish a next release (or i.e. patch release)

npm login
nvm use (if you have nvm installed)
yarn clean
yarn install
yarn build
yarn test
npx lerna publish --conventional-commits --dist-tag [`next` | `next` | `[release-vXX(BRANCH)]`] --otp <one-time password>

If for some reason this stops in between, you can manually publish missing packages like this:

npm publish <package-name> --tag [`latest` | `next` | `[release-vXX(BRANCH)]`] --otp <one-time password>

Depending on the state of the packages you might need to run npm pack in each failed package and then publish it.

Publishing (new) packages for the first time

npm publish [PACKAGE_NAME] --access public

From within the folder first i.e. cd @commitlint/new-packages.

Move next to latest

npm login
npx lerna exec --no-bail --no-private --no-sort --stream -- '[ -n "$(npm v . dist-tags.next)" ] && npm dist-tag add ${LERNA_PACKAGE_NAME}@$(npm v . dist-tags.next) latest --otp <one-time password>'

Remove next:

npx lerna exec --no-bail --no-private --no-sort --stream -- '[ -n "$(npm v . dist-tags.next)" ] && npm dist-tag rm ${LERNA_PACKAGE_NAME} next --otp <one-time password>'