mattiasw/ExifReader

Custom build installs excessive dependencies

samhh opened this issue · 5 comments

samhh commented

Hi again! Something I've noticed is that the custom build causes exifreader to install not only the listed packages but also everything in its npm manifest. This is not only slower but also introduces flakiness in CI with dependencies like Cypress which fetch network resources. I messed about with npx -p but couldn't seem to get it to work, at least not in a modern Yarn environment.

ls
$ ls ./node_modules/exifreader/node_modules/
@aashutoshrathi
@ampproject
@babel
@colors
@cypress
@discoveryjs
@eslint
@eslint-community
@humanwhocodes
@isaacs
@istanbuljs
@jridgewell
@leichtgewicht
@nodelib
@pkgjs
@types
@ungap
@webassemblyjs
@webpack-cli
@xmldom
@xtuc
accepts
acorn
acorn-import-assertions
acorn-jsx
aggregate-error
ajv
ajv-formats
ajv-keywords
ansi-colors
ansi-escapes
ansi-html-community
ansi-regex
ansi-styles
anymatch
append-transform
arch
archy
argparse
array-buffer-byte-length
array-flatten
arraybuffer.prototype.slice
asn1
assert-plus
assertion-error
astral-regex
async
asynckit
at-least-node
available-typed-arrays
aws-sign2
aws4
babel-loader
babel-plugin-polyfill-corejs2
babel-plugin-polyfill-corejs3
babel-plugin-polyfill-regenerator
babel-plugin-rewire
balanced-match
base64-js
batch
bcrypt-pbkdf
big.js
binary-extensions
blob-util
bluebird
body-parser
bonjour-service
brace-expansion
braces
browser-stdout
browserslist
buffer
buffer-crc32
buffer-from
bytes
cachedir
caching-transform
call-bind
callsites
camelcase
caniuse-lite
caseless
chai
chalk
check-error
check-more-types
chokidar
chrome-trace-event
ci-info
clean-stack
cli-cursor
cli-table3
cli-truncate
cliui
clone-deep
color-convert
color-name
colorette
combined-stream
commander
common-tags
commondir
compressible
compression
concat-map
connect-history-api-fallback
content-disposition
content-type
convert-source-map
cookie
cookie-signature
core-js-compat
core-util-is
cross-env
cross-spawn
cypress
dashdash
dayjs
debug
decamelize
deep-eql
deep-is
default-gateway
default-require-extensions
define-data-property
define-lazy-prop
define-properties
delayed-stream
depd
destroy
detect-node
diff
dns-equal
dns-packet
doctrine
eastasianwidth
ecc-jsbn
ee-first
electron-to-chromium
emoji-regex
emojis-list
encodeurl
end-of-stream
enhanced-resolve
enquirer
envinfo
error-ex
es-abstract
es-module-lexer
es-set-tostringtag
es-to-primitive
es6-error
escalade
escape-html
escape-string-regexp
eslint
eslint-plugin-cypress
eslint-scope
eslint-visitor-keys
espree
esprima
esquery
esrecurse
estraverse
esutils
etag
eventemitter2
eventemitter3
events
execa
executable
express
extend
extract-zip
extsprintf
fast-deep-equal
fast-json-stable-stringify
fast-levenshtein
fastest-levenshtein
fastq
faye-websocket
fd-slicer
figures
file-entry-cache
fill-range
finalhandler
find-cache-dir
find-up
flat
flat-cache
flatted
follow-redirects
for-each
foreground-child
forever-agent
form-data
forwarded
fresh
fromentries
fs-extra
fs-monkey
fs.realpath
function-bind
function.prototype.name
functions-have-names
gensync
get-caller-file
get-func-name
get-intrinsic
get-package-type
get-stream
get-symbol-description
getos
getpass
glob
glob-parent
glob-to-regexp
global-dirs
globals
globalthis
gopd
graceful-fs
graphemer
handle-thing
has-bigints
has-flag
has-property-descriptors
has-proto
has-symbols
has-tostringtag
hasha
hasown
he
hosted-git-info
hpack.js
html-entities
html-escaper
http-deceiver
http-errors
http-parser-js
http-proxy
http-proxy-middleware
http-signature
human-signals
husky
iconv-lite
ieee754
ignore
import-fresh
import-local
imurmurhash
indent-string
inflight
inherits
ini
internal-slot
interpret
ipaddr.js
is-array-buffer
is-arrayish
is-bigint
is-binary-path
is-boolean-object
is-callable
is-ci
is-core-module
is-date-object
is-docker
is-extglob
is-fullwidth-code-point
is-glob
is-installed-globally
is-negative-zero
is-number
is-number-object
is-path-inside
is-plain-obj
is-plain-object
is-regex
is-shared-array-buffer
is-stream
is-string
is-symbol
is-typed-array
is-typedarray
is-unicode-supported
is-weakref
is-windows
is-wsl
isarray
isexe
isobject
isstream
istanbul-lib-coverage
istanbul-lib-hook
istanbul-lib-instrument
istanbul-lib-processinfo
istanbul-lib-report
istanbul-lib-source-maps
istanbul-reports
jackspeak
jest-worker
js-tokens
js-yaml
jsbn
jsesc
json-buffer
json-parse-better-errors
json-parse-even-better-errors
json-schema
json-schema-traverse
json-stable-stringify-without-jsonify
json-stringify-safe
json5
jsonfile
jsprim
keyv
kind-of
launch-editor
lazy-ass
levn
listr2
load-json-file
loader-runner
loader-utils
locate-path
lodash
lodash.debounce
lodash.flattendeep
lodash.merge
lodash.once
log-symbols
log-update
loupe
lru-cache
make-dir
media-typer
memfs
memorystream
merge-descriptors
merge-stream
methods
micromatch
mime
mime-db
mime-types
mimic-fn
minimalistic-assert
minimatch
minimist
minipass
mocha
ms
multicast-dns
nanoid
natural-compare
negotiator
neo-async
nice-try
node-forge
node-preload
node-releases
normalize-package-data
normalize-path
npm-run-all
npm-run-path
nyc
object-inspect
object-keys
object.assign
obuf
on-finished
on-headers
once
onetime
open
optionator
ospath
p-limit
p-locate
p-map
p-retry
p-try
package-hash
parent-module
parse-json
parseurl
path-exists
path-is-absolute
path-key
path-parse
path-scurry
path-to-regexp
path-type
pathval
pend
performance-now
picocolors
picomatch
pidtree
pify
pirates
pkg-dir
prelude-ls
pretty-bytes
process
process-nextick-args
process-on-spawn
proxy-addr
proxy-from-env
psl
pump
punycode
qs
querystringify
queue-microtask
randombytes
range-parser
raw-body
read-pkg
readable-stream
readdirp
rechoir
regenerate
regenerate-unicode-properties
regenerator-runtime
regenerator-transform
regexp.prototype.flags
regexpu-core
regjsparser
release-zalgo
request-progress
require-directory
require-from-string
require-main-filename
requires-port
resolve
resolve-cwd
resolve-from
restore-cursor
retry
reusify
rfdc
rimraf
run-parallel
rxjs
safe-array-concat
safe-buffer
safe-regex-test
safer-buffer
schema-utils
select-hose
selfsigned
semver
send
serialize-javascript
serve-index
serve-static
set-blocking
set-function-length
set-function-name
setprototypeof
shallow-clone
shebang-command
shebang-regex
shell-quote
side-channel
signal-exit
slice-ansi
sockjs
source-map
source-map-support
spawn-wrap
spdx-correct
spdx-exceptions
spdx-expression-parse
spdx-license-ids
spdy
spdy-transport
sprintf-js
sshpk
statuses
string-replace-loader
string-width
string-width-cjs
string.prototype.padend
string.prototype.trim
string.prototype.trimend
string.prototype.trimstart
string_decoder
strip-ansi
strip-ansi-cjs
strip-bom
strip-final-newline
strip-json-comments
supports-color
supports-preserve-symlinks-flag
tapable
terser
terser-webpack-plugin
test-exclude
text-table
throttleit
through
thunky
tmp
to-fast-properties
to-regex-range
toidentifier
tough-cookie
tslib
tunnel-agent
tweetnacl
type-check
type-detect
type-fest
type-is
typed-array-buffer
typed-array-byte-length
typed-array-byte-offset
typed-array-length
typedarray-to-buffer
typescript
unbox-primitive
undici-types
unicode-canonical-property-names-ecmascript
unicode-match-property-ecmascript
unicode-match-property-value-ecmascript
unicode-property-aliases-ecmascript
universalify
unpipe
untildify
update-browserslist-db
uri-js
url-parse
util-deprecate
utils-merge
uuid
validate-npm-package-license
vary
verror
watchpack
wbuf
webpack
webpack-cli
webpack-dev-middleware
webpack-dev-server
webpack-merge
webpack-sources
websocket-driver
websocket-extensions
which
which-boxed-primitive
which-module
which-typed-array
wildcard
workerpool
wrap-ansi
wrap-ansi-cjs
wrappy
write-file-atomic
ws
y18n
yallist
yargs
yargs-parser
yargs-unparser
yauzl
yocto-queue

Hi! That doesn't seem very optimal, no. 🤔 I will try to have a look later in the week.

Apparently it will always install what's in the package.json when any new package is installed, and there is no easy way to avoid it. So I had to do a hacky solution but it seems to work. I see 137 packages now instead of the 569 in your list.

I committed it to the same PR as the last issue and will merge them together.

Released as version 4.17.0.

samhh commented

Working a treat for both issues I raised, many thanks 🙂

Great!