Skip to content

[mock-npm-registry] Stop npm packages from getting local copies of their exact-pinned dependencies - #16922

Merged
petebacondarwin merged 1 commit into
mainfrom
james/mock-registry-local-versions
Nov 16, 2026
Merged

petebacondarwin merged 1 commit into
mainfrom
james/mock-registry-local-versions

Conversation

@jamesopstad

@jamesopstad jamesopstad commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

[mock-npm-registry] Stop npm packages from getting local copies of their exact-pinned dependencies

Tests are failing in #16917 because the published cf dependency is resolving its @cloudflare/config dependency to the local version. This PR fixes that. Once it's merged the RC stack should be rebased.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal change

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 257f293

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ask-bonk

ask-bonk Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@pkg-pr-new

pkg-pr-new Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@16922

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@16922

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@16922

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@16922

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@16922

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@16922

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@16922

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@16922

miniflare

npm i https://pkg.pr.new/miniflare@16922

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@16922

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@16922

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@16922

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@16922

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@16922

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@16922

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@16922

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@16922

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@16922

wrangler

npm i https://pkg.pr.new/wrangler@16922

commit: 257f293

@jamesopstad
jamesopstad marked this pull request as ready for review November 13, 2026 23:28
@workers-devprod
workers-devprod requested review from a team and edmundhung and removed request for a team November 13, 2026 23:29
@workers-devprod

workers-devprod commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by the review of 11370fc7.

This review, of 2ff2c3c9

✅ Approved — No issues found: the local-version rename and manifest rewrite are correct, and both have tests.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No security concerns found in this test-only registry tooling.


📖 AGENTS.md: ✅ LGTM

No conflicts with the repository conventions.


📋 Code Quality: ✅ LGTM

No problems found in the changed code. rewriteManifest changes only the runtime-relevant dependency fields. It fails loudly on specifiers it can't rewrite safely. pnpm publish gets --ignore-scripts, which is correct because prepack already ran during pnpm pack.


⚡ Performance: ✅ LGTM

The extra pack, unpack and publish for each package runs once during setup, so the added cost is small.


📝 Documentation: ✅ LGTM

The README additions match the new behaviour.


Reviewed commit: 2ff2c3c9

@jamesopstad jamesopstad added the ci:no-changeset-required Skip pull request checks for a valid changeset label Nov 13, 2026

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by the review of 257f2932.

This review, of 11370fc7

✅ Approved — No issues found. The local-version scheme and the manifest rewrite are correct, and both have tests.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No security concerns in this test-only registry tooling.


📖 AGENTS.md: ✅ LGTM

The change is consistent with the repository's conventions.


📋 Code Quality: ✅ LGTM

No issues found:

  • rewriteManifest changes only dependencies, optionalDependencies and peerDependencies. It throws on any non-exact specifier that points at a renamed local package.
  • The callers of startMockNpmRegistry use workspace:* for local packages, so that strict check won't trip.
  • restoreLatestTag also runs for packages published under the local tag. It returns early on an upstream 404.
  • --ignore-scripts and --no-git-checks on publish are appropriate. The temporary directory is cleaned up in finally.
  • The tests cover the version scheme, the manifest rewrite, the rejection cases and the dist-tag behaviour.

⚡ Performance: ✅ LGTM

Each package gets one extra pack, unpack, rewrite and publish, and this runs once during registry setup. The added cost is small.


📝 Documentation: ✅ LGTM

The README additions match the new behaviour.


Reviewed commit: 11370fc7

@jamesopstad
jamesopstad force-pushed the james/mock-registry-local-versions branch from 11370fc to 2ff2c3c Compare November 13, 2026 23:38
@jamesopstad
jamesopstad force-pushed the james/mock-registry-local-versions branch from 2ff2c3c to 257f293 Compare November 13, 2026 23:39

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — No issues found. The local-version scheme and the manifest rewrite are correct, and both have tests.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No security concerns in this test-only registry tooling.


📖 AGENTS.md: ✅ LGTM

The change is consistent with the repository's conventions.


📋 Code Quality: ✅ LGTM

No issues found:

  • rewriteManifest changes only dependencies, optionalDependencies and peerDependencies. It throws on any non-exact specifier that points at a renamed local package.
  • The callers of startMockNpmRegistry use workspace:* for local packages, so that strict check won't trip.
  • restoreLatestTag also runs for packages published under the local tag. It returns early on an upstream 404.
  • --ignore-scripts and --no-git-checks on publish are appropriate. The temporary directory is cleaned up in finally.
  • The tests cover the version scheme, the manifest rewrite, the rejection cases and the dist-tag behaviour.

⚡ Performance: ✅ LGTM

Each package gets one extra pack, unpack, rewrite and publish, and this runs once during registry setup. The added cost is small.


📝 Documentation: ✅ LGTM

The README additions match the new behaviour.


Reviewed commit: 257f2932 — same changes as 11370fc7, so this is that commit's review (no new review was run; line numbers are as of 11370fc7)

@jamesopstad jamesopstad mentioned this pull request Nov 13, 2026
2 of 5 tasks
@petebacondarwin
petebacondarwin enabled auto-merge (squash) November 16, 2026 08:37

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Nov 16, 2026
@petebacondarwin
petebacondarwin merged commit cef1808 into main Nov 16, 2026
90 checks passed
@petebacondarwin
petebacondarwin deleted the james/mock-registry-local-versions branch November 16, 2026 08:38
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:no-changeset-required Skip pull request checks for a valid changeset

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants