Skip to content

[rush] Add an option to disable hoisting for indirect dependencies. #3542

Open
@iclanton

Description

@iclanton

#3535 brought to light that Rush doesn't currently have a built-in way to disable hoisting of indirect dependencies with PNPM.

These .npmrc options are used to disable any hoisting in PNPM, but they're off by default and are not particularly discoverable. I proposed adding these options to rush init in #3541, but @octogonz brought up the concern that enabling these stricter options by default may also be frustrating and non-discoverable, especially for existing repos that are already relying on hoisting for indirect dependencies.

Instead of enabling those options in the common/config/rush/.npmrc generated by rush init, I'd like to propose adding an option to the pnpmOptions section of rush.json called strictIndirectDependencies (although I'm totally open to alternative names). When this option is enabled, Rush would pass public-hoist-pattern=, hoist=false, and hoist-pattern= to pnpm directly, instead of via the checked-in .npmrc. This maximizes discoverability of the option and allows us to include a documentation comment in the rush.json generated by rush init.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is asking for a new feature or design changeneeds designThe next step is for someone to propose the details of an approach for solving the problem

    Type

    No type

    Projects

    Status

    General Discussions

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions