From 493a1674b546620d8da94c35d6a26f6eecef6fb7 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 9 Jun 2017 01:20:04 +1200 Subject: [PATCH 01/14] Simple notes example --- examples/test-cra/.storybook/addons.js | 1 + examples/test-cra/package.json | 1 + examples/test-cra/src/stories/index.js | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/test-cra/.storybook/addons.js b/examples/test-cra/.storybook/addons.js index 6aed412d04af..47eabe0ce400 100644 --- a/examples/test-cra/.storybook/addons.js +++ b/examples/test-cra/.storybook/addons.js @@ -1,2 +1,3 @@ import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; +import '@storybook/addon-notes/register'; diff --git a/examples/test-cra/package.json b/examples/test-cra/package.json index a26cae7fe97a..0bcdb6c56d2a 100644 --- a/examples/test-cra/package.json +++ b/examples/test-cra/package.json @@ -19,6 +19,7 @@ "devDependencies": { "@storybook/addon-actions": "file:../../addons/actions", "@storybook/addon-links": "file:../../addons/links", + "@storybook/addon-notes": "file:../../addons/notes", "@storybook/addon-storyshots": "file:../../addons/storyshots", "@storybook/addons": "file:../../lib/addons", "@storybook/channel-postmessage": "file:../../lib/channel-postmessage", diff --git a/examples/test-cra/src/stories/index.js b/examples/test-cra/src/stories/index.js index e72f193c5e53..df2b8cbabda6 100644 --- a/examples/test-cra/src/stories/index.js +++ b/examples/test-cra/src/stories/index.js @@ -5,6 +5,7 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; +import { WithNotes } from '@storybook/addon-notes'; import Button from './Button'; import Welcome from './Welcome'; @@ -13,7 +14,11 @@ import ComponentWithRef from './ComponentWithRef'; storiesOf('Welcome', module).add('to Storybook', () => ); storiesOf('Button', module) - .add('with text', () => ) + .add('with text', () => + + + + ) .add('with some emoji', () => ); storiesOf('ComponentWithRef', module).add('basic', () => ); From 42328de95389f040a2e5738504f6aace4d62fe37 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 9 Jun 2017 01:34:53 +1200 Subject: [PATCH 02/14] Added addon-options to test-cra kitchen sink --- examples/test-cra/.storybook/addons.js | 1 + examples/test-cra/.storybook/config.js | 12 ++++++++++++ examples/test-cra/package.json | 1 + 3 files changed, 14 insertions(+) diff --git a/examples/test-cra/.storybook/addons.js b/examples/test-cra/.storybook/addons.js index 47eabe0ce400..310c49319d6a 100644 --- a/examples/test-cra/.storybook/addons.js +++ b/examples/test-cra/.storybook/addons.js @@ -1,3 +1,4 @@ import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; import '@storybook/addon-notes/register'; +import '@storybook/addon-options/register'; diff --git a/examples/test-cra/.storybook/config.js b/examples/test-cra/.storybook/config.js index 35430210ce65..cdf620e1941e 100644 --- a/examples/test-cra/.storybook/config.js +++ b/examples/test-cra/.storybook/config.js @@ -1,4 +1,16 @@ import { configure } from '@storybook/react'; +import { setOptions } from '@storybook/addon-options'; + +setOptions({ + name: 'Test-CRA', + url: 'https://github.com/storybooks/storybook/tree/master/examples/test-cra', + goFullScreen: false, + showLeftPanel: true, + showDownPanel: true, + showSearchBox: false, + downPanelInRight: true, + sortStoriesByKind: false, +}) function loadStories() { require('../src/stories'); diff --git a/examples/test-cra/package.json b/examples/test-cra/package.json index 0bcdb6c56d2a..4a2c3c24d4af 100644 --- a/examples/test-cra/package.json +++ b/examples/test-cra/package.json @@ -20,6 +20,7 @@ "@storybook/addon-actions": "file:../../addons/actions", "@storybook/addon-links": "file:../../addons/links", "@storybook/addon-notes": "file:../../addons/notes", + "@storybook/addon-options": "file:../../addons/options", "@storybook/addon-storyshots": "file:../../addons/storyshots", "@storybook/addons": "file:../../lib/addons", "@storybook/channel-postmessage": "file:../../lib/channel-postmessage", From a77b18237ede94a6b543d482f08bad829ec134e2 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 9 Jun 2017 02:45:10 +1200 Subject: [PATCH 03/14] Add info add-on to test-cra kitchen sink (NOT WORKING) --- examples/test-cra/.storybook/config.js | 5 ++++- examples/test-cra/package.json | 1 + examples/test-cra/src/stories/index.js | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/test-cra/.storybook/config.js b/examples/test-cra/.storybook/config.js index cdf620e1941e..8be5676c0061 100644 --- a/examples/test-cra/.storybook/config.js +++ b/examples/test-cra/.storybook/config.js @@ -1,5 +1,6 @@ -import { configure } from '@storybook/react'; +import { configure, setAddon } from '@storybook/react'; import { setOptions } from '@storybook/addon-options'; +import infoAddon from '@storybook/addon-info'; setOptions({ name: 'Test-CRA', @@ -12,6 +13,8 @@ setOptions({ sortStoriesByKind: false, }) +setAddon(infoAddon); + function loadStories() { require('../src/stories'); } diff --git a/examples/test-cra/package.json b/examples/test-cra/package.json index 4a2c3c24d4af..9790cc8c3f77 100644 --- a/examples/test-cra/package.json +++ b/examples/test-cra/package.json @@ -18,6 +18,7 @@ }, "devDependencies": { "@storybook/addon-actions": "file:../../addons/actions", + "@storybook/addon-info": "file:../../addons/info", "@storybook/addon-links": "file:../../addons/links", "@storybook/addon-notes": "file:../../addons/notes", "@storybook/addon-options": "file:../../addons/options", diff --git a/examples/test-cra/src/stories/index.js b/examples/test-cra/src/stories/index.js index df2b8cbabda6..8496285f030c 100644 --- a/examples/test-cra/src/stories/index.js +++ b/examples/test-cra/src/stories/index.js @@ -19,6 +19,9 @@ storiesOf('Button', module) ) - .add('with some emoji', () => ); + .add('with some emoji', () => ) + .addWithInfo('with some info', 'Use the info addon with its painful API.', () => + + ); storiesOf('ComponentWithRef', module).add('basic', () => ); From ffc8696ab69fec42684c9b82f33e28ce1a52cedd Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 9 Jun 2017 03:12:01 +1200 Subject: [PATCH 04/14] Add knobs to test-cra kitchen sink (NOT WORKING) Currently knobs show up, but editing the knobs does not update the URL properly --- examples/test-cra/.storybook/addons.js | 1 + examples/test-cra/package.json | 1 + examples/test-cra/src/stories/index.js | 14 +++++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/test-cra/.storybook/addons.js b/examples/test-cra/.storybook/addons.js index 310c49319d6a..d4b660893001 100644 --- a/examples/test-cra/.storybook/addons.js +++ b/examples/test-cra/.storybook/addons.js @@ -2,3 +2,4 @@ import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; import '@storybook/addon-notes/register'; import '@storybook/addon-options/register'; +import '@storybook/addon-knobs/register'; diff --git a/examples/test-cra/package.json b/examples/test-cra/package.json index 9790cc8c3f77..698fde3364d2 100644 --- a/examples/test-cra/package.json +++ b/examples/test-cra/package.json @@ -19,6 +19,7 @@ "devDependencies": { "@storybook/addon-actions": "file:../../addons/actions", "@storybook/addon-info": "file:../../addons/info", + "@storybook/addon-knobs": "file:../../addons/knobs", "@storybook/addon-links": "file:../../addons/links", "@storybook/addon-notes": "file:../../addons/notes", "@storybook/addon-options": "file:../../addons/options", diff --git a/examples/test-cra/src/stories/index.js b/examples/test-cra/src/stories/index.js index 8496285f030c..93e9b1ff6232 100644 --- a/examples/test-cra/src/stories/index.js +++ b/examples/test-cra/src/stories/index.js @@ -6,6 +6,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; import { WithNotes } from '@storybook/addon-notes'; +import { withKnobs, text, number } from '@storybook/addon-knobs'; import Button from './Button'; import Welcome from './Welcome'; @@ -14,12 +15,19 @@ import ComponentWithRef from './ComponentWithRef'; storiesOf('Welcome', module).add('to Storybook', () => ); storiesOf('Button', module) - .add('with text', () => + .addDecorator(withKnobs) + .add('with text', () => ) + .add('with some emoji', () => ) + .add('with notes', () => - + ) - .add('with some emoji', () => ) + .add('with knobs', () => { + const label = text('Label', 'Edit me in knobs panel'); + const num = number('Number', 1); + return ; + }) .addWithInfo('with some info', 'Use the info addon with its painful API.', () => ); From fd0dbec7eb669be41de193a774eb0858317b75e9 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 9 Jun 2017 04:42:44 +1200 Subject: [PATCH 05/14] Kitchen sink examples: centered + cra-storybook - add centered to test-cra - add all to cra-storybook --- examples/cra-storybook/.storybook/addons.js | 3 +++ examples/cra-storybook/.storybook/config.js | 17 ++++++++++++- examples/cra-storybook/package.json | 7 +++++- examples/cra-storybook/src/stories/index.js | 28 +++++++++++++++++---- examples/test-cra/package.json | 1 + examples/test-cra/src/stories/index.js | 5 ++++ 6 files changed, 54 insertions(+), 7 deletions(-) diff --git a/examples/cra-storybook/.storybook/addons.js b/examples/cra-storybook/.storybook/addons.js index 09eddda4c251..5c57d83ea6f9 100644 --- a/examples/cra-storybook/.storybook/addons.js +++ b/examples/cra-storybook/.storybook/addons.js @@ -1,3 +1,6 @@ import '@storybook/addon-actions/register'; import '@storybook/addon-links/register'; import '@storybook/addon-events/register'; +import '@storybook/addon-notes/register'; +import '@storybook/addon-options/register'; +import '@storybook/addon-knobs/register'; diff --git a/examples/cra-storybook/.storybook/config.js b/examples/cra-storybook/.storybook/config.js index 35430210ce65..8be5676c0061 100644 --- a/examples/cra-storybook/.storybook/config.js +++ b/examples/cra-storybook/.storybook/config.js @@ -1,4 +1,19 @@ -import { configure } from '@storybook/react'; +import { configure, setAddon } from '@storybook/react'; +import { setOptions } from '@storybook/addon-options'; +import infoAddon from '@storybook/addon-info'; + +setOptions({ + name: 'Test-CRA', + url: 'https://github.com/storybooks/storybook/tree/master/examples/test-cra', + goFullScreen: false, + showLeftPanel: true, + showDownPanel: true, + showSearchBox: false, + downPanelInRight: true, + sortStoriesByKind: false, +}) + +setAddon(infoAddon); function loadStories() { require('../src/stories'); diff --git a/examples/cra-storybook/package.json b/examples/cra-storybook/package.json index 29ba51e8cbf3..620a31050da6 100644 --- a/examples/cra-storybook/package.json +++ b/examples/cra-storybook/package.json @@ -20,8 +20,13 @@ }, "devDependencies": { "@storybook/addon-actions": "^3.0.0", - "@storybook/addon-links": "^3.0.0", + "@storybook/addon-centered": "^3.0.0", "@storybook/addon-events": "^3.0.0", + "@storybook/addon-knobs": "^3.0.0", + "@storybook/addon-info": "^3.0.0", + "@storybook/addon-links": "^3.0.0", + "@storybook/addon-notes": "^3.0.0", + "@storybook/addon-options": "^3.0.0", "@storybook/addons": "^3.0.0", "@storybook/react": "^3.0.0", "react-scripts": "1.0.1" diff --git a/examples/cra-storybook/src/stories/index.js b/examples/cra-storybook/src/stories/index.js index e6344a41bb90..9e0304d96b90 100644 --- a/examples/cra-storybook/src/stories/index.js +++ b/examples/cra-storybook/src/stories/index.js @@ -1,11 +1,13 @@ import React from 'react'; - import EventEmiter from 'eventemitter3'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; import WithEvents from '@storybook/addon-events'; +import { WithNotes } from '@storybook/addon-notes'; +import { withKnobs, text, number } from '@storybook/addon-knobs'; +import centered from '@storybook/addon-centered'; import Button from './Button'; import Welcome from './Welcome'; @@ -25,12 +27,28 @@ const emit = emiter.emit.bind(emiter); storiesOf('Welcome', module).add('to Storybook', () => ); storiesOf('Button', module) + .addDecorator(withKnobs) .add('with text', () => ) - .add('with some emoji', () => ); + .add('with some emoji', () => ) + .add('with notes', () => + + + + ) + .add('with knobs', () => { + const label = text('Label', 'Edit me in knobs panel'); + const num = number('Number', 1); + return ; + }) + .addWithInfo('with some info', 'Use the info addon with its painful API.', () => + + ); + +storiesOf('App', module).add('full app', () => ); -storiesOf('App', module) - .add('with text', () => ) - .add('with some emoji', () => ); +storiesOf('Centered Button', module) + .addDecorator(centered) + .add('with text', () => ); storiesOf('WithEvents', module) .addDecorator(getStory => diff --git a/examples/test-cra/package.json b/examples/test-cra/package.json index 698fde3364d2..db7c38ab4410 100644 --- a/examples/test-cra/package.json +++ b/examples/test-cra/package.json @@ -18,6 +18,7 @@ }, "devDependencies": { "@storybook/addon-actions": "file:../../addons/actions", + "@storybook/addon-centered": "file:../../addons/centered", "@storybook/addon-info": "file:../../addons/info", "@storybook/addon-knobs": "file:../../addons/knobs", "@storybook/addon-links": "file:../../addons/links", diff --git a/examples/test-cra/src/stories/index.js b/examples/test-cra/src/stories/index.js index 93e9b1ff6232..5d51d41f7eb6 100644 --- a/examples/test-cra/src/stories/index.js +++ b/examples/test-cra/src/stories/index.js @@ -7,6 +7,7 @@ import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; import { WithNotes } from '@storybook/addon-notes'; import { withKnobs, text, number } from '@storybook/addon-knobs'; +import centered from '@storybook/addon-centered'; import Button from './Button'; import Welcome from './Welcome'; @@ -32,4 +33,8 @@ storiesOf('Button', module) ); +storiesOf('Centered Button', module) + .addDecorator(centered) + .add('with text', () => ); + storiesOf('ComponentWithRef', module).add('basic', () => ); From 9c021e1b5b38ad33340b387a98a61f030791be21 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 9 Jun 2017 01:43:58 +0200 Subject: [PATCH 06/14] =?UTF-8?q?=F0=9F=92=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ActionLogger/index.js | 16 ++---------- .../src/components/ActionLogger/style.js | 2 +- addons/knobs/src/components/PropField.js | 2 +- addons/knobs/src/components/PropForm.js | 26 +++++++++++-------- addons/knobs/src/components/WrapStory.js | 2 +- addons/knobs/src/components/types/Number.js | 2 +- examples/cra-storybook/src/stories/index.js | 4 ++- 7 files changed, 24 insertions(+), 30 deletions(-) diff --git a/addons/actions/src/components/ActionLogger/index.js b/addons/actions/src/components/ActionLogger/index.js index 5c2566495ff0..76de8f0f477d 100644 --- a/addons/actions/src/components/ActionLogger/index.js +++ b/addons/actions/src/components/ActionLogger/index.js @@ -4,26 +4,14 @@ import Inspector from 'react-inspector'; import style from './style'; class ActionLogger extends Component { - componentDidUpdate() { - const latest = this.ref.latest; - if (latest) { - const borderLeft = style.action.borderLeft; - latest.style.borderLeft = 'solid 5px #aaa'; - setTimeout(() => { - latest.style.borderLeft = borderLeft; - }, 300); - } - } - getActionData() { return this.props.actions.map((action, i) => this.renderAction(action, i)); } - renderAction(action, i) { - const ref = () => (this.ref = i ? '' : 'latest'); + renderAction(action) { const counter =
{action.count}
; return ( -
+
{action.count > 1 && counter}
diff --git a/addons/actions/src/components/ActionLogger/style.js b/addons/actions/src/components/ActionLogger/style.js index d82497e1adad..b7afc0524051 100644 --- a/addons/actions/src/components/ActionLogger/style.js +++ b/addons/actions/src/components/ActionLogger/style.js @@ -17,7 +17,7 @@ export default { borderLeft: '5px solid white', borderBottom: '1px solid #fafafa', transition: 'all 0.1s', - alignItems: 'center', + alignItems: 'start', }, countwrap: { paddingBottom: 2, diff --git a/addons/knobs/src/components/PropField.js b/addons/knobs/src/components/PropField.js index 0ecbfff94145..f75b6f125e32 100644 --- a/addons/knobs/src/components/PropField.js +++ b/addons/knobs/src/components/PropField.js @@ -64,7 +64,7 @@ export default class PropField extends React.Component { PropField.propTypes = { knob: PropTypes.shape({ name: PropTypes.string, - value: PropTypes.string, + value: PropTypes.any, }), onChange: PropTypes.func.isRequired, }; diff --git a/addons/knobs/src/components/PropForm.js b/addons/knobs/src/components/PropForm.js index 784e1e439a91..f645b02354be 100644 --- a/addons/knobs/src/components/PropForm.js +++ b/addons/knobs/src/components/PropForm.js @@ -35,16 +35,20 @@ export default class propForm extends React.Component { return (
- {knobs.map(knob => - this._onFieldChange(knob.name, knob.type)} - /> - )} + {knobs.map(knob => { + // eslint-disable-next-line react/jsx-no-bind + const changeHandler = this.onFieldChange.bind(this, knob.name, knob.type); + return ( + + ); + })} ); } @@ -60,7 +64,7 @@ propForm.propTypes = { knobs: PropTypes.arrayOf( PropTypes.shape({ name: PropTypes.string, - value: PropTypes.string, + value: PropTypes.any, }) ), onFieldChange: PropTypes.func.isRequired, diff --git a/addons/knobs/src/components/WrapStory.js b/addons/knobs/src/components/WrapStory.js index 02b2e4fbe8a3..29568e2950ad 100644 --- a/addons/knobs/src/components/WrapStory.js +++ b/addons/knobs/src/components/WrapStory.js @@ -71,7 +71,7 @@ WrapStory.defaultProps = { WrapStory.propTypes = { context: PropTypes.object, // eslint-disable-line react/forbid-prop-types storyFn: PropTypes.func, - channel: React.PropTypes.shape({ + channel: PropTypes.shape({ on: PropTypes.func, removeListener: PropTypes.func, }).isRequired, diff --git a/addons/knobs/src/components/types/Number.js b/addons/knobs/src/components/types/Number.js index 4cbf4b9b38a2..a14bceb4b0fa 100644 --- a/addons/knobs/src/components/types/Number.js +++ b/addons/knobs/src/components/types/Number.js @@ -74,7 +74,7 @@ NumberType.defaultProps = { NumberType.propTypes = { knob: PropTypes.shape({ name: PropTypes.string, - value: PropTypes.string, + value: PropTypes.number, }), onChange: PropTypes.func, }; diff --git a/examples/cra-storybook/src/stories/index.js b/examples/cra-storybook/src/stories/index.js index 9e0304d96b90..a85dea1474bc 100644 --- a/examples/cra-storybook/src/stories/index.js +++ b/examples/cra-storybook/src/stories/index.js @@ -38,7 +38,9 @@ storiesOf('Button', module) .add('with knobs', () => { const label = text('Label', 'Edit me in knobs panel'); const num = number('Number', 1); - return ; + const content = `I am ${label} and I'm ${num} years old.`; + + return ; }) .addWithInfo('with some info', 'Use the info addon with its painful API.', () => From 0d4d201da73b4290f57edfc5f737e1b56c15b45e Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 9 Jun 2017 01:45:19 +0200 Subject: [PATCH 07/14] FIX linting --- addons/info/src/components/Node.js | 4 ++-- addons/info/src/components/PropTable.js | 4 ++-- addons/info/src/components/Story.js | 8 ++++---- app/react/src/server/middleware.js | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/info/src/components/Node.js b/addons/info/src/components/Node.js index 34bf3aad17bb..6861665fca2e 100644 --- a/addons/info/src/components/Node.js +++ b/addons/info/src/components/Node.js @@ -106,7 +106,7 @@ export default function Node(props) { /> >
- {React.Children.map(children, childElement => ( + {React.Children.map(children, childElement => - ))} + )}
</{name}>
diff --git a/addons/info/src/components/PropTable.js b/addons/info/src/components/PropTable.js index ca44d6e4d977..ded666436083 100644 --- a/addons/info/src/components/PropTable.js +++ b/addons/info/src/components/PropTable.js @@ -98,7 +98,7 @@ export default function PropTable(props) { - {array.map(row => ( + {array.map(row => {row.property} {row.propType} @@ -110,7 +110,7 @@ export default function PropTable(props) { {row.description} - ))} + )} ); diff --git a/addons/info/src/components/Story.js b/addons/info/src/components/Story.js index 0ec1e096f9de..1c639aed8b0e 100644 --- a/addons/info/src/components/Story.js +++ b/addons/info/src/components/Story.js @@ -258,7 +258,7 @@ export default class Story extends React.Component {

Story Source

-          {React.Children.map(this.props.children, (root, idx) => (
+          {React.Children.map(this.props.children, (root, idx) =>
             
-          ))}
+          )}
         
); @@ -323,7 +323,7 @@ export default class Story extends React.Component { array.sort((a, b) => (a.displayName || a.name) > (b.displayName || b.name)); const { maxPropObjectKeys, maxPropArrayLength, maxPropStringLength } = this.props; - const propTables = array.map(type => ( + const propTables = array.map(type =>

"{type.displayName || type.name}" Component @@ -335,7 +335,7 @@ export default class Story extends React.Component { maxPropStringLength={maxPropStringLength} />

- )); + ); if (!propTables || propTables.length === 0) { return null; diff --git a/app/react/src/server/middleware.js b/app/react/src/server/middleware.js index d15201c82a28..aa61721ca00a 100644 --- a/app/react/src/server/middleware.js +++ b/app/react/src/server/middleware.js @@ -50,14 +50,14 @@ export default function(configDir) { }; router.get('/', (req, res) => { - const headHtml = getManagerHeadHtml(configDir) + const headHtml = getManagerHeadHtml(configDir); res.send(getIndexHtml({ publicPath, headHtml })); }); router.get('/iframe.html', (req, res) => { const headHtml = getHeadHtml(configDir); res.send(getIframeHtml({ ...data, headHtml, publicPath })); - }); + }); if (stats.toJson().errors.length) { webpackReject(stats); From 07badcfd4409229c3e5f13083a1d6d6295527e58 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 12 Jun 2017 15:33:33 +1200 Subject: [PATCH 08/14] chmod +x bin/*.js --- app/react-native/src/bin/storybook-build.js | 0 app/react-native/src/bin/storybook-start.js | 0 app/react-native/src/bin/storybook.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 app/react-native/src/bin/storybook-build.js mode change 100644 => 100755 app/react-native/src/bin/storybook-start.js mode change 100644 => 100755 app/react-native/src/bin/storybook.js diff --git a/app/react-native/src/bin/storybook-build.js b/app/react-native/src/bin/storybook-build.js old mode 100644 new mode 100755 diff --git a/app/react-native/src/bin/storybook-start.js b/app/react-native/src/bin/storybook-start.js old mode 100644 new mode 100755 diff --git a/app/react-native/src/bin/storybook.js b/app/react-native/src/bin/storybook.js old mode 100644 new mode 100755 From 5416463f87f9734fcfab1ad419d4418fbd025467 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 12 Jun 2017 16:00:50 +1200 Subject: [PATCH 09/14] Use lerna bootstrap for react-native-vanilla deps --- examples/react-native-vanilla/package.json | 17 +++++++---------- lerna.json | 3 +-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/react-native-vanilla/package.json b/examples/react-native-vanilla/package.json index 643f02744594..01c99a69c9e4 100644 --- a/examples/react-native-vanilla/package.json +++ b/examples/react-native-vanilla/package.json @@ -12,19 +12,16 @@ "react-native": "0.44.1" }, "devDependencies": { + "@storybook/addon-actions": "*", + "@storybook/addon-links": "*", + "@storybook/addon-options": "*", + "@storybook/addon-storyshots": "*", + "@storybook/addons": "*", + "@storybook/channels": "*", + "@storybook/react-native": "*", "babel-jest": "20.0.3", "babel-preset-react-native": "1.9.2", "jest": "20.0.4", - "react-test-renderer": "16.0.0-alpha.6", - "@storybook/addon-actions": "file:../../addons/actions", - "@storybook/addon-links": "file:../../addons/links", - "@storybook/addon-options": "file:../../addons/options", - "@storybook/addon-storyshots": "file:../../addons/storyshots", - "@storybook/addons": "file:../../lib/addons", - "@storybook/channels": "file:../../lib/channels", - "@storybook/channel-postmessage": "file:../../lib/channel-postmessage", - "@storybook/react-native": "file:../../app/react-native", - "@storybook/ui": "file:../../lib/ui", "react-dom": "^15.5.4" } } diff --git a/lerna.json b/lerna.json index b7844d88287d..5d7c0601c77e 100644 --- a/lerna.json +++ b/lerna.json @@ -3,8 +3,7 @@ "commands": { "bootstrap": { "ignore": [ - "test-cra", - "react-native-vanilla" + "test-cra" ] }, "publish": { From bb3d96217d39b0d942dd3ec157f44a1742075eb4 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 12 Jun 2017 16:01:41 +1200 Subject: [PATCH 10/14] Fix typo --- app/react-native/src/manager/components/PreviewHelp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/react-native/src/manager/components/PreviewHelp.js b/app/react-native/src/manager/components/PreviewHelp.js index b3ce3c3b10dd..ee120853cbc8 100644 --- a/app/react-native/src/manager/components/PreviewHelp.js +++ b/app/react-native/src/manager/components/PreviewHelp.js @@ -60,7 +60,7 @@ const PreviewHelp = () => For react-native init apps:

-
npm run <platform>
+
react-native run-<platform>
; From f70785321798b8eb27ab1ec6c0450b2b3f25965b Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 12 Jun 2017 17:15:21 +1200 Subject: [PATCH 11/14] react-native-vanilla => react-native-getstorybook --- .travis.yml | 1 - .../.babelrc | 0 .../.buckconfig | 0 .../.flowconfig | 0 .../.gitattributes | 0 .../.gitignore | 0 .../.watchmanconfig | 0 .../__tests__/__snapshots__/storyshots.js.snap | 0 .../__tests__/index.android.js | 0 .../__tests__/index.ios.js | 0 .../__tests__/storyshots.js | 0 .../android/app/BUCK | 0 .../android/app/build.gradle | 0 .../android/app/proguard-rules.pro | 0 .../android/app/src/main/AndroidManifest.xml | 0 .../java/com/reactnativevanilla/MainActivity.java | 0 .../com/reactnativevanilla/MainApplication.java | 0 .../app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../android/app/src/main/res/values/strings.xml | 0 .../android/app/src/main/res/values/styles.xml | 0 .../android/build.gradle | 0 .../android/gradle.properties | 0 .../android/gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 .../android/gradlew | 0 .../android/gradlew.bat | 0 .../android/keystores/BUCK | 0 .../android/keystores/debug.keystore.properties | 0 .../android/settings.gradle | 0 .../app.json | 0 .../index.android.js | 0 .../index.ios.js | 0 .../ios/ReactNativeVanilla-tvOS/Info.plist | 0 .../ios/ReactNativeVanilla-tvOSTests/Info.plist | 0 .../ReactNativeVanilla.xcodeproj/project.pbxproj | 0 .../xcschemes/ReactNativeVanilla-tvOS.xcscheme | 0 .../xcschemes/ReactNativeVanilla.xcscheme | 0 .../ios/ReactNativeVanilla/AppDelegate.h | 0 .../ios/ReactNativeVanilla/AppDelegate.m | 0 .../ReactNativeVanilla/Base.lproj/LaunchScreen.xib | 0 .../AppIcon.appiconset/Contents.json | 0 .../ios/ReactNativeVanilla/Info.plist | 0 .../ios/ReactNativeVanilla/main.m | 0 .../ios/ReactNativeVanillaTests/Info.plist | 0 .../ReactNativeVanillaTests.m | 0 .../jest.config.js | 0 .../package.json | 2 +- .../storybook/addons.js | 0 .../storybook/index.android.js | 0 .../storybook/index.ios.js | 0 .../storybook/stories/Button/index.android.js | 0 .../storybook/stories/Button/index.ios.js | 0 .../storybook/stories/CenterView/index.js | 0 .../storybook/stories/CenterView/style.js | 0 .../storybook/stories/Welcome/index.js | 0 .../storybook/stories/index.js | 0 .../storybook/storybook.js | 0 jest.config.js | 2 +- lerna.json | 2 +- package.json | 3 +-- 63 files changed, 4 insertions(+), 6 deletions(-) rename examples/{react-native-vanilla => react-native-getstorybook}/.babelrc (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/.buckconfig (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/.flowconfig (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/.gitattributes (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/.gitignore (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/.watchmanconfig (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/__tests__/__snapshots__/storyshots.js.snap (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/__tests__/index.android.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/__tests__/index.ios.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/__tests__/storyshots.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/BUCK (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/build.gradle (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/proguard-rules.pro (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/AndroidManifest.xml (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/java/com/reactnativevanilla/MainActivity.java (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/java/com/reactnativevanilla/MainApplication.java (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/res/values/strings.xml (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/app/src/main/res/values/styles.xml (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/build.gradle (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/gradle.properties (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/gradle/wrapper/gradle-wrapper.jar (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/gradle/wrapper/gradle-wrapper.properties (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/gradlew (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/gradlew.bat (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/keystores/BUCK (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/keystores/debug.keystore.properties (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/android/settings.gradle (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/app.json (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/index.android.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/index.ios.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla-tvOS/Info.plist (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla-tvOSTests/Info.plist (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla.xcodeproj/project.pbxproj (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla-tvOS.xcscheme (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla.xcscheme (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla/AppDelegate.h (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla/AppDelegate.m (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla/Base.lproj/LaunchScreen.xib (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla/Info.plist (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanilla/main.m (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanillaTests/Info.plist (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/ios/ReactNativeVanillaTests/ReactNativeVanillaTests.m (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/jest.config.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/package.json (94%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/addons.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/index.android.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/index.ios.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/stories/Button/index.android.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/stories/Button/index.ios.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/stories/CenterView/index.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/stories/CenterView/style.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/stories/Welcome/index.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/stories/index.js (100%) rename examples/{react-native-vanilla => react-native-getstorybook}/storybook/storybook.js (100%) diff --git a/.travis.yml b/.travis.yml index 6865e1508a98..cb7172e2183c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ after_success: "./scripts/travis/after_success.sh" script: - npm run bootstrap - npm run bootstrap:test-cra -- npm run bootstrap:react-native-vanilla - npm run bootstrap:docs - npm run lint - npm run test -- --coverage diff --git a/examples/react-native-vanilla/.babelrc b/examples/react-native-getstorybook/.babelrc similarity index 100% rename from examples/react-native-vanilla/.babelrc rename to examples/react-native-getstorybook/.babelrc diff --git a/examples/react-native-vanilla/.buckconfig b/examples/react-native-getstorybook/.buckconfig similarity index 100% rename from examples/react-native-vanilla/.buckconfig rename to examples/react-native-getstorybook/.buckconfig diff --git a/examples/react-native-vanilla/.flowconfig b/examples/react-native-getstorybook/.flowconfig similarity index 100% rename from examples/react-native-vanilla/.flowconfig rename to examples/react-native-getstorybook/.flowconfig diff --git a/examples/react-native-vanilla/.gitattributes b/examples/react-native-getstorybook/.gitattributes similarity index 100% rename from examples/react-native-vanilla/.gitattributes rename to examples/react-native-getstorybook/.gitattributes diff --git a/examples/react-native-vanilla/.gitignore b/examples/react-native-getstorybook/.gitignore similarity index 100% rename from examples/react-native-vanilla/.gitignore rename to examples/react-native-getstorybook/.gitignore diff --git a/examples/react-native-vanilla/.watchmanconfig b/examples/react-native-getstorybook/.watchmanconfig similarity index 100% rename from examples/react-native-vanilla/.watchmanconfig rename to examples/react-native-getstorybook/.watchmanconfig diff --git a/examples/react-native-vanilla/__tests__/__snapshots__/storyshots.js.snap b/examples/react-native-getstorybook/__tests__/__snapshots__/storyshots.js.snap similarity index 100% rename from examples/react-native-vanilla/__tests__/__snapshots__/storyshots.js.snap rename to examples/react-native-getstorybook/__tests__/__snapshots__/storyshots.js.snap diff --git a/examples/react-native-vanilla/__tests__/index.android.js b/examples/react-native-getstorybook/__tests__/index.android.js similarity index 100% rename from examples/react-native-vanilla/__tests__/index.android.js rename to examples/react-native-getstorybook/__tests__/index.android.js diff --git a/examples/react-native-vanilla/__tests__/index.ios.js b/examples/react-native-getstorybook/__tests__/index.ios.js similarity index 100% rename from examples/react-native-vanilla/__tests__/index.ios.js rename to examples/react-native-getstorybook/__tests__/index.ios.js diff --git a/examples/react-native-vanilla/__tests__/storyshots.js b/examples/react-native-getstorybook/__tests__/storyshots.js similarity index 100% rename from examples/react-native-vanilla/__tests__/storyshots.js rename to examples/react-native-getstorybook/__tests__/storyshots.js diff --git a/examples/react-native-vanilla/android/app/BUCK b/examples/react-native-getstorybook/android/app/BUCK similarity index 100% rename from examples/react-native-vanilla/android/app/BUCK rename to examples/react-native-getstorybook/android/app/BUCK diff --git a/examples/react-native-vanilla/android/app/build.gradle b/examples/react-native-getstorybook/android/app/build.gradle similarity index 100% rename from examples/react-native-vanilla/android/app/build.gradle rename to examples/react-native-getstorybook/android/app/build.gradle diff --git a/examples/react-native-vanilla/android/app/proguard-rules.pro b/examples/react-native-getstorybook/android/app/proguard-rules.pro similarity index 100% rename from examples/react-native-vanilla/android/app/proguard-rules.pro rename to examples/react-native-getstorybook/android/app/proguard-rules.pro diff --git a/examples/react-native-vanilla/android/app/src/main/AndroidManifest.xml b/examples/react-native-getstorybook/android/app/src/main/AndroidManifest.xml similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/AndroidManifest.xml rename to examples/react-native-getstorybook/android/app/src/main/AndroidManifest.xml diff --git a/examples/react-native-vanilla/android/app/src/main/java/com/reactnativevanilla/MainActivity.java b/examples/react-native-getstorybook/android/app/src/main/java/com/reactnativevanilla/MainActivity.java similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/java/com/reactnativevanilla/MainActivity.java rename to examples/react-native-getstorybook/android/app/src/main/java/com/reactnativevanilla/MainActivity.java diff --git a/examples/react-native-vanilla/android/app/src/main/java/com/reactnativevanilla/MainApplication.java b/examples/react-native-getstorybook/android/app/src/main/java/com/reactnativevanilla/MainApplication.java similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/java/com/reactnativevanilla/MainApplication.java rename to examples/react-native-getstorybook/android/app/src/main/java/com/reactnativevanilla/MainApplication.java diff --git a/examples/react-native-vanilla/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/examples/react-native-getstorybook/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to examples/react-native-getstorybook/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/examples/react-native-vanilla/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/examples/react-native-getstorybook/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to examples/react-native-getstorybook/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/examples/react-native-vanilla/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/examples/react-native-getstorybook/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to examples/react-native-getstorybook/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/examples/react-native-vanilla/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/examples/react-native-getstorybook/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to examples/react-native-getstorybook/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/examples/react-native-vanilla/android/app/src/main/res/values/strings.xml b/examples/react-native-getstorybook/android/app/src/main/res/values/strings.xml similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/res/values/strings.xml rename to examples/react-native-getstorybook/android/app/src/main/res/values/strings.xml diff --git a/examples/react-native-vanilla/android/app/src/main/res/values/styles.xml b/examples/react-native-getstorybook/android/app/src/main/res/values/styles.xml similarity index 100% rename from examples/react-native-vanilla/android/app/src/main/res/values/styles.xml rename to examples/react-native-getstorybook/android/app/src/main/res/values/styles.xml diff --git a/examples/react-native-vanilla/android/build.gradle b/examples/react-native-getstorybook/android/build.gradle similarity index 100% rename from examples/react-native-vanilla/android/build.gradle rename to examples/react-native-getstorybook/android/build.gradle diff --git a/examples/react-native-vanilla/android/gradle.properties b/examples/react-native-getstorybook/android/gradle.properties similarity index 100% rename from examples/react-native-vanilla/android/gradle.properties rename to examples/react-native-getstorybook/android/gradle.properties diff --git a/examples/react-native-vanilla/android/gradle/wrapper/gradle-wrapper.jar b/examples/react-native-getstorybook/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from examples/react-native-vanilla/android/gradle/wrapper/gradle-wrapper.jar rename to examples/react-native-getstorybook/android/gradle/wrapper/gradle-wrapper.jar diff --git a/examples/react-native-vanilla/android/gradle/wrapper/gradle-wrapper.properties b/examples/react-native-getstorybook/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from examples/react-native-vanilla/android/gradle/wrapper/gradle-wrapper.properties rename to examples/react-native-getstorybook/android/gradle/wrapper/gradle-wrapper.properties diff --git a/examples/react-native-vanilla/android/gradlew b/examples/react-native-getstorybook/android/gradlew similarity index 100% rename from examples/react-native-vanilla/android/gradlew rename to examples/react-native-getstorybook/android/gradlew diff --git a/examples/react-native-vanilla/android/gradlew.bat b/examples/react-native-getstorybook/android/gradlew.bat similarity index 100% rename from examples/react-native-vanilla/android/gradlew.bat rename to examples/react-native-getstorybook/android/gradlew.bat diff --git a/examples/react-native-vanilla/android/keystores/BUCK b/examples/react-native-getstorybook/android/keystores/BUCK similarity index 100% rename from examples/react-native-vanilla/android/keystores/BUCK rename to examples/react-native-getstorybook/android/keystores/BUCK diff --git a/examples/react-native-vanilla/android/keystores/debug.keystore.properties b/examples/react-native-getstorybook/android/keystores/debug.keystore.properties similarity index 100% rename from examples/react-native-vanilla/android/keystores/debug.keystore.properties rename to examples/react-native-getstorybook/android/keystores/debug.keystore.properties diff --git a/examples/react-native-vanilla/android/settings.gradle b/examples/react-native-getstorybook/android/settings.gradle similarity index 100% rename from examples/react-native-vanilla/android/settings.gradle rename to examples/react-native-getstorybook/android/settings.gradle diff --git a/examples/react-native-vanilla/app.json b/examples/react-native-getstorybook/app.json similarity index 100% rename from examples/react-native-vanilla/app.json rename to examples/react-native-getstorybook/app.json diff --git a/examples/react-native-vanilla/index.android.js b/examples/react-native-getstorybook/index.android.js similarity index 100% rename from examples/react-native-vanilla/index.android.js rename to examples/react-native-getstorybook/index.android.js diff --git a/examples/react-native-vanilla/index.ios.js b/examples/react-native-getstorybook/index.ios.js similarity index 100% rename from examples/react-native-vanilla/index.ios.js rename to examples/react-native-getstorybook/index.ios.js diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla-tvOS/Info.plist b/examples/react-native-getstorybook/ios/ReactNativeVanilla-tvOS/Info.plist similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla-tvOS/Info.plist rename to examples/react-native-getstorybook/ios/ReactNativeVanilla-tvOS/Info.plist diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla-tvOSTests/Info.plist b/examples/react-native-getstorybook/ios/ReactNativeVanilla-tvOSTests/Info.plist similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla-tvOSTests/Info.plist rename to examples/react-native-getstorybook/ios/ReactNativeVanilla-tvOSTests/Info.plist diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla.xcodeproj/project.pbxproj b/examples/react-native-getstorybook/ios/ReactNativeVanilla.xcodeproj/project.pbxproj similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla.xcodeproj/project.pbxproj rename to examples/react-native-getstorybook/ios/ReactNativeVanilla.xcodeproj/project.pbxproj diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla-tvOS.xcscheme b/examples/react-native-getstorybook/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla-tvOS.xcscheme similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla-tvOS.xcscheme rename to examples/react-native-getstorybook/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla-tvOS.xcscheme diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla.xcscheme b/examples/react-native-getstorybook/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla.xcscheme similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla.xcscheme rename to examples/react-native-getstorybook/ios/ReactNativeVanilla.xcodeproj/xcshareddata/xcschemes/ReactNativeVanilla.xcscheme diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla/AppDelegate.h b/examples/react-native-getstorybook/ios/ReactNativeVanilla/AppDelegate.h similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla/AppDelegate.h rename to examples/react-native-getstorybook/ios/ReactNativeVanilla/AppDelegate.h diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla/AppDelegate.m b/examples/react-native-getstorybook/ios/ReactNativeVanilla/AppDelegate.m similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla/AppDelegate.m rename to examples/react-native-getstorybook/ios/ReactNativeVanilla/AppDelegate.m diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla/Base.lproj/LaunchScreen.xib b/examples/react-native-getstorybook/ios/ReactNativeVanilla/Base.lproj/LaunchScreen.xib similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla/Base.lproj/LaunchScreen.xib rename to examples/react-native-getstorybook/ios/ReactNativeVanilla/Base.lproj/LaunchScreen.xib diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/react-native-getstorybook/ios/ReactNativeVanilla/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla/Images.xcassets/AppIcon.appiconset/Contents.json rename to examples/react-native-getstorybook/ios/ReactNativeVanilla/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla/Info.plist b/examples/react-native-getstorybook/ios/ReactNativeVanilla/Info.plist similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla/Info.plist rename to examples/react-native-getstorybook/ios/ReactNativeVanilla/Info.plist diff --git a/examples/react-native-vanilla/ios/ReactNativeVanilla/main.m b/examples/react-native-getstorybook/ios/ReactNativeVanilla/main.m similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanilla/main.m rename to examples/react-native-getstorybook/ios/ReactNativeVanilla/main.m diff --git a/examples/react-native-vanilla/ios/ReactNativeVanillaTests/Info.plist b/examples/react-native-getstorybook/ios/ReactNativeVanillaTests/Info.plist similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanillaTests/Info.plist rename to examples/react-native-getstorybook/ios/ReactNativeVanillaTests/Info.plist diff --git a/examples/react-native-vanilla/ios/ReactNativeVanillaTests/ReactNativeVanillaTests.m b/examples/react-native-getstorybook/ios/ReactNativeVanillaTests/ReactNativeVanillaTests.m similarity index 100% rename from examples/react-native-vanilla/ios/ReactNativeVanillaTests/ReactNativeVanillaTests.m rename to examples/react-native-getstorybook/ios/ReactNativeVanillaTests/ReactNativeVanillaTests.m diff --git a/examples/react-native-vanilla/jest.config.js b/examples/react-native-getstorybook/jest.config.js similarity index 100% rename from examples/react-native-vanilla/jest.config.js rename to examples/react-native-getstorybook/jest.config.js diff --git a/examples/react-native-vanilla/package.json b/examples/react-native-getstorybook/package.json similarity index 94% rename from examples/react-native-vanilla/package.json rename to examples/react-native-getstorybook/package.json index 01c99a69c9e4..4dfbc750db96 100644 --- a/examples/react-native-vanilla/package.json +++ b/examples/react-native-getstorybook/package.json @@ -1,5 +1,5 @@ { - "name": "react-native-vanilla", + "name": "react-native-getstorybook", "version": "0.0.1", "private": true, "scripts": { diff --git a/examples/react-native-vanilla/storybook/addons.js b/examples/react-native-getstorybook/storybook/addons.js similarity index 100% rename from examples/react-native-vanilla/storybook/addons.js rename to examples/react-native-getstorybook/storybook/addons.js diff --git a/examples/react-native-vanilla/storybook/index.android.js b/examples/react-native-getstorybook/storybook/index.android.js similarity index 100% rename from examples/react-native-vanilla/storybook/index.android.js rename to examples/react-native-getstorybook/storybook/index.android.js diff --git a/examples/react-native-vanilla/storybook/index.ios.js b/examples/react-native-getstorybook/storybook/index.ios.js similarity index 100% rename from examples/react-native-vanilla/storybook/index.ios.js rename to examples/react-native-getstorybook/storybook/index.ios.js diff --git a/examples/react-native-vanilla/storybook/stories/Button/index.android.js b/examples/react-native-getstorybook/storybook/stories/Button/index.android.js similarity index 100% rename from examples/react-native-vanilla/storybook/stories/Button/index.android.js rename to examples/react-native-getstorybook/storybook/stories/Button/index.android.js diff --git a/examples/react-native-vanilla/storybook/stories/Button/index.ios.js b/examples/react-native-getstorybook/storybook/stories/Button/index.ios.js similarity index 100% rename from examples/react-native-vanilla/storybook/stories/Button/index.ios.js rename to examples/react-native-getstorybook/storybook/stories/Button/index.ios.js diff --git a/examples/react-native-vanilla/storybook/stories/CenterView/index.js b/examples/react-native-getstorybook/storybook/stories/CenterView/index.js similarity index 100% rename from examples/react-native-vanilla/storybook/stories/CenterView/index.js rename to examples/react-native-getstorybook/storybook/stories/CenterView/index.js diff --git a/examples/react-native-vanilla/storybook/stories/CenterView/style.js b/examples/react-native-getstorybook/storybook/stories/CenterView/style.js similarity index 100% rename from examples/react-native-vanilla/storybook/stories/CenterView/style.js rename to examples/react-native-getstorybook/storybook/stories/CenterView/style.js diff --git a/examples/react-native-vanilla/storybook/stories/Welcome/index.js b/examples/react-native-getstorybook/storybook/stories/Welcome/index.js similarity index 100% rename from examples/react-native-vanilla/storybook/stories/Welcome/index.js rename to examples/react-native-getstorybook/storybook/stories/Welcome/index.js diff --git a/examples/react-native-vanilla/storybook/stories/index.js b/examples/react-native-getstorybook/storybook/stories/index.js similarity index 100% rename from examples/react-native-vanilla/storybook/stories/index.js rename to examples/react-native-getstorybook/storybook/stories/index.js diff --git a/examples/react-native-vanilla/storybook/storybook.js b/examples/react-native-getstorybook/storybook/storybook.js similarity index 100% rename from examples/react-native-vanilla/storybook/storybook.js rename to examples/react-native-getstorybook/storybook/storybook.js diff --git a/jest.config.js b/jest.config.js index 12054792ad60..bc3315b4ba41 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,7 +14,7 @@ module.exports = { '/examples/test-cra', ], testPathIgnorePatterns: ['/node_modules/'], - projects: ['./', './examples/react-native-vanilla'], + projects: ['./', './examples/react-native-getstorybook'], collectCoverage: false, collectCoverageFrom: [ 'app/**/*.{js,jsx}', diff --git a/lerna.json b/lerna.json index 5d7c0601c77e..45efdc0e69ce 100644 --- a/lerna.json +++ b/lerna.json @@ -10,7 +10,7 @@ "ignore": [ "cra-storybook", "test-cra", - "react-native-vanilla" + "react-native-getstorybook" ] } }, diff --git a/package.json b/package.json index 483abd531e04..e17a0af42717 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "bootstrap": "lerna bootstrap", "bootstrap:docs": "cd docs && npm i", "bootstrap:test-cra": "lerna exec --scope test-cra -- npm i", - "bootstrap:react-native-vanilla": "lerna exec --scope react-native-vanilla -- npm i", "changelog": "pr-log --sloppy", "precommit": "lint-staged", "coverage": "codecov", @@ -23,7 +22,7 @@ "lint:js": "eslint . --cache --cache-location=.cache/eslint --ext .js,.jsx,.json", "lint:md": "remark .", "publish": "lerna publish", - "test": "jest --projects ./ ./examples/react-native-vanilla" + "test": "jest --projects ./ ./examples/react-native-getstorybook" }, "devDependencies": { "babel-cli": "^6.24.1", From b7b80804b0d3d81d62e22d92aaa31d381fe1758b Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 12 Jun 2017 17:19:10 +1200 Subject: [PATCH 12/14] Rename car-storybook => cra-kitchen-sink --- .../{cra-storybook => cra-kitchen-sink}/.gitignore | 0 .../.storybook/addons.js | 0 .../.storybook/config.js | 0 .../{cra-storybook => cra-kitchen-sink}/README.md | 0 .../package.json | 2 +- .../public/favicon.ico | Bin .../public/index.html | 0 .../{cra-storybook => cra-kitchen-sink}/src/App.css | 0 .../{cra-storybook => cra-kitchen-sink}/src/App.js | 0 .../src/App.test.js | 0 .../src/base.css | 0 .../src/index.css | 0 .../src/index.js | 0 .../src/logo.svg | 0 .../src/stories/Button.js | 0 .../src/stories/Logger.js | 0 .../src/stories/Welcome.js | 0 .../src/stories/index.js | 0 examples/package.json | 2 +- examples/scripts/automated-cra-storybook.js | 2 +- jest.config.js | 2 +- lerna.json | 2 +- 22 files changed, 5 insertions(+), 5 deletions(-) rename examples/{cra-storybook => cra-kitchen-sink}/.gitignore (100%) rename examples/{cra-storybook => cra-kitchen-sink}/.storybook/addons.js (100%) rename examples/{cra-storybook => cra-kitchen-sink}/.storybook/config.js (100%) rename examples/{cra-storybook => cra-kitchen-sink}/README.md (100%) rename examples/{cra-storybook => cra-kitchen-sink}/package.json (97%) rename examples/{cra-storybook => cra-kitchen-sink}/public/favicon.ico (100%) rename examples/{cra-storybook => cra-kitchen-sink}/public/index.html (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/App.css (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/App.js (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/App.test.js (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/base.css (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/index.css (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/index.js (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/logo.svg (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/stories/Button.js (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/stories/Logger.js (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/stories/Welcome.js (100%) rename examples/{cra-storybook => cra-kitchen-sink}/src/stories/index.js (100%) diff --git a/examples/cra-storybook/.gitignore b/examples/cra-kitchen-sink/.gitignore similarity index 100% rename from examples/cra-storybook/.gitignore rename to examples/cra-kitchen-sink/.gitignore diff --git a/examples/cra-storybook/.storybook/addons.js b/examples/cra-kitchen-sink/.storybook/addons.js similarity index 100% rename from examples/cra-storybook/.storybook/addons.js rename to examples/cra-kitchen-sink/.storybook/addons.js diff --git a/examples/cra-storybook/.storybook/config.js b/examples/cra-kitchen-sink/.storybook/config.js similarity index 100% rename from examples/cra-storybook/.storybook/config.js rename to examples/cra-kitchen-sink/.storybook/config.js diff --git a/examples/cra-storybook/README.md b/examples/cra-kitchen-sink/README.md similarity index 100% rename from examples/cra-storybook/README.md rename to examples/cra-kitchen-sink/README.md diff --git a/examples/cra-storybook/package.json b/examples/cra-kitchen-sink/package.json similarity index 97% rename from examples/cra-storybook/package.json rename to examples/cra-kitchen-sink/package.json index 620a31050da6..a709db2e39fa 100644 --- a/examples/cra-storybook/package.json +++ b/examples/cra-kitchen-sink/package.json @@ -1,5 +1,5 @@ { - "name": "cra-storybook", + "name": "cra-kitchen-sink", "version": "1.0.0", "scripts": { "build": "react-scripts build", diff --git a/examples/cra-storybook/public/favicon.ico b/examples/cra-kitchen-sink/public/favicon.ico similarity index 100% rename from examples/cra-storybook/public/favicon.ico rename to examples/cra-kitchen-sink/public/favicon.ico diff --git a/examples/cra-storybook/public/index.html b/examples/cra-kitchen-sink/public/index.html similarity index 100% rename from examples/cra-storybook/public/index.html rename to examples/cra-kitchen-sink/public/index.html diff --git a/examples/cra-storybook/src/App.css b/examples/cra-kitchen-sink/src/App.css similarity index 100% rename from examples/cra-storybook/src/App.css rename to examples/cra-kitchen-sink/src/App.css diff --git a/examples/cra-storybook/src/App.js b/examples/cra-kitchen-sink/src/App.js similarity index 100% rename from examples/cra-storybook/src/App.js rename to examples/cra-kitchen-sink/src/App.js diff --git a/examples/cra-storybook/src/App.test.js b/examples/cra-kitchen-sink/src/App.test.js similarity index 100% rename from examples/cra-storybook/src/App.test.js rename to examples/cra-kitchen-sink/src/App.test.js diff --git a/examples/cra-storybook/src/base.css b/examples/cra-kitchen-sink/src/base.css similarity index 100% rename from examples/cra-storybook/src/base.css rename to examples/cra-kitchen-sink/src/base.css diff --git a/examples/cra-storybook/src/index.css b/examples/cra-kitchen-sink/src/index.css similarity index 100% rename from examples/cra-storybook/src/index.css rename to examples/cra-kitchen-sink/src/index.css diff --git a/examples/cra-storybook/src/index.js b/examples/cra-kitchen-sink/src/index.js similarity index 100% rename from examples/cra-storybook/src/index.js rename to examples/cra-kitchen-sink/src/index.js diff --git a/examples/cra-storybook/src/logo.svg b/examples/cra-kitchen-sink/src/logo.svg similarity index 100% rename from examples/cra-storybook/src/logo.svg rename to examples/cra-kitchen-sink/src/logo.svg diff --git a/examples/cra-storybook/src/stories/Button.js b/examples/cra-kitchen-sink/src/stories/Button.js similarity index 100% rename from examples/cra-storybook/src/stories/Button.js rename to examples/cra-kitchen-sink/src/stories/Button.js diff --git a/examples/cra-storybook/src/stories/Logger.js b/examples/cra-kitchen-sink/src/stories/Logger.js similarity index 100% rename from examples/cra-storybook/src/stories/Logger.js rename to examples/cra-kitchen-sink/src/stories/Logger.js diff --git a/examples/cra-storybook/src/stories/Welcome.js b/examples/cra-kitchen-sink/src/stories/Welcome.js similarity index 100% rename from examples/cra-storybook/src/stories/Welcome.js rename to examples/cra-kitchen-sink/src/stories/Welcome.js diff --git a/examples/cra-storybook/src/stories/index.js b/examples/cra-kitchen-sink/src/stories/index.js similarity index 100% rename from examples/cra-storybook/src/stories/index.js rename to examples/cra-kitchen-sink/src/stories/index.js diff --git a/examples/package.json b/examples/package.json index f11f22222c4e..53327ed10c59 100644 --- a/examples/package.json +++ b/examples/package.json @@ -4,7 +4,7 @@ "description": "A set of examples of how to use storybook, also used for regression testing", "main": "index.js", "scripts": { - "test:automated-cra-storybook": "node scripts/automated-cra-storybook.js" + "test:automated-cra-getstorybook": "node scripts/automated-cra-getstorybook.js" }, "license": "ISC", "dependencies": { diff --git a/examples/scripts/automated-cra-storybook.js b/examples/scripts/automated-cra-storybook.js index 9b0bfa06c0a7..5f850160239e 100755 --- a/examples/scripts/automated-cra-storybook.js +++ b/examples/scripts/automated-cra-storybook.js @@ -6,7 +6,7 @@ const { exec } = require('child-process-promise'); const rimraf = require('rimraf'); -const targetFolder = 'automated-cra-storybook'; +const targetFolder = 'automated-cra-getstorybook'; const cleanDir = () => new Promise(resolve => rimraf(`./${targetFolder}`, resolve)); diff --git a/jest.config.js b/jest.config.js index bc3315b4ba41..e725e9f2c386 100644 --- a/jest.config.js +++ b/jest.config.js @@ -10,7 +10,7 @@ module.exports = { '/addons', '/app', '/lib', - '/examples/cra-storybook', + '/examples/cra-kitchen-sink', '/examples/test-cra', ], testPathIgnorePatterns: ['/node_modules/'], diff --git a/lerna.json b/lerna.json index 45efdc0e69ce..5a2dd9a3af1a 100644 --- a/lerna.json +++ b/lerna.json @@ -8,7 +8,7 @@ }, "publish": { "ignore": [ - "cra-storybook", + "cra-kitchen-sink", "test-cra", "react-native-getstorybook" ] From 0537e3c92e17bdf0526f2ab545400d1c33dc56f3 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 12 Jun 2017 18:02:35 +1200 Subject: [PATCH 13/14] Merge crna-getstorybook into kitchen-sink --- examples/crna-getstorybook/.babelrc | 8 + examples/crna-getstorybook/.flowconfig | 63 ++++++ examples/crna-getstorybook/.gitignore | 3 + examples/crna-getstorybook/.watchmanconfig | 1 + examples/crna-getstorybook/App.js | 30 +++ examples/crna-getstorybook/App.test.js | 12 ++ examples/crna-getstorybook/README.md | 199 ++++++++++++++++++ .../__snapshots__/storyshots.js.snap | 151 +++++++++++++ .../crna-getstorybook/__tests__/storyshots.js | 7 + examples/crna-getstorybook/app.json | 5 + examples/crna-getstorybook/jest.config.js | 6 + examples/crna-getstorybook/package.json | 34 +++ .../crna-getstorybook/storybook/addons.js | 2 + examples/crna-getstorybook/storybook/index.js | 9 + .../storybook/stories/Button/index.android.js | 18 ++ .../storybook/stories/Button/index.ios.js | 18 ++ .../storybook/stories/CenterView/index.js | 15 ++ .../storybook/stories/CenterView/style.js | 8 + .../storybook/stories/Welcome/index.js | 52 +++++ .../storybook/stories/index.js | 25 +++ lerna.json | 5 +- 21 files changed, 669 insertions(+), 2 deletions(-) create mode 100644 examples/crna-getstorybook/.babelrc create mode 100644 examples/crna-getstorybook/.flowconfig create mode 100644 examples/crna-getstorybook/.gitignore create mode 100644 examples/crna-getstorybook/.watchmanconfig create mode 100644 examples/crna-getstorybook/App.js create mode 100644 examples/crna-getstorybook/App.test.js create mode 100644 examples/crna-getstorybook/README.md create mode 100644 examples/crna-getstorybook/__tests__/__snapshots__/storyshots.js.snap create mode 100644 examples/crna-getstorybook/__tests__/storyshots.js create mode 100644 examples/crna-getstorybook/app.json create mode 100644 examples/crna-getstorybook/jest.config.js create mode 100644 examples/crna-getstorybook/package.json create mode 100644 examples/crna-getstorybook/storybook/addons.js create mode 100644 examples/crna-getstorybook/storybook/index.js create mode 100644 examples/crna-getstorybook/storybook/stories/Button/index.android.js create mode 100644 examples/crna-getstorybook/storybook/stories/Button/index.ios.js create mode 100644 examples/crna-getstorybook/storybook/stories/CenterView/index.js create mode 100644 examples/crna-getstorybook/storybook/stories/CenterView/style.js create mode 100644 examples/crna-getstorybook/storybook/stories/Welcome/index.js create mode 100644 examples/crna-getstorybook/storybook/stories/index.js diff --git a/examples/crna-getstorybook/.babelrc b/examples/crna-getstorybook/.babelrc new file mode 100644 index 000000000000..2bcd546dbfd2 --- /dev/null +++ b/examples/crna-getstorybook/.babelrc @@ -0,0 +1,8 @@ +{ + "presets": ["babel-preset-expo"], + "env": { + "development": { + "plugins": ["transform-react-jsx-source"] + } + } +} diff --git a/examples/crna-getstorybook/.flowconfig b/examples/crna-getstorybook/.flowconfig new file mode 100644 index 000000000000..c5507b0c06e7 --- /dev/null +++ b/examples/crna-getstorybook/.flowconfig @@ -0,0 +1,63 @@ +[ignore] +; We fork some components by platform +.*/*[.]android.js + +; Ignore "BUCK" generated dirs +/\.buckd/ + +; Ignore unexpected extra "@providesModule" +.*/node_modules/.*/node_modules/fbjs/.* + +; Ignore duplicate module providers +; For RN Apps installed via npm, "Libraries" folder is inside +; "node_modules/react-native" but in the source repo it is in the root +.*/Libraries/react-native/React.js +.*/Libraries/react-native/ReactNative.js + +; Additional create-react-native-app ignores + +; Ignore duplicate module providers +.*/node_modules/fbemitter/lib/* + +; Ignore misbehaving dev-dependencies +.*/node_modules/xdl/build/* +.*/node_modules/reqwest/tests/* + +; Ignore missing expo-sdk dependencies (temporarily) +; https://github.com/expo/expo/issues/162 +.*/node_modules/expo/src/* + +; Ignore react-native-fbads dependency of the expo sdk +.*/node_modules/react-native-fbads/* + +[include] + +[libs] +node_modules/react-native/Libraries/react-native/react-native-interface.js +node_modules/react-native/flow +flow/ + +[options] +module.system=haste + +emoji=true + +experimental.strict_type_args=true + +munge_underscores=true + +module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' + +suppress_type=$FlowIssue +suppress_type=$FlowFixMe +suppress_type=$FixMe + +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy +suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError + +unsafe.enable_getters_and_setters=true + +[version] +^0.42.0 diff --git a/examples/crna-getstorybook/.gitignore b/examples/crna-getstorybook/.gitignore new file mode 100644 index 000000000000..1025e17bd3c6 --- /dev/null +++ b/examples/crna-getstorybook/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +.expo/ +npm-debug.* diff --git a/examples/crna-getstorybook/.watchmanconfig b/examples/crna-getstorybook/.watchmanconfig new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/examples/crna-getstorybook/.watchmanconfig @@ -0,0 +1 @@ +{} diff --git a/examples/crna-getstorybook/App.js b/examples/crna-getstorybook/App.js new file mode 100644 index 000000000000..ac4ee7fb1f02 --- /dev/null +++ b/examples/crna-getstorybook/App.js @@ -0,0 +1,30 @@ +import StorybookUI from './storybook'; + +export default StorybookUI; + +// generated by CRNA +// /* eslint-disable */ +// +// import React from 'react'; +// import { StyleSheet, Text, View } from 'react-native'; +// +// export default class App extends React.Component { +// render() { +// return ( +// +// Open up App.js to start working on your app! +// Changes you make will automatically reload. +// Shake your phone to open the developer menu. +// +// ); +// } +// } +// +// const styles = StyleSheet.create({ +// container: { +// flex: 1, +// backgroundColor: '#fff', +// alignItems: 'center', +// justifyContent: 'center', +// }, +// }); diff --git a/examples/crna-getstorybook/App.test.js b/examples/crna-getstorybook/App.test.js new file mode 100644 index 000000000000..0ed6152a5204 --- /dev/null +++ b/examples/crna-getstorybook/App.test.js @@ -0,0 +1,12 @@ +// generated by CRNA +/* eslint-disable */ + +import React from 'react'; +import App from './App'; + +import renderer from 'react-test-renderer'; + +it('renders without crashing', () => { + const rendered = renderer.create().toJSON(); + expect(rendered).toBeTruthy(); +}); diff --git a/examples/crna-getstorybook/README.md b/examples/crna-getstorybook/README.md new file mode 100644 index 000000000000..badf23552286 --- /dev/null +++ b/examples/crna-getstorybook/README.md @@ -0,0 +1,199 @@ +This project was bootstrapped with [Create React Native App](https://github.com/react-community/create-react-native-app). + +Below you'll find information about performing common tasks. The most recent version of this guide is available [here](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md). + +## Table of Contents + +- [Updating to New Releases](#updating-to-new-releases) +- [Available Scripts](#available-scripts) + - [npm start](#npm-start) +- [Customizing App Display Name and Icon](#customizing-app-display-name-and-icon) +- [Writing and Running Tests](#writing-and-running-tests) +- [Environment Variables](#environment-variables) + - [Configuring Packager IP Address](#configuring-packager-ip-address) +- [Adding Flow](#adding-flow) +- [Sharing and Deployment](#sharing-and-deployment) + - [Publishing to Expo's React Native Community](#publishing-to-expos-react-native-community) + - [Building an Expo "standalone" app](#building-an-expo-standalone-app) + - [Ejecting from Create React Native App](#ejecting-from-create-react-native-app) +- [Troubleshooting](#troubleshooting) + - [Networking](#networking) + - [iOS Simulator won't open](#ios-simulator-wont-open) + - [QR Code does not scan](#qr-code-does-not-scan) + +## Updating to New Releases + +You should only need to update the global installation of `create-react-native-app` very rarely, ideally never. + +Updating the `react-native-scripts` dependency of your app should be as simple as bumping the version number in `package.json` and reinstalling your project's dependencies. + +Upgrading to a new version of React Native requires updating the `react-native`, `react`, and `expo` package versions, and setting the correct `sdkVersion` in `app.json`. See the [versioning guide](https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md) for up-to-date information about package version compatibility. + +## Available Scripts + +If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing. + +### `npm start` + +Runs your app in development mode. + +Open it in the [Expo app](https://expo.io) on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal. + +Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the `--reset-cache` flag to the start script: + + npm start -- --reset-cache + # or + yarn start -- --reset-cache + +#### `npm test` + +Runs the [jest](https://github.com/facebook/jest) test runner on your tests. + +#### `npm run ios` + +Like `npm start`, but also attempts to open your app in the iOS Simulator if you're on a Mac and have it installed. + +#### `npm run android` + +Like `npm start`, but also attempts to open your app on a connected Android device or emulator. Requires an installation of Android build tools (see [React Native docs](https://facebook.github.io/react-native/docs/getting-started.html) for detailed setup). We also recommend installing Genymotion as your Android emulator. Once you've finished setting up the native build environment, there are two options for making the right copy of `adb` available to Create React Native App: + +##### Using Android Studio's `adb` + +1. Make sure that you can run adb from your terminal. +2. Open Genymotion and navigate to `Settings -> ADB`. Select β€œUse custom Android SDK tools” and update with your [Android SDK directory](https://stackoverflow.com/questions/25176594/android-sdk-location). + +##### Using Genymotion's `adb` + +1. Find Genymotion’s copy of adb. On macOS for example, this is normally `/Applications/Genymotion.app/Contents/MacOS/tools/`. +2. Add the Genymotion tools directory to your path (instructions for [Mac](http://osxdaily.com/2014/08/14/add-new-path-to-path-command-line/), [Linux](http://www.computerhope.com/issues/ch001647.htm), and [Windows](https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/)). +3. Make sure that you can run adb from your terminal. + +#### `npm run eject` + +This will start the process of "ejecting" from Create React Native App's build scripts. You'll be asked a couple of questions about how you'd like to build your project. + +**Warning:** Running eject is a permanent action (aside from whatever version control system you use). An ejected app will require you to have an [Xcode and/or Android Studio environment](https://facebook.github.io/react-native/docs/getting-started.html) set up. + +## Customizing App Display Name and Icon + +You can edit `app.json` to include [configuration keys](https://docs.expo.io/versions/latest/guides/configuration.html) under the `expo` key. + +To change your app's display name, set the `expo.name` key in `app.json` to an appropriate string. + +To set an app icon, set the `expo.icon` key in `app.json` to be either a local path or a URL. It's recommended that you use a 512x512 png file with transparency. + +## Writing and Running Tests + +This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` to have the files loaded by jest. See the [the template project](https://github.com/react-community/create-react-native-app/tree/master/react-native-scripts/template/__tests__) for an example test. The [jest documentation](https://facebook.github.io/jest/docs/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/tutorial-react-native.html). + +## Environment Variables + +You can configure some of Create React Native App's behavior using environment variables. + +### Configuring Packager IP Address + +When starting your project, you'll see something like this for your project URL: + + exp://192.168.0.2:19000 + +The "manifest" at that URL tells the Expo app how to retrieve and load your app's JavaScript bundle, so even if you load it in the app via a URL like `exp://localhost:19000`, the Expo client app will still try to retrieve your app at the IP address that the start script provides. + +In some cases, this is less than ideal. This might be the case if you need to run your project inside of a virtual machine and you have to access the packager via a different IP address than the one which prints by default. In order to override the IP address or hostname that is detected by Create React Native App, you can specify your own hostname via the `REACT_NATIVE_PACKAGER_HOSTNAME` environment variable: + +Mac and Linux: + + REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname' npm start + +Windows: + + set REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname' + npm start + +The above example would cause the development server to listen on `exp://my-custom-ip-address-or-hostname:19000`. + +## Adding Flow + +Flow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept. + +React Native works with [Flow](http://flowtype.org/) out of the box, as long as your Flow version matches the one used in the version of React Native. + +To add a local dependency to the correct Flow version to a Create React Native App project, follow these steps: + +1. Find the Flow `[version]` at the bottom of the included [.flowconfig](.flowconfig) +2. Run `npm install --save-dev flow-bin@x.y.z` (or `yarn add --dev flow-bin@x.y.z`), where `x.y.z` is the .flowconfig version number. +3. Add `"flow": "flow"` to the `scripts` section of your `package.json`. +4. Add `// @flow` to any files you want to type check (for example, to `App.js`). + +Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors. +You can optionally use a [plugin for your IDE or editor](https://flow.org/en/docs/editors/) for a better integrated experience. + +To learn more about Flow, check out [its documentation](https://flow.org/). + +## Sharing and Deployment + +Create React Native App does a lot of work to make app setup and development simple and straightforward, but it's very difficult to do the same for deploying to Apple's App Store or Google's Play Store without relying on a hosted service. + +### Publishing to Expo's React Native Community + +Expo provides free hosting for the JS-only apps created by CRNA, allowing you to share your app through the Expo client app. This requires registration for an Expo account. + +Install the `exp` command-line tool, and run the publish command: + + $ npm i -g exp + $ exp publish + +### Building an Expo "standalone" app + +You can also use a service like [Expo's standalone builds](https://docs.expo.io/versions/latest/guides/building-standalone-apps.html) if you want to get an IPA/APK for distribution without having to build the native code yourself. + +### Ejecting from Create React Native App + +If you want to build and deploy your app yourself, you'll need to eject from CRNA and use Xcode and Android Studio. + +This is usually as simple as running `npm run eject` in your project, which will walk you through the process. Make sure to install `react-native-cli` and follow the [native code getting started guide for React Native](https://facebook.github.io/react-native/docs/getting-started.html). + +#### Should I Use ExpoKit? + +If you have made use of Expo APIs while working on your project, then those API calls will stop working if you eject to a regular React Native project. If you want to continue using those APIs, you can eject to "React Native + ExpoKit" which will still allow you to build your own native code and continue using the Expo APIs. See the [ejecting guide](https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md) for more details about this option. + +## Troubleshooting + +### Networking + +If you're unable to load your app on your phone due to a network timeout or a refused connection, a good first step is to verify that your phone and computer are on the same network and that they can reach each other. Create React Native App needs access to ports 19000 and 19001 so ensure that your network and firewall settings allow access from your device to your computer on both of these ports. + +Try opening a web browser on your phone and opening the URL that the packager script prints, replacing `exp://` with `http://`. So, for example, if underneath the QR code in your terminal you see: + + exp://192.168.0.1:19000 + +Try opening Safari or Chrome on your phone and loading + + http://192.168.0.1:19000 + +and + + http://192.168.0.1:19001 + +If this works, but you're still unable to load your app by scanning the QR code, please open an issue on the [Create React Native App repository](https://github.com/react-community/create-react-native-app) with details about these steps and any other error messages you may have received. + +If you're not able to load the `http` URL in your phone's web browser, try using the tethering/mobile hotspot feature on your phone (beware of data usage, though), connecting your computer to that WiFi network, and restarting the packager. + +### iOS Simulator won't open + +If you're on a Mac, there are a few errors that users sometimes see when attempting to `npm run ios`: + +- "non-zero exit code: 107" +- "You may need to install Xcode" but it is already installed +- and others + +There are a few steps you may want to take to troubleshoot these kinds of errors: + +1. Make sure Xcode is installed and open it to accept the license agreement if it prompts you. You can install it from the Mac App Store. +2. Open Xcode's Preferences, the Locations tab, and make sure that the `Command Line Tools` menu option is set to something. Sometimes when the CLI tools are first installed by Homebrew this option is left blank, which can prevent Apple utilities from finding the simulator. Make sure to re-run `npm/yarn run ios` after doing so. +3. If that doesn't work, open the Simulator, and under the app menu select `Reset Contents and Settings...`. After that has finished, quit the Simulator, and re-run `npm/yarn run ios`. + +### QR Code does not scan + +If you're not able to scan the QR code, make sure your phone's camera is focusing correctly, and also make sure that the contrast on the two colors in your terminal is high enough. For example, WebStorm's default themes may [not have enough contrast](https://github.com/react-community/create-react-native-app/issues/49) for terminal QR codes to be scannable with the system barcode scanners that the Expo app uses. + +If this causes problems for you, you may want to try changing your terminal's color theme to have more contrast, or running Create React Native App from a different terminal. You can also manually enter the URL printed by the packager script in the Expo app's search bar to load it manually. diff --git a/examples/crna-getstorybook/__tests__/__snapshots__/storyshots.js.snap b/examples/crna-getstorybook/__tests__/__snapshots__/storyshots.js.snap new file mode 100644 index 000000000000..bc75b09ed489 --- /dev/null +++ b/examples/crna-getstorybook/__tests__/__snapshots__/storyshots.js.snap @@ -0,0 +1,151 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Button with some emoji 1`] = ` + + + + πŸ˜€ 😎 πŸ‘ πŸ’― + + + +`; + +exports[`Storyshots Button with text 1`] = ` + + + + Hello Button + + + +`; + +exports[`Storyshots Welcome to Storybook 1`] = ` + + + Welcome to React Native Storybook + + + This is a UI Component development environment for your React Native app. Here you can display and interact with your UI components as stories. A story is a single state of one or more UI components. You can have as many stories as you want. In other words a story is like a visual test case. + + + We have added some stories inside the "storybook/stories" directory for examples. Try editing the "storybook/stories/Welcome.js" file to edit this message. + + +`; diff --git a/examples/crna-getstorybook/__tests__/storyshots.js b/examples/crna-getstorybook/__tests__/storyshots.js new file mode 100644 index 000000000000..4f625b473e29 --- /dev/null +++ b/examples/crna-getstorybook/__tests__/storyshots.js @@ -0,0 +1,7 @@ +import path from 'path'; +import initStoryshots from '@storybook/addon-storyshots'; + +initStoryshots({ + framework: 'react-native', + configPath: path.join(__dirname, '..', 'storybook'), +}); diff --git a/examples/crna-getstorybook/app.json b/examples/crna-getstorybook/app.json new file mode 100644 index 000000000000..46c3343ebc68 --- /dev/null +++ b/examples/crna-getstorybook/app.json @@ -0,0 +1,5 @@ +{ + "expo": { + "sdkVersion": "17.0.0" + } +} diff --git a/examples/crna-getstorybook/jest.config.js b/examples/crna-getstorybook/jest.config.js new file mode 100644 index 000000000000..377a172fabae --- /dev/null +++ b/examples/crna-getstorybook/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + preset: 'react-native', + globals: { + __DEV__: true, + }, +}; diff --git a/examples/crna-getstorybook/package.json b/examples/crna-getstorybook/package.json new file mode 100644 index 000000000000..9a5be5dcce93 --- /dev/null +++ b/examples/crna-getstorybook/package.json @@ -0,0 +1,34 @@ +{ + "name": "crna-getstorybook", + "version": "0.1.0", + "private": true, + "devDependencies": { + "react-native-scripts": "0.0.31", + "jest-expo": "~1.0.1", + "react-test-renderer": "16.0.0-alpha.6", + "react-dom": "^15.5.4", + "@storybook/addon-actions": "*", + "@storybook/addon-links": "*", + "@storybook/addon-storyshots": "*", + "@storybook/addons": "*", + "@storybook/channels": "*", + "@storybook/react-native": "*" + }, + "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js", + "scripts": { + "start": "react-native-scripts start", + "eject": "react-native-scripts eject", + "android": "react-native-scripts android", + "ios": "react-native-scripts ios", + "test": "node node_modules/jest/bin/jest.js --watch", + "storybook": "storybook start -p 7007" + }, + "jest": { + "preset": "jest-expo" + }, + "dependencies": { + "expo": "^17.0.0", + "react": "16.0.0-alpha.6", + "react-native": "^0.44.0" + } +} diff --git a/examples/crna-getstorybook/storybook/addons.js b/examples/crna-getstorybook/storybook/addons.js new file mode 100644 index 000000000000..6aed412d04af --- /dev/null +++ b/examples/crna-getstorybook/storybook/addons.js @@ -0,0 +1,2 @@ +import '@storybook/addon-actions/register'; +import '@storybook/addon-links/register'; diff --git a/examples/crna-getstorybook/storybook/index.js b/examples/crna-getstorybook/storybook/index.js new file mode 100644 index 000000000000..fe7c22a703d5 --- /dev/null +++ b/examples/crna-getstorybook/storybook/index.js @@ -0,0 +1,9 @@ +import { getStorybookUI, configure } from '@storybook/react-native'; + +// import stories +configure(() => { + require('./stories'); // eslint-disable-line global-require +}, module); + +const StorybookUI = getStorybookUI({ port: 7007, host: 'localhost' }); +export default StorybookUI; diff --git a/examples/crna-getstorybook/storybook/stories/Button/index.android.js b/examples/crna-getstorybook/storybook/stories/Button/index.android.js new file mode 100644 index 000000000000..178e9ba70878 --- /dev/null +++ b/examples/crna-getstorybook/storybook/stories/Button/index.android.js @@ -0,0 +1,18 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { TouchableNativeFeedback } from 'react-native'; + +const Button = props => + + {props.children} + ; + +Button.propTypes = { + children: PropTypes.node.isRequired, + onPress: PropTypes.func, +}; +Button.defaultProps = { + onPress: () => {}, +}; + +export { Button as default }; diff --git a/examples/crna-getstorybook/storybook/stories/Button/index.ios.js b/examples/crna-getstorybook/storybook/stories/Button/index.ios.js new file mode 100644 index 000000000000..fb647e78a82c --- /dev/null +++ b/examples/crna-getstorybook/storybook/stories/Button/index.ios.js @@ -0,0 +1,18 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { TouchableHighlight } from 'react-native'; + +const Button = props => + + {props.children} + ; + +Button.propTypes = { + children: PropTypes.node.isRequired, + onPress: PropTypes.func, +}; +Button.defaultProps = { + onPress: () => {}, +}; + +export { Button as default }; diff --git a/examples/crna-getstorybook/storybook/stories/CenterView/index.js b/examples/crna-getstorybook/storybook/stories/CenterView/index.js new file mode 100644 index 000000000000..93c04ff6e8cf --- /dev/null +++ b/examples/crna-getstorybook/storybook/stories/CenterView/index.js @@ -0,0 +1,15 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { View } from 'react-native'; +import style from './style'; + +const CenterView = props => + + {props.children} + ; + +CenterView.propTypes = { + children: PropTypes.node.isRequired, +}; + +export { CenterView as default }; diff --git a/examples/crna-getstorybook/storybook/stories/CenterView/style.js b/examples/crna-getstorybook/storybook/stories/CenterView/style.js new file mode 100644 index 000000000000..ff347fd9841f --- /dev/null +++ b/examples/crna-getstorybook/storybook/stories/CenterView/style.js @@ -0,0 +1,8 @@ +export default { + main: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#F5FCFF', + }, +}; diff --git a/examples/crna-getstorybook/storybook/stories/Welcome/index.js b/examples/crna-getstorybook/storybook/stories/Welcome/index.js new file mode 100644 index 000000000000..c99a9aba96aa --- /dev/null +++ b/examples/crna-getstorybook/storybook/stories/Welcome/index.js @@ -0,0 +1,52 @@ +import React from 'react'; +import { View, Text } from 'react-native'; +import PropTypes from 'prop-types'; + +export default class Welcome extends React.Component { + styles = { + wrapper: { + flex: 1, + padding: 24, + justifyContent: 'center', + }, + header: { + fontSize: 18, + marginBottom: 18, + }, + content: { + fontSize: 12, + marginBottom: 10, + lineHeight: 18, + }, + }; + + showApp(event) { + event.preventDefault(); + this.props.showApp(); + } + + render() { + return ( + + Welcome to React Native Storybook + + This is a UI Component development environment for your React Native app. Here you can + display and interact with your UI components as stories. A story is a single state of one + or more UI components. You can have as many stories as you want. In other words a story is + like a visual test case. + + + We have added some stories inside the "storybook/stories" directory for examples. Try + editing the "storybook/stories/Welcome.js" file to edit this message. + + + ); + } +} + +Welcome.propTypes = { + showApp: PropTypes.func, +}; +Welcome.defaultProps = { + showApp: () => {}, +}; diff --git a/examples/crna-getstorybook/storybook/stories/index.js b/examples/crna-getstorybook/storybook/stories/index.js new file mode 100644 index 000000000000..1f0e1cb917a5 --- /dev/null +++ b/examples/crna-getstorybook/storybook/stories/index.js @@ -0,0 +1,25 @@ +import React from 'react'; +import { Text } from 'react-native'; + +import { storiesOf } from '@storybook/react-native'; +import { action } from '@storybook/addon-actions'; +import { linkTo } from '@storybook/addon-links'; + +import Button from './Button'; +import CenterView from './CenterView'; +import Welcome from './Welcome'; + +storiesOf('Welcome', module).add('to Storybook', () => ); + +storiesOf('Button', module) + .addDecorator(getStory => {getStory()}) + .add('with text', () => + + ) + .add('with some emoji', () => + + ); diff --git a/lerna.json b/lerna.json index 5a2dd9a3af1a..8eaca388084c 100644 --- a/lerna.json +++ b/lerna.json @@ -9,8 +9,9 @@ "publish": { "ignore": [ "cra-kitchen-sink", - "test-cra", - "react-native-getstorybook" + "crna-getstorybook", + "react-native-getstorybook", + "test-cra" ] } }, From 8d039e235f341a41e4865b328a9d606c69aa07b3 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 12 Jun 2017 19:59:02 +1200 Subject: [PATCH 14/14] Add link to info markdown Per https://github.com/storybooks/storybook/pull/1258 --- examples/cra-kitchen-sink/src/stories/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/cra-kitchen-sink/src/stories/index.js b/examples/cra-kitchen-sink/src/stories/index.js index a85dea1474bc..c294b06c8f05 100644 --- a/examples/cra-kitchen-sink/src/stories/index.js +++ b/examples/cra-kitchen-sink/src/stories/index.js @@ -42,8 +42,10 @@ storiesOf('Button', module) return ; }) - .addWithInfo('with some info', 'Use the info addon with its painful API.', () => - + .addWithInfo( + 'with some info', + 'Use the [info addon](https://github.com/storybooks/storybook/tree/master/addons/info) with its painful API.', + () => ); storiesOf('App', module).add('full app', () => );