You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All package managers support some form of setting a workspace/package for running commands. It would be convenient to have this as a unified -w/--workspace flag, rather than having to figure out what package manager a workspace is using in order to run commands for specific workspaces.
If there is interest in this, I'd be willing to attempt a PR at implementing it.
Suggested solution
Introduce a global -w flag that lets you run commands based on a workspace name.
e.g. ni would be translated as:
ni -w packageA vite
# npm -w packageA i vite
# yarn workspace packageA add vite
# pnpm add vite --filter packageA
# (cd path/to/packageA bun add vite) (not sure yet what the best way to handle bun is as it doesn't allow you to just specify the workspace name)
There's probably some more considerations and complexity beyond the basic use case to figure out, such as:
supporting pattern matching for specific packages (-w @package/*)
This should provide support for running in all workspaces as well (-w *)
If -w diverges from the npm implementation (likely will), we'd probably want a different flag. Maybe just uppercase -W
Alternative
Continue just using the per-package way of doing things. They're not super standard between packages (especially bun), so maybe it does make sense to leave as is.
Clear and concise description of the problem
All package managers support some form of setting a workspace/package for running commands. It would be convenient to have this as a unified
-w
/--workspace
flag, rather than having to figure out what package manager a workspace is using in order to run commands for specific workspaces.If there is interest in this, I'd be willing to attempt a PR at implementing it.
Suggested solution
Introduce a global
-w
flag that lets you run commands based on a workspace name.e.g. ni would be translated as:
There's probably some more considerations and complexity beyond the basic use case to figure out, such as:
-w packageA -w packageB
)-w @package/*
)-w *
)-w
diverges from the npm implementation (likely will), we'd probably want a different flag. Maybe just uppercase-W
Alternative
Continue just using the per-package way of doing things. They're not super standard between packages (especially bun), so maybe it does make sense to leave as is.
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: