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 · 16 comments · May be fixed by #29267
Open
2 tasks

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

valentinpalkovic opened this issue Jun 10, 2024 · 16 comments · May be fixed by #29267

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.

@stephenjason89
Copy link

stephenjason89 commented Oct 2, 2024

My first findings:

My fork: next...rhuanbarreto:storybook:next?expand=1 (compare)

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

In the meantime, I think we could rely on npm info and npm list and other stuff from npm as a fallback until Bun implements this feature. What are your thoughts?

@yymm120
Copy link

yymm120 commented Oct 2, 2024

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.

@stephenjason89 stephenjason89 linked a pull request Oct 2, 2024 that will close this issue
8 tasks
@stephenjason89
Copy link

@valentinpalkovic @rhuanbarreto I went ahead and created a PR that would demonstrate what i meant on the previous comment.

@mimse
Copy link

mimse commented Oct 4, 2024

I love to be able to use bun with storybook, so if this could be fixed for the next release I would be so grateful ❤️

@Donal2
Copy link

Donal2 commented Oct 10, 2024

Hi team, any update on this?

@nhhockeyplayer
Copy link

angular NX storybook projects are affected as well

is storybook failing or can we ignore this log message

nx storybook shared-root-ui-widget             

> nx run shared-root-ui-widget:storybook

Storybook failed to check addon compatibility Error: Unable to find a usable package manager within NPM, PNPM, Yarn and Yarn 2
    at JsPackageManagerFactory.getPackageManager (/Users/meanstack02/meanstacknh/node_modules/@storybook/core/dist/common/index.cjs:143260:11)
    at getIncompatibleStorybookPackages (/Users/meanstack02/meanstacknh/node_modules/@storybook/core/dist/core-server/index.cjs:48358:58)
    at warnOnIncompatibleAddons (/Users/meanstack02/meanstacknh/node_modules/@storybook/core/dist/core-server/index.cjs:48391:17)
    at buildDevStandalone (/Users/meanstack02/meanstacknh/node_modules/@storybook/core/dist/core-server/index.cjs:48465:11)
    at async withTelemetry (/Users/meanstack02/meanstacknh/node_modules/@storybook/core/dist/core-server/index.cjs:47080:12)
info => Starting manager..
info => Starting preview..
info Addon-docs: using MDX3
info => Using implicit CSS loaders
info => Using angular browser target options from "shared-root-ui-widget:build-storybook"
info => Using angular project with "tsConfig:/Users/meanstack02/meanstacknh/libs/shared/root/ui-widget/.storybook/tsconfig.json"
info => Using default Webpack5 setup
<i> [webpack-dev-middleware] wait until bundle finished
WARN /Users/meanstack02/meanstacknh/libs/shared/root/ui-widget/.storybook/main.ts is part of the TypeScript compilation but it's unused.
WARN Add only entry points to the 'files' or 'include' properties in your tsconfig.
WARN DefinePlugin

@nhhockeyplayer
Copy link

nhhockeyplayer commented Oct 13, 2024

WARN Conflicting values for 'process.env.NODE_ENV'

@IEdiong
Copy link

IEdiong commented Oct 16, 2024

@valentinpalkovic Is this still open?

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

Successfully merging a pull request may close this issue.