conventional-changelog-angular
Advanced tools
Comparing version 0.1.0 to 1.0.0
@@ -0,1 +1,11 @@ | ||
<a name="1.0.0"></a> | ||
# [1.0.0](https://github.com/stevemao/conventional-changelog-angular/compare/v0.1.0...v1.0.0) (2016-02-05) | ||
### Features | ||
* **writerOpts.transform:** do not discard commit if there is BREAKING CHANGE ([e67c4a1](https://github.com/stevemao/conventional-changelog-angular/commit/e67c4a1)), closes [ajoslin/conventional-changelog#127](https://github.com/ajoslin/conventional-changelog/issues/127) [angular/angular#5672](https://github.com/angular/angular/issues/5672) | ||
<a name="0.1.0"></a> | ||
@@ -2,0 +12,0 @@ # [0.1.0](https://github.com/stevemao/conventional-changelog-angular/compare/v0.0.2...v0.1.0) (2016-01-30) |
@@ -56,3 +56,3 @@ #### Examples | ||
If the prefix is `feat`, `fix` or `perf`, it will always appear in the changelog. | ||
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog. | ||
@@ -59,0 +59,0 @@ Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks. |
25
index.js
@@ -21,2 +21,9 @@ 'use strict'; | ||
transform: function(commit) { | ||
var discard = true; | ||
commit.notes.forEach(function(note) { | ||
note.title = 'BREAKING CHANGES'; | ||
discard = false; | ||
}); | ||
if (commit.type === 'feat') { | ||
@@ -30,4 +37,14 @@ commit.type = 'Features'; | ||
commit.type = 'Reverts'; | ||
} else { | ||
} else if (discard) { | ||
return; | ||
} else if (commit.type === 'docs') { | ||
commit.type = 'Documentation'; | ||
} else if (commit.type === 'style') { | ||
commit.type = 'Styles'; | ||
} else if (commit.type === 'refactor') { | ||
commit.type = 'Code Refactoring'; | ||
} else if (commit.type === 'test') { | ||
commit.type = 'Tests'; | ||
} else if (commit.type === 'chore') { | ||
commit.type = 'Chores'; | ||
} | ||
@@ -47,8 +64,2 @@ | ||
commit.notes.forEach(function(note) { | ||
if (note.title === 'BREAKING CHANGE') { | ||
note.title = 'BREAKING CHANGES'; | ||
} | ||
}); | ||
return commit; | ||
@@ -55,0 +66,0 @@ }, |
{ | ||
"name": "conventional-changelog-angular", | ||
"version": "0.1.0", | ||
"version": "1.0.0", | ||
"description": "conventional-changelog angular preset", | ||
"main": "index.js", | ||
"scripts": { | ||
"coverage": "istanbul cover -x test.js _mocha -- -R spec && rm -rf ./coverage", | ||
"coverage": "istanbul cover -x test.js _mocha -- -R spec --timeout 30000 && rm -rf ./coverage", | ||
"lint": "jshint *.js --exclude node_modules && jscs *.js", | ||
@@ -28,3 +28,3 @@ "test": "mocha --timeout 30000 && npm run-script lint" | ||
"chai": "^3.4.1", | ||
"conventional-changelog-core": "0.0.1", | ||
"conventional-changelog-core": "1.0.0", | ||
"coveralls": "^2.11.6", | ||
@@ -36,3 +36,3 @@ "git-dummy-commit": "^1.1.1", | ||
"mocha": "*", | ||
"shelljs": "^0.5.3", | ||
"shelljs": "^0.6.0", | ||
"through2": "^2.0.0" | ||
@@ -39,0 +39,0 @@ }, |
26
test.js
@@ -64,2 +64,28 @@ 'use strict'; | ||
it('should not discard commit if there is BREAKING CHANGE', function(done) { | ||
gitDummyCommit(['docs(readme): make it clear', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['style(whitespace): make it easier to read', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['refactor(code): change a lot of code', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['test(*): more tests', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['chore(deps): bump', 'BREAKING CHANGE: The Change is huge.']); | ||
conventionalChangelogCore({ | ||
config: preset | ||
}) | ||
.on('error', function(err) { | ||
done(err); | ||
}) | ||
.pipe(through(function(chunk) { | ||
chunk = chunk.toString(); | ||
expect(chunk).to.include('Documentation'); | ||
expect(chunk).to.include('Styles'); | ||
expect(chunk).to.include('Code Refactoring'); | ||
expect(chunk).to.include('Tests'); | ||
expect(chunk).to.include('Chores'); | ||
done(); | ||
})); | ||
}); | ||
it('should work if there is a semver tag', function(done) { | ||
@@ -66,0 +92,0 @@ var i = 0; |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14889
176
0