Repository navigation
feat(outdated): include node, deno, and bun runtimes - #11739
Conversation
`pnpm outdated` and `pnpm update --interactive` previously skipped `runtime:` dependencies because the npm specifier parser does not understand the protocol, so runtime versions never appeared in the outdated table or the interactive update picker.
|
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📜 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)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📚 Learning: 2026-05-14T09:04:00.133ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughRefactors outdated to dispatch "latest" queries via a ResolveLatestDispatcher, adds latest-resolution types and protocol/runtime resolveLatest implementations, wires the dispatcher into the default resolver and client API, updates outdated/outdatedDepsOfProjects and tests, and records a changeset documenting runtime support. ChangesOutdated command with resolver-driven latest resolution
Sequence Diagram(s)sequenceDiagram
participant Outdated
participant ResolveLatest
participant NpmResolver
participant RuntimeResolver
participant GitResolver
Outdated->>ResolveLatest: resolveLatest({ wantedDependency, compatible, resolveOpts })
ResolveLatest->>NpmResolver: resolveLatestFromNpm / JSR / NamedRegistry
ResolveLatest->>RuntimeResolver: resolveLatestNodeRuntime / resolveLatestDenoRuntime / resolveLatestBunRuntime
ResolveLatest->>GitResolver: resolveLatestFromGit
ResolveLatest-->>Outdated: LatestInfo | undefined
Estimated code review effort Possibly related PRs
Suggested labels
🚥 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 docstrings
🧪 Generate unit tests (beta)
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. Comment |
Each protocol resolver (npm, jsr, named-registry, git, tarball, local, node/bun/deno runtimes) now exports its own outdated function alongside its resolve function. `@pnpm/resolving.default-resolver` composes them into a single dispatcher, surfaced through `@pnpm/installing.client` as `createResolver(...).outdated`. The outdated command is protocol-agnostic — each resolver decides what "latest" means for its own protocol, how to extract current/wanted versions, and whether the dep is in scope at all. `@pnpm/resolving.resolver-base` defines the `OutdatedQuery`, `OutdatedInfo`, and `OutdatedFunction` types that every resolver implements.
`outdated` describes a state, not an action. Rename the resolver-side function to `resolveLatest` so it parallels `resolve` — each resolver already knows how to `resolve` a wanted dep to a specific version; the sister method figures out what the freshest version is. The function returns info even when nothing's outdated, so the new name doesn't mislead. Renamings: - `OutdatedQuery` → `LatestQuery` - `OutdatedInfo` → `LatestInfo` - `OutdatedFunction` → `ResolveLatestFunction` - `OutdatedDispatcher` → `ResolveLatestDispatcher` - `outdatedFromNpm`/`Jsr`/`NamedRegistry` → `resolveLatestFromNpm`/... - `outdatedGit`/`Tarball`/`Local` → `resolveLatestFromGit`/... - `outdatedNodeRuntime`/`Bun`/`Deno` → `resolveLatestNodeRuntime`/... - `createResolver(...).outdated` → `createResolver(...).resolveLatest`
Previously outdated.ts bailed out on a null \`relativeDepPath\` (i.e. \`link:\`) and threw on a missing \`pkgSnapshot\` (which also covered \`file:\` deps incidentally). Both protocol-specific checks lived in the command code. Now outdated.ts dispatches the query regardless of whether a snapshot exists; the local-resolver returns undefined for these refs, so they're silently skipped through the same path as any other unclaimed dep. Side benefit: a corrupted lockfile with a missing npm snapshot no longer crashes \`outdated\`; the npm-resolver still resolves latest from the registry, so the user sees a useful "current=missing, latest=X" entry instead of a stack trace.
Narrow the resolver contract:
- LatestQuery now carries just \`wantedDependency\`, \`wantedRef\`, and
\`compatible\`. \`currentRef\`, \`wantedVersion\`, \`currentVersion\`, and
\`registry\` are gone — none belonged in the resolver-facing API.
- LatestInfo is just \`{ latestManifest?: PackageManifest }\`. The resolver
no longer formats \`current\` / \`wanted\` display strings or returns
\`packageName\`; it just says "I claim this dep, here's what's latest
if I could find one."
Display + comparison move into outdated.ts:
- \`current\` / \`wanted\` derive from \`pkgSnapshot.version\` (falls back
to the raw ref for URL-shaped refs where the URL is the only diff
signal between commits).
- The "lockfile shifted" check uses raw \`wantedRef !== currentRef\`,
which is more sensitive than parsed-version equality and catches
peer-hash changes too.
- \`packageName\` comes from \`dp.parse(relativeDepPath).name\`, so
aliased deps still report under the real package name.
pickRegistryForPackage moves into npm-resolver: the resolver already
has \`opts.registries\` via its ctx, so it can pick per-package
internally instead of every caller passing a pre-resolved registry.
Also rename query field \`ref\` → \`wantedRef\` to mirror \`currentRef\`
elsewhere.
\`@pnpm/config.pick-registry-for-package\` was removed from \`@pnpm/deps.inspection.outdated\`'s dependencies in the previous commit; meta-updater caught the matching tsconfig project reference hanging around. Drop it.
Only the runtime resolvers used \`wantedRef\` (to detect \`runtime:\`
refs), and they can use \`wantedDependency.bareSpecifier\` for the same
check — the manifest spec starts with \`runtime:\` whenever the lockfile
ref does, so detection works identically. Every other resolver already
ignored \`wantedRef\`.
\`LatestQuery\` is now \`{ wantedDependency, compatible }\` — the
resolver's view of the dep is just "what does the manifest say to
install, in compatible or latest mode?" The lockfile-resolved ref is
the caller's concern.
The npm-resolver's \`resolveLatest\` was passing \`update: 'latest'\` to the underlying resolver, which makes it ignore the bareSpecifier's range and pick the absolute newest version. Under \`--compatible\` that defeats the whole point: \`is-negative: ^1.0.0\` should resolve to latest within ^1.0.0 (e.g. 1.0.1), not the absolute latest 2.1.0. The original \`createManifestGetter\` didn't pass \`update\` at all — it relied on the bareSpecifier (\`'latest'\` or the manifest range) to drive resolution. Drop the flag here too. Caught by the existing CLI e2e tests: \`pnpm outdated: print only compatible versions\` and \`pnpm outdated: --compatible works with npm aliases\`.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
deps/inspection/outdated/test/outdated.spec.ts (1)
20-22: ⚡ Quick winSkip
workspace:in the mock dispatcher too.The production flow now lets the local resolver claim
link:,file:, andworkspace:specs, but this helper still routesworkspace:throughgetLatest(). That makes the test double slightly more permissive than the real dispatcher and can hide regressions once workspace coverage is added.Suggested fix
- if (bareSpecifier?.startsWith('file:') || bareSpecifier?.startsWith('link:')) { + if ( + bareSpecifier?.startsWith('file:') || + bareSpecifier?.startsWith('link:') || + bareSpecifier?.startsWith('workspace:') + ) { return undefined }🤖 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/outdated/test/outdated.spec.ts` around lines 20 - 22, The test helper's mock dispatcher currently treats bareSpecifier starting with 'file:' or 'link:' as local and returns undefined, but it misses 'workspace:', causing workspace: specs to be routed through getLatest() and making the test more permissive than production; update the condition in the mock (the branch that checks bareSpecifier in the test helper/mock dispatcher) to also check bareSpecifier?.startsWith('workspace:') and return undefined for that case so workspace: specs are handled the same way as in the real dispatcher.
🤖 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.
Inline comments:
In @.changeset/outdated-runtimes.md:
- Line 19: The changeset wrongly documents LatestQuery as including wantedRef;
update the text to remove wantedRef from the LatestQuery description and state
that ResolveLatestFunction takes a LatestQuery composed of
wantedDependency.bareSpecifier and compatible (no wantedRef), and that protocol
is inferred from wantedDependency.bareSpecifier; also mention that protocol
resolvers export resolveLatest* and that the composed dispatcher is available as
createResolver(...).resolveLatest (referencing ResolveLatestFunction,
LatestQuery, LatestInfo, resolveLatest*, and createResolver(...).resolveLatest
to locate the relevant documentation).
In `@deps/inspection/outdated/src/outdated.ts`:
- Around line 198-200: displayVersion currently falls back to returning the raw
ref which for aliased dep-paths like "[email protected]" or "positive:
[email protected]" incorrectly surfaces the full dep-path instead of the plain
version; update displayVersion to, when snapshotVersion is undefined, detect and
extract a trailing semver from the ref (e.g. match
/@(\d+\.\d+\.\d+(?:[-+][\w.-]+)?)$/ or similar) and return that captured version
string; keep the existing URL check (/^https?:/) and only apply this dep-path
semver extraction before returning ref.
In `@resolving/default-resolver/src/index.ts`:
- Around line 159-169: The final branch in the resolveLatest function returns a
Promise because resolveLatestFromNamedRegistry(query, opts) is not awaited;
update the resolveLatest implementation to await
resolveLatestFromNamedRegistry(query, opts) (i.e., ensure the last call in the
chain uses await like the other resolvers) so the function consistently returns
LatestInfo | undefined instead of a raw Promise.
---
Nitpick comments:
In `@deps/inspection/outdated/test/outdated.spec.ts`:
- Around line 20-22: The test helper's mock dispatcher currently treats
bareSpecifier starting with 'file:' or 'link:' as local and returns undefined,
but it misses 'workspace:', causing workspace: specs to be routed through
getLatest() and making the test more permissive than production; update the
condition in the mock (the branch that checks bareSpecifier in the test
helper/mock dispatcher) to also check bareSpecifier?.startsWith('workspace:')
and return undefined for that case so workspace: specs are handled the same way
as in the real dispatcher.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bd08e656-cc8e-4183-99b1-05d743ffab0f
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (17)
.changeset/outdated-runtimes.mddeps/inspection/outdated/package.jsondeps/inspection/outdated/src/outdated.tsdeps/inspection/outdated/src/outdatedDepsOfProjects.tsdeps/inspection/outdated/test/outdated.spec.tsdeps/inspection/outdated/tsconfig.jsonengine/runtime/bun-resolver/src/index.tsengine/runtime/deno-resolver/src/index.tsengine/runtime/node-resolver/src/index.tsinstalling/client/src/index.tspkg-manifest/utils/src/convertEnginesRuntimeToDependencies.tsresolving/default-resolver/src/index.tsresolving/git-resolver/src/index.tsresolving/local-resolver/src/index.tsresolving/npm-resolver/src/index.tsresolving/resolver-base/src/index.tsresolving/tarball-resolver/src/index.ts
💤 Files with no reviewable changes (2)
- deps/inspection/outdated/tsconfig.json
- deps/inspection/outdated/package.json
📜 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). (3)
- GitHub Check: Agent
- GitHub Check: ubuntu-latest / Node.js 24 / Test
- GitHub Check: Run benchmark on ubuntu-latest
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Follow Standard Style with trailing commas, prefer functions over classes, declare functions after they are used (rely on hoisting), and use a single options object for functions with more than two or three arguments
Sort imports in three groups: standard libraries, external dependencies (alphabetically), then relative imports
Write code that explains itself through clear naming and types — do not write comments that merely restate what the code already says; use comments only for non-obvious reasons, hidden invariants, or workarounds
Files:
resolving/tarball-resolver/src/index.tsresolving/resolver-base/src/index.tspkg-manifest/utils/src/convertEnginesRuntimeToDependencies.tsresolving/local-resolver/src/index.tsengine/runtime/node-resolver/src/index.tsinstalling/client/src/index.tsengine/runtime/deno-resolver/src/index.tsresolving/git-resolver/src/index.tsengine/runtime/bun-resolver/src/index.tsdeps/inspection/outdated/src/outdatedDepsOfProjects.tsresolving/default-resolver/src/index.tsresolving/npm-resolver/src/index.tsdeps/inspection/outdated/src/outdated.tsdeps/inspection/outdated/test/outdated.spec.ts
🧠 Learnings (1)
📚 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:
resolving/tarball-resolver/src/index.tsresolving/resolver-base/src/index.tspkg-manifest/utils/src/convertEnginesRuntimeToDependencies.tsresolving/local-resolver/src/index.tsengine/runtime/node-resolver/src/index.tsinstalling/client/src/index.tsengine/runtime/deno-resolver/src/index.tsresolving/git-resolver/src/index.tsengine/runtime/bun-resolver/src/index.tsdeps/inspection/outdated/src/outdatedDepsOfProjects.tsresolving/default-resolver/src/index.tsresolving/npm-resolver/src/index.tsdeps/inspection/outdated/src/outdated.tsdeps/inspection/outdated/test/outdated.spec.ts
🔇 Additional comments (12)
pkg-manifest/utils/src/convertEnginesRuntimeToDependencies.ts (3)
8-9: LGTM!
10-11: LGTM!
12-14: LGTM!resolving/resolver-base/src/index.ts (1)
3-3: LGTM!Also applies to: 317-346
resolving/npm-resolver/src/index.ts (1)
13-14: LGTM!Also applies to: 19-19, 187-204, 269-281, 291-349
resolving/git-resolver/src/index.ts (1)
3-3: LGTM!Also applies to: 104-114
resolving/tarball-resolver/src/index.ts (1)
2-2: LGTM!Also applies to: 40-47
resolving/local-resolver/src/index.ts (1)
7-7: LGTM!Also applies to: 67-72
engine/runtime/bun-resolver/src/index.ts (1)
7-8: LGTM!Also applies to: 70-80
engine/runtime/deno-resolver/src/index.ts (1)
6-7: LGTM!Also applies to: 101-111
engine/runtime/node-resolver/src/index.ts (1)
6-7: LGTM!Also applies to: 84-96
installing/client/src/index.ts (1)
17-17: LGTM!Also applies to: 21-21, 25-25, 81-81
There was a problem hiding this comment.
Pull request overview
This PR updates pnpm’s “outdated”/interactive update flow to query “latest” versions via the resolver layer (instead of assuming npm-style specs), and extends reporting to runtime dependencies installed via the runtime: protocol (Node/Deno/Bun).
Changes:
- Introduces a resolver-base
resolveLatestprotocol (LatestQuery/LatestInfo) and wires aresolveLatestdispatcher through the default resolver and installing client. - Adds per-protocol
resolveLatest*implementations (npm/jsr/named-registry, git, tarball, local, node/deno/bun runtime resolvers). - Refactors
outdated()/outdatedDepsOfProjects()to useresolveLatest, and adds tests covering runtime dependencies in outdated output.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| resolving/resolver-base/src/index.ts | Adds LatestQuery, LatestInfo, and ResolveLatestFunction types for resolver-driven “latest” lookups. |
| resolving/npm-resolver/src/index.ts | Exposes resolveLatestFromNpm/Jsr/NamedRegistry built atop npm-resolver logic. |
| resolving/default-resolver/src/index.ts | Composes per-resolver resolveLatest* functions into a single dispatcher returned by createResolver(). |
| installing/client/src/index.ts | Re-exports resolveLatest types and returns resolveLatest from createResolver(). |
| engine/runtime/*-resolver/src/index.ts | Adds runtime-specific “latest” lookup for node/deno/bun runtime deps. |
| deps/inspection/outdated/src/outdated.ts | Makes outdated protocol-agnostic by calling resolveLatest and deriving display values from lockfile snapshots/refs. |
| deps/inspection/outdated/src/outdatedDepsOfProjects.ts | Switches from manifest-getter approach to creating a resolver and calling resolveLatest. |
| deps/inspection/outdated/test/outdated.spec.ts | Replaces getLatestManifest with a resolveLatest test dispatcher and adds runtime-focused tests. |
| resolving/git-resolver/src/index.ts | Adds resolveLatestFromGit() to claim git deps (no “latest” concept). |
| resolving/tarball-resolver/src/index.ts | Adds resolveLatestFromTarball() to claim URL tarball deps (no “latest” concept). |
| resolving/local-resolver/src/index.ts | Adds resolveLatestFromLocal() to skip local/link/workspace-style deps. |
| pkg-manifest/utils/src/convertEnginesRuntimeToDependencies.ts | Exports runtime name helpers (RUNTIME_NAMES, RuntimeName, isRuntimeAlias). |
| deps/inspection/outdated/package.json | Removes unused dependency on @pnpm/config.pick-registry-for-package. |
| deps/inspection/outdated/tsconfig.json | Removes stale project reference. |
| pnpm-lock.yaml | Drops the removed workspace dependency entry. |
| .changeset/outdated-runtimes.md | Changeset describing the feature and internal refactor. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- npm-resolver: pass the manifest's bareSpecifier (preserving \`jsr:\`, \`gh:\`, etc. prefixes) and use \`update: 'latest'\` only in non-compatible mode. The previous "use bare 'latest' as the spec" shortcut broke jsr and named-registry resolution because their parsers reject specs without the protocol prefix. - outdated.ts: \`displayVersion\` now also falls back to the dep-path's parsed version, fixing aliased deps where the snapshot doesn't record a version (\`positive: [email protected]\` now displays as \`3.1.0\` again instead of the full ref). - outdated.ts: \`displayVersion\` URL-detection broadened to \`git[+:]\` and \`github:\` schemes so git refs with non-\`https://\` prefixes still show the URL diff signal. - default-resolver: add the missing \`await\` on the last branch of the \`resolveLatest\` dispatch chain. - test dispatcher: also skip \`workspace:\` deps (matches what the real local-resolver does). - test file: collapse the duplicated comment block above \`makeResolveLatest\`. - changeset: drop stale \`wantedRef\` mention. Per coderabbitai and Copilot review on #11739.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
deps/inspection/outdated/test/outdated.spec.ts (1)
1005-1031: ⚡ Quick winAssert
compatiblepropagation in the compatible-mode runtime test.This test currently passes even if
outdated()stops forwardingcompatibleto the dispatcher, because the helper only checks package name. Add a direct assertion onquery.compatibleinresolveLatestfor this case.Proposed test-hardening diff
-test('outdated() runtime in --compatible mode resolves within the declared range', async () => { - const getLatestForCompat = async (packageName: string): Promise<PackageManifest | null> => { - expect(packageName).toBe('node') - return { name: 'node', version: '22.5.0' } - } +test('outdated() runtime in --compatible mode resolves within the declared range', async () => { const lockfile = { @@ const outdatedPkgs = await outdated({ compatible: true, currentLockfile: lockfile, - resolveLatest: makeResolveLatest(getLatestForCompat), + resolveLatest: async (query) => { + expect(query.compatible).toBe(true) + expect(query.wantedDependency.alias).toBe('node') + return { latestManifest: { name: 'node', version: '22.5.0' } } + }, lockfileDir: 'project',🤖 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/outdated/test/outdated.spec.ts` around lines 1005 - 1031, The test for outdated() in compatible-mode should assert that the compatible flag is forwarded to the resolver: update the resolveLatest helper (the function passed as resolveLatest via makeResolveLatest / getLatestForCompat) to inspect its incoming query argument and assert query.compatible === true (in addition to the package name check); specifically, inside the getLatestForCompat / resolveLatest callback used by the test, add an assertion like expect(query?.compatible).toBe(true) so the test fails if outdated() stops propagating the compatible flag.
🤖 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/outdated/test/outdated.spec.ts`:
- Around line 1005-1031: The test for outdated() in compatible-mode should
assert that the compatible flag is forwarded to the resolver: update the
resolveLatest helper (the function passed as resolveLatest via makeResolveLatest
/ getLatestForCompat) to inspect its incoming query argument and assert
query.compatible === true (in addition to the package name check); specifically,
inside the getLatestForCompat / resolveLatest callback used by the test, add an
assertion like expect(query?.compatible).toBe(true) so the test fails if
outdated() stops propagating the compatible flag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b8b76711-f320-4936-b1d0-8daef96f6825
📒 Files selected for processing (5)
.changeset/outdated-runtimes.mddeps/inspection/outdated/src/outdated.tsdeps/inspection/outdated/test/outdated.spec.tsresolving/default-resolver/src/index.tsresolving/npm-resolver/src/index.ts
✅ Files skipped from review due to trivial changes (1)
- .changeset/outdated-runtimes.md
🚧 Files skipped from review as they are similar to previous changes (3)
- resolving/default-resolver/src/index.ts
- resolving/npm-resolver/src/index.ts
- deps/inspection/outdated/src/outdated.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). (3)
- GitHub Check: Run benchmark on ubuntu-latest
- GitHub Check: Analyze (javascript)
- GitHub Check: Compile & Lint
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Follow Standard Style with trailing commas, prefer functions over classes, declare functions after they are used (rely on hoisting), and use a single options object for functions with more than two or three arguments
Sort imports in three groups: standard libraries, external dependencies (alphabetically), then relative imports
Write code that explains itself through clear naming and types — do not write comments that merely restate what the code already says; use comments only for non-obvious reasons, hidden invariants, or workarounds
Files:
deps/inspection/outdated/test/outdated.spec.ts
🧠 Learnings (1)
📚 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/outdated/test/outdated.spec.ts
🔇 Additional comments (1)
deps/inspection/outdated/test/outdated.spec.ts (1)
3-1004: LGTM!Also applies to: 1032-1089
Integrated-Benchmark Report (Linux)Scenario: Frozen Lockfile
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.3421299841400005,
"stddev": 0.59730368413449,
"median": 3.35632200224,
"user": 2.1461485399999995,
"system": 2.82735848,
"min": 2.59802190424,
"max": 4.74792383424,
"times": [
3.5409763562400003,
2.89132391424,
4.74792383424,
3.6208008402400003,
3.4513216572400003,
3.32397516924,
2.59802190424,
2.9793179372400003,
3.3886688352400003,
2.8789693932400002
]
},
{
"command": "pacquet@main",
"mean": 2.71530594634,
"stddev": 0.23558166195240454,
"median": 2.6426017242400004,
"user": 2.1229327400000004,
"system": 2.7916204799999997,
"min": 2.5736289122400002,
"max": 3.36964180824,
"times": [
2.7368165452400004,
2.61773449224,
2.66763582124,
2.5773024112400003,
2.5736289122400002,
2.65560824824,
2.6295952002400003,
2.70428178424,
2.62081424024,
3.36964180824
]
},
{
"command": "pnpm",
"mean": 4.77111692984,
"stddev": 0.2899264571083455,
"median": 4.70207965224,
"user": 6.212651639999999,
"system": 3.1596084799999997,
"min": 4.420717917239999,
"max": 5.38132456624,
"times": [
4.609994062239999,
4.45362716724,
4.62841889824,
5.38132456624,
4.92224173324,
4.420717917239999,
4.77574040624,
4.90240223724,
4.99728445224,
4.619417858239999
]
}
]
}Scenario: Frozen Lockfile (Hot Cache)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.08166356576,
"stddev": 0.12560843771972408,
"median": 1.08390210576,
"user": 0.30391806,
"system": 1.23160796,
"min": 0.90344659426,
"max": 1.25104320326,
"times": [
1.19183588826,
0.91104554226,
0.99011438426,
1.24809667026,
1.11348555826,
1.0397636052600001,
1.11072202926,
0.90344659426,
1.25104320326,
1.05708218226
]
},
{
"command": "pacquet@main",
"mean": 1.10852527856,
"stddev": 0.19430553353817565,
"median": 1.09610449676,
"user": 0.30570686,
"system": 1.2392033599999999,
"min": 0.89903090626,
"max": 1.4133287082600001,
"times": [
1.3824146962600001,
1.19734504026,
0.92755147526,
1.4133287082600001,
1.23301296826,
1.08204046526,
0.9103402712600001,
0.93001972626,
1.11016852826,
0.89903090626
]
},
{
"command": "pnpm",
"mean": 3.4337862371599996,
"stddev": 1.4633201914097145,
"median": 2.89673972676,
"user": 2.38283106,
"system": 1.6586745600000001,
"min": 2.30111839926,
"max": 6.50095461026,
"times": [
6.50095461026,
3.18910242326,
2.83597484926,
2.7150842542599998,
2.62100821626,
2.95750460426,
2.30111839926,
5.79539197626,
2.9731973262599998,
2.44852571226
]
}
]
} |
…heme-less git refs
Three review findings from the previous round:
1. **Peer-suffix-only changes were reported as outdated.** The
ref-mismatch check used \`wantedRef !== currentRef\`, so an npm dep
whose \`(peer-hash)\` shifted but whose semver didn't would surface
as a fake update. Now we compare the parsed \`wanted\` / \`current\`
display values instead — for npm-style refs that means the
peer-graph noise gets filtered out, and for URL/git refs (where
\`displayVersion\` returns the raw ref) commit changes still fire.
2. **Local deps could fall through to named-registry resolution.**
\`resolveLatestFromLocal\` was returning \`undefined\` for everything,
which let the dispatcher continue past it. A user-configured
named-registry alias called \`link\`, \`file\`, or \`workspace\` could
then claim those deps. Now the local-resolver explicitly returns
\`{}\` for \`link:\` / \`file:\` / \`workspace:\` specifiers so the
dispatcher stops there.
3. **Scheme-less git refs (\`github.com/user/repo/sha\`) were
displayed as the snapshot's package version**, hiding the actual
commit diff. \`displayVersion\` previously matched URL refs via a
prefix regex (\`https?:\`, \`git[+:]\`, \`github:\`) that missed the
scheme-less form still used in the existing \`using a matcher\`
test. Replaced the prefix check with a \`dp.parse\` lookup: if the
dep-path's \`nonSemverVersion\` contains a \`/\`, it's a URL/path
shape and we keep the raw ref; otherwise we prefer the snapshot's
version.
Reported by coderabbitai / reviewer on #11739.
\`resolveLatestBunRuntime\` and \`resolveLatestDenoRuntime\` delegate to
\`resolveFromNpm\` for version lookup, but were calling it with an empty
options object — silently dropping \`publishedBy\` / \`publishedByExclude\`
so a Bun/Deno version blocked by \`minimumReleaseAge\` or time-based
resolution would still surface as the "latest" runtime version.
Take \`ResolveOptions\` as a third argument and pass it through, plus
the same \`update: 'latest'\` flag the npm \`resolveLatest\` uses in
non-compatible mode. Also handle \`MINIMUM_RELEASE_AGE_VIOLATION\` and
\`ERR_PNPM_NO_MATCHING_VERSION\` the same way the npm helper does —
return \`{}\` (claimed, no latest available) instead of leaking the
policy-blocked version.
\`resolveLatestNodeRuntime\` queries nodejs.org directly, not npm, so it
has no policy to enforce — but accept \`ResolveOptions\` in its
signature for symmetry, marked unused.
The dispatcher in \`default-resolver\` now forwards \`opts\` to all three
runtime resolvers.
Reported by Copilot review on #11739.
Summary
pnpm outdatedandpnpm update --interactivepreviously skipped runtime dependencies (node/deno/buninstalled via theruntime:protocol). Both commands go throughoutdatedDepsOfProjects→outdated(), and the inner loop bailed out for anythingparseBareSpecifiercouldn't parse — which is everythingruntime:-shaped. A runtime was only ever reported if the current install differed from the wanted lockfile entry, so the latest available version was never surfaced. The same gap silently affectedjsr:and named-registry deps too.Commits, smallest fix first → progressively cleaner architecture:
feat(outdated)— minimal fix: special-case runtime deps inoutdated.tsso they appear in the table and the interactive update picker.refactor(outdated)— per-resolver dispatch. Each protocol resolver gets its own "what's the latest?" function;@pnpm/resolving.default-resolvercomposes them.refactor(outdated)— rename toresolveLatest(the function returns info regardless of whether the dep is outdated; "outdated" described a state, not an action).refactor(outdated)— let the local-resolver own thelink:/file:skip, drop the matching short-circuit inoutdated.ts.refactor(outdated)— slimLatestQuery/LatestInfoto the bare essentials; movepickRegistryForPackageinto the npm-resolver where it belongs; derivecurrent/wanteddisplay frompkgSnapshot.versioninoutdated.ts.chore(outdated)— drop stale tsconfig project reference left behind by support inherited dependencies ("peerDependencies") #5.refactor(outdated)— dropwantedReffrom the query; resolvers detect protocol frombareSpecifieralone.Final architecture
@pnpm/resolving.resolver-basedefines a single tiny protocol:undefinedfrom a resolver means "I don't claim this dep — try the next one."{}means "I claim it, but I can't tell you what's latest" (policy-blocked, network unavailable, or a protocol with no concept of latest — git/tarball).{ latestManifest }is the happy path.Each protocol resolver (npm/jsr/named-registry, git, tarball, local, node/bun/deno runtimes) exports its own
resolveLatest*function alongside itsresolve*.@pnpm/resolving.default-resolvercomposes them into a single first-match dispatcher, surfaced through@pnpm/installing.clientascreateResolver(...).resolveLatest.outdated.tsis protocol-agnostic: dispatches, then derivescurrent/wanteddisplay frompkgSnapshot.version(falling back to the raw ref for URL-shaped refs where the URL is the only diff signal between commits), uses rawwantedRef !== currentReffor the lockfile-shifted check, and pullspackageNamefromdp.parse(relativeDepPath).nameso aliased deps still report under the real package name.Per-resolver responsibilities:
resolveLatestFromNpm/resolveLatestFromJsr/resolveLatestFromNamedRegistry): match their respective spec shapes, call the matchingresolveFromXwith'latest'(or the original spec under--compatible), handleMINIMUM_RELEASE_AGE_VIOLATIONandERR_PNPM_NO_MATCHING_VERSIONso policy-blocked deps don't surface as available updates. Picks the per-package registry internally via its ctx.bareSpecifier.startsWith('runtime:')+ alias match, query their release sources for the latest version (only the version — no asset-hash fetches), return{ latestManifest }.{}(no concept of "latest"); the caller still surfaces a ref-mismatch report if the lockfile shifted to a different commit/URL.undefinedsolink:/file:/workspace:deps fall through and get silently skipped.Test plan
pnpm --filter @pnpm/deps.inspection.outdated test(CI; local jest run is blocked by a pre-existingmodule is already linkedfailure under VM Modules)pnpm --filter @pnpm/resolving.npm-resolver testpnpm --filter @pnpm/engine.runtime.node-resolver testengines.runtime+onFail: downloadfor node/deno/bun installed; runpnpm outdatedandpnpm update --interactiveand verify all three runtimes appear with the latest version pulled from their respective release sources.jsr:orgh:dep — verify it's now considered bypnpm outdated(previously silently skipped).github:owner/repo#commitdep — bump the commit, verifypnpm outdatedshows the URL change.Written by an agent (Claude Code, claude-opus-4-7).
Summary by CodeRabbit
New Features
pnpm outdatedandpnpm update --interactive; runtime versions are shown and can be updated.Refactor / Improvements
Tests