yarn-plugin-rescript is a ReScript project tooling made with Yarn Plugin. I just migrated it to work with Yarn 3.
It analyses ReScript dependencies using the Yarn API. And automatically unplugs and links it so the compiler can find the dependency.
This is similar to what pnpm does, but only does what is needed, so the rest of the dependencies can still benefit from Plug’n’Play
It also provides convenience features like yarn res init and yarn res add. You can automate initializing and managing bsconfig.json
Yarn’s plugin system is awesome, there are other possibilities that haven’t been discovered yet.
Right, I thought link would (also) iterate over the installed ReScript packages and add them to bsconfig.json if missing, but it is actually just making yarn link compatible with ReScript.
What I am really looking for is a way to automatically add all missing dependencies to bsconfig.json, or a way for libraries to add their deps to bsconfig.json automatically after installation. Not (necessarily) tied to any package manager (but obviously tied to the node_modules-workflow).
Feels like a long term preference would be to not have dependencies in bsconfig.json. Once a linking mechanism exists, the array in bsconfig is just a cache. Could make -with-deps parse package.json, and then cache automatically until the next with-deps call.