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

Addon-docs: Apply transformSource to any SourceType #12375

Merged
merged 4 commits into from
Sep 10, 2020

Conversation

phated
Copy link
Contributor

@phated phated commented Sep 3, 2020

Issue: N/A

What I did

I made the transformSource function (if specified) apply to all SourceType snippets.

While trying to modify the snippets produced for SourceType.DYNAMIC, I noticed that the transformSource option was only being applied to SourceType.CODE snippets. This seems to be due to it being called inside enhanceSource, but the SourceType refactoring came after, so I think it got missed in the shuffle.

How to test

  • Is this testable with Jest or Chromatic screenshots? I don't think so, I see some other refactors that can happen with enhanceSource and then things can be tested together.
  • Does this need a new example in the kitchen sink apps? I believe the kitchen sink app will get these through it's transformSource config.
  • Does this need an update to the documentation? Nope, the recipe actually makes it sound like this is globally called already.

If your answer is yes to any of these, please make sure to include it in your PR.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Looks great! Can you add an official-storybook example in Addons/Docs to demo this?

@phated
Copy link
Contributor Author

phated commented Sep 9, 2020

Yep! I'll put one together now 😄

@phated phated requested a review from usulpro as a code owner September 10, 2020 00:45
@phated phated requested a review from shilman September 10, 2020 00:46
@phated
Copy link
Contributor Author

phated commented Sep 10, 2020

All set! Here's a screenshot of what this looks like in the official-storybook!
Screen Shot 2020-09-09 at 5 49 15 PM

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

the string values are not capitalized 😭

Co-authored-by: Michael Shilman <shilman@users.noreply.github.com>
@phated
Copy link
Contributor Author

phated commented Sep 10, 2020

Whoops, sorry about that. I've applied your suggestions!

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

🙌

@shilman shilman changed the title Addon-docs: Apply transformSource to any SourceType if it is specified Addon-docs: Apply transformSource to any SourceType Sep 10, 2020
@shilman shilman merged commit c20fa15 into storybookjs:next Sep 10, 2020
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.

2 participants