You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(adapter): support npm module names in commitizen.path config
This change contains
* A refactoring of the `adapter.resolveAdapterPath` method
* An additional test case for the `adapter.resolveAdapterPath` method
* Updated documentation to reflect the changes
* Remove unneeded resolving of param passed to getPrompter in git-cz
strategy
* Use find-root package to determine position of package.json to
determine the path more reliable in complex npm situations
Instead of doing `fs.lsStatSync` calls against `commitizen.path`
`resolveAdapterPath` relies on `require.resolve`, which allows for
support of npm module names in `commitizen.path` while maintaining
backwards compatibility with the former implementation and
documentation.
Closes#79
Copy file name to clipboardExpand all lines: README.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,13 +47,21 @@ The above command does three things for you. It installs the cz-conventional-cha
47
47
...
48
48
"config": {
49
49
"commitizen": {
50
-
"path": "node_modules/cz-conventional-changelog"
50
+
"path": "cz-conventional-changelog"
51
51
}
52
52
}
53
53
```
54
54
55
55
This just tells Commitizen which adapter we actually want our contributors to use when they try to commit to this repo.
56
56
57
+
`commitizen.path` is resolved via [require.resolve](https://nodejs.org/api/globals.html#globals_require_resolve) and supports
58
+
59
+
* npm modules
60
+
* directories relative to `process.cwd()` containing an `index.js` file
61
+
* file base names relative to `process.cwd()` with `js` extension
62
+
* full relative file names
63
+
* absolute paths.
64
+
57
65
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.
58
66
59
67
#### Congratulations your repo is Commitizen-friendly. Time to flaunt it!
0 commit comments