feat(npm): registry-agnostic lockfiles via omit-lockfile-registry-resolved - #104
Merged
Merged
Conversation
…olved Commit a project .npmrc next to both lockfiles with omit-lockfile-registry-resolved=true and regenerate the lockfiles without `resolved` URLs. Each package keeps its version and integrity hash; npm fetches it from whichever registry is configured at install time. A lockfile regenerated behind a private mirror no longer bakes that mirror's URLs in, so no --registry flag and no replace-registry-host reliance. npm-registry.sh and build-image.yml now append to the project .npmrc instead of replacing it, so the committed setting survives. private-registry.spec.js asserts no lockfile carries a resolved URL, both .npmrc files carry the setting, and the registry step appends. Closes #103 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Closes #103
What
.npmrcat the root and inactions/withomit-lockfile-registry-resolved=true.resolvedURL gone (664 lines removed), versions andintegrityhashes unchanged.actions/lib/npm-registry.shand the inlined step inbuild-image.ymlnow append to the project.npmrcinstead of overwriting it, so the committed setting survives a private-registry run.tests/private-registry.spec.js: lockfiles must carry noresolvedURL and an integrity hash per package; both.npmrcfiles must carry the setting; the script appends to an existing.npmrc.Why
The lockfiles pinned every package to
registry.npmjs.organd private-network installs depended on npm'sreplace-registry-hostrewriting that host. Regenerating a lockfile behind a corporate~/.npmrcneeded--registry=https://registry.npmjs.org/, or it baked in mirror URLs and installed in one network only. With noresolvedURLs, npm fetches from whatever registry is configured; the integrity hash still pins the tarball.Verification
npm ciin a clean copy ofactions/with an empty cache installs from the lockfile withoutresolvedfields.private-registry.spec.js+artifact-checks.spec.js: 20 passed.🤖 Generated with Claude Code