awslabs / aws-crt-nodejs

NodeJS bindings for the AWS Common Runtime.
Apache License 2.0
40 stars 26 forks source link

Reduce number of dependencies added by AWS CRT #333

Open trivikr opened 2 years ago

trivikr commented 2 years ago

Is your feature request related to a problem? Please describe.

Installing aws-crt@1.12.5 adds 118 dependencies in node_modules as shown below.

$ mkdir test-aws-crt && cd test-aws-crt

$ test-aws-crt> npm init -y && npm install aws-crt@1.12.5 --save-exact

$ test-aws-crt> find node_modules -type d -maxdepth 1 | wc -l
     118

$ test-aws-crt> ls -1 node_modules
@httptoolkit
@types
ansi
ansi-regex
are-we-there-yet
aws-crt
axios
balanced-match
base64-js
big-integer
binary
bl
bluebird
brace-expansion
buffer
buffer-from
buffer-indexof-polyfill
buffer-shims
buffers
camelcase
chainsaw
chownr
cliui
cmake-js
code-point-at
commist
concat-map
concat-stream
core-util-is
crypto-js
debug
decamelize
deep-extend
delegates
duplexer2
duplexify
end-of-stream
fastestsmallesttextencoderdecoder
follow-redirects
fs-extra
fs-minipass
fs.realpath
fstream
gauge
glob
graceful-fs
has-unicode
help-me
ieee754
inflight
inherits
ini
invert-kv
is-fullwidth-code-point
is-iojs
isarray
isexe
isomorphic-ws
js-sdsl
jsonfile
lcid
leven
listenercount
lodash
lodash.pad
lodash.padend
lodash.padstart
lru-cache
memory-stream
minimatch
minimist
minipass
minizlib
mkdirp
mqtt
mqtt-packet
ms
npmlog
number-allocator
number-is-nan
once
os-locale
path-is-absolute
process-nextick-args
pump
rc
readable-stream
reinterval
rfdc
rimraf
safe-buffer
semver
setimmediate
split2
splitargs
stream-shift
string-width
string_decoder
strip-ansi
strip-json-comments
tar
traverse
typedarray
universalify
unzipper
url-join
util-deprecate
which
window-size
wrap-ansi
wrappy
ws
xtend
y18n
yallist
yargs

This is blocking the AWS SDK for JavaScript (v3) from reducing the install size.

Describe the solution you'd like

Remove unnecessary dependencies from aws-crt

Describe alternatives you've considered

N/A

Additional context

trivikr commented 2 years ago

The size of node_modules is 30M:

$ test-aws-crt> du -sh node_modules 
 30M    node_modules
trivikr commented 2 years ago

It looks like the dependencies added under install script can be moved to devDependencies, as the script is only run in development.

Dependencies: