Repository: conventional-changelog/standard-version
Pull request #241 (2018-04-20 19:13:40)

Show full tag name in checkpoint
Tried this package out for the first time and wanted to undo what it had done.
When I tried to remove the tag, I assumed the output "tagging release 0.0.1" was the exact name of the tag, but it was `v0.0.1`.

This changes it so the output is representing the actual name of the tag, and not just the version.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/16624495/badge)](https://coveralls.io/builds/16624495)

Coverage remained the same at 100.0% when pulling **07e5944802f5f4f27007a3c82dae4249c5c9c7e3 on MiniGod:patch-1** into **9a996072433935f79060ed252361a7707e988bf2 on conventional-changelog:master**.


Patch:
diff --git a/LICENSE.txt b/LICENSE.txt
index 836440b..5606e87 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,3 +1,5 @@
+ISC License
+
 Copyright (c) 2016, Contributors
 
 Permission to use, copy, modify, and/or distribute this software
diff --git a/README.md b/README.md
index 41c059c..ebde8b0 100644
--- a/README.md
+++ b/README.md
@@ -178,6 +178,19 @@ Simply add the following to your package.json to configure lifecycle scripts:
 }
 ```
 
+As an example to change from using GitHub to track your items to using your projects Jira use a 
+`postchangelog` script to replace the url fragment containing 'https://github.com/`myproject`/issues/'
+with a link to your Jira - assuming you have already installed [replace](https://www.npmjs.com/package/replace)
+```json
+{
+  "standard-version": {
+    "scripts": {
+      "postchangelog": "replace 'https://github.com/myproject/issues/' 'https://myjira/browse/' CHANGELOG.md"
+    }
+  }
+}
+```
+
 ### Skipping lifecycle steps
 
 You can skip any of the lifecycle steps (`bump`, `changelog`, `commit`, `tag`),
diff --git a/index.js b/index.js
index b5936ee..0c685e0 100755
--- a/index.js
+++ b/index.js
@@ -7,8 +7,17 @@ const commit = require('./lib/lifecycles/commit')
 const tag = require('./lib/lifecycles/tag')
 
 module.exports = function standardVersion (argv) {
-  var pkgPath = path.resolve(process.cwd(), './package.json')
-  var pkg = require(pkgPath)
+  var pkg
+  bump.pkgFiles.forEach((filename) => {
+    if (pkg) return
+    var pkgPath = path.resolve(process.cwd(), filename)
+    try {
+      pkg = require(pkgPath)
+    } catch (err) {}
+  })
+  if (!pkg) {
+    return Promise.reject(new Error('no package file found'))
+  }
   var newVersion = pkg.version
   var defaults = require('./defaults')
   var args = Object.assign({}, defaults, argv)
diff --git a/lib/lifecycles/bump.js b/lib/lifecycles/bump.js
index 4ab091c..5021a80 100644
--- a/lib/lifecycles/bump.js
+++ b/lib/lifecycles/bump.js
@@ -46,6 +46,17 @@ Bump.getUpdatedConfigs = function () {
   return configsToUpdate
 }
 
+Bump.pkgFiles = [
+  'package.json',
+  'bower.json',
+  'manifest.json'
+]
+
+Bump.lockFiles = [
+  'package-lock.json',
+  'npm-shrinkwrap.json'
+]
+
 function getReleaseType (prerelease, expectedReleaseType, currentVersion) {
   if (isString(prerelease)) {
     if (isInPrerelease(currentVersion)) {
@@ -138,10 +149,9 @@ function bumpVersion (releaseAs, callback) {
  */
 function updateConfigs (args, newVersion) {
   const dotgit = DotGitignore()
-  configsToUpdate[path.resolve(process.cwd(), './package.json')] = false
-  configsToUpdate[path.resolve(process.cwd(), './package-lock.json')] = false
-  configsToUpdate[path.resolve(process.cwd(), './npm-shrinkwrap.json')] = false
-  configsToUpdate[path.resolve(process.cwd(), './bower.json')] = false
+  Bump.pkgFiles.concat(Bump.lockFiles).forEach((filename) => {
+    configsToUpdate[path.resolve(process.cwd(), filename)] = false
+  })
   Object.keys(configsToUpdate).forEach(function (configPath) {
     try {
       if (dotgit.ignore(configPath)) return
diff --git a/lib/lifecycles/changelog.js b/lib/lifecycles/changelog.js
index 1eb1617..136f830 100644
--- a/lib/lifecycles/changelog.js
+++ b/lib/lifecycles/changelog.js
@@ -30,7 +30,8 @@ function outputChangelog (args, newVersion) {
     var context
     if (args.dryRun) context = {version: newVersion}
     var changelogStream = conventionalChangelog({
-      preset: 'angular'
+      preset: 'angular',
+      tagPrefix: args.tagPrefix
     }, context, {merges: null})
       .on('error', function (err) {
         return reject(err)
diff --git a/lib/lifecycles/tag.js b/lib/lifecycles/tag.js
index c7dc531..d2d4d7c 100644
--- a/lib/lifecycles/tag.js
+++ b/lib/lifecycles/tag.js
@@ -23,7 +23,7 @@ function execTag (newVersion, pkgPrivate, args) {
   } else {
     tagOption = '-a '
   }
-  checkpoint(args, 'tagging release %s', [newVersion])
+  checkpoint(args, 'tagging release %s%s', [args.tagPrefix, newVersion])
   return runExec(args, 'git tag ' + tagOption + args.tagPrefix + newVersion + ' -m "' + formatCommitMessage(args.message, newVersion) + '"')
     .then(() => {
       var message = 'git push --follow-tags origin master'


Test patch:
diff --git a/test.js b/test.js
index a2e0450..8895603 100644
--- a/test.js
+++ b/test.js
@@ -54,6 +54,12 @@ function writeBowerJson (version, option) {
   fs.writeFileSync('bower.json', JSON.stringify(bower), 'utf-8')
 }
 
+function writeManifestJson (version, option) {
+  option = option || {}
+  var manifest = Object.assign(option, {version: version})
+  fs.writeFileSync('manifest.json', JSON.stringify(manifest), 'utf-8')
+}
+
 function writeNpmShrinkwrapJson (version, option) {
   option = option || {}
   var shrinkwrap = Object.assign(option, { version: version })
@@ -693,6 +699,16 @@ describe('standard-version', function () {
       })
   })
 
+  describe('without a package file to bump', function () {
+    it('should exit with error', function () {
+      shell.rm('package.json')
+      return require('./index')({silent: true})
+        .catch((err) => {
+          err.message.should.equal('no package file found')
+        })
+    })
+  })
+
   describe('bower.json support', function () {
     beforeEach(function () {
       writeBowerJson('1.0.0')
@@ -710,6 +726,23 @@ describe('standard-version', function () {
     })
   })
 
+  describe('manifest.json support', function () {
+    beforeEach(function () {
+      writeManifestJson('1.0.0')
+    })
+
+    it('bumps version # in manifest.json', function () {
+      commit('feat: first commit')
+      shell.exec('git tag -a v1.0.0 -m "my awesome first release"')
+      commit('feat: new feature!')
+      return require('./index')({silent: true})
+        .then(() => {
+          JSON.parse(fs.readFileSync('manifest.json', 'utf-8')).version.should.equal('1.1.0')
+          getPackageVersion().should.equal('1.1.0')
+        })
+    })
+  })
+
   describe('npm-shrinkwrap.json support', function () {
     beforeEach(function () {
       writeNpmShrinkwrapJson('1.0.0')