Skip to content
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 documenation for supporting tool version managers like asdf and mise-en-place #2505

Merged
merged 4 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Having issues? See [FAQs](./docs/faqs.md).

### NodeJS

We develop on this library with the version of node defined in `.node-version`. We run the test suite against the major released versions of node that are still in active LTS and not development releases. Specific versions are defined in the workflow: `.github/workflows/build-and-test.yml`. Those are the versions we exxpect to support, if you are using a pre-release or development version of node you may run into unexpected issues.
We develop on this library with the version of node defined in [`.node-version`](.node-version). We run the test suite against the major released versions of node that are still in active LTS and not development releases. Specific versions are defined in the workflow: `.github/workflows/build-and-test.yml`. Those are the versions we expect to support, if you are using a pre-release or development version of node you may run into unexpected issues.

Having issues? See [FAQs](./docs/faqs.md).

Expand Down
9 changes: 8 additions & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ 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)
Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I'm still on asdf, I do plan on switching to Mise which supports .tool-versions, and .node-version, so this should be fine for that tool as well.

I just updated the PR for both cases

1. Use the node environment manager of your choice, but make sure you have the required version specified by the project.
- The version required by the project can be found in [`.node-version`](../.node-version).
- We recommend using a single tool version manager such as [mise-en-place](https://mise.jdx.dev/), [asdf](https://asdf-vm.com/), or (specific to just Node) [nodenv](https://github.com/nodenv/nodenv) to manage your node version on this project.
If you already have a preferred node version manager installed, use it.

> [!NOTE]
> If using asdf, you must [enable `legacy_version_file`](https://asdf-vm.com/manage/configuration.html#legacy-version-file) to have the tool version picked up from `.node-version`
> Mise supports `.node-version` [as a default](https://mise.jdx.dev/configuration.html#idiomatic-version-files). If you're having trouble, make sure that setting is not set to false.

2. Use [yarn](https://yarnpkg.com) to manage JS packages.

Expand Down
Loading