Skip to content

Commit

Permalink
Core: Rename load => configure
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Jul 26, 2019
1 parent adef6bd commit 0ac4898
Show file tree
Hide file tree
Showing 38 changed files with 58 additions and 77 deletions.
1 change: 0 additions & 1 deletion app/angular/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

export { moduleMetadata } from './preview/angular/decorators';
Expand Down
7 changes: 3 additions & 4 deletions app/angular/src/client/preview/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable prefer-destructuring */
import { start } from '@storybook/core/client';
import { ClientStoryApi } from '@storybook/addons';
import { ClientStoryApi, Loadable } from '@storybook/addons';

import './globals';
import render from './render';
Expand All @@ -10,7 +10,7 @@ const framework = 'angular';

interface ClientApi extends ClientStoryApi<StoryFnAngularReturnType> {
setAddon(addon: any): void;
configure(loaders: () => void, module: NodeModule): void;
configure(loader: Loadable, module: NodeModule, framework: string): void;
getStorybook(): IStorybookSection[];
clearDecorators(): void;
forceReRender(): void;
Expand All @@ -26,12 +26,11 @@ export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
});
};

export const load: ClientApi['load'] = (...args) => api.load(...args, framework);
export const configure: ClientApi['configure'] = (...args) => api.configure(...args, framework);
export const addDecorator: ClientApi['addDecorator'] = api.clientApi.addDecorator;
export const addParameters: ClientApi['addParameters'] = api.clientApi.addParameters;
export const clearDecorators: ClientApi['clearDecorators'] = api.clientApi.clearDecorators;
export const setAddon: ClientApi['setAddon'] = api.clientApi.setAddon;
export const configure: ClientApi['configure'] = api.configApi.configure;
export const forceReRender: ClientApi['forceReRender'] = api.forceReRender;
export const getStorybook: ClientApi['getStorybook'] = api.clientApi.getStorybook;
export const raw: ClientApi['raw'] = api.clientApi.raw;
1 change: 0 additions & 1 deletion app/ember/src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

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

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

export const {
setAddon,
Expand All @@ -16,7 +16,6 @@ export const {

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

export const { configure } = configApi;
export { forceReRender };
1 change: 0 additions & 1 deletion app/html/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
8 changes: 3 additions & 5 deletions app/html/src/client/preview/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable prefer-destructuring */
import { start } from '@storybook/core/client';
import { ClientStoryApi } from '@storybook/addons';
import { ClientStoryApi, Loadable } from '@storybook/addons';

import './globals';
import render from './render';
Expand All @@ -10,12 +10,11 @@ const framework = 'html';

interface ClientApi extends ClientStoryApi<StoryFnHtmlReturnType> {
setAddon(addon: any): void;
configure(loaders: () => void, module: NodeModule): void;
configure(loader: Loadable, module: NodeModule, framework: string): void;
getStorybook(): IStorybookSection[];
clearDecorators(): void;
forceReRender(): void;
raw: () => any; // todo add type
load: (req: any, m: NodeModule, framework: string) => void;
}

const api = start(render);
Expand All @@ -26,12 +25,11 @@ export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
});
};

export const load: ClientApi['load'] = (...args) => api.load(...args, framework);
export const configure: ClientApi['configure'] = (...args) => api.configure(...args, framework);
export const addDecorator: ClientApi['addDecorator'] = api.clientApi.addDecorator;
export const addParameters: ClientApi['addParameters'] = api.clientApi.addParameters;
export const clearDecorators: ClientApi['clearDecorators'] = api.clientApi.clearDecorators;
export const setAddon: ClientApi['setAddon'] = api.clientApi.setAddon;
export const configure: ClientApi['configure'] = api.configApi.configure;
export const forceReRender: ClientApi['forceReRender'] = api.forceReRender;
export const getStorybook: ClientApi['getStorybook'] = api.clientApi.getStorybook;
export const raw: ClientApi['raw'] = api.clientApi.raw;
1 change: 0 additions & 1 deletion app/marko/src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

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

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

export const {
setAddon,
Expand All @@ -16,7 +16,6 @@ export const {

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

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

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

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

export const {
setAddon,
Expand All @@ -16,7 +16,6 @@ export const {

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

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

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

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

export const {
setAddon,
Expand All @@ -16,7 +16,6 @@ export const {

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

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

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

export const {
setAddon,
Expand All @@ -16,7 +16,6 @@ export const {

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

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

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

export const {
setAddon,
Expand All @@ -16,7 +16,6 @@ export const {

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

export const { configure } = configApi;
export { forceReRender };
1 change: 0 additions & 1 deletion app/react/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export {
getStorybook,
raw,
forceReRender,
load,
} from './preview';

if (module && module.hot && module.hot.decline) {
Expand Down
8 changes: 3 additions & 5 deletions app/react/src/client/preview/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable prefer-destructuring */
import { start } from '@storybook/core/client';
import { ClientStoryApi } from '@storybook/addons';
import { ClientStoryApi, Loadable } from '@storybook/addons';

import './globals';
import render from './render';
Expand All @@ -10,12 +10,11 @@ const framework = 'react';

interface ClientApi extends ClientStoryApi<StoryFnReactReturnType> {
setAddon(addon: any): void;
configure(loaders: () => void, module: NodeModule): void;
configure(loader: Loadable, module: NodeModule, framework: string): void;
getStorybook(): IStorybookSection[];
clearDecorators(): void;
forceReRender(): void;
raw: () => any; // todo add type
load: (...args: any[]) => void;
}

const api = start(render);
Expand All @@ -26,12 +25,11 @@ export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
});
};

export const load: ClientApi['load'] = (...args) => api.load(...args, framework);
export const configure: ClientApi['configure'] = (...args) => api.configure(...args, framework);
export const addDecorator: ClientApi['addDecorator'] = api.clientApi.addDecorator;
export const addParameters: ClientApi['addParameters'] = api.clientApi.addParameters;
export const clearDecorators: ClientApi['clearDecorators'] = api.clientApi.clearDecorators;
export const setAddon: ClientApi['setAddon'] = api.clientApi.setAddon;
export const configure: ClientApi['configure'] = api.configApi.configure;
export const forceReRender: ClientApi['forceReRender'] = api.forceReRender;
export const getStorybook: ClientApi['getStorybook'] = api.clientApi.getStorybook;
export const raw: ClientApi['raw'] = api.clientApi.raw;
1 change: 0 additions & 1 deletion app/riot/src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export {
compileNow,
asCompiledCode,
raw,
load,
} from './preview';

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

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

export const {
setAddon,
Expand All @@ -18,9 +18,8 @@ export const {

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

export const { configure } = configApi;
const mount = vendorMount.bind(riot, '#root');
const compileNow = unboundCompileNow.bind(null, tag2);
export { forceReRender, render, tag2 as tag, mount, compileNow, asCompiledCode };
1 change: 0 additions & 1 deletion app/svelte/src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export {
getStorybook,
forceReRender,
raw,
load,
} from './preview';

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

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

export const {
setAddon,
Expand All @@ -16,7 +16,6 @@ export const {

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

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

if (module && module.hot && module.hot.decline) {
Expand Down
7 changes: 4 additions & 3 deletions app/vue/src/client/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ function decorateStory(getStory, decorators) {
);
}

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

export const {
setAddon,
Expand All @@ -88,7 +90,6 @@ export const {

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

export const { configure } = configApi;
export { forceReRender };
4 changes: 2 additions & 2 deletions examples/ember-cli/.storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { load, addParameters, addDecorator } from '@storybook/ember';
import { configure, addParameters, addDecorator } from '@storybook/ember';
import { withA11y } from '@storybook/addon-a11y';

addDecorator(withA11y);
Expand All @@ -9,4 +9,4 @@ addParameters({
},
});

load(require.context('../stories', true, /\.stories\.js$/), module);
configure(require.context('../stories', true, /\.stories\.js$/), module);
4 changes: 2 additions & 2 deletions examples/html-kitchen-sink/.storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { load, addParameters, addDecorator } from '@storybook/html';
import { configure, addParameters, addDecorator } from '@storybook/html';
import { withA11y } from '@storybook/addon-a11y';
import { DocsPage } from '@storybook/addon-docs/blocks';

Expand All @@ -21,4 +21,4 @@ addParameters({
docs: DocsPage,
});

load(require.context('../stories', true, /\.stories\.(js|mdx)$/), module);
configure(require.context('../stories', true, /\.stories\.(js|mdx)$/), module);
4 changes: 2 additions & 2 deletions examples/marko-cli/.storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { load, addParameters, addDecorator } from '@storybook/marko';
import { configure, addParameters, addDecorator } from '@storybook/marko';
import { withA11y } from '@storybook/addon-a11y';

addDecorator(withA11y);
Expand All @@ -8,4 +8,4 @@ addParameters({
},
});

load(require.context('../src/stories', true, /\.stories\.js$/), module);
configure(require.context('../src/stories', true, /\.stories\.js$/), module);
Loading

0 comments on commit 0ac4898

Please sign in to comment.