Skip to content
Merged
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
4 changes: 4 additions & 0 deletions docs/changes/2.2.0/npm-replace-registry-host.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
An npm repository's **Connect** panel in the web UI also shows
`npm config set replace-registry-host <package-lock.json-host>`, which has npm
download the tarballs of a `package-lock.json` written against another
registry through the repository instead.
1 change: 1 addition & 0 deletions web/src/components/PackageConnect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('connectSnippets', () => {
expect(snippets.map((s) => s.command)).toEqual([
'npm config set registry https://f.example/repository/npm-all/',
'npm config set @<scope>:registry https://f.example/repository/npm-all/',
'npm config set replace-registry-host <package-lock.json-host>',
'npm login --registry https://f.example/repository/npm-all/',
])
expect(
Expand Down
7 changes: 7 additions & 0 deletions web/src/components/PackageConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ export function connectSnippets(
command: `npm config set @<scope>:registry ${url}/`,
copyLabel: 'Copy scope-registry command',
},
{
// npm rewrites a lockfile's registry.npmjs.org URLs onto `registry`
// by itself; another registry's host it has to be told.
label: 'Install a package-lock.json written against another registry',
command: 'npm config set replace-registry-host <package-lock.json-host>',
copyLabel: 'Copy replace-registry-host command',
},
{
label: 'Sign in',
command: `npm login --registry ${url}/`,
Expand Down
Loading