Skip to content

plugin-materialize-virtual-workspaces-v1.2: Only remove virtual slug subdirs instead of rm -rf'ing virtualFolder

Choose a tag to compare

@dobesv dobesv released this 20 May 23:46
· 1 commit to plugin-materialize-virtual-workspaces since this release

Docs

https://github.com/dobesv/berry/tree/e75f6ae2f5a062f0399cc8a358d91499123830ad/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.1

  • Tighten cleanup. Previous versions removed the whole virtualFolder (default .yarn/__virtual__) with rm -rf at the start of every install. That's correct under default config but offers no guard against a misconfigured virtualFolder. v1.2 lists virtualFolder and removes only entries matching the slug pattern (-virtual-<hex>$). Standard .yarn siblings (cache, plugins, sdks, install-state.gz, …) don't match, so even if the config ever resolves to .yarn itself, nothing important would be deleted.

Installation

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