Skip to content

Commit ca32961

Browse files
jacopotarantinojimthedev
authored andcommitted
docs(install): Add documentation for installing and running locally (#300)
* docs(install): Add documentation for installing and running locally Added documentation embracing the best practice of installing and running packages locally. This supports easier package version control both via local package.json/npm-shrinkwrap.json and is more easily compatible with third party node/npm version managers. * docs(install): Update docs to use the verbose version of NPM commands.
1 parent 0ddfa20 commit ca32961

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ npm install -g commitizen
3131
Install your preferred `commitizen` adapter globally, for example [`cz-conventional-changelog`](https://www.npmjs.com/package/cz-conventional-changelog)
3232

3333
```
34-
npm i -g cz-conventional-changelog
34+
npm install -g cz-conventional-changelog
3535
```
3636

3737
Create a `.czrc` file in your `home` directory, with `path` referring to the preferred, globally installed, `commitizen` adapter
@@ -92,6 +92,27 @@ This just tells Commitizen which adapter we actually want our contributors to us
9292

9393
Please note that in previous version of Commitizen we used czConfig. **czConfig has been deprecated** and you should migrate to the new format before Commitizen 3.0.0.
9494

95+
#### Optional: Install and run Commitizen locally
96+
97+
Installing and running Commitizen locally allows you to make sure that developers are running the exact same version of Commitizen on every machine.
98+
99+
Install Commitizen with `npm install --save-dev commitizen`.
100+
101+
Once you have Commitizen installed as a local dev dependency you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/git-cz` in order to actually use the commands.
102+
103+
You can then initialize the conventional changelog adapter using: `./node_modules/.bin/commitizen init cz-conventional-changelog --save-dev --save-exact`
104+
105+
And you can then add some nice npm run scripts in your package.json pointing to the local version of commitizen:
106+
107+
```json
108+
...
109+
"scripts": {
110+
"commit": "git-cz"
111+
}
112+
```
113+
114+
This will be more convenient for your users because then if they want to do a commit, all they need to do is run `npm run commit` and they will get the prompts needed to start a commit!
115+
95116
#### Congratulations your repo is Commitizen-friendly. Time to flaunt it!
96117

97118
Add the Commitizen-friendly badge to your README using the following markdown:

0 commit comments

Comments
 (0)