es-tooling / ecosystem-cleanup

A place to keep track of ongoing efforts to clean up the JS ecosystem
405 stars 2 forks source link

Reduce npm cli (`npm`) dependency count #64

Open AbhiPrasad opened 4 months ago

AbhiPrasad commented 4 months ago

https://www.npmjs.com/package/npm

https://npmgraph.js.org/?q=npm

It's a lot. At current time of creating the issue it's 55 MB / 185 deps.

I think there is opportunity for us to slowly go in and modernize everything.

For example, https://github.com/npm/cacache has a bunch of stale dependabot PRs that would help reduce the dep count.

AbhiPrasad commented 4 months ago

first change I'm looking at is with cacache, specifically eliminating p-map to prevent it from bringing in aggregate-error. This was driven by my desire to improve semantic-release as well: https://github.com/npm/cacache/pull/281

AbhiPrasad commented 4 months ago

Well the cacache change was shot down unfortunately! https://github.com/npm/cacache/pull/281#issuecomment-2203322406

It seems like npm cli changes will be harder than expected! It might not be feasible to switch glob for example as well.

43081j commented 4 months ago

Bumping the engines version would possibly let you get rid of aggregate error at least

I would ask them how likely it is that kind of change would be accepted. And what they intend to do about an esm only dependency

SuperchupuDev commented 4 months ago

Removing util-deprecate from postcss-selector-parser shouldn't hard to do and it would be a small win for npm's dependency count https://npmgraph.js.org/?q=npm#select=exact%3Autil-deprecate%401.0.2 (relevant: postcss/postcss-selector-parser#210) image