New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): Adding an ignore workspace option #10916
base: main
Are you sure you want to change the base?
Conversation
The code overall looks good. Are you sure this is what you want though? This would mean that a workspace If package.json in the child package depends on |
Hey, thanks for the answer! First about the code, although it looks good, tests are actually failing because of this change:
I guess it's triggering some undesirable side effects, that's why the PR is still a draft. About your feedback, I think that would be an "expected behaviour" for every workspace management tool. I mean, from the moment you want a package to be different from everything else, it means that you have to handle a few things by yourself:
Also to add more context, even if we're considering using Bun as the workspace management tool, we're still using Yarn to do it. Having Bun that tries to automatically handle the workspace is a problem for now, that's why I thought that being able to disable the workspace detection behaviour would be a good solution. But I guess another one would be to detect if the workspace is already managed by another tool, although it sounds a bit complicated to implement |
Just to give a different perspective as well. While the flag would be helpful in this scenario this is just a bandaid and the real issue should be fixed sooner or later. |
Hey! |
9ea6a4a
to
95bfc75
Compare
What does this PR do?
The point of this PR is to add way to ignore the workspace when being in the case of an
InstallCommand
.For the context, we have a CLI in our monorepo that is developed with Bun, but we want it to be able to be independent from the monorepo. Since
1.1.7
, it'll automatically detect the workspace and go through all the process of installing the workspace dependencies.This PR adds a new flag
--ignore-workspace
to bunInstallCommand
. When set, it won't go through the workspace detection and run everything for the current package. It also adds theignoreWorkspace
option in thebunfig.toml
so you don't have to pass the flag every time.How did you verify your code works?
I wrote automated tests
bun-debug test test-file-name.test
)