-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add built storybooks to official storybook #2958
Merged
tmeasday
merged 6 commits into
master
from
tmeasday/add-built-storybooks-to-official-storybook
Feb 15, 2018
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9fcdb6a
Add a story pointing at the front page of each built storybook.
tmeasday c13fe0d
Move the chromatic test in with the other example tests
tmeasday 216043e
Add polymer to build
tmeasday 02dd733
Add snapshots for new app stories
tmeasday 05c1a36
Merge branch 'master' into tmeasday/add-built-storybooks-to-official-…
Hypnosphi cc46530
Merge branch 'master' into tmeasday/add-built-storybooks-to-official-…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../angular-cli/storybook-static | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../cra-kitchen-sink/storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../polymer-cli/storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../vue-kitchen-sink/storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
examples/official-storybook/stories/__snapshots__/app-acceptance.stories.storyshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Storyshots App|acceptance angular-cli 1`] = ` | ||
<iframe | ||
src="/angular-cli/index.html" | ||
style="border:0;position:absolute;top:0;left:0;width:100vw;height:100vh" | ||
title="angular-cli" | ||
/> | ||
`; | ||
|
||
exports[`Storyshots App|acceptance cra-kitchen-sink 1`] = ` | ||
<iframe | ||
src="/cra-kitchen-sink/index.html" | ||
style="border:0;position:absolute;top:0;left:0;width:100vw;height:100vh" | ||
title="cra-kitchen-sink" | ||
/> | ||
`; | ||
|
||
exports[`Storyshots App|acceptance polymer-cli 1`] = ` | ||
<iframe | ||
src="/polymer-cli/index.html" | ||
style="border:0;position:absolute;top:0;left:0;width:100vw;height:100vh" | ||
title="polymer-cli" | ||
/> | ||
`; | ||
|
||
exports[`Storyshots App|acceptance vue-kitchen-sink 1`] = ` | ||
<iframe | ||
src="/vue-kitchen-sink/index.html" | ||
style="border:0;position:absolute;top:0;left:0;width:100vw;height:100vh" | ||
title="vue-kitchen-sink" | ||
/> | ||
`; |
26 changes: 26 additions & 0 deletions
26
examples/official-storybook/stories/app-acceptance.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { withNotes } from '@storybook/addon-notes'; | ||
|
||
// For these stories to work, you must build the static version of the | ||
// example storybooks *before* running this storybook. | ||
|
||
const chapter = storiesOf('App|acceptance', module); | ||
|
||
const style = { | ||
border: 0, | ||
position: 'absolute', | ||
top: 0, | ||
left: 0, | ||
width: '100vw', | ||
height: '100vh', | ||
}; | ||
|
||
['cra-kitchen-sink', 'vue-kitchen-sink', 'angular-cli', 'polymer-cli'].forEach(name => { | ||
chapter.add( | ||
name, | ||
withNotes(`You must build the storybook for the ${name} example for this story to work.`)( | ||
() => <iframe style={style} title={name} src={`/${name}/index.html`} /> | ||
) | ||
); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just symlinked the built projects into the static directory of this storybook instead of needing to run a HTTP server for those files or importing them with a
file://
(which I guess is conceptually what it does right now).