-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Excluding the root from recursive exec (and other workspace commands) #2769
Comments
that PR did not change how the commands work. It just allowed to omit adding If you have all your projects in a subdirectory, you can do something like |
I have to agree with @mshick that this is surprising behavior since lerna also doesn't work this way. When I tried converting a repo from using lerna, I basically replaced
It's easy enough to add explicit filters for all the scripts blocks throughout the repo that had used lerna commands, but if I ever forget to manually add a filter when running at the command line, I'm likely to encounter issues if the root has a command with the same name. The package finding code already supports an option to ignore the root, so it should be straightforward to enable setting that option in the workspace yaml. Would you accept a PR? |
We've also run into this when trying to add new packages, i.e. pnpm add --recursive axios I would expect this to only install it in the sub-projects, but it also installs in the root I think this is especially surprising with |
This would be a breaking change but adding an option for now sounds good to me. |
Wanted to pitch in to say that in most cases, not having the command execute on the top level is what most people would want. Also, adding a |
PR: #3647 |
Coming from yarn, I've been puzzled by the behavior of treating the root
package.json
and scripts like another workspace in a monorepo. I found the PR where the behavior was changed to always include it, but there doesn't seem to be any opt-out on that, even though I see it has been made optional (opts.includeRoot
) in the code.In this case, I'm running
pnpm recursive exec
and don't want it running on root. I can't figure out how to exclude it though. Not sure if this is a feature request, or a request for help.The text was updated successfully, but these errors were encountered: