Skip to content

feat(view): show deprecation warning and bin info#12271

Merged
zkochan merged 7 commits into
pnpm:mainfrom
dasa:view-cmd
Jun 10, 2026
Merged

feat(view): show deprecation warning and bin info#12271
zkochan merged 7 commits into
pnpm:mainfrom
dasa:view-cmd

Conversation

@dasa

@dasa dasa commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Closes #11610

This is similar to the npm view command.

Summary by CodeRabbit

  • New Features

    • View command now displays a prominent "DEPRECATED! - " line for deprecated packages and lists available binaries as a comma-separated "bin:" line with improved spacing.
  • Tests

    • Added tests validating the deprecation marker and bin output formatting.
  • Chores

    • Added a patch changeset documenting the view command update.

@dasa dasa requested a review from zkochan as a code owner June 8, 2026 19:44
Copilot AI review requested due to automatic review settings June 8, 2026 19:44
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 8, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0)

Grey Divider


Remediation recommended

1. Unnormalized bin names 🐞 Bug ≡ Correctness
Description
view.handler prints bin names from Object.keys(info.bin) without applying pnpm’s bin-name
normalization and validation, so it may display bin names that would not actually be linked/usable
(e.g. scoped keys or otherwise-invalid names). This makes the new bin: output potentially
incorrect for some package manifests.
Code

deps/inspection/commands/src/view/index.ts[R137-149]

+  if (info.bin) {
+    let bins: string[] = []
+    if (typeof info.bin === 'string') {
+      if (info.bin.length > 0 && info.name) {
+        bins = [info.name[0] === '@' ? info.name.slice(info.name.indexOf('/') + 1) : info.name]
+      }
+    } else {
+      bins = Object.keys(info.bin)
+    }
+    if (bins.length > 0) {
+      lines.push('')
+      lines.push(`bin: ${chalk.cyan(bins.join(', '))}`)
+    }
Evidence
The new view implementation prints raw bin object keys, while pnpm’s bin resolver normalizes
scoped names and filters invalid names before treating them as bins; therefore view can disagree
with actual linked bin names.

deps/inspection/commands/src/view/index.ts[137-149]
bins/resolver/src/index.ts[63-78]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`pnpm view` now renders a `bin:` line, but it builds the list from raw manifest keys (`Object.keys(info.bin)`). pnpm’s bin-linking logic applies normalization (e.g. scope-stripping) and filters invalid/unsafe bin names; as a result, `pnpm view` can show bin names that won’t exist after installation.
### Issue Context
The `bin` section in `deps/inspection/commands/src/view/index.ts` should reflect the same bin names that pnpm would actually expose.
### Fix Focus Areas
- deps/inspection/commands/src/view/index.ts[137-149]
- bins/resolver/src/index.ts[63-78]
### Suggested fix
- When `info.bin` is an object, derive displayed bin names by applying the same normalization rules used by pnpm bin resolution:
- Strip scope from any bin key that starts with `@` (use the segment after the `/`).
- Filter out invalid names (empty, `.`, `..`, and names that fail the same URL-safe validation pnpm uses).
- Consider extracting/reusing a shared helper for “normalize bin name(s) for display/linking” so `view` stays consistent with the bin linker over time.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Empty bin prints blank ✓ Resolved 🐞 Bug ≡ Correctness
Description
view.handler prints a bin: line for any truthy info.bin, so an empty bin object renders as
bin: with no entries. pnpm elsewhere treats an empty bin map as “no bin”, so this output is
misleading.
Code

deps/inspection/commands/src/view/index.ts[R137-141]

+  if (info.bin) {
+    const bins = typeof info.bin === 'string' ? [info.bin] : Object.keys(info.bin)
+    lines.push('')
+    lines.push(`bin: ${chalk.cyan(bins.join(', '))}`)
+  }
Evidence
The new view rendering uses Object.keys(info.bin) and prints regardless of key count, so {}
becomes an empty bin: line. pnpm’s dependency resolver logic explicitly checks for
Object.keys(pkg.bin).length === 0 to treat it as no-bin, demonstrating the intended semantics for
empty bin maps.

deps/inspection/commands/src/view/index.ts[127-141]
installing/deps-resolver/src/resolveDependencies.ts[1607-1610]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`view.handler` currently renders a `bin:` line whenever `info.bin` is truthy. If `info.bin` is an empty object (`{}`), this produces `bin: ` (empty list), which is misleading.
## Issue Context
Other pnpm codepaths explicitly treat `bin: {}` as equivalent to “no bins”, so `view` should not print a `bin:` line unless at least one bin name exists.
## Fix Focus Areas
- deps/inspection/commands/src/view/index.ts[137-141]
## Suggested change
- Compute `bins` as today.
- Only push the blank line + `bin:` line if `bins.length > 0`.
- Optionally, treat an object bin with `Object.keys(info.bin).length === 0` as absent (same effect).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Bin string shown as path ✓ Resolved 🐞 Bug ≡ Correctness
Description
view.handler prints a string-valued bin as the raw relative path (e.g. cli.js) instead of the
executable name derived from the package name (scope-stripped), so reported bins are wrong for
shorthand bin manifests.
Code

deps/inspection/commands/src/view/index.ts[R137-141]

+  if (info.bin) {
+    const bins = typeof info.bin === 'string' ? [info.bin] : Object.keys(info.bin)
+    lines.push('')
+    lines.push(`bin: ${chalk.cyan(bins.join(', '))}`)
+  }
Evidence
The current implementation uses the raw string bin value, but pnpm types and existing bin
resolution show that string bin is a path and executable name should be derived from the package
name (scope removed).

deps/inspection/commands/src/view/index.ts[137-141]
core/types/src/package.ts[5-6]
core/types/src/package.ts[90-98]
bins/resolver/src/index.ts[63-68]
pnpr/.fixtures/packages/@foo/touch-file-one-bin/1.0.0/package.json[1-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `view` command prints `bin` values incorrectly when `info.bin` is a string. In package manifests, a string `bin` value represents the executable *path*, while the executable *name* should be derived from the package name (and for scoped packages, the scope must be stripped).
### Issue Context
- `PackageBin` is defined as `string | { [commandName: string]: string }`, where the string form is a path.
- pnpm’s own bin resolution logic derives the command name from the package name and strips scope.
### Fix Focus Areas
- deps/inspection/commands/src/view/index.ts[137-141]
### Suggested fix
Replace the current `bins` computation with logic that mirrors pnpm bin naming:
- If `info.bin` is a string: use `info.name` as the command name, but strip scope (`@scope/name` -> `name`).
- If `info.bin` is an object: use its keys, but also strip scope for any key starting with `@`.
Example helper:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (2)
4. Tests rely on upstream uuid ✓ Resolved 🐞 Bug ☼ Reliability
Description
The new view tests query uuid@10.0.0 even though the repo provides fixture packages for
deprecation and bin cases, making the test suite depend on upstream package metadata/version
availability.
Code

deps/inspection/commands/test/view.ts[R127-130]

+test('view: text output includes bin', async () => {
+  const result = await view.handler(VIEW_OPTIONS as unknown as Config & ConfigContext, ['uuid@10.0.0']) as string
+  expect(result).toContain('bin: uuid')
+})
Evidence
The added tests explicitly depend on uuid@10.0.0, while the repo already contains fixture packages
with deprecated and bin fields that can be used for deterministic tests.

deps/inspection/commands/test/view.ts[127-154]
pnpr/.fixtures/packages/@pnpm.e2e/deprecated/1.0.0/package.json[1-6]
pnpr/.fixtures/packages/@foo/touch-file-one-bin/1.0.0/package.json[1-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`deps/inspection/commands/test/view.ts` adds tests that query `uuid@10.0.0`. This introduces reliance on external/upstream package metadata instead of the repo’s deterministic registry fixtures.
### Issue Context
The test registry is seeded from in-repo fixtures (see `pnpr/.fixtures/packages`). There are existing fixture packages that cover:
- deprecated packages: `@pnpm.e2e/deprecated@1.0.0`
- packages with `bin` (both object and string forms): e.g. `@pnpm.e2e/touch-file-one-bin@1.0.0` and `@foo/touch-file-one-bin@1.0.0`
### Fix Focus Areas
- deps/inspection/commands/test/view.ts[127-154]
### Suggested fix
Replace `uuid@10.0.0` with fixture packages:
- For bin output: use `@pnpm.e2e/touch-file-one-bin@1.0.0` (expects `bin: t`) and/or `@foo/touch-file-one-bin@1.0.0` (expects derived name for string bin once fixed).
- For deprecation output: use `@pnpm.e2e/deprecated@1.0.0`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. ANSI-fragile output assertions 🐞 Bug ☼ Reliability
Description
The new assertions look for contiguous substrings like bin: uuid and DEPRECATED! - , but the
implementation colors only part of those lines with chalk, which inserts ANSI escape codes and
breaks such substring checks when colors are enabled.
Code

deps/inspection/commands/test/view.ts[R151-154]

+test('view: text output for deprecated package shows deprecation', async () => {
+  const result = await view.handler(VIEW_OPTIONS as unknown as Config & ConfigContext, ['uuid@10.0.0']) as string
+  expect(result).toContain('DEPRECATED! - ')
+})
Evidence
view applies chalk to only the token/bins segment, which can insert ANSI sequences between the
visible text segments. The repo demonstrates the preferred approach of stripping ANSI codes before
assertions.

deps/inspection/commands/src/view/index.ts[127-141]
deps/inspection/commands/test/view.ts[127-154]
pnpm/test/formatError.test.ts[1-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Tests assert on raw output that may contain ANSI color codes from `chalk`. Because only parts of the lines are colored, substring assertions like `"DEPRECATED! - "` and `"bin: uuid"` can fail when color output is enabled (e.g., `FORCE_COLOR=1`).
### Issue Context
- `view` builds these lines using `chalk.red('DEPRECATED!')` and `chalk.cyan(...)` for bins.
- The repo already uses `stripVTControlCharacters` to make colorized output tests stable.
### Fix Focus Areas
- deps/inspection/commands/test/view.ts[127-154]
### Suggested fix
In the tests, normalize the result before assertions:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bff9fc4c-d407-43bc-a706-6cb86a90ee65

📥 Commits

Reviewing files that changed from the base of the PR and between c85cfed and 1599363.

📒 Files selected for processing (1)
  • deps/inspection/commands/src/view/index.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Compile & Lint
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use Standard Style with trailing commas, prefer functions over classes, declare functions after they are used (relying on hoisting), limit functions to no more than two or three arguments, and use a single options object for functions needing more parameters
Follow import order: standard libraries first, then external dependencies (sorted alphabetically), then relative imports
Do not write comments that restate what the code already says; rename variables, split helpers, or move checks to more obvious places instead
Do not repeat documentation at call sites that already lives on the callee; update the JSDoc once and let every call site benefit
Use JSDoc for the function's contract (preconditions, postconditions, edge cases, why the function exists), not for re-narrating the function body
Do not record past implementation shape, refactor history, or removed code in comments; use git log and git blame for that information instead
Write comments only when the reason for code is non-obvious, a hidden invariant exists, a workaround for a known bug is needed, or an exception to surrounding pattern is deliberate

Files:

  • deps/inspection/commands/src/view/index.ts
🧠 Learnings (2)
📚 Learning: 2026-05-14T09:04:00.133Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11622
File: resolving/npm-resolver/test/publishedBy.test.ts:350-354
Timestamp: 2026-05-14T09:04:00.133Z
Learning: In the pnpm/pnpm repository, ESLint is the authoritative style linter. Do not raise review findings for missing trailing commas in multiline function calls (e.g., `fs.writeFileSync(...)`) when this repo’s ESLint configuration does not report them and lint passes. Prefer deferring to the ESLint results for this specific trailing-comma rule rather than enforcing it manually in code review.

Applied to files:

  • deps/inspection/commands/src/view/index.ts
📚 Learning: 2026-06-05T13:47:26.046Z
Learnt from: vsumner
Repo: pnpm/pnpm PR: 12190
File: installing/deps-installer/src/install/index.ts:2337-2343
Timestamp: 2026-06-05T13:47:26.046Z
Learning: In the pnpm/pnpm codebase, `PnpmError` automatically prefixes `err.code` with `ERR_PNPM_` when you pass a code that does not already start with `ERR_PNPM_` (it normalizes `this.code` via `code.startsWith('ERR_PNPM_') ? code : `ERR_PNPM_${code}``). Therefore, during code review you should NOT flag `new PnpmError(...)` call sites for passing a bare error code (e.g., `new PnpmError('FROZEN_STORE_INCOMPATIBLE_WITH_PNPR', ...)`); the resulting `err.code` will still be `ERR_PNPM_FROZEN_STORE_INCOMPATIBLE_WITH_PNPR`.

Applied to files:

  • deps/inspection/commands/src/view/index.ts
🔇 Additional comments (2)
deps/inspection/commands/src/view/index.ts (2)

127-130: LGTM!


137-150: LGTM!


📝 Walkthrough

Walkthrough

The view command now displays deprecation notices and improves bin field handling. When a package has deprecation metadata, a "DEPRECATED!" section is appended. The bin field is normalized from string or object and rendered as a comma-separated bin: line. Tests and a changeset were added.

Changes

View Command Deprecation and Bin Display

Layer / File(s) Summary
Deprecation notice and bin field rendering
deps/inspection/commands/src/view/index.ts, deps/inspection/commands/test/view.ts, .changeset/loose-meteors-travel.md
Handler output now conditionally appends DEPRECATED! when info.deprecated is present; info.bin is normalized (string → single-element array derived from info.name, object → keys) and rendered as a comma-separated bin: line. Tests verify bin: output and the deprecation marker; a changeset records a patch bump.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • zkochan

Poem

🐰 A tiny note that time has passed,
"DEPRECATED!" now appears at last.
Bins lined up in tidy rows,
The view command politely shows.
Hoppity hops — the rabbit knows!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: displaying deprecation warnings and bin information in the view command.
Linked Issues check ✅ Passed The pull request implements the core requirement from #11610 by adding deprecation notice display to the view command, mirroring npm view behavior as requested.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #11610: deprecation display, bin information output, and supporting tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds additional information to the pnpm view text output and expands test coverage to validate the new sections.

Changes:

  • Display deprecation notices in text output when info.deprecated is present
  • Display bin entries in text output when info.bin is present
  • Add tests asserting the presence of bin and deprecation output

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
deps/inspection/commands/src/view/index.ts Adds deprecated and bin sections to text view output formatting.
deps/inspection/commands/test/view.ts Adds assertions to ensure bin and deprecation sections appear in text output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deps/inspection/commands/src/view/index.ts
Comment thread deps/inspection/commands/test/view.ts Outdated
Comment thread deps/inspection/commands/test/view.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
deps/inspection/commands/test/view.ts (2)

127-130: ⚡ Quick win

Consider testing both bin formats.

The test only verifies the output for a single package (uuid@10.0.0). To ensure robust coverage, consider adding a test case that explicitly verifies:

  1. String bin format (single executable)
  2. Object bin format (multiple commands)

This would catch any issues with the bin normalization logic in the handler.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deps/inspection/commands/test/view.ts` around lines 127 - 130, The test for
view.handler currently only asserts a single-package case and misses verifying
both bin formats; add at least one more test that calls view.handler (using
VIEW_OPTIONS and the same Config & ConfigContext typing) with a package whose
package.json uses an object-style bin (multiple commands) and assert the output
contains each expected "bin: <name>" entry in addition to keeping the existing
string-style test for uuid@10.0.0 so the bin normalization logic in view.handler
is covered for both string and object formats.

151-154: ⚡ Quick win

Consider verifying the actual deprecation message.

The test only checks for the presence of the "DEPRECATED! - " prefix. To strengthen the assertion, consider also verifying that the actual deprecation message appears in the output, not just the label.

For example:

  expect(result).toContain('DEPRECATED! - ')
+ expect(result).toMatch(/DEPRECATED! - .+/)

This ensures the deprecation message content is actually rendered, not just the label.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deps/inspection/commands/test/view.ts` around lines 151 - 154, The test
"view: text output for deprecated package shows deprecation" currently only
asserts the prefix 'DEPRECATED! - ' is present; update the assertion to also
verify the actual deprecation message is rendered by checking view.handler's
output (the call using VIEW_OPTIONS and ['uuid@10.0.0']) contains a non-empty
message after that prefix — either assert a concrete expected message string if
known or use a regex/assertion that ensures 'DEPRECATED! - ' is followed by some
non-whitespace text (e.g. match /DEPRECATED! - \S+/) so the test validates the
deprecation content as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@deps/inspection/commands/test/view.ts`:
- Around line 127-130: The test for view.handler currently only asserts a
single-package case and misses verifying both bin formats; add at least one more
test that calls view.handler (using VIEW_OPTIONS and the same Config &
ConfigContext typing) with a package whose package.json uses an object-style bin
(multiple commands) and assert the output contains each expected "bin: <name>"
entry in addition to keeping the existing string-style test for uuid@10.0.0 so
the bin normalization logic in view.handler is covered for both string and
object formats.
- Around line 151-154: The test "view: text output for deprecated package shows
deprecation" currently only asserts the prefix 'DEPRECATED! - ' is present;
update the assertion to also verify the actual deprecation message is rendered
by checking view.handler's output (the call using VIEW_OPTIONS and
['uuid@10.0.0']) contains a non-empty message after that prefix — either assert
a concrete expected message string if known or use a regex/assertion that
ensures 'DEPRECATED! - ' is followed by some non-whitespace text (e.g. match
/DEPRECATED! - \S+/) so the test validates the deprecation content as well.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 005c8f81-8433-4d92-9d73-e030e4b4ab2f

📥 Commits

Reviewing files that changed from the base of the PR and between e4d2fe0 and d577c08.

📒 Files selected for processing (2)
  • deps/inspection/commands/src/view/index.ts
  • deps/inspection/commands/test/view.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Compile & Lint
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use Standard Style with trailing commas, prefer functions over classes, declare functions after they are used (relying on hoisting), limit functions to no more than two or three arguments, and use a single options object for functions needing more parameters
Follow import order: standard libraries first, then external dependencies (sorted alphabetically), then relative imports
Do not write comments that restate what the code already says; rename variables, split helpers, or move checks to more obvious places instead
Do not repeat documentation at call sites that already lives on the callee; update the JSDoc once and let every call site benefit
Use JSDoc for the function's contract (preconditions, postconditions, edge cases, why the function exists), not for re-narrating the function body
Do not record past implementation shape, refactor history, or removed code in comments; use git log and git blame for that information instead
Write comments only when the reason for code is non-obvious, a hidden invariant exists, a workaround for a known bug is needed, or an exception to surrounding pattern is deliberate

Files:

  • deps/inspection/commands/test/view.ts
  • deps/inspection/commands/src/view/index.ts
🧠 Learnings (3)
📚 Learning: 2026-05-14T09:04:00.133Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11622
File: resolving/npm-resolver/test/publishedBy.test.ts:350-354
Timestamp: 2026-05-14T09:04:00.133Z
Learning: In the pnpm/pnpm repository, ESLint is the authoritative style linter. Do not raise review findings for missing trailing commas in multiline function calls (e.g., `fs.writeFileSync(...)`) when this repo’s ESLint configuration does not report them and lint passes. Prefer deferring to the ESLint results for this specific trailing-comma rule rather than enforcing it manually in code review.

Applied to files:

  • deps/inspection/commands/test/view.ts
  • deps/inspection/commands/src/view/index.ts
📚 Learning: 2026-06-05T13:47:05.929Z
Learnt from: vsumner
Repo: pnpm/pnpm PR: 12190
File: installing/deps-installer/test/install/frozenStore.ts:2-17
Timestamp: 2026-06-05T13:47:05.929Z
Learning: In the pnpm/pnpm repository, the shared Jest preset keeps `injectGlobals` at its default (`true`), so `test` and `expect` are available as Jest globals. Therefore, reviewers should not flag (or treat as TypeScript/compilation errors) missing `import { test, expect } from 'jest/globals'` when a test file uses `test`/`expect` without importing them. Importing from `jest/globals` may still be used for consistency with sibling files, but it is not required for execution in this repo unless a Jest preset is explicitly configured with `injectGlobals: false`.

Applied to files:

  • deps/inspection/commands/test/view.ts
📚 Learning: 2026-06-05T13:47:26.046Z
Learnt from: vsumner
Repo: pnpm/pnpm PR: 12190
File: installing/deps-installer/src/install/index.ts:2337-2343
Timestamp: 2026-06-05T13:47:26.046Z
Learning: In the pnpm/pnpm codebase, `PnpmError` automatically prefixes `err.code` with `ERR_PNPM_` when you pass a code that does not already start with `ERR_PNPM_` (it normalizes `this.code` via `code.startsWith('ERR_PNPM_') ? code : `ERR_PNPM_${code}``). Therefore, during code review you should NOT flag `new PnpmError(...)` call sites for passing a bare error code (e.g., `new PnpmError('FROZEN_STORE_INCOMPATIBLE_WITH_PNPR', ...)`); the resulting `err.code` will still be `ERR_PNPM_FROZEN_STORE_INCOMPATIBLE_WITH_PNPR`.

Applied to files:

  • deps/inspection/commands/test/view.ts
  • deps/inspection/commands/src/view/index.ts
🔇 Additional comments (2)
deps/inspection/commands/src/view/index.ts (2)

127-130: LGTM!


137-141: Fix bin rendering for string-form info.bin

Current rendering treats info.bin differently by type: when it’s an object, it prints command names (Object.keys(info.bin)), but when it’s a string it prints the string value itself. Per npm’s bin: "<path>" convention, the command name should be the package name (info.name), not the path string.

The view test only asserts the uuid@10.0.0 output contains bin: uuid, so it may be exercising the object-form mock rather than the string-form.

  • Location: deps/inspection/commands/src/view/index.ts (lines ~137-141)
  • Minor: remove the extra space after ? on the ternary (line ~138)
🛠️ Proposed fix
  if (info.bin) {
-   const bins = typeof info.bin === 'string' ?  [info.bin] : Object.keys(info.bin)
-   lines.push('');
+   const bins = typeof info.bin === 'string' ? (info.name ? [info.name] : [info.bin]) : Object.keys(info.bin)
+   lines.push('')
    lines.push(`bin: ${chalk.cyan(bins.join(', '))}`)
  }

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 8, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 521da3e

Copilot AI review requested due to automatic review settings June 8, 2026 22:02
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 8, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 36a825c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread deps/inspection/commands/src/view/index.ts
Comment thread deps/inspection/commands/src/view/index.ts Outdated
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit c85cfed

Copilot AI review requested due to automatic review settings June 9, 2026 22:43
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 01eb3fc

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread deps/inspection/commands/src/view/index.ts
Comment thread deps/inspection/commands/src/view/index.ts
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 1599363

@dasa dasa requested a review from Copilot June 9, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread deps/inspection/commands/src/view/index.ts
Comment thread deps/inspection/commands/src/view/index.ts
@zkochan zkochan merged commit 46fd26a into pnpm:main Jun 10, 2026
10 checks passed
@dasa dasa deleted the view-cmd branch June 10, 2026 15:21
KSXGitHub pushed a commit that referenced this pull request Jun 10, 2026
Integrate the 9 commits main gained (#12271, #12294, #12301, #12303,
#12305, #12312, #12315, #12316, and the release/version bumps).

Conflict resolution: all four conflicts (record_lockfile_verified,
build_modules, hoisted_dep_graph, install) were between this branch's
lint edits and main's feature changes — took main's authoritative
versions; lint compliance is re-derived by re-running clippy in the
follow-up commit.
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.

Add deprecation notice to view command

3 participants