-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22261 from storybookjs/norbert/fix-21820-second-e…
…dition fix bad typings file caused by egoist/tsup#782
- Loading branch information
Showing
23 changed files
with
87 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import type { Addon_DecoratorFunction } from '@storybook/types'; | ||
import { withLinks } from './index'; | ||
|
||
export const decorators = [withLinks]; | ||
export const decorators: Addon_DecoratorFunction[] = [withLinks]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { parameters as docsParams } from './docs/config'; | ||
import type { Parameters } from './types'; | ||
|
||
export const parameters = { renderer: 'html' as const, ...docsParams }; | ||
export const parameters: Parameters = { renderer: 'html', ...docsParams }; | ||
|
||
export { decorators, argTypesEnhancers } from './docs/config'; | ||
export { renderToCanvas, render } from './render'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
import type { Addon_DecoratorFunction, ArgTypesEnhancer } from '@storybook/types'; | ||
import { SourceType, enhanceArgTypes } from '@storybook/docs-tools'; | ||
|
||
import { sourceDecorator } from './sourceDecorator'; | ||
import type { Parameters, StoryFnHtmlReturnType } from '../types'; | ||
|
||
export const decorators = [sourceDecorator]; | ||
export const decorators: Addon_DecoratorFunction<StoryFnHtmlReturnType>[] = [ | ||
sourceDecorator as Addon_DecoratorFunction<StoryFnHtmlReturnType>, | ||
]; | ||
|
||
export const parameters = { | ||
export const parameters: Partial<Parameters> = { | ||
docs: { | ||
story: { inline: true }, | ||
source: { | ||
type: SourceType.DYNAMIC, | ||
language: 'html', | ||
code: undefined as unknown, | ||
excludeDecorators: undefined as unknown, | ||
code: undefined, | ||
excludeDecorators: undefined, | ||
}, | ||
}, | ||
}; | ||
|
||
export const argTypesEnhancers = [enhanceArgTypes]; | ||
export const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import type { Addon_DecoratorFunction, ArgTypesEnhancer } from '@storybook/types'; | ||
import { extractComponentDescription, enhanceArgTypes } from '@storybook/docs-tools'; | ||
|
||
import { extractArgTypes } from './extractArgTypes'; | ||
import { jsxDecorator } from './jsxDecorator'; | ||
import type { StoryFnReactReturnType } from '../types'; | ||
|
||
export const parameters = { | ||
export const parameters: {} = { | ||
docs: { | ||
story: { inline: true }, | ||
extractArgTypes, | ||
extractComponentDescription, | ||
}, | ||
}; | ||
|
||
export const decorators = [jsxDecorator]; | ||
export const decorators: Addon_DecoratorFunction<StoryFnReactReturnType>[] = [jsxDecorator]; | ||
|
||
export const argTypesEnhancers = [enhanceArgTypes]; | ||
export const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import type { Addon_DecoratorFunction, ArgTypesEnhancer } from '@storybook/types'; | ||
import { enhanceArgTypes } from '@storybook/docs-tools'; | ||
import { extractArgTypes } from './extractArgTypes'; | ||
import { extractComponentDescription } from './extractComponentDescription'; | ||
import { sourceDecorator } from './sourceDecorator'; | ||
|
||
export const parameters = { | ||
export const parameters: {} = { | ||
docs: { | ||
story: { inline: true }, | ||
extractArgTypes, | ||
extractComponentDescription, | ||
}, | ||
}; | ||
|
||
export const decorators = [sourceDecorator]; | ||
export const decorators: Addon_DecoratorFunction<unknown>[] = [sourceDecorator]; | ||
|
||
export const argTypesEnhancers = [enhanceArgTypes]; | ||
export const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
/* eslint-disable prefer-destructuring */ | ||
import { start } from '@storybook/preview-api'; | ||
import type { Addon_ClientStoryApi, Addon_Loadable } from '@storybook/types'; | ||
import { decorateStory } from './decorators'; | ||
|
||
import type { SvelteRenderer } from './types'; | ||
import { render, renderToCanvas } from './render'; | ||
|
||
const { | ||
configure: coreConfigure, | ||
clientApi, | ||
forceReRender, | ||
} = start<SvelteRenderer>(renderToCanvas, { | ||
const RENDERER = 'svelte'; | ||
|
||
interface ClientApi extends Addon_ClientStoryApi<SvelteRenderer['storyResult']> { | ||
configure(loader: Addon_Loadable, module: NodeModule): void; | ||
forceReRender(): void; | ||
raw: () => any; // todo add type | ||
} | ||
|
||
const api = start<SvelteRenderer>(renderToCanvas, { | ||
decorateStory, | ||
render, | ||
}); | ||
|
||
export const { raw } = clientApi; | ||
|
||
const RENDERER = 'svelte'; | ||
export const storiesOf = (kind: string, m: any) => | ||
clientApi.storiesOf(kind, m).addParameters({ renderer: RENDERER }); | ||
export const configure = (...args: any[]) => coreConfigure(RENDERER, ...args); | ||
export const storiesOf: ClientApi['storiesOf'] = (kind, m) => { | ||
return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({ | ||
renderer: RENDERER, | ||
}); | ||
}; | ||
|
||
export { forceReRender }; | ||
export const configure: ClientApi['configure'] = (...args) => api.configure(RENDERER, ...args); | ||
export const forceReRender: ClientApi['forceReRender'] = api.forceReRender; | ||
export const raw: ClientApi['raw'] = api.clientApi.raw; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import type { Addon_DecoratorFunction, ArgTypesEnhancer } from '@storybook/types'; | ||
import { extractComponentDescription, enhanceArgTypes } from '@storybook/docs-tools'; | ||
import { extractArgTypes } from './extractArgTypes'; | ||
import { sourceDecorator } from './sourceDecorator'; | ||
|
||
export const parameters = { | ||
export const parameters: {} = { | ||
docs: { | ||
story: { inline: true, iframeHeight: '120px' }, | ||
extractArgTypes, | ||
extractComponentDescription, | ||
}, | ||
}; | ||
|
||
export const decorators = [sourceDecorator]; | ||
export const decorators: Addon_DecoratorFunction<any>[] = [sourceDecorator]; | ||
|
||
export const argTypesEnhancers = [enhanceArgTypes]; | ||
export const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import type { Addon_DecoratorFunction, ArgTypesEnhancer } from '@storybook/types'; | ||
import { extractComponentDescription, enhanceArgTypes } from '@storybook/docs-tools'; | ||
import { extractArgTypes } from './extractArgTypes'; | ||
import { sourceDecorator } from './sourceDecorator'; | ||
|
||
export const parameters = { | ||
export const parameters: {} = { | ||
docs: { | ||
story: { inline: true }, | ||
extractArgTypes, | ||
extractComponentDescription, | ||
}, | ||
}; | ||
|
||
export const decorators = [sourceDecorator]; | ||
export const decorators: Addon_DecoratorFunction<unknown>[] = [sourceDecorator]; | ||
|
||
export const argTypesEnhancers = [enhanceArgTypes]; | ||
export const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { parameters as docsParams } from './docs/config'; | ||
|
||
export const parameters = { renderer: 'web-components' as const, ...docsParams }; | ||
export const parameters: {} = { renderer: 'web-components' as const, ...docsParams }; | ||
export { decorators, argTypesEnhancers } from './docs/config'; | ||
export { render, renderToCanvas } from './render'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters