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]: Found a 'github-flavored-markdown-mdx' migration even without mdx files in the project #22167

Closed
Stunext opened this issue Apr 19, 2023 · 6 comments · Fixed by #22186
Closed

Comments

@Stunext
Copy link

Stunext commented Apr 19, 2023

Describe the bug

There seems to be a bug where updating or running:

npx storybook@next automigrate

Always offers the migration to github-flavored-markdown-mdx even when there are no mdx or jsx files in the project; I'm talking about an EMPTY project. Storybook 7 is supposed to use MDX2 and no longer supports GFM and that you recommend installing it as a development dependency if you use its features. I wonder what features? How can I use MDX2 without GFM which should I avoid using? If it is assumed that the package isn't provided by default during migration, then the storybook can be used without it.

To Reproduce

New vite project

npm create vite@latest

Select react project.

npx storybook@latest init

This command does not trigger 'github-flavored-markdown-mdx' migration

Then:

npx storybook@next automigrate or npx storybook@latest upgrade

Found a 'github-flavored-markdown-mdx' migration, even if you delete all files in the project. How is this detected?

System

Environment Info:

  System:
    OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
  Binaries:
    Node: 19.8.1 - ~/.nvm/versions/node/v19.8.1/bin/node
    npm: 9.5.1 - ~/.nvm/versions/node/v19.8.1/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
  npmPackages:
    @storybook/addon-essentials: ^7.0.6 => 7.0.6 
    @storybook/addon-interactions: ^7.0.6 => 7.0.6 
    @storybook/addon-links: ^7.0.6 => 7.0.6 
    @storybook/blocks: ^7.0.6 => 7.0.6 
    @storybook/react: ^7.0.6 => 7.0.6 
    @storybook/react-vite: ^7.0.6 => 7.0.6 
    @storybook/testing-library: ^0.0.14-next.2 => 0.0.14-next.2

Additional context

No response

@shilman
Copy link
Member

shilman commented Apr 20, 2023

Looking at the code it's clear that this automigration always runs. @ndelangen @yannbf was this intentional? Do we want to gate it on the presence of MDX files in the project?

@L3au
Copy link

L3au commented Apr 21, 2023

+1 Same confusion here

@Stunext
Copy link
Author

Stunext commented Apr 22, 2023

This hint should only be displayed if you are using something from GFM and therefore should give compile errors. It is currently not understood what features you should not use to avoid GFM migration. The message also appears when you have several components created and with their MDX files; and the project works perfectly, therefore it is not clear why it is necessary if there is no problem.

@ndelangen
Copy link
Member

The message also appears when you have several components created and with their MDX files

That's correct, we made that choice, because we figured we'd play things defensively.. better to warn when there's nothing wrong than to not warn, and have users be frustrated and spend a lot of time figuring out that's wrong.

How would we determine if a user is or is not using GFM?

We CAN detect if MDX is used, and if not, skip the warning (that's what my PR here does: #22186 it just need to be reviewed, merged and released.

@shilman
Copy link
Member

shilman commented May 2, 2023

Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.12 containing PR #22186 that references this issue. Upgrade today to the @future NPM tag to try it out!

npx sb@next upgrade --tag future

@shilman
Copy link
Member

shilman commented May 3, 2023

Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.8 containing PR #22186 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb@latest upgrade

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

Successfully merging a pull request may close this issue.

4 participants