Skip to content

Storybook/Export to CodeSandbox#19583

Merged
PeterDraex merged 74 commits into
microsoft:masterfrom
PeterDraex:storybook/export-to-codesandbox
Sep 29, 2021
Merged

Storybook/Export to CodeSandbox#19583
PeterDraex merged 74 commits into
microsoft:masterfrom
PeterDraex:storybook/export-to-codesandbox

Conversation

@PeterDraex

@PeterDraex PeterDraex commented Aug 31, 2021

Copy link
Copy Markdown
Contributor

Pull request checklist

Description of changes

This PR adds a "Open in CodeSandbox" button to each Storybook story, when viewed in Docs mode.

Most of the of that facilitates the export is in a Storybook addon, which has its own repository: https://github.com/PeterDraex/storybook-addon-export-to-codesandbox

For export to CodeSandbox to work properly, every story needs to be in its own file. This PR splits Button.stories.tsx so it could serve as an example to other component owners on how to create proper documentation.

TODO in other pull requests

must haves:

nice to haves:

  • When exporting dependencies, use versions from yarn.lock instead of <9.0.0-alpha.60/latest
  • Create a lint rule against relative import to stories (with exception for .md)
  • Enable theme switching

PeterDraex and others added 30 commits July 2, 2021 17:32
Comment thread .storybook/babel.plugin.js Outdated

@ling1726 ling1726 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested the documentation for:

  • Menu
  • Popover
  • Accordion
  • Button

Export works fine from what I can see 👍

Comment thread change/@fluentui-react-examples-292153ef-66f4-43d3-b6e7-8817fdcf814c.json Outdated
Comment thread packages/react-button/src/components/Button/ButtonDisabled.stories.tsx Outdated
@PeterDraex PeterDraex force-pushed the storybook/export-to-codesandbox branch from cc5a4db to 9f048b9 Compare September 17, 2021 21:42
@PeterDraex PeterDraex merged commit 8952fa6 into microsoft:master Sep 29, 2021
@PeterDraex PeterDraex deleted the storybook/export-to-codesandbox branch September 29, 2021 14:11
mlp73 pushed a commit to mlp73/fluentui that referenced this pull request Jan 17, 2022
Adds a "Open in CodeSandbox" button to stories in Storybook in Docs mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants