-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: include a workspace root when running --parallel in a single project; collapse an output of --parallel #6747
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
Conversation
don't remove flags because that is a breaking change
Don't revert those changes. If you want the output to be grouped when running scripts of one project, it should be done differently. |
Thank you for the review. I've added a "--collapse-output" option instead |
I don't see how it fixes the #6692 issue |
export const COLLAPSE_OUTPUT_OPTION_HELP = { | ||
description: 'Collapse the output of --parallel by disabling the --stream option, which is enabled by default when you run --parallel.', | ||
name: '--collapse-output', | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be a new option? Wouldn't --no-stream
work too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--no-stream works great. I didn't know that you can use --no- prefix in order to disable boolean options in pnpm. Very cool!
However, when running in a single project, the output is still not collapsed:
The --collapse-output option disables the --stream option (like --no-stream), but also sets the "stdio" variable to "pipe" in this file: exec/plugin-commands-script-runners/src/runRecursive.ts. As a result, an output is collapsed:
It fixes the issue by allowing the --parallel option to work in a single project. Without this, if you run --parallel in a single project, it shows an error "no projects matched the filters in...": |
Regarding the output, probably we can change the way it is printed by default. Related PR: #6780 |
Is this PR still needed? If I understood correctly, a user can use pnpm run without --parallel and the output will be collapsed (#6780). A user can also use pnpm run --parallel --no-stream in a monorepo to collapse the output. |
solved by #6785 |
cc @ai fixes #6692 & fixes #3076
I've added a check to see if a user is running --parallel in a single project, and if so, include that project (see file pnpm/src/main.ts).
I've removed the --stream option from the --parallel shorthand in order to collapse an output:

I've removed the changes introduced in this commit: 079942f in order to display a better output when running --parallel in a single project.


For example, here is the output of a --parallel when run in a single project without this change:
With this change: