From ce7e4988efae1e906fbcea53743861892696b887 Mon Sep 17 00:00:00 2001 From: Rafe Goldberg Date: Tue, 29 Mar 2022 13:08:06 -0700 Subject: [PATCH 01/13] chore(deps): bump react to v17.x - [x] update to react to v17.x - [x] update react peer deps to v16 or 17 - [x] [update enzyme adapter for react v17][ref1] [ref1]: https://semver.npmjs.com/ --- lib/enzyme.js | 2 +- package-lock.json | 289 ++++++++-------------------------------------- package.json | 14 +-- 3 files changed, 50 insertions(+), 255 deletions(-) diff --git a/lib/enzyme.js b/lib/enzyme.js index d574a56..bb18036 100644 --- a/lib/enzyme.js +++ b/lib/enzyme.js @@ -1,6 +1,6 @@ /* eslint-disable import/no-extraneous-dependencies */ -const Adapter = require('enzyme-adapter-react-16'); const enzyme = require('enzyme'); +const Adapter = require('@wojtekmaj/enzyme-adapter-react-17'); require('core-js/stable'); require('regenerator-runtime/runtime'); diff --git a/package-lock.json b/package-lock.json index 4ebcc99..2c7ab92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,6 @@ "core-js": "^3.19.3", "css-loader": "^6.2.0", "enzyme": "^3.11.0", - "enzyme-adapter-react-16": "^1.15.6", "eslint": "^8.4.1", "glob": "^7.1.6", "html-webpack-plugin": "^5.3.2", @@ -34,8 +33,8 @@ "jest": "^27.2.0", "node-sass": "^6.0.1", "prettier": "^2.4.1", - "react": "^16.14.0", - "react-dom": "^16.14.0", + "react": "^17.0.2", + "react-dom": "^17.0.2", "regenerator-runtime": "^0.13.9", "sass-loader": "^12.1.0", "style-loader": "^3.2.1", @@ -46,8 +45,8 @@ }, "peerDependencies": { "@readme/variable": "*", - "react": "16.x", - "react-dom": "16.x" + "react": "16.x||7.x", + "react-dom": "16.x||7.x" } }, "node_modules/@babel/code-frame": { @@ -4166,29 +4165,6 @@ "node": ">=8" } }, - "node_modules/airbnb-prop-types": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz", - "integrity": "sha512-7WHOFolP/6cS96PhKNrslCLMYAI8yB1Pp6u6XmxozQOiZbsI5ycglZr5cHhBFfuRcQQjzCMith5ZPZdYiJCxUg==", - "dev": true, - "dependencies": { - "array.prototype.find": "^2.1.1", - "function.prototype.name": "^1.1.2", - "is-regex": "^1.1.0", - "object-is": "^1.1.2", - "object.assign": "^4.1.0", - "object.entries": "^1.1.2", - "prop-types": "^15.7.2", - "prop-types-exact": "^1.2.0", - "react-is": "^16.13.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "peerDependencies": { - "react": "^0.14 || ^15.0.0 || ^16.0.0-alpha" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -4443,19 +4419,6 @@ "node": ">=8" } }, - "node_modules/array.prototype.find": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.1.tgz", - "integrity": "sha512-mi+MYNJYLTx2eNYy+Yh6raoQacCsNeeMUaspFPh9Y141lFSsWxxB8V9mM2ye+eqiRs917J6/pJ4M9ZPzenWckA==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array.prototype.flat": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", @@ -6353,52 +6316,6 @@ "string.prototype.trim": "^1.2.1" } }, - "node_modules/enzyme-adapter-react-16": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.6.tgz", - "integrity": "sha512-yFlVJCXh8T+mcQo8M6my9sPgeGzj85HSHi6Apgf1Cvq/7EL/J9+1JoJmJsRxZgyTvPMAqOEpRSu/Ii/ZpyOk0g==", - "dev": true, - "dependencies": { - "enzyme-adapter-utils": "^1.14.0", - "enzyme-shallow-equal": "^1.0.4", - "has": "^1.0.3", - "object.assign": "^4.1.2", - "object.values": "^1.1.2", - "prop-types": "^15.7.2", - "react-is": "^16.13.1", - "react-test-renderer": "^16.0.0-0", - "semver": "^5.7.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "peerDependencies": { - "enzyme": "^3.0.0", - "react": "^16.0.0-0", - "react-dom": "^16.0.0-0" - } - }, - "node_modules/enzyme-adapter-utils": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/enzyme-adapter-utils/-/enzyme-adapter-utils-1.14.0.tgz", - "integrity": "sha512-F/z/7SeLt+reKFcb7597IThpDp0bmzcH1E9Oabqv+o01cID2/YInlqHbFl7HzWBl4h3OdZYedtwNDOmSKkk0bg==", - "dev": true, - "dependencies": { - "airbnb-prop-types": "^2.16.0", - "function.prototype.name": "^1.1.3", - "has": "^1.0.3", - "object.assign": "^4.1.2", - "object.fromentries": "^2.0.3", - "prop-types": "^15.7.2", - "semver": "^5.7.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "peerDependencies": { - "react": "0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0" - } - }, "node_modules/enzyme-shallow-equal": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.4.tgz", @@ -12078,17 +11995,6 @@ "react-is": "^16.13.1" } }, - "node_modules/prop-types-exact": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/prop-types-exact/-/prop-types-exact-1.2.0.tgz", - "integrity": "sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA==", - "dev": true, - "dependencies": { - "has": "^1.0.3", - "object.assign": "^4.1.0", - "reflect.ownkeys": "^0.2.0" - } - }, "node_modules/proxy-addr": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", @@ -12241,13 +12147,12 @@ } }, "node_modules/react": { - "version": "16.14.0", - "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", - "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", "dependencies": { "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2" + "object-assign": "^4.1.1" }, "engines": { "node": ">=0.10.0" @@ -12259,15 +12164,27 @@ "integrity": "sha512-t7YFmz1AXdlImgHXA9Ja0T6AWuopilub24jRaQdPVbzUJVNKIYuy3uCFZYa7CE5S3UW6SrSa5nAqVQvtzRF9gw==" }, "node_modules/react-dom": { - "version": "16.14.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", - "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", "dev": true, "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.19.1" + "scheduler": "^0.20.2" + }, + "peerDependencies": { + "react": "17.0.2" + } + }, + "node_modules/react-dom/node_modules/scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" } }, "node_modules/react-is": { @@ -12275,18 +12192,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "node_modules/react-test-renderer": { - "version": "16.14.0", - "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.14.0.tgz", - "integrity": "sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg==", - "dev": true, - "dependencies": { - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "react-is": "^16.8.6", - "scheduler": "^0.19.1" - } - }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -12379,12 +12284,6 @@ "node": ">=8" } }, - "node_modules/reflect.ownkeys": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz", - "integrity": "sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=", - "dev": true - }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -13104,16 +13003,6 @@ "node": ">=10" } }, - "node_modules/scheduler": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", - "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", - "dev": true, - "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, "node_modules/schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -18387,23 +18276,6 @@ "indent-string": "^4.0.0" } }, - "airbnb-prop-types": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz", - "integrity": "sha512-7WHOFolP/6cS96PhKNrslCLMYAI8yB1Pp6u6XmxozQOiZbsI5ycglZr5cHhBFfuRcQQjzCMith5ZPZdYiJCxUg==", - "dev": true, - "requires": { - "array.prototype.find": "^2.1.1", - "function.prototype.name": "^1.1.2", - "is-regex": "^1.1.0", - "object-is": "^1.1.2", - "object.assign": "^4.1.0", - "object.entries": "^1.1.2", - "prop-types": "^15.7.2", - "prop-types-exact": "^1.2.0", - "react-is": "^16.13.1" - } - }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -18606,16 +18478,6 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" }, - "array.prototype.find": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.1.tgz", - "integrity": "sha512-mi+MYNJYLTx2eNYy+Yh6raoQacCsNeeMUaspFPh9Y141lFSsWxxB8V9mM2ye+eqiRs917J6/pJ4M9ZPzenWckA==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.4" - } - }, "array.prototype.flat": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", @@ -20115,38 +19977,6 @@ "string.prototype.trim": "^1.2.1" } }, - "enzyme-adapter-react-16": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.6.tgz", - "integrity": "sha512-yFlVJCXh8T+mcQo8M6my9sPgeGzj85HSHi6Apgf1Cvq/7EL/J9+1JoJmJsRxZgyTvPMAqOEpRSu/Ii/ZpyOk0g==", - "dev": true, - "requires": { - "enzyme-adapter-utils": "^1.14.0", - "enzyme-shallow-equal": "^1.0.4", - "has": "^1.0.3", - "object.assign": "^4.1.2", - "object.values": "^1.1.2", - "prop-types": "^15.7.2", - "react-is": "^16.13.1", - "react-test-renderer": "^16.0.0-0", - "semver": "^5.7.0" - } - }, - "enzyme-adapter-utils": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/enzyme-adapter-utils/-/enzyme-adapter-utils-1.14.0.tgz", - "integrity": "sha512-F/z/7SeLt+reKFcb7597IThpDp0bmzcH1E9Oabqv+o01cID2/YInlqHbFl7HzWBl4h3OdZYedtwNDOmSKkk0bg==", - "dev": true, - "requires": { - "airbnb-prop-types": "^2.16.0", - "function.prototype.name": "^1.1.3", - "has": "^1.0.3", - "object.assign": "^4.1.2", - "object.fromentries": "^2.0.3", - "prop-types": "^15.7.2", - "semver": "^5.7.1" - } - }, "enzyme-shallow-equal": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.4.tgz", @@ -24477,17 +24307,6 @@ "react-is": "^16.13.1" } }, - "prop-types-exact": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/prop-types-exact/-/prop-types-exact-1.2.0.tgz", - "integrity": "sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA==", - "dev": true, - "requires": { - "has": "^1.0.3", - "object.assign": "^4.1.0", - "reflect.ownkeys": "^0.2.0" - } - }, "proxy-addr": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", @@ -24600,13 +24419,12 @@ } }, "react": { - "version": "16.14.0", - "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", - "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", "requires": { "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2" + "object-assign": "^4.1.1" } }, "react-codemirror2": { @@ -24615,15 +24433,26 @@ "integrity": "sha512-t7YFmz1AXdlImgHXA9Ja0T6AWuopilub24jRaQdPVbzUJVNKIYuy3uCFZYa7CE5S3UW6SrSa5nAqVQvtzRF9gw==" }, "react-dom": { - "version": "16.14.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", - "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", "dev": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.19.1" + "scheduler": "^0.20.2" + }, + "dependencies": { + "scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dev": true, + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + } } }, "react-is": { @@ -24631,18 +24460,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "react-test-renderer": { - "version": "16.14.0", - "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.14.0.tgz", - "integrity": "sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "react-is": "^16.8.6", - "scheduler": "^0.19.1" - } - }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -24713,12 +24530,6 @@ "strip-indent": "^3.0.0" } }, - "reflect.ownkeys": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz", - "integrity": "sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=", - "dev": true - }, "regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -25257,16 +25068,6 @@ "xmlchars": "^2.2.0" } }, - "scheduler": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", - "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", - "dev": true, - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, "schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", diff --git a/package.json b/package.json index a783751..366b45f 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ }, "peerDependencies": { "@readme/variable": "*", - "react": "16.x", - "react-dom": "16.x" + "react": "16.x||7.x", + "react-dom": "16.x||7.x" }, "devDependencies": { "@babel/preset-env": "^7.15.6", @@ -44,7 +44,6 @@ "core-js": "^3.19.3", "css-loader": "^6.2.0", "enzyme": "^3.11.0", - "enzyme-adapter-react-16": "^1.15.6", "eslint": "^8.4.1", "glob": "^7.1.6", "html-webpack-plugin": "^5.3.2", @@ -53,8 +52,8 @@ "jest": "^27.2.0", "node-sass": "^6.0.1", "prettier": "^2.4.1", - "react": "^16.14.0", - "react-dom": "^16.14.0", + "react": "^17.0.2", + "react-dom": "^17.0.2", "regenerator-runtime": "^0.13.9", "sass-loader": "^12.1.0", "style-loader": "^3.2.1", @@ -64,11 +63,6 @@ "webpack-dev-server": "^4.2.1" }, "prettier": "@readme/eslint-config/prettier", - "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } - }, "commitlint": { "extends": [ "@commitlint/config-conventional" From 869c3efd90b6bc49db53af3daa94720917c05d21 Mon Sep 17 00:00:00 2001 From: Rafe Goldberg Date: Tue, 29 Mar 2022 13:11:31 -0700 Subject: [PATCH 02/13] test: against react v16 + 17 --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ae7c3c..7ac31bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ jobs: strategy: matrix: node-version: [12.x, 14.x] + react-version: [16.x, 17.x] steps: - uses: actions/checkout@v2.4.0 @@ -25,5 +26,8 @@ jobs: - name: Install dependencies run: npm ci + - name: Install React v${{ matrix.react-version }} + run: npm i react@${{ matrix.react-version }} + - name: Run tests run: npm test From 7085e28d6304f71250467977ad1acbd363be9c30 Mon Sep 17 00:00:00 2001 From: Rafe Goldberg Date: Tue, 29 Mar 2022 13:17:24 -0700 Subject: [PATCH 03/13] fix(peerdeps): typo should be "17.x" not "7.x"! --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 366b45f..93ab199 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ }, "peerDependencies": { "@readme/variable": "*", - "react": "16.x||7.x", - "react-dom": "16.x||7.x" + "react": "16.x||17.x", + "react-dom": "16.x||17.x" }, "devDependencies": { "@babel/preset-env": "^7.15.6", From 08af24f4dbefbf61815343c051e8fcd9486d7ead Mon Sep 17 00:00:00 2001 From: Rafe Goldberg Date: Tue, 29 Mar 2022 13:18:29 -0700 Subject: [PATCH 04/13] chore(devDeps): instal enzyme/React v17 adapter Co-authored-by: Gabe --- package-lock.json | 181 ++++++++++++++++++++++++++++++++++++++++------ package.json | 1 + 2 files changed, 160 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2c7ab92..7bf73cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "@commitlint/cli": "^16.0.1", "@commitlint/config-conventional": "^16.0.0", "@readme/eslint-config": "^8.0.3", + "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7", "babel-jest": "^27.2.0", "babel-loader": "^8.1.0", "core-js": "^3.19.3", @@ -4040,6 +4041,46 @@ } } }, + "node_modules/@wojtekmaj/enzyme-adapter-react-17": { + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@wojtekmaj/enzyme-adapter-react-17/-/enzyme-adapter-react-17-0.6.7.tgz", + "integrity": "sha512-B+byiwi/T1bx5hcj9wc0fUL5Hlb5giSXJzcnEfJVl2j6dGV2NJfcxDBYX0WWwIxlzNiFz8kAvlkFWI2y/nscZQ==", + "dev": true, + "dependencies": { + "@wojtekmaj/enzyme-adapter-utils": "^0.1.4", + "enzyme-shallow-equal": "^1.0.0", + "has": "^1.0.0", + "prop-types": "^15.7.0", + "react-is": "^17.0.0", + "react-test-renderer": "^17.0.0" + }, + "peerDependencies": { + "enzyme": "^3.0.0", + "react": "^17.0.0-0", + "react-dom": "^17.0.0-0" + } + }, + "node_modules/@wojtekmaj/enzyme-adapter-react-17/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, + "node_modules/@wojtekmaj/enzyme-adapter-utils": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@wojtekmaj/enzyme-adapter-utils/-/enzyme-adapter-utils-0.1.4.tgz", + "integrity": "sha512-ARGIQSIIv3oBia1m5Ihn1VU0FGmft6KPe39SBKTb8p7LSXO23YI4kNtc4M/cKoIY7P+IYdrZcgMObvedyjoSQA==", + "dev": true, + "dependencies": { + "function.prototype.name": "^1.1.0", + "has": "^1.0.0", + "object.fromentries": "^2.0.0", + "prop-types": "^15.7.0" + }, + "peerDependencies": { + "react": "^17.0.0-0" + } + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -12177,21 +12218,45 @@ "react": "17.0.2" } }, - "node_modules/react-dom/node_modules/scheduler": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", - "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", - "dev": true, - "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/react-shallow-renderer": { + "version": "16.14.1", + "resolved": "https://registry.npmjs.org/react-shallow-renderer/-/react-shallow-renderer-16.14.1.tgz", + "integrity": "sha512-rkIMcQi01/+kxiTE9D3fdS959U1g7gs+/rborw++42m1O9FAQiNI/UNRZExVUoAOprn4umcXf+pFRou8i4zuBg==", + "dev": true, + "dependencies": { + "object-assign": "^4.1.1", + "react-is": "^16.12.0 || ^17.0.0" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0" + } + }, + "node_modules/react-test-renderer": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-17.0.2.tgz", + "integrity": "sha512-yaQ9cB89c17PUb0x6UfWRs7kQCorVdHlutU1boVPEsB8IDZH6n9tHxMacc3y0JoXOJUsZb/t/Mb8FUWMKaM7iQ==", + "dev": true, + "dependencies": { + "object-assign": "^4.1.1", + "react-is": "^17.0.2", + "react-shallow-renderer": "^16.13.1", + "scheduler": "^0.20.2" + }, + "peerDependencies": { + "react": "17.0.2" + } + }, + "node_modules/react-test-renderer/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -13003,6 +13068,16 @@ "node": ">=10" } }, + "node_modules/scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, "node_modules/schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -18178,6 +18253,40 @@ "dev": true, "requires": {} }, + "@wojtekmaj/enzyme-adapter-react-17": { + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@wojtekmaj/enzyme-adapter-react-17/-/enzyme-adapter-react-17-0.6.7.tgz", + "integrity": "sha512-B+byiwi/T1bx5hcj9wc0fUL5Hlb5giSXJzcnEfJVl2j6dGV2NJfcxDBYX0WWwIxlzNiFz8kAvlkFWI2y/nscZQ==", + "dev": true, + "requires": { + "@wojtekmaj/enzyme-adapter-utils": "^0.1.4", + "enzyme-shallow-equal": "^1.0.0", + "has": "^1.0.0", + "prop-types": "^15.7.0", + "react-is": "^17.0.0", + "react-test-renderer": "^17.0.0" + }, + "dependencies": { + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + } + } + }, + "@wojtekmaj/enzyme-adapter-utils": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@wojtekmaj/enzyme-adapter-utils/-/enzyme-adapter-utils-0.1.4.tgz", + "integrity": "sha512-ARGIQSIIv3oBia1m5Ihn1VU0FGmft6KPe39SBKTb8p7LSXO23YI4kNtc4M/cKoIY7P+IYdrZcgMObvedyjoSQA==", + "dev": true, + "requires": { + "function.prototype.name": "^1.1.0", + "has": "^1.0.0", + "object.fromentries": "^2.0.0", + "prop-types": "^15.7.0" + } + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -24441,18 +24550,6 @@ "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "scheduler": "^0.20.2" - }, - "dependencies": { - "scheduler": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", - "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", - "dev": true, - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - } } }, "react-is": { @@ -24460,6 +24557,36 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "react-shallow-renderer": { + "version": "16.14.1", + "resolved": "https://registry.npmjs.org/react-shallow-renderer/-/react-shallow-renderer-16.14.1.tgz", + "integrity": "sha512-rkIMcQi01/+kxiTE9D3fdS959U1g7gs+/rborw++42m1O9FAQiNI/UNRZExVUoAOprn4umcXf+pFRou8i4zuBg==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "react-is": "^16.12.0 || ^17.0.0" + } + }, + "react-test-renderer": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-17.0.2.tgz", + "integrity": "sha512-yaQ9cB89c17PUb0x6UfWRs7kQCorVdHlutU1boVPEsB8IDZH6n9tHxMacc3y0JoXOJUsZb/t/Mb8FUWMKaM7iQ==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "react-is": "^17.0.2", + "react-shallow-renderer": "^16.13.1", + "scheduler": "^0.20.2" + }, + "dependencies": { + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + } + } + }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -25068,6 +25195,16 @@ "xmlchars": "^2.2.0" } }, + "scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dev": true, + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, "schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", diff --git a/package.json b/package.json index 366b45f..5a5a4d3 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@commitlint/cli": "^16.0.1", "@commitlint/config-conventional": "^16.0.0", "@readme/eslint-config": "^8.0.3", + "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7", "babel-jest": "^27.2.0", "babel-loader": "^8.1.0", "core-js": "^3.19.3", From e2c0b64635b08416fd31bce515aafa41c1f6adb1 Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:33:07 -0700 Subject: [PATCH 05/13] feat: getting ci building against react 16 --- .github/workflows/ci.yml | 15 +++++++++++++-- lib/enzyme.js | 9 ++++++++- package-lock.json | 4 ++-- package.json | 4 ++-- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ac31bc..0f047d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,18 @@ jobs: run: npm ci - name: Install React v${{ matrix.react-version }} - run: npm i react@${{ matrix.react-version }} + run: npm i react@${{ matrix.react-version react-dom@${{ matrix.react-version }} + + - name: Install React 16 Enzyme adapter + if: matrix.react-version == '16.x' + run: | + npm remove @wojtekmaj/enzyme-adapter-react-17 + npm install enzyme-adapter-react-16 + + - name: Run tests + if: matrix.react-version == '16.x' + run: REACT_VERSION=16 npm test - name: Run tests - run: npm test + if: matrix.react-version == '17.x' + run: REACT_VERSION=17 npm test diff --git a/lib/enzyme.js b/lib/enzyme.js index bb18036..8cc9c2a 100644 --- a/lib/enzyme.js +++ b/lib/enzyme.js @@ -1,6 +1,13 @@ +/* eslint-disable global-require */ /* eslint-disable import/no-extraneous-dependencies */ const enzyme = require('enzyme'); -const Adapter = require('@wojtekmaj/enzyme-adapter-react-17'); + +let Adapter; +if (process.env.REACT_VERSION && process.env.REACT_VERSION == '16') { + Adapter = require('enzyme-adapter-react-16'); +} else { + Adapter = require('@wojtekmaj/enzyme-adapter-react-17'); +} require('core-js/stable'); require('regenerator-runtime/runtime'); diff --git a/package-lock.json b/package-lock.json index 7bf73cb..e603a35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,8 +46,8 @@ }, "peerDependencies": { "@readme/variable": "*", - "react": "16.x||7.x", - "react-dom": "16.x||7.x" + "react": "16.x || 17.x", + "react-dom": "16.x || 17.x" } }, "node_modules/@babel/code-frame": { diff --git a/package.json b/package.json index ed18048..39d1eee 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ }, "peerDependencies": { "@readme/variable": "*", - "react": "16.x||17.x", - "react-dom": "16.x||17.x" + "react": "16.x || 17.x", + "react-dom": "16.x || 17.x" }, "devDependencies": { "@babel/preset-env": "^7.15.6", From 3c3b1f19d4c471d21e23568e8e576f17c8a000bd Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:37:51 -0700 Subject: [PATCH 06/13] ci: fixes --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f047d4..a12c7d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,16 +9,16 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x] - react-version: [16.x, 17.x] + node: [12, 14] + react: [16, 17] steps: - uses: actions/checkout@v2.4.0 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ matrix.node }} - name: Install npm@7 run: npm install -g npm@7 @@ -26,19 +26,19 @@ jobs: - name: Install dependencies run: npm ci - - name: Install React v${{ matrix.react-version }} - run: npm i react@${{ matrix.react-version react-dom@${{ matrix.react-version }} + - name: Install React v${{ matrix.react }} + run: npm i react@${{ matrix.react react-dom@${{ matrix.react }} - name: Install React 16 Enzyme adapter - if: matrix.react-version == '16.x' + if: matrix.react == '16' run: | npm remove @wojtekmaj/enzyme-adapter-react-17 npm install enzyme-adapter-react-16 - name: Run tests - if: matrix.react-version == '16.x' + if: matrix.react == '16' run: REACT_VERSION=16 npm test - name: Run tests - if: matrix.react-version == '17.x' + if: matrix.react == '17' run: REACT_VERSION=17 npm test From 5c75a9499ccdbcd446fb606f538d1411c39a77e9 Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:39:48 -0700 Subject: [PATCH 07/13] ci: debugging --- .github/workflows/ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a12c7d3..8224c5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,16 +29,16 @@ jobs: - name: Install React v${{ matrix.react }} run: npm i react@${{ matrix.react react-dom@${{ matrix.react }} - - name: Install React 16 Enzyme adapter - if: matrix.react == '16' - run: | - npm remove @wojtekmaj/enzyme-adapter-react-17 - npm install enzyme-adapter-react-16 - - - name: Run tests - if: matrix.react == '16' - run: REACT_VERSION=16 npm test - - - name: Run tests - if: matrix.react == '17' - run: REACT_VERSION=17 npm test + # - name: Install React 16 Enzyme adapter + # if: matrix.react == '16' + # run: | + # npm remove @wojtekmaj/enzyme-adapter-react-17 + # npm install enzyme-adapter-react-16 + + # - name: Run tests + # if: matrix.react == '16' + # run: REACT_VERSION=16 npm test + + # - name: Run tests + # if: matrix.react == '17' + # run: REACT_VERSION=17 npm test From e80edb03c5af0cc2c5f0f6c4053d5004597abddb Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:41:21 -0700 Subject: [PATCH 08/13] ci: debugging --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8224c5b..c20c67e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,16 +9,16 @@ jobs: strategy: matrix: - node: [12, 14] + node-version: [12.x, 14.x, 16.x] react: [16, 17] steps: - uses: actions/checkout@v2.4.0 - - name: Use Node.js ${{ matrix.node }} + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} - name: Install npm@7 run: npm install -g npm@7 @@ -26,8 +26,8 @@ jobs: - name: Install dependencies run: npm ci - - name: Install React v${{ matrix.react }} - run: npm i react@${{ matrix.react react-dom@${{ matrix.react }} + # - name: Install React v${{ matrix.react }} + # run: npm i react@${{ matrix.react react-dom@${{ matrix.react }} # - name: Install React 16 Enzyme adapter # if: matrix.react == '16' From 7c5483da83cf8d27a13ff059e332802391cd4e35 Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:42:33 -0700 Subject: [PATCH 09/13] ci: debugging --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c20c67e..c6a9a92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,8 @@ jobs: node-version: [12.x, 14.x, 16.x] react: [16, 17] + name: build (${{ matrix.node-version }} w/ React ${{ matrix.react }} + steps: - uses: actions/checkout@v2.4.0 @@ -26,8 +28,8 @@ jobs: - name: Install dependencies run: npm ci - # - name: Install React v${{ matrix.react }} - # run: npm i react@${{ matrix.react react-dom@${{ matrix.react }} + - name: Install React v${{ matrix.react }} + run: npm i react@${{ matrix.react }} react-dom@${{ matrix.react }} # - name: Install React 16 Enzyme adapter # if: matrix.react == '16' From 7ebf512fc5602ff4f658ca6bb4d3202d7b2d1bdd Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:44:08 -0700 Subject: [PATCH 10/13] ci: drop support for node 12 --- .github/workflows/ci.yml | 2 +- package-lock.json | 3 +++ package.json | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6a9a92..d16625c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] react: [16, 17] name: build (${{ matrix.node-version }} w/ React ${{ matrix.react }} diff --git a/package-lock.json b/package-lock.json index e603a35..3eeab82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,9 @@ "webpack-cli": "^4.8.0", "webpack-dev-server": "^4.2.1" }, + "engines": { + "node": "^14 || ^16" + }, "peerDependencies": { "@readme/variable": "*", "react": "16.x || 17.x", diff --git a/package.json b/package.json index 39d1eee..c312a19 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,9 @@ "url": "https://github.com/readmeio/syntax-highlighter.git" }, "homepage": "https://readmeio.github.io/syntax-highlighter/", + "engines": { + "node": "^14 || ^16" + }, "scripts": { "build": "webpack --progress", "lint": "eslint . --ext .jsx --ext .js", From 91d3908629b91e37ce537b5011b245c6e224508a Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:45:06 -0700 Subject: [PATCH 11/13] ci: run tests --- .github/workflows/ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d16625c..f95ed2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,16 +31,16 @@ jobs: - name: Install React v${{ matrix.react }} run: npm i react@${{ matrix.react }} react-dom@${{ matrix.react }} - # - name: Install React 16 Enzyme adapter - # if: matrix.react == '16' - # run: | - # npm remove @wojtekmaj/enzyme-adapter-react-17 - # npm install enzyme-adapter-react-16 - - # - name: Run tests - # if: matrix.react == '16' - # run: REACT_VERSION=16 npm test - - # - name: Run tests - # if: matrix.react == '17' - # run: REACT_VERSION=17 npm test + - name: Install React 16 Enzyme adapter + if: matrix.react == '16' + run: | + npm remove @wojtekmaj/enzyme-adapter-react-17 + npm install enzyme-adapter-react-16 + + - name: Run tests + if: matrix.react == '16' + run: REACT_VERSION=16 npm test + + - name: Run tests + if: matrix.react == '17' + run: npm test From 44a4415ef16319b9931be62f8fd896dd442e0c77 Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:47:46 -0700 Subject: [PATCH 12/13] fix: linting issues --- lib/enzyme.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/enzyme.js b/lib/enzyme.js index 8cc9c2a..6a7295d 100644 --- a/lib/enzyme.js +++ b/lib/enzyme.js @@ -1,9 +1,10 @@ -/* eslint-disable global-require */ /* eslint-disable import/no-extraneous-dependencies */ +/* eslint-disable import/no-unresolved */ +/* eslint-disable global-require */ const enzyme = require('enzyme'); let Adapter; -if (process.env.REACT_VERSION && process.env.REACT_VERSION == '16') { +if (process.env.REACT_VERSION && process.env.REACT_VERSION === '16') { Adapter = require('enzyme-adapter-react-16'); } else { Adapter = require('@wojtekmaj/enzyme-adapter-react-17'); From a2c13f80b7eb40e63aee8b1ce1d49448f26f353d Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Tue, 29 Mar 2022 13:51:30 -0700 Subject: [PATCH 13/13] ci: cleaning up messaging --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f95ed2b..6c6d54a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,10 +37,10 @@ jobs: npm remove @wojtekmaj/enzyme-adapter-react-17 npm install enzyme-adapter-react-16 - - name: Run tests + - name: Run tests on React 16 if: matrix.react == '16' run: REACT_VERSION=16 npm test - - name: Run tests + - name: Run tests on React 17 if: matrix.react == '17' run: npm test