Skip to content

fix(lookup): bun follows npm's toolchain and peer rules; version files report release-line - #256

Merged
sweepies merged 3 commits into
mainfrom
fix/bun-npm-rules
Nov 11, 2026
Merged

sweepies merged 3 commits into
mainfrom
fix/bun-npm-rules

Conversation

@sweepies

@sweepies sweepies commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Bug 2 from design consult 4, plus two follow-ups from the review of #255.

Bun misses npm's rules. With only bun enabled, the node descriptor emits Manager::Bun, but the supported-runtime rule and the peer rule tested Manager::Npm. So engines.node was treated as an installed version, and peer ranges were rewritten to exact pins. Both rules now apply to Npm | Bun (crates/lookup/src/lib.rs: supported_runtime, the peer policy in effective, the peer widening rewrite, the in-range toolchain keep and resolved_current_version). Bun version files still update like pins (#255). Lockfile behaviour is untouched.

Version files report release-line. crates/engine/src/report.rs labelled any toolchain with a resolved version supported-range, including .nvmrc, .node-version and .terraform-version, which #255 made installed pins. A toolchain whose scheme cannot express a range now reports release-line, as a .tool-versions pin does. Runtime constraints such as engines.node and required_version keep supported-range.

Report JSON change: resolution.kind for those version files changes from supported-range to release-line.

Tests:

  • pinned_bun_misses_npm_toolchain_and_peer_rules becomes bun_follows_npm_toolchain_and_peer_rules: a Bun toolchain ^20 gets no proposals, and a Bun peer ^18 widens to ^18 || ^19.0.0.
  • New a_version_file_pin_reports_release_line and an_engines_node_constraint_reports_supported_range (engine/tests/resolution.rs), which pin both sides of the label boundary.

Docs:

Corpus snapshot: unchanged. The defaults enable both npm and bun, and the node descriptor emits Manager::Npm when both are enabled, so no corpus dependency is a Bun one.

View guided diff Turn on auto-fix

Bun shares npm's files, so a bun-enabled repository emits the same node
descriptors under Manager::Bun. The supported-runtime and peer rules
named Manager::Npm alone, which treated a bun toolchain range as an
installed pin and rewrote a ranged peer to the exact target instead of
widening it.
A toolchain declaration resolved through the tool listing reported
supported-range regardless of scheme, so a version file such as .nvmrc
or .terraform-version — an installed pin, not a runtime constraint —
was mislabelled. A toolchain whose scheme cannot express a range now
reports release-line, matching the .tool-versions pin it is analogous
to; ranged constraints (engines.node, required_version) keep
supported-range.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula 580593a Commit Preview URL

Branch Preview URL
Nov 11 2026, 08:24 AM

@sweepies
sweepies merged commit ed0806c into main Nov 11, 2026
13 checks passed
@sweepies
sweepies deleted the fix/bun-npm-rules branch November 11, 2026 08:32
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 11, 2026
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