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

Framework name is not stripped in terminal log #8

Open
fi3ework opened this issue May 21, 2024 · 5 comments
Open

Framework name is not stripped in terminal log #8

fi3ework opened this issue May 21, 2024 · 5 comments
Labels
first party enhancement Can not aligned with first party builder/framework of Storybook

Comments

@fi3ework
Copy link
Member

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

@fi3ework fi3ework added the first party enhancement Can not aligned with first party builder/framework of Storybook label May 21, 2024
@tmkx
Copy link
Contributor

tmkx commented Jun 21, 2024

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

@fi3ework
Copy link
Member Author

fi3ework commented Jun 21, 2024

@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
Copy link
Contributor

tmkx commented Jun 21, 2024

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.

@fi3ework
Copy link
Member Author

fi3ework commented Jun 21, 2024

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
Copy link
Contributor

tmkx commented Jun 21, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first party enhancement Can not aligned with first party builder/framework of Storybook
Projects
None yet
Development

No branches or pull requests

2 participants