Skip to content

npm Connect panel: show the replace-registry-host command - #835

Merged
schmitch merged 1 commit into
mainfrom
claude/sleepy-darwin-n79c0d
Nov 3, 2026
Merged

schmitch merged 1 commit into
mainfrom
claude/sleepy-darwin-n79c0d

Conversation

@schmitch

@schmitch schmitch commented Nov 3, 2026

Copy link
Copy Markdown
Member

An npm repository's Connect sidebar (repository page, PackageConnect) already lists npm config set registry … and the scoped npm config set @<scope>:registry …. It now also lists:

npm config set replace-registry-host <package-lock.json-host>

The new line is labelled Install a package-lock.json written against another registry and sits between the scope line and npm login. With it set, npm downloads the tarballs of a lockfile written against another registry through this repository. npm already rewrites registry.npmjs.org URLs on its own, so the setting is only needed for other hosts.

No issue asks for this UI change, so this pull request fixes none, following AGENTS.md. Its changelog fragment uses a short name: docs/changes/2.2.0/npm-replace-registry-host.feature.md. The full guide to moving lockfiles is #655, a docs issue. That guide explains how replace-registry-host behaves in each npm version, including which lockfile URLs a bare host name rewrites correctly, and it stays a pull request of its own.

Changes

  • web/src/components/PackageConnect.tsx: the new npm snippet.
  • web/src/components/PackageConnect.test.ts: the expected npm commands include it.
  • docs/changes/2.2.0/npm-replace-registry-host.feature.md: changelog fragment.

Testing

  • pnpm run tsc: clean.
  • pnpm exec vitest run src/components/PackageConnect.test.ts src/routes: 26 files, 353 tests pass.
  • cargo xtask changelog --check: 57 fragments, all for milestones after 2.1.0.

Generated by Claude Code

An npm repository's Connect sidebar lists `npm config set registry` and the
scoped variant; it now also offers
`npm config set replace-registry-host <package-lock.json-host>`, so a
package-lock.json written against another registry downloads its tarballs
through this one. npm rewrites registry.npmjs.org URLs by itself; another
registry's host it has to be told.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012e6DJXfcjjRxskuvtSWDNo
@schmitch
schmitch added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 6661009 Nov 3, 2026
19 checks passed
@schmitch
schmitch deleted the claude/sleepy-darwin-n79c0d branch November 3, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants