Skip to content

[rush] Support pnpm configDependencies and updateConfig in pnpmfile #5776

@njxue

Description

@njxue

Feature Request: Support pnpm 10's configDependencies and updateConfig in pnpmfile

Summary

Rush currently does not provide a supported mechanism to declare pnpm configDependencies such as globalConfigDependencies.

pnpm supports configuration plugins via configDependencies and the new updateConfig hook in pnpmfile:
https://pnpm.io/config-dependencies
https://pnpm.io/pnpmfile#hooksupdateconfigconfig-config--promiseconfig

These are required for enabling pnpm plugins such as @pnpm/plugin-esm-node-path, which are used in pnpm’s global virtual store mode:
https://pnpm.io/11.x/global-virtual-store

Because Rush does not support these features, pnpm’s configuration plugin system cannot be used cleanly in Rush-managed repositories.


Problem

There is no Rush-supported way to:

  • declare configDependencies
  • use pnpmfile updateConfig hook in a supported way

As a result:

  • pnpm configDependencies cannot be installed in a structured way
  • global virtual store setups requiring pnpm plugins are blocked or require workarounds (packageExtensions)

Proposed Solution

1. Support globalConfigDependencies

Introduce a Rush-level configuration field (e.g. in common/config/rush/pnpm-config.json):

{
  "globalConfigDependencies": {
    "@pnpm/plugin-esm-node-path": "0.1.2"
  }
}

Or rush-pnpm add --config @pnpm/plugin-esm-node-path should add @pnpm/plugin-esm-node-path under configDependencies in common/temp/pnpm-workspace.yaml

2. Support updateConfig hook in common/config/rush/.pnpmfile.cs

module.exports = {
  hooks: {
    readPackage,
    updateConifg, // new hook
  }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions