Skip to content

Reproduce an issue with pnpm install's --filter argument

Notifications You must be signed in to change notification settings

walkerburgin/pnpm-filter-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pnpm-filter-repro

Overview

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.

Repro

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.

v7.33.6

➜ 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

v8.0.0

➜ 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

v8.9.2

➜ 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

About

Reproduce an issue with pnpm install's --filter argument

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published