Skip to content

Node version resolution doesn't match the behavior of vp env by default #128

Description

@JstnMcBrd

One of the things I like most about vp is that I don't have to think about node versions at all. It just looks at .node-version, then devEngines.runtime, then engines.node, then .nvmrc, and picks the right one automatically. No commands required, no extra config.

I was surprised to find that setup-vp doesn't work the same way. According to the README, if you don't pass node-version or node-version-file, it just defaults to latest LTS instead of doing that same lookup.

So if my project only declares its node version through devEngines.runtime, the action silently ignores that and grabs the latest LTS, unless I explicitly tell it node-version-file: package.json. And if I switch from devEngines.runtime to .node-version someday, vp will just work automatically, but setup-vp will not work unless I remember to update node-version-file.

This caught me off guard because I expected the action to behave like vp itself does. Having to manually point it at a file feels like extra config for something that should just work out of the box, and it's an easy way to end up with CI silently running a different node version than local dev.

Most of all, it feels inconsistent with how vp already behaves.

Would it be possible to make setup-vp just use vp's normal node version resolution when no explicit input is given, instead of defaulting to LTS?

- await exec("vp", ["env", "use", nodeVersion]);
+ await exec("vp", ["env", "use"]); // Rely on `vp` to resolve

Note:

I'm basing this off of the documentation in the README. When I read the code in index.ts and inputs.ts, I wasn't able to find where node-version defaults to LTS.

If it doesn't, then my request might be irrelevant because vp would use the normal node resolution after all. If that's the case, then I simply ask for the documentation to be updated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions