Skip to content

fix(lsp): resolve the newest prerelease of jsr packages that have no stable release - #36655

Merged
crowlKats merged 3 commits into
denoland:mainfrom
crowlKats:jsr-prerelease-fallback
Aug 29, 2026
Merged

crowlKats merged 3 commits into
denoland:mainfrom
crowlKats:jsr-prerelease-fallback

Conversation

@crowlKats

@crowlKats crowlKats commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

deno_graph 0.111.0 (denoland/deno_graph#661, landed here in #36699) resolves wildcard requirements to the newest pre-release inside the resolver when a package has no unyanked stable release, flowing through the same resolution options as everything else — including the minimum-dependency-age filter. With the resolver owning the semantics, the CLI-side fallback this PR originally added is no longer needed; what remains:

  • LSP: JsrCacheResolver::req_to_nv did its own version_req.matches() filtering, so a * requirement still matched nothing for a prerelease-only package and LSP diagnostics diverged from CLI resolution. It now uses deno_graph's exported predicates (prerelease_fallback_applies + version_matches), giving the LSP exactly the resolver's semantics: pre-releases are only considered when the package has no unyanked stable version at all, applied inside the single matching pass — a package with an uncached stable version and a cached pre-release does not fall back.
  • Coverage:
    • add::only_unstable_versions now also asserts the resulting deno.json;
    • new install::minimum_dependency_age_prerelease_only spec proves the dep-age cutoff applies to the pre-release fallback (a beta published after the cutoff is skipped in favor of an older one);
    • new lsp_jsr_prerelease_only_package integration test covers the LSP path.

@crowlKats
crowlKats force-pushed the jsr-prerelease-fallback branch from c6271d7 to d1b9d5b Compare August 26, 2026 15:34
@crowlKats crowlKats changed the title fix(add): install the newest prerelease of jsr packages that have no stable release fix(lsp): resolve the newest prerelease of jsr packages that have no stable release Aug 26, 2026
@crowlKats
crowlKats merged commit 1aa88c0 into denoland:main Aug 29, 2026
136 checks passed
bartlomieju pushed a commit that referenced this pull request Sep 16, 2026
…stable release (#36655)

deno_graph 0.111.0 (denoland/deno_graph#661, landed here in #36699)
resolves wildcard requirements to the newest pre-release inside the
resolver when a package has no unyanked stable release, flowing through
the same resolution options as everything else — including the
minimum-dependency-age filter. With the resolver owning the semantics,
the CLI-side fallback this PR originally added is no longer needed; what
remains:

- **LSP**: `JsrCacheResolver::req_to_nv` did its own
`version_req.matches()` filtering, so a `*` requirement still matched
nothing for a prerelease-only package and LSP diagnostics diverged from
CLI resolution. It now uses deno_graph's exported predicates
(`prerelease_fallback_applies` + `version_matches`), giving the LSP
exactly the resolver's semantics: pre-releases are only considered when
the package has no unyanked stable version at all, applied inside the
single matching pass — a package with an uncached stable version and a
cached pre-release does not fall back.
- **Coverage**:
- `add::only_unstable_versions` now also asserts the resulting
`deno.json`;
- new `install::minimum_dependency_age_prerelease_only` spec proves the
dep-age cutoff applies to the pre-release fallback (a beta published
after the cutoff is skipped in favor of an older one);
- new `lsp_jsr_prerelease_only_package` integration test covers the LSP
path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant