Open birkskyum opened 2 months ago
I second this. I'm finding myself either having to create redundant tasks at the root level, or cd'ing into my packages for running tasks.
A good test for this functionality would be moving the repo below from pnpm workspace to npm workspace, building all the packages and running an example: https://github.com/histoire-dev/histoire
Firstly we should check other package managers (npm, yarn, pnpm) and how they handle it and come up with a solution that best fits the needs.
pnpm --filter pkgA run command
npm run command --workspace=pkgA
yarn workspace pkgA run command
bun --filter pkgA run command
pnpm run command -r
npm run command --workspaces
yarn workspaces foreach run command
bun --filter ‘*’ run command
pnpm run command -r --filter <pattern>
npm run command --workspace=pkgA --workspace=pkgB
yarn workspaces foreach --from <pattern> run command
bun --filter <pattern> run command
Summary
filter
, yarn also has glob pattern support using the from
argI could see this issue split into three main things
With pnpm / bun workspace, there is a way to use --filter to select multiple packages or to select all packages
bun --filter '*'
orpnpm -r
to run a task in all of them, typicallydev
,build
orstart
.Also, the -r flag is super convenient in
pnpm update -r -i
for recursively making interactive dependency updates across the entire workspace.