diff --git a/package-lock.json b/package-lock.json index cfe65ad..6d9ea7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,16 +27,24 @@ "mocha": "^8.2.1", "neo-blessed": "^0.2.0", "prettier": "^2.2.1", + "react-devtools-core": "4.10.1", "rollup": "^2.38.5", "rollup-plugin-babel": "^4.4.0", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-node-resolve": "^5.2.0" }, "peerDependencies": { - "blessed": "^0.1.81", - "react": "^17.0.1", - "react-devtools-core": "^3.0.0", - "ws": "^6.0.0" + "blessed": ">=0.1.81 <0.2.0", + "react": ">=17.0.1 <18.0.0", + "react-devtools-core": ">=4.10.1 <5.0.0" + }, + "peerDependenciesMeta": { + "blessed": { + "optional": true + }, + "react-devtools-core": { + "optional": true + } } }, "node_modules/@babel/cli": { @@ -1546,12 +1554,6 @@ "dev": true, "optional": true }, - "node_modules/async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "peer": true - }, "node_modules/atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -4030,6 +4032,7 @@ "version": "17.0.1", "resolved": "https://registry.npmjs.org/react/-/react-17.0.1.tgz", "integrity": "sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w==", + "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -4039,24 +4042,13 @@ } }, "node_modules/react-devtools-core": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-3.6.3.tgz", - "integrity": "sha512-+P+eFy/yo8Z/UH9J0DqHZuUM5+RI2wl249TNvMx3J2jpUomLQa4Zxl56GEotGfw3PIP1eI+hVf1s53FlUONStQ==", - "peer": true, + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.10.1.tgz", + "integrity": "sha512-sXbBjGAWcf9HAblTP/zMtFhGHqxAfIR+GPxONZsSGN9FHnF4635dx1s2LdQWG9rJ+Ehr3nWg+BUAB6P78my5PA==", + "dev": true, "dependencies": { "shell-quote": "^1.6.1", - "ws": "^3.3.1" - } - }, - "node_modules/react-devtools-core/node_modules/ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "peer": true, - "dependencies": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" + "ws": "^7" } }, "node_modules/react-reconciler": { @@ -4376,7 +4368,8 @@ "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "node_modules/safe-regex": { "version": "1.1.0", @@ -4441,7 +4434,7 @@ "version": "1.7.2", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", - "peer": true + "dev": true }, "node_modules/slash": { "version": "2.0.0", @@ -4911,12 +4904,6 @@ "node": ">=0.10.0" } }, - "node_modules/ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", - "peer": true - }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -5153,12 +5140,24 @@ "dev": true }, "node_modules/ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "peer": true, - "dependencies": { - "async-limiter": "~1.0.0" + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.3.tgz", + "integrity": "sha512-hr6vCR76GsossIRsr8OLR9acVVm1jyfEWvhbNjtgPOrfvAlKzvyeg/P6r8RuDjRyrcQoPQT7K0DGEPc7Ae6jzA==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/y18n": { @@ -6586,12 +6585,6 @@ "dev": true, "optional": true }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "peer": true - }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -8510,26 +8503,13 @@ } }, "react-devtools-core": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-3.6.3.tgz", - "integrity": "sha512-+P+eFy/yo8Z/UH9J0DqHZuUM5+RI2wl249TNvMx3J2jpUomLQa4Zxl56GEotGfw3PIP1eI+hVf1s53FlUONStQ==", - "peer": true, + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.10.1.tgz", + "integrity": "sha512-sXbBjGAWcf9HAblTP/zMtFhGHqxAfIR+GPxONZsSGN9FHnF4635dx1s2LdQWG9rJ+Ehr3nWg+BUAB6P78my5PA==", + "dev": true, "requires": { "shell-quote": "^1.6.1", - "ws": "^3.3.1" - }, - "dependencies": { - "ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "peer": true, - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - } - } + "ws": "^7" } }, "react-reconciler": { @@ -8785,7 +8765,8 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "safe-regex": { "version": "1.1.0", @@ -8844,7 +8825,7 @@ "version": "1.7.2", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", - "peer": true + "dev": true }, "slash": { "version": "2.0.0", @@ -9234,12 +9215,6 @@ "repeat-string": "^1.6.1" } }, - "ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", - "peer": true - }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -9429,13 +9404,11 @@ "dev": true }, "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "peer": true, - "requires": { - "async-limiter": "~1.0.0" - } + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.3.tgz", + "integrity": "sha512-hr6vCR76GsossIRsr8OLR9acVVm1jyfEWvhbNjtgPOrfvAlKzvyeg/P6r8RuDjRyrcQoPQT7K0DGEPc7Ae6jzA==", + "dev": true, + "requires": {} }, "y18n": { "version": "4.0.1", diff --git a/package.json b/package.json index 2e82967..9e8bfb7 100644 --- a/package.json +++ b/package.json @@ -45,16 +45,24 @@ "mocha": "^8.2.1", "neo-blessed": "^0.2.0", "prettier": "^2.2.1", + "react-devtools-core": "4.10.1", "rollup": "^2.38.5", "rollup-plugin-babel": "^4.4.0", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-node-resolve": "^5.2.0" }, "peerDependencies": { - "blessed": "^0.1.81", - "react": "^17.0.1", - "react-devtools-core": "^3.0.0", - "ws": "^6.0.0" + "blessed": ">=0.1.81 <0.2.0", + "react": ">=17.0.1 <18.0.0", + "react-devtools-core": ">=4.10.1 <5.0.0" + }, + "peerDependenciesMeta": { + "blessed": { + "optional": true + }, + "react-devtools-core": { + "optional": true + } }, "dependencies": { "react": "^17.0.1", diff --git a/src/fiber/devtools.js b/src/fiber/devtools.js index b2d5f5c..e5ae718 100644 --- a/src/fiber/devtools.js +++ b/src/fiber/devtools.js @@ -1,6 +1,11 @@ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ +module.exports = { + version: require('react').version +}; + try { + require.resolve('react-devtools-core'); const defineProperty = Object.defineProperty; defineProperty(global, 'WebSocket', { value: require('ws') @@ -20,9 +25,5 @@ try { resolveRNStyle: null // TODO maybe: require('flattenStyle') }); } catch (err) { - if (process.env.NODE_ENV !== 'production') { - console.warn( - 'WARNING: the `ws` package must be installed to use `react-devtools`.' - ); - } + // no devtools installed... }