forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 0
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 storybookjs#24623 from storybookjs/norbert/split-d…
…ocs-entries Maintenance: Split renderers preview entrypoints
- Loading branch information
Showing
64 changed files
with
311 additions
and
246 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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./dist/preset'); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { ArgTypesEnhancer, DecoratorFunction } from '@storybook/types'; | ||
import { SourceType, enhanceArgTypes } from '@storybook/docs-tools'; | ||
|
||
import { sourceDecorator } from './docs/sourceDecorator'; | ||
import type { HtmlRenderer } from './types'; | ||
|
||
export const decorators: DecoratorFunction<HtmlRenderer>[] = [sourceDecorator]; | ||
|
||
export const parameters = { | ||
docs: { | ||
story: { inline: true }, | ||
source: { | ||
type: SourceType.DYNAMIC, | ||
language: 'html', | ||
code: undefined, | ||
excludeDecorators: undefined, | ||
}, | ||
}, | ||
}; | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { Parameters } from './types'; | ||
|
||
export const parameters: Parameters = { renderer: 'html' }; | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { StorybookConfig } from '@storybook/types'; | ||
import { join } from 'path'; | ||
|
||
export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (input, options) => { | ||
const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0; | ||
const result: string[] = []; | ||
|
||
return result | ||
.concat(input) | ||
.concat([join(__dirname, 'entry-preview.mjs')]) | ||
.concat(docsEnabled ? [join(__dirname, 'entry-preview-docs.mjs')] : []); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./dist/preset'); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { renderToCanvas, render } from './render'; | ||
|
||
export const parameters = { renderer: 'preact' }; |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { StorybookConfig } from '@storybook/types'; | ||
import { join } from 'path'; | ||
|
||
export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (input, options) => { | ||
const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0; | ||
const result: string[] = []; | ||
|
||
return result | ||
.concat(input) | ||
.concat([join(__dirname, 'entry-preview.mjs')]) | ||
.concat(docsEnabled ? [join(__dirname, 'entry-preview-docs.mjs')] : []); | ||
}; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
code/renderers/react/src/applyDecorators.ts → ...nderers/react/src/docs/applyDecorators.ts
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { ArgTypesEnhancer, DecoratorFunction } from '@storybook/types'; | ||
import { extractComponentDescription, enhanceArgTypes } from '@storybook/docs-tools'; | ||
|
||
import { extractArgTypes } from './docs/extractArgTypes'; | ||
import { jsxDecorator } from './docs/jsxDecorator'; | ||
import type { ReactRenderer } from './types'; | ||
|
||
export const parameters = { | ||
docs: { | ||
story: { inline: true }, | ||
extractArgTypes, | ||
extractComponentDescription, | ||
}, | ||
}; | ||
|
||
export const decorators: DecoratorFunction<ReactRenderer>[] = [jsxDecorator]; | ||
|
||
export const argTypesEnhancers: ArgTypesEnhancer<ReactRenderer>[] = [enhanceArgTypes]; | ||
|
||
export { applyDecorators } from './docs/applyDecorators'; |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const parameters: {} = { renderer: 'react' }; | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
import type { StorybookConfig } from '@storybook/types'; | ||
|
||
import { join } from 'path'; | ||
|
||
export const addons: StorybookConfig['addons'] = [ | ||
require.resolve('@storybook/react-dom-shim/dist/preset'), | ||
]; | ||
|
||
export const previewAnnotations: StorybookConfig['previewAnnotations'] = async (input, options) => { | ||
const docsConfig = await options.presets.apply('docs', {}, options); | ||
const docsEnabled = Object.keys(docsConfig).length > 0; | ||
const result: string[] = []; | ||
|
||
return result | ||
.concat(input) | ||
.concat([join(__dirname, 'entry-preview.mjs')]) | ||
.concat(docsEnabled ? [join(__dirname, 'entry-preview-docs.mjs')] : []); | ||
}; |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
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
Oops, something went wrong.