Enhancement: fall back to `.tool-versions` for the Node.js runtime

オープン 初心者向け
#709 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
backend, cli

調査の方向性

src/core-open/scanners/node-scanner.tsのnodeRuntimeFromPins周辺と、Pythonスキャナーの.tool-versionsの処理を読み、その後test/node-runtime-pin.test.tsを確認します。nodejsとnodeのエントリー、無視されるコメントと空行、マッピングできないトークン、指定された優先順位を対象とするテストを追加します。有効なピンがNodeランタイムの遅れを報告し、優先順位の高いピンが引き続き優先されることをテストで確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement good first issue
  • Difficulty: small
  • Area: Node / CLI UX (runtime lag)
Problem

#628 added volta.node, .nvmrc, and .node-version as fallbacks when engines.node is missing (nodeRuntimeFromPins in src/core-open/scanners/node-scanner.ts, around lines 104–128). The helper still does not read asdf/mise .tool-versions:

nodejs 20.11.1
# or:
node 20.11.1

Python, Ruby, and Elixir already read .tool-versions. A Node project that only pins the runtime there reports no runtime and no runtime lag.

Expected behaviour

When engines.node, volta.node, .nvmrc, and .node-version have not produced a runtime, read .tool-versions in the same directory as package.json. Accept a nodejs or node line. Use the first version token (reuse normalizeNodePin / the Python pythonVersionFromToolVersions pattern). Skip non-version tokens such as system, lts, or ref:… unless normalizeNodePin already maps them (it already maps some .nvmrc lts codenames — stay consistent). Comments and blank lines are ignored.

Precedence, first match wins: engines.node > volta.node > .nvmrc > .node-version > .tool-versions.

Acceptance
  • Extend test/node-runtime-pin.test.ts.
  • Only .tool-versions with nodejs 20.11.1 or node 20.11.1 reports Node 20.11.1 and runtime lag.
  • .nvmrc still wins over .tool-versions.
  • engines.node still wins over every pin file.
  • A system (or otherwise unmappable) .tool-versions entry yields no runtime.
  • Comments and blank lines are ignored.

主要言語
TypeScript
スター
4
フォーク
3
平均マージ
1日 22時間
マージ済み PR(30日)
76

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vibgrate/cli のほかの issue

vibgrate/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。