-
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
Open
erickzhao
wants to merge
12
commits into
main
Choose a base branch
from
node-22
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+2,512
−3,586
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
erickzhao
commented
Jan 11, 2025
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.
dsanders11
reviewed
Jan 15, 2025
erickzhao
changed the title
feat!: bump engines to Node.js 22
feat!: bump engines to Node.js >=22.12.0
Jan 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: bumps minimum Node.js version to >=22.12.0
Dependency upgrades
Node.js 22.12 gives us the ability to use CommonJS
require
calls on ESM dependency graphs. This gives us the ability to upgradegot
andenv-paths
past their last CJS version without using a dynamicawait import
, which isn't tenable in a few cases.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.skipLibCheck: true
was added due to an incompatibility withgot@14
.module: node16
andmoduleResolution: node16
.module: esnext
andmoduleResolution: node10
.See full git diff of output: erickzhao/get-diff-tester@8a04644
See tester code for output build: https://github.com/erickzhao/get-tester