diff --git a/docs/guides/install/from-npm-install-to-bun-install.mdx b/docs/guides/install/from-npm-install-to-bun-install.mdx index 1fcf44967f03..7758e5b4d11e 100644 --- a/docs/guides/install/from-npm-install-to-bun-install.mdx +++ b/docs/guides/install/from-npm-install-to-bun-install.mdx @@ -82,6 +82,12 @@ bun --filter 'lib-*' my-script # npm run --workspace lib-foo --workspace lib-bar my-script ``` +`bun run` also takes npm's `-w` / `--workspace` flag, with a package name or a folder. Put the flag before the script name: + +```sh terminal icon="terminal" +bun run --workspace lib-foo --workspace lib-bar my-script +``` + --- ## Update dependencies diff --git a/docs/pm/filter.mdx b/docs/pm/filter.mdx index ec8a989f959a..d92b484ffc1f 100644 --- a/docs/pm/filter.mdx +++ b/docs/pm/filter.mdx @@ -142,7 +142,7 @@ bun run --filter foo myscript ### Parallel and sequential mode -Combine `--filter` or `--workspaces` with `--parallel` or `--sequential` to run scripts across workspace packages with Foreman-style prefixed output: +Combine `--filter`, `--workspace` or `--workspaces` with `--parallel` or `--sequential` to run scripts across workspace packages with Foreman-style prefixed output: ```bash terminal icon="terminal" # Run "build" in all matching packages concurrently @@ -161,9 +161,9 @@ bun run --parallel --no-exit-on-error --filter '*' test bun run --parallel --filter '*' build lint ``` -Bun prefixes each line of output with the package and script name (`pkg-a:build | ...`). Without `--filter`/`--workspaces`, the prefix is only the script name (`build | ...`). When a package's `package.json` has no `name` field, Bun uses the relative path from the workspace root instead. +Bun prefixes each line of output with the package and script name (`pkg-a:build | ...`). Without a flag that selects packages (`--filter`, `--workspace`, `--workspaces`), the prefix is only the script name (`build | ...`). When a package's `package.json` has no `name` field, Bun uses the relative path from the workspace root instead. -Use `--if-present` with `--workspaces` to skip packages that don't have the requested script instead of erroring. +Use `--if-present` with `--workspace` or `--workspaces` to skip packages that don't have the requested script instead of erroring. ### Dependency Order diff --git a/docs/runtime/index.mdx b/docs/runtime/index.mdx index fbf58dd8c34b..2aad5b8d79f0 100644 --- a/docs/runtime/index.mdx +++ b/docs/runtime/index.mdx @@ -162,6 +162,26 @@ executes `