update-db icon indicating copy to clipboard operation
update-db copied to clipboard

[feature request] Add support for the bun package manager

Open eelkevdbos opened this issue 2 years ago • 4 comments

Executing bunx update-browserslist-db@latest results in the following error:

update-browserslist-db: No lockfile found. Run "npm install", "yarn install" or "pnpm install"

Bun uses a binary lockfile called bun.lockb and at the time of writing has no built-in method yet to update individual packages.

eelkevdbos avatar Oct 11 '23 15:10 eelkevdbos

Sure, please send PR.

Just be sure that you are updating all nested dependencies.

ai avatar Oct 11 '23 15:10 ai

I'm working on a draft PR and will post back as soon as I have a working setup.

eelkevdbos avatar Oct 11 '23 16:10 eelkevdbos

Hey! Any update on this issue? @eelkevdbos

alec-c4 avatar Apr 16 '24 15:04 alec-c4

Appears to be blocked by oven-sh/bun#6419

hbibel avatar Apr 23 '24 09:04 hbibel

Bun now supports it! https://github.com/oven-sh/bun/issues/6419#issuecomment-2179541513

ftzi avatar Jun 26 '24 15:06 ftzi

I need some Bun user to send PR. Here is what you need to do:

  1. Add Bun detection here https://github.com/browserslist/update-db/blob/main/index.js#L41-L57
  2. Add caniuse-lite latest version extraction here https://github.com/browserslist/update-db/blob/main/index.js#L63-L79
  3. Add caniuse-lite update CLI call like this https://github.com/browserslist/update-db/blob/main/index.js#L288-L289
  4. Add tests to text/fixtures and call them from test/index.test.js.

ai avatar Jun 26 '24 15:06 ai

Bun support added with 1.1. Thanks to @pornoiya and @kytta.

Note 2 limits:

  1. You need to have npm to get latest caniuse-lite version.
  2. It will add caniuse-lite to dependencies. https://github.com/browserslist/update-db/issues/42

We created issues in Bun repo to fix these limits.

ai avatar Jul 02 '24 22:07 ai