feat(js_runtime): add multi-source Node version reading#522
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
0e469bd to
901823c
Compare
3 tasks
901823c to
256cd9b
Compare
Deploying vite-plus with
|
| Latest commit: |
256cd9b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3f73d7d1.vite-plus.pages.dev |
| Branch Preview URL: | https://improve-js-runtime.vite-plus.pages.dev |
72c1b11 to
03093b9
Compare
03093b9 to
e865f32
Compare
e865f32 to
a166bdb
Compare
a166bdb to
2937a7c
Compare
369d292 to
61f1397
Compare
2937a7c to
5c6ebe7
Compare
Member
|
cursor review |
2da0acc to
9889dde
Compare
Read Node.js version from multiple sources with priority: 1. .node-version file (highest) 2. engines.node in package.json 3. devEngines.runtime in package.json (lowest) Key behaviors: - Only write to .node-version when no version source exists - Always fetch latest LTS from network when no version specified - Warn when resolved version conflicts with lower-priority constraints - node-semver handles partial versions natively (20, 20.18, etc.)
Invalid version strings from .node-version, engines.node, and devEngines.runtime are now ignored with a warning, allowing fallthrough to lower-priority sources or the latest LTS version. The normalize_version function trims whitespace and validates the version as either an exact semver version or a valid range.
…hanges - Add Version Validation section documenting trim and semver validation - Update Version Write-Back section to reflect current behavior (only write when no version source exists) - Add success criteria #19 for invalid version fallthrough behavior
When resolving semver ranges like `^20.19.0 || >=22.12.0`, now prefers LTS versions over non-LTS versions. Previously it would return v25 (non-LTS), but now returns the latest LTS that satisfies the range. Only falls back to non-LTS if no LTS version matches the range. Changes: - Updated resolve_version_from_list to prefer highest LTS version - Updated find_cached_version to cross-reference with version index for LTS status of cached versions - Added tests for LTS preference behavior
When fetching the version index fails due to network errors and a local cache exists (even if expired), log a warning and return the cached version instead of failing. This ensures network issues don't interrupt the normal flow when we have a usable cache fallback.
Add visual feedback when downloading JS runtimes using indicatif crate. Shows download progress with bytes, speed, and ETA in TTY environments. Automatically hidden in CI or when output is piped.
Display what is being downloaded (e.g., "Downloading Node.js v22.13.1...") above the progress bar so users understand what the download is for.
9889dde to
42c817f
Compare
This was referenced Feb 6, 2026
Brooooooklyn
approved these changes
Feb 7, 2026
Member
Author
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.

Read Node.js version from multiple sources with priority:
Key behaviors: