Replies: 1 comment
|
@zkochan is this still valid issue? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Contribution
Describe the user story
I'm currently working on a monorepo where I need to run a command from the root of the repo with the subfolder of the workspace as a parameter, but this is not possible at all since
pnpm exec -ronly allows you to run a command from the workspace folder, and it only provides thePNPM_PACKAGE_NAMEvariable.Describe the solution you'd like
It would be nice to add another parameter that runs each command from the root of the project and instead adds a variable like
PNPM_PACKAGE_FOLDERwith the subfolder of the project, so I can do something like:-b, --base: Run commands from project root
pnpm -rcb "echo Project \$PNPM_PACKAGE_FOLDER"Which would work like this in a project:
pnpm-workspace.yaml
output:
Describe the drawbacks of your solution
I don't think this would imply many changes in the exec command since it would be adding a parameter and switching the cwd to the project root and adding a new env var to each command ran
Describe alternatives you've considered
My current alternative is to either parse the pnpm-workspace.yaml manually and run commands for each entry and parse wildcards, etc, or to find each package.json in subfolders and run a command for each of them, not the best options.
All reactions