-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: prune optional peer dependencies that are no longer explicitly depended on #8431
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
base: latest
Are you sure you want to change the base?
Conversation
7127150
to
efd74f7
Compare
so the Windows tests are failing because my new test results in a request for the I've kept the adding of the tgz file in case that will be useful - I'm also not sure why this fails only on Windows 😕 |
Yeah this is a GOOD thing cause answering this question will help us know if this PR is right. |
@wraithgar so I've spent a few hours trying to dig into this without much luck, though I'm still pretty sure the failure is about the test setup rather than the fix being wrong - if I revert the fix, then all the tests fail with the same kind of error though there's more of them because it's resolving about 20 more packages. I think the issue is something on the lines of dependencies (not) being cached - the error gets raised when calling this: cli/workspaces/arborist/lib/arborist/reify.js Lines 799 to 803 in c457c75
I also feel like when I revert the fix, the Windows test fail about different packages e.g. it complains about I don't think I'll be able to dig into this much further by myself I'm afraid as I've not found any solid difference between Windows and Linux 😞 |
Currently optional peer dependencies are retained so long as at least one package in the tree has them as an optional peer dependency, meaning once added they become non-optional even though
npm
does actually seem to mark such dependencies.To resolve this, I've modified the pruning logic to check for nodes that are both
optional
andpeer
, in addition toextraneous
nodes.References
Resolves #4737