Skip to content

plugin-materialize-virtual-workspaces-v1.1: Bypass PnP-patched fs when creating virtual workspace symlinks

Choose a tag to compare

@dobesv dobesv released this 20 May 20:50
· 2 commits to plugin-materialize-virtual-workspaces since this release

Docs

https://github.com/dobesv/berry/tree/8f5aaacfdf937523fa52ae6dc77ff6db689ca7d4/packages/plugin-materialize-virtual-workspaces#readme

Workaround for

yarnpkg/berry#6871 — node --watch (and other file-watching / dependency-analysis tools) don't see changes in PnP workspaces with peer dependencies, because the resolved path lives under .yarn/__virtual__ and that path doesn't exist on disk. This plugin creates real symlinks at those paths after every install.

Changes since v1.0

  • Bypass PnP-patched fs when creating virtual workspace symlinks. v1.0 routed its calls through @yarnpkg/fslib's xfs, which Yarn's PnP runtime had patched to remap .yarn/__virtual__ paths back to their real targets — defeating the entire point of the plugin and producing EEXIST errors in real monorepos. v1.1 uses node:fs directly. (yarn install now succeeds on monorepos with many virtualized workspaces.)

Installation

yarn plugin import https://github.com/dobesv/berry/releases/download/plugin-materialize-virtual-workspaces-v1.1/plugin-materialize-virtual-workspaces.js