Skip to content

Commit

Permalink
fix(shared-metrics): removed fs-extra dependency from production
Browse files Browse the repository at this point in the history
  • Loading branch information
aryamohanan committed Oct 7, 2024
1 parent ef623a1 commit 01e8f54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 40 deletions.
39 changes: 4 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/shared-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@
"@instana/core": "3.19.0",
"detect-libc": "^2.0.2",
"event-loop-lag": "^1.4.0",
"fs-extra": "^11.2.0",
"semver": "^7.5.4",
"tar": "^6.2.1"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"@types/tar": "^6.1.6"
},
"optionalDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions packages/shared-metrics/src/util/nativeModuleRetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const os = require('os');
const tar = require('tar');
const path = require('path');
const detectLibc = require('detect-libc');
const fse = require('fs-extra');

/**
* @typedef {Object} InstanaSharedMetricsOptions
Expand Down Expand Up @@ -188,8 +187,8 @@ function copyPrecompiled(opts, loaderEmitter, callback) {
`Copying the precompiled build for ${opts.nativeModuleName} ${label} from ${sourceDir} to ${targetDir}.`
);

fse
.copy(sourceDir, targetDir)
fs.promises
.cp(sourceDir, targetDir, { recursive: true })
.then(() => {
// We have unpacked and copied the correct precompiled native addon. The next attempt to require the
// dependency should work.
Expand Down

0 comments on commit 01e8f54

Please sign in to comment.