yarn-worksapces-bug
Repro of the latest Yarn Workspaces bug
Issue in Yarn: yarnpkg/berry#2665
Repro Steps
- Pull the repo locally
git clone git@github.com:gund/yarn-worksapces-bug.git
- Navigate to repo
cd yarn-worksapces-bug
- Run install
yarn install
- Assert restults
Assert restults
To assert the issue you need to check root folder node_modules/@spryker
as it must contain all the packages hoisted from workspaces packages.
Actual results (yarn >=v2.4.0)
In the root there are no packages in node_modules/@spryker
as they were deoptimised and
pushed into every workspace package as a separate copy.
Actual content of the root folder `node_modules/@spryker`:
➜ yarn-workspaces-bug git:(master) ✗ ls node_modules/@spryker
ls: cannot access 'node_modules/@spryker': No such file or directory
➜ yarn-workspaces-bug git:(master) ✗ ls packages/*/node_modules/@spryker
packages/dashboard/node_modules/@spryker:
button styles utils web-components
packages/product-list/node_modules/@spryker:
card styles table utils web-components
packages/product-offer/node_modules/@spryker:
button card styles table utils web-components
packages/profile/node_modules/@spryker:
card styles utils web-components
packages/sales-orders/node_modules/@spryker:
button card styles table utils web-components
packages/security/node_modules/@spryker:
button card styles web-components
packages/zed-ui/node_modules/@spryker:
button utils web-components
Expected results (yarn <=v2.3.1)
In the root folder node_modules/@spryker
there should be all packages hoisted from
the workspaces packages as they are all compatible with each other.
Expected content of the root folder `node_modules/@spryker`:
➜ yarn-workspaces-bug git:(master) ✗ ls node_modules/@spryker
button card styles table utils web-components
➜ yarn-workspaces-bug git:(master) ✗ ls packages/*/node_modules/@spryker
zsh: no matches found: packages/*/node_modules/@spryker