storybook: [Bug]: Support bun as a package manager
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.
- [x] 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)
- [x] 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
- install Storybook
- upgrade Storybook
- run Storybook’s automigrations
- run and build Storybook
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 49
- Comments: 26 (9 by maintainers)
Hi @darklight9811
A closed issue doesn’t necessarily mean that it is already part of the latest stable release. We close issues automatically as soon as the related PR is merged. You can see here that it is part of the latest pre-release. Therefore, please try to run
bunx storybook@ 8.5.0-alpha.2 init —package-manager=buninstead.This PR actually looks pretty promising. It is a community PR which I have continued on and finalized.
I have tested:
initin a vue3 projectupgradefrom 8.4.0-beta.0 to 0.0.0-pr-29267-sha-1523974daddcommand to add a Storybook addonPlease feel free to test out the canary release:
0.0.0-pr-29267-sha-1523974d.I have even tested running Storybook via the bun runtime, and both the
devandbuildcommands worked successfully in a vue3 example project.It is likely that we will introduce bun package manager support and bun runtime support in Storybook 8.5.
Please check out the PR above and try out the canary release. Let us know if things are still buggy.
@valentinpalkovic Is this still open?
Hi team, any update on this?
I only hope to use storybook under the project managed by the bun. Is there any solution to achieve this, even if it’s lame. Thanks.
@valentinpalkovic @rhuanbarreto I went ahead and created a PR that would demonstrate what i meant on the previous comment.
Could you try out
bun add storybook@0.0.0-pr-29267-sha-1523974dbunx storybook@0.0.0-pr-29267-sha-1523974d initbunx storybook/0.0.0-pr-29267-sha-1523974d init --package-manager=buninstead?
I haven’t tried to
initin an empty directory so far, but only into an existing project.In the meantime, I think we could rely on
npm infoandnpm listand other stuff from npm as a fallback until Bun implements this feature. What are your thoughts?Thanks for pointing out the way! Will have a look at it tonight!