From bcf18cc95c174da792b5107031e2dc9030904456 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 1 Jul 2019 16:30:49 +0200 Subject: [PATCH] FIX types --- lib/addons/src/make-decorator.ts | 28 +- lib/client-api/src/client_api.test.ts | 20 +- lib/client-api/src/client_api.ts | 93 +++--- lib/client-api/src/config_api.ts | 31 +- lib/client-api/src/story_store.ts | 113 ++++--- lib/client-api/src/types.ts | 457 ++------------------------ lib/client-api/src/typings.d.ts | 23 +- lib/client-api/tsconfig.json | 3 +- yarn.lock | 290 ++++++++++++++++ 9 files changed, 486 insertions(+), 572 deletions(-) diff --git a/lib/addons/src/make-decorator.ts b/lib/addons/src/make-decorator.ts index 2347c3b32e49..a826201ec4e4 100644 --- a/lib/addons/src/make-decorator.ts +++ b/lib/addons/src/make-decorator.ts @@ -1,23 +1,39 @@ import deprecate from 'util-deprecate'; +export interface Parameters { + fileName?: string; + options?: OptionsParameter; + [key: string]: any; +} + export interface StoryContext { + id: string; name: string; kind: string; - parameters: { - [key: string]: any; - }; + [key: string]: any; + parameters: Parameters; } export interface WrapperSettings { - options: { - [key: string]: any; - }; + options: OptionsParameter; parameters: { [key: string]: any; }; } +export interface OptionsParameter extends Object { + storySort?: any; + hierarchyRootSeparator?: string; + hierarchySeparator?: RegExp; + theme?: { + base: string; + brandTitle?: string; + }; + [key: string]: any; +} + export type StoryGetter = (context: StoryContext) => any; +export type StoryFn = (p?: StoryContext) => any; export type StoryWrapper = ( getStory: StoryGetter, diff --git a/lib/client-api/src/client_api.test.ts b/lib/client-api/src/client_api.test.ts index 7e663815dcbc..18828725d0f4 100644 --- a/lib/client-api/src/client_api.test.ts +++ b/lib/client-api/src/client_api.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-underscore-dangle */ import { logger } from '@storybook/client-logger'; import { mockChannel } from '@storybook/addons'; import ClientApi from './client_api'; @@ -103,6 +104,7 @@ describe('preview.client_api', () => { clientApi.setAddon({ aa() { + console.log(this); data = this.kind; }, }); @@ -118,7 +120,7 @@ describe('preview.client_api', () => { clientApi.addParameters({ a: '1' }); - // eslint-disable-next-line no-underscore-dangle + // @ts-ignore expect(clientApi._globalParameters).toEqual({ a: '1', options: {} }); }); @@ -128,7 +130,7 @@ describe('preview.client_api', () => { clientApi.addParameters({ options: { a: '1' } }); clientApi.addParameters({ options: { b: '2' } }); - // eslint-disable-next-line no-underscore-dangle + // @ts-ignore expect(clientApi._globalParameters).toEqual({ options: { a: '1', b: '2' } }); }); @@ -138,7 +140,7 @@ describe('preview.client_api', () => { clientApi.addParameters({ backgrounds: ['value'], options: { a: '1', b: '3' } }); clientApi.addParameters({ options: { a: '2' } }); - // eslint-disable-next-line no-underscore-dangle + // @ts-ignore expect(clientApi._globalParameters).toEqual({ backgrounds: ['value'], options: { a: '2', b: '3' }, @@ -151,7 +153,7 @@ describe('preview.client_api', () => { clientApi.addParameters({ backgrounds: ['value'], options: { a: '1', b: '3' } }); clientApi.addParameters({ backgrounds: [], options: { a: '2' } }); - // eslint-disable-next-line no-underscore-dangle + // @ts-ignore expect(clientApi._globalParameters).toEqual({ backgrounds: [], options: { a: '2', b: '3' }, @@ -164,7 +166,7 @@ describe('preview.client_api', () => { clientApi.addParameters({ options: { a: '1', b: '2', theming: { c: '3' } } }); clientApi.addParameters({ options: { theming: { c: '4', d: '5' } } }); - // eslint-disable-next-line no-underscore-dangle + // @ts-ignore expect(clientApi._globalParameters).toEqual({ options: { a: '1', b: '2', theming: { c: '4', d: '5' } }, }); @@ -194,6 +196,7 @@ describe('preview.client_api', () => { addDecorator(fn => `bb-${fn()}`); storiesOf('kind', module).add('name', () => 'Hello'); + const f = storyStore.fromId('x'); expect(storyStore.fromId('kind--name').storyFn()).toBe('bb-Hello'); }); @@ -245,10 +248,12 @@ describe('preview.client_api', () => { describe('clearDecorators', () => { it('should remove all global decorators', () => { const { clientApi } = getContext(undefined); - // eslint-disable-next-line no-underscore-dangle + + // @ts-ignore clientApi._globalDecorators = 1234; clientApi.clearDecorators(); - // eslint-disable-next-line no-underscore-dangle + + // @ts-ignore expect(clientApi._globalDecorators).toEqual([]); }); }); @@ -537,6 +542,7 @@ describe('preview.client_api', () => { } storiesOf('kind', module).add('story', stories[1]); + // @ts-ignore expect(logger.warn.mock.calls[0][0]).toMatch( /Story with id kind--story already exists in the store/ ); diff --git a/lib/client-api/src/client_api.ts b/lib/client-api/src/client_api.ts index 55ad20cc3593..2180a833cd30 100644 --- a/lib/client-api/src/client_api.ts +++ b/lib/client-api/src/client_api.ts @@ -1,7 +1,7 @@ /* eslint no-underscore-dangle: 0 */ import isPlainObject from 'is-plain-object'; import { logger } from '@storybook/client-logger'; -import addons, { Addon } from '@storybook/addons'; +import addons, { StoryContext, StoryFn, Parameters } from '@storybook/addons'; import Events from '@storybook/core-events'; import { toId } from '@storybook/router/utils'; @@ -10,14 +10,13 @@ import isEqual from 'lodash/isEqual'; import get from 'lodash/get'; import { ClientApiParams, - IApi, - IDecoratorParams, - IHierarchyObj, - StoryStore, - StoryFn, + StoryApi, + ClientApiAddon, + DecoratorFunction, + ClientApiAddons, } from './types'; import subscriptionsStore from './subscriptions_store'; -import { IAddon } from '../dist/types'; +import StoryStore from './story_store'; // merge with concatenating arrays, but no duplicates const merge = (a: any, b: any) => @@ -39,25 +38,24 @@ const merge = (a: any, b: any) => return undefined; }); -export const defaultDecorateStory = (storyFn: StoryFn, decorators: any[]) => +interface DecoratorPropData { + [key: string]: any; +} + +export const defaultDecorateStory = (storyFn: StoryFn, decorators: DecoratorFunction[]) => decorators.reduce( - (decorated, decorator) => (context: { parameters: any; options: any }) => - decorator((p: { parameters: any; options: any }) => { - console.log('p: ', p); - - return ( - decorated( - // MUTATION ! - Object.assign( - context, - p, - { parameters: Object.assign(context.parameters || {}, p.parameters) }, - { options: Object.assign(context.options || {}, p.options) } - ) - ), - context + (decorated, decorator) => (context: StoryContext) => + decorator((p: DecoratorPropData = {}) => { + return decorated( + // MUTATION ! + Object.assign( + context, + p, + { parameters: Object.assign(context.parameters || {}, p.parameters) }, + { options: Object.assign(context.options || {}, p.options) } + ) ); - }), + }, context), storyFn ); @@ -78,20 +76,16 @@ const withSubscriptionTracking = (storyFn: StoryFn) => { return result; }; -interface Addons { - [key: string]: Addon; -} - export default class ClientApi { private _storyStore: StoryStore; - private _addons: Addons; + private _addons: ClientApiAddons; - private _globalDecorators: any[]; + private _globalDecorators: DecoratorFunction[]; - private _globalParameters: { [key: string]: any }; + private _globalParameters: Parameters; - private _decorateStory: (storyFn: StoryFn, decorators: any) => any; + private _decorateStory: (storyFn: StoryFn, decorators: DecoratorFunction[]) => any; constructor({ storyStore, decorateStory = defaultDecorateStory }: ClientApiParams) { this._storyStore = storyStore; @@ -123,9 +117,11 @@ export default class ClientApi { this._globalParameters.options ); - addDecorator = (decorator: () => any) => this._globalDecorators.push(decorator); + addDecorator = (decorator: DecoratorFunction) => { + this._globalDecorators.push(decorator); + }; - addParameters = (parameters: IDecoratorParams[] | { globalParameter: 'string' }) => { + addParameters = (parameters: Parameters | { globalParameter: 'string' }) => { this._globalParameters = { ...this._globalParameters, ...parameters, @@ -154,32 +150,31 @@ export default class ClientApi { if (m && m.hot && m.hot.dispose) { m.hot.dispose(() => { const { _storyStore } = this; - _storyStore.remove(undefined); - - // TODO: refactor this - // Maybe not needed at all if stories can just be overwriten ? - this._storyStore.removeStoryKind(kind); - this._storyStore.incrementRevision(); + _storyStore.removeStoryKind(kind); + _storyStore.incrementRevision(); }); } - const localDecorators: any[] | (() => void)[] = []; - let localParameters = {}; + const localDecorators: DecoratorFunction[] = []; + let localParameters: Parameters = {}; let hasAdded = false; - const api = { + const api: StoryApi = { kind, - } as IApi; + add: () => api, + addDecorator: () => api, + addParameters: () => api, + }; // apply addons Object.keys(this._addons).forEach(name => { - const addon = this._addons[name] as IAddon; + const addon = this._addons[name] as ClientApiAddon; api[name] = (...args: any[]) => { addon.apply(api, args); return api; }; }); - api.add = (storyName: string, storyFn: StoryFn, parameters: any) => { + api.add = (storyName: string, storyFn: StoryFn, parameters: Parameters) => { hasAdded = true; const { _globalParameters, _globalDecorators } = this; @@ -198,7 +193,7 @@ export default class ClientApi { const fileName = m && m.id ? `${m.id}` : undefined; const { hierarchyRootSeparator, hierarchySeparator } = this.getSeparators(); - const baseOptions = { + const baseOptions: Parameters['options'] = { hierarchyRootSeparator, hierarchySeparator, }; @@ -208,7 +203,7 @@ export default class ClientApi { localParameters, parameters, ].reduce( - (acc, p) => { + (acc: Parameters, p) => { if (p) { Object.entries(p).forEach(([key, value]) => { const existingValue = acc[key]; @@ -273,7 +268,7 @@ This is probably not what you intended. Read more here: https://github.com/story const fileName = this._storyStore.getStoryFileName(kind); const stories = this._storyStore.getStories(kind).map(name => { - const render = this._storyStore.getStoryWithContext(); + const render = this._storyStore.getStoryWithContext(kind, name); return { name, render }; }); diff --git a/lib/client-api/src/config_api.ts b/lib/client-api/src/config_api.ts index 7780fa97fdc3..58a02d2b8d28 100644 --- a/lib/client-api/src/config_api.ts +++ b/lib/client-api/src/config_api.ts @@ -1,22 +1,11 @@ +// / /* eslint no-underscore-dangle: 0 */ import Events from '@storybook/core-events'; -import { logger } from '@storybook/client-logger'; -import { PostmsgTransport } from '@storybook/channel-postmessage'; import Channel from '@storybook/channels'; -import { ClientApi, StoryStore, IModule } from './types'; - -interface IChannel { - events: { - forceReRender: []; - registerSubscription: []; - setCurrentStory: []; - 'storybook/a11y/request': []; - }; - isAsync: boolean; - sender: string; - transport: PostmsgTransport; -} +import { ErrorLike } from './types'; +import StoryStore from './story_store'; +import ClientApi from './client_api'; export default class ConfigApi { _channel: Channel; @@ -30,13 +19,13 @@ export default class ConfigApi { constructor({ channel, storyStore, - clearDecorators, clientApi, + clearDecorators, }: { channel: Channel | null; storyStore: StoryStore; - clearDecorators: any; clientApi: ClientApi; + clearDecorators: () => void; }) { // channel can be null when running in node // always check whether channel is available @@ -53,11 +42,11 @@ export default class ConfigApi { _renderError(err: Error) { const { stack, message } = err; - const error = { stack, message }; - this._storyStore.setSelection({ error }, undefined); + const error: ErrorLike = { stack, message }; + this._storyStore.setSelection(undefined, error); } - configure = (loaders: () => void, module: IModule) => { + configure = (loaders: () => void, module: NodeModule) => { const render = () => { const errors = []; @@ -82,7 +71,7 @@ export default class ConfigApi { throw errors[0]; } else { - this._storyStore.setSelection(undefined, null); + this._storyStore.setSelection(undefined, undefined); } }; diff --git a/lib/client-api/src/story_store.ts b/lib/client-api/src/story_store.ts index 78c2a2ab8705..e0a98f12d6a6 100644 --- a/lib/client-api/src/story_store.ts +++ b/lib/client-api/src/story_store.ts @@ -7,15 +7,15 @@ import { stripIndents } from 'common-tags'; import { Channel } from '@storybook/channels'; import Events from '@storybook/core-events'; import { logger } from '@storybook/client-logger'; +import { StoryContext, StoryFn, Parameters } from '@storybook/addons'; import { DecoratorFunction, - HandlerFunction, - DecoratorData, - Decorator, - DecoratorParameters, LegacyData, LegacyItem, - Keys, + StoreData, + AddStoryArgs, + StoreItem, + ErrorLike, } from './types'; // TODO: these are copies from components/nav/lib @@ -43,26 +43,33 @@ const toExtracted = (obj: T) => return Object.assign(acc, { [key]: value }); }, {}); +interface Selection { + storyId: string; + viewMode: string; +} + export default class StoryStore extends EventEmitter { - _legacydata: LegacyData; + _error?: ErrorLike; - _data: DecoratorData; + _channel: Channel; - _revision: number; + _data: StoreData; - _selection: {}; + _legacyData?: LegacyData; - _channel: Channel; + _legacydata: LegacyData; - _error?: Error; + _revision: number; + + _selection: Selection; constructor(params: { channel: Channel }) { super(); this._legacydata = ({} as any) as LegacyData; - this._data = ({} as any) as any; + this._data = ({} as any) as StoreData; this._revision = 0; - this._selection = {}; + this._selection = ({} as any) as Selection; this._channel = params.channel; this._error = undefined; } @@ -72,9 +79,9 @@ export default class StoryStore extends EventEmitter { }; // NEW apis - fromId = (id: string) => { + fromId = (id: string): StoreItem | null => { try { - const data = this._data[id as Keys]; + const data = this._data[id as string]; if (!data || !data.getDecorated) { return null; @@ -84,7 +91,7 @@ export default class StoryStore extends EventEmitter { } catch (e) { logger.warn('failed to get story:', this._data); logger.error(e); - return {}; + return null; } }; @@ -99,7 +106,8 @@ export default class StoryStore extends EventEmitter { // determine if we should apply a sort to the stories or just use default import order if (Object.values(this._data).length > 0) { const index = Object.keys(this._data).find( - key => this._data[key] && this._data[key].parameters && this._data[key].parameters.options + key => + !!(this._data[key] && this._data[key].parameters && this._data[key].parameters.options) ); if (index && this._data[index].parameters.options.storySort) { const sortFn = this._data[index].parameters.options.storySort; @@ -110,10 +118,9 @@ export default class StoryStore extends EventEmitter { return stories.reduce((a, [k, v]) => Object.assign(a, { [k]: toExtracted(v) }), {}); } - setSelection = (data: any, error?: Error) => { - const { storyId, viewMode } = data; - - this._selection = data === undefined ? this._selection : { storyId, viewMode }; + setSelection(data: Selection | undefined, error: ErrorLike): void { + this._selection = + data === undefined ? this._selection : { storyId: data.storyId, viewMode: data.viewMode }; this._error = error === undefined ? this._error : error; setTimeout(() => { @@ -125,42 +132,30 @@ export default class StoryStore extends EventEmitter { // should be deprecated in future. this.emit(Events.STORY_RENDER); }, 1); - }; + } - getSelection = () => this._selection; + getSelection = (): Selection => this._selection; - getError = () => this._error; + getError = (): ErrorLike | undefined => this._error; remove = (id: string): void => { const { _data } = this; - delete _data[id as Keys]; + delete _data[id]; }; addStory( - { - id, - kind, - name, - storyFn: original, - parameters = ({} as any) as DecoratorParameters, - }: { - id: string; - kind: string; - name: string; - storyFn?: () => any; - parameters: DecoratorParameters; - }, + { id, kind, name, storyFn: original, parameters = {} }: AddStoryArgs, { getDecorators, applyDecorators, }: { - getDecorators: () => (...args: any[]) => any[]; - applyDecorators: (decorators: DecoratorFunction, actionCallback: HandlerFunction) => void; + getDecorators: () => DecoratorFunction[]; + applyDecorators: (fn: StoryFn, decorators: DecoratorFunction[]) => any; } ) { const { _data } = this; - if (_data[id as Keys]) { + if (_data[id]) { logger.warn(stripIndents` Story with id ${id} already exists in the store! @@ -180,12 +175,14 @@ export default class StoryStore extends EventEmitter { const getOriginal = () => original; // lazily decorate the story when it's loaded - const getDecorated = memoize(1)(() => applyDecorators(getOriginal(), getDecorators())) as any; // not sure why, but continues to block build if not any + const getDecorated: () => StoryFn = memoize(1)(() => + applyDecorators(getOriginal(), getDecorators()) + ); - const storyFn = (p: any) => + const storyFn: StoryFn = (p: StoryContext) => getDecorated()({ ...identification, parameters: { ...parameters, ...p } }); - _data[id as Keys] = toChild({ + _data[id] = { ...identification, getDecorated, @@ -193,7 +190,7 @@ export default class StoryStore extends EventEmitter { storyFn, parameters, - }) as Decorator; + }; // LEGACY DATA this.addLegacyStory({ kind, name, storyFn, parameters }); @@ -228,12 +225,12 @@ export default class StoryStore extends EventEmitter { }: { kind: string; name: string; - storyFn: (p?: any) => any; - parameters: { fileName?: string }; + storyFn: StoryFn; + parameters: Parameters; }) { const k = toKey(kind); - if (!this._legacydata[k as Keys]) { - this._legacydata[k as Keys] = { + if (!this._legacydata[k as string]) { + this._legacydata[k as string] = { kind, fileName: parameters.fileName, index: getId(), @@ -241,7 +238,7 @@ export default class StoryStore extends EventEmitter { }; } - this._legacydata[k as Keys].stories[toKey(name)] = { + this._legacydata[k as string].stories[toKey(name)] = { name, // kind, index: getId(), @@ -260,19 +257,19 @@ export default class StoryStore extends EventEmitter { getStories(kind: string) { const key = toKey(kind); - if (!this._legacydata[key as Keys]) { + if (!this._legacydata[key as string]) { return []; } - return Object.keys(this._legacydata[key as Keys].stories) - .map(name => this._legacydata[key as Keys].stories[name]) + return Object.keys(this._legacydata[key as string].stories) + .map(name => this._legacydata[key as string].stories[name]) .sort((info1, info2) => info1.index - info2.index) .map(info => info.name); } getStoryFileName(kind: string) { const key = toKey(kind); - const storiesKind = this._legacydata[key as Keys]; + const storiesKind = this._legacydata[key as string]; if (!storiesKind) { return null; } @@ -285,7 +282,7 @@ export default class StoryStore extends EventEmitter { return null; } - const storiesKind = this._legacydata[toKey(kind) as Keys]; + const storiesKind = this._legacydata[toKey(kind) as string]; if (!storiesKind) { return null; } @@ -318,12 +315,12 @@ export default class StoryStore extends EventEmitter { removeStoryKind(kind: string) { if (this.hasStoryKind(kind)) { - this._legacydata[toKey(kind) as Keys].stories = {}; + this._legacydata[toKey(kind) as string].stories = {}; } } hasStoryKind(kind: string) { - return Boolean(this._legacydata[toKey(kind) as Keys]); + return Boolean(this._legacydata[toKey(kind) as string]); } hasStory(kind: string, name: string) { @@ -344,6 +341,6 @@ export default class StoryStore extends EventEmitter { } clean() { - this.getStoryKinds().forEach(kind => delete this._legacydata[toKey(kind) as Keys]); + this.getStoryKinds().forEach(kind => delete this._legacydata[toKey(kind) as string]); } } diff --git a/lib/client-api/src/types.ts b/lib/client-api/src/types.ts index 9fb580ab2a67..fe5d4a608989 100644 --- a/lib/client-api/src/types.ts +++ b/lib/client-api/src/types.ts @@ -1,400 +1,35 @@ -import { Channel } from '@storybook/channels'; -import { Addon } from '@storybook/addons'; +import { Addon, StoryFn, StoryContext, Parameters } from '@storybook/addons'; +import StoryStore from './story_store'; -export type Keys = - | 'addons-a11y-basebutton--default' - | 'addons-a11y-basebutton--delayed-render' - | 'addons-a11y-basebutton--disabled' - | 'addons-a11y-basebutton--invalid-contrast' - | 'addons-a11y-basebutton--label' - | 'addons-a11y-button--content' - | 'addons-a11y-button--default' - | 'addons-a11y-button--disabled' - | 'addons-a11y-button--invalid-contrast' - | 'addons-a11y-button--label' - | 'addons-a11y-form--with-label' - | 'addons-a11y-form--with-placeholder' - | 'addons-a11y-form--without-label' - | 'addons-a11y-image--presentation' - | 'addons-a11y-image--with-alt' - | 'addons-a11y-image--without-alt' - | 'addons-a11y-image--without-alt-but-unchecked' - | 'addons-a11y-typography--correct' - | 'addons-a11y-typography--empty-heading' - | 'addons-a11y-typography--empty-link' - | 'addons-a11y-typography--empty-paragraph' - | 'addons-a11y-typography--link-without-href' - | 'addons-actions--all-types' - | 'addons-actions--basic-example' - | 'addons-actions--circular-payload' - | 'addons-actions--configureactionsdepth' - | 'addons-actions--decorated-action' - | 'addons-actions--decorated-action-config' - | 'addons-actions--decorated-actions' - | 'addons-actions--decorated-actions-config' - | 'addons-actions--limit-action-output' - | 'addons-actions--multiple-actions' - | 'addons-actions--multiple-actions-as-object' - | 'addons-actions--multiple-actions-config' - | 'addons-actions--multiple-actions-object-config' - | 'addons-actions--persisting-the-action-logger' - | 'addons-actions--reserved-keyword-as-name' - | 'addons-actions-deprecated--decorated-action' - | 'addons-backgrounds--disabled-via' - | 'addons-backgrounds--overriden' - | 'addons-backgrounds--skipped-via-disable-true' - | 'addons-backgrounds--story-1' - | 'addons-backgrounds--story-2' - | 'addons-centered--story-1' - | 'addons-contexts--languages' - | 'addons-contexts--simple-css-theming' - | 'addons-cssresources--camera-icon' - | 'addons-cssresources--primary-large-button' - | 'addons-design-assets--multiple-images' - | 'addons-design-assets--named-assets' - | 'addons-design-assets--single-image' - | 'addons-design-assets--single-webpage' - | 'addons-design-assets--url-replacement' - | 'addons-design-assets--youtube-video' - | 'addons-events--logger' - | 'addons-events-deprecated--logger' - | 'addons-graphql--get-pickachu' - | 'addons-info-decorator--use-info-as-story-decorator' - | 'addons-info-deprecated--displays-markdown-in-description' - | 'addons-info-forwardref--displays-forwarded-ref-components-correctly' - | 'addons-info-forwardref--uses-forwardref-displayname-if-available' - | 'addons-info-github-issues--1814' - | 'addons-info-jsx--displays-jsx-in-description' - | 'addons-info-markdown--displays-markdown-in-description' - | 'addons-info-markdown--from-external-markdown-file' - | 'addons-info-markdown--from-internal-markdown-file' - | 'addons-info-options-excludedproptypes--excludes-proptypes-that-are-in-the-excludedproptypes-array' - | 'addons-info-options-header--shows-or-hides-info-addon-header' - | 'addons-info-options-inline--inlines-component-inside-story' - | 'addons-info-options-proptables--shows-additional-component-prop-tables' - | 'addons-info-options-proptablesexclude--exclude-component-from-prop-tables' - | 'addons-info-options-source--shows-or-hides-info-addon-source' - | 'addons-info-options-styles--extend-info-styles-with-an-object' - | 'addons-info-options-styles--full-control-over-styles-using-a-function' - | 'addons-info-options-tablecomponent--use-a-custom-component-for-the-table' - | 'addons-info-parameters--disable-the-addon-entirely' - | 'addons-info-parameters--overwrite-the-parameters-with-markdown-variable' - | 'addons-info-parameters--overwrite-the-text-parameter-with-markdown-inline' - | 'addons-info-parameters--overwriting-and-extending-the-parameters-and-options-set-stories-wise' - | 'addons-info-parameters--using-paramaters-across-all-stories' - | 'addons-info-react-docgen--comments-from-component-declaration' - | 'addons-info-react-docgen--comments-from-flow-declarations' - | 'addons-info-react-docgen--comments-from-named-export-component-declaration' - | 'addons-info-react-docgen--comments-from-proptype-declarations' - | 'addons-info-story-source--array-prop' - | 'addons-info-story-source--children' - | 'addons-info-story-source--many-props' - | 'addons-info-story-source--object-prop' - | 'addons-info-story-source--one-prop' - | 'addons-jest--withtests' - | 'addons-knobs-withknobs--accepts-story-parameters' - | 'addons-knobs-withknobs--complex-select' - | 'addons-knobs-withknobs--dynamic-knobs' - | 'addons-knobs-withknobs--optionsknob' - | 'addons-knobs-withknobs--triggers-actions-via-button' - | 'addons-knobs-withknobs--tweaks-static-values' - | 'addons-knobs-withknobs--tweaks-static-values-organized-in-groups' - | 'addons-knobs-withknobs--xss-safety' - | 'addons-knobs-withknobs-using-options--accepts-options' - | 'addons-links-button--first' - | 'addons-links-button--second' - | 'addons-links-href--log' - | 'addons-links-link--first' - | 'addons-links-link--second' - | 'addons-links-scroll-position--first' - | 'addons-links-scroll-position--second' - | 'addons-links-select--first' - | 'addons-links-select--index' - | 'addons-links-select--second' - | 'addons-links-select--third' - | 'addons-notes--addon-notes' - | 'addons-notes--addon-notes-rendering-imported-markdown' - | 'addons-notes--addon-notes-rendering-inline-github-flavored-markdown' - | 'addons-notes--with-a-markdown-giphy' - | 'addons-notes--with-a-markdown-table' - | 'addons-options--hiding-addon-panel' - | 'addons-options--setting-name' - | 'addons-queryparams--mock-is-4' - | 'addons-queryparams--mock-is-true' - | 'addons-storyshots--block' - | 'addons-viewport--default' - | 'addons-viewport-custom-default-kindle-fire-2--disabled' - | 'addons-viewport-custom-default-kindle-fire-2--inherited' - | 'addons-viewport-custom-default-kindle-fire-2--overridden-via-withviewport-parameterized-decorator' - | 'app-acceptance--angular-cli' - | 'app-acceptance--cra-kitchen-sink' - | 'app-acceptance--cra-react15' - | 'app-acceptance--cra-ts-kitchen-sink' - | 'app-acceptance--html-kitchen-sink' - | 'app-acceptance--mithril-kitchen-sink' - | 'app-acceptance--polymer-cli' - | 'app-acceptance--preact-kitchen-sink' - | 'app-acceptance--riot-kitchen-sink' - | 'app-acceptance--svelte-kitchen-sink' - | 'app-acceptance--vue-kitchen-sink' - | 'basics-actionbar--manyitems' - | 'basics-actionbar--singleitem' - | 'basics-badge--all-badges' - | 'basics-brand-storybookicon--default' - | 'basics-brand-storybooklogo--normal' - | 'basics-button--all-buttons' - | 'basics-documentformatting--withdom' - | 'basics-documentformatting--withmarkdown' - | 'basics-form-button--sizes' - | 'basics-form-button--validations' - | 'basics-form-field--field' - | 'basics-form-input--alignment' - | 'basics-form-input--sizes' - | 'basics-form-input--validations' - | 'basics-form-select--sizes' - | 'basics-form-select--validations' - | 'basics-form-textarea--alignment' - | 'basics-form-textarea--sizes' - | 'basics-form-textarea--validations' - | 'basics-icon--labels' - | 'basics-icon--no-labels' - | 'basics-link--cancel-w-href' - | 'basics-link--cancel-w-onclick' - | 'basics-link--no-cancel-w-href' - | 'basics-link--no-cancel-w-onclick' - | 'basics-link--styled-links' - | 'basics-placeholder--singlechild' - | 'basics-placeholder--twochildren' - | 'basics-scrollarea--both' - | 'basics-scrollarea--horizontal' - | 'basics-scrollarea--vertical' - | 'basics-scrollarea--withouterborder' - | 'basics-spaced--col' - | 'basics-spaced--col-outer' - | 'basics-spaced--row' - | 'basics-spaced--row-multiply' - | 'basics-spaced--row-outer' - | 'basics-syntaxhighlighter--bash' - | 'basics-syntaxhighlighter--bordered-copy-able' - | 'basics-syntaxhighlighter--dark-unsupported' - | 'basics-syntaxhighlighter--jsx' - | 'basics-syntaxhighlighter--padded' - | 'basics-syntaxhighlighter--showlinenumbers' - | 'basics-syntaxhighlighter--story' - | 'basics-syntaxhighlighter--unsupported' - | 'basics-tabs--stateful-dynamic' - | 'basics-tabs--stateful-no-initial' - | 'basics-tabs--stateful-static' - | 'basics-tabs--stateless-absolute' - | 'basics-tabs--stateless-bordered' - | 'basics-tabs--stateless-empty' - | 'basics-tabs--stateless-with-tools' - | 'basics-tooltip-listitem--active-icon' - | 'basics-tooltip-listitem--all' - | 'basics-tooltip-listitem--default' - | 'basics-tooltip-listitem--default-icon' - | 'basics-tooltip-listitem--disabled' - | 'basics-tooltip-listitem--loading' - | 'basics-tooltip-listitem--w-positions' - | 'basics-tooltip-listitem--w-positions-active' - | 'basics-tooltip-tooltip--basic-default' - | 'basics-tooltip-tooltip--basic-default-bottom' - | 'basics-tooltip-tooltip--basic-default-left' - | 'basics-tooltip-tooltip--basic-default-right' - | 'basics-tooltip-tooltip--no-chrome' - | 'basics-tooltip-tooltiplinklist--links' - | 'basics-tooltip-tooltiplinklist--links-and-callback' - | 'basics-tooltip-tooltipmessage--default' - | 'basics-tooltip-tooltipmessage--minimal-message' - | 'basics-tooltip-tooltipmessage--with-link' - | 'basics-tooltip-tooltipmessage--with-links' - | 'basics-tooltip-tooltipnote--default' - | 'basics-tooltip-withtooltip--no-chrome' - | 'basics-tooltip-withtooltip--simple-click' - | 'basics-tooltip-withtooltip--simple-click-closeonclick' - | 'basics-tooltip-withtooltip--simple-click-start-open' - | 'basics-tooltip-withtooltip--simple-hover' - | 'basics-tooltip-withtooltip--simple-hover-functional' - | 'basics-typography--all' - | 'core-decorators--all' - | 'core-errors--story-errors' - | 'core-errors--story-throws-exception' - | 'core-events--force-re-render' - | 'core-parameters--passed-to-story' - | 'core-scroll--story-with-100vh-padding-1' - | 'core-scroll--story-with-100vh-padding-2' - | 'core-unicode--кнопки' - | 'core-unicode--바보x`' - | 'core-unicode--😀' - | 'other-demo-button--with-some-emoji' - | 'other-demo-button--with-text' - | 'other-demo-welcome--to-storybook' - | 'other-stories-dirname-example--story-1' - | 'other-stories-dirname-example--story-2' - | 'ui-layout-desktop--bottom-panel' - | 'ui-layout-desktop--default' - | 'ui-layout-desktop--full' - | 'ui-layout-desktop--no-nav' - | 'ui-layout-desktop--no-panel' - | 'ui-layout-desktop--no-panel-no-nav' - | 'ui-layout-desktop--page' - | 'ui-layout-mobile--initial-0' - | 'ui-layout-mobile--initial-1' - | 'ui-layout-mobile--initial-2' - | 'ui-layout-mobile--page' - | 'ui-notifications-item--longtext' - | 'ui-notifications-item--simple' - | 'ui-notifications-item--withlink' - | 'ui-notifications-notifications--all' - | 'ui-notifications-notifications--placement' - | 'ui-notifications-notifications--single' - | 'ui-panel--default' - | 'ui-panel--no-panels' - | 'ui-preview-iframe--errorstory' - | 'ui-preview-iframe--missingstory' - | 'ui-preview-iframe--workingstory' - | 'ui-preview-preview--no-tabs' - | 'ui-preview-preview--with-tabs' - | 'ui-settings-aboutscreen--failed-to-fetch-new-version' - | 'ui-settings-aboutscreen--new-version-required' - | 'ui-settings-aboutscreen--up-to-date' - | 'ui-settings-settingsfooter--basic' - | 'ui-settings-shortcutsscreen--default-shortcuts' - | 'ui-sidebar-listitemicon--all' - | 'ui-sidebar-sidebar--loading' - | 'ui-sidebar-sidebar--simple' - | 'ui-sidebar-sidebarheading--custombrandimage' - | 'ui-sidebar-sidebarheading--linkandtext' - | 'ui-sidebar-sidebarheading--longtext' - | 'ui-sidebar-sidebarheading--menuhighlighted' - | 'ui-sidebar-sidebarheading--onlytext' - | 'ui-sidebar-sidebarheading--standard' - | 'ui-sidebar-sidebarheading--standardnolink' - | 'ui-sidebar-sidebaritem--component' - | 'ui-sidebar-sidebaritem--componentexpanded' - | 'ui-sidebar-sidebaritem--group' - | 'ui-sidebar-sidebaritem--loading' - | 'ui-sidebar-sidebaritem--nesteddepths' - | 'ui-sidebar-sidebaritem--story' - | 'ui-sidebar-sidebaritem--storyselected' - | 'ui-sidebar-sidebaritem--with-long-name' - | 'ui-sidebar-sidebarsearch--filledin' - | 'ui-sidebar-sidebarsearch--focussed' - | 'ui-sidebar-sidebarsearch--simple' - | 'ui-sidebar-sidebarstories--empty' - | 'ui-sidebar-sidebarstories--loading' - | 'ui-sidebar-sidebarstories--noroot' - | 'ui-sidebar-sidebarstories--withroot' - | 'ui-sidebar-sidebarsubheading--default'; - -export interface IDecoratorParams { - default?: boolean; - name: string; - value: string; -} - -export interface IDecoratorParamA11y { - config: { [key: string]: any }; // this was empty, not sure what its type is - options: { [key: string]: string }; -} - -export interface IHierarchyObj { - hierarchyRootSeparator: string; - hierarchySeparator: RegExp; - theme?: { base: string; brandTitle: string }; -} -export interface IDecoratorParamOptions extends Object { - storySort: any; - hierarchyRootSeparator: string; - hierarchySeparator: RegExp; - theme: { - base: string; - brandTitle: string; - }; -} - -export interface IDecoratorBackgrounds { - name: string; - value: string; - default?: true; +export interface ErrorLike { + message: string; + stack: string; } -export interface IContext { - id: string; - kind: string; - name: string; - options: IDecoratorParamOptions; - parameters: DecoratorParameters; - story: string; -} - -export interface DecoratorParameters { - a11y: IDecoratorParamA11y; - backgrounds: IDecoratorBackgrounds[]; - fileName?: string; - globalParameter?: string; - options?: IDecoratorParamOptions; -} - -export type StoryFn = (p?: any) => any; -export interface Decorator { - getDecorated: () => (args: any) => any; - getOriginal: () => any; - id: string; - kind: string; - name: string; - parameters: DecoratorParameters; +export interface StoreItem extends StoryContext { + getDecorated: () => StoryFn; + getOriginal: () => StoryFn; story: string; storyFn: StoryFn; } -export type DecoratorData = { [K in Keys]: Decorator } & { [key: string]: Decorator }; - -export interface IModule { - exports: any; - id: string; - loaded: boolean; - webpackPolyfill: number; - hot: any; +export interface StoreData { + [key: string]: StoreItem; } -export interface ClientApi { - add: (storyName: string, storyFn: () => any, parameters: any) => void; - _addons: { [key: string]: any }; - addDecorator: (decorator: any) => any; - addDecorators: (parameters: any) => any; - kind: string; -} export interface ClientApiParams { storyStore: StoryStore; decorateStory: (storyFn: any, decorators: any) => any; } -export interface IStoryContext { - kind: string; - name: string; - parameters: any; -} -export interface ICollection { - [p: string]: any; -} -export interface IStory { - props?: ICollection; - moduleMetadata?: any; - component?: any; - template?: string; -} -export type IGetStory = (context: IStoryContext) => IStory; -export interface IApi { +export interface StoryApi { + addDecorator: (decorator: any) => StoryApi; + addParameters: (parameters: any) => StoryApi; + add: (storyName: string, getStory: StoryFn, parameters?: Parameters) => StoryApi; kind: string; - name: string; - addDecorator: (decorator: any) => IApi; - addParameters: (parameters: any) => IApi; - add: (storyName: string, getStory: IGetStory, parameters?: any) => IApi; [key: string]: any; } -export type HandlerFunction = (...args: any[]) => void; -export type DecoratorFunction = (args: any[]) => any[]; +export type DecoratorFunction = (fn: StoryFn, c: StoryContext) => ReturnType; export interface LegacyItem { fileName: string; @@ -405,53 +40,21 @@ export interface LegacyItem { selection?: { storyId: string }; } -export type LegacyData = { [K in Keys]: LegacyItem }; -type _decorator = Partial; -export interface StoryStore { - fromId: (id: string) => any; - getSelection: (a: any, b: Error) => void; - getRevision: () => number; - incrementRevision: () => void; - addLegacyStory: (p: DecoratorData) => void; - pushToManager: () => void; - addStory: ( - p: _decorator, - cbObj: { - applyDecorators: (storyFn: StoryFn, decorators: any) => any; - getDecorators: () => any[]; - } - ) => void; - remove: (id: string) => void; - setChannel: (channel: Channel) => void; - setSelection: (ref: any, err: Error) => void; - emit?: (...args: any) => void; - raw?: () => [] | {}; - extract: () => {}; - getStoryWithContext: () => any; - getStoryFileName: (kind: string) => null | string; - getStories: (kind: string) => any[]; - getStoryKinds: () => string[]; - removeStoryKind: (kind: string) => void; - hasStoryKind: (kind: string) => boolean; - getStoryAndParameters: ( - kind: string, - name: string - ) => { - story: any; - parameters: any; - }; - getStory: (kind: string, name: string) => any; - hasStory: (kind: string, name: string) => boolean; - size: () => number; - clean: () => void; - _error?: undefined; - _channel: Channel; - _data: DecoratorData; - _events?: any; - _eventsCount?: number; - _legacyData?: LegacyData; +export interface AddStoryArgs { + id: string; + kind: string; + name: string; + storyFn: StoryFn; + parameters: Parameters; +} + +export interface LegacyData { + [K: string]: LegacyItem; } -export interface IAddon extends Addon { - apply: (a: IApi, b: any[]) => any; +export interface ClientApiAddon extends Addon { + apply: (a: StoryApi, b: any[]) => any; +} +export interface ClientApiAddons { + [key: string]: ClientApiAddon; } diff --git a/lib/client-api/src/typings.d.ts b/lib/client-api/src/typings.d.ts index 10978106a58c..656f6e03f620 100644 --- a/lib/client-api/src/typings.d.ts +++ b/lib/client-api/src/typings.d.ts @@ -1,4 +1,21 @@ declare module 'global'; -declare module '@storybook/client-api'; -declare module '@storybook/core-events'; -declare module './types'; \ No newline at end of file + + +declare global { + interface NodeModule { + hot: { + accept(dependencies: string[], callback: (updatedDependencies: string[]) => void): void; + accept(dependency: string, callback: () => void): void; + accept(errHandler?: (err: any) => void): void; + decline(dependencies: string[]): void; + decline(dependency: string): void; + decline(): void; + + dispose(callback: (data: any) => void): void; + addDisposeHandler(callback: (data: any) => void): void; + + removeDisposeHandler(callback: (data: any) => void): void; + // ... + } + } +} \ No newline at end of file diff --git a/lib/client-api/tsconfig.json b/lib/client-api/tsconfig.json index 4894223ce827..62968dd8bd2c 100644 --- a/lib/client-api/tsconfig.json +++ b/lib/client-api/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src" + "rootDir": "./src", + "types": ["webpack-env"] }, "include": ["src/**/*"], "exclude": ["src/**/*.test.ts"] diff --git a/yarn.lock b/yarn.lock index 77bdacd1a5ca..55e49fc87c81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3367,12 +3367,302 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" integrity sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow== +<<<<<<< HEAD "@storybook/channels@^5.1.9": version "5.1.9" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-5.1.9.tgz#003cfca0b9f1ba6cf47ce68304aedd71bdb55e74" integrity sha512-R6i7859FsXgY9XFFErVe7gS37wGYpQEEWsO1LzUW7YptGuFTUa8yLgKkNkgfy7Zs61Xm+GiBq8PvS/CWxjotPw== dependencies: core-js "^3.0.1" +======= +"@storybook/addons@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-5.1.0-alpha.32.tgz#7392535f6ec8412048181f78c109ad3e6fa2b7bd" + integrity sha512-D90X2NsphzvFqRnRmXiakboXfxbhyp91Ss3jB5FIqKUp6r1wy3ul3VPa43tIod3drkrDRsvWA9qZLG9/Df9/dg== + dependencies: + "@storybook/api" "5.1.0-alpha.32" + "@storybook/channels" "5.1.0-alpha.32" + "@storybook/client-logger" "5.1.0-alpha.32" + core-js "^2.6.5" + global "^4.3.2" + util-deprecate "^1.0.2" + +"@storybook/api@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-5.1.0-alpha.32.tgz#42b2d41ef7a4831160f5a33918d85000678f4ab0" + integrity sha512-lcsT9iL8hk+wG0Ef0senJy8pH7d/7UThLPQR+EdMscqe37/9RKpwNO004D4YAeOTO8ZNIvYXKScPQzNHlXg79Q== + dependencies: + "@storybook/channels" "5.1.0-alpha.32" + "@storybook/client-logger" "5.1.0-alpha.32" + "@storybook/core-events" "5.1.0-alpha.32" + "@storybook/router" "5.1.0-alpha.32" + "@storybook/theming" "5.1.0-alpha.32" + core-js "^2.6.5" + fast-deep-equal "^2.0.1" + global "^4.3.2" + lodash.isequal "^4.5.0" + lodash.mergewith "^4.6.1" + lodash.pick "^4.4.0" + memoizerific "^1.11.3" + prop-types "^15.6.2" + react "^16.7.0" + semver "^5.6.0" + store2 "^2.7.1" + telejson "^2.1.1" + util-deprecate "^1.0.2" + +"@storybook/channel-postmessage@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-5.1.0-alpha.32.tgz#0a2f35ffc668d65e54870355261501b59d6de943" + integrity sha512-A+g9AJki9X8BhMj2YSnRu9WBpaCvOyebT9KHKThl9dhV1Mr08vJl4RFfXcVds9Zy4qbljbzanJWJ85LYjxp82g== + dependencies: + "@storybook/channels" "5.1.0-alpha.32" + "@storybook/client-logger" "5.1.0-alpha.32" + core-js "^2.6.5" + global "^4.3.2" + telejson "^2.1.1" + +"@storybook/channels@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-5.1.0-alpha.32.tgz#74afb7f0f84c6088232fa23f680adc9d9c03587e" + integrity sha512-f2ZmlvhdqS5fuLxYFbrTqoaZMnbAhrmKvlu6+lwSRXIV3H9PEipeSX7RQJSJAsdqJaw2YfIMgNIbZaj9XpoPNw== + dependencies: + core-js "^2.6.5" + +"@storybook/client-api@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-5.1.0-alpha.32.tgz#2e4d91580edc9bb4695a8984bc442c0ebdbd082d" + integrity sha512-/Q/kbiMsfl6hvuC9/uJ6HPQePc2UNLA072k/RaHl2rMHWuNDRkML7VDjrt+Zthh+PQB5Vd/IZ79owJVHG5+/Lg== + dependencies: + "@storybook/addons" "5.1.0-alpha.32" + "@storybook/client-logger" "5.1.0-alpha.32" + "@storybook/core-events" "5.1.0-alpha.32" + "@storybook/router" "5.1.0-alpha.32" + common-tags "^1.8.0" + core-js "^2.6.5" + eventemitter3 "^3.1.0" + global "^4.3.2" + is-plain-object "^2.0.4" + lodash.debounce "^4.0.8" + lodash.isequal "^4.5.0" + lodash.mergewith "^4.6.1" + memoizerific "^1.11.3" + qs "^6.6.0" + +"@storybook/client-logger@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-5.1.0-alpha.32.tgz#5f1e537e8bcc624c00e9049267f2dae5d5c47ec5" + integrity sha512-Aw8CkhBwGdjSAjp2hOr+GDMkymORHNvlrK3HZFF1dFQcpyD8Xlyj/Tjo/mm3Wx9GDoC45/8h/LxwzsyyMl+qNA== + dependencies: + core-js "^2.6.5" + +"@storybook/components@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-5.1.0-alpha.32.tgz#f920956ea1eb7a3b65caa103a1002c4751388141" + integrity sha512-Ovn55VQmRh2RcyYxw2mlw175FAUZ/mMgfwGm6Pi0V/VCFKII3Lv6wcmZMsw+8e1lGb1Ho3R/lXcrDK+Fmgor0Q== + dependencies: + "@storybook/client-logger" "5.1.0-alpha.32" + "@storybook/theming" "5.1.0-alpha.32" + core-js "^2.6.5" + global "^4.3.2" + js-beautify "^1.8.9" + markdown-to-jsx "^6.9.1" + memoizerific "^1.11.3" + polished "^3.0.0" + popper.js "^1.14.7" + prop-types "^15.7.2" + react "^16.8.4" + react-dom "^16.8.4" + react-focus-lock "^1.18.3" + react-helmet-async "^0.2.0" + react-popper-tooltip "^2.8.0" + react-syntax-highlighter "^8.0.1" + react-textarea-autosize "^7.1.0" + recompose "^0.30.0" + simplebar-react "^0.1.5" + +"@storybook/core-events@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-5.1.0-alpha.32.tgz#3a8221ccd15f4f6148fe0551e2d3cf05e957d123" + integrity sha512-b62AocO0I07x0d3EFr2TimKkXdaB44w2P/6Z6H2paJptRQm0YtUND6pJJW/OFLoZQWc7nwEoO8eZhTXUyzPuPg== + dependencies: + core-js "^2.6.5" + +"@storybook/core@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.1.0-alpha.32.tgz#bdc5520edcc622f9b06c210923f5b24d493ee404" + integrity sha512-VgHr68Bs/nSYNnKbGZM4n4lGaD4LWjhLIISDlq6vW0vvr8pqHmPAcvSKGfdgHZ14/GxEqwGc5/0oZ2Fg6KvnBg== + dependencies: + "@babel/plugin-proposal-class-properties" "^7.3.3" + "@babel/plugin-proposal-object-rest-spread" "^7.3.2" + "@babel/plugin-syntax-dynamic-import" "^7.2.0" + "@babel/plugin-transform-react-constant-elements" "^7.2.0" + "@babel/preset-env" "^7.4.1" + "@storybook/addons" "5.1.0-alpha.32" + "@storybook/channel-postmessage" "5.1.0-alpha.32" + "@storybook/client-api" "5.1.0-alpha.32" + "@storybook/client-logger" "5.1.0-alpha.32" + "@storybook/core-events" "5.1.0-alpha.32" + "@storybook/node-logger" "5.1.0-alpha.32" + "@storybook/router" "5.1.0-alpha.32" + "@storybook/theming" "5.1.0-alpha.32" + "@storybook/ui" "5.1.0-alpha.32" + airbnb-js-shims "^1 || ^2" + autoprefixer "^9.4.9" + babel-plugin-add-react-displayname "^0.0.5" + babel-plugin-emotion "^10.0.9" + babel-plugin-macros "^2.4.5" + babel-preset-minify "^0.5.0 || 0.6.0-alpha.5" + boxen "^3.0.0" + case-sensitive-paths-webpack-plugin "^2.2.0" + chalk "^2.4.2" + cli-table3 "0.5.1" + commander "^2.19.0" + common-tags "^1.8.0" + core-js "^2.6.5" + css-loader "^2.1.1" + detect-port "^1.3.0" + dotenv-webpack "^1.7.0" + ejs "^2.6.1" + express "^4.16.4" + file-loader "^3.0.1" + file-system-cache "^1.0.5" + find-cache-dir "^2.0.0" + fs-extra "^7.0.1" + global "^4.3.2" + html-webpack-plugin "^4.0.0-beta.2" + inquirer "^6.2.0" + interpret "^1.2.0" + ip "^1.1.5" + json5 "^2.1.0" + lazy-universal-dotenv "^2.0.0" + node-fetch "^2.3.0" + open "^6.1.0" + postcss-flexbugs-fixes "^4.1.0" + postcss-loader "^3.0.0" + pretty-hrtime "^1.0.3" + qs "^6.6.0" + raw-loader "^1.0.0" + react-dev-utils "^8.0.0" + regenerator-runtime "^0.12.1" + resolve "^1.10.0" + resolve-from "^4.0.0" + semver "^5.6.0" + serve-favicon "^2.5.0" + shelljs "^0.8.3" + style-loader "^0.23.1" + terser-webpack-plugin "^1.2.2" + url-loader "^1.1.2" + util-deprecate "^1.0.2" + webpack "^4.28.0" + webpack-dev-middleware "^3.6.0" + webpack-hot-middleware "^2.24.3" + +"@storybook/node-logger@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.1.0-alpha.32.tgz#4c9dd139770b3b23c952872df6832fddad573089" + integrity sha512-MaiH8rEccXY5PfwGC78enxZ+Moupy3hTzUqGKOoUMeLIdZ/FvNb04MR4Leo8Cd1Pw6GTW1DVb0aUu7t3GlBH7w== + dependencies: + chalk "^2.4.2" + core-js "^2.6.5" + npmlog "^4.1.2" + pretty-hrtime "^1.0.3" + regenerator-runtime "^0.12.1" + +"@storybook/react@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/react/-/react-5.1.0-alpha.32.tgz#0acd22184a86c942a187919df466368de6823a17" + integrity sha512-x7ssSlrmNXsmqHgAVjoMoMUFgOJsym+HUDs/p/DFxRjF4fuBrddz8BvjByqH+Tr9YW4nyGA2vUHP3InfAiS4Hw== + dependencies: + "@babel/plugin-transform-react-constant-elements" "^7.2.0" + "@babel/preset-flow" "^7.0.0" + "@babel/preset-react" "^7.0.0" + "@storybook/core" "5.1.0-alpha.32" + "@storybook/node-logger" "5.1.0-alpha.32" + "@svgr/webpack" "^4.0.3" + babel-plugin-named-asset-import "^0.3.1" + babel-plugin-react-docgen "^3.0.0" + babel-preset-react-app "^7.0.2" + common-tags "^1.8.0" + core-js "^2.6.5" + global "^4.3.2" + lodash "^4.17.11" + mini-css-extract-plugin "^0.5.0" + prop-types "^15.7.2" + react-dev-utils "^8.0.0" + regenerator-runtime "^0.12.1" + semver "^5.6.0" + webpack "^4.28.0" + +"@storybook/router@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-5.1.0-alpha.32.tgz#f862f6ff2652dbc990030fd4ea1d3a9fd9d01431" + integrity sha512-t4agmfHiaN+a8El8482Fot5+AHZQrE1h8aep4hKZXK3JF3KL+mHk9QvrILdMsDrx5BNiDMI4v4WQ5w8f2U88aQ== + dependencies: + "@reach/router" "^1.2.1" + "@storybook/theming" "5.1.0-alpha.32" + core-js "^2.6.5" + global "^4.3.2" + memoizerific "^1.11.3" + qs "^6.6.0" + +"@storybook/theming@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-5.1.0-alpha.32.tgz#4742b9ad2969017138e440222af5ae033a202871" + integrity sha512-2BcOtxIZK3daKwmUyhlVpEXYDFp0rBB2GPoLF3CODOhF7wAmxjia46Amg7Ch82EqhstRko8geBhgJcHsD0OhqA== + dependencies: + "@emotion/core" "^10.0.9" + "@emotion/styled" "^10.0.7" + "@storybook/client-logger" "5.1.0-alpha.32" + common-tags "^1.8.0" + core-js "^2.6.5" + deep-object-diff "^1.1.0" + emotion-theming "^10.0.9" + global "^4.3.2" + lodash.isequal "^4.5.0" + lodash.mergewith "^4.6.1" + memoizerific "^1.11.3" + polished "^3.0.0" + prop-types "^15.7.2" + react-inspector "^2.3.1" + +"@storybook/ui@5.1.0-alpha.32": + version "5.1.0-alpha.32" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.1.0-alpha.32.tgz#2fdba3555e3ea33f9843bb3406db79115212e3f0" + integrity sha512-C33Mq4lSMGRSQWKWKyKjljXatsvGXzAAjknhVUWWC5Z9CBeFoYfvvfvcovdO3IGoTMwifzr5YqWGqcF2OaiRKg== + dependencies: + "@storybook/addons" "5.1.0-alpha.32" + "@storybook/api" "5.1.0-alpha.32" + "@storybook/client-logger" "5.1.0-alpha.32" + "@storybook/components" "5.1.0-alpha.32" + "@storybook/core-events" "5.1.0-alpha.32" + "@storybook/router" "5.1.0-alpha.32" + "@storybook/theming" "5.1.0-alpha.32" + core-js "^2.6.5" + fast-deep-equal "^2.0.1" + fuse.js "^3.4.4" + global "^4.3.2" + lodash.debounce "^4.0.8" + lodash.isequal "^4.5.0" + lodash.mergewith "^4.6.1" + lodash.pick "^4.4.0" + markdown-to-jsx "^6.9.3" + memoizerific "^1.11.3" + polished "^3.0.0" + prop-types "^15.7.2" + qs "^6.6.0" + react "^16.8.4" + react-dom "^16.8.4" + react-draggable "^3.1.1" + react-helmet-async "^0.2.0" + react-hotkeys "2.0.0-pre4" + react-resize-detector "^4.0.5" + recompose "^0.30.0" + semver "^5.6.0" + store2 "^2.7.1" + telejson "^2.1.1" + util-deprecate "^1.0.2" +>>>>>>> 8eb8ffb... FIX typings "@svgr/babel-plugin-add-jsx-attribute@^4.2.0": version "4.2.0"