Yeah, it’s how it works. I actually haven’t found value in the pinned-dependencies at all.
There are two options, you either treat shared as an actual package that should be developed separately. In this case, the solution will be to run rescript build -with-deps -w in the web and shared simultaneously.
Or instead of adding it as a dependency, you can set a path to shared in the bsconfig’s sources option. It has problems with artifact location and some other things, but it generally works.
ReScript will not rebuild any pinned-dependencies in watch mode! This is due to the complexity of file watching, so you’d need to set up your own file-watcher process that runs rescript build on specific file changes.
Is this for watching for changes? I don’t mind the limitation there as I typically work on packages independently. What I’m running into is if package A has a dependency on package B and you change package B, package A does not pick up up on any of the changes even with pinned-dependencies and rescript build -with-deps
Sounds like this should be possible according to this documentation page: Pinned Dependencies | ReScript Language Manual, but whenever I try to run rescript build, my main app breaks and then my extension stops working. I always have to use a rescript clean and restart the extension.
There were several call to action for monorepo users in several discussions over several years.
I apologize if I’m stepping on any toes here, I just started splitting a large project into manageable pieces and ran into what seemed like a bug with building. I searched the forums for “monorepo,” read through a few posts, and replied to the one that’s most similar to my case.
edit: I just actually looked into rewatch and see that it’s specific for rescript, will try to give it a try!
For the record: Yes, rewatch is for file watching rescript builds with support for npm workspaces. But actually it is a whole build system, since it replaces bsb.exe and calls the compiler (bsc.exe) directly.
@hellos3b: I am not sure if that documentation example is the way to go. Have a look at the aforementioned rescript-mui monorepo. It uses a root bsconfig and builds are started from there.