From fa81280eff9a41eed4b50d919d2656597f65234c Mon Sep 17 00:00:00 2001 From: Charles Lee Date: Tue, 5 Sep 2017 15:01:16 +1000 Subject: [PATCH 1/2] coveraged configuration fixed, contrb document edited --- .gitignore | 1 + .nycrc | 3 ++- CONTRIBUTING.md | 10 +++++----- package.json | 5 +++-- src/index.umd.js | 3 +++ 5 files changed, 14 insertions(+), 8 deletions(-) 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..e409fb8cc0 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 +* We use node.js v8 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 +tests. If you can't install node v8 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 @@ -20,7 +20,7 @@ Before you open a PR: the change is aligned with the project roadmap by opening an issue first, especially if you're going to spend a lot of time on it. * In development, run `npm start` to build (+watch) the project source, and run -the [development server](http://localhost:8000). +the [development server](http://localhost:8080). * Please ensure all the examples work correctly after your change. If you're adding a major new use-case, add a new example demonstrating its use. * Please **do not** commit the build files. Make sure **only** your changes to @@ -39,7 +39,7 @@ know. We'll help you get started, rather than adding it to the queue. * Where possible, include tests with your changes, either that demonstrates the bug, or tests the new functionality. If you're not sure how to test your changes, feel free to ping @bruderstein -* Run `npm run cover` to check that the coverage hasn't dropped, and look at the +* Run `npm run coveralls` to check that the coverage hasn't dropped, and look at the report (under the generated `coverage` directory) to check that your changes are covered * Please [follow our established coding conventions](https://github.com/keystonejs/keystone/wiki/Coding-Standards) @@ -50,5 +50,5 @@ but please ensure there are not more violations than before your changes. please read our [Documentation Guidelines](https://github.com/keystonejs/keystone/wiki/Documentation-Translation-Guidelines). * _Make sure you revert your build before submitting a PR_ to reduce the chance -of conflicts. `gulp build-scripts` is run after PRs are merged and before any +of conflicts. `npm run build` is run after PRs are merged and before any releases are made. diff --git a/package.json b/package.json index 9912415119..a38074126f 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,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 +83,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 | 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'; From acb21523ea040187a090a5ebaec8002db0e2acdc Mon Sep 17 00:00:00 2001 From: Charles Lee Date: Tue, 5 Sep 2017 15:44:05 +1000 Subject: [PATCH 2/2] update coveralls script and remove babel-register from core depenencies --- CONTRIBUTING.md | 12 ++++++------ package.json | 3 +-- webpack.config.js | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e409fb8cc0..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 v8 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 v8 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 @@ -20,7 +20,7 @@ Before you open a PR: the change is aligned with the project roadmap by opening an issue first, especially if you're going to spend a lot of time on it. * In development, run `npm start` to build (+watch) the project source, and run -the [development server](http://localhost:8080). +the [development server](http://localhost:8000). * Please ensure all the examples work correctly after your change. If you're adding a major new use-case, add a new example demonstrating its use. * Please **do not** commit the build files. Make sure **only** your changes to @@ -39,7 +39,7 @@ know. We'll help you get started, rather than adding it to the queue. * Where possible, include tests with your changes, either that demonstrates the bug, or tests the new functionality. If you're not sure how to test your changes, feel free to ping @bruderstein -* Run `npm run coveralls` to check that the coverage hasn't dropped, and look at the +* Run `npm run cover` to check that the coverage hasn't dropped, and look at the report (under the generated `coverage` directory) to check that your changes are covered * Please [follow our established coding conventions](https://github.com/keystonejs/keystone/wiki/Coding-Standards) @@ -50,5 +50,5 @@ but please ensure there are not more violations than before your changes. please read our [Documentation Guidelines](https://github.com/keystonejs/keystone/wiki/Documentation-Translation-Guidelines). * _Make sure you revert your build before submitting a PR_ to reduce the chance -of conflicts. `npm run build` is run after PRs are merged and before any +of conflicts. `gulp build-scripts` is run after PRs are merged and before any releases are made. diff --git a/package.json b/package.json index a38074126f..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" @@ -84,7 +83,7 @@ "scripts": { "build": "nps build", "cover": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha", - "coveralls": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha | coveralls", + "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/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: [