-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
What is the problem this feature would solve?
When working from the root of a monorepo, it's awkward to run a single package.json script. There are two existing means of doing so:
cd-ing into the desired package, usingbun run <script-name>, thencd-ing back- Using
bun run --filter <package-name> <script-name>
These are relatively simple to use, but it still feels like there should be an easier way.
What is the feature you are proposing to solve the problem?
bun run --filter is powerful and already established. However, it feels strange to me to use for single scripts. (It's also slightly annoying to type.)
One way to better support the single-script use case would be to enable bun run to automatically run any script in a monorepo that has a unique name. That is, bun run <script-name> would run any script in the workspace matching <script-name> as long as there is only one match.
Another approach could be to allow bun run <package-name> <script-name> directly, assuming this doesn't controvert any existing or potential Bun syntax.
What alternatives have you considered?
Covered in previous sections---although I'm not convinced anything should be done in the first place. It's just a small annoyance I encountered in Bun's already great monorepo support.