storybookjs / storybook

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

CSF3: Auto-title regression for PascalCase filenames #18039

Closed shilman closed 2 years ago

shilman commented 2 years ago

@spacecakes fixed in 6.5

Wow, that is convenient. Thank you very much!

The only issue I noticed with this is that story hoisting does not work for multi-word component names, because, say, CheckboxGroup.stories.js is gets processed into Checkbox Group for the story name, while the path remains as-is so they no longer match. So we get this:

Screenshot 2022-04-22 at 18 58 16

Not a dealbreaker by any means and I realise it's prelease software, but it would be nice if this worked to avoid nesting single-story components with this setup.

Originally posted by @spacecakes in https://github.com/storybookjs/storybook/issues/15376#issuecomment-1106696896

shilman commented 2 years ago

Thanks @spacecakes I must have broken this when I changed how auto-title handles file paths. Will fix before the release.

shilman commented 2 years ago

@valentinpalkovic These are the relevant PRs: https://github.com/storybookjs/storybook/pull/17597 https://github.com/storybookjs/storybook/pull/17574 https://github.com/storybookjs/storybook/pull/17421

Also, single-story hoisting (the feature that broke): https://github.com/storybookjs/storybook/issues/13251 and its implementation https://github.com/storybookjs/storybook/pull/13039

shilman commented 2 years ago

Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-beta.1 containing PR #18052 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

spacecakes commented 2 years ago

Huge thanks for this @shilman 🙏