react-native-storybook-loader
Advanced tools
Comparing version
{ | ||
"name": "react-native-storybook-loader", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"repository": "https://github.com/elderfo/react-native-storybook-loader.git", | ||
@@ -5,0 +5,0 @@ "bugs": "https://github.com/elderfo/react-native-storybook-loader/issues", |
@@ -8,6 +8,5 @@ # react-native-storybook-loader | ||
## Purpose | ||
While using storybook for React Native, I repeatedly found myself manually creating a file with imports for all my stories. So I built an automated way to do it. `react-native-storybook-loader` can be run using configuration in your `package.json` or via the CLI interface. | ||
While using storybook for React Native, I repeatedly found myself manually creating a file with imports for all my stories. So I built an automated way to do it. `react-native-storybook-loader` can be run using configuration in your `package.json` or via the CLI interface and it generates a file with all the imports for you. | ||
@@ -19,3 +18,5 @@ ## Installation | ||
``` | ||
Or | ||
```bash | ||
@@ -28,2 +29,3 @@ npm install react-native-storybook-loader --save-dev | ||
Create a React Native project using [create-react-native-app](https://facebook.github.io/react-native/blog/2017/03/13/introducing-create-react-native-app.html) | ||
```bash | ||
@@ -34,2 +36,3 @@ create-react-native-app AwesomeProject | ||
Add react-native-storybook to the project using [`getstorybook`](https://getstorybook.io/docs/react-storybook/basics/quick-start-guide) | ||
```bash | ||
@@ -43,6 +46,6 @@ cd AwesomeProject | ||
```bash | ||
yarn install react-native-storybook-loader -D | ||
yarn add react-native-storybook-loader -D | ||
``` | ||
Update `index.js` file in the `./storybook` directory to point to the generated `storyLoader.js` | ||
Update `index.js` file in the `./storybook` directory to point to `storyLoader.js` (this file will be generated before launching Storybook). | ||
@@ -71,3 +74,30 @@ ```javascript | ||
Run Storybook | ||
```bash | ||
yarn storybook | ||
``` | ||
Or | ||
```bash | ||
npm run storybook | ||
``` | ||
Run react-native on the targeted platform | ||
```bash | ||
react-native run-android | ||
``` | ||
Or | ||
```bash | ||
react-native run-ios | ||
``` | ||
_Note: If you have problems connecting from your device to Storybook using Android issue the following command: `adb reverse tcp:7007 tcp:7007`._ | ||
## Configuration | ||
Story loading is controlled by the `react-native-storybook-loader` section of the project's `package.json`. | ||
@@ -135,5 +165,7 @@ | ||
## Support | ||
Please log issues | ||
## Contributing | ||
Coming Soon |
@@ -18,3 +18,6 @@ const fs = require('fs'); | ||
const templateContents = ` | ||
// template for doT (https://github.com/olado/doT) | ||
// Auto-generated file created by react-native-storybook-loader | ||
// Do not edit. | ||
// | ||
// https://github.com/elderfo/react-native-storybook-loader.git | ||
@@ -21,0 +24,0 @@ function loadStories() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
170453
0.29%932
0.32%165
24.06%