-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix bad typings file caused by https://github.com/egoist/tsup/issues/782 #22261
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f460464
fix bad typings file caused by https://github.com/egoist/tsup/issues/782
ndelangen 69dc1b0
I've done a search for all references to `'lib/` in the dist we gener…
ndelangen 79f1940
remove parameter type extension, that's not needed
ndelangen 6d462b9
Merge branch 'next' into norbert/fix-21820-second-edition
ndelangen 3fcad85
Merge branch 'next' into norbert/fix-21820-second-edition
ndelangen db9704b
Merge branch 'next' into norbert/fix-21820-second-edition
ndelangen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just use
import type { DecoratorFunction } from '@storybook/types';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These types are pretty much equal. When we do the types cleanup at 8.0 we'll sync this up.