1818
1919## Contents
2020
21- - [ What is commitlint] ( #what-is-commitlint )
22- - [ Benefits of using commitlint] ( #benefits-using-commitlint )
23- - [ Getting started] ( #getting-started )
24- - [ CLI] ( #cli )
25- - [ Config] ( #config )
26- - [ Shared configuration] ( #shared-configuration )
27- - [ API] ( #api )
28- - [ Tools] ( #tools )
29- - [ Version Support and Releases] ( #version-support-and-releases )
30- - [ Related projects] ( #related-projects )
31- - [ License] ( #license )
32- - [ Development] ( #development )
33- - [ Install and run] ( #install-and-run )
34- - [ Testing] ( #testing )
35- - [ Publishing a release] ( #publishing-a-release )
21+ - [ Get Started | Website] ( #get-started--website )
22+ - [ Contents] ( #contents )
23+ - [ What is commitlint] ( #what-is-commitlint )
24+ - [ Benefits of using commitlint] ( #benefits-of-using-commitlint )
25+ - [ Getting started] ( #getting-started )
26+ - [ CLI] ( #cli )
27+ - [ Config] ( #config )
28+ - [ Shared configuration] ( #shared-configuration )
29+ - [ Documentation] ( #documentation )
30+ - [ API] ( #api )
31+ - [ Tools] ( #tools )
32+ - [ Roadmap] ( #roadmap )
33+ - [ Version Support and Releases] ( #version-support-and-releases )
34+ - [ Releases] ( #releases )
35+ - [ Related projects] ( #related-projects )
36+ - [ License] ( #license )
37+ - [ Development] ( #development )
38+ - [ Install and run] ( #install-and-run )
3639
3740---
3841
@@ -48,15 +51,15 @@ type(scope?): subject #scope is optional; multiple scopes are supported (curren
4851
4952Real world examples can look like this:
5053
51- ```
54+ ``` text
5255chore: run tests on travis ci
5356```
5457
55- ```
58+ ``` text
5659fix(server): send cors headers
5760```
5861
59- ```
62+ ``` text
6063feat(blog): add comment section
6164```
6265
@@ -83,51 +86,6 @@ These can be modified by [your own configuration](#config).
8386
8487## Getting started
8588
86- ``` sh
87- # Install commitlint cli and conventional config
88- npm install --save-dev @commitlint/{config-conventional,cli}
89- # For Windows:
90- npm install --save-dev @commitlint/config-conventional @commitlint/cli
91-
92- # Configure commitlint to use conventional config
93- echo " module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
94- ```
95-
96- To lint commits before they are created you can use Husky's ` commit-msg ` hook:
97-
98- ``` sh
99- # Install Husky v6
100- npm install husky --save-dev
101- # or
102- yarn add husky --dev
103-
104- # Activate hooks
105- npx husky install
106- # or
107- yarn husky install
108- ```
109-
110- ### Add hook
111-
112- > [ !WARNING]
113- > It's necessary that you use ** commit-msg** as the name for hook file.
114- > Read Git hooks [ documentation] ( https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks ) for more info.
115-
116- ```
117- npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
118- ```
119-
120- ** Or use installed package instead**
121-
122- ```
123- npm pkg set scripts.commitlint="commitlint --edit"
124- npx husky add .husky/commit-msg 'npm run commitlint ${1}'
125- ```
126-
127- Check the [ husky documentation] ( https://typicode.github.io/husky/#/?id=manual ) on how you can automatically have Git hooks enabled after install for different ` yarn ` versions.
128-
129- ** Detailed Setup instructions**
130-
13189- [ Local setup] ( https://conventional-changelog.github.io/commitlint/#/guides-local-setup ) - Lint messages on commit with husky
13290- [ CI setup] ( https://conventional-changelog.github.io/commitlint/#/guides-ci-setup ) - Lint messages during CI builds
13391
@@ -255,96 +213,6 @@ yarn run commitlint # run CLI
255213
256214For more information on how to contribute please take a look at our [ contribution guide] ( ./.github/CONTRIBUTING.md ) .
257215
258- ### Testing
259-
260- From the project root directory, use the following commands to run the test suite
261-
262- ``` sh
263- yarn clean
264- yarn install
265- yarn build
266- yarn test
267- ```
268-
269- ### Package dependency overview
270-
271- ![ commitlint-dependencies] ( https://user-images.githubusercontent.com/4248851/58385093-34b79780-7feb-11e9-8f27-bffc4aca3eba.png )
272-
273- (Partly outdated)
274-
275- ### Publishing a release
276-
277- ``` sh
278- npm login
279- nvm use (if you have nvm installed)
280- ```
281-
282- - [ nvm] ( https://github.com/nvm-sh/nvm )
283- - [ asdf] ( https://asdf-vm.com/ ) is supported as well
284-
285- ``` sh
286- yarn clean
287- yarn install
288- yarn build
289- yarn test
290- yarn run publish --otp < one-time password>
291- ```
292-
293- If something in between fails (like a new package was added and needs to be published for the
294- first time but you forgot) you can use ` lerna publish from-package ` to publish anything that
295- has not been published yet.
296-
297- #### Create GitHub release
298-
299- 1 . Copy changelog entry for the new version
300- 1 . Create release for the new tag: https://github.com/conventional-changelog/commitlint/releases
301- 1 . Post in the [ commitlint Slack-channel] [ 12 ]
302-
303- #### Publish a ` next ` release (or i.e. patch release)
304-
305- ``` sh
306- npm login
307- nvm use (if you have nvm installed)
308- ```
309-
310- ``` sh
311- yarn clean
312- yarn install
313- yarn build
314- yarn test
315- npx lerna publish --conventional-commits --dist-tag [` next` | ` [PATCH_RELEASE_VERSION]` ] --otp < one-time password>
316- ```
317-
318- If for some reason this stops in between, you can manually publish missing packages like this:
319-
320- ``` sh
321- npm publish < package-name> --tag [` next` | ` [PATCH_RELEASE_VERSION]` ] --otp < one-time password>
322- ```
323-
324- ##### Publishing (new) packages for the first time
325-
326- ``` sh
327- npm publish [PACKAGE_NAME] --access public
328- ```
329-
330- From within the folder first i.e. ` cd @commitlint/new-packages ` .
331-
332- ##### Move ` next ` to ` latest `
333-
334- ``` sh
335- npm login
336- ```
337-
338- ``` sh
339- 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>'
340- ```
341-
342- Remove next:
343-
344- ``` sh
345- 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>'
346- ```
347-
348216[ 0 ] : https://img.shields.io/badge/stability-stable-green.svg?style=flat-square
349217[ 1 ] : https://nodejs.org/api/documentation.html#documentation_stability_index
350218[ 2 ] : https://img.shields.io/npm/v/@commitlint/cli.svg?style=flat-square
0 commit comments