Support for Pnpm Workspaces with one single pnpm-lock.yaml file?
chrisspiegl opened this issue · comments
Clear and concise description of the problem
I started using stale-dep
in some of my repositories.
Now one of the projects grew and I am working with a pnpm workspace
with one singular pnpm-lock.yaml
in the workspace root.
stale-dep
does not seem to recognize the pnpm-lock.yaml
in the workspace root?
Would this be somethign that's possible to support?
Suggested solution
xy
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Could you please provide a minimum repo?
For pnpm workspace, you can add the scripts into package.json of the root, and it'll check the pnpm-lock.yaml
from the root of the project.
Dear @sxzz , sorry for the long wait time. I had this planned for long but never found the time.
I have now created a reproduction: https://codesandbox.io/p/sandbox/reproduction-stale-dep-pnpm-workspace-dr2lfj
This shows that when I have a pnpm workspace
which calls stale-dep
from a sub package (app with and without postinstall
in this case) it complains that there is no pnpm-lock.yaml
file present.
I have also tried to run the stale-dep -u
in the sub package app-with-postinstall
upon postinstall
but that also does not work and shows the same error.
I hope the reproduction helps figure out what may be going on or if there is something I have to fix on my end.
Updated the reproduction to show the case a bit better and run on Node version 18.
https://codesandbox.io/p/sandbox/reproduction-stale-dep-pnpm-workspace-dr2lfj (link above is also updated).
Steps to reproduce:
- open sandbox
- run
pnpm install
- result: it will show error because the sub directory
app-with-postinstall
will try to do thepostinstall stale-dep -u
but that will fail with errorno pnpm-lock.yaml
. - run
pnpm lint
- result: it will print
not stale
because here thestale-dep -u
after install works sincepnpm-lock.yaml
is present in root of workspace. cd app-with-postinstall
- run
pnpm start
- error
no pnpm-lock.yaml found
cd ../app-no-postinstall
- run
pnpm start
- error
no pnpm-lock.yaml found
I hope this helps and is clear to understand.
This project doesn't support pnpm + workspace now. If anyone can contribute this enhancement, I'd like to merge it happily.