Uh oh!
There was an error while loading. Please reload this page.
feat: dedupe - display difference when --dry-run is enabled - #7133
Conversation
wraithgar
commented
Jan 16, 2024
Wow this has been on a lot of folks' wishlist for years! |
ljharb
commented
Jan 16, 2024
Agreed, this is amazing! is it too much to ask to align the output like a table? i'm not sure if the cli has a pattern for that already |
wraithgar
commented
Jan 16, 2024
How do we feel about displaying this if the config value |
ljharb
commented
Jan 16, 2024
I definitely would. I'd also love to see it on |
wraithgar
commented
Jan 17, 2024
Just to clarify, these suggestions can be done in separate PRs, I think having dry-run always do this is fine for a start. |
ritaaktay
commented
Jan 23, 2024
Tried out an implementation of tabular format using the examples in |
## Summary - suppress human-readable reify diff lines when JSON output is requested - preserve detailed diff output for non-JSON `--dry-run` and `--long` commands - cover both `--dry-run --json` and `--long --json` ## Background Detailed dry-run diff output was introduced in npm 10.4.0 by #7133 without accounting for JSON mode. The structured JSON summary already contains the add, remove, and change details, so the extra text is redundant and makes stdout invalid JSON. Related to #8567, with the regression coverage requested during review. ## Testing - `tap --no-coverage --no-check-coverage test/lib/utils/reify-output.js` - `eslint lib/utils/reify-output.js test/lib/utils/reify-output.js` Fixes#8565 Copilot-Session: 48e629f8-eb5a-467c-970b-feb313628c00
This PR adds functionality to show the difference in what would have been changed if the user had run the
dedupecommand with the--dry-runflag. At the moment the output is not really useful and doesn't give the user any information other than something likeadded 2 packages, removed 3 packages, and changed 12 packages in 48s.This PR changes that:

References
Closes#2687
Closes#4398