Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate / dedupe command for bun install #1343

Open
ArnaudBarre opened this issue Oct 17, 2022 · 2 comments
Open

Deduplicate / dedupe command for bun install #1343

ArnaudBarre opened this issue Oct 17, 2022 · 2 comments
Labels
bun install Something that relates to the npm-compatible client enhancement New feature or request

Comments

@ArnaudBarre
Copy link
Contributor

What is the problem this feature will solve?

Reduce the total number of installed dependencies after a adding/bumping a dependency.

Example:
First installed: module-a request esbuild ^0.15.7, module-b request esbuild ^0.15.8
esbuild v0.15.10 is installed

Few days later, bumping module-a, still request esbuild ^0.15.7
Both esbuild v0.15.10 and esbuild v0.15.11 are installed

What is the feature you are proposing to solve the problem?

Builtin version of https://github.com/scinos/yarn-deduplicate

We could also have installation algorithms that prioritise installed version over last available version (related to #118)

What alternatives have you considered?

On small projects, I delete the lock and start from a fresh install.
On larger project with tens of dependencies used in production, I keep using yarn so that I can safely bump a dev dependency and then deduplicate the install of esbuild for example without touching the exact version of my UI dependencies.

@ArnaudBarre ArnaudBarre added the enhancement New feature or request label Oct 17, 2022
@Electroid Electroid added the bun install Something that relates to the npm-compatible client label Nov 3, 2022
@ArnaudBarre ArnaudBarre changed the title Deduplicate command for bun install Deduplicate / dedpue command for bun install Jun 27, 2024
@ArnaudBarre ArnaudBarre changed the title Deduplicate / dedpue command for bun install Deduplicate / dedupe command for bun install Jun 27, 2024
@steinybot
Copy link

I can't seem to upgrade React because of this. I want to upgrade to 18.3.1 but something else is pulling in 18.2.0.

Having 2 reacts fails rather spectacularly with things like:
Screenshot 2024-08-06 at 2 45 02 PM

Writing the dependencies back out to yarn format has:

react@*, "react@0.14 - 18", react@>=16.0.0, react@>=16.11.0, react@>=16.13.1, react@>=16.8, react@>=16.8.4, react@>=16.9.0, "react@^16.13.1 || ^17.0.0 || ^18.0.0", "react@^16.8 || ^17 || ^18", "react@^16.8.0 || 17.x", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^16.9.0 || ^17", react@^18.2.0:
  version "18.2.0"
  resolved "https://registry.npmjs.org/react/-/react-18.2.0.tgz"
  integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
  dependencies:
    loose-envify "^1.1.0"

react@18.3.1, react@^18.3.1:
  version "18.3.1"
  resolved "https://registry.npmjs.org/react/-/react-18.3.1.tgz"
  integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
  dependencies:
    loose-envify "^1.1.0"

I don't understand why a package manager would do this (well not just one but all of them copy each others insane behaviour).

Dedupe should not be a command. There should be no duplicates in the first place.

@kravetsone
Copy link

A lot of types bugs i get with elysia or gramio.dev...

Please fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bun install Something that relates to the npm-compatible client enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants