-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Migrate from rimraf
to NodeJS fs
#108
Conversation
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.
Removing rimraf
is great!
I'm neutral on promises-based fs
vs callbacks-based fs
. Neither has massively cleaner/more-readable syntax here, IMO. But this is fine as it is. It took me a moment to spot the .then()
and realize how the code flow was working, but looks good now that I noticed that. Tests are passing.
Other than suggesting the non-prefixed fsPromises
, I would be 👍 to merging this.
Co-authored-by: DeeDeeG <[email protected]>
(Getting sidetracked, feel free to skip this: To be honest, this entire file is suspect for being replaced with core (A long term "wishlist item" is to get rid of |
Thanks for taking a look at this one as well. And great catch on the import name. But yeah otherwise this one felt easy enough and could get rid of the whole dep. But you are totally right that I bet (maybe after a bump or two) we can remove But once tests are happy after all the changes we can go ahead and merge this one! |
[ EDIT: Okay, I guess it's just a network error. Probably a fluke, but updating
Maybe this is a fluke and never happens again. On the other hand, could be good to update the |
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.
Formally approving, but would recommend updating yarn.lock
in this PR or I might do a follow-up PR just to update that, since it's used by core repo to resolve the dependencies, and should stay in sync or else core repo will keep updating it on-the-fly all the time, defeating the point of the lockfile.)
I can push commit 53d3d5f to this branch if you want an updated |
@DeeDeeG if you'd like feel free to push it, otherwise I can get an update in within the next 30 minutes |
@confused-Techie done, I pushed the updated lockfile to this PR's branch just now. |
Thanks @DeeDeeG merging this one now then! |
In this repo we have the module dependency
rimraf
which is used in a singular location to bring unix like file deletions into the copy and move commands.With such little usage, it seemed easy enough to migrate this to the builtin NodeJS
fs
module'srm
method.After migrating that then means we are able to fully go ahead and remove the
rimraf
dependency from this repository completely.As for any concerns about the change, the options provided to
fs.rm
, according to the docs, will mimic Unixrm -rf
functionality. Which is quite literally the repo description ofrimraf
.