Skip to content

fix(hub): support npm registry proxies in devcontainers - #24

Merged
weastler merged 1 commit into
mainfrom
weastler-devcontainer-npm-proxy
Oct 19, 2026
Merged

weastler merged 1 commit into
mainfrom
weastler-devcontainer-npm-proxy

Conversation

@weastler

Copy link
Copy Markdown
Collaborator

Why

Contributors on networks that require an npm registry proxy need the devcontainer setup to use that registry from the start. Configuring npm only after startup is too late: installing the devcontainer CLI or the initial project dependencies can already fail. This change provides an explicit, portable way to choose a registry without embedding a particular network's settings or downgrading dependencies to match its package availability.

What changes

Add an opt-in --use-npm-proxy URL option to the devcontainer wrapper's startup commands. It accepts a credential-free HTTP(S) registry URL, uses the standard NPM_CONFIG_REGISTRY setting for CLI installation and initial dependency setup, then saves the registry in the container user's npm settings for later commands. It can also update an existing container without rebuilding or removing it. The development guide documents usage and how to remove the saved override.

Disable the Node feature's unused optional pnpm installation because Hub uses npm. Without the proxy option, registry behavior stays unchanged. Host npm settings, repository npm configuration, lockfiles, TLS verification, and the production image are untouched. This PR contains no dependency downgrades or Manage prototypes latency changes.

End-to-end provisioning of a fresh devcontainer with a proxy remains unverified.

Allow a credential-free registry URL for CLI installation and container setup, then save it in the container user's npm settings. Disable unused pnpm installation without changing locked dependencies or default registry behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bd1d4a40-2eb6-4e35-9c28-55affc9e5e96
@weastler
weastler requested review from a team and nshki as code owners October 19, 2026 00:56
Copilot AI max review requested due to automatic review settings October 19, 2026 00:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Subsequent commands do not reuse the proxy-built CLI image, breaking the documented workflow on proxy-only networks.

No open issues 🎉

What changed in this PR

Adds opt-in npm registry proxy support to Hub’s devcontainer setup.

Changes:

  • Configure the registry for CLI installation and initial container dependencies.
  • Persist the container’s npm registry setting and document its removal.
  • Disable unused pnpm installation and expand wrapper tests.
File Description
hub/​test/​bin/​devcontainer_test.rb Test proxy options, validation, and command forwarding.
hub/​docs/​development.md Document proxy setup, persistence, and cleanup.
hub/​bin/​devcontainer Parse and apply the proxy option.
hub/​.devcontainer/​devcontainer.json Disable optional pnpm installation.
hub/​.devcontainer/​cli.Dockerfile Accept a registry argument for CLI installation.

Review effort: Max

@nshki nshki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @weastler! This will be super helpful to contributors behind enterprise firewalls.

@weastler
weastler merged commit 3717d1e into main Oct 19, 2026
31 checks passed
@weastler
weastler deleted the weastler-devcontainer-npm-proxy branch October 19, 2026 15:14
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.

3 participants