0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-25 02:32:52 -05:00

set ignore_latest_tag to false by default

This commit is contained in:
Alex Kocharin 2014-04-01 00:13:59 +00:00
parent 752d0f62f0
commit b4c0b89365
4 changed files with 7 additions and 7 deletions

View file

@ -109,8 +109,7 @@ function Config(config) {
this.server_id = crypto.pseudoRandomBytes(6).toString('hex')
}
// default for sinopia 0.7.x, may be changed in the future
if (this.ignore_latest_tag == null) this.ignore_latest_tag = true
if (this.ignore_latest_tag == null) this.ignore_latest_tag = false
return this
}

View file

@ -85,5 +85,5 @@ logs:
# Workaround for countless npm bugs. Must have for npm <1.14.x, but expect
# it to be turned off in future versions. If `true`, latest tag is ignored,
# and the highest semver is placed instead.
#ignore_latest_tag: true
#ignore_latest_tag: false

View file

@ -301,9 +301,9 @@ Storage.prototype.get_package = function(name, options, callback) {
if (whitelist.indexOf(i) === -1) delete result[i]
}
// ensure that latest tag is always present,
// this can be overridden with dist-tags
result['dist-tags'].latest = utils.semver_sort(Object.keys(result.versions))
if (self.config.ignore_latest_tag) {
result['dist-tags'].latest = utils.semver_sort(Object.keys(result.versions))
}
for (var i in result['dist-tags']) {
if (Array.isArray(result['dist-tags'][i])) {

View file

@ -31,7 +31,8 @@ module.exports = function() {
assert.equal(res.statusCode, 200)
assert.equal(typeof(body.versions['1.1']), 'object')
assert.equal(body['dist-tags'].something, '0.1.1alpha')
assert.equal(body['dist-tags'].latest, '0.1.3alpha')
// note: 5.4.3 is invalid tag, 0.1.3alpha is highest semver
assert.equal(body['dist-tags'].latest, '5.4.3')
assert.equal(body['dist-tags'].bad, null)
cb()
})