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-lib] Add autoInstallPeers in pnpm-config #4379

Merged
merged 4 commits into from
Oct 6, 2023

Conversation

g-chao
Copy link
Contributor

@g-chao g-chao commented Oct 3, 2023

Summary

PNPM8 changes the default value for auto-install-peers setting. It is default to true in
PNPM8

In this PR, we want to provide a option inside pnpm-config.json to let user overwrite auto-install-peers setting easily.

Details

If user set auto-install-peers in pnpm-config.json only, use the value in pnpm-config.json
If user set auto-install-peers in pnpm-config.json and .npmrc, use the value in pnpm-config.json, and output a warning message
If user set auto-install-peers in .npmrc only, do nothing, let pnpm handle it
If user does not set auto-install-peers in both pnpm-config.json and .npmrc, rush will default it to false

How it was tested

Manually tested on rush-example repo.

Impacted documentation

N/A

@octogonz
Copy link
Collaborator

octogonz commented Oct 3, 2023

If user does not set auto-install-peers in pnpm-config.json and .npmrc, do nothing, let pnpm handle it

@iclanton @D4N14L @dmichon-msft Should Rush instead default to false? A couple considerations:

  1. As with our reasoning regarding resolutionMode, a monorepo owner who is not following the latest PNPM news may innocently update pnpmVersion and be surprised to learn that installation semantics are suddenly very different from the past.
  2. Is auto-install-peers=true an unwise choice for a large scale professional development? (The early discussions seemed to conclude that, but maybe opinions have changed?) We generally aim for Rush's out-of-box defaults to be the best choices for a large monorepo, even if that means diverging from the native defaults of PNPM.

@octogonz octogonz merged commit c677b60 into microsoft:main Oct 6, 2023
5 checks passed
@octogonz
Copy link
Collaborator

octogonz commented Oct 7, 2023

🚀 This feature was released with Rush 5.109.1

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
Development

Successfully merging this pull request may close these issues.

2 participants