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

Support for Pnpm Workspaces with one single pnpm-lock.yaml file? #7

Open
3 tasks done
chrisspiegl opened this issue Mar 29, 2023 · 4 comments
Open
3 tasks done
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@chrisspiegl
Copy link

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

@chrisspiegl chrisspiegl added the enhancement New feature or request label Mar 29, 2023
@sxzz
Copy link
Owner

sxzz commented Apr 17, 2023

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.

@chrisspiegl
Copy link
Author

chrisspiegl commented Oct 17, 2023

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.

@chrisspiegl
Copy link
Author

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:

  1. open sandbox
  2. run pnpm install
  3. result: it will show error because the sub directory app-with-postinstall will try to do the postinstall stale-dep -u but that will fail with error no pnpm-lock.yaml.
  4. run pnpm lint
  5. result: it will print not stale because here the stale-dep -u after install works since pnpm-lock.yaml is present in root of workspace.
  6. cd app-with-postinstall
  7. run pnpm start
  8. error no pnpm-lock.yaml found
  9. cd ../app-no-postinstall
  10. run pnpm start
  11. error no pnpm-lock.yaml found

I hope this helps and is clear to understand.

@sxzz sxzz added the help wanted Extra attention is needed label Nov 3, 2023
@sxzz
Copy link
Owner

sxzz commented Nov 3, 2023

This project doesn't support pnpm + workspace now. If anyone can contribute this enhancement, I'd like to merge it happily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants