Skip to content

Add support for "lts" alias, closes #313#322

Merged
qw3rtman merged 2 commits intotj:masterfrom
stefanmaric:feature/lts
Dec 18, 2015
Merged

Add support for "lts" alias, closes #313#322
qw3rtman merged 2 commits intotj:masterfrom
stefanmaric:feature/lts

Conversation

@stefanmaric
Copy link
Copy Markdown
Contributor

--lts will display latest LTS version
lts will install latest LTS version

Node LTS releases use "a naming convention based on the Periodic
Table of Elements [...] in alphabetical order", as announced here:
https://nodejs.org/en/blog/release/v4.2.0/

LTS versions have their own folder in nodejs' dist folder, e.g.:
https://nodejs.org/dist/latest-argon/

To retrieve latest LTS' latest version, we search for and fetch
that folder. We get the semver number from the first file that
holds it. Then we can fetch the tarball.

--lts will display latest LTS version
lts will install latest LTS version

Node LTS releases use "a naming convention based on the Periodic
Table of Elements [...] in alphabetical order", as announced here:
https://nodejs.org/en/blog/release/v4.2.0/

LTS versions have their own folder in nodejs' dist folder, e.g.:
https://nodejs.org/dist/latest-argon/

To retrieve latest LTS' latest version, we search for and fetch
that folder. We get the semver number from the first file that
holds it. Then we can fetch the trallbar.
@jwhitmarsh
Copy link
Copy Markdown

This is cool - can it be merged and released?

@fluffywaffles
Copy link
Copy Markdown

👍
I'd be eager to see this merged; I literally searched for "n lts" and ended up here!

@qw3rtman
Copy link
Copy Markdown
Collaborator

I think it'd be nice to have a n lts <version> as well. I haven't taken a look at the URL schema for these LTS releases, so I'm not sure how difficult it would be to implement this. Thoughts?

For now, I think this is a great addition. //cc @tedgaydos @benatkin @tjwebb @troy0820

@tejasmanohar
Copy link
Copy Markdown

+1

@qw3rtman Example usage of n lts <version? Generally, only 1 version is supported as "LTS" by an organization at a given time, right (I may be wrong)?

@tejasmanohar
Copy link
Copy Markdown

Also, I think we should remove stable in favor of the existence of both lts and latest since stable is a bit ambiguous now... Thoughts, @qw3rtman / @stefanmaric? Sent a (sub-)PR to the fork / the branch of this PR- https://github.com/stefanmaric/n/pull/2

@ghost
Copy link
Copy Markdown

ghost commented Nov 15, 2015

I will want to keep stable in place for backward compatibility. It will just become an alias to lts. I do not think there will be any ambiguity.

@tejasmanohar
Copy link
Copy Markdown

fair enough

@stefanmaric
Copy link
Copy Markdown
Contributor Author

There can be more than 1 LTS version in a given point in time, based on this: https://github.com/nodejs/LTS/blob/master/README.md

But I would say it is unnecessary for now. When I think in n lts I want to get the latest version of nodejs with Long Term Support.

Anyway, in current n codebase, I can easily make --lts display available LTS versions and lts <version-name> install a specific one. A problem is that it requires few more HTTP calls to get it.

Nodejs' dist folder has index.json and index.tab files, which I think creationix/nvm uses. Those files, each, contain a lot of metadata, including which versions are LTS. Using any of those would skip HTTP calls but it would also mean a rewrite of n. (and I actually prefer current simplicity of n)

About @tejasmanohar pull request: I agree with removing the stable alias because it now means latest. Probably the nodejs team will be releasing canary builds in the feature and we could add canary and --canaty to n. But removing stable alias breaks backwards compatibility so, I would send this PR for a MINOR release and leave the removal of stable for a future MAJOR, following semver.org

PD: I wrote this message some hours ago but forgot to send it.

@tejasmanohar
Copy link
Copy Markdown

About @tejasmanohar pull request: I agree with removing the stable alias because it now means latest. Probably the nodejs will be releasing canary builds in the feature and we could add canary and --canaty to n. But removing stable alias breaks backwards compatibility so, I would send this PR for a MINOR release and leave the removal of stable for a future MAJOR, following semver.org

Right, agreed.

@ghost
Copy link
Copy Markdown

ghost commented Nov 16, 2015

index.json may not be up to date. a real early version of n used it and it did not work out. That is why it went to scanning the dist site for version numbers. I would not go to far into LTS with specific release names. All LTS version will still follow the semver system. I am going to leave LTS as the newest LTS. If you want an "older" LTS, you can still use n <version> like n 4.2 to get Argon.

@stefanmaric
Copy link
Copy Markdown
Contributor Author

So we are good to go with this PR, right? (I kinda need this in npm for prod stuff. 😄 )

@jwhitmarsh
Copy link
Copy Markdown

👍 would really like to see this merged :)

@tejasmanohar
Copy link
Copy Markdown

@stefanmaric n, not npm, right? :)

@stefanmaric
Copy link
Copy Markdown
Contributor Author

I meant the npm registry @tejasmanohar, so I can distribute some scripts to my peers. 😄

Already a month since I submitted the PR, won't merge? 😢

@ffaubert
Copy link
Copy Markdown

ffaubert commented Dec 5, 2015

Would really love to have this functionality soon.

@stefanmaric
Copy link
Copy Markdown
Contributor Author

cc: @maxrimue

@maxrimue
Copy link
Copy Markdown
Contributor

@stefanmaric I'm sorry, but I'm not a collaborator any more, which means that I do not have permissions to merge this

@stefanmaric
Copy link
Copy Markdown
Contributor Author

I'm sorry, but I'm not a collaborator any more, which means that I do not have permissions to merge this

What a pity. :c

Who's in charge now? There's a good amount of users willing to use this feature (including myself 😄 ).

cc: @tj

@qw3rtman
Copy link
Copy Markdown
Collaborator

I'm willing to merge. @tedgaydos is this good with you?

@ghost
Copy link
Copy Markdown

ghost commented Dec 18, 2015

You can merge it if you want. It looks fine. I will look to get this published to npm this weekend. I was away on a long project that is winding down.

@tjwebb
Copy link
Copy Markdown
Collaborator

tjwebb commented Dec 18, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants