mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Storybook: Add internal stories functionality (#23139)
This commit is contained in:
parent
9272c0817c
commit
6d6d86f940
@ -10,7 +10,7 @@ Storybook is:
|
||||
|
||||
## How to create stories
|
||||
|
||||
Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`.
|
||||
Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`. If a story should be internal, not visible in production, name the file `SomeComponent.story.internal.tsx`.
|
||||
|
||||
### Writing stories
|
||||
|
||||
|
@ -1,5 +1,11 @@
|
||||
const stories = ['../src/**/*.story.{js,jsx,ts,tsx,mdx}'];
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
stories.push('../src/**/*.story.internal.{js,jsx,ts,tsx,mdx}');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
stories: ['../src/**/*.story.{js,jsx,ts,tsx,mdx}'],
|
||||
stories: stories,
|
||||
addons: [
|
||||
'@storybook/addon-knobs',
|
||||
'@storybook/addon-actions',
|
||||
|
Loading…
Reference in New Issue
Block a user