Skip to content
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

[rush] (pnpm) Ignoring peer dependency #3293

Closed
anantoghosh opened this issue Mar 24, 2022 · 3 comments
Closed

[rush] (pnpm) Ignoring peer dependency #3293

anantoghosh opened this issue Mar 24, 2022 · 3 comments
Projects

Comments

@anantoghosh
Copy link

anantoghosh commented Mar 24, 2022

Summary

For example when I install @emotion/react which has a optional peer dependency on @babel/core. We are not installing @babel/core as it not required for our build.

I tried to ignore it by setting in the projects's package.json

"pnpm": {
  "peerDependencyRules": {
    "ignoreMissing": [
      "@babel/core"
    ]
  }
}

as recommended by pnpm, but that does not seem to work within a rush repo. It works normally in a pnpm project just fine.

This prevents our projects from using strict peer dependencies, as it throws an error. Furthermore, it makes the rush update output quite verbose and full of warnings.

Repro steps

https://github.com/anantoghosh/rush-peer

image

Details

Current workaround is to install all the optional peers as well, but that may lead to unintended effects under certain cases.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.62.2
rushVersion from rush.json? 5.63.0
useWorkspaces from rush.json? true
Operating system? Windows
Would you consider contributing a PR? Yes
Node.js version (node -v)? v16.13.2
pnpm v6.32.3
@D4N14L
Copy link
Member

D4N14L commented Mar 29, 2022

We just run PNPM install when performing rush install, so I'm unsure why this wouldn't be working for you. Our own modifications on top of this are limited to .pnpmfile.cjs and generate a workspace file. Have you tried doing this with a vanilla PNPM workspace?

@D4N14L D4N14L added this to Waiting for Author in Bug Triage Mar 29, 2022
@anantoghosh
Copy link
Author

anantoghosh commented Mar 30, 2022

@D4N14L thank you for your input, it helped me with further investigation. It turns out in a pnpm workspace, the pnpm key must be specified in the root package.json.
pnpm/pnpm#4306 (comment). Since rush does not expose the root package.json, is there any way we could specify it?

@elliot-nelson
Copy link
Collaborator

elliot-nelson commented Dec 12, 2022

This configuration option is now officially supported in Rush 5.79+ in the pnpm-config file: https://github.com/microsoft/rushstack/blob/main/libraries/rush-lib/assets/rush-init/common/config/rush/pnpm-config.json

(if you run into any issues please file a new ticket.)

Bug Triage automation moved this from Waiting for Author to Closed Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Bug Triage
  
Closed
Development

No branches or pull requests

3 participants