rspack-contrib/storybook-rsbuild

Framework name is not stripped in terminal log

Opened this issue · 5 comments

The builder name log is verbose as shown below, which is much more verbose than Vite or webpack framework. There's a strip function https://github.com/storybookjs/storybook/blob/a5c7f7fd16643c3aa85fceb9149e3d2e83b9ef7d/code/lib/core-server/src/build-dev.ts#L216-L219 which only works with @storybook/name frameworks.

image

img_v3_02av_562a3eef-18b8-456f-ab5d-8ae3f61b7fbg

tmkx commented

it shows a full path because the framework option is from getAbsolutePath. it's okay if we use framework: 'storybook-react-rsbuild' instead of framework: getAbsolutePath('storybook-react-rsbuild')

image

https://github.com/storybookjs/storybook/blob/a5c7f7fd16643c3aa85fceb9149e3d2e83b9ef7d/code/lib/core-server/src/build-dev.ts#L81

@tmkx
Yes, it will. However, it's very prone to failed to find addons / builder / frameworks in a pnpm monorepo without a resolved dep path. (see how frequency getAbsolutePath is being used in Storybook https://github.com/search?q=repo%3Astorybookjs%2Fstorybook%20getAbsolutePath&type=code)

tmkx commented

I mean it works as expected in user's projects. it shows the full path in this repo only.

the users use 'storybook-react-rsbuild' directly, which doesn't have this issue.

It will show as expected in user project ONLY IF they don't use getAbsolutePath. But official's framework will show the neat name EVEN WITH getAbsolutePath.

tmkx commented

i see, this may occur in a monorepo which shares Storybook dependencies. agree with u that it's better to do something like frameworkName.split(/[\\/]/).at(-1) in storybook