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

Codemod: Convert module format to MDX #7418

Merged
merged 8 commits into from Jul 15, 2019
Merged

Codemod: Convert module format to MDX #7418

merged 8 commits into from Jul 15, 2019

Conversation

shilman
Copy link
Member

@shilman shilman commented Jul 15, 2019

Issue: #7101

What I did

  • Rename existing codemod to convert-storiesof-to-module
  • Add codemod to convert modules format stories to MDX
  • Add test cases + docs

How to test

yarn jest --testPathPattern=convert-module-to-mdx.test.js

Also:

./lib/cli/bin/index.js migrate convert-module-to-mdx --glob "examples/official-storybook/stories/**/*.stories.js" --rename js:mdx

@vercel
Copy link

vercel bot commented Jul 15, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-7101-mdx-format-codemod.storybook.now.sh

@shilman shilman changed the title Addon-docs: Convert module to MDX migration Addon-docs: Convert module format to MDX migration Jul 15, 2019
@shilman shilman changed the title Addon-docs: Convert module format to MDX migration Codemod: Convert module format to MDX Jul 15, 2019
@shilman shilman requested a review from tmeasday July 15, 2019 04:51
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good I guess? I don't really know the transform library well enough to read that code very meaningfully

return attrs;
}

// 1. If the program does not have `export default { title: '....' }, skip it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future would we have ways of setting the title from the component displayName?

@shilman shilman merged commit c33c4c2 into next Jul 15, 2019
@shilman shilman deleted the 7101-mdx-format-codemod branch July 15, 2019 11:18
@shilman shilman mentioned this pull request Jul 15, 2019
21 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 this pull request may close these issues.

None yet

2 participants