-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix: removed recursive-copy module from the production dependency #1265
Conversation
bf78260
to
f574ec6
Compare
9640821
to
35be99a
Compare
bd07e06
to
c7728c3
Compare
c7728c3
to
b988d7e
Compare
refs #848 Maybe its worth adding a task to the v4 release to replace fs-extra with the native fs.cp? |
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.
Thanks for taking care of this. Added some comments 👍
78f1a60
to
eeb4897
Compare
eeb4897
to
b7a9df6
Compare
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.
Commit suggestion
fix(shared-metrics): removed recursive-copy dependency #1265
refs ...
- resolves the following warning:
. "npm WARN deprecated [email protected]: This module is not supported and has memory leaks. Avoid using it. Consider lru-cache for a more robust and tested solution for coalescing async requests by key value."
The module recursive-copy currently has inflight(deprecated) as a subdependency, which triggers following npm warnings during the installation of our collector.
To resolve this issue, we are removing recursive-copy from our production dependencies and will instead use fs-extra, which is a drop-in replacement for the native fs module. All methods in fs are included in fs-extra.
While I generally prefer to avoid external libraries and additional dependencies, and would prefer to copy directories recursively using native fs methods, the fs.cp function was not available in earlier versions of Node.js 16.
Note: fs.cp and fsPromises.cp, which can copy directories, are available in Node v16.7.0. However, since we also support Node v14, we will not use these methods at this time. Instead, we’ll implement a custom solution using fs-extra methods to ensure compatibility with our existing Node.js versions. In the next major version we can consider to replace it with native fs.cp method. The syntax is very similar.
Reasons to choose fs-extra:
fs
module, making migration straightforward.refs : INSTA-12493