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

feat: add support node is an alias for the latest version #418

Closed
wants to merge 2 commits into from

Conversation

bluelovers
Copy link

@jdforsythe
Copy link

@bluelovers this should also add stable as an alias.

@bahagia97 any idea when this will be released? We go to production on the latest LTS but also want to test with the latest version to know ahead of time what our compatibility will be with the next LTS, so we currently use a node-version matrix like:

matrix:
  node-version: ['lts/*', '17']

but this would require updates to hundreds of repos when we get versions 18 and 19. This change will allow us to use

matrix:
  node-version: ['lts/*', 'node']

(or preferably stable) and then we won't have to update the configs when new versions are released.

@panticmilos
Copy link
Contributor

Hi @bluelovers,

This branch has conflicts with the main branch, so could you please resolve it. Also, you need to run npm build, to update the content of the /dist folder. There are some small spacing mistakes in the version.yaml workflow so can you please fix that as well.

Cheers

Copy link

@mheob mheob left a comment

Choose a reason for hiding this comment

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

See the comment of @panticmilos.

And an additional stable alias I would also prefer.

Edit:
Since NVM says "stable: this alias is deprecated, and only truly applies to node v0.12 and earlier. Currently, this is an alias for node" I would not add stable alias.

README.md Outdated Show resolved Hide resolved
@bluelovers bluelovers requested a review from a team April 20, 2022 19:25
@@ -373,6 +373,10 @@ async function queryDistForMatch(
let versions: string[] = [];
let nodeVersions = await getVersionsFromDist();

if (versionSpec === 'node') {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather go with latest here. I get that there's prior art for node, but it doesn't make much sense to me on its own merits.

The meaning of latest is self-evident and matches other usage in Actions (ubuntu-latest, etc.)

Copy link

@mheob mheob Apr 21, 2022

Choose a reason for hiding this comment

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

NVM does not support latest.
So if you use a .nvmrc file, like here described, latest is not an option.

From the nvm docs:

  • node: this installs the latest version of node
  • iojs: this installs the latest version of io.js
  • stable: this alias is deprecated, and only truly applies to node v0.12 and earlier. Currently, this is an alias for node.
  • unstable: this alias points to node v0.11 - the last "unstable" node release, since post-1.0, all node versions are stable. (in SemVer, versions communicate breakage, not stability).

I would prefer to use the same aliases as NVM.

But I understand your thoughts on this.

bluelovers and others added 2 commits April 22, 2022 02:41
Co-authored-by: Alexander Böhm <3983539+mheob@users.noreply.github.com>
@bluelovers bluelovers force-pushed the pr/nvm-latest-node-001 branch from c5d261e to 91bdfe3 Compare April 21, 2022 18:44
@bluelovers
Copy link
Author

Hi @bluelovers,

This branch has conflicts with the main branch, so could you please resolve it. Also, you need to run npm build, to update the content of the /dist folder. There are some small spacing mistakes in the version.yaml workflow so can you please fix that as well.

Cheers

i can't build it from my env, so if can, can u build it afiter merge?

@panticmilos
Copy link
Contributor

Hi @bluelovers,

Right now I am working on this feature. My PR will be really similar to yours, with some additional stuff added, so I will prepare everything.

Cheers

@dmitry-shibanov
Copy link
Contributor

Hello everyone. Support for node alias was added. For now I'm going to close the issue. If you have any concerns feel free to ping us.

@zdm
Copy link

zdm commented May 16, 2022

I got error.

Invalid workflow file
The workflow is not valid. .github/workflows/build.yaml (Line: 26, Col: 23): Unexpected value 'current'

``
....`
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
architecture: [x64]
node-version: current
name: build on ${{ matrix.os }} ${{ matrix.architecture }} node ${{ matrix.node-version }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.architecture }}
...

@zdm
Copy link

zdm commented May 16, 2022

Same error if node-version: [current]

@dmitry-shibanov
Copy link
Contributor

Hello @zdm. I've tried to use this snippet, but it works as expected.

    - name: Setup Node
      uses: actions/setup-node@v3
      with:
        node-version: current
        architecture: x64

Could you please share a link to the public repository to reproduce the issue.

@zdm
Copy link

zdm commented May 16, 2022

try matrix, pls

@zdm
Copy link

zdm commented May 16, 2022

error is when node-version: current used in matrix

@dmitry-shibanov
Copy link
Contributor

@zdm I've tried this one and everything works as expected:

jobs:          
  test-setup-node:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]
        version: [current, latest, node]
    steps:
    - name: Checkout repository
      uses: actions/checkout@v3
    - run: node --version
    - name: Setup Node
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.version }}
        architecture: x64
    - run: node --version

@zdm
Copy link

zdm commented May 16, 2022

ah, sorry, this is my mistake, array is required, i was confused by your example
sorry again

deining pushed a commit to deining/setup-node that referenced this pull request Nov 9, 2023
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.8.2 to 10.9.1.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](TypeStrong/ts-node@v10.8.2...v10.9.1)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants