-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix: optional set calculation #8537
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
Conversation
7661908
to
1d155dc
Compare
Test failures were from missing snapshots that were deleted because of skipped tests. I restored those snapshots and rebased. |
1d155dc
to
105a86c
Compare
105a86c
to
245300a
Compare
I moved my fix from inside I will spend some more time looking at Edit: no longer looking at |
While investigating CI failure in #8537, I found unrelated test failures when running locally on windows. `prune with lockfile with implicit optional peer dependencies` fixed by adding files to fixture `node_modules`, avoiding network, also reduced package lock to minimum and removed unhelpful snapshots `move aside symlink clutter` fixed by creating problematic symlink in `t.testdir()` instead of in `reifyPackages` hook --------- Co-authored-by: Liam Mitchell <[email protected]>
Things have moved a bit in arborist since this PR was made. I rebased it against |
Discovered while investigating #8535 (comment) Similar to #8566, relates to #8184 Moves `inert` (uninstallable optional) calculation into `buildIdealTree` so it can be used in diff. Also removes most of #8184 in favor of a [simpler fix](https://github.com/npm/cli/pull/8602/files#diff-02626074e1a4a170693607e4a3a69dfc08ee52067734717833b22cf162923e07R354), see PR comments for the journey. Improvements: * we don't see uninstallable packages as "installed" in CLI output * `createSparseTree` no longer creates dirs that will only be cleaned later For the example in the linked issue, it changes output from `added 156 packages` to `added 12 packages` and combined with #8537 it changes to `added 6 packages`, the expected result.
Discovered while investigating #8535 (comment).
I noticed that not all deps of a failed optional dep were added to the trash list.
I modified the tests to expose this and changed the implementation to fix it.
Best illustrated with this graph showing the results of the test case
const setO = optionalSet(nodeO)
:Yellow nodes were returned by the prev implementation. Yellow + green nodes are returned by the fixed implementation.
Code to produce graph