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

[Bug]: Support bun as a package manager #28164

Open
2 tasks
valentinpalkovic opened this issue Jun 10, 2024 · 8 comments
Open
2 tasks

[Bug]: Support bun as a package manager #28164

valentinpalkovic opened this issue Jun 10, 2024 · 8 comments

Comments

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Jun 10, 2024

Describe the bug

Storybook supports npm, pnpm and yarn berry as package managers during installation, automigration, upgrade and startup. Adding support for Bun's package manager would be great since it allows a wide range of users to initialize, upgrade and automigrate Storybook in repositories using Bun as the package manager.

Tasks

Acceptance criteria

When Bun is used as a package manager, it should be possible to

  • install Storybook
  • upgrade Storybook
  • run Storybook's automigrations
  • run and build Storybook

Additional context

No response

@valentinpalkovic
Copy link
Contributor Author

Any kind of help would be appreciated and I can give guidance and support if necessary!

@rhuanbarreto
Copy link

Thanks for pointing out the way! Will have a look at it tonight!

@lucadibello
Copy link

Thanks for pointing out the way! Will have a look at it tonight!

If I can help in some way, let me know!

@rhuanbarreto
Copy link

My first findings:

My fork: https://github.com/storybookjs/storybook/compare/next...rhuanbarreto:storybook:next?expand=1

Bun doesn't support many json outputs for detecting package versions. Need to work more on this.

@luisalrp
Copy link

I don't now how, because i tried to use storybook myself into a nextjs bun boilerplate, but midday is staring to use storybook in their turborepo with bun and biome. I hope it helps some kind.

@valentinpalkovic
Copy link
Contributor Author

@rhuanbarreto Does it make sense to ignore this limitation for now and just continue on the parts which bun supports? Maybe we can find alternative approaches to read a package version for example.

@rhuanbarreto
Copy link

@valentinpalkovic I'm trying to follow the interface Storybook gives me in order to do the parsing. For all other package managers, there's a json output where you can parse the values. The supported plain text output rather than the binary format is a yarn v1 plain text that needs it's own parser.

I'm not saying it's not possible. But for working as a package manager, this part of parsing the lockfile is an issue that increases the complexity. Just need effort to make it work.

Once bun itself in the near future will support a more parseable output (hence the linked issue here), I don't think it's worth the effort (for me) to make it work until this change.

@rhuanbarreto
Copy link

One more thing. Bun still doesn't support many of the commands that the other package managers have in order to peek into the dependency tree. Is this a blocker? No. But increases the level of complexity by some orders of magnitude. I think Bun also need to help introducing more package manager commands into their own software so this can be solved easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants