Skip to content

Commit

Permalink
feat: remove is-builtin-module (#2703)
Browse files Browse the repository at this point in the history
The node versions we support as per our engines constraint already have
a built in function for determining if a module is built in.

This removes the dependency and uses the built in function instead.
  • Loading branch information
43081j authored May 13, 2024
1 parent addd21d commit 2344d60
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
20 changes: 0 additions & 20 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions packages/artillery/lib/platform/aws-ecs/legacy/bom.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const fs = require('fs');
const A = require('async');

const isBuiltinModule = require('is-builtin-module');
const { isBuiltin } = require('node:module');
const detective = require('detective-es6');
const depTree = require('dependency-tree');

Expand Down Expand Up @@ -240,7 +240,7 @@ function getCustomJsDependencies(context, next) {
const npmPackages = requires
.filter(
(requireString) =>
!isBuiltinModule(requireString) && !isLocalModule(requireString)
!isBuiltin(requireString) && !isLocalModule(requireString)
)
.map((requireString) => {
return requireString.startsWith('@')
Expand Down
1 change: 0 additions & 1 deletion packages/artillery/lib/platform/aws-lambda/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ const createAndUploadLambdaZip = async (
'uninstall',
'dependency-tree',
'detective',
'is-builtin-module',
'try-require',
'walk-sync',
'esbuild-wasm',
Expand Down
1 change: 0 additions & 1 deletion packages/artillery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"eventemitter3": "^4.0.4",
"fs-extra": "^10.1.0",
"got": "^11.8.5",
"is-builtin-module": "^2.0.0",
"joi": "^17.6.0",
"js-yaml": "^3.13.1",
"jsonwebtoken": "^9.0.1",
Expand Down

0 comments on commit 2344d60

Please sign in to comment.