conventional-changelog
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -5,6 +5,4 @@ var es = require('event-stream'); | ||
var LINK_VERSION = '[## %s%s](%s/releases/tag/%s)'; | ||
var VERSION = '## %s %s'; | ||
var LINK_PATCH_VERSION = '[### %s%s](%s/releases/tag/%s)'; | ||
var PATCH_VERSION = '### %s %s'; | ||
var VERSION = '## %s%s'; | ||
var PATCH_VERSION = '### %s%s'; | ||
var LINK_ISSUE = '[#%s](%s/issues/%s)'; | ||
@@ -20,13 +18,9 @@ var ISSUE = '(#%s)'; | ||
function getVersionLink (repository, version, subtitle) { | ||
function getVersion (version, subtitle) { | ||
subtitle = subtitle ? ' ' + subtitle : ''; | ||
return repository ? | ||
util.format(LINK_VERSION, version, subtitle, repository, version) : | ||
util.format(VERSION, version, version, subtitle); | ||
return util.format(VERSION, version, subtitle); | ||
} | ||
function getPatchVersionLink (repository, version, subtitle) { | ||
function getPatchVersion (version, subtitle) { | ||
subtitle = subtitle ? ' ' + subtitle : ''; | ||
return repository ? | ||
util.format(LINK_PATCH_VERSION, version, subtitle, repository, version) : | ||
util.format(PATCH_VERSION, version, version, subtitle); | ||
return util.format(PATCH_VERSION, version, subtitle); | ||
} | ||
@@ -46,8 +40,2 @@ function getIssueLink(repository, issue) { | ||
function writeLog(commits, options, done) { | ||
options = extend({ | ||
versionLink: getVersionLink.bind(null, options.repository), | ||
patchVersionLink: getPatchVersionLink.bind(null, options.repository), | ||
issueLink: getIssueLink.bind(null, options.repository), | ||
commitLink: getCommitLink.bind(null, options.repository) | ||
}, options || {}); | ||
@@ -101,4 +89,4 @@ var log = ''; | ||
options = extend({ | ||
versionLink: getVersionLink.bind(null, options.repository), | ||
patchVersionLink: getPatchVersionLink.bind(null, options.repository), | ||
versionText: getVersion, | ||
patchVersionText: getPatchVersion, | ||
issueLink: getIssueLink.bind(null, options.repository), | ||
@@ -111,4 +99,4 @@ commitLink: getCommitLink.bind(null, options.repository) | ||
var versionText = version.split('.')[2] === '0' ? | ||
options.versionLink(version, subtitle) : | ||
options.patchVersionLink(version, subtitle); | ||
options.versionText(version, subtitle) : | ||
options.patchVersionText(version, subtitle); | ||
@@ -115,0 +103,0 @@ if (options.repository) { |
{ | ||
"name": "conventional-changelog", | ||
"codename": "change", | ||
"version": "0.0.10", | ||
"codename": "reorder", | ||
"version": "0.0.11", | ||
"description": "Generate a markdown changelog from git commit metadata", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -63,5 +63,5 @@ conventional-changelog | ||
* `versionLink` `{function(version, subtitle)}` - If repository is provided, this function will be used to link to major and minor versions. By default, returns a github version link based on options.repository: `opts.repository + '/releases/tag/' + version` | ||
* `versionText` `{function(version, subtitle)}` - What to use for the title of a major version in the changelog. Defaults to `'## ' + version + ' ' + subtitle`. | ||
* `patchVersionLink` `{function(version, subtitle)}` - If repository is provided, this function will be used to link to patch versions. By default, returns a github version link based on options.repository: `opts.repository + '/releases/tag/' + version` | ||
* `patchVersionText` `{function(version, subtitle)}` - What to use for the title of a patch version in the changelog. Defaults to `'### ' + version + ' ' + subtitle`. | ||
@@ -68,0 +68,0 @@ * `commitLink` `{function(commitHash)}` - If repository is provided, this function will be used to link to commits. By default, returns a github commit link based on options.repository: `opts.repository + '/commit/' + hash` |
@@ -36,3 +36,3 @@ describe("Writer", function() { | ||
writer.header('0.1.0'); | ||
expect(log).to.contain('[## 0.1.0 subby](github.com/user/repo/releases/tag/0.1.0)'); | ||
expect(log).to.contain('## 0.1.0 subby'); | ||
}); | ||
@@ -42,3 +42,3 @@ it('patch version', function() { | ||
writer.header('0.0.3'); | ||
expect(log).to.contain('[### 0.0.3 subby](github.com/user/repo/releases/tag/0.0.3)'); | ||
expect(log).to.contain('### 0.0.3 subby'); | ||
}); | ||
@@ -45,0 +45,0 @@ }); |
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
19624
459