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

docs: overview of compatible nodejs versions #2601

Open
Rotzbua opened this issue May 22, 2024 · 4 comments · May be fixed by #2602
Open

docs: overview of compatible nodejs versions #2601

Rotzbua opened this issue May 22, 2024 · 4 comments · May be fixed by #2602

Comments

@Rotzbua
Copy link
Contributor

Rotzbua commented May 22, 2024

Is your feature request related to a problem? Please describe.

The support docs states that the current LTS nodejs is supported.

For projects that are slower to upgrade the node version, it is difficult to find the correct sinon version, as the current LTS version is newer than the old one required by the projects. Currently it is difficult to find out which sinon version supports an old node version.

Describe the solution you'd like

Simple table which states which is the minimum supported node version for every mayor sinon version.

Sinon min Node
18 18
17 18

Describe alternatives you've considered

As alternative re-add and maintain engines attribute in package.json for upcoming releases. Was removed in #1608.

Additional context
nope

@fatso83
Copy link
Contributor

fatso83 commented May 27, 2024

Finding historic versions for Node is indeed a good case. I guess we could try to reflect this somehow. Maybe we should have a little unit test that checks the versions running on CI are the same ones listed. Not sure how to keep it in sync otherwise.

@Rotzbua Rotzbua linked a pull request May 28, 2024 that will close this issue
2 tasks
@fatso83
Copy link
Contributor

fatso83 commented Jun 4, 2024

Thanks for the PR. I supplied feedback on #2602 last week.

@Rotzbua
Copy link
Contributor Author

Rotzbua commented Jun 5, 2024

Thanks for the feedback.
I used the “supported” node versions from the Github test script.
If I understand your feedback correctly, this is not the node version for which it was explicitly built. It is instead based on the query maintained node versions from browserslistrc .
To find out which node version the release was built for, you need to check what the package-lock.json returns at the build time. It could even be that during a patch a mayor version of node is no longer supported.
Difficult to get it formally right. Actually, you would have to adapt the build script and publish the supported versions in the release or pin the supported versions and bump them with a mayor release....

@fatso83
Copy link
Contributor

fatso83 commented Jun 6, 2024

It's possible to automate like this in our pipeline. This is how to extract the major versions:

❯  echo "node 20.10.0" | awk '{split($2, a, "."); print a[1]} '
20

So this would be sufficient to get the Node versions supported during a build:

npx browserslist 'maintained node versions'  | awk '{split($2, a, "."); print a[1]} '
20
18

Do you want to have a stab at how this could be used to automate updating some table or similarly?

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 a pull request may close this issue.

2 participants