From 56ca9340836a39267d01089da822c19223108584 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 2 Dec 2017 15:39:57 +0000 Subject: [PATCH 1/9] chore(package): update dependencies --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 864f4a9..3caebc0 100644 --- a/package.json +++ b/package.json @@ -24,29 +24,29 @@ "homepage": "https://github.com/wimpyprogrammer/react-component-update#readme", "devDependencies": { "babel-cli": "^6.26.0", - "babel-jest": "^20.0.3", + "babel-jest": "^21.2.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "chai": "^4.0.2", - "codecov": "^2.3.0", + "codecov": "^3.0.0", "create-react-class": "^15.6.0", "dirty-chai": "^2.0.0", "enzyme": "^3.1.0", "enzyme-adapter-react-16": "^1.0.1", - "eslint": "^3.19.0", - "eslint-config-airbnb": "^15.0.1", + "eslint": "^4.12.1", + "eslint-config-airbnb": "^16.1.0", "eslint-plugin-import": "^2.3.0", - "eslint-plugin-jsx-a11y": "^5.0.3", + "eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-react": "^7.1.0", - "jest": "^20.0.4", + "jest": "^21.2.1", "lodash.uniqueid": "^4.0.1", "publish-please": "^2.3.1", "react": "*", "react-dom": "*", "react-test-renderer": "*", "rimraf": "^2.6.1", - "sinon": "^3.2.1", + "sinon": "^4.1.2", "sinon-chai": "^2.13.0" }, "peerDependencies": { From 70111902458cc096d8bc444e37228add98a5abd0 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 2 Dec 2017 15:40:00 +0000 Subject: [PATCH 2/9] docs(readme): add Greenkeeper badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 18d2d3b..b09a2ed 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # react-component-update +[![Greenkeeper badge](https://badges.greenkeeper.io/wimpyprogrammer/react-component-update.svg)](https://greenkeeper.io/) + [![Build Status](https://travis-ci.org/wimpyprogrammer/react-component-update.svg?branch=master)](https://travis-ci.org/wimpyprogrammer/react-component-update) [![codecov](https://codecov.io/gh/wimpyprogrammer/react-component-update/branch/master/graph/badge.svg)](https://codecov.io/gh/wimpyprogrammer/react-component-update) [![Known Vulnerabilities](https://snyk.io/test/github/wimpyprogrammer/react-component-update/badge.svg)](https://snyk.io/test/github/wimpyprogrammer/react-component-update) From f973833d2403ce8aadbad28773f7852b4fe0b2d9 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sat, 2 Dec 2017 10:10:18 -0600 Subject: [PATCH 3/9] Align Greenkeeper badge with existing badges --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b09a2ed..05c78c2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # react-component-update -[![Greenkeeper badge](https://badges.greenkeeper.io/wimpyprogrammer/react-component-update.svg)](https://greenkeeper.io/) - [![Build Status](https://travis-ci.org/wimpyprogrammer/react-component-update.svg?branch=master)](https://travis-ci.org/wimpyprogrammer/react-component-update) [![codecov](https://codecov.io/gh/wimpyprogrammer/react-component-update/branch/master/graph/badge.svg)](https://codecov.io/gh/wimpyprogrammer/react-component-update) [![Known Vulnerabilities](https://snyk.io/test/github/wimpyprogrammer/react-component-update/badge.svg)](https://snyk.io/test/github/wimpyprogrammer/react-component-update) +[![Greenkeeper badge](https://badges.greenkeeper.io/wimpyprogrammer/react-component-update.svg)](https://greenkeeper.io/) Adds convenience lifecycle events to your React components. From 8a2155cadf0639431c8d76bf7464eaed368b6697 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sat, 2 Dec 2017 10:24:31 -0600 Subject: [PATCH 4/9] Fix function-paren-newline lint errors --- src/component.spec.js | 20 +++++++++++++++----- src/pureComponent.spec.js | 20 +++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/component.spec.js b/src/component.spec.js index 15e06bc..04f38b0 100644 --- a/src/component.spec.js +++ b/src/component.spec.js @@ -232,7 +232,9 @@ describe('Component extension with overrides calling super()', () => { it('runs user code in override on mount', () => { sinon.assert.callOrder( - userComponentWillMountBefore, callbackWill, userComponentWillMountAfter, + userComponentWillMountBefore, + callbackWill, + userComponentWillMountAfter, ); }); @@ -244,7 +246,9 @@ describe('Component extension with overrides calling super()', () => { it('runs user code in override on props update', () => { component.setProps(getUniqueProps()); sinon.assert.callOrder( - userComponentWillReceivePropsBefore, callbackWill, userComponentWillReceivePropsAfter, + userComponentWillReceivePropsBefore, + callbackWill, + userComponentWillReceivePropsAfter, ); }); @@ -261,7 +265,9 @@ describe('Component extension with overrides calling super()', () => { it('runs user code in override on mount', () => { sinon.assert.callOrder( - userComponentDidMountBefore, callbackDid, userComponentDidMountAfter, + userComponentDidMountBefore, + callbackDid, + userComponentDidMountAfter, ); }); @@ -273,7 +279,9 @@ describe('Component extension with overrides calling super()', () => { it('runs user code in override on props update', () => { component.setProps(getUniqueProps()); sinon.assert.callOrder( - userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter, + userComponentDidUpdateBefore, + callbackDid, + userComponentDidUpdateAfter, ); }); @@ -285,7 +293,9 @@ describe('Component extension with overrides calling super()', () => { it('runs user code in override on state update', () => { component.setState(getUniqueState()); sinon.assert.callOrder( - userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter, + userComponentDidUpdateBefore, + callbackDid, + userComponentDidUpdateAfter, ); }); }); diff --git a/src/pureComponent.spec.js b/src/pureComponent.spec.js index 8550d21..5dfaaa9 100644 --- a/src/pureComponent.spec.js +++ b/src/pureComponent.spec.js @@ -227,7 +227,9 @@ descriptor('PureComponent extension with overrides calling super()', () => { it('runs user code in override on mount', () => { sinon.assert.callOrder( - userComponentWillMountBefore, callbackWill, userComponentWillMountAfter, + userComponentWillMountBefore, + callbackWill, + userComponentWillMountAfter, ); }); @@ -239,7 +241,9 @@ descriptor('PureComponent extension with overrides calling super()', () => { it('runs user code in override on props update', () => { component.setProps(getUniqueProps()); sinon.assert.callOrder( - userComponentWillReceivePropsBefore, callbackWill, userComponentWillReceivePropsAfter, + userComponentWillReceivePropsBefore, + callbackWill, + userComponentWillReceivePropsAfter, ); }); @@ -256,7 +260,9 @@ descriptor('PureComponent extension with overrides calling super()', () => { it('runs user code in override on mount', () => { sinon.assert.callOrder( - userComponentDidMountBefore, callbackDid, userComponentDidMountAfter, + userComponentDidMountBefore, + callbackDid, + userComponentDidMountAfter, ); }); @@ -268,7 +274,9 @@ descriptor('PureComponent extension with overrides calling super()', () => { it('runs user code in override on props update', () => { component.setProps(getUniqueProps()); sinon.assert.callOrder( - userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter, + userComponentDidUpdateBefore, + callbackDid, + userComponentDidUpdateAfter, ); }); @@ -280,7 +288,9 @@ descriptor('PureComponent extension with overrides calling super()', () => { it('runs user code in override on state update', () => { component.setState(getUniqueState()); sinon.assert.callOrder( - userComponentDidUpdateBefore, callbackDid, userComponentDidUpdateAfter, + userComponentDidUpdateBefore, + callbackDid, + userComponentDidUpdateAfter, ); }); }); From c294837e43241991e1934f438890edbcf8b79e04 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sat, 2 Dec 2017 10:24:48 -0600 Subject: [PATCH 5/9] Fix prefer-destructuring lint error --- test-setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-setup.js b/test-setup.js index cf91e3a..eea9bcb 100644 --- a/test-setup.js +++ b/test-setup.js @@ -1,5 +1,5 @@ /* eslint-disable global-require, import/no-extraneous-dependencies, import/no-unresolved */ -const configure = require('enzyme').configure; +const { configure } = require('enzyme'); const reactVersion = require('react').version; const [majorReactVersion, minorReactVersion] = reactVersion.split('.'); From 5a085d0c1edd7c00096bf2a9034a124c501d0037 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sat, 2 Dec 2017 10:58:44 -0600 Subject: [PATCH 6/9] Shim requestAnimationFrame during tests Per http://fb.me/react-polyfills. --- package.json | 5 ++++- test-shims.js | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test-shims.js diff --git a/package.json b/package.json index 3caebc0..13c115a 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,10 @@ "jest": { "coverageDirectory": "./coverage/", "collectCoverage": true, - "setupTestFrameworkScriptFile": "/test-setup.js", + "setupFiles": [ + "/test-shims.js", + "/test-setup.js" + ], "testMatch": [ "**/src/*.spec.js?(x)" ] diff --git a/test-shims.js b/test-shims.js new file mode 100644 index 0000000..c9488be --- /dev/null +++ b/test-shims.js @@ -0,0 +1,3 @@ +global.requestAnimationFrame = (callback) => { + setTimeout(callback, 0); +}; From 2b03a8e7baa5cf744d2ec5b78b48271d1f2b6155 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sat, 2 Dec 2017 11:12:05 -0600 Subject: [PATCH 7/9] Replace npm blacklist with whitelist --- .npmignore | 138 --------------------------------------------------- package.json | 3 ++ 2 files changed, 3 insertions(+), 138 deletions(-) delete mode 100644 .npmignore diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 5d158af..0000000 --- a/.npmignore +++ /dev/null @@ -1,138 +0,0 @@ -# Created by https://www.gitignore.io/api/node,macos,linux,windows - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### macOS ### -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### Node ### -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# End of https://www.gitignore.io/api/node,macos,linux,windows - -# Pre-transpiled source code -src/ - -# Tests -*.spec.js - -# Vagrant development environment -.vagrant/ -Vagrantfile -puphpet/ diff --git a/package.json b/package.json index 13c115a..1c4667e 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "1.1.0", "description": "Extends the native React Component to streamline updates", "main": "lib/index.js", + "files": [ + "lib/**/!(*.spec).js" + ], "scripts": { "clean": "rimraf lib", "build": "npm run clean && babel src --out-dir lib", From e9a6025efad3929677ad644551fe70e7e13b6e98 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sat, 2 Dec 2017 11:24:11 -0600 Subject: [PATCH 8/9] Limit coverage report to library source files Exclude the test-setup.js and test-shims.js from coverage stats. --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 1c4667e..17f8afc 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,9 @@ "jest": { "coverageDirectory": "./coverage/", "collectCoverage": true, + "collectCoverageFrom": [ + "src/**/!(*.spec).js" + ], "setupFiles": [ "/test-shims.js", "/test-setup.js" From 71ce6c4e8918486fc5c7b358b3585f516cc9ed65 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sat, 2 Dec 2017 18:14:13 +0000 Subject: [PATCH 9/9] Bump patch version to 1.1.1. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 17f8afc..2c7960a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-component-update", - "version": "1.1.0", + "version": "1.1.1", "description": "Extends the native React Component to streamline updates", "main": "lib/index.js", "files": [