Skip to content

[rush] Fix an edge case for workspace peer dependencies when calculating packageJsonInjectedDependenciesHash to improve its accuracy #4809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

g-chao
Copy link
Contributor

@g-chao g-chao commented Jun 26, 2024

Summary

If you declare a workspace package in peerDependencies, though you put the version range there, PNPM does not respect it. Below is an example:
peerDependencies section in @rushstack/heft-api-extractor-plugin project package.json

"peerDependencies": {
    "@rushstack/heft": "0.66.18"
  },

The actual pnpm-lock.yaml
img_v3_02c8_154f1501-0d30-4138-a2ce-b5e78bf2775h

So, we don't need to take these packages into consideration when calculating packageJsonInjectedDependenciesHash.

How it was tested

Manually tested with Monorepo locally.

D4N14L
D4N14L previously requested changes Jun 26, 2024
@g-chao g-chao force-pushed the chao/improve-getPackageJsonInjectedDependenciesHash branch from 9846523 to 034bea6 Compare June 26, 2024 20:53
@g-chao g-chao changed the title [rush] Normalize workspace dependencies' version when calculating packageJsonInjectedDependenciesHash to improve its accuracy [rush] Fix an edge case for workspace peer dependencies when calculating packageJsonInjectedDependenciesHash to improve its accuracy Jun 26, 2024
@octogonz octogonz dismissed D4N14L’s stale review June 26, 2024 22:07

That issue has been addressed in the latest commit

@octogonz octogonz merged commit 08cd264 into microsoft:main Jun 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants