Skip to content

Commit

Permalink
Merge pull request #6 from cwlsn/5-storybook
Browse files Browse the repository at this point in the history
Setup latest Storybook alpha for babel7 and webpack4 support
  • Loading branch information
cwlsn authored Sep 3, 2018
2 parents 785e072 + 583a502 commit 17bb630
Show file tree
Hide file tree
Showing 9 changed files with 11,551 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

8 changes: 8 additions & 0 deletions .browserlistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"browserslist": [
"last 1 version",
"> 1%",
"maintained node versions",
"not dead"
]
}
1 change: 1 addition & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@storybook/addon-actions/register';
9 changes: 9 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { configure } from '@storybook/react';

const req = require.context('../src/components', true, /[^/]+\/stories.js$/);

function loadStories() {
req.keys().forEach((filename) => req(filename));
}

configure(loadStories, module);
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

## Get Started

Expand All @@ -16,3 +16,18 @@ $ cd cool-name
$ rm -rf .git
$ git init
```

## Development and Storybook

You can easily develop and interact with your components by using Storybook. To run the local server, simply run:

```bash
$ npm i
$ npm run storybook
```

Navigate to [http://localhost:9001](http://localhost:9001) to view your stories. They should automatically update as you develop.

Storybook will pick up any story from the `stories.js` file in a component folder.

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.
3 changes: 3 additions & 0 deletions babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['@babel/preset-env', '@babel/preset-react'],
};
Loading

0 comments on commit 17bb630

Please sign in to comment.