diff --git a/lib/commands/owner.js b/lib/commands/owner.js index 40f16332b2922..3a997db800db7 100644 --- a/lib/commands/owner.js +++ b/lib/commands/owner.js @@ -120,7 +120,7 @@ class Owner extends BaseCommand { this.npm.output(maintainers.map(m => `${m.name} <${m.email}>`).join('\n')) } } catch (err) { - log.error('owner ls', "Couldn't get owner data", pkg) + log.error('owner ls', "Couldn't get owner data", npmFetch.cleanUrl(pkg)) throw err } } diff --git a/lib/commands/ping.js b/lib/commands/ping.js index 5a651c4a6ab09..c79e6a96cee40 100644 --- a/lib/commands/ping.js +++ b/lib/commands/ping.js @@ -1,3 +1,4 @@ +const { cleanUrl } = require('npm-registry-fetch') const log = require('../utils/log-shim') const pingUtil = require('../utils/ping.js') const BaseCommand = require('../base-command.js') @@ -8,14 +9,15 @@ class Ping extends BaseCommand { static name = 'ping' async exec (args) { - log.notice('PING', this.npm.config.get('registry')) + const cleanRegistry = cleanUrl(this.npm.config.get('registry')) + log.notice('PING', cleanRegistry) const start = Date.now() const details = await pingUtil({ ...this.npm.flatOptions }) const time = Date.now() - start log.notice('PONG', `${time}ms`) if (this.npm.config.get('json')) { this.npm.output(JSON.stringify({ - registry: this.npm.config.get('registry'), + registry: cleanRegistry, time, details, }, null, 2)) diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 89584e5814784..a9c4b4bc0bb6d 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -12,6 +12,7 @@ const { readdirScoped } = require('@npmcli/fs') const { lstat, readlink } = require('fs/promises') const { depth } = require('treeverse') const log = require('proc-log') +const { cleanUrl } = require('npm-registry-fetch') const { OK, @@ -1210,7 +1211,8 @@ This is a one-time fix-up, please be patient... if (this[_manifests].has(spec.raw)) { return this[_manifests].get(spec.raw) } else { - log.silly('fetch manifest', spec.raw) + const cleanRawSpec = cleanUrl(spec.rawSpec) + log.silly('fetch manifest', spec.raw.replace(spec.rawSpec, cleanRawSpec)) const p = pacote.manifest(spec, options) .then(mani => { this[_manifests].set(spec.raw, mani) diff --git a/workspaces/arborist/lib/place-dep.js b/workspaces/arborist/lib/place-dep.js index 16a0095fa0963..e757d0c38a6d7 100644 --- a/workspaces/arborist/lib/place-dep.js +++ b/workspaces/arborist/lib/place-dep.js @@ -9,6 +9,7 @@ const localeCompare = require('@isaacs/string-locale-compare')('en') const log = require('proc-log') +const { cleanUrl } = require('npm-registry-fetch') const deepestNestingTarget = require('./deepest-nesting-target.js') const CanPlaceDep = require('./can-place-dep.js') const { @@ -187,7 +188,7 @@ class PlaceDep { `${this.dep.name}@${this.dep.version}`, this.canPlace.description, `for: ${this.edge.from.package._id || this.edge.from.location}`, - `want: ${this.edge.spec || '*'}` + `want: ${cleanUrl(this.edge.spec || '*')}` ) const placementType = this.canPlace.canPlace === CONFLICT