JamieMason / syncpack

Consistent dependency versions in large JavaScript Monorepos.
https://jamiemason.github.io/syncpack/
MIT License
1.34k stars 44 forks source link

feat(versions): support local filepaths in nested workspaces #133

Open Armine-i opened 1 year ago

Armine-i commented 1 year ago

Description

When two workspaces are in separate hierarchies and need to reference a common patch as a dependency, I use the relative path to the patch directory. However, in this situation, syncpack does not correctly identify that the different patch paths are actually the same due to their directory locations. As a result, running yarn run syncpack list-mismatches will generate an error.

Steps to reproduce:

The output should be similar to:

✘ react-dom has mismatched versions which syncpack cannot fix
--
patch:react-dom@16.11.0#patches/react-dom+16.11.0.patch in dependencies of package.json
patch:react-dom@16.11.0#../patches/react-dom+16.11.0.patch in dependencies of workspace-1/package.json

env: syncpack: 9.8.6 node: 14.19.0 yarn: 3.2.2 os: Mac Ventura 13.3.1

Thanks for looking into this!

JamieMason commented 1 year ago

Thanks Mina, this will be a new feature. Once we can first properly support workspace: this will be easier to get in 👍