Skip to content

fix(env): stop auto-writing .node-version file (#666) - #667

Merged
fengmk2 merged 6 commits into
mainfrom
remove-node-version-auto-write
Mar 3, 2026
Merged

fix(env): stop auto-writing .node-version file (#666)#667
fengmk2 merged 6 commits into
mainfrom
remove-node-version-auto-write

Conversation

@fengmk2

@fengmk2 fengmk2 commented Mar 2, 2026

Copy link
Copy Markdown
Member

Remove the auto-write behavior where the shim would create a
.node-version file when no version source existed. The file should
only be written explicitly via vp env pin.

closes VP-208

fengmk2 commented Mar 2, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fengmk2 fengmk2 self-assigned this Mar 2, 2026
@linear

linear Bot commented Mar 2, 2026

Copy link
Copy Markdown
VP-208 Stop auto write .node-version file

Only write .node-version on vp env pin command.

@fengmk2
fengmk2 force-pushed the remove-node-version-auto-write branch 2 times, most recently from be4cd52 to 095505c Compare March 2, 2026 13:22
@fengmk2
fengmk2 marked this pull request as ready for review March 2, 2026 13:43

fengmk2 commented Mar 3, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • Mar 3, 2:33 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 3, 2:34 AM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 3, 2:50 AM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 3, 3:05 AM UTC: @fengmk2 merged this pull request with Graphite.

@fengmk2
fengmk2 force-pushed the remove-node-version-auto-write branch from 5576ece to 0196c33 Compare March 3, 2026 02:34
fengmk2 added 6 commits March 3, 2026 02:50
Remove the auto-write behavior where the shim would create a
.node-version file when no version source existed. The file should
only be written explicitly via `vp env pin`.
After removing auto-write of .node-version (#666), `ensure_project_runtime()`
still called `download_runtime_for_project()` which skips the user's
`default_node_version` config and goes straight to LTS. This caused
`vp run` and `vp exec` to use a different Node.js version than
`vp env which` in unpinned projects.

Fix by switching to `config::resolve_version()` which checks the full
resolution chain (env var → .node-version → engines.node →
devEngines.runtime → user default → LTS).
…ct runtime

Restructure ensure_project_runtime() to delegate to download_runtime_for_project()
when project version sources exist, fixing two issues:
- Range versions now check locally cached versions before network (P1)
- Invalid engines.node correctly falls through to devEngines.runtime (P2)
…are invalid

When resolve_node_version() finds a version source with an invalid value
(e.g., engines.node: "typo"), it returns Some(...) which previously routed
to download_runtime_for_project(). That function falls to LTS when all
sources are invalid, skipping the user's configured default.

Add has_valid_version_source() to validate project sources before routing.
When no valid source exists, fall through to config::resolve_version()
which checks the user default from config.json before LTS.
Tests that change the global default Node.js version (via `vp env default`)
can interfere with each other when run concurrently. Add a `serial` field to
steps.json that partitions tests into serial and parallel groups — serial
tests run first with concurrency 1, then parallel tests run with full CPU
concurrency.
When engines.node contained an invalid version and devEngines.runtime was
also present in the same package.json, `vp exec` skipped the fallback and
went straight to user default/LTS. Extend the fallback match in
resolve_version() to also handle VersionSource::EnginesNode, so invalid
engines.node correctly falls through to devEngines.runtime.
@fengmk2
fengmk2 force-pushed the remove-node-version-auto-write branch from 0196c33 to 59dec20 Compare March 3, 2026 02:50
@fengmk2
fengmk2 merged commit d43215b into main Mar 3, 2026
18 checks passed
@fengmk2
fengmk2 deleted the remove-node-version-auto-write branch March 3, 2026 03:05
fengmk2 added a commit that referenced this pull request Aug 7, 2026
Apply STE-style simplification to the report, scripts, and POC comment.
Link every referenced nub/vp issue. Record the verified #667 status:
PR #2313 fixes the core binding lookup, nub 0.7.2 materializes
packages with undeclared imports per-project, and aube 1.37's slot
layout resolves the old require. vp build passes on current versions.
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.

2 participants