Skip to content

Commit eeff91f

Browse files
Cameron Westlandjimthedev
authored andcommitted
docs(bootstrap): add documentation for passing config via bootstrap (#195)
1 parent c6d2fdb commit eeff91f

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,54 @@ It is important to note that if you are running `git-cz` from a npm script (let'
9595

9696
Note that the last two options **do not** require you to pass `--` before the args but the first **does**.
9797

98+
### Commitizen for multi-repo proejcts
99+
100+
As a project maintainer of many projects, you may want to standardize on a single commit message
101+
format for all of them. You can create your own node module which acts as front-end for commitizen.
102+
103+
#### 1. Create your own entry point script
104+
105+
106+
```
107+
// my-cli.js
108+
109+
#!/usr/bin/env node
110+
"use strict";
111+
112+
const path = require('path');
113+
const bootstrap = require('commitizen/dist/cli/git-cz').bootstrap;
114+
115+
bootstrap({
116+
cliPath: path.join(__dirname, '../node_modules/commitizen'),
117+
// this is new
118+
config: {
119+
"path": "cz-conventional-changelog"
120+
}
121+
});
122+
```
123+
124+
#### 2. Add script to package.json
125+
126+
```
127+
// package.json
128+
129+
{
130+
"name": "company-commit",
131+
"bin": "./my-cli.js"
132+
"dependencies": {
133+
"commitizen": "^2.7.6",
134+
"cz-conventional-changelog": "^1.1.5",
135+
}
136+
}
137+
```
138+
139+
#### 3. Publish it to npm and use it!
140+
141+
```
142+
npm install company-commit --save-dev
143+
./node_modules/.bin/company-commit
144+
```
145+
98146
### Adapters
99147

100148
We know that every project and build process has different requirements so we've tried to keep Commitizen open for extension. You can do this by choosing from any of the pre-build adapters or even by building your own. Here are some of the great adapters available to you:

0 commit comments

Comments
 (0)