unjs / nypm

🌈 Unified Package Manager for Node.js (npm, pnpm, yarn), Bun and Deno
MIT License
517 stars 21 forks source link

util to dedup dependencies #166

Open OrbisK opened 4 days ago

OrbisK commented 4 days ago

Describe the feature

Follow up of: https://github.com/nuxt/cli/pull/573#issuecomment-2506061673

nypm should support dedupe.

Package manager support

npm

npm should have build in dedupe https://docs.npmjs.com/cli/v10/commands/npm-dedupe

pnpm

https://pnpm.io/cli/dedupe

yarn

https://yarnpkg.com/cli/dedupe

bun

planned: https://github.com/oven-sh/bun/issues/8594#issuecomment-2195796840

deno

?

Additional information

OrbisK commented 4 days ago

@danielroe I would implement it, but i am not sure how to handle not supporting bun and deno.

pi0 commented 4 days ago

For the first step, I think we can throw an error from dedupDependencies() / nypm dedup this way nuxi can fallback to a warning or prompt for alternatives.

In next step I like to introduce a util for upgrading deps with different options but that might take longer.

OrbisK commented 4 days ago

For the first step, I think we can throw an error from util / cli this way nuxi can fallback to a warning or prompt for alternatives.

In next step I like to introduce a util for upgrading deps with different options but that might take longer.

so i should start or wait for the upgrading? :)

pi0 commented 4 days ago

Feel free to start it will unblock nuxi :)