Skip to content

Commit

Permalink
npm-registry-client: goodbye
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Dec 10, 2018
1 parent b24ed5f commit ec9fcc1
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 348 deletions.
2 changes: 1 addition & 1 deletion lib/config/figgy-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function mkConfig (...providers) {
includeDeprecated: false,
'npm-session': npmSession,
'project-scope': npm.projectScope,
refer: npm.registry.refer,
refer: npm.refer,
dmode: npm.modes.exec,
fmode: npm.modes.file,
umask: npm.modes.umask,
Expand Down
2 changes: 1 addition & 1 deletion lib/config/pacote.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function pacoteOpts (moreOpts) {
projectScope: npm.projectScope,
proxy: npm.config.get('https-proxy') || npm.config.get('proxy'),
noProxy: npm.config.get('noproxy'),
refer: npm.registry.refer,
refer: npm.referer,
registry: npm.config.get('registry'),
retry: {
retries: npm.config.get('fetch-retries'),
Expand Down
29 changes: 0 additions & 29 deletions lib/config/reg-client.js

This file was deleted.

16 changes: 1 addition & 15 deletions lib/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
var which = require('which')
var glob = require('glob')
var rimraf = require('rimraf')
var lazyProperty = require('lazy-property')
var parseJSON = require('./utils/parse-json.js')
var clientConfig = require('./config/reg-client.js')
var aliases = require('./config/cmd-list').aliases
var cmdList = require('./config/cmd-list').cmdList
var plumbing = require('./config/cmd-list').plumbing
Expand Down Expand Up @@ -106,7 +104,6 @@
})

var registryRefer
var registryLoaded

Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) {
Object.defineProperty(npm.commands, c, { get: function () {
Expand Down Expand Up @@ -153,7 +150,7 @@
}).filter(function (arg) {
return arg && arg.match
}).join(' ')
if (registryLoaded) npm.registry.refer = registryRefer
npm.referer = registryRefer
}

cmd.apply(npm, args)
Expand Down Expand Up @@ -357,17 +354,6 @@
npm.projectScope = config.get('scope') ||
scopeifyScope(getProjectScope(npm.prefix))

// at this point the configs are all set.
// go ahead and spin up the registry client.
lazyProperty(npm, 'registry', function () {
registryLoaded = true
var RegClient = require('npm-registry-client')
var registry = new RegClient(clientConfig(npm, log, npm.config))
registry.version = npm.version
registry.refer = registryRefer
return registry
})

startMetrics()

return cb(null, npm)
Expand Down
2 changes: 0 additions & 2 deletions lib/org.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict'

const BB = require('bluebird')

const figgyPudding = require('figgy-pudding')
const liborg = require('libnpm/org')
const npmConfig = require('./config/figgy-config.js')
Expand Down
3 changes: 1 addition & 2 deletions lib/utils/error-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ function errorMessage (er) {

case 'EOTP':
case 'E401':
// the E401 message checking is a hack till we replace npm-registry-client with something
// OTP aware.
// E401 is for places where we accidentally neglect OTP stuff
if (er.code === 'EOTP' || /one-time pass/.test(er.message)) {
short.push(['', 'This operation requires a one-time password from your authenticator.'])
detail.push([
Expand Down
29 changes: 0 additions & 29 deletions lib/utils/get-publish-config.js

This file was deleted.

103 changes: 0 additions & 103 deletions lib/utils/map-to-registry.js

This file was deleted.

Loading

0 comments on commit ec9fcc1

Please sign in to comment.