Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass publishConfig through to npm-registry-fetch #1949

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ const publish_ = async (arg, opts) => {
// The purpose of re-reading the manifest is in case it changed,
// so that we send the latest and greatest thing to the registry
manifest = await readJson(`${arg}/package.json`)
await otplease(opts, opts => libpub(arg, manifest, opts))
const { publishConfig } = manifest
await otplease(opts, opts => libpub(arg, manifest, { ...opts, publishConfig }))
}

// publish
Expand Down
7 changes: 7 additions & 0 deletions node_modules/npm-registry-fetch/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions node_modules/npm-registry-fetch/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/npm-registry-fetch/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion test/lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ const { test, cleanSnapshot } = require('tap')
const requireInject = require('require-inject')

test('should publish with libnpmpublish', (t) => {
const publishConfig = { registry: 'https://some.registry' }
const testDir = t.testdir({
'package.json': JSON.stringify({
name: 'my-cool-pkg',
version: '1.0.0'
version: '1.0.0',
publishConfig
}, null, 2)
})

Expand All @@ -32,6 +34,7 @@ test('should publish with libnpmpublish', (t) => {
t.ok(arg, 'gets path')
t.ok(manifest, 'gets manifest')
t.ok(opts, 'gets opts object')
t.same(opts.publishConfig, publishConfig, 'publishConfig is passed through')
t.ok(true, 'libnpmpublish is called')
}
},
Expand Down