Skip to content

Keep registry URLs out of the docs npm lockfile - #2068

Merged
DariuszPorowski merged 1 commit into
v0.62from
kachawla-npm-lockfile-omit-registry-resolved
Oct 28, 2026
Merged

DariuszPorowski merged 1 commit into
v0.62from
kachawla-npm-lockfile-omit-registry-resolved

Conversation

@kachawla

Copy link
Copy Markdown
Member

Summary

Add docs/.npmrc with omit-lockfile-registry-resolved=true and regenerate docs/package-lock.json once so it no longer stores registry download URLs.

Reason for change

npm writes each package's full download URL into the lockfile's resolved fields, using whatever registry the author installed from. If that is a private mirror, those URLs get committed. In radius-project/samples#2698 this put 214 private registry URLs into a lockfile, which broke Dependabot and the upmerge to edge, and took radius-project/samples#2709, radius-project/samples#2710, and radius-project/samples#2713 to clean up.

The docs lockfile only has registry.npmjs.org URLs today, so this is preventive. With omit-lockfile-registry-resolved set, npm writes lockfiles without a resolved key for registry dependencies. Package versions and integrity hashes stay, so installs remain pinned and verified, and each install uses the registry configured on that machine.

The .npmrc sits next to package.json because npm reads project config from there. It does not set registry, so local registry settings keep working.

The one-time lockfile diff removes the 59 resolved lines and nothing else. No versions or integrity hashes changed.

This mirrors radius-project/samples#2719.

How to test

  1. From docs/, run npm install --package-lock-only and confirm git diff shows no changes and grep -c '"resolved"' package-lock.json prints 0.
  2. Compare against the base branch, ignoring resolved fields. This should print nothing:
    diff <(git show origin/v0.62:docs/package-lock.json | jq -S 'del(.. | .resolved?)') <(jq -S . docs/package-lock.json)
  3. From docs/, run npm ci and npm run build. Both should succeed, as in the Radius Website workflow on this PR.

File change summary

File Summary of change
docs/.npmrc New. Sets omit-lockfile-registry-resolved=true.
docs/package-lock.json Removes the 59 resolved URLs. No other changes.

Add docs/.npmrc with omit-lockfile-registry-resolved=true so npm writes
package-lock.json without registry download URLs. Regenerate the
lockfile once, which removes the 59 resolved entries. Versions and
integrity hashes are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@DariuszPorowski
DariuszPorowski merged commit 3b0dbb4 into v0.62 Oct 28, 2026
18 checks passed
@DariuszPorowski
DariuszPorowski deleted the kachawla-npm-lockfile-omit-registry-resolved branch October 28, 2026 23:51

This branch was successfully deployed

1 active deployment
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.

2 participants