-
Notifications
You must be signed in to change notification settings - Fork 106
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!: bump engines to Node.js >=22.12.0 #312
Conversation
d('* Replacing existing file'); | ||
await fs.remove(cachePath); | ||
|
||
if (!fs.existsSync(path.dirname(cachePath))) { |
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.
Note: this new clause is needed because fs.rename
will fail if the target directory doesn't exist, while fs.move
creates the directory.
This also doesn't work across disks, but we could catch the resulting error and fall back to an fs.copy
call if necessary.
@@ -109,8 +111,7 @@ describe('artifact-utils', () => { | |||
artifactName: 'electron', | |||
mirrorOptions: { | |||
mirror: 'https://mirror.example.com/', | |||
// eslint-disable-next-line @typescript-eslint/camelcase |
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.
Thank god
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.
LGTM, other than the declaration: true
change in tsconfig.json
that @erikian called out.
0f540cd adds declarations back and uses |
Sad, but good catch! |
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.
Excited to get this landed!
🎉 This PR is included in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
BREAKING CHANGE: bumps minimum Node.js version to >=22.12.0
ESM
Node.js 22.12 gives us the ability to use CommonJS
require
calls on ESM dependency graphs. This compatibility gives us the ability to migrate our libraries to ESM and maintain support for projects that are using CommonJS.Removal of deprecated APIs
@electron/get
already had a few deprecated APIs and this PR removes them since we're already making a breaking change anyways:nightly_mirror
option was removed (was deprecated in favour ofnightlyMirror
)force
option was removed (was deprecated in favour ofcacheMode=WriteOnly
).Test migration from Jest to Vitest
Jest currently has issues with
require(esm)
while it works out of the box with Vitest. We were already looking to migrate to Vitest across other Ecosystem repos, so this PR just switches over.vitest
(no globals)jest.mock
calls turned intovi
callstsconfig.json changes
We're now basing our TypeScript config off of
@tsconfig/node22
, which is a bit different from what we had in the past.Due to going ESM-only, we only have a singular
tsconfig.json
now.