Skip to content
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

Allow option to run recursive including root? #4906

Closed
shirotech opened this issue Jun 21, 2022 · 4 comments · Fixed by #4928
Closed

Allow option to run recursive including root? #4906

shirotech opened this issue Jun 21, 2022 · 4 comments · Fixed by #4928
Milestone

Comments

@shirotech
Copy link
Contributor

shirotech commented Jun 21, 2022

According to https://pnpm.io/cli/recursive:

pnpm -r, --recursive

Runs a command in every project of a workspace, excluding the root project, when used with the following commands:

  • exec
  • run
  • test
  • add

Is there an option or is it possible to run with root as well? Or is that considered an anti-pattern?

Also, not sure why these specific commands have special hard-coded treatments? Is it part of some spec? I would have thought it would just be easier and more generic to have a flag say --no-root or something, and let the users decide if root should be included or not?

@zkochan
Copy link
Member

zkochan commented Jun 22, 2022

I agree with you. And it used to work consistently in the past. But I was asked to change it: #2769

An option sounds good and I think such issue already exists but I can't find it.

@shirotech
Copy link
Contributor Author

Hi @zkochan Thanks for the response, I had a look and found a special option in npm. https://docs.npmjs.com/cli/v8/commands/npm-link#include-workspace-root I believe using -r, --recursive flags should follow the include-workspace-root option to include root or not.

@shirotech
Copy link
Contributor Author

Hi @zkochan understand that you are busy, so I have proposed a change #4928 I'm not sure how to go about adding tests, if you can help me do that if needed. Thanks.

zkochan added a commit that referenced this issue Jun 24, 2022
close #4906

Co-authored-by: Zoltan Kochan <z@kochan.io>
@zkochan zkochan added this to the v7.4 milestone Jun 27, 2022
@coyotte508
Copy link

Would it be possible to add this to the docs here: https://pnpm.io/filtering ?

I'm very thankful the option exists, we have a CI where the root has its own lint script (for the root config files)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants