Skip to content

Commit

Permalink
Addon-docs: Module story format & framework param (#7110)
Browse files Browse the repository at this point in the history
Addon-docs: Module story format & framework param
  • Loading branch information
shilman committed Jun 19, 2019
2 parents 5f8e9d0 + 766ae4a commit fbb11ad
Show file tree
Hide file tree
Showing 28 changed files with 140 additions and 100 deletions.
1 change: 1 addition & 0 deletions app/angular/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

export { moduleMetadata } from './preview/angular/decorators';
Expand Down
7 changes: 5 additions & 2 deletions app/angular/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'angular';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
1 change: 1 addition & 0 deletions app/ember/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/ember/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'ember';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
1 change: 1 addition & 0 deletions app/html/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/html/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'html';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
1 change: 1 addition & 0 deletions app/marko/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/marko/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'marko';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
1 change: 1 addition & 0 deletions app/mithril/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/mithril/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'mithril';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
1 change: 1 addition & 0 deletions app/polymer/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/polymer/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'polymer';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
1 change: 1 addition & 0 deletions app/preact/src/client/index.js
Expand Up @@ -7,4 +7,5 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';
7 changes: 5 additions & 2 deletions app/preact/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'preact';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
5 changes: 4 additions & 1 deletion app/react-native/src/index.ts
Expand Up @@ -2,7 +2,7 @@ import Preview from './preview';

const preview = new Preview();

export const storiesOf = preview.api().storiesOf.bind(preview);
const rawStoriesOf = preview.api().storiesOf.bind(preview);
export const setAddon = preview.api().setAddon.bind(preview);
export const addDecorator = preview.api().addDecorator.bind(preview);
export const addParameters = preview.api().addParameters.bind(preview);
Expand All @@ -11,3 +11,6 @@ export const configure = preview.configure;
export const getStorybook = preview.api().getStorybook.bind(preview);
export const getStorybookUI = preview.getStorybookUI;
export const raw = preview.api().raw.bind(preview);

export const storiesOf = (...args: any[]) =>
rawStoriesOf(...args).addParameters({ framework: 'react-native' });
1 change: 1 addition & 0 deletions app/react/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
raw,
forceReRender,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/react/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'react';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
1 change: 1 addition & 0 deletions app/riot/src/client/index.js
Expand Up @@ -12,6 +12,7 @@ export {
compileNow,
asCompiledCode,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/riot/src/client/preview/index.js
Expand Up @@ -5,10 +5,9 @@ import riot, { tag2, mount as vendorMount } from 'riot';
import render from './render';
import { compileNow as unboundCompileNow, asCompiledCode } from './compileStageFunctions';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -17,6 +16,10 @@ export const {
raw,
} = clientApi;

const framework = 'riot';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
const mount = vendorMount.bind(riot, '#root');
const compileNow = unboundCompileNow.bind(null, tag2);
Expand Down
1 change: 1 addition & 0 deletions app/svelte/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/svelte/src/client/preview/index.js
Expand Up @@ -3,10 +3,9 @@ import { start } from '@storybook/core/client';
import './globals';
import render from './render';

const { clientApi, configApi, forceReRender } = start(render);
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'svelte';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
1 change: 1 addition & 0 deletions app/vue/src/client/index.js
Expand Up @@ -7,6 +7,7 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 5 additions & 2 deletions app/vue/src/client/preview/index.js
Expand Up @@ -70,10 +70,9 @@ function decorateStory(getStory, decorators) {
);
}

const { clientApi, configApi, forceReRender } = start(render, { decorateStory });
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render, { decorateStory });

export const {
storiesOf,
setAddon,
addDecorator,
addParameters,
Expand All @@ -82,5 +81,9 @@ export const {
raw,
} = clientApi;

const framework = 'vue';
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
export const load = (...args) => coreLoad(...args, framework);

export const { configure } = configApi;
export { forceReRender };
Expand Up @@ -12,7 +12,7 @@ exports[`Storyshots Core|Parameters passed to story 1`] = `
<button
_ngcontent-a-c10=""
>
Parameters are {"options":{"hierarchyRootSeparator":{},"hierarchySeparator":{}},"globalParameter":"globalParameter","chapterParameter":"chapterParameter","storyParameter":"storyParameter"}
Parameters are {"options":{"hierarchyRootSeparator":{},"hierarchySeparator":{}},"globalParameter":"globalParameter","framework":"angular","chapterParameter":"chapterParameter","storyParameter":"storyParameter"}
</button>
</storybook-button-component>
</storybook-dynamic-app-root>
Expand Down

1 comment on commit fbb11ad

@vercel
Copy link

@vercel vercel bot commented on fbb11ad Jun 19, 2019

Choose a reason for hiding this comment

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

Please sign in to comment.