chore: remove registry pin from .npmrc, guard lockfile in CI#662
Open
ochafik wants to merge 1 commit into
Open
chore: remove registry pin from .npmrc, guard lockfile in CI#662ochafik wants to merge 1 commit into
ochafik wants to merge 1 commit into
Conversation
Drop the `registry=` pin from .npmrc — it's npm's default and pinning it shadows contributors' own proxy registry config. The committed package-lock.json must reference only registry.npmjs.org, but `npm install` records whichever registry it actually resolved against (URL *and* integrity digest, which can differ for older packages). Replace the inline grep checks in .husky/pre-commit and CI with scripts/check-lockfile-registry.mjs, which also has a `--fix` mode that re-fetches resolved/integrity from registry.npmjs.org for the leaked entries. Also: - `update-lock:docker` no longer hard-codes `--registry=https://registry.npmjs.org/`; it uses the system registry and runs `--fix` at the end. - AGENTS.md updated to describe the new flow and the `npm run lint:lockfile` helper.
@modelcontextprotocol/ext-apps
@modelcontextprotocol/server-basic-preact
@modelcontextprotocol/server-basic-react
@modelcontextprotocol/server-basic-solid
@modelcontextprotocol/server-basic-svelte
@modelcontextprotocol/server-basic-vanillajs
@modelcontextprotocol/server-basic-vue
@modelcontextprotocol/server-budget-allocator
@modelcontextprotocol/server-cohort-heatmap
@modelcontextprotocol/server-customer-segmentation
@modelcontextprotocol/server-debug
@modelcontextprotocol/server-map
@modelcontextprotocol/server-pdf
@modelcontextprotocol/server-scenario-modeler
@modelcontextprotocol/server-shadertoy
@modelcontextprotocol/server-sheet-music
@modelcontextprotocol/server-system-monitor
@modelcontextprotocol/server-threejs
@modelcontextprotocol/server-transcript
@modelcontextprotocol/server-video-resource
@modelcontextprotocol/server-wiki-explorer
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
.npmrcpinsregistry=https://registry.npmjs.org/, which forces everynpm installthrough the public registry even for contributors who fetch through a corporate proxy registry (their supply-chain gate). The pin was a blunt way to keep the committedpackage-lock.jsonfree of non-publicresolvedURLs.This replaces the pin with a precise invariant check, so contributors can use whatever registry their machine is configured for while the committed lockfile is guaranteed to reference only the public registry.
What
.npmrc: drop theregistry=pin, leave a comment explaining the invariant and how it's enforced.scripts/check-lockfile-registry.mjs(new): fails if anypackage-lock.jsonentry has aresolvedURL outsideregistry.npmjs.org.--fixre-fetches the public registry's canonicalresolved/integrityfor each offending entry and rewrites it (safe to run afternpm install <pkg>against a proxy).ci.yml): replace the inlinegrepcheck with the script..husky/pre-commit): same.package.json: addlint:lockfilescript;update-lock:dockernow runs--fixinstead of forcing--registry.Verified
--fixrestores it byte-identical to the public-registry original.