Skip to content

Commit 2a1a111

Browse files
renovate[bot]jimthedev
authored andcommittedJul 19, 2019
fix(deps): update dependency cz-conventional-changelog to v3 (#654)
* fix(deps): update dependency cz-conventional-changelog to v3 * fix: resolve test with latest cz-conventional-changelog
1 parent 129a779 commit 2a1a111

File tree

4 files changed

+146
-34
lines changed

4 files changed

+146
-34
lines changed
 

‎package-lock.json

+138-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
"dependencies": {
7474
"cachedir": "2.2.0",
75-
"cz-conventional-changelog": "2.1.0",
75+
"cz-conventional-changelog": "3.0.1",
7676
"dedent": "0.7.0",
7777
"detect-indent": "6.0.0",
7878
"find-node-modules": "2.0.0",

‎src/commitizen/init.js

+6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function init (sh, repoPath, adapterNpmName, {
5656
yarn = false,
5757
dev = false,
5858
exact = false,
59+
includeCommitizen = false
5960
} = defaultInitOptions) {
6061

6162
// Don't let things move forward if required args are missing
@@ -73,6 +74,8 @@ function init (sh, repoPath, adapterNpmName, {
7374
// Generate a string that represents the npm install command
7475
let installAdapterCommand = yarn ? generateYarnAddAdapterCommand(stringMappings, adapterNpmName) : generateNpmInstallAdapterCommand(stringMappings, adapterNpmName);
7576

77+
let installCommitizenCommand = yarn ? generateYarnAddAdapterCommand(stringMappings, "commitizen") : generateNpmInstallAdapterCommand(stringMappings, "commitizen");
78+
7679
// Check for previously installed adapters
7780
if (adapterConfig && adapterConfig.path && adapterConfig.path.length > 0 && !force) {
7881
throw new Error(`A previous adapter is already configured. Use --force to override
@@ -86,6 +89,9 @@ function init (sh, repoPath, adapterNpmName, {
8689

8790
try {
8891
executeShellCommand(sh, repoPath, installAdapterCommand);
92+
if(includeCommitizen) {
93+
executeShellCommand(sh, repoPath, installCommitizenCommand);
94+
}
8995
addPathToAdapterConfig(sh, CLI_PATH, repoPath, adapterNpmName);
9096
} catch (e) {
9197
console.error(e);

‎test/tests/adapter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('adapter', function () {
131131
};
132132

133133
// Install an adapter
134-
commitizenInit(sh, config.paths.endUserRepo, 'cz-conventional-changelog');
134+
commitizenInit(sh, config.paths.endUserRepo, 'cz-conventional-changelog', {includeCommitizen: true});
135135

136136
// TEST
137137
expect(function () { adapter.getPrompter('IAMANIMPOSSIBLEPATH'); }).to.throw(Error);

0 commit comments

Comments
 (0)
Please sign in to comment.