-
Notifications
You must be signed in to change notification settings - Fork 133
fix: replace deprecated node FS prop W-19160014 #1607
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
Conversation
@@ -23,7 +23,7 @@ const registriesFromPresets = fs | |||
.filter((file) => !file.name.endsWith('CustomLabelsBeta.json')) | |||
.map((file) => ({ | |||
name: file.name, | |||
registry: JSON.parse(fs.readFileSync(path.join(file.path, file.name), 'utf-8')) as MetadataRegistry, | |||
registry: JSON.parse(fs.readFileSync(path.join(file.parentPath, file.name), 'utf-8')) as MetadataRegistry, |
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 previous path
prop was deprecated in node v18,20 and 21 then removed in v24:
https://nodejs.org/docs/latest-v22.x/api/fs.html#direntpath
parentPath
is supported on node >= 18.20.0 so it's safe to use
@@ -1,4 +1,5 @@ | |||
{ | |||
"devDepOverrides": ["mocha"], |
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.
mocha v10 has a bug when loading TS files via a node loader:
mochajs/mocha#5314
after fixing the types in SDR we still get those wrong warnings:
this change overrides the version of mocha provided by dev-scripts so we can use mocha v11 here, see:
https://github.com/forcedotcom/dev-scripts/?tab=readme-ov-file#config-file-notes
related:
oclif/core#1416
@@ -209,5 +210,8 @@ | |||
}, | |||
"publishConfig": { | |||
"access": "public" | |||
}, | |||
"resolutions": { | |||
"@types/node": "18.19.123" |
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.
we bumped these types in dev-script: forcedotcom/dev-scripts#388
but there's another @types/node
for node v20 coming as a peerDep from commitlint deps, we'll override it here as a workaround until we drop node v18.
What does this PR do?
Fixes issues blocking tests from being run in node v24:
@W-19160014@