Skip to content

feat(npm): registry-agnostic lockfiles via omit-lockfile-registry-resolved - #104

Merged
oto-macenauer-absa merged 1 commit into
masterfrom
feat/omit-lockfile-resolved
Sep 23, 2026
Merged

oto-macenauer-absa merged 1 commit into
masterfrom
feat/omit-lockfile-resolved

Conversation

@oto-macenauer-absa

Copy link
Copy Markdown
Collaborator

Closes #103

What

  • .npmrc at the root and in actions/ with omit-lockfile-registry-resolved=true.
  • Both lockfiles regenerated: every resolved URL gone (664 lines removed), versions and integrity hashes unchanged.
  • actions/lib/npm-registry.sh and the inlined step in build-image.yml now append to the project .npmrc instead of overwriting it, so the committed setting survives a private-registry run.
  • tests/private-registry.spec.js: lockfiles must carry no resolved URL and an integrity hash per package; both .npmrc files must carry the setting; the script appends to an existing .npmrc.
  • Docs updated: AGENTS.md, CONTRIBUTING.md, CLAUDE.md, contract/DEPLOYMENT.md, contract/SINGLE_PAGE.md, publish-docs README, action comments.

Why

The lockfiles pinned every package to registry.npmjs.org and private-network installs depended on npm's replace-registry-host rewriting that host. Regenerating a lockfile behind a corporate ~/.npmrc needed --registry=https://registry.npmjs.org/, or it baked in mirror URLs and installed in one network only. With no resolved URLs, npm fetches from whatever registry is configured; the integrity hash still pins the tarball.

Verification

  • npm ci in a clean copy of actions/ with an empty cache installs from the lockfile without resolved fields.
  • private-registry.spec.js + artifact-checks.spec.js: 20 passed.

🤖 Generated with Claude Code

…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>
@oto-macenauer-absa
oto-macenauer-absa merged commit 5740e21 into master Sep 23, 2026
8 checks passed
@oto-macenauer-absa
oto-macenauer-absa deleted the feat/omit-lockfile-resolved branch September 23, 2026 12:39
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.

Drop registry URLs from the lockfiles (omit-lockfile-registry-resolved)

1 participant