Skip to content

fix(resolving-npm-resolver): rewrite jsr: specifiers on update --latest - #13394

Merged
zkochan merged 2 commits into
mainfrom
fix-13363
Jul 26, 2026
Merged

zkochan merged 2 commits into
mainfrom
fix-13363

Conversation

@zkochan

@zkochan zkochan commented Jul 26, 2026 •

Copy link
Copy Markdown
Member

Summary

pnpm update --latest left jsr: dependencies at their old version in pacquet: jsr:1.0.0 stayed put where the TypeScript CLI rewrites it to jsr:2.0.0.

update --latest writes back whatever the resolver reports as the dependency's normalized bare specifier, and writes nothing when the resolver reports none — deliberately, so specifiers no resolver claims are left alone. pacquet's JSR path never reported one, so every jsr: dependency landed in that "unclaimed" case.

Reporting the npm-shaped range calc_specifier builds would have been wrong — it would rewrite the entry into a plain registry dependency. This adds calc_prefixed_specifier, mirroring the TypeScript resolver's calcPrefixedSpecifier, and renders the picked version back under the protocol: jsr:<range> when the dependency installs under the package's own name, jsr:<pkg name>@<range> when it is aliased, keeping the range operator the entry already declared.

The ported update_latest_bumps_a_jsr_dependency test loses its allow_known_failure! gate and moves out of known_failures. update_latest_bumps_an_aliased_jsr_dependency keeps only its importer gate (#13362), so its manifest assertion now runs for real.

No TypeScript-side change: resolveJsr in resolving/npm-resolver/src/index.ts already calls calcPrefixedSpecifier. This PR brings pacquet up to it.

Follow-up: the named-registry resolver has the identical gap — <alias>: dependencies are also never rewritten. It needs the same wiring plus its own test; filed as #13393 and marked with a TODO at the site.

Closes #13363

Squash Commit Body

`update --latest` writes back whatever the resolver reports as the
dependency's normalized bare specifier, and writes nothing when the
resolver reports none — so specifiers no resolver claims are left alone.
The JSR path never reported one, so a `jsr:` dependency always landed in
that "unclaimed" case and kept its old version.

Reporting the npm-shaped range `calc_specifier` builds would have been
wrong: it would rewrite the entry into a registry dependency. Render the
picked version back under the protocol instead, through a new
`calc_prefixed_specifier` mirroring the TypeScript resolver's
`calcPrefixedSpecifier` — `jsr:<range>` when the dependency installs
under the package's own name, `jsr:<pkg name>@<range>` when it is
aliased, keeping the range operator the entry already declared.

`BuildResolveResult` now carries the rendered specifier rather than the
inputs to render it, since which shape to render is the calling
resolver's knowledge, not `build_resolve_result`'s.

The named-registry resolver has the same gap and is tracked separately
in pnpm/pnpm#13393.

TypeScript-side: no change needed, `resolveJsr` already calls
`calcPrefixedSpecifier`.

Closes pnpm/pnpm#13363

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes / Behavior Change
    • pnpm update --latest now properly bumps unaliased jsr: dependencies to the latest available versions while preserving the original jsr: protocol form and range operator.
    • Lockfiles now record the resolved JSR package versions consistently.
  • Documentation
    • Updated release-note and test-porting guidance to match the corrected jsr: --latest behavior.
  • Tests
    • Added/updated CLI and resolver unit tests to verify jsr: specifier formatting and --latest bumping outcomes.

Copilot AI review requested due to automatic review settings July 26, 2026 00:46

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@zkochan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d9875313-e8b4-4034-80c1-c152fd7bbebb

📥 Commits

Reviewing files that changed from the base of the PR and between b15417e and c4d836b.

📒 Files selected for processing (8)
  • .changeset/update-latest-rewrites-jsr-specifiers.md
  • pnpm/crates/cli/tests/update_jsr.rs
  • pnpm/crates/resolving-npm-resolver/src/calc_specifier.rs
  • pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs
  • pnpm/crates/resolving-npm-resolver/src/lib.rs
  • pnpm/crates/resolving-npm-resolver/src/named_registry_resolver.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs
  • pnpm/plans/TEST_PORTING.md
📝 Walkthrough

Walkthrough

Changes

JSR specifier rewriting

Layer / File(s) Summary
Prefixed specifier calculation
pnpm/crates/resolving-npm-resolver/src/calc_specifier.rs, pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs, pnpm/crates/resolving-npm-resolver/src/lib.rs
Adds and exports calc_prefixed_specifier, with tests for range operators, aliases, and unaliased JSR dependencies.
Resolver result plumbing
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs, pnpm/crates/resolving-npm-resolver/src/named_registry_resolver.rs
Resolvers now pass precomputed manifest-ready specifiers through BuildResolveResult; JSR results retain the jsr: prefix.
Update coverage and release documentation
pnpm/crates/cli/tests/update_jsr.rs, pnpm/plans/TEST_PORTING.md, .changeset/update-latest-rewrites-jsr-specifiers.md
Integration coverage verifies unaliased JSR updates to latest versions, and related known-failure, porting, and release-note entries are updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UpdateLatest
  participant resolve_jsr_impl
  participant build_resolve_result
  participant ManifestLockfile
  User->>UpdateLatest: update jsr dependency
  UpdateLatest->>resolve_jsr_impl: resolve latest package
  resolve_jsr_impl->>build_resolve_result: pass calculated jsr specifier
  build_resolve_result->>ManifestLockfile: write updated manifest and resolution
  ManifestLockfile-->>User: return updated jsr version and package
Loading

Possibly related issues

  • pnpm/pnpm#13363 — Directly tracks JSR specifier rewriting for update --latest.
  • pnpm/pnpm#13393 — Covers related resolver plumbing for calculated specifiers.

Possibly related PRs

  • pnpm/pnpm#13250 — Changes the resolver-driven update --latest specifier calculation path.
  • pnpm/pnpm#13366 — Overlaps with JSR update integration tests and known-failure changes.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-13363

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix update --latest to rewrite jsr: specifiers while preserving protocol

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Make pnpm update --latest rewrite jsr: dependency versions in package.json.
• Preserve the original protocol and range operator when rendering updated specifiers.
• Add/enable JSR update tests and document the behavior change via changeset.
Diagram

graph TD
  A["pnpm update --latest"] --> B["NpmResolver (JSR)"] --> C["build_resolve_result"] --> D["ResolveResult specifier"] --> E["Manifest writer"] --> F["package.json"]
  B --> G["calc_prefixed_specifier"] --> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Normalize `jsr:` specifier in the JSR parser
  • ➕ Keeps all normalization decisions near parsing logic
  • ➕ May simplify resolver call sites by always populating normalized_bare_specifier
  • ➖ Parser would need protocol-aware rendering rules anyway (alias vs non-alias)
  • ➖ Harder to keep behavior aligned with TypeScript resolver without duplication at parse time
2. Make `build_resolve_result` render specifiers via a strategy enum
  • ➕ Centralizes specifier rendering in one place
  • ➕ Could reduce duplicated mapping logic across resolvers
  • ➖ Pushes protocol-specific knowledge into a shared utility
  • ➖ Requires a more complex API (enum + inputs) and risks future coupling

Recommendation: Keep the PR’s approach: compute the protocol-correct, manifest-ready specifier in the calling resolver (JSR path) and pass it into build_resolve_result. This preserves separation of concerns: only the resolver knows how its protocol round-trips, while build_resolve_result simply wires the chosen representation into ResolveResult.

Files changed (8) +154 / -67

Bug fix (2) +65 / -23
calc_specifier.rsAdd calc_prefixed_specifier for non-npm protocol round-tripping +29/-0

Add calc_prefixed_specifier for non-npm protocol round-tripping

• Introduces 'calc_prefixed_specifier' to render a picked version back under a protocol prefix (e.g. 'jsr:'), preserving the declared range operator and handling alias vs non-alias forms. Mirrors the TypeScript resolver’s 'calcPrefixedSpecifier' behavior.

pnpm/crates/resolving-npm-resolver/src/calc_specifier.rs

npm_resolver.rsPlumb manifest-ready specifier through resolve results for npm and jsr +36/-23

Plumb manifest-ready specifier through resolve results for npm and jsr

• Changes resolver call sites to compute a manifest-ready specifier eagerly and pass it as 'calculated_specifier'. For 'jsr:' resolution, uses 'calc_prefixed_specifier' so 'update --latest' can rewrite 'jsr:' dependencies without converting them into plain registry ranges.

pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs

Refactor (2) +7 / -7
lib.rsExport calc_prefixed_specifier from resolving-npm-resolver crate +1/-1

Export calc_prefixed_specifier from resolving-npm-resolver crate

• Updates public exports so downstream modules can use 'calc_prefixed_specifier' alongside 'calc_specifier'.

pnpm/crates/resolving-npm-resolver/src/lib.rs

named_registry_resolver.rsRename resolve-result field usage and add TODO for named-registry rewrite +6/-6

Rename resolve-result field usage and add TODO for named-registry rewrite

• Adapts to the new 'calculated_specifier' field naming and documents the analogous named-registry alias rewrite gap as a tracked TODO (pnpm/pnpm#13393).

pnpm/crates/resolving-npm-resolver/src/named_registry_resolver.rs

Tests (2) +75 / -35
update_jsr.rsEnable JSR update-latest manifest rewrite test and adjust known failures +22/-34

Enable JSR update-latest manifest rewrite test and adjust known failures

• Promotes 'update_latest_bumps_a_jsr_dependency' from known-failure to a real test, asserting both manifest and lockfile updates for a plain 'jsr:' dependency. Keeps the aliased JSR test partially gated only for the remaining importer/lockfile gap (pnpm/pnpm#13362).

pnpm/crates/cli/tests/update_jsr.rs

tests.rsAdd unit tests for prefixed specifier rendering behavior +53/-1

Add unit tests for prefixed specifier rendering behavior

• Extends specifier tests to cover 'calc_prefixed_specifier' for 'jsr:' protocol, ensuring range operator preservation, correct handling of aliased specifiers, and default pinning when no operator is present.

pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs

Documentation (2) +7 / -2
update-latest-rewrites-jsr-specifiers.mdAdd changeset documenting JSR specifier rewrite on update --latest +5/-0

Add changeset documenting JSR specifier rewrite on update --latest

• Adds a patch changeset for pacquet describing that 'pnpm update --latest' now rewrites 'jsr:' dependencies while preserving protocol and the declared range operator.

.changeset/update-latest-rewrites-jsr-specifiers.md

TEST_PORTING.mdUpdate test porting notes for JSR update coverage +2/-2

Update test porting notes for JSR update coverage

• Updates the porting plan to reflect that the 'jsr without alias' update-latest case is now fully ported as a real test, while the aliased case remains gated on the importer gap.

pnpm/plans/TEST_PORTING.md

@greptile-apps

greptile-apps Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains within the scope of the prior review feedback.

Reviews (3): Last reviewed commit: "refactor(resolving-npm-resolver): skip s..." | Re-trigger Greptile

@qodo-code-review

qodo-code-review Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Remediation recommended

1. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet even though the changeset text describes a
user-visible pnpm update --latest behavior change. This violates the requirement that changesets
explicitly include the pnpm package with a valid bump type.
Code

.changeset/update-latest-rewrites-jsr-specifiers.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐⭐⭐ High

Very close precedent: changeset describing pnpm behavior was updated to include a pnpm bump entry.

PR-#13337

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each changeset to include an explicit pnpm entry with a valid
bump type. The added changeset front-matter lists only pacquet, while the body text explicitly
claims a pnpm update --latest behavior change, indicating pnpm should be declared in the
changeset.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/update-latest-rewrites-jsr-specifiers.md[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 changeset front-matter declares only `"pacquet": patch` but the changeset body describes a `pnpm update --latest` user-visible behavior change. Per compliance, changesets must explicitly include the `pnpm` package with a valid bump type (`patch`/`minor`/`major`).

## Issue Context
This PR adds `.changeset/update-latest-rewrites-jsr-specifiers.md` and it currently omits `pnpm` from the front-matter.

## Fix Focus Areas
- .changeset/update-latest-rewrites-jsr-specifiers.md[1-5]

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


2. Eager specifier allocation ✓ Resolved 🐞 Bug ➹ Performance
Description
NpmResolver::resolve_impl (and the JSR branch) now always builds calculated_specifier when
opts.calc_specifier is set, even for dependency forms that already provide
spec.normalized_bare_specifier (e.g. tarball URLs). build_resolve_result will then prefer the
existing normalized specifier and drop the newly-allocated string, adding avoidable work on
update/add paths.
Code

pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs[R283-292]

+            calculated_specifier: calc_specifier_from(wanted_dependency, opts).map(
+                |(bare_specifier, default_pin)| {
+                    crate::calc_specifier(
+                        bare_specifier,
+                        wanted_dependency.alias.as_deref(),
+                        &picked.version,
+                        default_pin,
+                    )
+                },
+            ),
Relevance

⭐⭐ Medium

Micro-optimization; no clear matching accept/reject precedent for avoiding eager specifier
allocation in resolver.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
parse_bare_specifier explicitly sets normalized_bare_specifier=Some(...) for tarball URL
dependencies, meaning build_resolve_result will not need any calculated specifier. However, the
resolver now always computes calculated_specifier when opts.calc_specifier is set, and
build_resolve_result then uses .or(calculated_specifier), so the computed String is dropped
whenever the normalized specifier is present.

pnpm/crates/resolving-npm-resolver/src/parse_bare_specifier.rs[84-93]
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs[273-293]
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs[841-850]

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

### Issue description
`calculated_specifier` is computed eagerly in the resolver call sites. For dependency spec shapes where `spec.normalized_bare_specifier` is already `Some(...)` (notably tarball URL parses), `build_resolve_result` will keep the existing normalized specifier and discard `calculated_specifier`, wasting string allocations and some parsing work.

### Issue Context
This only happens when `ResolveOptions::calc_specifier` is enabled (manifest-writing paths like update/add), and only matters when the parsed `RegistryPackageSpec` already carries `normalized_bare_specifier`.

### Fix Focus Areas
- pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs[273-293]
- pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs[331-356]

### Suggested fix
At each `build_resolve_result(BuildResolveResult { ... })` call site, gate the `calc_*specifier*` computation on `spec.normalized_bare_specifier.is_none()` (for the npm path use `spec`, for the JSR path use `jsr_spec.spec`). For example:

```rust
let calculated_specifier = (opts.calc_specifier && spec.normalized_bare_specifier.is_none())
 .then(|| calc_specifier_from(wanted_dependency, opts))
 .flatten()
 .map(|(bare_specifier, default_pin)| { /* calc_* */ });
```

This preserves current behavior while avoiding needless allocations when a normalized specifier is already available.

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


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     10.9±0.31ms    34.4 MB/sec    1.05     11.4±0.05ms    32.8 MB/sec
packument/parse                1.00     38.1±0.25µs  1742.3 MB/sec    1.08     41.3±0.18µs  1606.5 MB/sec
tarball/download_dependency    1.01      2.3±0.07ms  1918.9 KB/sec    1.00      2.2±0.06ms  1935.3 KB/sec

@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 (2)
pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs (1)

115-116: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep test documentation limited to non-obvious rationale. These comments partly restate assertions or porting history; retain only the protocol-binding and known-failure-gate invariants.

  • pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs#L115-L116: remove the description of the unaliased output shape.
  • pnpm/crates/cli/tests/update_jsr.rs#L84-L86: replace the test-behavior summary with the registry-binding invariant, if documentation is needed.
  • pnpm/crates/cli/tests/update_jsr.rs#L141-L144: retain the explanation of the gate placement, but remove the assertion summary.

As per coding guidelines, Rust comments should explain non-obvious invariants or contracts rather than narrate test behavior.

🤖 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 `@pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs` around lines
115 - 116, Trim the comments at
pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs:115-116 by
removing the unaliased output-shape description. At
pnpm/crates/cli/tests/update_jsr.rs:84-86, replace the test-behavior summary
with only the registry-binding invariant if documentation is needed. At
pnpm/crates/cli/tests/update_jsr.rs:141-144, preserve the non-obvious
gate-placement rationale while removing the assertion summary; do not alter test
behavior.

Source: Coding guidelines

pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs (1)

283-292: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Keep calculated-specifier rendering lazy. build_resolve_result prefers spec.normalized_bare_specifier, but both call sites now allocate and serialize calculated_specifier before that choice. The previous or_else path avoided this work whenever parsing had already normalized the specifier.

  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs#L283-L292: only call calc_specifier when spec.normalized_bare_specifier is absent.
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs#L344-L355: only call calc_prefixed_specifier when jsr_spec.spec.normalized_bare_specifier is absent.

As per path instructions, resolver paths are hot and should avoid extra common-path work.

🤖 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 `@pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs` around lines 283 -
292, The calculated specifier must remain lazy: in build_resolve_result at
pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs lines 283-292, only
invoke calc_specifier when spec.normalized_bare_specifier is absent; likewise,
at lines 344-355, only invoke calc_prefixed_specifier when
jsr_spec.spec.normalized_bare_specifier is absent, preserving the normalized
value on the common path.

Source: Path instructions

🤖 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 `@pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs`:
- Around line 115-116: Trim the comments at
pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs:115-116 by
removing the unaliased output-shape description. At
pnpm/crates/cli/tests/update_jsr.rs:84-86, replace the test-behavior summary
with only the registry-binding invariant if documentation is needed. At
pnpm/crates/cli/tests/update_jsr.rs:141-144, preserve the non-obvious
gate-placement rationale while removing the assertion summary; do not alter test
behavior.

In `@pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs`:
- Around line 283-292: The calculated specifier must remain lazy: in
build_resolve_result at pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs
lines 283-292, only invoke calc_specifier when spec.normalized_bare_specifier is
absent; likewise, at lines 344-355, only invoke calc_prefixed_specifier when
jsr_spec.spec.normalized_bare_specifier is absent, preserving the normalized
value on the common path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e2e56d9d-e660-4480-8bd4-b27882469a0d

📥 Commits

Reviewing files that changed from the base of the PR and between 774b4c2 and c4ab995.

📒 Files selected for processing (8)
  • .changeset/update-latest-rewrites-jsr-specifiers.md
  • pnpm/crates/cli/tests/update_jsr.rs
  • pnpm/crates/resolving-npm-resolver/src/calc_specifier.rs
  • pnpm/crates/resolving-npm-resolver/src/calc_specifier/tests.rs
  • pnpm/crates/resolving-npm-resolver/src/lib.rs
  • pnpm/crates/resolving-npm-resolver/src/named_registry_resolver.rs
  • pnpm/crates/resolving-npm-resolver/src/npm_resolver.rs
  • pnpm/plans/TEST_PORTING.md

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 26, 2026
zkochan added a commit that referenced this pull request Jul 26, 2026
…pre-empts

`build_resolve_result` prefers the spec's own normalized bare specifier
over the computed one, so computing it for a spec that already carries
one — a registry-host tarball URL, whose text has to stay verbatim — only
allocated a string to drop it. Gate `calc_specifier_from` on the spec so
neither call site renders in that case.

Also trim test doc comments that restated their assertions.

Addresses review feedback on #13394.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 26, 2026 01:02

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@zkochan

zkochan commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

Thanks — addressed in b15417e98b90d5b26a4ac2a8ec2e0b0dd0dbfb8f.

Eager specifier allocation (Qodo #2, CodeRabbit nitpick 2) — valid, fixed. Rather than duplicating the guard at both call sites, calc_specifier_from now takes the spec and returns None when it already carries a normalized_bare_specifier, so neither the npm nor the JSR path renders a string build_resolve_result would discard. The two sources are now mutually exclusive by construction.

Test comments (CodeRabbit nitpick 1) — fixed. Trimmed the doc comments on an_unaliased_prefixed_specifier_carries_the_range_alone, update_latest_bumps_a_jsr_dependency, and update_latest_bumps_an_aliased_jsr_dependency down to their upstream-port provenance and the non-obvious gate-placement rationale, dropping the parts that restated the assertions.

Changeset missing pnpm entry (Qodo #1) — not applicable here; rule 713436 is misfiring on the prose. This change is Rust-only, and per AGENTS.md:

Do not add "pnpm" to a Rust-only changeset: in changesets, pnpm always means the TypeScript CLI package. A changeset whose implementation is Rust-only and targets pacquet must omit "pnpm".

The same section also requires the release-note prose to say pnpm, not pacquet ("use pnpm in its release-note prose and command examples"), which is what the rule matched on. The TypeScript CLI needs no change — resolveJsr already calls calcPrefixedSpecifier — so bumping pnpm would cut a TS release for a change that isn't in it. Leaving the changeset as "pacquet": patch.

Code Coverage check — failing on every branch right now, main included (runs at 00:20, 00:24, 00:42 UTC on main all failed the same way: the Run step dies after ~6 minutes with no logs). Unrelated to this PR.


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

@qodo-code-review

Copy link
Copy Markdown

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

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

zkochan and others added 2 commits July 26, 2026 03:09
`update --latest` writes back whatever the resolver reports as the
dependency's normalized bare specifier, and writes nothing when the
resolver reports none — so specifiers no resolver claims are left alone.
The JSR path never reported one, so a `jsr:` dependency always landed in
that "unclaimed" case and kept its old version.

Reporting the npm-shaped range `calc_specifier` builds would have been
wrong: it would rewrite the entry into a registry dependency. Render the
picked version back under the protocol instead, through a new
`calc_prefixed_specifier` mirroring the TypeScript resolver's
`calcPrefixedSpecifier` — `jsr:<range>` when the dependency installs
under the package's own name, `jsr:<pkg name>@<range>` when it is
aliased, keeping the range operator the entry already declared.

`BuildResolveResult` now carries the rendered specifier rather than the
inputs to render it, since which shape to render is the calling
resolver's knowledge, not `build_resolve_result`'s.

The named-registry resolver has the same gap and is tracked separately
in #13393.

TypeScript-side: no change needed, `resolveJsr` already calls
`calcPrefixedSpecifier`.

Closes #13363

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…pre-empts

`build_resolve_result` prefers the spec's own normalized bare specifier
over the computed one, so computing it for a spec that already carries
one — a registry-host tarball URL, whose text has to stay verbatim — only
allocated a string to drop it. Gate `calc_specifier_from` on the spec so
neither call site renders in that case.

Also trim test doc comments that restated their assertions.

Addresses review feedback on #13394.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 26, 2026 01:10

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

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

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.31%. Comparing base (f892e3d) to head (c4d836b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13394   +/-   ##
=======================================
  Coverage   87.31%   87.31%           
=======================================
  Files         542      542           
  Lines       93200    93225   +25     
=======================================
+ Hits        81376    81400   +24     
- Misses      11824    11825    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: c4d836b659a1

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.482 ± 0.133 2.349 2.751 1.62 ± 0.19
pacquet@main 2.495 ± 0.137 2.325 2.796 1.63 ± 0.19
pnpr@HEAD 1.533 ± 0.159 1.345 1.776 1.00
pnpr@main 1.570 ± 0.146 1.340 1.752 1.02 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.48158597894,
      "stddev": 0.1333577419105054,
      "median": 2.4498192138400006,
      "user": 1.4607278799999999,
      "system": 1.3169839199999998,
      "min": 2.3488106223400003,
      "max": 2.75144183034,
      "times": [
        2.4349925213400003,
        2.37926303534,
        2.38729734134,
        2.4646459063400004,
        2.4916526943400004,
        2.3488106223400003,
        2.75144183034,
        2.5323010043400003,
        2.36579898034,
        2.6596558533400003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.49510515374,
      "stddev": 0.13695559164959617,
      "median": 2.4666844558400003,
      "user": 1.5317536799999998,
      "system": 1.2772367199999999,
      "min": 2.3246534713400004,
      "max": 2.79621511934,
      "times": [
        2.56266744434,
        2.54625744334,
        2.79621511934,
        2.4236729503400003,
        2.41631989634,
        2.3609761323400003,
        2.5869201683400003,
        2.3246534713400004,
        2.5024864083400002,
        2.4308825033400003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.53322865784,
      "stddev": 0.15877154129705276,
      "median": 1.50580259984,
      "user": 1.02801108,
      "system": 1.1387169199999998,
      "min": 1.34541913434,
      "max": 1.77623165334,
      "times": [
        1.38419660934,
        1.42644648134,
        1.66688046634,
        1.34541913434,
        1.60867137134,
        1.77623165334,
        1.42682754234,
        1.5847776573399999,
        1.38273510034,
        1.7301005623399999
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5704142882399998,
      "stddev": 0.1459299418986834,
      "median": 1.62895593234,
      "user": 1.09869358,
      "system": 1.1181759199999999,
      "min": 1.33976087434,
      "max": 1.75247639334,
      "times": [
        1.48030989134,
        1.39939639934,
        1.69813402634,
        1.70984928734,
        1.63640398734,
        1.6390997303400001,
        1.42720441534,
        1.33976087434,
        1.62150787734,
        1.75247639334
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 261.9 ± 8.4 250.0 274.4 1.03 ± 0.05
pacquet@main 254.7 ± 8.3 241.5 267.0 1.00
pnpr@HEAD 267.3 ± 8.2 256.6 279.7 1.05 ± 0.05
pnpr@main 270.6 ± 6.8 259.1 282.3 1.06 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2618614660400001,
      "stddev": 0.008365496826834004,
      "median": 0.26317981204000007,
      "user": 0.22437246000000002,
      "system": 0.5276244999999999,
      "min": 0.25001980554000003,
      "max": 0.27444027154000006,
      "times": [
        0.26757831654,
        0.25001980554000003,
        0.27444027154000006,
        0.25334173854,
        0.26702092354000007,
        0.26935092354000006,
        0.26297360254,
        0.25013006454000003,
        0.26338602154000007,
        0.26037299254000007
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25474042434,
      "stddev": 0.008278812277742133,
      "median": 0.2574034310400001,
      "user": 0.19731466000000003,
      "system": 0.5318567,
      "min": 0.24154831254,
      "max": 0.26699173854,
      "times": [
        0.26193236654,
        0.26038175954000004,
        0.26699173854,
        0.25372302754000003,
        0.25774919854000006,
        0.24154831254,
        0.24555981454,
        0.24471116354000003,
        0.25727558454000005,
        0.25753127754000005
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.26733219254000007,
      "stddev": 0.008227450167745676,
      "median": 0.26700302504000006,
      "user": 0.21954906,
      "system": 0.5112717,
      "min": 0.25660438754000003,
      "max": 0.27970567254000006,
      "times": [
        0.26807252954000005,
        0.26077844854000004,
        0.27970567254000006,
        0.26593352054,
        0.27961185554000006,
        0.25660438754000003,
        0.25865208254000005,
        0.26964509854,
        0.26150099254000003,
        0.27281733754000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.2706421466400001,
      "stddev": 0.006799621347198053,
      "median": 0.27096862204000005,
      "user": 0.21925925999999998,
      "system": 0.5316759,
      "min": 0.25910465754000006,
      "max": 0.28229695554000006,
      "times": [
        0.27285766354,
        0.25910465754000006,
        0.26637568554,
        0.26664939154000006,
        0.27836323854000006,
        0.26466845254000004,
        0.28229695554000006,
        0.27068071354000006,
        0.27416817754000006,
        0.27125653054000004
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.779 ± 0.020 2.733 2.802 1.73 ± 0.15
pacquet@main 2.772 ± 0.015 2.750 2.798 1.73 ± 0.15
pnpr@HEAD 1.605 ± 0.142 1.444 1.839 1.00
pnpr@main 1.669 ± 0.128 1.432 1.867 1.04 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.77910649698,
      "stddev": 0.01985470375037598,
      "median": 2.7821538409800004,
      "user": 1.7317605200000004,
      "system": 1.3046074,
      "min": 2.73278302748,
      "max": 2.8021534434800004,
      "times": [
        2.79421603748,
        2.8021534434800004,
        2.7950861924800003,
        2.78098733348,
        2.73278302748,
        2.78698611748,
        2.78074694948,
        2.78332034848,
        2.7710473484800002,
        2.76373817148
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.77243287038,
      "stddev": 0.014824551131589354,
      "median": 2.7693914734800003,
      "user": 1.6804867199999998,
      "system": 1.309487,
      "min": 2.75027839148,
      "max": 2.7981715724800003,
      "times": [
        2.77005215048,
        2.7687307964800003,
        2.7981715724800003,
        2.75027839148,
        2.78341428448,
        2.7891676054800003,
        2.75746613048,
        2.7640281584800004,
        2.7641531244800004,
        2.7788664894800004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6053261934799998,
      "stddev": 0.1418114709125977,
      "median": 1.5606514899800001,
      "user": 1.06223182,
      "system": 1.1038321,
      "min": 1.44356253648,
      "max": 1.8391283044800002,
      "times": [
        1.44356253648,
        1.5989948334800002,
        1.51783799948,
        1.4995448924800001,
        1.55646753648,
        1.83206979848,
        1.48684992748,
        1.7139706624800002,
        1.56483544348,
        1.8391283044800002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.66858217768,
      "stddev": 0.1276565175368042,
      "median": 1.68587817198,
      "user": 1.0373666199999998,
      "system": 1.1405771,
      "min": 1.43218617848,
      "max": 1.86748768348,
      "times": [
        1.75473597248,
        1.86748768348,
        1.7051966084799999,
        1.72358213848,
        1.52981198348,
        1.59301137548,
        1.6305842804800001,
        1.43218617848,
        1.7826658204799999,
        1.6665597354800001
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 597.8 ± 11.4 580.4 614.5 1.96 ± 0.06
pacquet@main 584.5 ± 13.3 568.7 606.5 1.91 ± 0.06
pnpr@HEAD 311.1 ± 7.0 300.8 324.3 1.02 ± 0.03
pnpr@main 305.4 ± 6.4 296.6 318.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.59779919546,
      "stddev": 0.011371994730521778,
      "median": 0.59492594966,
      "user": 0.7330017999999997,
      "system": 0.66180786,
      "min": 0.58043306516,
      "max": 0.6144784721600001,
      "times": [
        0.60652639016,
        0.6144784721600001,
        0.5940678901600001,
        0.61185706316,
        0.59325516416,
        0.60581336416,
        0.59023564516,
        0.58554089116,
        0.59578400916,
        0.58043306516
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.58450070656,
      "stddev": 0.01333154093316889,
      "median": 0.5820045471599999,
      "user": 0.7125770999999999,
      "system": 0.65255776,
      "min": 0.56869224016,
      "max": 0.60645552216,
      "times": [
        0.56869224016,
        0.59603003116,
        0.57974346316,
        0.60286688716,
        0.58426563116,
        0.60645552216,
        0.57667530116,
        0.58544739116,
        0.56921588916,
        0.57561470916
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31114568695999995,
      "stddev": 0.006960746439115103,
      "median": 0.31224446565999997,
      "user": 0.20745390000000002,
      "system": 0.51990566,
      "min": 0.30079004516,
      "max": 0.32428198516,
      "times": [
        0.30574340716,
        0.31455401116,
        0.31528723516,
        0.31315879716,
        0.30708924715999997,
        0.31133013416,
        0.32428198516,
        0.31565503816,
        0.30079004516,
        0.30356696916
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.3054120806599999,
      "stddev": 0.006432759058100605,
      "median": 0.30405568616,
      "user": 0.2006402,
      "system": 0.5423231599999998,
      "min": 0.29664948816,
      "max": 0.31850119116,
      "times": [
        0.30863115016,
        0.31850119116,
        0.30011825816,
        0.30137967816,
        0.31018306816,
        0.30384084616,
        0.30427052616,
        0.30063133616,
        0.30991526416,
        0.29664948816
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.915 ± 0.008 1.909 1.933 6.40 ± 0.22
pacquet@main 1.898 ± 0.011 1.875 1.914 6.34 ± 0.22
pnpr@HEAD 0.313 ± 0.005 0.306 0.324 1.05 ± 0.04
pnpr@main 0.299 ± 0.010 0.282 0.310 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.91540907536,
      "stddev": 0.0075323132333284274,
      "median": 1.91355076206,
      "user": 0.9432078999999998,
      "system": 0.76852144,
      "min": 1.90864249006,
      "max": 1.9331456990600002,
      "times": [
        1.91588930206,
        1.9331456990600002,
        1.9230754280600002,
        1.9154279610600002,
        1.90864249006,
        1.91304658506,
        1.9087706140600003,
        1.9140549390600001,
        1.9102406690600002,
        1.91179706606
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8978563532600004,
      "stddev": 0.010636848659922449,
      "median": 1.89940382506,
      "user": 0.9209548999999999,
      "system": 0.76166344,
      "min": 1.87544817106,
      "max": 1.91432337106,
      "times": [
        1.9036428230600002,
        1.91432337106,
        1.87544817106,
        1.8938668220600001,
        1.89850287406,
        1.8984634790600001,
        1.9031153920600001,
        1.90030477606,
        1.9040952820600001,
        1.88680054206
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31310712056,
      "stddev": 0.004976260897904578,
      "median": 0.31244527056000004,
      "user": 0.20504700000000003,
      "system": 0.5525377399999998,
      "min": 0.30593883306,
      "max": 0.32393428606,
      "times": [
        0.31246772806,
        0.32393428606,
        0.31336286906,
        0.30841344506,
        0.30593883306,
        0.31242281306,
        0.31701380006,
        0.31554873506000003,
        0.31026059206,
        0.31170810406
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29913553396000003,
      "stddev": 0.010032926714467242,
      "median": 0.30415219906,
      "user": 0.19545859999999998,
      "system": 0.5133380399999999,
      "min": 0.28160472406000003,
      "max": 0.30971708506,
      "times": [
        0.29076220106,
        0.28991427106,
        0.28160472406000003,
        0.28980768906000004,
        0.30657088606,
        0.30562380706000003,
        0.30971708506,
        0.30728273906000003,
        0.30268059106,
        0.30739134606
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 368.3 ± 7.2 357.5 381.4 4.22 ± 0.11
pacquet@main 363.1 ± 8.8 350.6 373.9 4.16 ± 0.13
pnpr@HEAD 87.3 ± 1.6 84.5 90.7 1.00
pnpr@main 87.4 ± 1.6 83.9 90.7 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.36833604878,
      "stddev": 0.007194417541474242,
      "median": 0.36862794028,
      "user": 0.3565644599999999,
      "system": 0.06183609999999999,
      "min": 0.35752753578,
      "max": 0.38139010378000004,
      "times": [
        0.36180342678,
        0.38139010378000004,
        0.37038995778,
        0.36965128178,
        0.36083488878000003,
        0.35752753578,
        0.37542534278,
        0.36614207778,
        0.36760459878,
        0.37259127378
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.36305610928000004,
      "stddev": 0.008775463117214301,
      "median": 0.36026432728,
      "user": 0.36073765999999996,
      "system": 0.051609300000000004,
      "min": 0.35062467378,
      "max": 0.37392972078000003,
      "times": [
        0.35960812378,
        0.35791802278,
        0.35062467378,
        0.35290944678,
        0.37252901478,
        0.37305570978,
        0.37087362078,
        0.36092053078,
        0.35819222878,
        0.37392972078000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08728611202242423,
      "stddev": 0.0015749845152981273,
      "median": 0.08722102578,
      "user": 0.020349763030303034,
      "system": 0.009448006060606057,
      "min": 0.08454175778,
      "max": 0.09065942678,
      "times": [
        0.08704697678000001,
        0.08681234378,
        0.09007383278,
        0.08688270678,
        0.08495997678,
        0.08769599178,
        0.09037595078,
        0.08454175778,
        0.08676235978,
        0.08754233178,
        0.08800020578000001,
        0.08726344578,
        0.08681255578,
        0.08617473978,
        0.08752189278,
        0.08664881478,
        0.09065942678,
        0.08516775978,
        0.08910783878,
        0.08465281678,
        0.08740067378000001,
        0.08790939478,
        0.08677893178,
        0.08722102578,
        0.08807946578,
        0.08590875778,
        0.08977110978,
        0.08480173878,
        0.08857786778,
        0.08672053978000001,
        0.08748617578000001,
        0.08852055878000001,
        0.08656173078
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08739110284250003,
      "stddev": 0.001572774008981336,
      "median": 0.08739848028,
      "user": 0.020933366250000005,
      "system": 0.008906306249999999,
      "min": 0.08385688478,
      "max": 0.09068651678,
      "times": [
        0.08923010778,
        0.08530543878,
        0.08760835678000001,
        0.08542401278,
        0.08955787778,
        0.08866880978,
        0.09033254978000001,
        0.08650820978,
        0.08909242878,
        0.08684151878,
        0.08852785278,
        0.08549832378,
        0.08949762278000001,
        0.08385688478,
        0.08785474178,
        0.08807093078,
        0.08648768078,
        0.08695972178,
        0.08812264678000001,
        0.08642797778,
        0.08595206078,
        0.08748512378000001,
        0.08653792578,
        0.09068651678,
        0.08558674978,
        0.08717728378,
        0.08750030378,
        0.08731183678,
        0.08718394578000001,
        0.08766523378,
        0.08549778278,
        0.08805683278
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.521 ± 0.134 4.419 4.782 1.28 ± 0.06
pacquet@main 4.485 ± 0.052 4.419 4.612 1.27 ± 0.05
pnpr@HEAD 3.538 ± 0.140 3.447 3.803 1.00 ± 0.05
pnpr@main 3.538 ± 0.120 3.448 3.841 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.52078794284,
      "stddev": 0.13445762589456225,
      "median": 4.46114340734,
      "user": 1.67162474,
      "system": 1.3831562600000002,
      "min": 4.41894991734,
      "max": 4.78207545634,
      "times": [
        4.48505972234,
        4.41894991734,
        4.42651004034,
        4.4370942513400005,
        4.78207545634,
        4.55397839234,
        4.42693778734,
        4.74313075334,
        4.43722709234,
        4.49691601534
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.48453457094,
      "stddev": 0.052367140488039345,
      "median": 4.47046083484,
      "user": 1.6988698400000004,
      "system": 1.34111746,
      "min": 4.41892842934,
      "max": 4.61179209434,
      "times": [
        4.46003963534,
        4.47504211234,
        4.41892842934,
        4.61179209434,
        4.46587955734,
        4.46347523034,
        4.48950748534,
        4.5115122983400004,
        4.44500351534,
        4.50416535134
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.538290364540001,
      "stddev": 0.13996207105932099,
      "median": 3.47421060634,
      "user": 1.1857221400000002,
      "system": 1.23157056,
      "min": 3.44718135234,
      "max": 3.80301080034,
      "times": [
        3.44718135234,
        3.80301080034,
        3.46526597034,
        3.50641731934,
        3.50202525834,
        3.79961281334,
        3.45990958834,
        3.47626087734,
        3.45105933034,
        3.47216033534
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.53791930474,
      "stddev": 0.11997197911693973,
      "median": 3.49654899934,
      "user": 1.22323524,
      "system": 1.2002605599999998,
      "min": 3.44761814234,
      "max": 3.8409321913400003,
      "times": [
        3.44761814234,
        3.49770757634,
        3.53908323034,
        3.56155523434,
        3.46929754034,
        3.4601145943400002,
        3.44776642934,
        3.61972768634,
        3.49539042234,
        3.8409321913400003
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13394
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,732.78 ms
(-0.04%)Baseline: 2,733.77 ms
3,280.53 ms
(83.30%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,908.64 ms
(+0.94%)Baseline: 1,890.90 ms
2,269.08 ms
(84.12%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
580.43 ms
(+1.05%)Baseline: 574.39 ms
689.27 ms
(84.21%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
357.53 ms
(+2.31%)Baseline: 349.45 ms
419.33 ms
(85.26%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,348.81 ms
(-0.44%)Baseline: 2,359.14 ms
2,830.96 ms
(82.97%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,418.95 ms
(-0.12%)Baseline: 4,424.38 ms
5,309.25 ms
(83.23%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
250.02 ms
(+1.47%)Baseline: 246.41 ms
295.69 ms
(84.56%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13394
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,443.56 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
305.94 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
300.79 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
84.54 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,345.42 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,447.18 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
256.60 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit 723dc76 into main Jul 26, 2026
33 checks passed
@zkochan
zkochan deleted the fix-13363 branch July 26, 2026 07:21
kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 27, 2026
…st (pnpm#13394)

`update --latest` writes back whatever the resolver reports as the
dependency's normalized bare specifier, and writes nothing when the
resolver reports none — so specifiers no resolver claims are left alone.
The JSR path never reported one, so a `jsr:` dependency always landed in
that "unclaimed" case and kept its old version.

Reporting the npm-shaped range `calc_specifier` builds would have been
wrong: it would rewrite the entry into a registry dependency. Render the
picked version back under the protocol instead, through a new
`calc_prefixed_specifier` mirroring the TypeScript resolver's
`calcPrefixedSpecifier` — `jsr:<range>` when the dependency installs
under the package's own name, `jsr:<pkg name>@<range>` when it is
aliased, keeping the range operator the entry already declared.

`BuildResolveResult` now carries the rendered specifier rather than the
inputs to render it, since which shape to render is the calling
resolver's knowledge, not `build_resolve_result`'s.

The named-registry resolver has the same gap and is tracked separately
in pnpm#13393.

TypeScript-side: no change needed, `resolveJsr` already calls
`calcPrefixedSpecifier`.

Closes pnpm#13363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pacquet: update --latest does not rewrite jsr: specifiers

3 participants