Open cbilotta opened 1 year ago
Aside from using git submodules, this is the exact problem I am encountering. I'm having a heck of a time trying to get cached builds using a monorepo with standard "workspaces" configuration.
The bun docker guide does not account for monorepo. The bun install --frozen-lockfile
fails first because the workspace directories are not present. To fix this, you have to copy your source packages (dependencies) to the install directory. This creates a new problem though, changes to a source package will now invalidate the build cache, requiring a cold install
on each build.
Maybe bun install
could have more granular control like -w/-W
to install workspace dependencies as a separate step? 🤷♀️
Related: https://github.com/oven-sh/bun/issues/6353
Maybe bun fetch
is a better solution
What is the problem this feature would solve?
Hello,
I am currently using a monorepo setup containing local packages as git submodules. This has two advantages:
One of the issues with this setup is that the lockfile should not be shared (should not be in the root of the monorepo) in order to keep caching working as it should, but also so developers don't trigger changes to the root lockfile simply because they don't have access to one of the sub-module.
As far as I understand, currently Bun can not split the lockfiles into the folders of the respective workspace members when using the "workspaces" monorepo configuration.
What is the feature you are proposing to solve the problem?
It would be great to have a feature such as shared-workspace-lockfile from pnpm.
What alternatives have you considered?
Not using the "workspaces" package.json configuration field and linking packages myself, but it's not that straightforward to do and I imagine I would have to launch dependencies install scripts in all submodules which is not great.