Skip to content

Conversation

@comp615
Copy link
Contributor

@comp615 comp615 commented Nov 19, 2025

Current Behavior

If a workspace uses pnpm and adds a local patch to a dependency (e.g. vitest), this patch is not taken into account when computing that dependency's hash for purposes of determining cache changes. In practice, you could patch vitest locally, and tests would pull from the cache.

Expected Behavior

Patches can alter behavior in the same way that updating the version could, it's just that the version is not created and the patch is applied locally.

This updates the pnpm lockfile parsing functionality to read the patches field into a map and then combine the patch hash with the integrity hash. The integrity hash ONLY represents the remote / tarball intergrity, so these have to be combined in order to create a proper key.

Related Issue(s)

(Could not find any, but saw this in my work today)

@comp615 comp615 requested review from a team and meeroslav as code owners November 19, 2025 21:50
@comp615 comp615 requested a review from leosvelperez November 19, 2025 21:50
@netlify
Copy link

netlify bot commented Nov 19, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c24c7a6

@vercel
Copy link

vercel bot commented Nov 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Nov 19, 2025 9:54pm

@comp615 comp615 changed the title fix(core): include PNPM patches in externalDependncy hash computations fix(core): include PNPM patches in externalDependencies hash computations Nov 19, 2025
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.

1 participant