Repository navigation
fix(lsp): resolve the newest prerelease of jsr packages that have no stable release - #36655
Merged
Merged
Conversation
crowlKats
force-pushed
the
jsr-prerelease-fallback
branch
from
August 26, 2026 15:34
c6271d7 to
d1b9d5b
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
JsrCacheResolver::req_to_nvdid its ownversion_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.add::only_unstable_versionsnow also asserts the resultingdeno.json;install::minimum_dependency_age_prerelease_onlyspec 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);lsp_jsr_prerelease_only_packageintegration test covers the LSP path.