salesforce / salesforce/design-system-react
Use ES6 export for Storybook stories
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 982
- Forks
- 440
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 4
Description
.storybook/config.js:
import { configure } from ‘@storybook/react’;
configure(require.context(‘../src/’, true, /\.stories\.js$/), module);
Then the [component].stories.js file could also use a require.context and export all the files located in __examples__. This makes adding a story zero config by just adding a jsx file to a folder.
We will still want to identify which examples go on the doc site. Right now that is listed in the component.json file.
There's a code shift script for this: sb migrate storiesof-to-csf --glob "**/*.stories.js"
For more info:
https://medium.com/storybookjs/component-story-format-66f4c32366df
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with .storybook/config.js and the existing [component].stories.js files, then review component.json for which examples appear on the documentation site. Use the referenced Storybook migration command as a guide, and consider the work done when stories can be discovered from the proposed example files while documentation-site selection remains defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100