cz-conventional-changelog 3.0.0 → 3.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.
- package/engine.js +3 -1
- package/engine.test.js +20 -1
- package/index.js +2 -0
- package/package.json +4 -4
package/engine.js
CHANGED
|
@@ -83,7 +83,9 @@ module.exports = function(options) {
|
|
|
83
83
|
'What is the scope of this change (e.g. component or file name): (press enter to skip)',
|
|
84
84
|
default: options.defaultScope,
|
|
85
85
|
filter: function(value) {
|
|
86
|
-
return
|
|
86
|
+
return options.disableScopeLowerCase
|
|
87
|
+
? value.trim()
|
|
88
|
+
: value.trim().toLowerCase();
|
|
87
89
|
}
|
|
88
90
|
},
|
|
89
91
|
{
|
package/engine.test.js
CHANGED
|
@@ -18,7 +18,6 @@ var defaultOptions = {
|
|
|
18
18
|
var type = 'func';
|
|
19
19
|
var scope = 'everything';
|
|
20
20
|
var subject = 'testing123';
|
|
21
|
-
var subject2 = 'after the fall, I was gone';
|
|
22
21
|
var longBody =
|
|
23
22
|
'a a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a' +
|
|
24
23
|
'a a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a aa a' +
|
|
@@ -85,6 +84,23 @@ describe('commit message', function() {
|
|
|
85
84
|
})
|
|
86
85
|
).to.equal(`${type}(${scope}): ${subject}\n\n${body}`);
|
|
87
86
|
});
|
|
87
|
+
it('header and body w/ uppercase scope', function() {
|
|
88
|
+
var upperCaseScope = scope.toLocaleUpperCase();
|
|
89
|
+
expect(
|
|
90
|
+
commitMessage(
|
|
91
|
+
{
|
|
92
|
+
type,
|
|
93
|
+
scope: upperCaseScope,
|
|
94
|
+
subject,
|
|
95
|
+
body
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
...defaultOptions,
|
|
99
|
+
disableScopeLowerCase: true
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
).to.equal(`${type}(${upperCaseScope}): ${subject}\n\n${body}`);
|
|
103
|
+
});
|
|
88
104
|
it('header, body and issues w/ out scope', function() {
|
|
89
105
|
expect(
|
|
90
106
|
commitMessage({
|
|
@@ -298,6 +314,9 @@ describe('defaults', function() {
|
|
|
298
314
|
)
|
|
299
315
|
).to.equal(issues);
|
|
300
316
|
});
|
|
317
|
+
it('disableScopeLowerCase default', function() {
|
|
318
|
+
expect(questionDefault('disableScopeLowerCase')).to.be.undefined;
|
|
319
|
+
});
|
|
301
320
|
});
|
|
302
321
|
|
|
303
322
|
describe('prompts', function() {
|
package/index.js
CHANGED
|
@@ -12,6 +12,8 @@ var options = {
|
|
|
12
12
|
defaultSubject: process.env.CZ_SUBJECT || config.defaultSubject,
|
|
13
13
|
defaultBody: process.env.CZ_BODY || config.defaultBody,
|
|
14
14
|
defaultIssues: process.env.CZ_ISSUES || config.defaultIssues,
|
|
15
|
+
disableScopeLowerCase:
|
|
16
|
+
process.env.DISABLE_SCOPE_LOWERCASE || config.disableScopeLowerCase,
|
|
15
17
|
maxHeaderWidth:
|
|
16
18
|
(process.env.CZ_MAX_HEADER_WIDTH &&
|
|
17
19
|
parseInt(process.env.CZ_MAX_HEADER_WIDTH)) ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cz-conventional-changelog",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Commitizen adapter following the conventional-changelog format.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"chalk": "^2.4.1",
|
|
25
|
-
"
|
|
25
|
+
"commitizen": "^4.0.3",
|
|
26
|
+
"conventional-commit-types": "^3.0.0",
|
|
26
27
|
"lodash.map": "^4.5.1",
|
|
27
|
-
"longest": "^
|
|
28
|
+
"longest": "^2.0.1",
|
|
28
29
|
"right-pad": "^1.0.1",
|
|
29
30
|
"word-wrap": "^1.0.3"
|
|
30
31
|
},
|
|
@@ -32,7 +33,6 @@
|
|
|
32
33
|
"@types/chai": "^4.1.7",
|
|
33
34
|
"@types/mocha": "^5.2.7",
|
|
34
35
|
"chai": "^4.2.0",
|
|
35
|
-
"commitizen": "^4.0.2",
|
|
36
36
|
"cosmiconfig": "^5.2.1",
|
|
37
37
|
"mocha": "^6.2.0",
|
|
38
38
|
"mock-require": "^3.0.3",
|