Open Jarred-Sumner opened 11 months ago
Note Yarn Classic (v1) and Yarn Berry (v2+) uses completely different lockfile formats. Is this tracking both?
Looking forward to this. We tried to do yarn.lock -> package-lock.json -> bun. But we lost too much context and couldn't build the apps.
This would be amazing and help us incrementally adopt bun
Note Yarn Classic (v1) and Yarn Berry (v2+) uses completely different lockfile formats. Is this tracking both?
This is tracking Yarn v1 because npm download stats suggest more people use it.
@Jarred-Sumner, you cannot rely on npm download stats. Here's why:
https://twitter.com/wojtekmaj91/status/1679944016941527040
This is an extremely bad way of comparing package managers popularity.
- Package managers updated more often will get downloaded more often by the same users.
- Yarn Berry used to sit inside the repo in .yarn/releases. This resulted in one download per repo, and it wasn't from npm.
- Node Corepack doesn't use npm for all Yarn versions - see source code: https://github.com/nodejs/corepack/blob/main/config.json
My suggestion would be to count lockfiles and packageManager entries in package.json in OSS repositories instead. Of course, easier said than done.
Actually, this inspired me to measure package managers popularity it as accurately as possible. Here are the results.
https://dev.to/wojtekmaj/package-manager-wars-the-real-picture-e9p
I hope bun can add support for loading and writing Yarn v1 lock file directly, so we can use bun as a drop-in replacement for Yarn v1, because current workflow and keyboard muscle memory are not easily to change.
alias yarn='bun yarn-v1'
yarn install # CRUD the yarn.lock file
I think Yarn v1 stills has large users, see the Yarn v4 document Migrating from 1.x / npm, and Alpine Linux only pack Yarn v1.
I don't like Yarn v4, it makes a package manager so complex, they don't release a standalone binary for Yarn v4, it need you to use Corepack, a package manager depency another pacakge manger, it doesn't make sense.
When I use Yarn v1 to replace npm
as package manager, only a few reasons:
I don't need any advanced features like PnP, workspace, just need it downloads the package files fast.
@john-griffin You can now bun install package-lock.json if you are on bun canary. https://github.com/oven-sh/bun/issues/1751#issuecomment-1757253940
any progress here?( it is very strange that bun can print yarn.lock but cannot do reverse
Tracking issue following up from https://github.com/oven-sh/bun/issues/1751