Skip to content

Commit b1cc530

Browse files
committed
chore(cli): remove log option from being passed anywhere
1 parent 2c1f206 commit b1cc530

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+153
-323
lines changed

lib/commands/access.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const path = require('path')
33
const libaccess = require('libnpmaccess')
44
const readPackageJson = require('read-package-json-fast')
55

6-
const log = require('../utils/log-shim.js')
76
const otplease = require('../utils/otplease.js')
87
const getIdentity = require('../utils/get-identity.js')
98
const BaseCommand = require('../base-command.js')
@@ -79,7 +78,6 @@ class Access extends BaseCommand {
7978

8079
return this[cmd](args, {
8180
...this.npm.flatOptions,
82-
log,
8381
})
8482
}
8583

lib/commands/adduser.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class AddUser extends BaseCommand {
3131
creds,
3232
registry,
3333
scope,
34-
log,
3534
})
3635

3736
await this.updateConfig({

lib/commands/ci.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class CI extends ArboristWorkspaceCmd {
3636
}
3737

3838
const where = this.npm.prefix
39+
const { silent } = this.npm.flatOptions
3940
const opts = {
4041
...this.npm.flatOptions,
4142
packageLock: true, // npm ci should never skip lock files
4243
path: where,
43-
log,
4444
save: false, // npm ci should never modify the lockfile or package.json
4545
workspaces: this.workspaceNames,
4646
}
@@ -101,7 +101,7 @@ class CI extends ArboristWorkspaceCmd {
101101
scriptShell,
102102
stdio: 'inherit',
103103
stdioString: true,
104-
banner: log.level !== 'silent',
104+
banner: !silent,
105105
event,
106106
})
107107
}

lib/commands/dedupe.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// dedupe duplicated packages, or find them in the tree
22
const Arborist = require('@npmcli/arborist')
33
const reifyFinish = require('../utils/reify-finish.js')
4-
const log = require('../utils/log-shim.js')
54

65
const ArboristWorkspaceCmd = require('../arborist-cmd.js')
76

@@ -40,7 +39,6 @@ class Dedupe extends ArboristWorkspaceCmd {
4039
const where = this.npm.prefix
4140
const opts = {
4241
...this.npm.flatOptions,
43-
log,
4442
path: where,
4543
dryRun,
4644
save,

lib/commands/deprecate.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const fetch = require('npm-registry-fetch')
2-
const log = require('../utils/log-shim.js')
32
const otplease = require('../utils/otplease.js')
43
const npa = require('npm-package-arg')
54
const semver = require('semver')
@@ -51,7 +50,6 @@ class Deprecate extends BaseCommand {
5150
...this.npm.flatOptions,
5251
spec: p,
5352
query: { write: true },
54-
log,
5553
})
5654

5755
Object.keys(packument.versions)
@@ -66,7 +64,6 @@ class Deprecate extends BaseCommand {
6664
method: 'PUT',
6765
body: packument,
6866
ignoreBody: true,
69-
log,
7067
}))
7168
}
7269
}

lib/commands/diff.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class Diff extends BaseCommand {
6161
...this.npm.flatOptions,
6262
diffFiles: args,
6363
where: this.top,
64-
log,
6564
})
6665
return this.npm.output(res)
6766
}
@@ -194,7 +193,6 @@ class Diff extends BaseCommand {
194193
const packument = await pacote.packument(spec, {
195194
...this.npm.flatOptions,
196195
preferOnline: true,
197-
log,
198196
})
199197
bSpec = pickManifest(
200198
packument,

lib/commands/dist-tag.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class DistTag extends BaseCommand {
3131
async exec ([cmdName, pkg, tag]) {
3232
const opts = {
3333
...this.npm.flatOptions,
34-
log,
3534
}
3635

3736
if (['add', 'a', 'set', 's'].includes(cmdName)) {

lib/commands/doctor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Doctor extends BaseCommand {
125125
stringLength: s => ansiTrim(s).length,
126126
}
127127

128-
const silent = log.levels[log.level] > log.levels.error
128+
const { silent } = this.npm.flatOptions
129129
if (!silent) {
130130
this.npm.output(table(outTable, tableOpts))
131131
if (!allOk) {

lib/commands/exec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const libexec = require('libnpmexec')
22
const BaseCommand = require('../base-command.js')
33
const getLocationMsg = require('../exec/get-workspace-location-msg.js')
4-
const log = require('../utils/log-shim')
54

65
// it's like this:
76
//
@@ -77,7 +76,6 @@ class Exec extends BaseCommand {
7776
call,
7877
localBin,
7978
locationMsg,
80-
log,
8179
globalBin,
8280
output,
8381
packages,

lib/commands/fund.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const pacote = require('pacote')
55
const semver = require('semver')
66
const npa = require('npm-package-arg')
77
const { depth } = require('treeverse')
8-
const log = require('../utils/log-shim.js')
98
const { readTree: getFundingInfo, normalizeFunding, isValidFunding } = require('libnpmfund')
109

1110
const completion = require('../utils/completion/installed-deep.js')
@@ -69,7 +68,6 @@ class Fund extends ArboristWorkspaceCmd {
6968
// TODO: add !workspacesEnabled option handling to libnpmfund
7069
const fundingInfo = getFundingInfo(tree, {
7170
...this.flatOptions,
72-
log,
7371
workspaces: this.workspaceNames,
7472
})
7573

0 commit comments

Comments
 (0)