Skip to content

Commit 306bf7d

Browse files
committed
fix: add flatOptions.silent to pass through to pacote
1 parent 81da28b commit 306bf7d

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

lib/commands/diff.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ class Diff extends BaseCommand {
194194
const packument = await pacote.packument(spec, {
195195
...this.npm.flatOptions,
196196
preferOnline: true,
197-
log,
198197
})
199198
bSpec = pickManifest(
200199
packument,

lib/commands/owner.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class Owner extends BaseCommand {
5959
async exec ([action, ...args]) {
6060
const opts = {
6161
...this.npm.flatOptions,
62-
log,
6362
}
6463
switch (action) {
6564
case 'ls':

lib/commands/publish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Publish extends BaseCommand {
6161
throw new Error('Tag name must not be a valid SemVer range: ' + defaultTag.trim())
6262
}
6363

64-
const opts = { ...this.npm.flatOptions, log }
64+
const opts = { ...this.npm.flatOptions }
6565

6666
// you can publish name@version, ./foo.tgz, etc.
6767
// even though the default is the 'file:.' cwd.

lib/commands/view.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const relativeDate = require('tiny-relative-date')
1212
const semver = require('semver')
1313
const style = require('ansistyles')
1414
const { inspect, promisify } = require('util')
15-
const { packument } = require('pacote')
15+
const pacote = require('pacote')
1616

1717
const readFile = promisify(fs.readFile)
1818
const readJson = async file => jsonParse(await readFile(file, 'utf8'))
@@ -44,7 +44,7 @@ class View extends BaseCommand {
4444
preferOnline: true,
4545
}
4646
const spec = npa(opts.conf.argv.remain[2])
47-
const pckmnt = await packument(spec, config)
47+
const pckmnt = await pacote.packument(spec, config)
4848
const defaultTag = this.npm.config.get('tag')
4949
const dv = pckmnt.versions[pckmnt['dist-tags'][defaultTag]]
5050
pckmnt.versions = Object.keys(pckmnt.versions).sort(semver.compareLoose)
@@ -198,7 +198,7 @@ class View extends BaseCommand {
198198
version = spec.rawSpec
199199
}
200200

201-
const pckmnt = await packument(spec, opts)
201+
const pckmnt = await pacote.packument(spec, opts)
202202

203203
if (pckmnt['dist-tags'] && pckmnt['dist-tags'][version]) {
204204
version = pckmnt['dist-tags'][version]

lib/npm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ class Npm extends EventEmitter {
285285
const { flat } = this.config
286286
if (this.command) {
287287
flat.npmCommand = this.command
288+
// XXX: ensure we pass silent everywhere that flatOptions
289+
// is being based. this will get removed in a future refactor
290+
flat.silent = this.config.get('loglevel') === 'silent'
288291
}
289292
return flat
290293
}

workspaces/libnpmpack/lib/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ async function pack (spec = 'file:.', opts = {}) {
1414

1515
const manifest = await pacote.manifest(spec, opts)
1616

17-
// Default to true if no log options passed, set to false if we're in silent
18-
// mode
19-
const banner = !opts.log || (opts.log.level !== 'silent')
17+
// set to false if we're in silent mode
18+
const banner = !opts.silent
2019

2120
if (spec.type === 'directory') {
2221
// prepack

0 commit comments

Comments
 (0)