Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Oct 22, 2025

Add a useNpmProxy flag to the NPM location options. When enabled, this proxy URL is used instead of the main NPM registry URL. The implementation assumes that the proxy returns identical content and respects the same headers.

This flag is enabled only for updating preinstalled Snaps.


Note

Adds a useNpmProxy option to NPM locations and routes automatic preinstalled Snap updates through the MetaMask NPM proxy.

  • Snaps Controller (packages/snaps-controllers/src/snaps/SnapController.ts):
    • Use detectSnapLocation(..., { useNpmProxy: true }) when auto-updating preinstalled Snaps during updateRegistry.
  • NPM Location (packages/snaps-controllers/src/snaps/location/npm.ts):
    • Add NPM_REGISTRY_PROXY and new NpmOptions.useNpmProxy flag.
    • Default registry selection now uses proxy when useNpmProxy is true.
    • Update isNPM to treat proxy URL as NPM.

Written by Cursor Bugbot for commit 4dda778. This will update automatically on new commits. Configure here.

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.27%. Comparing base (0b412ce) to head (4dda778).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3695   +/-   ##
=======================================
  Coverage   98.27%   98.27%           
=======================================
  Files         418      418           
  Lines       12146    12150    +4     
  Branches     1875     1878    +3     
=======================================
+ Hits        11937    11941    +4     
  Misses        209      209           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding force-pushed the fb/add-npm-proxy-support branch from 4337ec9 to 4dda778 Compare November 6, 2025 09:17
@FrederikBolding FrederikBolding marked this pull request as ready for review November 6, 2025 09:54
@FrederikBolding FrederikBolding requested a review from a team as a code owner November 6, 2025 09:54
@FrederikBolding FrederikBolding added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit dd4e37c Nov 6, 2025
123 checks passed
@FrederikBolding FrederikBolding deleted the fb/add-npm-proxy-support branch November 6, 2025 10:15
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