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]: The codemod mdx-to-csf wrongly generates empty story files #26130

Closed
Tracked by #25432
valentinpalkovic opened this issue Feb 21, 2024 · 0 comments · Fixed by #26164
Closed
Tracked by #25432

[Bug]: The codemod mdx-to-csf wrongly generates empty story files #26130

valentinpalkovic opened this issue Feb 21, 2024 · 0 comments · Fixed by #26164
Assignees
Milestone

Comments

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Feb 21, 2024

The mdx-to-csf codemod transforms the standard Storybook 6.5 introduction.stories.mdx file to two files:

  • introduction.mdx
  • introduction.stories.ts

The introduction.stories.ts doesn't have any component defined so it is obsolete.

Reproduction

  1. Checkout https://github.com/freeCodeCamp/freeCodeCamp
  2. Go to /tools/ui-components
  3. Run /Users/valentinpalkovic/Projects/storybook-next/code/lib/cli/bin/index.js migrate mdx-to-csf --glob "**/*.stories.mdx"
  4. Two files are generated: introduction.mdx and introduction.stories.ts are generated. introduction.stories.ts doesn't have valuable content though. The introduction.mdx file references a non-existent component in its <Meta ... /> definition.

Acceptance criteria

  • The codemod should not generate *.stories.ts files, if a component doesn't exist
  • The <Meta ... /> definition inside the generated *.mdx file should not reference a component that doesn't exist.
@vanessayuenn vanessayuenn added this to the 8.0-RC milestone Feb 22, 2024
@valentinpalkovic valentinpalkovic changed the title [Bug]: Codemod mdx-to-csf wrongly generates empty story files [Bug]: The codemod mdx-to-csf wrongly generates empty story files Feb 22, 2024
@valentinpalkovic valentinpalkovic linked a pull request Feb 26, 2024 that will close this issue
8 tasks
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.

3 participants