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]: CSF-2-3 automigration scripts ignores Typescript types #20219

Closed
Tracked by #20674
valentinpalkovic opened this issue Dec 13, 2022 · 5 comments
Closed
Tracked by #20674

[Bug]: CSF-2-3 automigration scripts ignores Typescript types #20219

valentinpalkovic opened this issue Dec 13, 2022 · 5 comments
Assignees

Comments

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Dec 13, 2022

Describe the bug

The csf-2-3 automigration script does not transform StoryFn types to StoryObj.

Requirements:

  1. StoryFn type assignments should be replaced by StoryObj.
  2. The import has to be adjusted to import StoryFn instead of StoryObj

To Reproduce

  1. Create a Story, which imports StoryFn from "@storybook/" and use it for a Story.
export const Default: StoryFn = () => {...}
  1. Run the auto migration script
npx sb@next migrate csf-2-to-3 --glob="**/*.stories.ts" 
  1. The StoryFn type is not transformed to StoryObj
@valentinpalkovic
Copy link
Contributor Author

👆 fyi: @kasperpeulen

@kasperpeulen
Copy link
Contributor

Strange, I have used this script to transform all the CLI templates from CSF2 to CSF3 🤔

@kasperpeulen
Copy link
Contributor

Also tagging mr. @shilman

@shilman shilman added csf3 and removed needs triage labels Dec 13, 2022
@kasperpeulen
Copy link
Contributor

@valentinpalkovic I have the same issue. Not sure if this is a regression then.

@shilman
Copy link
Member

shilman commented Jan 17, 2023

Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.29 containing PR #20273 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

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

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

No branches or pull requests

3 participants