Skip to content

Commit 17bb630

Browse files
authored
Merge pull request #6 from cwlsn/5-storybook
Setup latest Storybook alpha for babel7 and webpack4 support
2 parents 785e072 + 583a502 commit 17bb630

File tree

9 files changed

+11551
-5
lines changed

9 files changed

+11551
-5
lines changed

.babelrc

-3
This file was deleted.

.browserlistrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"browserslist": [
3+
"last 1 version",
4+
"> 1%",
5+
"maintained node versions",
6+
"not dead"
7+
]
8+
}

.storybook/addons.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@storybook/addon-actions/register';

.storybook/config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { configure } from '@storybook/react';
2+
3+
const req = require.context('../src/components', true, /[^/]+\/stories.js$/);
4+
5+
function loadStories() {
6+
req.keys().forEach((filename) => req(filename));
7+
}
8+
9+
configure(loadStories, module);

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
> Rinse, React, repeat. A boilerplate to build a React component library.
66
7-
###### To learn how this project was made from scratch, [read the blog post](url)!
7+
#### To learn how this project was made from scratch, [read the blog post](url)!
88

99
## Get Started
1010

@@ -16,3 +16,18 @@ $ cd cool-name
1616
$ rm -rf .git
1717
$ git init
1818
```
19+
20+
## Development and Storybook
21+
22+
You can easily develop and interact with your components by using Storybook. To run the local server, simply run:
23+
24+
```bash
25+
$ npm i
26+
$ npm run storybook
27+
```
28+
29+
Navigate to [http://localhost:9001](http://localhost:9001) to view your stories. They should automatically update as you develop.
30+
31+
Storybook will pick up any story from the `stories.js` file in a component folder.
32+
33+
Rinse is currently using the latest technology available, so you may need to update your Node versions to latest to accomodate Babel 7 and Webpack 4.

babelrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@babel/preset-env', '@babel/preset-react'],
3+
};

0 commit comments

Comments
 (0)