Commit f6c868d
authored
fix: calculate omit in diff (#8566)
Discovered while investigating #8535
`npm install --omit` output doesn't show any removed packages.
This PR moves the omit calc into the diff calc so omits are handled like
other resolution logic.
Improvements:
* we see removals in CLI output
* _createSparseTree no longer creates dirs that will only be cleaned
later
* no duplicate filterSet calculation, omit is calculated right after
filters
I removed the trashList check on reifying node. Code coverage complained
that this branch wasn't hit in any tests so I assume it should always be
empty.
I think this uncovered one bug with workspaces in the test `workspaces >
reify workspaces omit dev dependencies > workspaces only`. From my
understanding of the
[docs](https://docs.npmjs.com/cli/v11/commands/npm-install#include-workspace-root),
only workspace `a` should be touched, `root` and workspace `b` should
still have their packages. I updated the test.
Co-authored-by: Liam Mitchell <[email protected]>1 parent 7949cff commit f6c868d
File tree
5 files changed
+63
-46
lines changed- workspaces/arborist
- lib
- arborist
- tap-snapshots/test/arborist
- test/arborist
5 files changed
+63
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
315 | 320 | | |
316 | 321 | | |
317 | 322 | | |
318 | | - | |
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
| |||
470 | 474 | | |
471 | 475 | | |
472 | 476 | | |
| 477 | + | |
| 478 | + | |
473 | 479 | | |
474 | 480 | | |
475 | 481 | | |
| |||
554 | 560 | | |
555 | 561 | | |
556 | 562 | | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | 563 | | |
589 | 564 | | |
590 | 565 | | |
| |||
683 | 658 | | |
684 | 659 | | |
685 | 660 | | |
686 | | - | |
687 | 661 | | |
688 | 662 | | |
689 | 663 | | |
690 | 664 | | |
691 | 665 | | |
692 | 666 | | |
693 | 667 | | |
694 | | - | |
695 | 668 | | |
696 | 669 | | |
697 | 670 | | |
698 | 671 | | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | 672 | | |
704 | 673 | | |
705 | 674 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
97 | | - | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
104 | | - | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
109 | 123 | | |
110 | 124 | | |
111 | 125 | | |
| |||
184 | 198 | | |
185 | 199 | | |
186 | 200 | | |
| 201 | + | |
| 202 | + | |
187 | 203 | | |
188 | 204 | | |
189 | 205 | | |
| |||
214 | 230 | | |
215 | 231 | | |
216 | 232 | | |
| 233 | + | |
| 234 | + | |
217 | 235 | | |
218 | 236 | | |
219 | 237 | | |
| |||
232 | 250 | | |
233 | 251 | | |
234 | 252 | | |
| 253 | + | |
| 254 | + | |
235 | 255 | | |
236 | 256 | | |
237 | 257 | | |
238 | 258 | | |
239 | 259 | | |
240 | | - | |
| 260 | + | |
241 | 261 | | |
242 | 262 | | |
243 | 263 | | |
244 | 264 | | |
245 | 265 | | |
246 | 266 | | |
247 | 267 | | |
248 | | - | |
| 268 | + | |
249 | 269 | | |
250 | 270 | | |
251 | 271 | | |
| |||
285 | 305 | | |
286 | 306 | | |
287 | 307 | | |
| 308 | + | |
| 309 | + | |
288 | 310 | | |
289 | 311 | | |
290 | 312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
493 | 505 | | |
494 | 506 | | |
495 | 507 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17365 | 17365 | | |
17366 | 17366 | | |
17367 | 17367 | | |
17368 | | - | |
17369 | 17368 | | |
17370 | 17369 | | |
17371 | 17370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
397 | 412 | | |
398 | 413 | | |
399 | 414 | | |
| |||
1329 | 1344 | | |
1330 | 1345 | | |
1331 | 1346 | | |
1332 | | - | |
| 1347 | + | |
1333 | 1348 | | |
1334 | 1349 | | |
1335 | 1350 | | |
| |||
0 commit comments