From 6da0f7a5e5211b888972c462ea0d8ebc0f658e89 Mon Sep 17 00:00:00 2001 From: Hypnosphi Date: Fri, 6 Jul 2018 23:18:49 +0300 Subject: [PATCH] Commit snapshot --- lib/cli/test/snapshots/react_babel_6/.babelrc | 4 +++ .../react_babel_6/.storybook/addons.js | 2 ++ .../react_babel_6/.storybook/config.js | 9 ++++++ .../test/snapshots/react_babel_6/index.html | 11 +++++++ lib/cli/test/snapshots/react_babel_6/index.js | 7 +++++ .../test/snapshots/react_babel_6/package.json | 30 +++++++++++++++++++ .../snapshots/react_babel_6/rollup.config.js | 22 ++++++++++++++ .../react_babel_6/stories/index.stories.js | 19 ++++++++++++ 8 files changed, 104 insertions(+) create mode 100644 lib/cli/test/snapshots/react_babel_6/.babelrc create mode 100644 lib/cli/test/snapshots/react_babel_6/.storybook/addons.js create mode 100644 lib/cli/test/snapshots/react_babel_6/.storybook/config.js create mode 100644 lib/cli/test/snapshots/react_babel_6/index.html create mode 100644 lib/cli/test/snapshots/react_babel_6/index.js create mode 100644 lib/cli/test/snapshots/react_babel_6/package.json create mode 100644 lib/cli/test/snapshots/react_babel_6/rollup.config.js create mode 100644 lib/cli/test/snapshots/react_babel_6/stories/index.stories.js diff --git a/lib/cli/test/snapshots/react_babel_6/.babelrc b/lib/cli/test/snapshots/react_babel_6/.babelrc new file mode 100644 index 00000000000..f93c98353c1 --- /dev/null +++ b/lib/cli/test/snapshots/react_babel_6/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["react"], + "plugins": ["external-helpers"] +} diff --git a/lib/cli/test/snapshots/react_babel_6/.storybook/addons.js b/lib/cli/test/snapshots/react_babel_6/.storybook/addons.js new file mode 100644 index 00000000000..6aed412d04a --- /dev/null +++ b/lib/cli/test/snapshots/react_babel_6/.storybook/addons.js @@ -0,0 +1,2 @@ +import '@storybook/addon-actions/register'; +import '@storybook/addon-links/register'; diff --git a/lib/cli/test/snapshots/react_babel_6/.storybook/config.js b/lib/cli/test/snapshots/react_babel_6/.storybook/config.js new file mode 100644 index 00000000000..b98cb4736a4 --- /dev/null +++ b/lib/cli/test/snapshots/react_babel_6/.storybook/config.js @@ -0,0 +1,9 @@ +import { configure } from '@storybook/react'; + +// automatically import all files ending in *.stories.js +const req = require.context('../stories', true, /.stories.js$/); +function loadStories() { + req.keys().forEach(filename => req(filename)); +} + +configure(loadStories, module); diff --git a/lib/cli/test/snapshots/react_babel_6/index.html b/lib/cli/test/snapshots/react_babel_6/index.html new file mode 100644 index 00000000000..bcb2f9489a6 --- /dev/null +++ b/lib/cli/test/snapshots/react_babel_6/index.html @@ -0,0 +1,11 @@ + + + + + Hello world + + +
+ + + \ No newline at end of file diff --git a/lib/cli/test/snapshots/react_babel_6/index.js b/lib/cli/test/snapshots/react_babel_6/index.js new file mode 100644 index 00000000000..8e5bb96fc9c --- /dev/null +++ b/lib/cli/test/snapshots/react_babel_6/index.js @@ -0,0 +1,7 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; + +ReactDOM.render( +

Hello, world!

, + document.getElementById('root') +); diff --git a/lib/cli/test/snapshots/react_babel_6/package.json b/lib/cli/test/snapshots/react_babel_6/package.json new file mode 100644 index 00000000000..8eab96d00d5 --- /dev/null +++ b/lib/cli/test/snapshots/react_babel_6/package.json @@ -0,0 +1,30 @@ +{ + "name": "react-babel-6-fixture", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "scripts": { + "build": "rollup -c", + "storybook": "start-storybook -p 6006", + "build-storybook": "build-storybook" + }, + "dependencies": { + "react": "^15.6.1", + "react-dom": "^15.6.1" + }, + "devDependencies": { + "babel-core": "^6.26.3", + "babel-plugin-external-helpers": "^6.22.0", + "babel-preset-react": "^6.24.1", + "rollup": "^0.49.1", + "rollup-plugin-babel": "^3.0.2", + "rollup-plugin-commonjs": "^8.2.0", + "rollup-plugin-node-resolve": "^3.0.0", + "rollup-plugin-replace": "^1.1.1", + "@storybook/react": "^3.4.8", + "@storybook/addon-actions": "^3.4.8", + "@storybook/addon-links": "^3.4.8", + "@storybook/addons": "^3.4.8", + "babel-loader": "^7.1.5" + } +} diff --git a/lib/cli/test/snapshots/react_babel_6/rollup.config.js b/lib/cli/test/snapshots/react_babel_6/rollup.config.js new file mode 100644 index 00000000000..2f0639d761f --- /dev/null +++ b/lib/cli/test/snapshots/react_babel_6/rollup.config.js @@ -0,0 +1,22 @@ +import replace from 'rollup-plugin-replace'; +import commonjs from 'rollup-plugin-commonjs'; +import resolve from 'rollup-plugin-node-resolve'; +import babel from 'rollup-plugin-babel'; + +export default { + input: 'index.js', + output: { + file: 'dist/bundle.js', + format: 'iife' + }, + plugins: [ + replace({ + 'process.env.NODE_ENV': JSON.stringify('production') + }), + commonjs(), + resolve(), + babel({ + exclude: 'node_modules/**' // only transpile our source code + }) + ] +}; diff --git a/lib/cli/test/snapshots/react_babel_6/stories/index.stories.js b/lib/cli/test/snapshots/react_babel_6/stories/index.stories.js new file mode 100644 index 00000000000..aa04241802d --- /dev/null +++ b/lib/cli/test/snapshots/react_babel_6/stories/index.stories.js @@ -0,0 +1,19 @@ +import React from 'react'; + +import { storiesOf } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; +import { linkTo } from '@storybook/addon-links'; + +import { Button, Welcome } from '@storybook/react/demo'; + +storiesOf('Welcome', module).add('to Storybook', () => ); + +storiesOf('Button', module) + .add('with text', () => ) + .add('with some emoji', () => ( + + ));