epic-stack
epic-stack copied to clipboard
build(node): use `.nvmrc` to declare `node` version
Test Plan
Current tests should pass as-is
Checklist
- [x] Docs updated
Screenshots
This does not have any changes that need screenshots
closes: #799
There might be a GitHub Action for fetching the value (similar to how we fetch fly app name). However I am not familiar with that.
As per .nvmrc, node GitHub Action supports reading the version from any file, as long the only text it has is the version of node to use.
I just used .nvmrc, as nvm is the most popular version manager for node. Technically we can call it whatever we want.
This does not mean that you need to use nvm. Having .nvmrc simply makes it easy for anyone using nvm to use the same version. If you don't it doesn't affect you per-se.
Is there any way for these tools to reference the engines config in the package.json so we don't need an entirely separate file for managing the node version?
Is there any way for these tools to reference the engines config in the package.json so we don't need an entirely separate file for managing the node version?
I've investigated it, and it seems that:
nvmhas a feature request opened for 9 years with slow progressfnmis able to pick it up through a config but still experimental
I personally recommend fnm to everyone that uses nvm as it's significantly faster (see this article regarding nvm).
Should we proceed with recommending fnm in the docs to use the correct version?
Regarding the action setup-node, it also accepts package.json as node-version-file 🎉
That all sounds fine to me. I'm fine with documentation that recommends fnm as long as we don't need to add yet another root-level file to the codebase.
Regarding the action setup-node, it also accepts
package.jsonasnode-version-file🎉
Interesting I didn't know this.. I will update to use it
Closing this for now. Feel free to open a new PR for supporting the package.json