Skip to content

fix: keep dry-run output valid json - #9928

Merged
reggi merged 1 commit into
release/v11from
backport/v11/9823
Aug 28, 2026
Merged

fix: keep dry-run output valid json#9928
reggi merged 1 commit into
release/v11from
backport/v11/9823

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #9823 to release/v11.

## 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
(cherry picked from commit a8c9b2f)
@github-actions
github-actions Bot requested review from a team as code owners August 27, 2026 22:21
@reggi
reggi merged commit 7f1f2b7 into release/v11 Aug 28, 2026
37 checks passed
@reggi
reggi deleted the backport/v11/9823 branch August 28, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants