-
Notifications
You must be signed in to change notification settings - Fork 237
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
Support for the new Node LTS (version 20) #2363
Conversation
a8681db
to
dab78c4
Compare
9da8dbd
to
531f199
Compare
285b891
to
4eb6041
Compare
lib/plugins/plugin-validator.spec.js
Outdated
@@ -43,6 +43,13 @@ describe('plugin-validator', () => { | |||
}) | |||
|
|||
describe('unexpected keys', () => { | |||
afterEach(() => { | |||
// prevent the process exitcode of 100 from failing the tests in the CI |
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.
The comment describes the code but not the reason. What does exit code 100 mean and why do we need to avoid that failing the CI?
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.
Please see here where the test fails in the CI: https://github.com/alphagov/govuk-prototype-kit/actions/runs/6668446182/job/18124028349
The tests actually pass, but the action fails due to the process completing with exit code 100
The exit code 100 is set in the code and now that we have moved to node 20, the unit tests fail when we don't unset it from 100
The fix in the tests was the only way I could get this to pass.
This PR drops support for 16 which we shouldn't be doing. We should be adding support for 20 without dropping support for 16. We should also go back to using a specific version in our |
Hope this is useful, but you'll probably want Node.js v20.x rather than v20.9.0 or you'll miss new releases: - lts/*
+ lts/iron We've just completed our GOV.UK Frontend switch to Node.js 20 Snags wise, Dependabot is still using Node.js 18 which caught us out today: But otherwise all our tooling blockers were completed and I've added notes for asdf or nvm gotchas |
Bear in mind too that you're still on the legacy Similar to how Node.js 18 shipped with npm v8 but later npm v9, watch out for this to become an issue: |
With the version - I think it's important that we specify the version in |
That's fair, don't forget your matrix:
node-version: [16.x, 18.x, 20.x] |
@@ -14,11 +14,13 @@ describe('plugin-validator', () => { | |||
|
|||
beforeEach(() => { | |||
const mockFileSystemRoot = path.join(process.cwd(), 'example-plugin') | |||
const exitCodeSetterSpy = jest.spyOn(process, 'exitCode', 'set').mockImplementation(() => {}) |
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.
🙌
3d7a7e8
to
4626a91
Compare
7c6c7dd
to
b28ffe1
Compare
As the current LTS version of node.js is 20 and the maintenance version is 18, we should reflect that within the protoype kit.
See here for the current LTS version: https://nodejs.org/en/download