gund / yarn-worksapces-bug

Repro of the latest Yarn Workspaces bug

Home Page:https://github.com/yarnpkg/berry/issues/2665

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yarn-worksapces-bug

Repro of the latest Yarn Workspaces bug
Issue in Yarn: yarnpkg/berry#2665

Repro Steps

  1. Pull the repo locally
git clone git@github.com:gund/yarn-worksapces-bug.git
  1. Navigate to repo
cd yarn-worksapces-bug
  1. Run install
yarn install
  1. 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

About

Repro of the latest Yarn Workspaces bug

https://github.com/yarnpkg/berry/issues/2665