├── .gitignore ├── storybook-as-package ├── packages │ ├── storybook │ │ ├── .env │ │ ├── README.md │ │ ├── .storybook │ │ │ ├── addons.js │ │ │ └── config.js │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── manifest.json │ │ │ └── index.html │ │ ├── src │ │ │ └── stories │ │ │ │ └── index.js │ │ └── package.json │ ├── external-component │ │ ├── .env │ │ ├── .travis.yml │ │ ├── src │ │ │ ├── .eslintrc │ │ │ ├── styles.module.css │ │ │ └── index.js │ │ ├── README.md │ │ ├── .babelrc │ │ ├── .editorconfig │ │ ├── .eslintrc │ │ ├── rollup.config.js │ │ ├── package.json │ │ └── dist │ │ │ ├── index.es.js.map │ │ │ ├── index.js.map │ │ │ ├── index.es.js │ │ │ └── index.js │ └── web-app │ │ ├── .env │ │ ├── src │ │ ├── index.js │ │ └── index.css │ │ ├── package.json │ │ ├── public │ │ └── index.html │ │ └── README.md ├── lerna.json ├── package.json └── readme.md ├── storybook-in-root ├── packages │ ├── external-component │ │ ├── .env │ │ ├── .travis.yml │ │ ├── src │ │ │ ├── .eslintrc │ │ │ ├── styles.module.css │ │ │ └── index.js │ │ ├── README.md │ │ ├── .babelrc │ │ ├── .editorconfig │ │ ├── .eslintrc │ │ ├── rollup.config.js │ │ ├── package.json │ │ └── dist │ │ │ ├── index.es.js.map │ │ │ ├── index.js.map │ │ │ ├── index.es.js │ │ │ └── index.js │ └── web-app │ │ ├── .env │ │ ├── src │ │ ├── index.js │ │ └── index.css │ │ ├── package.json │ │ ├── public │ │ └── index.html │ │ └── README.md ├── .storybook │ ├── addons.js │ └── config.js ├── lerna.json ├── src │ └── stories │ │ └── index.js ├── readme.md └── package.json └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/.env: -------------------------------------------------------------------------------- 1 | SKIP_PREFLIGHT_CHECK=true 2 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/.env: -------------------------------------------------------------------------------- 1 | SKIP_PREFLIGHT_CHECK=true 2 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/.env: -------------------------------------------------------------------------------- 1 | SKIP_PREFLIGHT_CHECK=true 2 | -------------------------------------------------------------------------------- /storybook-in-root/packages/web-app/.env: -------------------------------------------------------------------------------- 1 | SKIP_PREFLIGHT_CHECK=true 2 | PORT=3001 3 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/README.md: -------------------------------------------------------------------------------- 1 | Create React App with Storybook 2 | -------------------------------------------------------------------------------- /storybook-as-package/packages/web-app/.env: -------------------------------------------------------------------------------- 1 | SKIP_PREFLIGHT_CHECK=true 2 | PORT=3001 3 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 9 4 | - 8 5 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 9 4 | - 8 5 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/src/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jest": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/src/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jest": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /storybook-in-root/.storybook/addons.js: -------------------------------------------------------------------------------- 1 | import '@storybook/addon-actions/register'; 2 | import '@storybook/addon-links/register'; 3 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/.storybook/addons.js: -------------------------------------------------------------------------------- 1 | import '@storybook/addon-actions/register'; 2 | import '@storybook/addon-links/register'; 3 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/README.md: -------------------------------------------------------------------------------- 1 | Created with create-react-library 2 | 3 | Only mod is adding `rollup-no-tty-check`, and deleting cruft. 4 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/README.md: -------------------------------------------------------------------------------- 1 | Created with create-react-library 2 | 3 | Only mod is adding `rollup-no-tty-check`, and deleting cruft. 4 | -------------------------------------------------------------------------------- /storybook-in-root/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "0.0.0", 6 | "npmClient": "yarn", 7 | "useWorkspaces": true 8 | } 9 | -------------------------------------------------------------------------------- /storybook-as-package/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "0.0.0", 6 | "npmClient": "yarn", 7 | "useWorkspaces": true 8 | } 9 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/src/styles.module.css: -------------------------------------------------------------------------------- 1 | .component { 2 | background: linen; 3 | font-size: 20px; 4 | border: 1px solid black; 5 | padding: 8px; 6 | } 7 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/src/styles.module.css: -------------------------------------------------------------------------------- 1 | .component { 2 | background: linen; 3 | font-size: 20px; 4 | border: 1px solid black; 5 | padding: 8px; 6 | } 7 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false 5 | }], 6 | "stage-0", 7 | "react" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richsoni/lerna-storybook-architecture-demo/HEAD/storybook-as-package/packages/storybook/public/favicon.ico -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false 5 | }], 6 | "stage-0", 7 | "react" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /storybook-in-root/.storybook/config.js: -------------------------------------------------------------------------------- 1 | import { configure } from '@storybook/react'; 2 | 3 | function loadStories() { 4 | require('../src/stories'); 5 | } 6 | 7 | configure(loadStories, module); 8 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/.storybook/config.js: -------------------------------------------------------------------------------- 1 | import { configure } from '@storybook/react'; 2 | 3 | function loadStories() { 4 | require('../src/stories'); 5 | } 6 | 7 | configure(loadStories, module); 8 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /storybook-in-root/packages/web-app/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import ExternalComponent from '@lerna-storybook-demo/external-component'; 5 | 6 | 7 | ReactDOM.render(, document.getElementById('root')); 8 | -------------------------------------------------------------------------------- /storybook-as-package/packages/web-app/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import ExternalComponent from '@lerna-storybook-demo/external-component'; 5 | 6 | 7 | ReactDOM.render(, document.getElementById('root')); 8 | -------------------------------------------------------------------------------- /storybook-in-root/src/stories/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import ExternalComponent from "../../packages/external-component/dist/index.es"; 5 | 6 | storiesOf('External Component', module) 7 | .add('default', () => ) 8 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/src/stories/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import ExternalComponent from "@lerna-storybook-demo/external-component"; 5 | 6 | storiesOf('External Component', module) 7 | .add('default', () => ) 8 | -------------------------------------------------------------------------------- /storybook-as-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "private": true, 4 | "scripts": { 5 | "build:all": "lerna run build --parallel", 6 | "install:all": "lerna bootstrap && lerna link", 7 | "start:all": "lerna run start --parallel" 8 | }, 9 | "devDependencies": { 10 | "lerna": "^3.10.5" 11 | }, 12 | "workspaces": [ 13 | "packages/*" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /storybook-as-package/packages/web-app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 5 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 6 | sans-serif; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | } 10 | 11 | code { 12 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 13 | monospace; 14 | } 15 | -------------------------------------------------------------------------------- /storybook-in-root/packages/web-app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 5 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 6 | sans-serif; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | } 10 | 11 | code { 12 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 13 | monospace; 14 | } 15 | -------------------------------------------------------------------------------- /storybook-as-package/readme.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | ## Getting Started 4 | 5 | This package uses [Yarn Workspaces], so make sure to install Yarn before setting up the package. 6 | 7 | ### Local Setup 8 | 9 | After cloning, run the following: 10 | 11 | ``` 12 | $ yarn install:all 13 | ``` 14 | 15 | ### Servers 16 | 17 | This package only requires one command to develop: 18 | 19 | ``` 20 | yarn start:all 21 | ``` 22 | 23 | [Yarn Workspaces]: https://yarnpkg.com/lang/en/docs/workspaces/ 24 | -------------------------------------------------------------------------------- /storybook-in-root/readme.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | ## Getting Started 4 | 5 | This package uses [Yarn Workspaces], so make sure to install Yarn before setting up the package. 6 | 7 | ### Local Setup 8 | 9 | After cloning, run the following: 10 | 11 | ``` 12 | $ yarn install:all 13 | ``` 14 | 15 | ### Servers 16 | 17 | This package requires two server commands: 18 | 19 | ``` 20 | yarn start:all 21 | yarn storybook 22 | ``` 23 | 24 | [Yarn Workspaces]: https://yarnpkg.com/lang/en/docs/workspaces/ 25 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/src/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import PropTypes from 'prop-types' 3 | import styles from './styles.module.css'; 4 | 5 | export default class ExampleComponent extends Component { 6 | static propTypes = { 7 | text: PropTypes.string 8 | } 9 | 10 | render() { 11 | const { 12 | text 13 | } = this.props 14 | 15 | return ( 16 |
17 | External Component: {text} 18 |
19 | ) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/src/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import PropTypes from 'prop-types' 3 | import styles from './styles.module.css'; 4 | 5 | export default class ExampleComponent extends Component { 6 | static propTypes = { 7 | text: PropTypes.string 8 | } 9 | 10 | render() { 11 | const { 12 | text 13 | } = this.props 14 | 15 | return ( 16 |
17 | External Component: {text} 18 |
19 | ) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": [ 4 | "standard", 5 | "standard-react" 6 | ], 7 | "env": { 8 | "es6": true 9 | }, 10 | "plugins": [ 11 | "react" 12 | ], 13 | "parserOptions": { 14 | "sourceType": "module" 15 | }, 16 | "rules": { 17 | // don't force es6 functions to include space before paren 18 | "space-before-function-paren": 0, 19 | 20 | // allow specifying true explicitly for boolean props 21 | "react/jsx-boolean-value": 0 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": [ 4 | "standard", 5 | "standard-react" 6 | ], 7 | "env": { 8 | "es6": true 9 | }, 10 | "plugins": [ 11 | "react" 12 | ], 13 | "parserOptions": { 14 | "sourceType": "module" 15 | }, 16 | "rules": { 17 | // don't force es6 functions to include space before paren 18 | "space-before-function-paren": 0, 19 | 20 | // allow specifying true explicitly for boolean props 21 | "react/jsx-boolean-value": 0 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /storybook-in-root/packages/web-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lerna-storybook-demo/web-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.7.0", 7 | "react-dom": "^16.7.0", 8 | "react-scripts": "2.1.3", 9 | "@lerna-storybook-demo/external-component": "1.0.0" 10 | }, 11 | "scripts": { 12 | "start": "react-scripts start", 13 | "build": "react-scripts build", 14 | "test": "react-scripts test", 15 | "eject": "react-scripts eject" 16 | }, 17 | "eslintConfig": { 18 | "extends": "react-app" 19 | }, 20 | "browserslist": [ 21 | ">0.2%", 22 | "not dead", 23 | "not ie <= 11", 24 | "not op_mini all" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /storybook-as-package/packages/web-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lerna-storybook-demo/web-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.7.0", 7 | "react-dom": "^16.7.0", 8 | "react-scripts": "2.1.3", 9 | "@lerna-storybook-demo/external-component": "1.0.0" 10 | }, 11 | "scripts": { 12 | "start": "react-scripts start", 13 | "build": "react-scripts build", 14 | "test": "react-scripts test", 15 | "eject": "react-scripts eject" 16 | }, 17 | "eslintConfig": { 18 | "extends": "react-app" 19 | }, 20 | "browserslist": [ 21 | ">0.2%", 22 | "not dead", 23 | "not ie <= 11", 24 | "not op_mini all" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /storybook-in-root/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "private": true, 4 | "scripts": { 5 | "build:all": "lerna run build --parallel", 6 | "install:all": "lerna bootstrap && lerna link", 7 | "start:all": "lerna run start --parallel", 8 | "storybook": "start-storybook -p 9009", 9 | "build-storybook": "build-storybook" 10 | }, 11 | "devDependencies": { 12 | "lerna": "^3.10.5", 13 | "@storybook/react": "^4.1.11", 14 | "@storybook/addon-actions": "^4.1.11", 15 | "@storybook/addon-links": "^4.1.11", 16 | "@storybook/addons": "^4.1.11", 17 | "@babel/core": "^7.2.2", 18 | "babel-loader": "^8.0.5" 19 | }, 20 | "workspaces": [ 21 | "packages/*" 22 | ], 23 | "dependencies": {} 24 | } 25 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/rollup.config.js: -------------------------------------------------------------------------------- 1 | import babel from 'rollup-plugin-babel' 2 | import commonjs from 'rollup-plugin-commonjs' 3 | import external from 'rollup-plugin-peer-deps-external' 4 | import postcss from 'rollup-plugin-postcss' 5 | import resolve from 'rollup-plugin-node-resolve' 6 | import url from 'rollup-plugin-url' 7 | import svgr from '@svgr/rollup' 8 | 9 | import pkg from './package.json' 10 | 11 | export default { 12 | input: 'src/index.js', 13 | output: [ 14 | { 15 | file: pkg.main, 16 | format: 'cjs', 17 | sourcemap: true 18 | }, 19 | { 20 | file: pkg.module, 21 | format: 'es', 22 | sourcemap: true 23 | } 24 | ], 25 | plugins: [ 26 | external(), 27 | postcss({ 28 | modules: true 29 | }), 30 | url(), 31 | svgr(), 32 | babel({ 33 | exclude: 'node_modules/**', 34 | plugins: [ 'external-helpers' ] 35 | }), 36 | resolve(), 37 | commonjs() 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/rollup.config.js: -------------------------------------------------------------------------------- 1 | import babel from 'rollup-plugin-babel' 2 | import commonjs from 'rollup-plugin-commonjs' 3 | import external from 'rollup-plugin-peer-deps-external' 4 | import postcss from 'rollup-plugin-postcss' 5 | import resolve from 'rollup-plugin-node-resolve' 6 | import url from 'rollup-plugin-url' 7 | import svgr from '@svgr/rollup' 8 | 9 | import pkg from './package.json' 10 | 11 | export default { 12 | input: 'src/index.js', 13 | output: [ 14 | { 15 | file: pkg.main, 16 | format: 'cjs', 17 | sourcemap: true 18 | }, 19 | { 20 | file: pkg.module, 21 | format: 'es', 22 | sourcemap: true 23 | } 24 | ], 25 | plugins: [ 26 | external(), 27 | postcss({ 28 | modules: true 29 | }), 30 | url(), 31 | svgr(), 32 | babel({ 33 | exclude: 'node_modules/**', 34 | plugins: [ 'external-helpers' ] 35 | }), 36 | resolve(), 37 | commonjs() 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lerna-storybook-demo/storybook", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.7.0", 7 | "react-dom": "^16.7.0", 8 | "react-scripts": "2.1.3", 9 | "@lerna-storybook-demo/external-component": "1.0.0" 10 | }, 11 | "scripts": { 12 | "start": "yarn storybook", 13 | "build": "react-scripts build", 14 | "test": "react-scripts test", 15 | "eject": "react-scripts eject", 16 | "storybook": "start-storybook -p 9009 -s public", 17 | "build-storybook": "build-storybook -s public" 18 | }, 19 | "eslintConfig": { 20 | "extends": "react-app" 21 | }, 22 | "browserslist": [ 23 | ">0.2%", 24 | "not dead", 25 | "not ie <= 11", 26 | "not op_mini all" 27 | ], 28 | "devDependencies": { 29 | "@storybook/react": "^4.1.11", 30 | "@storybook/addon-actions": "^4.1.11", 31 | "@storybook/addon-links": "^4.1.11", 32 | "@storybook/addons": "^4.1.11", 33 | "@babel/core": "^7.2.2", 34 | "babel-loader": "^8.0.5" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Lerna / Storybook Architecture Demo 2 | 3 | This Repo contains two separate lerna projects which contains the following: 4 | * lerna.json 5 | * `packages/external-component` - a component library using [create-react-library] which builds with React as a Peer Dependency. It also uses CSSModules to demonstrate that clients are not required to depend on them 6 | * `packages/web-app` - a basic [create-react-app], which depends on and imports the built `external-component` via lerna 7 | * A [Storybook] instance which include `external-component` and supports live reload 8 | 9 | When the packages differ is the location of [Storybook]. 10 | 11 | In `storybook-as-package`, [Storybook] is located in `packages` and behaves just like any other Lerna package. 12 | 13 | In `storybook-in-root`, [Storybook] is installed and configured within the Root repository. 14 | 15 | # Local Development 16 | 17 | Each project works slightly differently. 18 | 19 | Follow the readme for each: 20 | * [storybook-as-package](https://github.com/richsoni/lerna-storybook-architecture-demo/blob/master/storybook-as-package) 21 | * [storybook-in-root](https://github.com/richsoni/lerna-storybook-architecture-demo/blob/master/storybook-in-root) 22 | 23 | [create-react-library]: https://github.com/transitive-bullshit/create-react-library 24 | [create-react-app]: https://github.com/facebook/create-react-app 25 | [Storybook]: https://storybook.js.org 26 | -------------------------------------------------------------------------------- /storybook-as-package/packages/web-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 22 | React App 23 | 24 | 25 | 28 |
29 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /storybook-in-root/packages/web-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 22 | React App 23 | 24 | 25 | 28 |
29 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /storybook-as-package/packages/storybook/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 15 | 16 | 25 | React App 26 | 27 | 28 | 29 |
30 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lerna-storybook-demo/external-component", 3 | "version": "1.0.0", 4 | "description": "", 5 | "author": "richsoni", 6 | "license": "MIT", 7 | "repository": "richsoni/external-component", 8 | "main": "dist/index.js", 9 | "module": "dist/index.es.js", 10 | "jsnext:main": "dist/index.es.js", 11 | "engines": { 12 | "node": ">=8", 13 | "npm": ">=5" 14 | }, 15 | "scripts": { 16 | "test": "cross-env CI=1 react-scripts test --env=jsdom", 17 | "test:watch": "react-scripts test --env=jsdom", 18 | "build": "rollup -c", 19 | "start": "rollup -c -w", 20 | "prepare": "yarn run build", 21 | "predeploy": "cd example && yarn install && yarn run build", 22 | "deploy": "gh-pages -d example/build" 23 | }, 24 | "peerDependencies": { 25 | "prop-types": "^15.5.4", 26 | "react": "^15.0.0 || ^16.0.0", 27 | "react-dom": "^15.0.0 || ^16.0.0" 28 | }, 29 | "devDependencies": { 30 | "@svgr/rollup": "^2.4.1", 31 | "babel-core": "^6.26.3", 32 | "babel-eslint": "^8.2.5", 33 | "babel-plugin-external-helpers": "^6.22.0", 34 | "babel-preset-env": "^1.7.0", 35 | "babel-preset-react": "^6.24.1", 36 | "babel-preset-stage-0": "^6.24.1", 37 | "cross-env": "^5.1.4", 38 | "eslint": "^5.0.1", 39 | "eslint-config-standard": "^11.0.0", 40 | "eslint-config-standard-react": "^6.0.0", 41 | "eslint-plugin-import": "^2.13.0", 42 | "eslint-plugin-node": "^7.0.1", 43 | "eslint-plugin-promise": "^4.0.0", 44 | "eslint-plugin-react": "^7.10.0", 45 | "eslint-plugin-standard": "^3.1.0", 46 | "gh-pages": "^1.2.0", 47 | "prop-types": "^15.6.2", 48 | "react": "^16.4.1", 49 | "react-dom": "^16.4.1", 50 | "react-scripts": "^1.1.4", 51 | "rollup": "^0.64.1", 52 | "rollup-no-tty-check": "^0.0.2", 53 | "rollup-plugin-babel": "^3.0.7", 54 | "rollup-plugin-commonjs": "^9.1.3", 55 | "rollup-plugin-node-resolve": "^3.3.0", 56 | "rollup-plugin-peer-deps-external": "^2.2.0", 57 | "rollup-plugin-postcss": "^1.6.2", 58 | "rollup-plugin-url": "^1.4.0" 59 | }, 60 | "files": [ 61 | "dist" 62 | ], 63 | "dependencies": { 64 | "prop-types": "^15.6.2" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lerna-storybook-demo/external-component", 3 | "version": "1.0.0", 4 | "description": "", 5 | "author": "richsoni", 6 | "license": "MIT", 7 | "repository": "richsoni/external-component", 8 | "main": "dist/index.js", 9 | "module": "dist/index.es.js", 10 | "jsnext:main": "dist/index.es.js", 11 | "engines": { 12 | "node": ">=8", 13 | "npm": ">=5" 14 | }, 15 | "scripts": { 16 | "test": "cross-env CI=1 react-scripts test --env=jsdom", 17 | "test:watch": "react-scripts test --env=jsdom", 18 | "build": "rollup -c", 19 | "start": "rollup -c -w", 20 | "prepare": "yarn run build", 21 | "predeploy": "cd example && yarn install && yarn run build", 22 | "deploy": "gh-pages -d example/build" 23 | }, 24 | "peerDependencies": { 25 | "prop-types": "^15.5.4", 26 | "react": "^15.0.0 || ^16.0.0", 27 | "react-dom": "^15.0.0 || ^16.0.0" 28 | }, 29 | "devDependencies": { 30 | "@svgr/rollup": "^2.4.1", 31 | "babel-core": "^6.26.3", 32 | "babel-eslint": "^8.2.5", 33 | "babel-plugin-external-helpers": "^6.22.0", 34 | "babel-preset-env": "^1.7.0", 35 | "babel-preset-react": "^6.24.1", 36 | "babel-preset-stage-0": "^6.24.1", 37 | "cross-env": "^5.1.4", 38 | "eslint": "^5.0.1", 39 | "eslint-config-standard": "^11.0.0", 40 | "eslint-config-standard-react": "^6.0.0", 41 | "eslint-plugin-import": "^2.13.0", 42 | "eslint-plugin-node": "^7.0.1", 43 | "eslint-plugin-promise": "^4.0.0", 44 | "eslint-plugin-react": "^7.10.0", 45 | "eslint-plugin-standard": "^3.1.0", 46 | "gh-pages": "^1.2.0", 47 | "prop-types": "^15.6.2", 48 | "react": "^16.4.1", 49 | "react-dom": "^16.4.1", 50 | "react-scripts": "^1.1.4", 51 | "rollup": "^0.64.1", 52 | "rollup-no-tty-check": "^0.0.2", 53 | "rollup-plugin-babel": "^3.0.7", 54 | "rollup-plugin-commonjs": "^9.1.3", 55 | "rollup-plugin-node-resolve": "^3.3.0", 56 | "rollup-plugin-peer-deps-external": "^2.2.0", 57 | "rollup-plugin-postcss": "^1.6.2", 58 | "rollup-plugin-url": "^1.4.0" 59 | }, 60 | "files": [ 61 | "dist" 62 | ], 63 | "dependencies": { 64 | "prop-types": "^15.6.2" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/dist/index.es.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.es.js","sources":["../../../node_modules/style-inject/dist/style-inject.es.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport styles from './styles.module.css';\n\nexport default class ExampleComponent extends Component {\n static propTypes = {\n text: PropTypes.string\n }\n\n render() {\n const {\n text\n } = this.props\n\n return (\n
\n External Component: {text}\n
\n )\n }\n}\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","ExampleComponent","text","props","styles","component","Component","propTypes","PropTypes","string"],"mappings":";;;AAAA,SAASA,WAAT,CAAqBC,GAArB,EAA0BC,GAA1B,EAA+B;MACxBA,QAAQ,KAAK,CAAlB,EAAsBA,MAAM,EAAN;MAClBC,WAAWD,IAAIC,QAAnB;;MAEI,CAACF,GAAD,IAAQ,OAAOG,QAAP,KAAoB,WAAhC,EAA6C;;;;MAEzCC,OAAOD,SAASC,IAAT,IAAiBD,SAASE,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAA5B;MACIC,QAAQH,SAASI,aAAT,CAAuB,OAAvB,CAAZ;QACMC,IAAN,GAAa,UAAb;;MAEIN,aAAa,KAAjB,EAAwB;QAClBE,KAAKK,UAAT,EAAqB;WACdC,YAAL,CAAkBJ,KAAlB,EAAyBF,KAAKK,UAA9B;KADF,MAEO;WACAE,WAAL,CAAiBL,KAAjB;;GAJJ,MAMO;SACAK,WAAL,CAAiBL,KAAjB;;;MAGEA,MAAMM,UAAV,EAAsB;UACdA,UAAN,CAAiBC,OAAjB,GAA2Bb,GAA3B;GADF,MAEO;UACCW,WAAN,CAAkBR,SAASW,cAAT,CAAwBd,GAAxB,CAAlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICnBiBe;;;;;;;;;;6BAKV;UAELC,IAFK,GAGH,KAAKC,KAHF,CAELD,IAFK;;;aAML;;UAAK,WAAWE,OAAOC,SAAvB;;;OADF;;;;EAV0CC;;AAAzBL,iBACZM,YAAY;QACXC,UAAUC;;;;;"} -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/dist/index.es.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.es.js","sources":["../../../node_modules/style-inject/dist/style-inject.es.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport styles from './styles.module.css';\n\nexport default class ExampleComponent extends Component {\n static propTypes = {\n text: PropTypes.string\n }\n\n render() {\n const {\n text\n } = this.props\n\n return (\n
\n External Component: {text}\n
\n )\n }\n}\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","ExampleComponent","text","props","styles","component","Component","propTypes","PropTypes","string"],"mappings":";;;AAAA,SAASA,WAAT,CAAqBC,GAArB,EAA0BC,GAA1B,EAA+B;MACxBA,QAAQ,KAAK,CAAlB,EAAsBA,MAAM,EAAN;MAClBC,WAAWD,IAAIC,QAAnB;;MAEI,CAACF,GAAD,IAAQ,OAAOG,QAAP,KAAoB,WAAhC,EAA6C;;;;MAEzCC,OAAOD,SAASC,IAAT,IAAiBD,SAASE,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAA5B;MACIC,QAAQH,SAASI,aAAT,CAAuB,OAAvB,CAAZ;QACMC,IAAN,GAAa,UAAb;;MAEIN,aAAa,KAAjB,EAAwB;QAClBE,KAAKK,UAAT,EAAqB;WACdC,YAAL,CAAkBJ,KAAlB,EAAyBF,KAAKK,UAA9B;KADF,MAEO;WACAE,WAAL,CAAiBL,KAAjB;;GAJJ,MAMO;SACAK,WAAL,CAAiBL,KAAjB;;;MAGEA,MAAMM,UAAV,EAAsB;UACdA,UAAN,CAAiBC,OAAjB,GAA2Bb,GAA3B;GADF,MAEO;UACCW,WAAN,CAAkBR,SAASW,cAAT,CAAwBd,GAAxB,CAAlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICnBiBe;;;;;;;;;;6BAKV;UAELC,IAFK,GAGH,KAAKC,KAHF,CAELD,IAFK;;;aAML;;UAAK,WAAWE,OAAOC,SAAvB;;;OADF;;;;EAV0CC;;AAAzBL,iBACZM,YAAY;QACXC,UAAUC;;;;;"} -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/dist/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sources":["../../../node_modules/style-inject/dist/style-inject.es.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport styles from './styles.module.css';\n\nexport default class ExampleComponent extends Component {\n static propTypes = {\n text: PropTypes.string\n }\n\n render() {\n const {\n text\n } = this.props\n\n return (\n
\n External Component: {text}\n
\n )\n }\n}\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","ExampleComponent","text","props","React","styles","component","Component","propTypes","PropTypes","string"],"mappings":";;;;;;;;AAAA,SAASA,WAAT,CAAqBC,GAArB,EAA0BC,GAA1B,EAA+B;MACxBA,QAAQ,KAAK,CAAlB,EAAsBA,MAAM,EAAN;MAClBC,WAAWD,IAAIC,QAAnB;;MAEI,CAACF,GAAD,IAAQ,OAAOG,QAAP,KAAoB,WAAhC,EAA6C;;;;MAEzCC,OAAOD,SAASC,IAAT,IAAiBD,SAASE,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAA5B;MACIC,QAAQH,SAASI,aAAT,CAAuB,OAAvB,CAAZ;QACMC,IAAN,GAAa,UAAb;;MAEIN,aAAa,KAAjB,EAAwB;QAClBE,KAAKK,UAAT,EAAqB;WACdC,YAAL,CAAkBJ,KAAlB,EAAyBF,KAAKK,UAA9B;KADF,MAEO;WACAE,WAAL,CAAiBL,KAAjB;;GAJJ,MAMO;SACAK,WAAL,CAAiBL,KAAjB;;;MAGEA,MAAMM,UAAV,EAAsB;UACdA,UAAN,CAAiBC,OAAjB,GAA2Bb,GAA3B;GADF,MAEO;UACCW,WAAN,CAAkBR,SAASW,cAAT,CAAwBd,GAAxB,CAAlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICnBiBe;;;;;;;;;;6BAKV;UAELC,IAFK,GAGH,KAAKC,KAHF,CAELD,IAFK;;;aAMLE;;UAAK,WAAWC,OAAOC,SAAvB;;;OADF;;;;EAV0CC;;AAAzBN,iBACZO,YAAY;QACXC,UAAUC;;;;;"} -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/dist/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sources":["../../../node_modules/style-inject/dist/style-inject.es.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport styles from './styles.module.css';\n\nexport default class ExampleComponent extends Component {\n static propTypes = {\n text: PropTypes.string\n }\n\n render() {\n const {\n text\n } = this.props\n\n return (\n
\n External Component: {text}\n
\n )\n }\n}\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","ExampleComponent","text","props","React","styles","component","Component","propTypes","PropTypes","string"],"mappings":";;;;;;;;AAAA,SAASA,WAAT,CAAqBC,GAArB,EAA0BC,GAA1B,EAA+B;MACxBA,QAAQ,KAAK,CAAlB,EAAsBA,MAAM,EAAN;MAClBC,WAAWD,IAAIC,QAAnB;;MAEI,CAACF,GAAD,IAAQ,OAAOG,QAAP,KAAoB,WAAhC,EAA6C;;;;MAEzCC,OAAOD,SAASC,IAAT,IAAiBD,SAASE,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAA5B;MACIC,QAAQH,SAASI,aAAT,CAAuB,OAAvB,CAAZ;QACMC,IAAN,GAAa,UAAb;;MAEIN,aAAa,KAAjB,EAAwB;QAClBE,KAAKK,UAAT,EAAqB;WACdC,YAAL,CAAkBJ,KAAlB,EAAyBF,KAAKK,UAA9B;KADF,MAEO;WACAE,WAAL,CAAiBL,KAAjB;;GAJJ,MAMO;SACAK,WAAL,CAAiBL,KAAjB;;;MAGEA,MAAMM,UAAV,EAAsB;UACdA,UAAN,CAAiBC,OAAjB,GAA2Bb,GAA3B;GADF,MAEO;UACCW,WAAN,CAAkBR,SAASW,cAAT,CAAwBd,GAAxB,CAAlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICnBiBe;;;;;;;;;;6BAKV;UAELC,IAFK,GAGH,KAAKC,KAHF,CAELD,IAFK;;;aAMLE;;UAAK,WAAWC,OAAOC,SAAvB;;;OADF;;;;EAV0CC;;AAAzBN,iBACZO,YAAY;QACXC,UAAUC;;;;;"} -------------------------------------------------------------------------------- /storybook-in-root/packages/web-app/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /storybook-as-package/packages/web-app/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/dist/index.es.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | function styleInject(css, ref) { 5 | if (ref === void 0) ref = {}; 6 | var insertAt = ref.insertAt; 7 | 8 | if (!css || typeof document === 'undefined') { 9 | return; 10 | } 11 | 12 | var head = document.head || document.getElementsByTagName('head')[0]; 13 | var style = document.createElement('style'); 14 | style.type = 'text/css'; 15 | 16 | if (insertAt === 'top') { 17 | if (head.firstChild) { 18 | head.insertBefore(style, head.firstChild); 19 | } else { 20 | head.appendChild(style); 21 | } 22 | } else { 23 | head.appendChild(style); 24 | } 25 | 26 | if (style.styleSheet) { 27 | style.styleSheet.cssText = css; 28 | } else { 29 | style.appendChild(document.createTextNode(css)); 30 | } 31 | } 32 | 33 | var css = ".styles-module_component__ujQ7c {\n background: linen;\n font-size: 20px;\n border: 1px solid black;\n padding: 8px;\n}\n"; 34 | var styles = { "component": "styles-module_component__ujQ7c" }; 35 | styleInject(css); 36 | 37 | var classCallCheck = function (instance, Constructor) { 38 | if (!(instance instanceof Constructor)) { 39 | throw new TypeError("Cannot call a class as a function"); 40 | } 41 | }; 42 | 43 | var createClass = function () { 44 | function defineProperties(target, props) { 45 | for (var i = 0; i < props.length; i++) { 46 | var descriptor = props[i]; 47 | descriptor.enumerable = descriptor.enumerable || false; 48 | descriptor.configurable = true; 49 | if ("value" in descriptor) descriptor.writable = true; 50 | Object.defineProperty(target, descriptor.key, descriptor); 51 | } 52 | } 53 | 54 | return function (Constructor, protoProps, staticProps) { 55 | if (protoProps) defineProperties(Constructor.prototype, protoProps); 56 | if (staticProps) defineProperties(Constructor, staticProps); 57 | return Constructor; 58 | }; 59 | }(); 60 | 61 | var inherits = function (subClass, superClass) { 62 | if (typeof superClass !== "function" && superClass !== null) { 63 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 64 | } 65 | 66 | subClass.prototype = Object.create(superClass && superClass.prototype, { 67 | constructor: { 68 | value: subClass, 69 | enumerable: false, 70 | writable: true, 71 | configurable: true 72 | } 73 | }); 74 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 75 | }; 76 | 77 | var possibleConstructorReturn = function (self, call) { 78 | if (!self) { 79 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 80 | } 81 | 82 | return call && (typeof call === "object" || typeof call === "function") ? call : self; 83 | }; 84 | 85 | var ExampleComponent = function (_Component) { 86 | inherits(ExampleComponent, _Component); 87 | 88 | function ExampleComponent() { 89 | classCallCheck(this, ExampleComponent); 90 | return possibleConstructorReturn(this, (ExampleComponent.__proto__ || Object.getPrototypeOf(ExampleComponent)).apply(this, arguments)); 91 | } 92 | 93 | createClass(ExampleComponent, [{ 94 | key: 'render', 95 | value: function render() { 96 | var text = this.props.text; 97 | 98 | 99 | return React.createElement( 100 | 'div', 101 | { className: styles.component }, 102 | 'External Component: ', 103 | text 104 | ); 105 | } 106 | }]); 107 | return ExampleComponent; 108 | }(Component); 109 | 110 | ExampleComponent.propTypes = { 111 | text: PropTypes.string 112 | }; 113 | 114 | export default ExampleComponent; 115 | //# sourceMappingURL=index.es.js.map 116 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/dist/index.es.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | function styleInject(css, ref) { 5 | if (ref === void 0) ref = {}; 6 | var insertAt = ref.insertAt; 7 | 8 | if (!css || typeof document === 'undefined') { 9 | return; 10 | } 11 | 12 | var head = document.head || document.getElementsByTagName('head')[0]; 13 | var style = document.createElement('style'); 14 | style.type = 'text/css'; 15 | 16 | if (insertAt === 'top') { 17 | if (head.firstChild) { 18 | head.insertBefore(style, head.firstChild); 19 | } else { 20 | head.appendChild(style); 21 | } 22 | } else { 23 | head.appendChild(style); 24 | } 25 | 26 | if (style.styleSheet) { 27 | style.styleSheet.cssText = css; 28 | } else { 29 | style.appendChild(document.createTextNode(css)); 30 | } 31 | } 32 | 33 | var css = ".styles-module_component__ujQ7c {\n background: linen;\n font-size: 20px;\n border: 1px solid black;\n padding: 8px;\n}\n"; 34 | var styles = { "component": "styles-module_component__ujQ7c" }; 35 | styleInject(css); 36 | 37 | var classCallCheck = function (instance, Constructor) { 38 | if (!(instance instanceof Constructor)) { 39 | throw new TypeError("Cannot call a class as a function"); 40 | } 41 | }; 42 | 43 | var createClass = function () { 44 | function defineProperties(target, props) { 45 | for (var i = 0; i < props.length; i++) { 46 | var descriptor = props[i]; 47 | descriptor.enumerable = descriptor.enumerable || false; 48 | descriptor.configurable = true; 49 | if ("value" in descriptor) descriptor.writable = true; 50 | Object.defineProperty(target, descriptor.key, descriptor); 51 | } 52 | } 53 | 54 | return function (Constructor, protoProps, staticProps) { 55 | if (protoProps) defineProperties(Constructor.prototype, protoProps); 56 | if (staticProps) defineProperties(Constructor, staticProps); 57 | return Constructor; 58 | }; 59 | }(); 60 | 61 | var inherits = function (subClass, superClass) { 62 | if (typeof superClass !== "function" && superClass !== null) { 63 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 64 | } 65 | 66 | subClass.prototype = Object.create(superClass && superClass.prototype, { 67 | constructor: { 68 | value: subClass, 69 | enumerable: false, 70 | writable: true, 71 | configurable: true 72 | } 73 | }); 74 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 75 | }; 76 | 77 | var possibleConstructorReturn = function (self, call) { 78 | if (!self) { 79 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 80 | } 81 | 82 | return call && (typeof call === "object" || typeof call === "function") ? call : self; 83 | }; 84 | 85 | var ExampleComponent = function (_Component) { 86 | inherits(ExampleComponent, _Component); 87 | 88 | function ExampleComponent() { 89 | classCallCheck(this, ExampleComponent); 90 | return possibleConstructorReturn(this, (ExampleComponent.__proto__ || Object.getPrototypeOf(ExampleComponent)).apply(this, arguments)); 91 | } 92 | 93 | createClass(ExampleComponent, [{ 94 | key: 'render', 95 | value: function render() { 96 | var text = this.props.text; 97 | 98 | 99 | return React.createElement( 100 | 'div', 101 | { className: styles.component }, 102 | 'External Component: ', 103 | text 104 | ); 105 | } 106 | }]); 107 | return ExampleComponent; 108 | }(Component); 109 | 110 | ExampleComponent.propTypes = { 111 | text: PropTypes.string 112 | }; 113 | 114 | export default ExampleComponent; 115 | //# sourceMappingURL=index.es.js.map 116 | -------------------------------------------------------------------------------- /storybook-in-root/packages/external-component/dist/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } 4 | 5 | var React = require('react'); 6 | var React__default = _interopDefault(React); 7 | var PropTypes = _interopDefault(require('prop-types')); 8 | 9 | function styleInject(css, ref) { 10 | if (ref === void 0) ref = {}; 11 | var insertAt = ref.insertAt; 12 | 13 | if (!css || typeof document === 'undefined') { 14 | return; 15 | } 16 | 17 | var head = document.head || document.getElementsByTagName('head')[0]; 18 | var style = document.createElement('style'); 19 | style.type = 'text/css'; 20 | 21 | if (insertAt === 'top') { 22 | if (head.firstChild) { 23 | head.insertBefore(style, head.firstChild); 24 | } else { 25 | head.appendChild(style); 26 | } 27 | } else { 28 | head.appendChild(style); 29 | } 30 | 31 | if (style.styleSheet) { 32 | style.styleSheet.cssText = css; 33 | } else { 34 | style.appendChild(document.createTextNode(css)); 35 | } 36 | } 37 | 38 | var css = ".styles-module_component__ujQ7c {\n background: linen;\n font-size: 20px;\n border: 1px solid black;\n padding: 8px;\n}\n"; 39 | var styles = { "component": "styles-module_component__ujQ7c" }; 40 | styleInject(css); 41 | 42 | var classCallCheck = function (instance, Constructor) { 43 | if (!(instance instanceof Constructor)) { 44 | throw new TypeError("Cannot call a class as a function"); 45 | } 46 | }; 47 | 48 | var createClass = function () { 49 | function defineProperties(target, props) { 50 | for (var i = 0; i < props.length; i++) { 51 | var descriptor = props[i]; 52 | descriptor.enumerable = descriptor.enumerable || false; 53 | descriptor.configurable = true; 54 | if ("value" in descriptor) descriptor.writable = true; 55 | Object.defineProperty(target, descriptor.key, descriptor); 56 | } 57 | } 58 | 59 | return function (Constructor, protoProps, staticProps) { 60 | if (protoProps) defineProperties(Constructor.prototype, protoProps); 61 | if (staticProps) defineProperties(Constructor, staticProps); 62 | return Constructor; 63 | }; 64 | }(); 65 | 66 | var inherits = function (subClass, superClass) { 67 | if (typeof superClass !== "function" && superClass !== null) { 68 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 69 | } 70 | 71 | subClass.prototype = Object.create(superClass && superClass.prototype, { 72 | constructor: { 73 | value: subClass, 74 | enumerable: false, 75 | writable: true, 76 | configurable: true 77 | } 78 | }); 79 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 80 | }; 81 | 82 | var possibleConstructorReturn = function (self, call) { 83 | if (!self) { 84 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 85 | } 86 | 87 | return call && (typeof call === "object" || typeof call === "function") ? call : self; 88 | }; 89 | 90 | var ExampleComponent = function (_Component) { 91 | inherits(ExampleComponent, _Component); 92 | 93 | function ExampleComponent() { 94 | classCallCheck(this, ExampleComponent); 95 | return possibleConstructorReturn(this, (ExampleComponent.__proto__ || Object.getPrototypeOf(ExampleComponent)).apply(this, arguments)); 96 | } 97 | 98 | createClass(ExampleComponent, [{ 99 | key: 'render', 100 | value: function render() { 101 | var text = this.props.text; 102 | 103 | 104 | return React__default.createElement( 105 | 'div', 106 | { className: styles.component }, 107 | 'External Component: ', 108 | text 109 | ); 110 | } 111 | }]); 112 | return ExampleComponent; 113 | }(React.Component); 114 | 115 | ExampleComponent.propTypes = { 116 | text: PropTypes.string 117 | }; 118 | 119 | module.exports = ExampleComponent; 120 | //# sourceMappingURL=index.js.map 121 | -------------------------------------------------------------------------------- /storybook-as-package/packages/external-component/dist/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } 4 | 5 | var React = require('react'); 6 | var React__default = _interopDefault(React); 7 | var PropTypes = _interopDefault(require('prop-types')); 8 | 9 | function styleInject(css, ref) { 10 | if (ref === void 0) ref = {}; 11 | var insertAt = ref.insertAt; 12 | 13 | if (!css || typeof document === 'undefined') { 14 | return; 15 | } 16 | 17 | var head = document.head || document.getElementsByTagName('head')[0]; 18 | var style = document.createElement('style'); 19 | style.type = 'text/css'; 20 | 21 | if (insertAt === 'top') { 22 | if (head.firstChild) { 23 | head.insertBefore(style, head.firstChild); 24 | } else { 25 | head.appendChild(style); 26 | } 27 | } else { 28 | head.appendChild(style); 29 | } 30 | 31 | if (style.styleSheet) { 32 | style.styleSheet.cssText = css; 33 | } else { 34 | style.appendChild(document.createTextNode(css)); 35 | } 36 | } 37 | 38 | var css = ".styles-module_component__ujQ7c {\n background: linen;\n font-size: 20px;\n border: 1px solid black;\n padding: 8px;\n}\n"; 39 | var styles = { "component": "styles-module_component__ujQ7c" }; 40 | styleInject(css); 41 | 42 | var classCallCheck = function (instance, Constructor) { 43 | if (!(instance instanceof Constructor)) { 44 | throw new TypeError("Cannot call a class as a function"); 45 | } 46 | }; 47 | 48 | var createClass = function () { 49 | function defineProperties(target, props) { 50 | for (var i = 0; i < props.length; i++) { 51 | var descriptor = props[i]; 52 | descriptor.enumerable = descriptor.enumerable || false; 53 | descriptor.configurable = true; 54 | if ("value" in descriptor) descriptor.writable = true; 55 | Object.defineProperty(target, descriptor.key, descriptor); 56 | } 57 | } 58 | 59 | return function (Constructor, protoProps, staticProps) { 60 | if (protoProps) defineProperties(Constructor.prototype, protoProps); 61 | if (staticProps) defineProperties(Constructor, staticProps); 62 | return Constructor; 63 | }; 64 | }(); 65 | 66 | var inherits = function (subClass, superClass) { 67 | if (typeof superClass !== "function" && superClass !== null) { 68 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 69 | } 70 | 71 | subClass.prototype = Object.create(superClass && superClass.prototype, { 72 | constructor: { 73 | value: subClass, 74 | enumerable: false, 75 | writable: true, 76 | configurable: true 77 | } 78 | }); 79 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 80 | }; 81 | 82 | var possibleConstructorReturn = function (self, call) { 83 | if (!self) { 84 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 85 | } 86 | 87 | return call && (typeof call === "object" || typeof call === "function") ? call : self; 88 | }; 89 | 90 | var ExampleComponent = function (_Component) { 91 | inherits(ExampleComponent, _Component); 92 | 93 | function ExampleComponent() { 94 | classCallCheck(this, ExampleComponent); 95 | return possibleConstructorReturn(this, (ExampleComponent.__proto__ || Object.getPrototypeOf(ExampleComponent)).apply(this, arguments)); 96 | } 97 | 98 | createClass(ExampleComponent, [{ 99 | key: 'render', 100 | value: function render() { 101 | var text = this.props.text; 102 | 103 | 104 | return React__default.createElement( 105 | 'div', 106 | { className: styles.component }, 107 | 'External Component: ', 108 | text 109 | ); 110 | } 111 | }]); 112 | return ExampleComponent; 113 | }(React.Component); 114 | 115 | ExampleComponent.propTypes = { 116 | text: PropTypes.string 117 | }; 118 | 119 | module.exports = ExampleComponent; 120 | //# sourceMappingURL=index.js.map 121 | --------------------------------------------------------------------------------