Expected Behaviour
It is frequently important to have the runtime node version match the version used locally and in CI (e.g. to run tests). Similarly to how the setup-node or asdf-vm/actions/install actions work in GitHub Actions, it should be possible for hedy to read the node version from a file so that the following are controlled in one place:
- Local node version (e.g. via asdf)
- GitHub Actions (e.g. via the
setup-node or asdf-vm/actions/install action)
- Runtime version
Proposed Syntax
node-version-file CLI argument and nodeVersionFile package configuration should be able to contain a relative file path. If present and the file contains a parseable value, this should be used as the node version. If the value is a simple integer, that's the node version. If the value contains a two or three segment version (i.e. 20.1.2) then only the first segment is used.
Similar to the setup-node action, if both node-version-file and node-version are configured, node-version is used.