summaryrefslogtreecommitdiff
path: root/deps/npm/lib/commands
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/commands')
-rw-r--r--deps/npm/lib/commands/access.js2
-rw-r--r--deps/npm/lib/commands/adduser.js1
-rw-r--r--deps/npm/lib/commands/ci.js3
-rw-r--r--deps/npm/lib/commands/dedupe.js2
-rw-r--r--deps/npm/lib/commands/deprecate.js3
-rw-r--r--deps/npm/lib/commands/diff.js2
-rw-r--r--deps/npm/lib/commands/dist-tag.js1
-rw-r--r--deps/npm/lib/commands/doctor.js3
-rw-r--r--deps/npm/lib/commands/exec.js2
-rw-r--r--deps/npm/lib/commands/fund.js2
-rw-r--r--deps/npm/lib/commands/hook.js10
-rw-r--r--deps/npm/lib/commands/init.js1
-rw-r--r--deps/npm/lib/commands/install.js3
-rw-r--r--deps/npm/lib/commands/link.js6
-rw-r--r--deps/npm/lib/commands/logout.js1
-rw-r--r--deps/npm/lib/commands/org.js8
-rw-r--r--deps/npm/lib/commands/owner.js2
-rw-r--r--deps/npm/lib/commands/ping.js2
-rw-r--r--deps/npm/lib/commands/profile.js8
-rw-r--r--deps/npm/lib/commands/prune.js2
-rw-r--r--deps/npm/lib/commands/publish.js6
-rw-r--r--deps/npm/lib/commands/run-script.js6
-rw-r--r--deps/npm/lib/commands/star.js4
-rw-r--r--deps/npm/lib/commands/team.js15
-rw-r--r--deps/npm/lib/commands/token.js2
-rw-r--r--deps/npm/lib/commands/uninstall.js2
-rw-r--r--deps/npm/lib/commands/unpublish.js7
-rw-r--r--deps/npm/lib/commands/update.js1
-rw-r--r--deps/npm/lib/commands/whoami.js3
29 files changed, 34 insertions, 76 deletions
diff --git a/deps/npm/lib/commands/access.js b/deps/npm/lib/commands/access.js
index 7d3930dacb..206d6de9c2 100644
--- a/deps/npm/lib/commands/access.js
+++ b/deps/npm/lib/commands/access.js
@@ -3,7 +3,6 @@ const path = require('path')
const libaccess = require('libnpmaccess')
const readPackageJson = require('read-package-json-fast')
-const log = require('../utils/log-shim.js')
const otplease = require('../utils/otplease.js')
const getIdentity = require('../utils/get-identity.js')
const BaseCommand = require('../base-command.js')
@@ -79,7 +78,6 @@ class Access extends BaseCommand {
return this[cmd](args, {
...this.npm.flatOptions,
- log,
})
}
diff --git a/deps/npm/lib/commands/adduser.js b/deps/npm/lib/commands/adduser.js
index 1cf70fffbf..cbeaaaf0f2 100644
--- a/deps/npm/lib/commands/adduser.js
+++ b/deps/npm/lib/commands/adduser.js
@@ -31,7 +31,6 @@ class AddUser extends BaseCommand {
creds,
registry,
scope,
- log,
})
await this.updateConfig({
diff --git a/deps/npm/lib/commands/ci.js b/deps/npm/lib/commands/ci.js
index 5e862a473a..e054bee516 100644
--- a/deps/npm/lib/commands/ci.js
+++ b/deps/npm/lib/commands/ci.js
@@ -40,7 +40,6 @@ class CI extends ArboristWorkspaceCmd {
...this.npm.flatOptions,
packageLock: true, // npm ci should never skip lock files
path: where,
- log,
save: false, // npm ci should never modify the lockfile or package.json
workspaces: this.workspaceNames,
}
@@ -101,7 +100,7 @@ class CI extends ArboristWorkspaceCmd {
scriptShell,
stdio: 'inherit',
stdioString: true,
- banner: log.level !== 'silent',
+ banner: !this.npm.silent,
event,
})
}
diff --git a/deps/npm/lib/commands/dedupe.js b/deps/npm/lib/commands/dedupe.js
index 1c270249ad..4662ce3241 100644
--- a/deps/npm/lib/commands/dedupe.js
+++ b/deps/npm/lib/commands/dedupe.js
@@ -1,7 +1,6 @@
// dedupe duplicated packages, or find them in the tree
const Arborist = require('@npmcli/arborist')
const reifyFinish = require('../utils/reify-finish.js')
-const log = require('../utils/log-shim.js')
const ArboristWorkspaceCmd = require('../arborist-cmd.js')
@@ -40,7 +39,6 @@ class Dedupe extends ArboristWorkspaceCmd {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
- log,
path: where,
dryRun,
save,
diff --git a/deps/npm/lib/commands/deprecate.js b/deps/npm/lib/commands/deprecate.js
index 5505b9bf77..839e974caf 100644
--- a/deps/npm/lib/commands/deprecate.js
+++ b/deps/npm/lib/commands/deprecate.js
@@ -1,5 +1,4 @@
const fetch = require('npm-registry-fetch')
-const log = require('../utils/log-shim.js')
const otplease = require('../utils/otplease.js')
const npa = require('npm-package-arg')
const semver = require('semver')
@@ -51,7 +50,6 @@ class Deprecate extends BaseCommand {
...this.npm.flatOptions,
spec: p,
query: { write: true },
- log,
})
Object.keys(packument.versions)
@@ -66,7 +64,6 @@ class Deprecate extends BaseCommand {
method: 'PUT',
body: packument,
ignoreBody: true,
- log,
}))
}
}
diff --git a/deps/npm/lib/commands/diff.js b/deps/npm/lib/commands/diff.js
index b3855aa08f..d737a58dc4 100644
--- a/deps/npm/lib/commands/diff.js
+++ b/deps/npm/lib/commands/diff.js
@@ -61,7 +61,6 @@ class Diff extends BaseCommand {
...this.npm.flatOptions,
diffFiles: args,
where: this.top,
- log,
})
return this.npm.output(res)
}
@@ -194,7 +193,6 @@ class Diff extends BaseCommand {
const packument = await pacote.packument(spec, {
...this.npm.flatOptions,
preferOnline: true,
- log,
})
bSpec = pickManifest(
packument,
diff --git a/deps/npm/lib/commands/dist-tag.js b/deps/npm/lib/commands/dist-tag.js
index e2b013206d..bb36f3f72b 100644
--- a/deps/npm/lib/commands/dist-tag.js
+++ b/deps/npm/lib/commands/dist-tag.js
@@ -31,7 +31,6 @@ class DistTag extends BaseCommand {
async exec ([cmdName, pkg, tag]) {
const opts = {
...this.npm.flatOptions,
- log,
}
if (['add', 'a', 'set', 's'].includes(cmdName)) {
diff --git a/deps/npm/lib/commands/doctor.js b/deps/npm/lib/commands/doctor.js
index 47a522eb67..508faa57aa 100644
--- a/deps/npm/lib/commands/doctor.js
+++ b/deps/npm/lib/commands/doctor.js
@@ -125,8 +125,7 @@ class Doctor extends BaseCommand {
stringLength: s => ansiTrim(s).length,
}
- const silent = log.levels[log.level] > log.levels.error
- if (!silent) {
+ if (!this.npm.silent) {
this.npm.output(table(outTable, tableOpts))
if (!allOk) {
console.error('')
diff --git a/deps/npm/lib/commands/exec.js b/deps/npm/lib/commands/exec.js
index 61a6d96595..52fb1f8eb7 100644
--- a/deps/npm/lib/commands/exec.js
+++ b/deps/npm/lib/commands/exec.js
@@ -1,7 +1,6 @@
const libexec = require('libnpmexec')
const BaseCommand = require('../base-command.js')
const getLocationMsg = require('../exec/get-workspace-location-msg.js')
-const log = require('../utils/log-shim')
// it's like this:
//
@@ -77,7 +76,6 @@ class Exec extends BaseCommand {
call,
localBin,
locationMsg,
- log,
globalBin,
output,
packages,
diff --git a/deps/npm/lib/commands/fund.js b/deps/npm/lib/commands/fund.js
index 47a51c33a6..787a5193f0 100644
--- a/deps/npm/lib/commands/fund.js
+++ b/deps/npm/lib/commands/fund.js
@@ -5,7 +5,6 @@ const pacote = require('pacote')
const semver = require('semver')
const npa = require('npm-package-arg')
const { depth } = require('treeverse')
-const log = require('../utils/log-shim.js')
const { readTree: getFundingInfo, normalizeFunding, isValidFunding } = require('libnpmfund')
const completion = require('../utils/completion/installed-deep.js')
@@ -69,7 +68,6 @@ class Fund extends ArboristWorkspaceCmd {
// TODO: add !workspacesEnabled option handling to libnpmfund
const fundingInfo = getFundingInfo(tree, {
...this.flatOptions,
- log,
workspaces: this.workspaceNames,
})
diff --git a/deps/npm/lib/commands/hook.js b/deps/npm/lib/commands/hook.js
index c99a995858..2ff6ac01ce 100644
--- a/deps/npm/lib/commands/hook.js
+++ b/deps/npm/lib/commands/hook.js
@@ -2,7 +2,6 @@ const hookApi = require('libnpmhook')
const otplease = require('../utils/otplease.js')
const relativeDate = require('tiny-relative-date')
const Table = require('cli-table3')
-const log = require('../utils/log-shim.js')
const BaseCommand = require('../base-command.js')
class Hook extends BaseCommand {
@@ -23,7 +22,6 @@ class Hook extends BaseCommand {
async exec (args) {
return otplease({
...this.npm.flatOptions,
- log,
}, (opts) => {
switch (args[0]) {
case 'add':
@@ -48,7 +46,7 @@ class Hook extends BaseCommand {
} else if (opts.parseable) {
this.npm.output(Object.keys(hook).join('\t'))
this.npm.output(Object.keys(hook).map(k => hook[k]).join('\t'))
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(`+ ${this.hookName(hook)} ${
opts.unicode ? ' ➜ ' : ' -> '
} ${hook.endpoint}`)
@@ -66,7 +64,7 @@ class Hook extends BaseCommand {
})
} else if (!hooks.length) {
this.npm.output("You don't have any hooks configured yet.")
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
if (hooks.length === 1) {
this.npm.output('You have one hook configured.')
} else {
@@ -103,7 +101,7 @@ class Hook extends BaseCommand {
} else if (opts.parseable) {
this.npm.output(Object.keys(hook).join('\t'))
this.npm.output(Object.keys(hook).map(k => hook[k]).join('\t'))
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(`- ${this.hookName(hook)} ${
opts.unicode ? ' ✘ ' : ' X '
} ${hook.endpoint}`)
@@ -117,7 +115,7 @@ class Hook extends BaseCommand {
} else if (opts.parseable) {
this.npm.output(Object.keys(hook).join('\t'))
this.npm.output(Object.keys(hook).map(k => hook[k]).join('\t'))
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(`+ ${this.hookName(hook)} ${
opts.unicode ? ' ➜ ' : ' -> '
} ${hook.endpoint}`)
diff --git a/deps/npm/lib/commands/init.js b/deps/npm/lib/commands/init.js
index 7e8a8f7a5c..367533f825 100644
--- a/deps/npm/lib/commands/init.js
+++ b/deps/npm/lib/commands/init.js
@@ -114,7 +114,6 @@ class Init extends BaseCommand {
color,
localBin,
locationMsg,
- log,
globalBin,
output,
path,
diff --git a/deps/npm/lib/commands/install.js b/deps/npm/lib/commands/install.js
index a92a5edc5e..61526abb78 100644
--- a/deps/npm/lib/commands/install.js
+++ b/deps/npm/lib/commands/install.js
@@ -147,7 +147,6 @@ class Install extends ArboristWorkspaceCmd {
const opts = {
...this.npm.flatOptions,
- log,
auditLevel: null,
path: where,
add: args,
@@ -173,7 +172,7 @@ class Install extends ArboristWorkspaceCmd {
scriptShell,
stdio: 'inherit',
stdioString: true,
- banner: log.level !== 'silent',
+ banner: !this.npm.silent,
event,
})
}
diff --git a/deps/npm/lib/commands/link.js b/deps/npm/lib/commands/link.js
index e8e2c6b349..d656791469 100644
--- a/deps/npm/lib/commands/link.js
+++ b/deps/npm/lib/commands/link.js
@@ -7,7 +7,6 @@ const Arborist = require('@npmcli/arborist')
const npa = require('npm-package-arg')
const rpj = require('read-package-json-fast')
const semver = require('semver')
-const log = require('../utils/log-shim.js')
const reifyFinish = require('../utils/reify-finish.js')
@@ -69,7 +68,6 @@ class Link extends ArboristWorkspaceCmd {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
- log,
global: true,
prune: false,
}
@@ -118,7 +116,6 @@ class Link extends ArboristWorkspaceCmd {
const localArb = new Arborist({
...this.npm.flatOptions,
prune: false,
- log,
path: this.npm.prefix,
save,
})
@@ -126,7 +123,6 @@ class Link extends ArboristWorkspaceCmd {
...this.npm.flatOptions,
prune: false,
path: this.npm.prefix,
- log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
workspaces: this.workspaceNames,
@@ -143,12 +139,10 @@ class Link extends ArboristWorkspaceCmd {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
- log,
global: true,
})
await arb.reify({
add,
- log,
})
await reifyFinish(this.npm, arb)
}
diff --git a/deps/npm/lib/commands/logout.js b/deps/npm/lib/commands/logout.js
index 34fbace583..aea5e93652 100644
--- a/deps/npm/lib/commands/logout.js
+++ b/deps/npm/lib/commands/logout.js
@@ -25,7 +25,6 @@ class Logout extends BaseCommand {
...this.npm.flatOptions,
method: 'DELETE',
ignoreBody: true,
- log,
})
} else if (auth.isBasicAuth) {
log.verbose('logout', `clearing user credentials for ${reg}`)
diff --git a/deps/npm/lib/commands/org.js b/deps/npm/lib/commands/org.js
index 89859200fe..f3d344ca33 100644
--- a/deps/npm/lib/commands/org.js
+++ b/deps/npm/lib/commands/org.js
@@ -2,7 +2,6 @@ const liborg = require('libnpmorg')
const otplease = require('../utils/otplease.js')
const Table = require('cli-table3')
const BaseCommand = require('../base-command.js')
-const log = require('../utils/log-shim.js')
class Org extends BaseCommand {
static description = 'Manage orgs'
@@ -35,7 +34,6 @@ class Org extends BaseCommand {
async exec ([cmd, orgname, username, role], cb) {
return otplease({
...this.npm.flatOptions,
- log,
}, opts => {
switch (cmd) {
case 'add':
@@ -76,7 +74,7 @@ class Org extends BaseCommand {
this.npm.output(
[memDeets.org.name, memDeets.org.size, memDeets.user, memDeets.role].join('\t')
)
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(
`Added ${memDeets.user} as ${memDeets.role} to ${memDeets.org.name}. You now have ${
memDeets.org.size
@@ -118,7 +116,7 @@ class Org extends BaseCommand {
} else if (opts.parseable) {
this.npm.output(['user', 'org', 'userCount', 'deleted'].join('\t'))
this.npm.output([user, org, userCount, true].join('\t'))
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(
`Successfully removed ${user} from ${org}. You now have ${userCount} member${
userCount === 1 ? '' : 's'
@@ -149,7 +147,7 @@ class Org extends BaseCommand {
Object.keys(roster).forEach(user => {
this.npm.output([user, roster[user]].join('\t'))
})
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
const table = new Table({ head: ['user', 'role'] })
Object.keys(roster)
.sort()
diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js
index 7b76b7be42..effaaa6a53 100644
--- a/deps/npm/lib/commands/owner.js
+++ b/deps/npm/lib/commands/owner.js
@@ -59,7 +59,6 @@ class Owner extends BaseCommand {
async exec ([action, ...args]) {
const opts = {
...this.npm.flatOptions,
- log,
}
switch (action) {
case 'ls':
@@ -198,7 +197,6 @@ class Owner extends BaseCommand {
method: 'PUT',
body,
spec,
- log,
})
})
diff --git a/deps/npm/lib/commands/ping.js b/deps/npm/lib/commands/ping.js
index 27089be4e1..5a651c4a6a 100644
--- a/deps/npm/lib/commands/ping.js
+++ b/deps/npm/lib/commands/ping.js
@@ -10,7 +10,7 @@ class Ping extends BaseCommand {
async exec (args) {
log.notice('PING', this.npm.config.get('registry'))
const start = Date.now()
- const details = await pingUtil({ ...this.npm.flatOptions, log })
+ const details = await pingUtil({ ...this.npm.flatOptions })
const time = Date.now() - start
log.notice('PONG', `${time}ms`)
if (this.npm.config.get('json')) {
diff --git a/deps/npm/lib/commands/profile.js b/deps/npm/lib/commands/profile.js
index 9786e9ba4d..6b4d1407f7 100644
--- a/deps/npm/lib/commands/profile.js
+++ b/deps/npm/lib/commands/profile.js
@@ -108,7 +108,7 @@ class Profile extends BaseCommand {
async get (args) {
const tfa = 'two-factor auth'
const info = await pulseTillDone.withPromise(
- npmProfile.get({ ...this.npm.flatOptions, log })
+ npmProfile.get({ ...this.npm.flatOptions })
)
if (!info.cidr_whitelist) {
@@ -170,7 +170,7 @@ class Profile extends BaseCommand {
}
async set (args) {
- const conf = { ...this.npm.flatOptions, log }
+ const conf = { ...this.npm.flatOptions }
const prop = (args[0] || '').toLowerCase().trim()
let value = args.length > 1 ? args.slice(1).join(' ') : null
@@ -285,7 +285,7 @@ class Profile extends BaseCommand {
if (auth.basic) {
log.info('profile', 'Updating authentication to bearer token')
const result = await npmProfile.createToken(
- auth.basic.password, false, [], { ...this.npm.flatOptions, log }
+ auth.basic.password, false, [], { ...this.npm.flatOptions }
)
if (!result.token) {
@@ -309,7 +309,7 @@ class Profile extends BaseCommand {
log.info('profile', 'Determine if tfa is pending')
const userInfo = await pulseTillDone.withPromise(
- npmProfile.get({ ...this.npm.flatOptions, log })
+ npmProfile.get({ ...this.npm.flatOptions })
)
const conf = { ...this.npm.flatOptions }
diff --git a/deps/npm/lib/commands/prune.js b/deps/npm/lib/commands/prune.js
index 5831df6285..16c8b6d432 100644
--- a/deps/npm/lib/commands/prune.js
+++ b/deps/npm/lib/commands/prune.js
@@ -1,6 +1,5 @@
// prune extraneous packages
const Arborist = require('@npmcli/arborist')
-const log = require('../utils/log-shim.js')
const reifyFinish = require('../utils/reify-finish.js')
const ArboristWorkspaceCmd = require('../arborist-cmd.js')
@@ -15,7 +14,6 @@ class Prune extends ArboristWorkspaceCmd {
const opts = {
...this.npm.flatOptions,
path: where,
- log,
workspaces: this.workspaceNames,
}
const arb = new Arborist(opts)
diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js
index 63106c520b..d1f0ee743c 100644
--- a/deps/npm/lib/commands/publish.js
+++ b/deps/npm/lib/commands/publish.js
@@ -55,13 +55,13 @@ class Publish extends BaseCommand {
const json = this.npm.config.get('json')
const defaultTag = this.npm.config.get('tag')
const ignoreScripts = this.npm.config.get('ignore-scripts')
- const silent = log.level === 'silent'
+ const { silent } = this.npm
if (semver.validRange(defaultTag)) {
throw new Error('Tag name must not be a valid SemVer range: ' + defaultTag.trim())
}
- const opts = { ...this.npm.flatOptions, log }
+ const opts = { ...this.npm.flatOptions }
// you can publish name@version, ./foo.tgz, etc.
// even though the default is the 'file:.' cwd.
@@ -152,7 +152,7 @@ class Publish extends BaseCommand {
const results = {}
const json = this.npm.config.get('json')
- const silent = log.level === 'silent'
+ const { silent } = this.npm
const noop = a => a
const color = this.npm.color ? chalk : { green: noop, bold: noop }
await this.setWorkspaces(filters)
diff --git a/deps/npm/lib/commands/run-script.js b/deps/npm/lib/commands/run-script.js
index cd877e0b3d..edba95821b 100644
--- a/deps/npm/lib/commands/run-script.js
+++ b/deps/npm/lib/commands/run-script.js
@@ -116,7 +116,7 @@ class RunScript extends BaseCommand {
stdio: 'inherit',
stdioString: true,
pkg,
- banner: log.level !== 'silent',
+ banner: !this.npm.silent,
}
for (const [event, args] of events) {
@@ -139,7 +139,7 @@ class RunScript extends BaseCommand {
}
const allScripts = Object.keys(scripts)
- if (log.level === 'silent') {
+ if (this.npm.silent) {
return allScripts
}
@@ -233,7 +233,7 @@ class RunScript extends BaseCommand {
async listWorkspaces (args, filters) {
await this.setWorkspaces(filters)
- if (log.level === 'silent') {
+ if (this.npm.silent) {
return
}
diff --git a/deps/npm/lib/commands/star.js b/deps/npm/lib/commands/star.js
index 4974c39883..2d08747aa7 100644
--- a/deps/npm/lib/commands/star.js
+++ b/deps/npm/lib/commands/star.js
@@ -29,13 +29,12 @@ class Star extends BaseCommand {
const pkgs = args.map(npa)
for (const pkg of pkgs) {
const [username, fullData] = await Promise.all([
- getIdentity(this.npm, { ...this.npm.flatOptions, log }),
+ getIdentity(this.npm, { ...this.npm.flatOptions }),
fetch.json(pkg.escapedName, {
...this.npm.flatOptions,
spec: pkg,
query: { write: true },
preferOnline: true,
- log,
}),
])
@@ -64,7 +63,6 @@ class Star extends BaseCommand {
spec: pkg,
method: 'PUT',
body,
- log,
})
this.npm.output(show + ' ' + pkg.name)
diff --git a/deps/npm/lib/commands/team.js b/deps/npm/lib/commands/team.js
index e3fb9b83c5..1e13a83f52 100644
--- a/deps/npm/lib/commands/team.js
+++ b/deps/npm/lib/commands/team.js
@@ -1,7 +1,6 @@
const columns = require('cli-columns')
const libteam = require('libnpmteam')
-const log = require('../utils/log-shim.js')
const otplease = require('../utils/otplease.js')
const BaseCommand = require('../base-command.js')
@@ -43,7 +42,7 @@ class Team extends BaseCommand {
// XXX: "description" option to libnpmteam is used as a description of the
// team, but in npm's options, this is a boolean meaning "show the
// description in npm search output". Hence its being set to null here.
- await otplease({ ...this.npm.flatOptions, log }, opts => {
+ await otplease({ ...this.npm.flatOptions }, opts => {
entity = entity.replace(/^@/, '')
switch (cmd) {
case 'create': return this.create(entity, opts)
@@ -73,7 +72,7 @@ class Team extends BaseCommand {
}))
} else if (opts.parseable) {
this.npm.output(`${entity}\tcreated`)
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(`+@${entity}`)
}
}
@@ -87,7 +86,7 @@ class Team extends BaseCommand {
}))
} else if (opts.parseable) {
this.npm.output(`${entity}\tdeleted`)
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(`-@${entity}`)
}
}
@@ -102,7 +101,7 @@ class Team extends BaseCommand {
}))
} else if (opts.parseable) {
this.npm.output(`${user}\t${entity}\tadded`)
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(`${user} added to @${entity}`)
}
}
@@ -117,7 +116,7 @@ class Team extends BaseCommand {
}))
} else if (opts.parseable) {
this.npm.output(`${user}\t${entity}\tremoved`)
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
this.npm.output(`${user} removed from @${entity}`)
}
}
@@ -128,7 +127,7 @@ class Team extends BaseCommand {
this.npm.output(JSON.stringify(users, null, 2))
} else if (opts.parseable) {
this.npm.output(users.join('\n'))
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
const plural = users.length === 1 ? '' : 's'
const more = users.length === 0 ? '' : ':\n'
this.npm.output(`\n@${entity} has ${users.length} user${plural}${more}`)
@@ -142,7 +141,7 @@ class Team extends BaseCommand {
this.npm.output(JSON.stringify(teams, null, 2))
} else if (opts.parseable) {
this.npm.output(teams.join('\n'))
- } else if (!opts.silent && opts.loglevel !== 'silent') {
+ } else if (!this.npm.silent) {
const plural = teams.length === 1 ? '' : 's'
const more = teams.length === 0 ? '' : ':\n'
this.npm.output(`\n@${entity} has ${teams.length} team${plural}${more}`)
diff --git a/deps/npm/lib/commands/token.js b/deps/npm/lib/commands/token.js
index cfb5ab6665..df80f1afec 100644
--- a/deps/npm/lib/commands/token.js
+++ b/deps/npm/lib/commands/token.js
@@ -168,7 +168,7 @@ class Token extends BaseCommand {
}
config () {
- const conf = { ...this.npm.flatOptions, log }
+ const conf = { ...this.npm.flatOptions }
const creds = this.npm.config.getCredentialsByURI(conf.registry)
if (creds.token) {
conf.auth = { token: creds.token }
diff --git a/deps/npm/lib/commands/uninstall.js b/deps/npm/lib/commands/uninstall.js
index b40c59bda4..587968e3bb 100644
--- a/deps/npm/lib/commands/uninstall.js
+++ b/deps/npm/lib/commands/uninstall.js
@@ -1,5 +1,4 @@
const { resolve } = require('path')
-const log = require('../utils/log-shim.js')
const Arborist = require('@npmcli/arborist')
const rpj = require('read-package-json-fast')
@@ -49,7 +48,6 @@ class Uninstall extends ArboristWorkspaceCmd {
const opts = {
...this.npm.flatOptions,
path,
- log,
rm: args,
workspaces: this.workspaceNames,
}
diff --git a/deps/npm/lib/commands/unpublish.js b/deps/npm/lib/commands/unpublish.js
index d8410cc134..c848b6389d 100644
--- a/deps/npm/lib/commands/unpublish.js
+++ b/deps/npm/lib/commands/unpublish.js
@@ -32,7 +32,7 @@ class Unpublish extends BaseCommand {
return []
}
- const opts = { ...this.npm.flatOptions, log }
+ const opts = { ...this.npm.flatOptions }
const username = await getIdentity(this.npm, { ...opts }).catch(() => null)
if (!username) {
return []
@@ -68,8 +68,7 @@ class Unpublish extends BaseCommand {
const spec = args.length && npa(args[0])
const force = this.npm.config.get('force')
- const loglevel = this.npm.config.get('loglevel')
- const silent = loglevel === 'silent'
+ const { silent } = this.npm
const dryRun = this.npm.config.get('dry-run')
let pkgName
let pkgVersion
@@ -84,7 +83,7 @@ class Unpublish extends BaseCommand {
)
}
- const opts = { ...this.npm.flatOptions, log }
+ const opts = { ...this.npm.flatOptions }
if (!spec || path.resolve(spec.name) === this.npm.localPrefix) {
// if there's a package.json in the current folder, then
// read the package name and version out of that.
diff --git a/deps/npm/lib/commands/update.js b/deps/npm/lib/commands/update.js
index c55d7cf575..025ebbaf81 100644
--- a/deps/npm/lib/commands/update.js
+++ b/deps/npm/lib/commands/update.js
@@ -54,7 +54,6 @@ class Update extends ArboristWorkspaceCmd {
const opts = {
...this.npm.flatOptions,
- log,
path: where,
save,
workspaces: this.workspaceNames,
diff --git a/deps/npm/lib/commands/whoami.js b/deps/npm/lib/commands/whoami.js
index 07ebe2e244..154cc87039 100644
--- a/deps/npm/lib/commands/whoami.js
+++ b/deps/npm/lib/commands/whoami.js
@@ -1,5 +1,4 @@
const getIdentity = require('../utils/get-identity.js')
-const log = require('../utils/log-shim.js')
const BaseCommand = require('../base-command.js')
class Whoami extends BaseCommand {
@@ -8,7 +7,7 @@ class Whoami extends BaseCommand {
static params = ['registry']
async exec (args) {
- const username = await getIdentity(this.npm, { ...this.npm.flatOptions, log })
+ const username = await getIdentity(this.npm, { ...this.npm.flatOptions })
this.npm.output(
this.npm.config.get('json') ? JSON.stringify(username) : username
)