browserslist / update-db

CLI tool to update caniuse-lite to refresh target browsers from Browserslist config
https://browsersl.ist/
MIT License
286 stars 57 forks source link

[feature request] Add support for the bun package manager #25

Closed eelkevdbos closed 2 days ago

eelkevdbos commented 8 months ago

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.

ai commented 8 months ago

Sure, please send PR.

Just be sure that you are updating all nested dependencies.

eelkevdbos commented 8 months ago

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

alec-c4 commented 2 months ago

Hey! Any update on this issue? @eelkevdbos

hbibel commented 2 months ago

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

SrBrahma commented 1 week ago

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

ai commented 1 week ago

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 commented 1 day ago

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.