-
-
Notifications
You must be signed in to change notification settings - Fork 399
refactor(tools): use fs.promises API #2282
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
@@ -2,7 +2,7 @@ | |||
|
|||
"use strict"; | |||
const colors = require("colors"); | |||
const fsp = require("fs-extra"); |
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 can remove fs-extra
from package.json now, right?
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.
copydeps
still uses fs-extra
for its own utility functions, but maybe we could cook our own ones.
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.
I checked. cp
is being used only for files (not directories), so we can use the native one easily. And we have fs.rmdir
and fs.unlink
for fsp.remove
🎉
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.
@saschanaz Do you plan to fix above here or separate PR?
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.
Hmm, maybe a separate one.
Should we update this too? |
Ah yes... but should we defer this until version 8 loses its support? Not sure. |
|
The API is introduced in Node.js 10, but yes, it will break 8. |
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.
This is in node lts, right?
Sure 😃 |
We should target active lts only. Ok to delete 8. |
One notable thing is that nodejs/node#26581 is not backported into 10 LTS yet, so using ReSpec there may emit some warnings. |
Like this... Looks like we should wait a bit more 😅
|
Lets pipe it through |
The warnings are ok IMO. Reading the history, the API did not change from when it was experimental to when it became stable... so technically, it was stable. Also, the warning don’t affect processing, so I think it’s fine to ship. |
Uses
fs.promises
which is now marked as stable.