-
Notifications
You must be signed in to change notification settings - Fork 3
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
Introduce version alias for current node version and project pined version #1
Introduce version alias for current node version and project pined version #1
Conversation
Codecov Report
|
src/aliases.js
Outdated
|
||
if (!nodeVersionFile) { | ||
throw new Error( | ||
`node config file not found [was looking for ${NODE_VERSION_FILES.join( |
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.
When no NODE_VERSION_FILES
was found, we should default to process.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.
I did. it, but I'm a bit unsure about it.
That is a good default, but it should be disableable. Otherwise no way to know if version was resolved from version file, or if just process 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.
I think this is an interesting idea, but I would favor simplicity (no options) over feature here as a first step. However if someone post an issue where they wished that an error was thrown to notify them that they forgot to add their .nvmrc
, we should add that option then.
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.
Thanks a lot for this PR @AdrieanKhisbe!
I added some comments.
Also, the CI is currently failing. I think this is because the new function is not used by src/main.js
yet.
Thanks for your help!
dd1fc27
to
6627c6a
Compare
I made the changes, but then just realize I had an outdated version of the page, missing lasts changes. 🤦♂ I'll be back |
…when no version file
@ehmicky I completed the changes, and introduced an alias section in the documentation: I set I might try to work on nvm aliases support. Tell me if you prefer that to happens in that PR, or a second one, once thos one has landed. 🙂 |
@ehmicky I did work on nvm alias in the end, you can preview it here: (tests are green except on windows where is an issue cloning the repo cause by one nvm fixture file) |
@ehmicky I have all changes ready but the one about the two test were I used `resolveVersionRangeAlias purposefully: #1 (comment) I before to commit and push, I would like to know if it's okey, or if you really prefer not to unit test at this level. I'll wait for your input on this issue to commit and push (I'll also apply the rebase that needs to be done with the current |
…oject version locks Supported files for node locks: .node-version, .nvmrc, .naverc Follow up discussion on client library get-node: ehmicky/get-node#4
…when no version file
8d78643
to
ac12c5b
Compare
@ehmicky,and here it is :) |
(strange the lint is breaking, it's passing on my machine, and my CI 🤔 https://github.com/AdrieanKhisbe/normalize-node-version/actions/runs/72487439) |
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.
Thanks a lot for this PR @AdrieanKhisbe! 🎉
This looks good now. There is a linting issue and a merge conflict with package-lock.json
but I will fix it directly on master
.
Released in: 🎉 @all-contributors Could you please add @AdrieanKhisbe for code, test and ideas? |
I've put up a pull request to add @AdrieanKhisbe! 🎉 |
@ehmicky Awesome! :) And interesting this @allcontributor bot! |
…, indirections and cycle protection) 🔖 🛠️ This is a rework of https://github.com/AdrieanKhisbe/normalize-node-version/commits/support-nvm-aliases--original prototype when ehmicky#1 was still in building 🏗️
includies lts/aliases, stable, personal ones, indirections and cycle protection :hammer_and_wrench: This is a rework of https://github.com/AdrieanKhisbe/normalize-node-version/commits/support-nvm-aliases--original prototype when ehmicky#1 was still in building 🏗️
includies lts/aliases, stable, personal ones, indirections and cycle protection :hammer_and_wrench: This is a rework of https://github.com/AdrieanKhisbe/normalize-node-version/commits/support-nvm-aliases--original prototype when ehmicky#1 was still in building 🏗️
Support version alias for process version '-' and '.' for common project version locks (.node-version,.nvmrc,.naverc)
This is a Follow up from our discussions @ehmicky on client library get-node: ehmicky/get-node#4
So here is the Proposal:
Problem addressed: with
nve
, running on the.nvmrc
version of project and others, without having to explicitly say which exact my .nvmrc isRelated Prs: no pr opened
Solution proposed: support of aliases/pseudo versions:
.
: resolve to the version range stored in.node-version
,.nvmrc
or.naverc
(using find-up)_
: resolve to current process node versionChecklist
README.md
, thedocs
directory (ifany) and the
examples
directory (if any).