storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.51k stars 9.14k forks source link

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

Open valentinpalkovic opened 1 month ago

valentinpalkovic commented 1 month ago

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.

- [ ] Implement a new `BunProxy`. Take a look, how, for example, the PNPMProxy was implemented (https://github.com/storybookjs/storybook/blob/next/code/lib/core-common/src/js-package-manager/PNPMProxy.ts)
- [ ] Adjust the JsPackageManagerFactory.getPackageManager to return a new BunProxy (https://github.com/storybookjs/storybook/blob/next/code/lib/core-common/src/js-package-manager/JsPackageManagerFactory.ts#L24)

Acceptance criteria

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

Additional context

No response

valentinpalkovic commented 1 month ago

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

rhuanbarreto commented 1 month ago

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

lucadibello commented 1 month ago

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

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

rhuanbarreto commented 4 weeks ago

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 commented 3 weeks ago

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.