-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: .node-version support #2007
base: main
Are you sure you want to change the base?
feat: .node-version support #2007
Conversation
Hi @rwjblue! I opened this PR in accordance with our discussions in the RFC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation seems generally correct, I think we are missing (from the RFC) a few things:
- implementation for error messages mentioned in RFC
- tests
- package.json with volta + .node-version (uses package.json)
- no volta in package.json + .node-version (uses .node-version)
- no volta in package.json + no .node-version (uses global default)
- no volta in package.json + .node-version with invalid semver (e.g.
lts/*
) (should error with nice message) - no volta in package.json + .node-version with extra unexpected content (should error with nice message)
@rwjblue I added some test cases and better error handling. I did not differentiate between:
since that would involve parsing the contents of the file further, even after error. Plus; how do we determine invalid semver compared to just a malformed string? Quite hard logic to specify I believe. 🙃 |
Ya good point, I totally agree with you. I think that there might be something useful RE: specifying a valid looking value that just isn't a valid Node version (e.g. Right now (with
I think that's probably still fine, but I think we need to update the output to indicate why we were looking for that version. In today's world it always comes from the same place ( Probably best to update the RFC with some of this info too. |
Thanks for the input @rwjblue. This last bit about printing the source of the node version appears a bit more complex, and unfortunately, I don't have the time to implement this right now. I still think the implementation is solid though. |
Sure, seems good to me. |
One thing I'm not sure of, is if we should feature flag this (defaulting to on). I'm not really sure what our normal process there is. The actual implementation seems like something fairly easy to back out if we needed to (e.g. it isn't spanning a ton of different files and whatnot), so I'm not sure that we really need a feature flag? Maybe @charlespierce or @chriskrycho have opinions? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@rwjblue - What's the status of this? |
Support for
.node-version
file in accordance with volta-cli/rfcs#54.Extended on #1974:
.node_version
->.node-version
v
and ignoring line endings