conventional-changelog-angular
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -0,1 +1,11 @@ | ||
<a name="0.0.2"></a> | ||
## [0.0.2](https://github.com/stevemao/conventional-changelog-angular/compare/v0.0.1...v0.0.2) (2016-01-30) | ||
### Features | ||
* **exports:** export the promise ([60def39](https://github.com/stevemao/conventional-changelog-angular/commit/60def39)) | ||
<a name="0.0.1"></a> | ||
@@ -2,0 +12,0 @@ ## 0.0.1 (2015-12-26) |
135
index.js
@@ -6,83 +6,72 @@ 'use strict'; | ||
var resolve = require('path').resolve; | ||
var semver = require('semver'); | ||
var _ = require('lodash'); | ||
function presetOpts() { | ||
var parserOpts = { | ||
headerPattern: /^(\w*)(?:\((.*)\))?\: (.*)$/, | ||
headerCorrespondence: [ | ||
'type', | ||
'scope', | ||
'subject' | ||
], | ||
noteKeywords: 'BREAKING CHANGE', | ||
revertPattern: /^revert:\s([\s\S]*?)\s*This reverts commit (\w*)\./, | ||
revertCorrespondence: ['header', 'hash'] | ||
}; | ||
var parserOpts = { | ||
headerPattern: /^(\w*)(?:\((.*)\))?\: (.*)$/, | ||
headerCorrespondence: [ | ||
'type', | ||
'scope', | ||
'subject' | ||
], | ||
noteKeywords: 'BREAKING CHANGE', | ||
revertPattern: /^revert:\s([\s\S]*?)\s*This reverts commit (\w*)\./, | ||
revertCorrespondence: ['header', 'hash'] | ||
}; | ||
var writerOpts = { | ||
transform: function(commit) { | ||
if (commit.type === 'feat') { | ||
commit.type = 'Features'; | ||
} else if (commit.type === 'fix') { | ||
commit.type = 'Bug Fixes'; | ||
} else if (commit.type === 'perf') { | ||
commit.type = 'Performance Improvements'; | ||
} else if (commit.type === 'revert') { | ||
commit.type = 'Reverts'; | ||
} else { | ||
return; | ||
} | ||
var writerOpts = { | ||
transform: function(commit) { | ||
if (commit.type === 'feat') { | ||
commit.type = 'Features'; | ||
} else if (commit.type === 'fix') { | ||
commit.type = 'Bug Fixes'; | ||
} else if (commit.type === 'perf') { | ||
commit.type = 'Performance Improvements'; | ||
} else if (commit.type === 'revert') { | ||
commit.type = 'Reverts'; | ||
} else { | ||
return; | ||
} | ||
if (commit.scope === '*') { | ||
commit.scope = ''; | ||
} | ||
if (commit.scope === '*') { | ||
commit.scope = ''; | ||
} | ||
if (typeof commit.hash === 'string') { | ||
commit.hash = commit.hash.substring(0, 7); | ||
} | ||
if (typeof commit.hash === 'string') { | ||
commit.hash = commit.hash.substring(0, 7); | ||
} | ||
if (typeof commit.subject === 'string') { | ||
commit.subject = commit.subject.substring(0, 80); | ||
if (typeof commit.subject === 'string') { | ||
commit.subject = commit.subject.substring(0, 80); | ||
} | ||
commit.notes.forEach(function(note) { | ||
if (note.title === 'BREAKING CHANGE') { | ||
note.title = 'BREAKING CHANGES'; | ||
} | ||
}); | ||
_.map(commit.notes, function(note) { | ||
if (note.title === 'BREAKING CHANGE') { | ||
note.title = 'BREAKING CHANGES'; | ||
} | ||
return commit; | ||
}, | ||
groupBy: 'type', | ||
commitGroupsSort: 'title', | ||
commitsSort: ['scope', 'subject'], | ||
noteGroupsSort: 'title', | ||
notesSort: compareFunc | ||
}; | ||
return note; | ||
}); | ||
module.exports = Q.all([ | ||
readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8'), | ||
readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8'), | ||
readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8'), | ||
readFile(resolve(__dirname, 'templates/footer.hbs'), 'utf-8') | ||
]) | ||
.spread(function(template, header, commit, footer) { | ||
writerOpts.mainTemplate = template; | ||
writerOpts.headerPartial = header; | ||
writerOpts.commitPartial = commit; | ||
writerOpts.footerPartial = footer; | ||
return commit; | ||
}, | ||
groupBy: 'type', | ||
commitGroupsSort: 'title', | ||
commitsSort: ['scope', 'subject'], | ||
noteGroupsSort: 'title', | ||
notesSort: compareFunc, | ||
generateOn: function(commit) { | ||
return semver.valid(commit.version); | ||
} | ||
}; | ||
return Q.all([ | ||
readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8'), | ||
readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8'), | ||
readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8'), | ||
readFile(resolve(__dirname, 'templates/footer.hbs'), 'utf-8') | ||
]) | ||
.spread(function(template, header, commit, footer) { | ||
writerOpts.mainTemplate = template; | ||
writerOpts.headerPartial = header; | ||
writerOpts.commitPartial = commit; | ||
writerOpts.footerPartial = footer; | ||
return { | ||
parserOpts: parserOpts, | ||
writerOpts: writerOpts | ||
}; | ||
}); | ||
} | ||
module.exports = presetOpts; | ||
return { | ||
parserOpts: parserOpts, | ||
writerOpts: writerOpts | ||
}; | ||
}); |
{ | ||
"name": "conventional-changelog-angular", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "conventional-changelog angular preset", | ||
"main": "index.js", | ||
"scripts": { | ||
"coverage": "istanbul cover _mocha -- -R spec && rm -rf ./coverage", | ||
"coverage": "istanbul cover -x test.js _mocha -- -R spec && rm -rf ./coverage", | ||
"lint": "jshint *.js --exclude node_modules && jscs *.js", | ||
"test": "mocha && npm run-script lint" | ||
"test": "mocha --timeout 30000 && npm run-script lint" | ||
}, | ||
@@ -31,2 +31,3 @@ "repository": { | ||
"git-dummy-commit": "^1.1.1", | ||
"istanbul": "^0.4.1", | ||
"jscs": "^2.7.0", | ||
@@ -40,6 +41,4 @@ "jshint": "^2.9.1-rc2", | ||
"compare-func": "^1.3.1", | ||
"lodash": "^3.10.1", | ||
"q": "^1.4.1", | ||
"semver": "^5.1.0" | ||
"q": "^1.4.1" | ||
} | ||
} |
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url] | ||
> [conventional-changelog](https://github.com/ajoslin/conventional-changelog) angular preset | ||
> [conventional-changelog](https://github.com/ajoslin/conventional-changelog) [angular](https://github.com/angular/angular) preset | ||
See [conventional](convention.md) | ||
See [convention](convention.md) | ||
@@ -8,0 +8,0 @@ |
'use strict'; | ||
var child = require('child_process'); | ||
var conventionalChangelogCore = require('conventional-changelog-core'); | ||
var preset = require('./'); | ||
var expect = require('chai').expect; | ||
@@ -8,3 +9,2 @@ var gitDummyCommit = require('git-dummy-commit'); | ||
var through = require('through2'); | ||
var preset = require('./')(); | ||
@@ -36,2 +36,5 @@ describe('angular preset', function() { | ||
}) | ||
.on('error', function(err) { | ||
done(err); | ||
}) | ||
.pipe(through(function(chunk) { | ||
@@ -72,2 +75,5 @@ chunk = chunk.toString(); | ||
}) | ||
.on('error', function(err) { | ||
done(err); | ||
}) | ||
.pipe(through(function(chunk, enc, cb) { | ||
@@ -74,0 +80,0 @@ chunk = chunk.toString(); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12759
2
10
144
- Removedlodash@^3.10.1
- Removedsemver@^5.1.0
- Removedlodash@3.10.1(transitive)
- Removedsemver@5.7.2(transitive)