In Yarn workspaces, shared deps are "hoisted" to a parent folder. Workspaces are symlinked like.
Let's say I am working in a monorepo with two Yarn workspaces, package-1 and package-2, each one with their own bsconfig.json (image source):

If package-1 depends on package-2 there is no way at the moment (that I know of) to run bsb -w from package-1 folder, and have the compiler pick up the changes on package-2.
I was thinking if the watcher could somehow detect if the folder in node_modules is a symlink, and in that case watch for changes in it as well?
Would this happen even if it's not in a monorepo?
馃憤 This would be absolutely great to have!
Our use case is a yarn workspaces monorepo with the following packages:
with both A and B depending on C.
Currently, when running bsb -w in A or B, changes in C are not picked up.
Any plans on this @bobzhang?
I've also noticed that if you are building multiple apps that are sharing same symlinked package bs will warn about package name duplicates and that first one was picked.
Another issue is parallel builds with shared packages. They are not possible because of race conditions, we are using concurrency 1 everywhere.
Sorry for bumping this again, but this is very very annoying with mono repo setups :/ will this issue be prioritised at some point?
Note @Coobaha raised several separate issues, watching dependent packages and shared packages
@bobzhang Would you like me to provide an example repo with a monorepo setup as described above?
Very naive implementation https://github.com/BuckleScript/bucklescript/pull/4047 should add symlinks to watch list
Adding to the request queue. monorepos have a lot of benefits for modern web development.
Any kind of guidance would be appreciated, I'm happy to pitch in but no idea why this doesn't work.
@bobzhang any clue as to when this will be fixed?
Looks like it works on bs 8. @jchavarri maybe close?
@BlueHotDog Do you have a working sample repo, by any chance?
Actually, on second check, it still doesnt work :(((( but, it does behave a bit better.
Also this:
Trying to run yarn in a yarn workspace monorepo getting crypting errors.
Please Please Please - how can we make monorepo usable?
Error:
https://gist.github.com/BlueHotDog/e70733c751e69a802570e08f3bf773cb
Thanks.
Most helpful comment
馃憤 This would be absolutely great to have!
Our use case is a yarn workspaces monorepo with the following packages:
with both A and B depending on C.
Currently, when running
bsb -win A or B, changes in C are not picked up.