diff --git a/.gitignore b/.gitignore index cbaf6162bbd4..9516fb99c900 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,22 @@ node_modules *.log .idea + +package-lock.json npm-shrinkwrap.json +yarn.lock +*.lerna_backup +packs/*.tgz + dist +build +coverage/ +docs/public + +.cache + .tern-port *.DS_Store -.cache junit.xml -coverage/ -*.lerna_backup -build packages/examples/automated-* -yarn.lock /**/LICENSE -docs/public -packs/*.tgz -package-lock.json diff --git a/app/react/src/server/config/webpack.config.js b/app/react/src/server/config/webpack.config.js index 24eacd0bf24b..f80f31e1751f 100644 --- a/app/react/src/server/config/webpack.config.js +++ b/app/react/src/server/config/webpack.config.js @@ -46,6 +46,9 @@ export default function() { // Add support to NODE_PATH. With this we could avoid relative path imports. // Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253 modules: ['node_modules'].concat(nodePaths), + alias: { + react: path.resolve('./node_modules/react'), + }, }, performance: { hints: false, diff --git a/app/react/src/server/config/webpack.config.prod.js b/app/react/src/server/config/webpack.config.prod.js index 989b1adca7ad..fed4daea79c2 100644 --- a/app/react/src/server/config/webpack.config.prod.js +++ b/app/react/src/server/config/webpack.config.prod.js @@ -54,6 +54,10 @@ export default function() { // Add support to NODE_PATH. With this we could avoid relative path imports. // Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253 modules: ['node_modules'].concat(nodePaths), + alias: { + react: path.resolve('./node_modules/react'), + 'react-dom': path.resolve('./node_modules/react-dom'), + }, }, }; diff --git a/examples/cra-kitchen-sink/src/stories/index.js b/examples/cra-kitchen-sink/src/stories/index.js index fabd50e219a2..dfa2525b7ed8 100644 --- a/examples/cra-kitchen-sink/src/stories/index.js +++ b/examples/cra-kitchen-sink/src/stories/index.js @@ -58,6 +58,7 @@ storiesOf('Button', module) // NOTE: color picker is currently broken const backgroundColor = color('background', '#ffff00'); + // const backgroundColor = '#ffff00'; const items = array('Items', ['Laptop', 'Book', 'Whiskey']); const otherStyles = object('Styles', { border: '3px solid #ff00ff', diff --git a/lib/cli/package.json b/lib/cli/package.json index 3244c0958914..94486a1557d3 100644 --- a/lib/cli/package.json +++ b/lib/cli/package.json @@ -20,9 +20,6 @@ "type": "git", "url": "https://github.com/storybooks/storybook.git" }, - "scripts": { - "postinstall": "opencollective postinstall --collective=storybook" - }, "dependencies": { "@storybook/codemod": "^3.1.5", "chalk": "^1.1.3", diff --git a/package.json b/package.json index a3ef97b387f3..e1d70a42e3e2 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,11 @@ "babel-plugin-transform-runtime": "^6.23.0", "babel-polyfill": "^6.23.0", "babel-preset-env": "^1.5.1", + "babel-preset-es2015": "^6.24.1", + "babel-preset-es2016": "^6.24.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-0": "^6.24.1", + "babel-runtime": "^6.23.0", "chalk": "^1.1.3", "codecov": "^2.2.0", "danger": "^0.21.0", diff --git a/scripts/prepublish.js b/scripts/prepublish.js index d13952b9e4c1..a4206fbd6ac9 100644 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -9,11 +9,15 @@ shell.echo(chalk.bold(`${packageJson.name}@${packageJson.version}`)); shell.echo(chalk.gray('\n=> Clean dist.')); shell.rm('-rf', 'dist'); +const pwd = shell.pwd(); +shell.echo(`pwd = ${pwd}`); +shell.cd(path.join(__dirname, '..')); + const babel = path.join(__dirname, '..', 'node_modules', '.bin', 'babel'); const args = [ '--ignore tests,__tests__,test.js,stories/,story.jsx', '--plugins "transform-runtime"', - './src --out-dir ./dist', + `${pwd}/src --out-dir ${pwd}/dist`, '--copy-files', ].join(' ');