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

Support yarn.lock in bun pm migrate #6409

Open
Jarred-Sumner opened this issue Oct 11, 2023 · 11 comments
Open

Support yarn.lock in bun pm migrate #6409

Jarred-Sumner opened this issue Oct 11, 2023 · 11 comments
Labels
bun install Something that relates to the npm-compatible client tracking An umbrella issue for tracking big features

Comments

@Jarred-Sumner
Copy link
Collaborator

Tracking issue following up from #1751

@Jarred-Sumner Jarred-Sumner added tracking An umbrella issue for tracking big features bun install Something that relates to the npm-compatible client labels Oct 11, 2023
@wojtekmaj
Copy link

Note Yarn Classic (v1) and Yarn Berry (v2+) uses completely different lockfile formats. Is this tracking both?

@john-griffin
Copy link

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.

@yharaskrik
Copy link
Contributor

This would be amazing and help us incrementally adopt bun

@Jarred-Sumner
Copy link
Collaborator Author

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.

@wojtekmaj
Copy link

wojtekmaj commented Oct 21, 2023

@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.

@wojtekmaj
Copy link

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

@muzuiget
Copy link

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:

  • download faster, download package files in mult-threads.
  • use global cache to void re-download the same file.
  • creat a lock file.

I don't need any advanced features like PnP, workspace, just need it downloads the package files fast.

@XenoWad01
Copy link

@john-griffin
You can now bun install package-lock.json if you are on bun canary. #1751 (comment)

@terion-name
Copy link

any progress here?( it is very strange that bun can print yarn.lock but cannot do reverse

@thanveershah
Copy link

Would love to know an update on this

@leolcao
Copy link

leolcao commented Nov 28, 2024

would love if bun support the yarn lockfile v2+(4.0+). Compare to yarn lockfile v1, the yarn.lock file doesn't include any registry information, so that lockfile is registry url independent.

yarn lockfile v1:

"@tsconfig/node16@^1.0.2":
  version "1.0.4"
  resolved "https://registry.npmmirror.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
  integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==

yarn lockfile v2+:

"@tsconfig/node16@npm:^1.0.2":
  version: 1.0.4
  resolution: "@tsconfig/node16@npm:1.0.4"
  checksum: 10c0/05f8f2734e266fb1839eb1d57290df1664fe2aa3b0fdd685a9035806daa635f7519bf6d5d9b33f6e69dd545b8c46bd6e2b5c79acb2b1f146e885f7f11a42a5bb
  languageName: node
  linkType: hard

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 tracking An umbrella issue for tracking big features
Projects
None yet
Development

No branches or pull requests

9 participants