Skip to content
This repository has been archived by the owner on Nov 25, 2017. It is now read-only.

Commit

Permalink
feat(tag): add tag information back in to not break semantic-release …
Browse files Browse the repository at this point in the history
…just yet
  • Loading branch information
boennemann committed Aug 18, 2015
1 parent cefe60f commit bdf2ebc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const npmlog = require('npmlog')
const RegClient = require('npm-registry-client')

module.exports = function (pluginConfig, {pkg, npm, plugins}, cb) {
npmlog.level = npm.loglevel || 'error'
npmlog.level = npm.loglevel || 'warn'
const client = new RegClient({log: npmlog})

client.get(`${npm.registry}${pkg.name.replace('/', '%2F')}`, {
Expand All @@ -19,7 +19,11 @@ module.exports = function (pluginConfig, {pkg, npm, plugins}, cb) {

cb(null, {
version,
gitHead: data.versions[version].gitHead
gitHead: data.versions[version].gitHead,
get tag () {
npmlog.warn('deprecated', 'tag will be removed with the next major release')
return npm.tag
}
})
})
}
3 changes: 3 additions & 0 deletions test/specs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ test('last release from registry', (t) => {
tt.error(err)
tt.is(release.version, '1.33.7', 'version')
tt.is(release.gitHead, 'HEAD', 'gitHead')
tt.is(release.tag, 'latest', 'dist-tag')

tt.end()
})
Expand All @@ -33,6 +34,7 @@ test('last release from registry', (t) => {
tt.error(err)
tt.is(release.version, '0.8.15', 'version')
tt.is(release.gitHead, 'bar', 'gitHead')
tt.is(release.tag, 'foo', 'dist-tag')

tt.end()
})
Expand All @@ -57,6 +59,7 @@ test('last release from registry', (t) => {
tt.error(err)
tt.is(release.version, '1.33.7', 'version')
tt.is(release.gitHead, 'HEAD', 'gitHead')
tt.is(release.tag, 'latest', 'dist-tag')

tt.end()
})
Expand Down

0 comments on commit bdf2ebc

Please sign in to comment.