Skip to content

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

Closed
wants to merge 6 commits into from

Conversation

VladBrok
Copy link

@VladBrok VladBrok commented Jul 2, 2023

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:
image

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:
image
With this change:
image

@VladBrok VladBrok requested a review from zkochan as a code owner July 2, 2023 06:59
@zkochan
Copy link
Member

zkochan commented Jul 2, 2023

I've removed the --stream option from the --parallel shorthand in order to collapse an output:

don't remove flags because that is a breaking change

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

Don't revert those changes. If you want the output to be grouped when running scripts of one project, it should be done differently.

@VladBrok
Copy link
Author

VladBrok commented Jul 3, 2023

I've removed the --stream option from the --parallel shorthand in order to collapse an output:

don't remove flags because that is a breaking change

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

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

@zkochan
Copy link
Member

zkochan commented Jul 3, 2023

I don't see how it fixes the #6692 issue

Comment on lines +62 to +66
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',
}

Copy link
Member

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?

Copy link
Author

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:

image

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:

image

@VladBrok
Copy link
Author

VladBrok commented Jul 4, 2023

I don't see how it fixes the #6692 issue

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...":

image

@zkochan
Copy link
Member

zkochan commented Jul 8, 2023

Regarding the output, probably we can change the way it is printed by default. Related PR: #6780

@VladBrok
Copy link
Author

VladBrok commented Jul 9, 2023

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.

@zkochan
Copy link
Member

zkochan commented Jul 9, 2023

solved by #6785

@zkochan zkochan closed this Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

output not collapsed when running parallel scripts Allow to use --parallel without monorepo (in a single project)
2 participants