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

bun package manager: accept package.yaml instead package.json #7468

Closed
masterwendu opened this issue Dec 5, 2023 · 2 comments
Closed

bun package manager: accept package.yaml instead package.json #7468

masterwendu opened this issue Dec 5, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@masterwendu
Copy link

What is the problem this feature would solve?

json is not the perfect config file format. The most pain for me is that you cannot add comments.

YAML would be a much nicer option in my opinion and it has a similar structure like JSON. So a migration would be pretty fast.

benefits of a package.yaml as option:

  • add comments
  • faster to write config, because you don´t have to use " and {, }
  • multiline option
  • better overview of the file

disadvantages:

  • project with a package.yaml won´t have npm support anymore

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

bun install and bun add supports to work with package.yaml out of the box.

A plus would be if bun could also provide a json to yaml migration feature and visa versa (if I want to switch back to npm)

What alternatives have you considered?

package.toml would also be an option

@masterwendu masterwendu added the enhancement New feature or request label Dec 5, 2023
@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Dec 5, 2023

I definitely agree that json isn't perfect. It's missing features like comments and trailing commas. But syntax doesn't add enough value to justify the ecosystem cost of a decision like this. You could use a build tool that converts your package.toml or package.yaml into another format ahead of time into a package.json though

@Jarred-Sumner Jarred-Sumner closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2023
@hzamir
Copy link

hzamir commented May 30, 2024

pnpm supports package.yaml (though not perfectly it resolves and reads them). I would not like to go back. I know exactly why every package is included and generating package.jsons just in time is a bit of a pain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants