-
Notifications
You must be signed in to change notification settings - Fork 81
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
build(tools): Add support for asdf #2505
base: main
Are you sure you want to change the base?
Conversation
@@ -25,7 +25,9 @@ We welcome contributions in the form of comments, issues, or pull requests with | |||
|
|||
## Environment setup | |||
|
|||
1. Use the node environment manager of your choice, but make sure you have the required version specified in `.node-version`. We recommend using [nodenv](https://github.com/nodenv/nodenv) to manage your node versions, but you can also use [homebrew](https://brew.sh/). More info can be found here: [how to install Node.js](https://nodejs.dev/how-to-install-nodejs) |
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.
The nodejs link was a 404, so I removed it.
Additionally, it is not recommended to use brew for Node, as brew prefers to use latest
whenever possible. Contributors using brew will likely continue to use it (and hopefully know how to deal with those quirks), so I think it best to recommend a version manager and leave it at that.
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.
Something I've wondered for a while about asdf is that it supports .node-version
file, is it better to have two files or just let asdf users know how to enable legacy_version_file
for asdf?
https://github.com/asdf-vm/asdf-nodejs#nvmrc-and-node-version-support
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.
@gidjin did y'all ever chat about this?
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.
We did, I never tested with the legacy_version_file
enabled. I do need to do that. If that works, I can revert much of this PR, but still want the other doc changes/fixes to go into effect
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.
Left a note that I'd like to chat about before approving, otherwise this is good.
Summary
Nodenv is a great tool and many folks in the JS ecosystem use it. We support and recommend it today, and include a
.node-version
to help with that.asdf is also very popular, but typically more for developers working in a mixed tech stack (JS & Go, JS & Java, etc).
By adding
.tool-versions
, asdf users get the same benefits as nodenv users, by having their node version automatically set to the correct version when working within this project directory.asdf users likely need asdf for other projects, and should not be expected to switch to nodenv
It is also not recommended to use multiple node version managers, so either only asdf or only nodenv/n/nvm is recommended. Otherwise the tools can compete, causing unexpected shimming of Node to your PATH.
This PR preserves support for Nodenv for the folks who use that tool, but enables support for asdf for folks who use that tool. It is up to contributors to install, use, and manage the tool of their preference.
How To Test
As an asdf user, I tested by running the following within the repo directory: