Skip to content

feat(outdated): include node, deno, and bun runtimes - #11739

Merged
zkochan merged 11 commits into
mainfrom
node-outdated
May 19, 2026
Merged

zkochan merged 11 commits into
mainfrom
node-outdated

Conversation

@zkochan

@zkochan zkochan commented May 19, 2026 •

Copy link
Copy Markdown
Member

Summary

pnpm outdated and pnpm update --interactive previously skipped runtime dependencies (node/deno/bun installed via the runtime: protocol). Both commands go through outdatedDepsOfProjects → outdated(), and the inner loop bailed out for anything parseBareSpecifier couldn't parse — which is everything runtime:-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 affected jsr: and named-registry deps too.

Commits, smallest fix first → progressively cleaner architecture:

  1. feat(outdated) — minimal fix: special-case runtime deps in outdated.ts so they appear in the table and the interactive update picker.
  2. refactor(outdated) — per-resolver dispatch. Each protocol resolver gets its own "what's the latest?" function; @pnpm/resolving.default-resolver composes them.
  3. refactor(outdated) — rename to resolveLatest (the function returns info regardless of whether the dep is outdated; "outdated" described a state, not an action).
  4. refactor(outdated) — let the local-resolver own the link:/file: skip, drop the matching short-circuit in outdated.ts.
  5. refactor(outdated) — slim LatestQuery / LatestInfo to the bare essentials; move pickRegistryForPackage into the npm-resolver where it belongs; derive current/wanted display from pkgSnapshot.version in outdated.ts.
  6. chore(outdated) — drop stale tsconfig project reference left behind by support inherited dependencies ("peerDependencies") #5.
  7. refactor(outdated) — drop wantedRef from the query; resolvers detect protocol from bareSpecifier alone.

Final architecture

@pnpm/resolving.resolver-base defines a single tiny protocol:

interface LatestQuery {
  wantedDependency: WantedDependency
  compatible?: boolean
}

interface LatestInfo {
  latestManifest?: PackageManifest
}

type ResolveLatestFunction = (query: LatestQuery, opts: ResolveOptions) =>
  Promise<LatestInfo | undefined>
  • undefined from 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 its resolve*. @pnpm/resolving.default-resolver composes them into a single first-match dispatcher, surfaced through @pnpm/installing.client as createResolver(...).resolveLatest.

outdated.ts is protocol-agnostic: dispatches, then derives current/wanted display from pkgSnapshot.version (falling back to the raw ref for URL-shaped refs where the URL is the only diff signal between commits), uses raw wantedRef !== currentRef for the lockfile-shifted check, and pulls packageName from dp.parse(relativeDepPath).name so aliased deps still report under the real package name.

Per-resolver responsibilities:

  • npm-resolver (resolveLatestFromNpm / resolveLatestFromJsr / resolveLatestFromNamedRegistry): match their respective spec shapes, call the matching resolveFromX with 'latest' (or the original spec under --compatible), handle MINIMUM_RELEASE_AGE_VIOLATION and ERR_PNPM_NO_MATCHING_VERSION so policy-blocked deps don't surface as available updates. Picks the per-package registry internally via its ctx.
  • node/bun/deno runtime resolvers: claim deps via bareSpecifier.startsWith('runtime:') + alias match, query their release sources for the latest version (only the version — no asset-hash fetches), return { latestManifest }.
  • git / tarball resolvers: claim deps via spec shape, return {} (no concept of "latest"); the caller still surfaces a ref-mismatch report if the lockfile shifted to a different commit/URL.
  • local-resolver: returns undefined so link:/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-existing module is already linked failure under VM Modules)
  • pnpm --filter @pnpm/resolving.npm-resolver test
  • pnpm --filter @pnpm/engine.runtime.node-resolver test
  • Manual: project with engines.runtime + onFail: download for node/deno/bun installed; run pnpm outdated and pnpm update --interactive and verify all three runtimes appear with the latest version pulled from their respective release sources.
  • Manual: project with a jsr: or gh: dep — verify it's now considered by pnpm outdated (previously silently skipped).
  • Manual: project with a github:owner/repo#commit dep — bump the commit, verify pnpm outdated shows the URL change.

Written by an agent (Claude Code, claude-opus-4-7).

Summary by CodeRabbit

  • New Features

    • Node.js, Deno, and Bun runtimes are now included in pnpm outdated and pnpm update --interactive; runtime versions are shown and can be updated.
  • Refactor / Improvements

    • Outdated detection is more accurate and lockfile-aware, with improved “latest” computation and deprecation handling.
    • Local/link/file/workspace dependencies remain excluded from outdated reports.
  • Tests

    • Added/updated tests covering runtime outdated behavior and compatibility scenarios.

Review Change Stack

`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.
@coderabbitai

coderabbitai Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

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: e7f5fd3e-4cf1-4afd-916f-7cf579478e00

📥 Commits

Reviewing files that changed from the base of the PR and between 35880ae and 900cdd0.

📒 Files selected for processing (4)
  • engine/runtime/bun-resolver/src/index.ts
  • engine/runtime/deno-resolver/src/index.ts
  • engine/runtime/node-resolver/src/index.ts
  • resolving/default-resolver/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • engine/runtime/deno-resolver/src/index.ts
  • engine/runtime/node-resolver/src/index.ts
  • resolving/default-resolver/src/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: Run benchmark on ubuntu-latest
  • 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:

  • engine/runtime/bun-resolver/src/index.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:

  • engine/runtime/bun-resolver/src/index.ts
🔇 Additional comments (1)
engine/runtime/bun-resolver/src/index.ts (1)

4-8: LGTM!

Also applies to: 70-92


📝 Walkthrough

Walkthrough

Refactors 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.

Changes

Outdated command with resolver-driven latest resolution

Layer / File(s) Summary
Latest-resolution type contract
resolving/resolver-base/src/index.ts
Adds LatestQuery, LatestInfo, and ResolveLatestFunction types forming the resolver "latest" contract.
Protocol and runtime latest-resolution implementations
resolving/npm-resolver/src/index.ts, resolving/git-resolver/src/index.ts, resolving/tarball-resolver/src/index.ts, resolving/local-resolver/src/index.ts, engine/runtime/*-resolver/src/index.ts
Implements resolveLatest* functions for npm-style, git, tarball, local, and runtime (node/deno/bun) protocols and spec-matching predicates.
Default resolver latest dispatcher
resolving/default-resolver/src/index.ts
Wires protocol-specific resolveLatest hooks into a ResolveLatestDispatcher that queries resolvers in precedence order and returns the first non-undefined LatestInfo.
Client API public exports
installing/client/src/index.ts
Re-exports LatestInfo, LatestQuery, ResolveLatestDispatcher and extends createResolver to return resolveLatest.
Outdated command and project-level wiring
deps/inspection/outdated/src/outdated.ts, deps/inspection/outdated/src/outdatedDepsOfProjects.ts
Refactors outdated and outdatedDepsOfProjects to call resolveLatest, pass publishedBy/publishedByExclude, compute wanted/current from lockfile snapshots, and use resolver-driven latest semantics and comparison helpers.
Tests updated for resolveLatest and runtime coverage
deps/inspection/outdated/test/outdated.spec.ts
Replace getLatestManifest mocks with a ResolveLatestDispatcher helper, remove registries from calls, and add tests covering node/deno/bun runtime outdated behavior and compatible mode.
Runtime alias utilities and manifest changes
pkg-manifest/utils/src/convertEnginesRuntimeToDependencies.ts, deps/inspection/outdated/package.json, deps/inspection/outdated/tsconfig.json
Export runtime name constants and isRuntimeAlias() helper; remove @pnpm/config.pick-registry-for-package from package.json and tsconfig references.
Changeset and release notes
.changeset/outdated-runtimes.md
Records minor bumps and documents that pnpm outdated/pnpm update --interactive now include Node/Deno/Bun runtimes and use resolver-driven latest computation.

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
Loading

Estimated code review effort
🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • pnpm/pnpm#11664: Shares publishedBy/minimumReleaseAge policy wiring into resolver-driven selection flows.

Suggested labels
area: supply chain security

"A rabbit hops through the code so spry,
Dispatching 'latest' beneath the sky.
Node, Deno, Bun join the fête,
Tests and types align just great.
Hooray — small hops, big tidy sigh!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.44% 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 summarizes the main feature: adding runtime dependency (node, deno, bun) support to the outdated command.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch node-outdated

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.

zkochan added 6 commits May 19, 2026 14:12
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.
@zkochan
zkochan marked this pull request as ready for review May 19, 2026 13:29
Copilot AI review requested due to automatic review settings May 19, 2026 13:29
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\`.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
deps/inspection/outdated/test/outdated.spec.ts (1)

20-22: ⚡ Quick win

Skip workspace: in the mock dispatcher too.

The production flow now lets the local resolver claim link:, file:, and workspace: specs, but this helper still routes workspace: through getLatest(). 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

📥 Commits

Reviewing files that changed from the base of the PR and between f77244f and 45ab27f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • .changeset/outdated-runtimes.md
  • deps/inspection/outdated/package.json
  • deps/inspection/outdated/src/outdated.ts
  • deps/inspection/outdated/src/outdatedDepsOfProjects.ts
  • deps/inspection/outdated/test/outdated.spec.ts
  • deps/inspection/outdated/tsconfig.json
  • engine/runtime/bun-resolver/src/index.ts
  • engine/runtime/deno-resolver/src/index.ts
  • engine/runtime/node-resolver/src/index.ts
  • installing/client/src/index.ts
  • pkg-manifest/utils/src/convertEnginesRuntimeToDependencies.ts
  • resolving/default-resolver/src/index.ts
  • resolving/git-resolver/src/index.ts
  • resolving/local-resolver/src/index.ts
  • resolving/npm-resolver/src/index.ts
  • resolving/resolver-base/src/index.ts
  • resolving/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.ts
  • resolving/resolver-base/src/index.ts
  • pkg-manifest/utils/src/convertEnginesRuntimeToDependencies.ts
  • resolving/local-resolver/src/index.ts
  • engine/runtime/node-resolver/src/index.ts
  • installing/client/src/index.ts
  • engine/runtime/deno-resolver/src/index.ts
  • resolving/git-resolver/src/index.ts
  • engine/runtime/bun-resolver/src/index.ts
  • deps/inspection/outdated/src/outdatedDepsOfProjects.ts
  • resolving/default-resolver/src/index.ts
  • resolving/npm-resolver/src/index.ts
  • deps/inspection/outdated/src/outdated.ts
  • 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:

  • resolving/tarball-resolver/src/index.ts
  • resolving/resolver-base/src/index.ts
  • pkg-manifest/utils/src/convertEnginesRuntimeToDependencies.ts
  • resolving/local-resolver/src/index.ts
  • engine/runtime/node-resolver/src/index.ts
  • installing/client/src/index.ts
  • engine/runtime/deno-resolver/src/index.ts
  • resolving/git-resolver/src/index.ts
  • engine/runtime/bun-resolver/src/index.ts
  • deps/inspection/outdated/src/outdatedDepsOfProjects.ts
  • resolving/default-resolver/src/index.ts
  • resolving/npm-resolver/src/index.ts
  • deps/inspection/outdated/src/outdated.ts
  • deps/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

Comment thread .changeset/outdated-runtimes.md Resolved
Comment thread resolving/default-resolver/src/index.ts Resolved

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

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 resolveLatest protocol (LatestQuery/LatestInfo) and wires a resolveLatest dispatcher 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 use resolveLatest, 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.

Comment thread resolving/npm-resolver/src/index.ts Resolved
Comment thread .changeset/outdated-runtimes.md Resolved
- 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.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
deps/inspection/outdated/test/outdated.spec.ts (1)

1005-1031: ⚡ Quick win

Assert compatible propagation in the compatible-mode runtime test.

This test currently passes even if outdated() stops forwarding compatible to the dispatcher, because the helper only checks package name. Add a direct assertion on query.compatible in resolveLatest for 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

📥 Commits

Reviewing files that changed from the base of the PR and between b341625 and 161f158.

📒 Files selected for processing (5)
  • .changeset/outdated-runtimes.md
  • deps/inspection/outdated/src/outdated.ts
  • deps/inspection/outdated/test/outdated.spec.ts
  • resolving/default-resolver/src/index.ts
  • resolving/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

@github-actions

github-actions Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Scenario: Frozen Lockfile

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.342 ± 0.597 2.598 4.748 1.23 ± 0.24
pacquet@main 2.715 ± 0.236 2.574 3.370 1.00
pnpm 4.771 ± 0.290 4.421 5.381 1.76 ± 0.19
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)

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.082 ± 0.126 0.903 1.251 1.00
pacquet@main 1.109 ± 0.194 0.899 1.413 1.02 ± 0.22
pnpm 3.434 ± 1.463 2.301 6.501 3.17 ± 1.40
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.
Copilot AI review requested due to automatic review settings May 19, 2026 16:21

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 17 out of 18 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

\`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.
@coderabbitai coderabbitai Bot added the area: supply chain security Issues related to minimumReleaseAge, blockExoticSubdeps, build script safety, and trust policies. label May 19, 2026
@zkochan
zkochan merged commit 1627943 into main May 19, 2026
15 checks passed
@zkochan
zkochan deleted the node-outdated branch May 19, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli/dlx area: lockfile area: supply chain security Issues related to minimumReleaseAge, blockExoticSubdeps, build script safety, and trust policies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants