We have a large monorepo that uses PNPM. Our build system calls pnpm install
using the --filter
argument to install dependencies
for the subset of the repository that a developer is working on. The ability to perform a filtered install like this was actually the
killer feature that led us adopt PNPM in the first place. It looks like the --filter
argument may have been broken in the
v8.0.0
release.
This repository has two disjoint sets of packages:
@monorepo/foo-app
->@monorepo/foo-lib
@monorepo/bar-app
->@monorepo/bar-lib
My expectation is that running pnpm install --filter @monorepo/foo-app...
will not install dependencies for @monorepo/bar-app
or @monorepo/bar-lib
.
➜ pnpm-filter-repro node pnpm/v7.33.6/bin/pnpm.cjs install --filter @monorepo/foo-app...
➜ pnpm-filter-repro tree -d packages
packages
├── bar-app
├── bar-lib
├── foo-app
│ └── node_modules
│ ├── @monorepo
│ │ └── foo-lib -> ../../../foo-lib
│ ├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
│ ├── react-dom -> ../../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom
│ └── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
└── foo-lib
└── node_modules
├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
└── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
➜ pnpm-filter-repro node pnpm/v8.0.0/bin/pnpm.cjs install --filter @monorepo/foo-app...
➜ pnpm-filter-repro tree -d packages
packages
├── bar-app
│ └── node_modules
│ ├── @monorepo
│ │ └── bar-lib -> ../../../bar-lib
│ ├── cypress -> ../../../node_modules/.pnpm/[email protected]/node_modules/cypress
│ ├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
│ ├── react-dom -> ../../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom
│ └── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
├── bar-lib
│ └── node_modules
│ ├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
│ └── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
├── foo-app
│ └── node_modules
│ ├── @monorepo
│ │ └── foo-lib -> ../../../foo-lib
│ ├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
│ ├── react-dom -> ../../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom
│ └── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
└── foo-lib
└── node_modules
├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
└── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
➜ pnpm-filter-repro node pnpm/v8.9.2/bin/pnpm.cjs install --filter @monorepo/foo-app...
➜ pnpm-filter-repro tree -d packages
packages
├── bar-app
│ └── node_modules
│ ├── @monorepo
│ │ └── bar-lib -> ../../../bar-lib
│ ├── cypress -> ../../../node_modules/.pnpm/[email protected]/node_modules/cypress
│ ├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
│ ├── react-dom -> ../../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom
│ └── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
├── bar-lib
│ └── node_modules
│ ├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
│ └── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
├── foo-app
│ └── node_modules
│ ├── @monorepo
│ │ └── foo-lib -> ../../../foo-lib
│ ├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
│ ├── react-dom -> ../../../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom
│ └── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript
└── foo-lib
└── node_modules
├── react -> ../../../node_modules/.pnpm/[email protected]/node_modules/react
└── typescript -> ../../../node_modules/.pnpm/[email protected]/node_modules/typescript