Skip to content

Have bun install respect/translate lockfiles from other package managers #1751

@trcio

Description

@trcio

What is the problem this feature would solve?

When trying to use bun install on an existing codebase, it is likely there would also exist a lock file generated by npm (package-lock.json) or yarn (yarn.lock).
Right now, running bun install on a codebase like this results in a potentially different dependency tree being resolved and installed.
To maintain consistent behavior in the application itself and to sweeten the deal when adopting bun, bun install should respect the dependency tree that has been previously resolved.

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

When running bun install for the first time on a codebase, it should check for the existence of various lockfiles.
If there already exists a bun.lockb file, no further steps are required.
If no bun.lockb is found, start checking for the other lock file types.
If any of those are found, bun should be able to parse it correctly and install the dependencies described by it - it can then save the tree in the bun.lockb format

What alternatives have you considered?

Writing a separate lockfile translator that can convert package-lock.jsons and yarn.locks into a bun.lockb format.
Certainly could prove useful for existing codebases that want to benefit from the offerings of bun

Integrating this as a step in the logic of bun install seems like the best route?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bun installSomething that relates to the npm-compatible clientenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions