From dfdcaa893e07cb9e91ee5fb1ddd8955c2ddb60bc Mon Sep 17 00:00:00 2001 From: steve-p-com Date: Mon, 18 Apr 2016 20:53:00 +0100 Subject: [PATCH] Change the way package distribution tags are processed and stored --- .gitignore | 6 ++++ conf/full.yaml | 6 ---- lib/config.js | 2 -- lib/local-storage.js | 25 +++++---------- lib/storage.js | 27 ++++++---------- lib/utils.js | 68 +++++++++++++++++++++++++++------------- test/unit/st_merge.js | 16 ++-------- test/unit/tag_version.js | 23 ++++---------- 8 files changed, 77 insertions(+), 96 deletions(-) diff --git a/.gitignore b/.gitignore index 79595d190..fe652cd2d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,9 @@ bin/** test-storage* node_modules + +# Visual Studio Code +.vscode/* +.jscsrc +.jshintrc +jsconfig.json diff --git a/conf/full.yaml b/conf/full.yaml index b8c344181..4cc4d4b70 100644 --- a/conf/full.yaml +++ b/conf/full.yaml @@ -119,9 +119,3 @@ logs: # maximum size of uploaded json document # increase it if you have "request entity too large" errors #max_body_size: 1mb - -# 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: false - diff --git a/lib/config.js b/lib/config.js index e9add9ec7..df0744d75 100644 --- a/lib/config.js +++ b/lib/config.js @@ -142,8 +142,6 @@ function Config(config) { self.server_id = Crypto.pseudoRandomBytes(6).toString('hex') } - if (self.ignore_latest_tag == null) self.ignore_latest_tag = false - return self } diff --git a/lib/local-storage.js b/lib/local-storage.js index 52a03210d..e73bad50d 100644 --- a/lib/local-storage.js +++ b/lib/local-storage.js @@ -176,19 +176,7 @@ Storage.prototype.update_versions = function(name, newdata, callback) { } } for (var tag in newdata['dist-tags']) { - if (!Array.isArray(data['dist-tags'][tag]) || data['dist-tags'][tag].length != newdata['dist-tags'][tag].length) { - // backward compat - var need_change = true - } else { - for (var i=0; i