diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-02-27 03:08:20 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-02-27 03:20:31 +0300 |
commit | 628fcdb0be4e14c0312085a50dc2ae01dc713fa6 (patch) | |
tree | a97292ac8fb03d49d125a9e872782f7afd27ad4a /lib | |
parent | d7b785393dffce93bb70317fbc039a6428ca37c5 (diff) |
completion: remove registry calls to -/short
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bugs.js | 11 | ||||
-rw-r--r-- | lib/docs.js | 10 | ||||
-rw-r--r-- | lib/install.js | 37 | ||||
-rw-r--r-- | lib/repo.js | 11 | ||||
-rw-r--r-- | lib/view.js | 8 |
5 files changed, 16 insertions, 61 deletions
diff --git a/lib/bugs.js b/lib/bugs.js index fabbbaf10..306d9bb4b 100644 --- a/lib/bugs.js +++ b/lib/bugs.js @@ -13,14 +13,9 @@ var npm = require("./npm.js") , mapToRegistry = require("./utils/map-to-registry.js") bugs.completion = function (opts, cb) { - if (opts.conf.argv.remain.length > 2) return cb() - mapToRegistry("-/short", npm.config, function (er, uri, auth) { - if (er) return cb(er) - - npm.registry.get(uri, { timeout : 60000, auth : auth }, function (er, list) { - return cb(null, list || []) - }) - }) + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() } function bugs (args, cb) { diff --git a/lib/docs.js b/lib/docs.js index 9abe740a3..0de2349dd 100644 --- a/lib/docs.js +++ b/lib/docs.js @@ -11,13 +11,9 @@ var npm = require("./npm.js") , mapToRegistry = require("./utils/map-to-registry.js") docs.completion = function (opts, cb) { - mapToRegistry("/-/short", npm.config, function (er, uri, auth) { - if (er) return cb(er) - - npm.registry.get(uri, { timeout : 60000, auth : auth }, function (er, list) { - return cb(null, list || []) - }) - }) + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() } function url (json) { diff --git a/lib/install.js b/lib/install.js index 79b26ff09..73580e5af 100644 --- a/lib/install.js +++ b/lib/install.js @@ -65,7 +65,7 @@ install.completion = function (opts, cb) { }) } - fs.readdir(partialPath, function (err, siblings) { + return fs.readdir(partialPath, function (err, siblings) { if (err) return cb(null, []) // invalid dir: no matching asyncMap(siblings, annotatePackageDirMatch, function (err, matches) { @@ -79,40 +79,11 @@ install.completion = function (opts, cb) { return cb(null, [cleaned[0].fullPath]) }) }) - return } - mapToRegistry("-/short", npm.config, function (er, uri, auth) { - if (er) return cb(er) - - var options = { auth : auth } - npm.registry.get(uri, options, function (er, pkgs) { - if (er) return cb() - if (!opts.partialWord) return cb(null, pkgs) - - var name = npa(opts.partialWord).name - pkgs = pkgs.filter(function (p) { - return p.indexOf(name) === 0 - }) - - if (pkgs.length !== 1 && opts.partialWord === name) { - return cb(null, pkgs) - } - - mapToRegistry(pkgs[0], npm.config, function (er, uri) { - if (er) return cb(er) - - npm.registry.get(uri, options, function (er, d) { - if (er) return cb() - return cb(null, Object.keys(d["dist-tags"] || {}) - .concat(Object.keys(d.versions || {})) - .map(function (t) { - return pkgs[0] + "@" + t - })) - }) - }) - }) - }) + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() } var npm = require("./npm.js") diff --git a/lib/repo.js b/lib/repo.js index 3db4a16bc..1b0454773 100644 --- a/lib/repo.js +++ b/lib/repo.js @@ -15,14 +15,9 @@ var npm = require("./npm.js") , npa = require("npm-package-arg") repo.completion = function (opts, cb) { - if (opts.conf.argv.remain.length > 2) return cb() - mapToRegistry("/-/short", npm.config, function (er, uri) { - if (er) return cb(er) - - npm.registry.get(uri, { timeout : 60000 }, function (er, list) { - return cb(null, list || []) - }) - }) + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() } function repo (args, cb) { diff --git a/lib/view.js b/lib/view.js index bd20ab5a3..47da39b64 100644 --- a/lib/view.js +++ b/lib/view.js @@ -14,11 +14,9 @@ var npm = require("./npm.js") view.completion = function (opts, cb) { if (opts.conf.argv.remain.length <= 2) { - return mapToRegistry("-/short", npm.config, function (er, uri, auth) { - if (er) return cb(er) - - npm.registry.get(uri, { auth : auth }, cb) - }) + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + return cb() } // have the package, get the fields. var tag = npm.config.get("tag") |