cz-conventional-changelog 1.2.0 → 2.0.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 +21 -3
  2. package/package.json +3 -3
package/engine.js CHANGED
@@ -5,6 +5,12 @@ var map = require('lodash.map');
5
5
  var longest = require('longest');
6
6
  var rightPad = require('right-pad');
7
7
 
8
+ var filter = function(array) {
9
+ return array.filter(function(x) {
10
+ return x;
11
+ });
12
+ };
13
+
8
14
  // This can be any kind of SystemJS compatible module.
9
15
  // We use Commonjs here, but ES6 or AMD would do just
10
16
  // fine.
@@ -62,8 +68,12 @@ module.exports = function (options) {
62
68
  message: 'Provide a longer description of the change:\n'
63
69
  }, {
64
70
  type: 'input',
65
- name: 'footer',
66
- message: 'List any breaking changes or issues closed by this change:\n'
71
+ name: 'breaking',
72
+ message: 'List any breaking changes:\n'
73
+ }, {
74
+ type: 'input',
75
+ name: 'issues',
76
+ message: 'List any issues closed by this change:\n'
67
77
  }
68
78
  ]).then(function(answers) {
69
79
 
@@ -85,7 +95,15 @@ module.exports = function (options) {
85
95
 
86
96
  // Wrap these lines at 100 characters
87
97
  var body = wrap(answers.body, wrapOptions);
88
- var footer = wrap(answers.footer, wrapOptions);
98
+
99
+ // Apply breaking change prefix, removing it if already present
100
+ var breaking = answers.breaking.trim();
101
+ breaking = breaking ? 'BREAKING CHANGE: ' + breaking.replace(/^BREAKING CHANGE: /, '') : '';
102
+ breaking = wrap(breaking, wrapOptions);
103
+
104
+ var issues = wrap(answers.issues, wrapOptions);
105
+
106
+ var footer = filter([ breaking, issues ]).join('\n\n');
89
107
 
90
108
  commit(head + '\n\n' + body + '\n\n' + footer);
91
109
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cz-conventional-changelog",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "description": "Commitizen adapter following the conventional-changelog format.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,8 +24,8 @@
24
24
  "word-wrap": "^1.0.3"
25
25
  },
26
26
  "devDependencies": {
27
- "commitizen": "1.0.5",
28
- "semantic-release": "^4.3.5"
27
+ "commitizen": "2.9.6",
28
+ "semantic-release": "^6.3.2"
29
29
  },
30
30
  "czConfig": {
31
31
  "path": "./"