-
Notifications
You must be signed in to change notification settings - Fork 422
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
chore: Add .direnv file for automatic Node.js version switching with fnm #3009
Conversation
WalkthroughThe update introduces the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
.envrc
Outdated
@@ -0,0 +1,6 @@ | |||
use_node() { | |||
local node_version=$(jq -r '.engines.node' package.json) | |||
fnm use "$node_version" |
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.
What about nvm? Also, do these tools offer this functionality of automatically switching version based on package.json
engine?
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.
It's worth mentioning- for my purposes I use nvm and set the latest as a default alias. Perhaps devs can do something similar then we don't have to concern ourselves with maintaining this for all devs.
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.
You're right, this is narrowing the solution. Plus, version resolution is not trivial.
With .nvmrc
we don't get unpredictable results looking forwards.
(forced a new commit)
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.
I use fnm:
You can use fnm use --resolve-engines
to get the version that is pegged.
You can also add eval "$(fnm env --use-on-cd)"
your shell to automatically update
Add .nvmrc file pegging Node.js version to a concrete one.
a98d393
to
337f4e7
Compare
What is the purpose of the change
Added .direnv config, to support that allows fnm to automatically switch Node.js version.
ClickUp Task
ClickUp Task URL
Brief Changelog
Testing and Verifying
Documentation and Release Note
Summary by CodeRabbit
package.json
.