Conversation
Restore the inline tree of peer dependency issues when `strictPeerDependencies: true` causes `ERR_PNPM_PEER_DEP_ISSUES`, so users and CI tools (e.g. Renovate) can see the failures without running `pnpm peers check` separately. The non-strict warning path still emits the short "Run pnpm peers check" hint.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughA new shared package ChangesPeer Dependency Issue Rendering
Sequence DiagramsequenceDiagram
actor User
participant pnpm as pnpm CLI
participant Validator as Peer Validator
participant Error as Error Handler
participant Reporter as Default Reporter
participant Renderer as Peers Issues Renderer
participant Output as Output Stream
User->>pnpm: pnpm install (strictPeerDependencies: true)
pnpm->>Validator: validate peer dependencies
Validator-->>pnpm: issues found
pnpm->>Error: raise ERR_PNPM_PEER_DEP_ISSUES
Error->>Reporter: reportPeerDependencyIssuesError(issuesByProjects)
Reporter->>Renderer: renderPeerIssues(issuesByProjects)
Renderer->>Renderer: format unmet/missing/conflicting peers
Renderer-->>Reporter: formatted string
Reporter->>Output: write composed error (inline issues + hints)
Output->>User: display ERR_PNPM_PEER_DEP_ISSUES with details
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR restores inline rendering of the peer dependency issues tree specifically for the ERR_PNPM_PEER_DEP_ISSUES error path (triggered by strictPeerDependencies: true), so CI/log consumers can see the actual peer failures without running pnpm peers check separately (fixes #11439).
Changes:
- Re-introduces the
@pnpm/installing.render-peer-issuesworkspace package to render peer-issues as a tree. - Updates the default CLI reporter to include the rendered tree in strict peer dependency errors.
- Adds
cli-columnsto the workspace catalog and wires new dependencies/tests/snapshots.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds cli-columns to the shared catalog for consistent dependency management. |
| pnpm-lock.yaml | Locks the new catalog entry and the restored workspace package dependencies. |
| installing/render-peer-issues/tsconfig.lint.json | Adds lint tsconfig for the restored package. |
| installing/render-peer-issues/tsconfig.json | Adds build tsconfig + project references for the restored package. |
| installing/render-peer-issues/test/tsconfig.json | Adds test tsconfig for compiling/running Jest tests. |
| installing/render-peer-issues/test/index.ts | Adds unit tests for peer-issues tree rendering behavior. |
| installing/render-peer-issues/test/snapshots/index.ts.snap | Adds snapshots for the renderer output. |
| installing/render-peer-issues/src/index.ts | Implements the peer issues tree rendering logic. |
| installing/render-peer-issues/README.md | Documents the restored package. |
| installing/render-peer-issues/package.json | Defines package metadata, scripts, and dependencies. |
| installing/render-peer-issues/CHANGELOG.md | Restores historical changelog content for the package. |
| cli/default-reporter/tsconfig.json | Adds TS project reference to the restored renderer package. |
| cli/default-reporter/test/reportingPeerDependencyIssues.ts | Updates reporter test expectation to assert tree content on strict error. |
| cli/default-reporter/src/reportError.ts | Renders the peer-issues tree inline when reporting strict peer dependency errors. |
| cli/default-reporter/package.json | Adds dependency on @pnpm/installing.render-peer-issues. |
| .changeset/render-peer-issues-on-strict-error.md | Announces the restored strict-error inline tree behavior. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@installing/render-peer-issues/README.md`:
- Around line 11-13: The README's license link `[MIT](LICENSE)` is relative to
installing/render-peer-issues and will 404; update the link target to point at
the repository root license (e.g., change `[MIT](LICENSE)` to `[MIT](/LICENSE)`
or an equivalent root-relative path) so the link resolves to the repo-level
LICENSE from anywhere in the tree.
In `@installing/render-peer-issues/src/index.ts`:
- Around line 38-41: The width calculation for cliColumnsOptions uses
process.stdout.columns directly, which can be undefined in non-TTY CI
environments; update the computation for width (the value assigned to
cliColumnsOptions.width) to fall back to a safe default when opts?.width is not
provided and process.stdout.columns is missing or invalid (e.g., use
process.stdout.columns || a numeric default like 80, or coerce and guard against
NaN) similar to the pattern used in cli/default-reporter so the final width is
always a valid number before subtracting 2.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e835af48-1a7d-4b7f-8541-7a047d3460cb
⛔ Files ignored due to path filters (2)
installing/render-peer-issues/test/__snapshots__/index.ts.snapis excluded by!**/*.snappnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
.changeset/render-peer-issues-on-strict-error.mdcli/default-reporter/package.jsoncli/default-reporter/src/reportError.tscli/default-reporter/test/reportingPeerDependencyIssues.tscli/default-reporter/tsconfig.jsoninstalling/render-peer-issues/CHANGELOG.mdinstalling/render-peer-issues/README.mdinstalling/render-peer-issues/package.jsoninstalling/render-peer-issues/src/index.tsinstalling/render-peer-issues/test/index.tsinstalling/render-peer-issues/test/tsconfig.jsoninstalling/render-peer-issues/tsconfig.jsoninstalling/render-peer-issues/tsconfig.lint.jsonpnpm-workspace.yaml
|
Triaged the bot review comments:
|
Move under deps/inspection/ alongside peers-checker, and use noun-form leaf naming consistent with sibling packages.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…tests - Use a single conditional join instead of a multi-line template literal that left a trailing newline. - Strip ANSI escape codes from output before substring assertions so the tests stay correct under FORCE_COLOR=1.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- renderPeerIssues now emits a separate section per distinct foundVersion for the same peer name, so different installed versions are no longer silently collapsed to the first one. - The strictPeerDependencies hint no longer adds a trailing empty line.
…ixture The previous fixture used versions that actually satisfied their ranges (2.0.0 satisfies ^2.0.0), which would not occur in production data emitted by checkPeerDependencies.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
`pnpm install` non-deterministically picked string-width@4.2.3 for wide-align's optional peer slot; main currently has 1.0.2. Reverting to keep the diff scoped.
Fixes #11439. When `strictPeerDependencies: true` causes `ERR_PNPM_PEER_DEP_ISSUES`, the peer dependency issues are again rendered inline — using the **same format as `pnpm peers check`** — so users (and CI tools like Renovate) can see what failed without running another command. The non-strict warning path is unchanged: it still emits the short "Run `pnpm peers check`" hint. ### Behavior `strictPeerDependencies: true`: ``` ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies ✕ unmet peer react Installed: 17.0.2 Wanted: ^18.2.0: react-dom@18.2.0 hint: To disable failing on peer dependency issues, add the following to pnpm-workspace.yaml in your project root: strictPeerDependencies: false ``` `strictPeerDependencies: false` (unchanged): ``` WARN Issues with peer dependencies found. Run "pnpm peers check" to list them. ``` ### Implementation - Added a new `@pnpm/deps.inspection.peers-issues-renderer` package at `deps/inspection/peers-issues-renderer/`, alongside its data producer `@pnpm/deps.inspection.peers-checker`. It exposes a single `renderPeerIssues()` that emits the flat issue list previously inlined in `pnpm peers check`. - Removed the duplicated formatter from `deps/inspection/commands/src/peers.ts` and made the `pnpm peers check` command consume the new renderer. - `cli/default-reporter/src/reportError.ts`: `reportPeerDependencyIssuesError` now calls the shared `renderPeerIssues()` and prefixes the hint block with the rendered output. Tests strip ANSI escapes before substring assertions so they stay correct under `FORCE_COLOR=1`. Result: a single renderer is shared between the install error and the `pnpm peers check` command — output is identical between the two paths.
Summary
Fixes #11439.
When
strictPeerDependencies: truecausesERR_PNPM_PEER_DEP_ISSUES, the peer dependency issues are again rendered inline — using the same format aspnpm peers check— so users (and CI tools like Renovate) can see what failed without running another command.The non-strict warning path is unchanged: it still emits the short "Run
pnpm peers check" hint.Behavior
strictPeerDependencies: true:strictPeerDependencies: false(unchanged):Implementation
@pnpm/deps.inspection.peers-issues-rendererpackage atdeps/inspection/peers-issues-renderer/, alongside its data producer@pnpm/deps.inspection.peers-checker. It exposes a singlerenderPeerIssues()that emits the flat issue list previously inlined inpnpm peers check.deps/inspection/commands/src/peers.tsand made thepnpm peers checkcommand consume the new renderer.cli/default-reporter/src/reportError.ts:reportPeerDependencyIssuesErrornow calls the sharedrenderPeerIssues()and prefixes the hint block with the rendered output. Tests strip ANSI escapes before substring assertions so they stay correct underFORCE_COLOR=1.Result: a single renderer is shared between the install error and the
pnpm peers checkcommand — output is identical between the two paths.Test plan
pnpm --filter @pnpm/deps.inspection.peers-issues-renderer test— 6 tests passpnpm --filter @pnpm/cli.default-reporter test— 92 tests passreact 17+react-dom 18strictPeerDependencies: true→ flat issue list printed inline (same format aspnpm peers check)strictPeerDependencies: false→ short warning onlypnpm peers checkoutput matches the install error's issue list verbatimSummary by CodeRabbit