diff --git a/.eslintignore b/.eslintignore index 3c3629e..99e39d7 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ -node_modules +/node_modules/ +/packages/ diff --git a/.nvmrc b/.nvmrc index ba7f754..18bb418 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -7.4.0 +7.5.0 diff --git a/circle.yml b/circle.yml index 52a40cf..bbbbc3d 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,6 @@ machine: node: - version: 7.4.0 + version: 7.5.0 environment: NODE_ENV: development @@ -10,10 +10,11 @@ dependencies: override: - npm install post: - - node_modules/.bin/lerna bootstrap + - npm run -s lerna -- bootstrap test: override: - - node_modules/.bin/lerna run lint - - node_modules/.bin/lerna run test - - node_modules/.bin/lerna run e2e --concurrency 1 + - npm run -s lint + - npm run -s lerna -- run lint + - npm run -s lerna -- run test + - npm run -s lerna -- run e2e --concurrency 1 diff --git a/lerna.json b/lerna.json index eaa62b9..0d6f9fb 100644 --- a/lerna.json +++ b/lerna.json @@ -1,4 +1,4 @@ { - "lerna": "2.0.0-beta.34", + "lerna": "2.0.0-beta.37", "version": "independent" } diff --git a/lib/webpack/common.js b/lib/webpack/common.js index 88a11e9..d5d7237 100644 --- a/lib/webpack/common.js +++ b/lib/webpack/common.js @@ -27,11 +27,24 @@ exports.PACKAGE_NAME = PACKAGE_NAME; exports.loaders = { - json: {test: /\.json$/, loader: `json`}, babel: { test: /\.js$/, - loader: `babel`, - include: [pathTo(`src`), pathTo(`example`)] + loader: `babel-loader`, + include: [pathTo(`src`), pathTo(`example`)], + options: { + presets: [ + [`es2015`, {loose: true, modules: false}], + `react` + ], + plugins: [ + `transform-object-rest-spread` + ], + env: { + production: { + plugins: [`transform-react-remove-prop-types`] + } + } + } } }; @@ -41,19 +54,20 @@ exports.plugins = { 'process.env.NODE_ENV': JSON.stringify(NODE_ENV) }), html: new HtmlWebpackPlugin(), - uglify: new webpack.optimize.UglifyJsPlugin({ - compressor: { - warnings: false - } - }), + uglify: new webpack.optimize.UglifyJsPlugin(), include: assets => new HtmlWebpackIncludeAssetsPlugin({ assets, append: false + }), + loaderOptions: new webpack.LoaderOptionsPlugin({ + minimize: true }) }; -exports.resolve = {extensions: [``, `.js`]}; +exports.resolve = { + extensions: [`.js`] +}; exports.stats = {colors: true}; diff --git a/lib/webpack/dev.config.js b/lib/webpack/dev.config.js index e75780d..a207d5f 100644 --- a/lib/webpack/dev.config.js +++ b/lib/webpack/dev.config.js @@ -1,5 +1,3 @@ - - const { pathTo, plugins, @@ -25,7 +23,7 @@ module.exports = { plugins.define ], module: { - loaders: [ + rules: [ loaders.babel ] }, diff --git a/lib/webpack/dist.config.js b/lib/webpack/dist.config.js index 0710c9a..1b24283 100644 --- a/lib/webpack/dist.config.js +++ b/lib/webpack/dist.config.js @@ -1,5 +1,3 @@ - - const { pathTo, PACKAGE_NAME, @@ -13,7 +11,7 @@ const { module.exports = { - devtool: null, + devtool: false, entry: pathTo(`src`, `index.js`), output: { filename: `${PACKAGE_NAME}.js`, @@ -25,7 +23,7 @@ module.exports = { plugins.define ], module: { - loaders: [ + rules: [ loaders.babel ] }, diff --git a/lib/webpack/min.config.js b/lib/webpack/min.config.js index e71dc16..92edd78 100644 --- a/lib/webpack/min.config.js +++ b/lib/webpack/min.config.js @@ -13,7 +13,7 @@ const { module.exports = { - devtool: null, + devtool: false, entry: pathTo(`src`, `index.js`), output: { filename: `${PACKAGE_NAME}.min.js`, @@ -23,10 +23,11 @@ module.exports = { }, plugins: [ plugins.define, - plugins.uglify + plugins.uglify, + plugins.loaderOptions ], module: { - loaders: [ + rules: [ loaders.babel ] }, diff --git a/lib/webpack/pub.config.js b/lib/webpack/pub.config.js index 03ee5fd..368e355 100644 --- a/lib/webpack/pub.config.js +++ b/lib/webpack/pub.config.js @@ -11,7 +11,7 @@ const { module.exports = { - devtool: null, + devtool: false, entry: pathTo(`example`, `index.js`), output: { filename: `bundle.js`, @@ -26,7 +26,7 @@ module.exports = { ]) ], module: { - loaders: [ + rules: [ loaders.babel ] }, diff --git a/package.json b/package.json index 4c5784f..2d1dc83 100644 --- a/package.json +++ b/package.json @@ -7,22 +7,21 @@ "babel-cli": "6.22.2", "babel-loader": "6.2.10", "babel-plugin-transform-object-rest-spread": "6.22.0", - "babel-plugin-transform-react-remove-prop-types": "0.2.11", + "babel-plugin-transform-react-remove-prop-types": "0.3.2", "babel-preset-es2015": "6.22.0", - "babel-preset-node7": "1.4.0", + "babel-preset-node7": "1.5.0", "babel-preset-react": "6.22.0", "babel-register": "6.22.0", - "eslint": "3.14.1", - "eslint-config-airbnb": "14.0.0", + "eslint": "3.15.0", + "eslint-config-airbnb": "14.1.0", "eslint-plugin-import": "2.2.0", - "eslint-plugin-jsx-a11y": "3.0.2", + "eslint-plugin-jsx-a11y": "4.0.0", "eslint-plugin-react": "6.9.0", "gh-pages": "0.12.0", "glob": "7.1.1", - "html-webpack-include-assets-plugin": "0.0.2", - "html-webpack-plugin": "2.26.0", - "json-loader": "0.5.4", - "lerna": "2.0.0-beta.34", + "html-webpack-include-assets-plugin": "0.0.3", + "html-webpack-plugin": "2.28.0", + "lerna": "2.0.0-beta.37", "nightwatch-autorun": "3.1.0", "react": "15.4.2", "react-dom": "15.4.2", @@ -30,7 +29,7 @@ "sinon": "1.17.7", "tap-xunit": "1.7.0", "tape": "4.6.3", - "webpack": "1.14.0", - "webpack-dev-server": "1.16.2" + "webpack": "2.2.1", + "webpack-dev-server": "2.3.0" } } diff --git a/packages/bulkhead/.babelrc b/packages/bulkhead/.babelrc new file mode 100644 index 0000000..cdda663 --- /dev/null +++ b/packages/bulkhead/.babelrc @@ -0,0 +1,14 @@ +{ + "presets": [ + ["es2015", {"loose": true}], + "react" + ], + "plugins": [ + "transform-object-rest-spread" + ], + "env": { + "production": { + "plugins": ["transform-react-remove-prop-types"] + } + } +} diff --git a/packages/bulkhead/.eslintignore b/packages/bulkhead/.eslintignore index 5b99d46..24c3201 100644 --- a/packages/bulkhead/.eslintignore +++ b/packages/bulkhead/.eslintignore @@ -1,4 +1,5 @@ -build/ -lib/ -pub/ -reports/ +/node_modules/ +/build/ +/lib/ +/pub/ +/reports/ diff --git a/packages/bulkhead/.nvmrc b/packages/bulkhead/.nvmrc index ba7f754..18bb418 100644 --- a/packages/bulkhead/.nvmrc +++ b/packages/bulkhead/.nvmrc @@ -1 +1 @@ -7.4.0 +7.5.0 diff --git a/packages/bulkhead/package.json b/packages/bulkhead/package.json index 0b5c06a..6c3df92 100644 --- a/packages/bulkhead/package.json +++ b/packages/bulkhead/package.json @@ -45,19 +45,5 @@ "LICENSE", "package.json", "README.md" - ], - "babel": { - "presets": [ - ["es2015", {"loose": true}], - "react" - ], - "plugins": [ - "transform-object-rest-spread" - ], - "env": { - "production": { - "plugins": ["transform-react-remove-prop-types"] - } - } - } + ] } diff --git a/packages/swap/.babelrc b/packages/swap/.babelrc new file mode 100644 index 0000000..cdda663 --- /dev/null +++ b/packages/swap/.babelrc @@ -0,0 +1,14 @@ +{ + "presets": [ + ["es2015", {"loose": true}], + "react" + ], + "plugins": [ + "transform-object-rest-spread" + ], + "env": { + "production": { + "plugins": ["transform-react-remove-prop-types"] + } + } +} diff --git a/packages/swap/.eslintignore b/packages/swap/.eslintignore index 5b99d46..24c3201 100644 --- a/packages/swap/.eslintignore +++ b/packages/swap/.eslintignore @@ -1,4 +1,5 @@ -build/ -lib/ -pub/ -reports/ +/node_modules/ +/build/ +/lib/ +/pub/ +/reports/ diff --git a/packages/swap/.nvmrc b/packages/swap/.nvmrc index ba7f754..18bb418 100644 --- a/packages/swap/.nvmrc +++ b/packages/swap/.nvmrc @@ -1 +1 @@ -7.4.0 +7.5.0 diff --git a/packages/swap/package.json b/packages/swap/package.json index e4e7275..af7b5ed 100644 --- a/packages/swap/package.json +++ b/packages/swap/package.json @@ -47,19 +47,5 @@ "LICENSE", "package.json", "README.md" - ], - "babel": { - "presets": [ - ["es2015", {"loose": true}], - "react" - ], - "plugins": [ - "transform-object-rest-spread" - ], - "env": { - "production": { - "plugins": ["transform-react-remove-prop-types"] - } - } - } + ] } diff --git a/scripts/e2e.js b/scripts/e2e.js index 89ab06c..f9751bc 100755 --- a/scripts/e2e.js +++ b/scripts/e2e.js @@ -1,17 +1,20 @@ #!/usr/bin/env node +const nightwatchAutorun = require(`nightwatch-autorun`); +const webpack = require(`webpack`); +const WebpackDevServer = require(`webpack-dev-server`); + + const {npm, CWD} = require(`../lib/bash`); const {output_folder: REPORT_DIR} = require(`../lib/nightwatch.json`); +const webpackConfig = require(`../lib/webpack/dev.config.js`); npm(`rimraf reports/e2e`, {cwd: CWD}); -npm(`nightwatch-autorun `, { - cwd: CWD, - env: { - NIGHTWATCH_CONFIG: require.resolve(`../lib/nightwatch.json`), - WEBPACK_CONFIG: require.resolve(`../lib/webpack/dev.config.js`), - REPORT_DIR, - LOG_DIR: REPORT_DIR - } +nightwatchAutorun({ + server: new WebpackDevServer(webpack(webpackConfig)), + nightwatchConfig: require.resolve(`../lib/nightwatch.json`), + reportDir: REPORT_DIR, + logDir: REPORT_DIR });