diff --git a/.gitignore b/.gitignore index d2dfea8f34..582edcc8d2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ pids # Coverage tools lib-cov coverage +.nyc_output # Dependency directory node_modules diff --git a/.nycrc b/.nycrc index a5969c8b78..e6c59634b3 100644 --- a/.nycrc +++ b/.nycrc @@ -7,5 +7,6 @@ "babel-register" ], "sourceMap": false, - "instrument": false + "instrument": false, + "report-dir": "./coverage" } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6afd856a9d..776eac1b30 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,9 +3,9 @@ Thanks for your interest in React-Select. All forms of contribution are welcome, from issue reports to PRs and documentation / write-ups. -* We use node.js v4 for development and testing. Due to incompatibilities with -JSDOM and older versions of node.js, you'll need to use node 4 to run the -tests. If you can't install node v4 as your "default" node installation, you +* We use node.js v4+ for development and testing. Due to incompatibilities with +JSDOM and older versions of node.js, you'll need to use node 4 and above to run the +tests. If you can't install node v4 or above as your "default" node installation, you could try using [nvm](https://github.com/creationix/nvm) to install multiple versions concurrently. * If you're upgrading your node.js 0.x environment, it's sometimes necessary diff --git a/package.json b/package.json index 9912415119..9838bc30ca 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "url": "https://github.com/JedWatson/react-select.git" }, "dependencies": { - "babel-register": "^6.26.0", "classnames": "^2.2.4", "prop-types": "^15.5.8", "react-input-autosize": "^1.1.3" @@ -31,6 +30,7 @@ "chai": "^4.1.2", "coveralls": "^2.11.12", "create-react-class": "^15.5.2", + "cross-env": "^5.0.5", "css-loader": "^0.28.7", "eslint": "^4.6.1", "extract-text-webpack-plugin": "^3.0.0", @@ -82,8 +82,8 @@ }, "scripts": { "build": "nps build", - "cover": "istanbul cover _mocha -- -u exports --compilers js:babel-core/register -R spec", - "coveralls": "NODE_ENV=test nyc mocha", + "cover": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha", + "coveralls": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha && cat coverage/lcov.info | coveralls", "lint": "eslint .", "publish:examples": "NODE_ENV=production nps publish", "start": "webpack-dev-server --progress", diff --git a/src/index.umd.js b/src/index.umd.js index 90477b1d68..e63cc05ad4 100644 --- a/src/index.umd.js +++ b/src/index.umd.js @@ -1,3 +1,6 @@ +// This file exists as an entry point for bundling our umd builds. +// Both in rollup and in webpack, umd builds built from es6 modules are not compatible with mixed imports. (which exist in index.js) +// This file does away with named imports in favor of a single export default. import Select from './Select'; import Async from './Async'; import AsyncCreatable from './AsyncCreatable'; diff --git a/webpack.config.js b/webpack.config.js index b5171a2a7f..4f83858c48 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,7 +15,7 @@ module.exports = { }, devServer: { contentBase: path.resolve(__dirname, 'examples/src'), - port: 8080, + port: 8000, }, module: { rules: [