cz-conventional-changelog 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/engine.js +22 -6
  2. package/package.json +5 -4
package/engine.js CHANGED
@@ -57,7 +57,7 @@ module.exports = function (options) {
57
57
  }, {
58
58
  type: 'input',
59
59
  name: 'scope',
60
- message: 'Denote the scope of this change ($location, $browser, $compile, etc.):\n'
60
+ message: 'What is the scope of this change (e.g. component or file name)? (press enter to skip)\n'
61
61
  }, {
62
62
  type: 'input',
63
63
  name: 'subject',
@@ -65,15 +65,31 @@ module.exports = function (options) {
65
65
  }, {
66
66
  type: 'input',
67
67
  name: 'body',
68
- message: 'Provide a longer description of the change:\n'
68
+ message: 'Provide a longer description of the change: (press enter to skip)\n'
69
+ }, {
70
+ type: 'confirm',
71
+ name: 'isBreaking',
72
+ message: 'Are there any breaking changes?',
73
+ default: false
69
74
  }, {
70
75
  type: 'input',
71
76
  name: 'breaking',
72
- message: 'List any breaking changes:\n'
77
+ message: 'Describe the breaking changes:\n',
78
+ when: function(answers) {
79
+ return answers.isBreaking;
80
+ }
81
+ }, {
82
+ type: 'confirm',
83
+ name: 'isIssueAffected',
84
+ message: 'Does this change affect any open issues?',
85
+ default: false
73
86
  }, {
74
87
  type: 'input',
75
88
  name: 'issues',
76
- message: 'List any issues closed by this change:\n'
89
+ message: 'Add issue references (e.g. "fix #123", "re #123".):\n',
90
+ when: function(answers) {
91
+ return answers.isIssueAffected;
92
+ }
77
93
  }
78
94
  ]).then(function(answers) {
79
95
 
@@ -97,11 +113,11 @@ module.exports = function (options) {
97
113
  var body = wrap(answers.body, wrapOptions);
98
114
 
99
115
  // Apply breaking change prefix, removing it if already present
100
- var breaking = answers.breaking.trim();
116
+ var breaking = answers.breaking ? answers.breaking.trim() : '';
101
117
  breaking = breaking ? 'BREAKING CHANGE: ' + breaking.replace(/^BREAKING CHANGE: /, '') : '';
102
118
  breaking = wrap(breaking, wrapOptions);
103
119
 
104
- var issues = wrap(answers.issues, wrapOptions);
120
+ var issues = answers.issues ? wrap(answers.issues, wrapOptions) : '';
105
121
 
106
122
  var footer = filter([ breaking, issues ]).join('\n\n');
107
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cz-conventional-changelog",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Commitizen adapter following the conventional-changelog format.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,7 +19,6 @@
19
19
  "conventional-commit-types": "^2.0.0",
20
20
  "lodash.map": "^4.5.1",
21
21
  "longest": "^1.0.1",
22
- "pad-right": "^0.2.2",
23
22
  "right-pad": "^1.0.1",
24
23
  "word-wrap": "^1.0.3"
25
24
  },
@@ -27,7 +26,9 @@
27
26
  "commitizen": "2.9.6",
28
27
  "semantic-release": "^6.3.2"
29
28
  },
30
- "czConfig": {
31
- "path": "./"
29
+ "config": {
30
+ "commitizen": {
31
+ "path": "./index.js"
32
+ }
32
33
  }
33
34
  }