From b4833ccbac6203c433e177c3c7b97d06f8a145aa Mon Sep 17 00:00:00 2001 From: jhen Date: Tue, 25 Jul 2023 14:51:30 +0800 Subject: [PATCH 1/3] Bump eslint & related deps --- .eslintrc | 2 +- package.json | 12 +- yarn.lock | 1699 +++++++++++++++++++++++++++++--------------------- 3 files changed, 1009 insertions(+), 704 deletions(-) diff --git a/.eslintrc b/.eslintrc index 10692b1c..45e72880 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,5 @@ { - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "extends": "airbnb", "env": { "browser": true, diff --git a/package.json b/package.json index 8c988678..2637b07b 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "license": "MIT", "devDependencies": { "@babel/core": "^7.22.9", + "@babel/eslint-parser": "^7.22.9", "@babel/plugin-transform-react-constant-elements": "^7.22.5", "@babel/plugin-transform-react-inline-elements": "^7.22.5", "@babel/preset-env": "^7.22.9", @@ -37,7 +38,6 @@ "@electron/osx-sign": "^1.0.4", "@electron/universal": "^1.4.1", "apollo-boost": "^0.1.27", - "babel-eslint": "^8.2.2", "babel-loader": "^9.1.3", "babel-plugin-transform-react-remove-prop-types": "^0.4.10", "cross-env": "^5.2.0", @@ -47,11 +47,11 @@ "electron-installer-dmg": "^4.0.0", "electron-installer-windows": "^3.0.0", "electron-packager": "^17.1.1", - "eslint": "^4.18.2", - "eslint-config-airbnb": "^10.0.0", - "eslint-plugin-import": "^1.12.0", - "eslint-plugin-jsx-a11y": "^2.0.1", - "eslint-plugin-react": "^6.0.0", + "eslint": "^8.45.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.33.0", "jest": "^29.6.1", "mobx": "^3.6.2", "mobx-remotedev": "^0.2.8", diff --git a/yarn.lock b/yarn.lock index b8708b5c..54e1b9a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -26,13 +31,6 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" - integrity sha512-cuAuTTIQ9RqcFRJ/Y8PvTh+paepNcaGxwQwjIDRWPXmzzyAeCO4KqS9ikMvq0MCbRk6GlYKwfzStrcP3/jSL8g== - dependencies: - "@babel/highlight" "7.0.0-beta.44" - "@babel/code-frame@^7.0.0": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" @@ -73,16 +71,14 @@ json5 "^2.2.2" semver "^6.3.1" -"@babel/generator@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" - integrity sha512-5xVb7hlhjGcdkKpMXgicAVgx8syK5VJz193k0i/0sLP6DzE6lRrU1K3B/rFefgdo9LPGMAOOOAWW4jycj07ShQ== +"@babel/eslint-parser@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.22.9.tgz#75f8aa978d1e76c87cc6f26c1ea16ae58804d390" + integrity sha512-xdMkt39/nviO/4vpVdrEYPwXCsYIXSSAr6mC7WQsNIlGnuxKyKE7GZjalcnbSWiC4OXGNNN3UQPeHfjSC6sTDA== dependencies: - "@babel/types" "7.0.0-beta.44" - jsesc "^2.5.1" - lodash "^4.2.0" - source-map "^0.5.0" - trim-right "^1.0.1" + "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.1" "@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.7.2": version "7.22.9" @@ -167,15 +163,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== -"@babel/helper-function-name@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" - integrity sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg== - dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.44" - "@babel/template" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - "@babel/helper-function-name@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" @@ -184,13 +171,6 @@ "@babel/template" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/helper-get-function-arity@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" - integrity sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw== - dependencies: - "@babel/types" "7.0.0-beta.44" - "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" @@ -267,13 +247,6 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" - integrity sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA== - dependencies: - "@babel/types" "7.0.0-beta.44" - "@babel/helper-split-export-declaration@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" @@ -319,15 +292,6 @@ "@babel/traverse" "^7.22.6" "@babel/types" "^7.22.5" -"@babel/highlight@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" - integrity sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - "@babel/highlight@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" @@ -1136,23 +1100,13 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.7", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.6", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.7", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.6", "@babel/runtime@^7.20.7", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.6.tgz#57d64b9ae3cff1d67eb067ae117dac087f5bd438" integrity sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ== dependencies: regenerator-runtime "^0.13.11" -"@babel/template@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f" - integrity sha512-w750Sloq0UNifLx1rUqwfbnC6uSUk0mfwwgGRfdLiaUzfAOiH0tHJE6ILQIUi3KYkjiCDTskoIsnfqZvWLBDng== - dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" - lodash "^4.2.0" - "@babel/template@^7.22.5", "@babel/template@^7.3.3": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" @@ -1162,22 +1116,6 @@ "@babel/parser" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/traverse@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" - integrity sha512-UHuDz8ukQkJCDASKHf+oDt3FVUzFd+QYfuBIsiNu/4+/ix6pP/C+uQZJ6K1oEfbCMv/IKWbgDEh7fcsnIE5AtA== - dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/generator" "7.0.0-beta.44" - "@babel/helper-function-name" "7.0.0-beta.44" - "@babel/helper-split-export-declaration" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" - debug "^3.1.0" - globals "^11.1.0" - invariant "^2.2.0" - lodash "^4.2.0" - "@babel/traverse@^7.21.2", "@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8": version "7.22.8" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e" @@ -1194,15 +1132,6 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" - integrity sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ== - dependencies: - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^2.0.0" - "@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" @@ -1389,6 +1318,38 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz#d0fce5d07b0620caa282b5131c297bb60f9d87e6" integrity sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww== +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.0.tgz#5b63f0df5528a44e28aa8578d393de908cc3d4d0" + integrity sha512-uiPeRISaglZnaZk8vwrjQZ1CxogZeY/4IYft6gBOTqu1WhVXWmCmZMWxUv2Q/pxSvPdp1JPaO62kLOcOkMqWrw== + +"@eslint/eslintrc@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.0.tgz#82256f164cc9e0b59669efc19d57f8092706841d" + integrity sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.6.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@eslint/js@8.44.0": + version "8.44.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.44.0.tgz#961a5903c74139390478bdc808bcde3fc45ab7af" + integrity sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw== + "@floating-ui/core@^1.3.1": version "1.3.1" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.3.1.tgz#4d795b649cc3b1cbb760d191c80dcb4353c9a366" @@ -1401,6 +1362,25 @@ dependencies: "@floating-ui/core" "^1.3.1" +"@humanwhocodes/config-array@^0.11.10": + version "0.11.10" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" + integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1671,6 +1651,34 @@ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== +"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": + version "5.1.1-v1" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" + integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== + dependencies: + eslint-scope "5.1.1" + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + "@polka/url@^1.0.0-next.20": version "1.0.0-next.21" resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" @@ -2392,6 +2400,11 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + "@types/keyv@*": version "3.1.1" resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" @@ -2782,29 +2795,17 @@ acorn-import-assertions@^1.9.0: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= - dependencies: - acorn "^3.0.4" +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^8.0.0: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= - -acorn@^5.5.0: - version "5.7.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" - integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== - -acorn@^8.0.4, acorn@^8.7.1, acorn@^8.8.2: +acorn@^8.0.4, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: version "8.10.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -2865,11 +2866,6 @@ ajv-formats@^2.1.1: dependencies: ajv "^8.0.0" -ajv-keywords@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I= - ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" @@ -2882,17 +2878,7 @@ ajv-keywords@^5.1.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^5.2.3, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ajv@^6.12.5, ajv@^6.7.0: +ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.7.0: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -3146,6 +3132,18 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +aria-query@^5.1.3: + version "5.3.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e" + integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A== + dependencies: + dequal "^2.0.3" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -3161,6 +3159,14 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + array-filter@~0.0.0: version "0.0.1" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" @@ -3176,6 +3182,17 @@ array-flatten@^2.1.2: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== +array-includes@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" + integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" + is-string "^1.0.7" + array-map@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" @@ -3191,13 +3208,48 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.find@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.0.tgz#630f2eaf70a39e608ac3573e45cf8ccd0ede9ad7" - integrity sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg== +array.prototype.flat@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2" + integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA== dependencies: - define-properties "^1.1.3" - es-abstract "^1.13.0" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" + integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +array.prototype.tosorted@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz#ccf44738aa2b5ac56578ffda97c03fd3e23dd532" + integrity sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + get-intrinsic "^1.1.3" + +arraybuffer.prototype.slice@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz#9b5ea3868a6eebc30273da577eb888381c0044bb" + integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" arson@^0.2.5: version "0.2.6" @@ -3234,6 +3286,11 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= +ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag== + astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -3283,7 +3340,24 @@ author-regex@^1.0.0: resolved "https://registry.yarnpkg.com/author-regex/-/author-regex-1.0.0.tgz#d08885be6b9bbf9439fe087c76287245f0a81450" integrity sha1-0IiFvmubv5Q5/gh8dihyRfCoFFA= -babel-code-frame@6.26.0, babel-code-frame@^6.22.0: +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + +axe-core@^4.6.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.2.tgz#040a7342b20765cb18bb50b628394c21bccc17a0" + integrity sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g== + +axobject-query@^3.1.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.2.1.tgz#39c378a6e3b06ca679f29138151e45b2b32da62a" + integrity sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg== + dependencies: + dequal "^2.0.3" + +babel-code-frame@6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= @@ -3292,18 +3366,6 @@ babel-code-frame@6.26.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-eslint@^8.2.2: - version "8.2.6" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.6.tgz#6270d0c73205628067c0f7ae1693a9e797acefd9" - integrity sha512-aCdHjhzcILdP8c9lej7hvXKvQieyRt20SF102SIGyY4cUIiw6UaAtK4j2o3dXX74jEmy0TJ0CEhv4fTIM3SzcA== - dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/traverse" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" - eslint-scope "3.7.1" - eslint-visitor-keys "^1.0.0" - babel-jest@^29.6.1: version "29.6.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.1.tgz#a7141ad1ed5ec50238f3cd36127636823111233a" @@ -3410,11 +3472,6 @@ babel-preset-jest@^29.5.0: babel-plugin-jest-hoist "^29.5.0" babel-preset-current-node-syntax "^1.0.0" -babylon@7.0.0-beta.44: - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" - integrity sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g== - balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -3599,11 +3656,6 @@ buffer@^5.2.1: base64-js "^1.3.1" ieee754 "^1.1.13" -builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= - bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -3647,7 +3699,7 @@ cacheable-request@^7.0.2: normalize-url "^6.0.1" responselike "^2.0.0" -call-bind@^1.0.0: +call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== @@ -3655,18 +3707,6 @@ call-bind@^1.0.0: function-bind "^1.1.1" get-intrinsic "^1.0.2" -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -3708,7 +3748,7 @@ chalk@1.1.3, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -3772,11 +3812,6 @@ ci-info@^3.2.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== - cjs-module-lexer@^1.0.0: version "1.2.3" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" @@ -4058,16 +4093,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.6.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - conf@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/conf/-/conf-1.4.0.tgz#1ea66c9d7a9b601674a5bb9d2b8dc3c726625e67" @@ -4079,6 +4104,11 @@ conf@^1.3.0: pkg-up "^2.0.0" write-file-atomic "^2.3.0" +confusing-browser-globals@^1.0.10: + version "1.0.11" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" + integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== + connect-history-api-fallback@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" @@ -4089,11 +4119,6 @@ consumable-stream@^2.0.0: resolved "https://registry.yarnpkg.com/consumable-stream/-/consumable-stream-2.0.0.tgz#11d3c7281b747eb9efd31c199b3a8b1711bec654" integrity sha512-I6WA2JVYXs/68rEvi1ie3rZjP6qusTVFEQkbzR+WC+fY56TpwiGTIDJETsrnlxv5CsnmK69ps6CkYvIbpEEqBA== -contains-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= - content-disposition@0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" @@ -4225,7 +4250,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.1, cross-spawn@^7.0.3: +cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -4561,18 +4586,10 @@ d3tooltip@^3.0.0: dependencies: "@babel/runtime" "^7.20.6" -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -damerau-levenshtein@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz#780cf7144eb2e8dbd1c3bb83ae31100ccc31a414" - integrity sha512-CBCRqFnpu715iPmw1KrdOrzRqbdFwQTwAWyyyYS42+iAgHCuXZ+/TdMgQkUENPomxEz9z1BEzuQU2Xw0kUuAgA== +damerau-levenshtein@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" + integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== dateformat@^5.0.3: version "5.0.3" @@ -4593,6 +4610,13 @@ debug@^3.1.0: dependencies: ms "^2.1.1" +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" @@ -4636,10 +4660,10 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: version "4.3.1" @@ -4663,13 +4687,21 @@ define-lazy-prop@^2.0.0: resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.1.2, define-properties@^1.1.3: +define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: object-keys "^1.0.12" +define-properties@^1.1.4, define-properties@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" + integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -4714,6 +4746,11 @@ deprecated-decorator@^0.1.6: resolved "https://registry.yarnpkg.com/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz#00966317b7a12fe92f3cc831f7583af329b86c37" integrity sha1-AJZjF7ehL+kvPMgx91g68ym4bDc= +dequal@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== + destroy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" @@ -4767,22 +4804,6 @@ dns-packet@^5.2.2: dependencies: "@leichtgewicht/ip-codec" "^2.0.1" -doctrine@1.3.x: - version "1.3.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.3.0.tgz#13e75682b55518424276f7c173783456ef913d26" - integrity sha1-E+dWgrVVGEJCdvfBc3g0Vu+RPSY= - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - -doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" @@ -4790,6 +4811,13 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + dom-helpers@^5.0.1: version "5.2.1" resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902" @@ -5051,6 +5079,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + encode-utf8@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" @@ -5115,98 +5148,86 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.13.0: - version "1.14.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.2.tgz#7ce108fad83068c8783c3cdf62e504e084d8c497" - integrity sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg== - dependencies: - es-to-primitive "^1.2.0" - function-bind "^1.1.1" +es-abstract@^1.19.0, es-abstract@^1.20.4: + version "1.22.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== + dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.2.1" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" has "^1.0.3" - has-symbols "^1.0.0" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-inspect "^1.6.0" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.10" + is-weakref "^1.0.2" + object-inspect "^1.12.3" object-keys "^1.1.1" - string.prototype.trimleft "^2.0.0" - string.prototype.trimright "^2.0.0" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.7" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.10" es-module-lexer@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.3.0.tgz#6be9c9e0b4543a60cd166ff6f8b4e9dae0b0c16f" integrity sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA== -es-to-primitive@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + +es-shim-unscopables@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" + integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== + dependencies: + has "^1.0.3" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" is-symbol "^1.0.2" -es5-ext@^0.10.35, es5-ext@^0.10.50, es5-ext@^0.10.51, es5-ext@~0.10.14: - version "0.10.51" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.51.tgz#ed2d7d9d48a12df86e0299287e93a09ff478842f" - integrity sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ== - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.1" - next-tick "^1.0.0" - es6-error@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== -es6-iterator@~2.0.1, es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@^0.1.4, es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - integrity sha1-0rPsXU2ADO2BjbU40ol02wpzzLE= - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-symbol@^3.1.1, es6-symbol@~3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.2.tgz#859fdd34f32e905ff06d752e7171ddd4444a7ed1" - integrity sha512-/ZypxQsArlv+KHpGvng52/Iz8by3EQPxhmbuz8yFG89N/caTFBSbcXONDw0aMjy827gQg26XAjP4uXFvnfINmQ== - dependencies: - d "^1.0.1" - es5-ext "^0.10.51" - es6-template-regex@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/es6-template-regex/-/es6-template-regex-0.1.1.tgz#e517b9e0f742beeb8d3040834544fda0e4651467" @@ -5252,76 +5273,104 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-airbnb-base@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-5.0.3.tgz#9714ac35ec2cd7fab0d44d148a9f91db2944074d" - integrity sha1-lxSsNews1/qw1E0Uip+R2ylEB00= - -eslint-config-airbnb@^10.0.0: - version "10.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-10.0.1.tgz#a470108646d6c45e1f639a03f11d504a1aa4aedc" - integrity sha1-pHAQhkbWxF4fY5oD8R1QShqkrtw= +eslint-config-airbnb-base@^15.0.0: + version "15.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236" + integrity sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig== dependencies: - eslint-config-airbnb-base "^5.0.2" + confusing-browser-globals "^1.0.10" + object.assign "^4.1.2" + object.entries "^1.1.5" + semver "^6.3.0" -eslint-import-resolver-node@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" - integrity sha1-Wt2BBujJKNssuiMrzZ76hG49oWw= +eslint-config-airbnb@^19.0.4: + version "19.0.4" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-19.0.4.tgz#84d4c3490ad70a0ffa571138ebcdea6ab085fdc3" + integrity sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew== dependencies: - debug "^2.2.0" - object-assign "^4.0.1" - resolve "^1.1.6" + eslint-config-airbnb-base "^15.0.0" + object.assign "^4.1.2" + object.entries "^1.1.5" -eslint-plugin-import@^1.12.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-1.16.0.tgz#b2fa07ebcc53504d0f2a4477582ec8bff1871b9f" - integrity sha1-svoH68xTUE0PKkR3WC7Iv/GHG58= +eslint-import-resolver-node@^0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7" + integrity sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA== dependencies: - builtin-modules "^1.1.1" - contains-path "^0.1.0" - debug "^2.2.0" - doctrine "1.3.x" - es6-map "^0.1.3" - es6-set "^0.1.4" - eslint-import-resolver-node "^0.2.0" - has "^1.0.1" - lodash.cond "^4.3.0" - lodash.endswith "^4.0.1" - lodash.find "^4.3.0" - lodash.findindex "^4.3.0" - minimatch "^3.0.3" - object-assign "^4.0.1" - pkg-dir "^1.0.0" - pkg-up "^1.0.0" + debug "^3.2.7" + is-core-module "^2.11.0" + resolve "^1.22.1" -eslint-plugin-jsx-a11y@^2.0.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-2.2.3.tgz#4e35cb71b8a7db702ac415c806eb8e8d9ea6c65d" - integrity sha1-TjXLcbin23AqxBXIBuuOjZ6mxl0= +eslint-module-utils@^2.7.4: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" + integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== dependencies: - damerau-levenshtein "^1.0.0" - jsx-ast-utils "^1.0.0" - object-assign "^4.0.1" + debug "^3.2.7" -eslint-plugin-react@^6.0.0: - version "6.10.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz#c5435beb06774e12c7db2f6abaddcbf900cd3f78" - integrity sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g= +eslint-plugin-import@^2.27.5: + version "2.27.5" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65" + integrity sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow== dependencies: - array.prototype.find "^2.0.1" - doctrine "^1.2.2" - has "^1.0.1" - jsx-ast-utils "^1.3.4" - object.assign "^4.0.4" + array-includes "^3.1.6" + array.prototype.flat "^1.3.1" + array.prototype.flatmap "^1.3.1" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.7" + eslint-module-utils "^2.7.4" + has "^1.0.3" + is-core-module "^2.11.0" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.values "^1.1.6" + resolve "^1.22.1" + semver "^6.3.0" + tsconfig-paths "^3.14.1" + +eslint-plugin-jsx-a11y@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.7.1.tgz#fca5e02d115f48c9a597a6894d5bcec2f7a76976" + integrity sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA== + dependencies: + "@babel/runtime" "^7.20.7" + aria-query "^5.1.3" + array-includes "^3.1.6" + array.prototype.flatmap "^1.3.1" + ast-types-flow "^0.0.7" + axe-core "^4.6.2" + axobject-query "^3.1.1" + damerau-levenshtein "^1.0.8" + emoji-regex "^9.2.2" + has "^1.0.3" + jsx-ast-utils "^3.3.3" + language-tags "=1.0.5" + minimatch "^3.1.2" + object.entries "^1.1.6" + object.fromentries "^2.0.6" + semver "^6.3.0" -eslint-scope@3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" - integrity sha512-ivpbtpUgg9SJS4TLjK7KdcDhqc/E3CGItsvQbBNLkNGUeMhd5qnJcryba/brESS+dg3vrLqPuc/UcS7jRJdN5A== +eslint-plugin-react@^7.33.0: + version "7.33.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.33.0.tgz#6c356fb0862fec2cd1b04426c669ea746e9b6eb3" + integrity sha512-qewL/8P34WkY8jAqdQxsiL82pDUeT7nhs8IsuXgfgnsEloKCT4miAV9N9kGtx7/KM9NH/NCGUE7Edt9iGxLXFw== dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" + array-includes "^3.1.6" + array.prototype.flatmap "^1.3.1" + array.prototype.tosorted "^1.1.1" + doctrine "^2.1.0" + estraverse "^5.3.0" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.1.2" + object.entries "^1.1.6" + object.fromentries "^2.0.6" + object.hasown "^1.1.2" + object.values "^1.1.6" + prop-types "^15.8.1" + resolve "^2.0.0-next.4" + semver "^6.3.1" + string.prototype.matchall "^4.0.8" eslint-scope@5.1.1: version "5.1.1" @@ -5331,89 +5380,87 @@ eslint-scope@5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^3.7.1: - version "3.7.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" - integrity sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA== +eslint-scope@^7.2.0: + version "7.2.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.1.tgz#936821d3462675f25a18ac5fd88a67cc15b393bd" + integrity sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA== dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" + esrecurse "^4.3.0" + estraverse "^5.2.0" -eslint-visitor-keys@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== - -eslint@^4.18.2: - version "4.19.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" - integrity sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ== - dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" - chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^3.7.1" - eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" +eslint-visitor-keys@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" + integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== + +eslint@^8.45.0: + version "8.45.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.45.0.tgz#bab660f90d18e1364352c0a6b7c6db8edb458b78" + integrity sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.4.0" + "@eslint/eslintrc" "^2.1.0" + "@eslint/js" "8.44.0" + "@humanwhocodes/config-array" "^0.11.10" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.2.0" + eslint-visitor-keys "^3.4.1" + espree "^9.6.0" + esquery "^1.4.2" esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" - mkdirp "^0.5.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^1.0.1" - require-uncached "^1.0.3" - semver "^5.3.0" - strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" + optionator "^0.9.3" + strip-ansi "^6.0.1" + text-table "^0.2.0" -espree@^3.5.4: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" - integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== +espree@^9.6.0: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" + acorn "^8.9.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: - estraverse "^4.1.0" + estraverse "^5.1.0" esrecurse@^4.3.0: version "4.3.0" @@ -5422,12 +5469,12 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.2.0: +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== @@ -5442,14 +5489,6 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= - dependencies: - d "1" - es5-ext "~0.10.14" - eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -5633,11 +5672,6 @@ extract-zip@^2.0.0, extract-zip@^2.0.1: optionalDependencies: "@types/yauzl" "^2.9.1" -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -5648,16 +5682,23 @@ fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@~2.0.4: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastest-levenshtein@^1.0.12: version "1.0.16" resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== +fastq@^1.6.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + dependencies: + reusify "^1.0.4" + faye-websocket@^0.11.3: version "0.11.4" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" @@ -5693,13 +5734,12 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" + flat-cache "^3.0.4" filename-reserved-regex@^2.0.0: version "2.0.0" @@ -5772,14 +5812,6 @@ find-root@^1.1.0: resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" @@ -5802,6 +5834,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + find-up@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" @@ -5818,15 +5858,18 @@ find-yarn-workspace-root@^1.2.1: fs-extra "^4.0.3" micromatch "^3.1.4" -flat-cache@^1.2.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" - integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== dependencies: - circular-json "^0.3.1" - graceful-fs "^4.1.2" - rimraf "~2.6.2" - write "^0.2.1" + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== flora-colossus@^1.0.0: version "1.0.1" @@ -5848,6 +5891,13 @@ follow-redirects@^1.0.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -5953,10 +6003,20 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +function.prototype.name@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" + integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + +functions-have-names@^1.2.2, functions-have-names@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== galactus@^0.2.1: version "0.2.1" @@ -6004,7 +6064,7 @@ get-folder-size@^2.0.1: gar "^1.0.4" tiny-each-async "2.0.3" -get-intrinsic@^1.0.2: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== @@ -6053,11 +6113,26 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + get-value@^2.0.2, get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -6070,7 +6145,7 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@^7.0.0, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: +glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -6126,18 +6201,32 @@ global-prefix@^1.0.1: is-windows "^1.0.1" which "^1.2.14" -globals@^11.0.1, globals@^11.1.0: +globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globalthis@^1.0.1: +globals@^13.19.0: + version "13.20.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + dependencies: + type-fest "^0.20.2" + +globalthis@^1.0.1, globalthis@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== dependencies: define-properties "^1.1.3" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + got@^11.8.5: version "11.8.6" resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" @@ -6191,6 +6280,11 @@ graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + graphiql-explorer@^0.4.0: version "0.4.4" resolved "https://registry.yarnpkg.com/graphiql-explorer/-/graphiql-explorer-0.4.4.tgz#01a7005c27a4148a4555bb746f5af84eb588824c" @@ -6367,6 +6461,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -6377,6 +6476,13 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + has-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" @@ -6387,11 +6493,18 @@ has-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= -has-symbols@^1.0.3: +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -6423,7 +6536,7 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -has@^1.0.1, has@^1.0.3: +has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== @@ -6589,10 +6702,10 @@ ieee754@^1.1.13: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^3.3.3: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== +ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== image-size@^0.7.4: version "0.7.5" @@ -6668,7 +6781,7 @@ ini@^1.3.4: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== -inquirer@3.3.0, inquirer@^3.0.6: +inquirer@3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" integrity sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ== @@ -6688,6 +6801,15 @@ inquirer@3.3.0, inquirer@^3.0.6: strip-ansi "^4.0.0" through "^2.3.6" +internal-slot@^1.0.3, internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== + dependencies: + get-intrinsic "^1.2.0" + has "^1.0.3" + side-channel "^1.0.4" + "internmap@1 - 2": version "2.0.3" resolved "https://registry.yarnpkg.com/internmap/-/internmap-2.0.3.tgz#6685f23755e43c524e251d29cbc97248e3061009" @@ -6703,13 +6825,6 @@ interpret@^3.1.1: resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== -invariant@^2.2.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" @@ -6734,6 +6849,15 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -6744,6 +6868,13 @@ is-arrayish@^0.3.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -6751,11 +6882,24 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-callable@^1.1.3, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" @@ -6768,7 +6912,7 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.11.0: +is-core-module@^2.11.0, is-core-module@^2.9.0: version "2.12.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== @@ -6849,7 +6993,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.1, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -6877,6 +7021,11 @@ is-my-json-valid@^2.20.0: jsonpointer "^5.0.0" xtend "^4.0.0" +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + is-number-like@^1.0.3: version "1.0.8" resolved "https://registry.yarnpkg.com/is-number-like/-/is-number-like-1.0.8.tgz#2e129620b50891042e44e9bbbb30593e75cfbbe3" @@ -6884,6 +7033,13 @@ is-number-like@^1.0.3: dependencies: lodash.isfinite "^3.3.2" +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -6901,6 +7057,11 @@ is-obj@^1.0.0: resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + is-plain-obj@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -6933,17 +7094,13 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= -is-regex@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: - has "^1.0.3" - -is-resolvable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== + call-bind "^1.0.2" + has-tostringtag "^1.0.0" is-retry-allowed@^1.0.0: version "1.2.0" @@ -6955,6 +7112,13 @@ is-root@1.0.0: resolved "https://registry.yarnpkg.com/is-root/-/is-root-1.0.0.tgz#07b6c233bc394cd9d02ba15c966bd6660d6342d5" integrity sha1-B7bCM7w5TNnQK6FclmvWZg1jQtU= +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -6965,6 +7129,13 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -6972,6 +7143,27 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.0" +is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.10, is-typed-array@^1.1.9: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -6989,11 +7181,16 @@ is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isbinaryfile@^4.0.8: version "4.0.10" resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" @@ -7441,17 +7638,17 @@ jest@^29.6.1: import-local "^3.0.2" jest-cli "^29.6.1" -js-tokens@^3.0.0, js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.10.0, js-yaml@^3.9.1: +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@^3.10.0: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -7467,6 +7664,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsan@^3.1.13, jsan@^3.1.3, jsan@^3.1.5, jsan@^3.1.9: version "3.1.13" resolved "https://registry.yarnpkg.com/jsan/-/jsan-3.1.13.tgz#4de8c7bf8d1cfcd020c313d438f930cec4b91d86" @@ -7513,11 +7717,6 @@ json-schema-merge-allof@^0.6.0: json-schema-compare "^0.2.2" lodash "^4.17.4" -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -7548,6 +7747,13 @@ json5@^0.5.1: resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + json5@^2.2.2: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" @@ -7721,10 +7927,15 @@ jss@10.10.0, jss@^10.9.2: is-in-browser "^1.1.3" tiny-warning "^1.0.2" -jsx-ast-utils@^1.0.0, jsx-ast-utils@^1.3.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" - integrity sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE= +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.3: + version "3.3.4" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.4.tgz#b896535fed5b867650acce5a9bd4135ffc7b3bf9" + integrity sha512-fX2TVdCViod6HwKEtSWGHs57oFhVfCMwieb9PuRDgjDPh5XeqJiHFFFJCHxU5cnTc3Bu/GRL+kPiFmw8XWOfKw== + dependencies: + array-includes "^3.1.6" + array.prototype.flat "^1.3.1" + object.assign "^4.1.4" + object.values "^1.1.6" junk@^3.1.0: version "3.1.0" @@ -7784,6 +7995,18 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +language-subtag-registry@~0.3.2: + version "0.3.22" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz#2e1500861b2e457eba7e7ae86877cbd08fa1fd1d" + integrity sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w== + +language-tags@=1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" + integrity sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ== + dependencies: + language-subtag-registry "~0.3.2" + launch-editor@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.6.0.tgz#4c0c1a6ac126c572bd9ff9a30da1d2cae66defd7" @@ -7797,13 +8020,13 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" + prelude-ls "^1.2.1" + type-check "~0.4.0" lie@3.1.1: version "3.1.1" @@ -7874,6 +8097,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + locate-path@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" @@ -7886,11 +8116,6 @@ lodash-es@^4.17.15: resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== -lodash.cond@^4.3.0: - version "4.5.2" - resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" - integrity sha1-9HGh2khr5g9quVXRcRVSPdHSVdU= - lodash.curry@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.curry/-/lodash.curry-4.1.1.tgz#248e36072ede906501d75966200a86dab8b23170" @@ -7901,21 +8126,6 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= -lodash.endswith@^4.0.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/lodash.endswith/-/lodash.endswith-4.2.1.tgz#fed59ac1738ed3e236edd7064ec456448b37bc09" - integrity sha1-/tWawXOO0+I27dcGTsRWRIs3vAk= - -lodash.find@^4.3.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.find/-/lodash.find-4.6.0.tgz#cb0704d47ab71789ffa0de8b97dd926fb88b13b1" - integrity sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E= - -lodash.findindex@^4.3.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.findindex/-/lodash.findindex-4.6.0.tgz#a3245dee61fb9b6e0624b535125624bb69c11106" - integrity sha1-oyRd7mH7m24GJLU1ElYku2nBEQY= - lodash.flattendeep@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" @@ -7936,6 +8146,11 @@ lodash.isfinite@^3.3.2: resolved "https://registry.yarnpkg.com/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz#fb89b65a9a80281833f0b7478b3a5104f898ebb3" integrity sha1-+4m2WpqAKBgz8LdHizpRBPiY67M= +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lodash.pickby@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" @@ -7951,12 +8166,12 @@ lodash.uniqby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI= -lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -8199,14 +8414,14 @@ minimatch@3.0.3: dependencies: brace-expansion "^1.0.0" -minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" -minimatch@^3.1.1: +minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -8356,11 +8571,6 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -next-tick@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= - nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -8444,17 +8654,12 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" - integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== - -object-inspect@^1.9.0: +object-inspect@^1.12.3, object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -8471,15 +8676,41 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.0.4: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== +object.assign@^4.1.2, object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +object.entries@^1.1.5, object.entries@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.6.tgz#9737d0e5b8291edd340a3e3264bb8a3b00d5fa23" + integrity sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +object.fromentries@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.6.tgz#cdb04da08c539cffa912dcd368b886e0904bfa73" + integrity sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +object.hasown@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.2.tgz#f919e21fad4eb38a57bc6345b3afd496515c3f92" + integrity sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw== + dependencies: + define-properties "^1.1.4" + es-abstract "^1.20.4" object.pick@^1.3.0: version "1.3.0" @@ -8488,6 +8719,15 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" +object.values@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" + integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -8554,17 +8794,17 @@ optimism@^0.10.0: dependencies: "@wry/context" "^0.4.0" -optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= +optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" + "@aashutoshrathi/word-wrap" "^1.2.3" + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" original@>=0.0.5: version "1.0.2" @@ -8602,7 +8842,7 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.1.0: +p-limit@^3.0.2, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -8637,6 +8877,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-locate@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" @@ -8738,13 +8985,6 @@ path-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= - dependencies: - pinkie-promise "^2.0.0" - path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -8765,11 +9005,6 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -8849,13 +9084,6 @@ pirates@^4.0.4, pirates@^4.0.5: resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= - dependencies: - find-up "^1.0.0" - pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -8877,13 +9105,6 @@ pkg-dir@^7.0.0: dependencies: find-up "^6.3.0" -pkg-up@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" - integrity sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY= - dependencies: - find-up "^1.0.0" - pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" @@ -8905,11 +9126,6 @@ plist@^3.0.0, plist@^3.0.4, plist@^3.0.5: base64-js "^1.5.1" xmlbuilder "^15.1.1" -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - portscanner@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/portscanner/-/portscanner-2.2.0.tgz#6059189b3efa0965c9d96a56b958eb9508411cf1" @@ -8982,10 +9198,10 @@ postcss@^8.4.21, postcss@^8.4.23: picocolors "^1.0.0" source-map-js "^1.0.2" -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prepend-http@^1.0.1: version "1.0.4" @@ -9006,7 +9222,7 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -progress@^2.0.0, progress@^2.0.3: +progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -9100,6 +9316,11 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + quick-lru@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" @@ -9348,7 +9569,7 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.2.2: +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -9467,10 +9688,14 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" - integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== +regexp.prototype.flags@^1.4.3, regexp.prototype.flags@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" + integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + functions-have-names "^1.2.3" regexpu-core@^5.3.1: version "5.3.2" @@ -9544,14 +9769,6 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -9582,11 +9799,6 @@ resolve-dir@^1.0.0: expand-tilde "^2.0.0" global-modules "^1.0.0" -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -9614,7 +9826,7 @@ resolve@^1.1.6, resolve@^1.10.0: dependencies: path-parse "^1.0.6" -resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0: +resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1: version "1.22.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== @@ -9623,6 +9835,15 @@ resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^2.0.0-next.4: + version "2.0.0-next.4" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" + integrity sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + responselike@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" @@ -9653,6 +9874,11 @@ retry@^0.13.1: resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -9667,13 +9893,6 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rimraf@~2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - rn-host-detect@^1.0.1: version "1.1.5" resolved "https://registry.yarnpkg.com/rn-host-detect/-/rn-host-detect-1.1.5.tgz#fbecb982b73932f34529e97932b9a63e58d8deb6" @@ -9703,6 +9922,13 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + rw@1: version "1.3.3" resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4" @@ -9720,6 +9946,16 @@ rx-lite@*, rx-lite@^4.0.8: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ= +safe-array-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" + integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -9730,6 +9966,15 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@^5.1.1, resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -9820,7 +10065,7 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.5.0, semver@^5.6.0: version "5.7.2" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== @@ -10043,13 +10288,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== - dependencies: - is-fullwidth-code-point "^2.0.0" - slice-ansi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" @@ -10200,7 +10438,7 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: +source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== @@ -10329,7 +10567,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@^2.1.0, string-width@^2.1.1: +string-width@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -10364,21 +10602,46 @@ string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string.prototype.trimleft@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" - integrity sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw== +string.prototype.matchall@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" + integrity sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg== dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" + has-symbols "^1.0.3" + internal-slot "^1.0.3" + regexp.prototype.flags "^1.4.3" + side-channel "^1.0.4" -string.prototype.trimright@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz#669d164be9df9b6f7559fa8e89945b168a5a6c58" - integrity sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg== +string.prototype.trim@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" + integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimend@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimstart@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" string_decoder@^1.1.1: version "1.3.0" @@ -10454,11 +10717,6 @@ strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - strip-outer@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-outer/-/strip-outer-1.0.1.tgz#b2fd2abf6604b9d1e6013057195df836b8a9d631" @@ -10549,18 +10807,6 @@ symbol-observable@^1.0.2, symbol-observable@^1.2.0: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== -table@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" - integrity sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA== - dependencies: - ajv "^5.2.3" - ajv-keywords "^2.1.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" - tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" @@ -10596,7 +10842,7 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -text-table@0.2.0, text-table@~0.2.0: +text-table@0.2.0, text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= @@ -10753,11 +10999,6 @@ trim-repeated@^1.0.0: dependencies: escape-string-regexp "^1.0.2" -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw== - ts-invariant@^0.3.2: version "0.3.3" resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.3.3.tgz#b5742b1885ecf9e29c31a750307480f045ec0b16" @@ -10772,6 +11013,16 @@ ts-invariant@^0.4.0, ts-invariant@^0.4.2: dependencies: tslib "^1.9.3" +tsconfig-paths@^3.14.1: + version "3.14.2" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" + integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tslib@^1.9.0, tslib@^1.9.3: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" @@ -10782,12 +11033,12 @@ tslib@^2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.0.tgz#b295854684dbda164e181d259a22cd779dcd7bc3" integrity sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA== -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: - prelude-ls "~1.1.2" + prelude-ls "^1.2.1" type-detect@4.0.8: version "4.0.8" @@ -10799,6 +11050,11 @@ type-fest@^0.13.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" @@ -10812,21 +11068,60 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" @@ -11221,11 +11516,33 @@ whatwg-fetch@2.0.4, whatwg-fetch@^2.0.3: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= +which-typed-array@^1.1.10, which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + which@^1.2.14, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -11250,11 +11567,6 @@ word-wrap@^1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" @@ -11311,13 +11623,6 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= - dependencies: - mkdirp "^0.5.1" - ws@5.1.1, ws@^7, ws@^7.3.1, ws@^7.5.9, ws@^8.13.0, ws@^8.9.0: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" From 54a50abc2c50827de84dbfef6e72aa9134d9f559 Mon Sep 17 00:00:00 2001 From: jhen Date: Tue, 25 Jul 2023 15:43:28 +0800 Subject: [PATCH 2/3] Fix lint errors --- .eslintrc | 3 +- .prettierrc | 2 +- __e2e__/app.spec.js | 393 +++++++-------- __e2e__/buildTestBundle.js | 14 +- __e2e__/fixture/app.js | 20 +- __e2e__/fixture/mobx.js | 18 +- __e2e__/fixture/redux.js | 28 +- __e2e__/fixture/remotedev.js | 24 +- __e2e__/fixture/setup.js | 29 +- __e2e__/fixture/xhr-test.js | 10 +- __e2e__/mockRNServer.js | 16 +- app/actions/debugger.js | 26 +- app/actions/setting.js | 18 +- app/components/Draggable.js | 72 +-- app/components/FormInput.js | 81 ++-- app/containers/App.js | 215 +++++---- app/containers/ReactInspector.js | 149 +++--- app/containers/redux/DevTools.js | 38 +- app/containers/redux/Header.js | 42 +- app/containers/redux/Settings.js | 24 +- app/index.js | 128 ++--- app/middlewares/debuggerAPI.js | 257 +++++----- app/middlewares/reduxAPI.js | 160 +++--- app/reducers/debugger.js | 60 +-- app/reducers/index.js | 20 +- app/reducers/setting.js | 26 +- app/setup.js | 10 +- app/store/configureStore.js | 36 +- app/utils/adb.js | 14 +- app/utils/config.js | 4 +- app/utils/devMenu.js | 180 ++++--- app/utils/devtools.js | 24 +- app/worker/.eslintrc | 5 + app/worker/apollo.js | 40 +- app/worker/asyncStorage.js | 116 ++--- app/worker/devMenu.js | 35 +- app/worker/index.js | 126 ++--- app/worker/networkInspect.js | 117 ++--- app/worker/polyfills/fetch.js | 454 +++++++++--------- app/worker/reactDevTools.js | 23 +- app/worker/reduxAPI.js | 313 ++++++------ app/worker/remotedev.js | 92 ++-- app/worker/setup.js | 22 +- app/worker/utils.js | 201 ++++---- babel.config.js | 6 +- electron/config/__tests__/index.test.js | 42 +- electron/config/index.js | 28 +- electron/config/template.js | 2 +- electron/context-menu.js | 97 ++-- electron/devtools.js | 24 +- electron/extensions.js | 18 +- electron/main.js | 202 ++++---- electron/menu/common.js | 43 +- electron/menu/darwin.js | 45 +- electron/menu/dialog.js | 25 +- electron/menu/index.js | 8 +- electron/menu/linux+win.js | 45 +- electron/sync-state.js | 24 +- electron/update.js | 96 ++-- electron/url-handle/handleURL.js | 122 +++-- electron/url-handle/index.js | 8 +- electron/url-handle/port.js | 34 +- electron/window.js | 186 ++++--- examples/test-old-bridge/App.js | 13 +- examples/test-old-bridge/babel.config.js | 6 +- .../test-old-bridge/examples/redux/App.js | 20 +- .../examples/redux/app/store.js | 6 +- .../redux/features/counter/Counter.js | 28 +- .../redux/features/counter/counterAPI.js | 4 +- .../redux/features/counter/counterSlice.js | 42 +- npm-package/.eslintrc | 5 + npm-package/babel.config.js | 6 +- npm-package/bin/rndebugger-open.js | 21 +- .../injectDevToolsMiddleware.test.js | 135 +++--- npm-package/src/injectDevToolsMiddleware.js | 143 +++--- npm-package/src/main.js | 71 ++- npm-package/src/open.js | 90 ++-- package.json | 1 + scripts/mac/createDMG.js | 12 +- scripts/mac/createUniversalApp.js | 51 +- scripts/postinstall.js | 22 +- webpack/base.js | 12 +- webpack/main.prod.js | 10 +- webpack/renderer.dev.js | 12 +- webpack/renderer.prod.js | 16 +- 85 files changed, 2762 insertions(+), 2704 deletions(-) create mode 100644 app/worker/.eslintrc create mode 100644 npm-package/.eslintrc diff --git a/.eslintrc b/.eslintrc index 45e72880..e725c336 100644 --- a/.eslintrc +++ b/.eslintrc @@ -33,6 +33,7 @@ ], "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], "import/prefer-default-export": 0, - "import/no-extraneous-dependencies": ["error", { "optionalDependencies": true }] + "import/no-extraneous-dependencies": ["error", { "optionalDependencies": true }], + "semi": ["error", "never"] } } diff --git a/.prettierrc b/.prettierrc index 4d4fc7b8..30661acc 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,7 @@ { "trailingComma": "all", "tabWidth": 2, - "semi": true, + "semi": false, "singleQuote": true, "printWidth": 80 } diff --git a/__e2e__/app.spec.js b/__e2e__/app.spec.js index 3280585f..f6cc49ae 100644 --- a/__e2e__/app.spec.js +++ b/__e2e__/app.spec.js @@ -1,164 +1,168 @@ -import fs from 'fs'; -import path from 'path'; -import net from 'net'; -import http from 'http'; -import executablePath from 'electron'; -import { _electron as electron } from 'playwright-core'; -import waitForExpect from 'wait-for-expect'; -import buildTestBundle, { bundlePath } from './buildTestBundle'; -import createMockRNServer from './mockRNServer'; - -const delay = (time) => new Promise((resolve) => setTimeout(resolve, time)); - -jest.setTimeout(6e4); +import fs from 'fs' +import path from 'path' +import net from 'net' +import http from 'http' +import executablePath from 'electron' +import { _electron as electron } from 'playwright-core' +import waitForExpect from 'wait-for-expect' +import buildTestBundle, { bundlePath } from './buildTestBundle' +import createMockRNServer from './mockRNServer' + +const delay = (time) => new Promise((resolve) => { + setTimeout(resolve, time) +}) + +jest.setTimeout(6e4) describe('Application launch', () => { - let electronApp; - let mainWindow; - const logs = []; + let electronApp + let mainWindow + const logs = [] beforeAll(async () => { - await buildTestBundle(); - process.env.E2E_TEST = '1'; - process.env.PACKAGE = 'no'; + await buildTestBundle() + process.env.E2E_TEST = '1' + process.env.PACKAGE = 'no' electronApp = await electron.launch({ executablePath, args: ['--user-dir=__e2e__/tmp', './main.js'], cwd: path.join(__dirname, '../dist'), - }); - mainWindow = await electronApp.firstWindow(); - mainWindow.on('console', (msg) => logs.push(msg)); - await mainWindow.waitForLoadState(); - }); + }) + mainWindow = await electronApp.firstWindow() + mainWindow.on('console', (msg) => logs.push(msg)) + await mainWindow.waitForLoadState() + }) afterAll(async () => { - await electronApp.close(); - }); + await electronApp.close() + }) it('should show an initial window', async () => { expect(await mainWindow.title()).toBe( 'React Native Debugger - Attempting reconnection (port 8081)', - ); - }); + ) + }) it('should portfile (for debugger-open usage) always exists in home dir', async () => { const portFile = path.join( process.env.USERPROFILE || process.env.HOME, '.rndebugger_port', - ); + ) - expect(fs.existsSync(portFile)).toBe(true); - fs.unlinkSync(portFile); + expect(fs.existsSync(portFile)).toBe(true) + fs.unlinkSync(portFile) - let attempts = 10; - let expected = false; - while (attempts > 0 && !expected) { - expected = fs.existsSync(portFile); - await delay(1000); - attempts--; - } - expect(expected).toBe(true); - }); + await waitForExpect(async () => { + expect(fs.existsSync(portFile)).toBeTruthy() + }) + }) it("should contain Inspector monitor's component on Redux DevTools", async () => { - const val = await mainWindow.textContent('//div[contains(@class, "inspector-")]'); - expect(val).not.toBeNull(); - }); + const val = await mainWindow.textContent( + '//div[contains(@class, "inspector-")]', + ) + expect(val).not.toBeNull() + }) it('should contain an empty actions list on Redux DevTools', async () => { - const val = await mainWindow.textContent('//div[contains(@class, "actionListRows-")]'); - expect(val).toBe(''); - }); + const val = await mainWindow.textContent( + '//div[contains(@class, "actionListRows-")]', + ) + expect(val).toBe('') + }) it('should show waiting message on React DevTools', async () => { - const el = await mainWindow.locator('//h2[text()="Waiting for React to connect…"]'); - expect(await el.isVisible()).toBe(true); - }); - - const customRNServerPort = 8098; - const getURLFromConnection = (server) => - new Promise((resolve) => { - server.on('connection', (socket, req) => { - resolve(req.url); - }); - }); + const el = await mainWindow.locator( + '//h2[text()="Waiting for React to connect…"]', + ) + expect(await el.isVisible()).toBe(true) + }) + + const customRNServerPort = 8098 + const getURLFromConnection = (server) => new Promise((resolve) => { + server.on('connection', (socket, req) => { + resolve(req.url) + }) + }) it('should connect to fake RN server', async () => { - const { wss, server } = createMockRNServer(); + const { wss, server } = createMockRNServer() - const url = await getURLFromConnection(wss); - expect(url).toBe('/debugger-proxy?role=debugger&name=Chrome'); + const url = await getURLFromConnection(wss) + expect(url).toBe('/debugger-proxy?role=debugger&name=Chrome') await waitForExpect(async () => { expect(await mainWindow.title()).toBe( 'React Native Debugger - Waiting for client connection (port 8081)', - ); - }); - server.close(); - wss.close(); - }); + ) + }) + server.close() + wss.close() + }) it('should connect to fake RN server (port 8088) with send set-debugger-loc after', async () => { - const { wss, server } = createMockRNServer(customRNServerPort); + const { wss, server } = createMockRNServer(customRNServerPort) - const rndPath = `rndebugger://set-debugger-loc?host=localhost&port=${customRNServerPort}`; - const homeEnv = process.platform === 'win32' ? 'USERPROFILE' : 'HOME'; - const portFile = path.join(process.env[homeEnv], '.rndebugger_port'); - const rndPort = fs.readFileSync(portFile, 'utf-8'); + const rndPath = `rndebugger://set-debugger-loc?host=localhost&port=${customRNServerPort}` + const homeEnv = process.platform === 'win32' ? 'USERPROFILE' : 'HOME' + const portFile = path.join(process.env[homeEnv], '.rndebugger_port') + const rndPort = fs.readFileSync(portFile, 'utf-8') const sendSuccess = await new Promise((resolve) => { - const socket = net.createConnection({ host: '127.0.0.1', port: rndPort }, () => { - let pass; - socket.setEncoding('utf-8'); - socket.write(JSON.stringify({ path: rndPath })); - socket.on('data', (data) => { - pass = data === 'success'; - socket.end(); - }); - socket.on('end', () => resolve(pass)); - setTimeout(() => socket.end(), 1000); - }); - }); - expect(sendSuccess).toBe(true); - - const url = await getURLFromConnection(wss); - expect(url).toBe('/debugger-proxy?role=debugger&name=Chrome'); + const socket = net.createConnection( + { host: '127.0.0.1', port: rndPort }, + () => { + let pass + socket.setEncoding('utf-8') + socket.write(JSON.stringify({ path: rndPath })) + socket.on('data', (data) => { + pass = data === 'success' + socket.end() + }) + socket.on('end', () => resolve(pass)) + setTimeout(() => socket.end(), 1000) + }, + ) + }) + expect(sendSuccess).toBe(true) + + const url = await getURLFromConnection(wss) + expect(url).toBe('/debugger-proxy?role=debugger&name=Chrome') await waitForExpect(async () => { expect(await mainWindow.title()).toBe( `React Native Debugger - Waiting for client connection (port ${customRNServerPort})`, - ); - }); - server.close(); - wss.close(); - }); + ) + }) + server.close() + wss.close() + }) describe('Import fake script after', () => { - const getOneRequestHeaders = (port) => - new Promise((resolve) => { - const server = http.createServer((req, res) => { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end(''); - resolve(req.headers); - server.close(); - }); - server.listen(port); - }); - - let headersPromise; - let server; - let wss; + const getOneRequestHeaders = (port) => new Promise((resolve) => { + const server = http.createServer((req, res) => { + res.writeHead(200, { 'Content-Type': 'text/plain' }) + res.end('') + resolve(req.headers) + server.close() + }) + server.listen(port) + }) + + let headersPromise + let server + let wss beforeAll(async () => { - const info = createMockRNServer(customRNServerPort); - server = info.server; - wss = info.wss; + const info = createMockRNServer(customRNServerPort) + server = info.server + wss = info.wss - headersPromise = getOneRequestHeaders(8099); + headersPromise = getOneRequestHeaders(8099) await new Promise((resolve) => { wss.on('connection', (socket) => { socket.on('message', (message) => { - const data = JSON.parse(message); + const data = JSON.parse(message) switch (data.replyID) { case 'createJSRuntime': socket.send( @@ -168,61 +172,64 @@ describe('Application launch', () => { inject: [], url: `../../${bundlePath}`, }), - ); - break; + ) + break case 'sendFakeScript': - return resolve(); + return resolve() default: - console.error(`Unexperted id ${data.replyID}, data:`, data); + console.error(`Unexperted id ${data.replyID}, data:`, data) } - }); + }) socket.send( JSON.stringify({ id: 'createJSRuntime', method: 'prepareJSRuntime', }), - ); - }); - }); + ) + }) + }) expect(await mainWindow.title()).toBe( `React Native Debugger - Connected (port ${customRNServerPort})`, - ); - }); + ) + }) afterAll(() => { - server.close(); - wss.close(); - }); + server.close() + wss.close() + }) it('should received forbidden header names from xhr-test', async () => { - const headers = await headersPromise; + const headers = await headersPromise - expect(headers.origin).toBe('custom_origin_here'); - expect(headers['user-agent']).toBe('react-native'); - }); + expect(headers.origin).toBe('custom_origin_here') + expect(headers['user-agent']).toBe('react-native') + }) it('should have @@INIT action on Redux DevTools', async () => { - const el = await mainWindow.locator('div').filter({ hasText: '@@redux/INIT' }).first(); - expect(await el.isVisible()).toBeTruthy(); // Last store is `RemoteDev store instance 1` - }); - - let currentInstance = 'Autoselect instances'; // Default instance - const wait = () => delay(750); + const el = await mainWindow + .locator('div') + .filter({ hasText: '@@redux/INIT' }) + .first() + expect(await el.isVisible()).toBeTruthy() // Last store is `RemoteDev store instance 1` + }) + + let currentInstance = 'Autoselect instances' // Default instance + const wait = () => delay(750) const selectInstance = async (instance) => { - let el = mainWindow.locator(`//div[text()="${currentInstance}"]`); - expect(await el.isVisible()).toBeTruthy(); - await el.click({ force: true }); - await wait(); - currentInstance = instance; - el = mainWindow.locator(`//div[text()="${instance}"]`); - expect(await el.isVisible()).toBeTruthy(); - await el.click({ force: true }); - await wait(); - }; + let el = mainWindow.locator(`//div[text()="${currentInstance}"]`) + expect(await el.isVisible()).toBeTruthy() + await el.click({ force: true }) + await wait() + currentInstance = instance + el = mainWindow.locator(`//div[text()="${instance}"]`) + expect(await el.isVisible()).toBeTruthy() + await el.click({ force: true }) + await wait() + } const commit = async () => { - await mainWindow.click('//button[text()="Commit"]', { force: true }); - await wait(); - }; + await mainWindow.click('//button[text()="Commit"]', { force: true }) + await wait() + } const expectActions = { 'Redux store instance 1': { @@ -254,62 +261,72 @@ describe('Application launch', () => { expt: ['@@redux/INIT', 'TEST_PASS_FOR_REMOTEDEV_STORE_1'], notExpt: ['testPassForMobXStore2'], }, - }; + } + + const eachAsync = (entries, fn) => entries.reduce( + (promise, entry, index) => promise.then(() => fn(entry, index)), + Promise.resolve(), + ) const runExpectActions = async (name) => { - const { expt, notExpt } = expectActions[name]; - - for (const action of expt) { - const el = await mainWindow.locator('div').filter({ hasText: action }).first(); - expect(await el.isVisible()).toBeTruthy(); - } - for (const action of notExpt) { - const el = await mainWindow.locator('div').filter({ hasText: action }).first(); - expect(await el.isVisible()).toBeFalsy(); - } - }; + const { expt, notExpt } = expectActions[name] + + await eachAsync(expt, async (action) => { + const el = await mainWindow + .locator('div') + .filter({ hasText: action }) + .first() + expect(await el.isVisible()).toBeTruthy() + }) + + await eachAsync(notExpt, async (action) => { + const el = await mainWindow + .locator('div') + .filter({ hasText: action }) + .first() + expect(await el.isVisible()).toBeFalsy() + }) + } const checkInstance = async (name) => { - await selectInstance(name); - await runExpectActions(name); - await commit(); - }; + await selectInstance(name) + await runExpectActions(name) + await commit() + } it('should have two Redux store instances on Redux DevTools', async () => { - await checkInstance('Redux store instance 1'); - await checkInstance('Redux store instance 2'); - }); + await checkInstance('Redux store instance 1') + await checkInstance('Redux store instance 2') + }) it('should have two MobX store instances on Redux DevTools', async () => { - await checkInstance('MobX store instance 1'); - await checkInstance('MobX store instance 2'); - }); + await checkInstance('MobX store instance 1') + await checkInstance('MobX store instance 2') + }) it('should have one RemoteDev store instances on Redux DevTools', async () => { - await checkInstance('RemoteDev store instance 1'); - }); + await checkInstance('RemoteDev store instance 1') + }) it('should have only specific logs in console of main window', async () => { // Print renderer process logs - logs.forEach((log) => - console.log( - `Message: ${log.text()}\nType: ${log.type()}`, - ), - ); - expect(logs.length).toEqual(3); // clear + clear + warning - const [, , formDataWarning] = logs; - expect(formDataWarning.type()).toBe('warning'); + logs.forEach((log) => console.log(`Message: ${log.text()}\nType: ${log.type()}`)) + expect(logs.length).toEqual(3) // clear + clear + warning + const [, , formDataWarning] = logs + expect(formDataWarning.type()).toBe('warning') expect( - formDataWarning.text().indexOf( - "Detected you're enabled Network Inspect", - ) > 0, - ).toBeTruthy(); - }); + formDataWarning + .text() + .indexOf("Detected you're enabled Network Inspect") > 0, + ).toBeTruthy() + }) it('should show apollo devtools panel', async () => { expect( - await mainWindow.evaluate(() => window.__APOLLO_DEVTOOLS_SHOULD_DISPLAY_PANEL__), - ).toBeTruthy(); - }); - }); -}); + await mainWindow.evaluate( + () => window.__APOLLO_DEVTOOLS_SHOULD_DISPLAY_PANEL__, + ), + ).toBeTruthy() + }) + }) +}) diff --git a/__e2e__/buildTestBundle.js b/__e2e__/buildTestBundle.js index 36f8f036..c0e4510f 100644 --- a/__e2e__/buildTestBundle.js +++ b/__e2e__/buildTestBundle.js @@ -1,15 +1,15 @@ -import path from 'path'; -import webpack from 'webpack'; +import path from 'path' +import webpack from 'webpack' -const outputPath = '__e2e__/fixture'; -const filename = 'app.bundle.js'; +const outputPath = '__e2e__/fixture' +const filename = 'app.bundle.js' -export const bundlePath = path.join(outputPath, filename); +export const bundlePath = path.join(outputPath, filename) // Build a bundle for simulate RNDebugger worker run react-native bundle, // it included redux, mobx, remotedev tests export default function buildTestBundle() { - return new Promise(resolve => + return new Promise((resolve) => { webpack({ mode: 'development', entry: './__e2e__/fixture/app', @@ -21,5 +21,5 @@ export default function buildTestBundle() { mainFields: ['main', 'browser'], }, }).run(resolve) - ); + }) } diff --git a/__e2e__/fixture/app.js b/__e2e__/fixture/app.js index 1ad49700..549d2fd1 100644 --- a/__e2e__/fixture/app.js +++ b/__e2e__/fixture/app.js @@ -1,11 +1,11 @@ -import './setup'; -import runReduxTest from './redux'; -import runMobXTest from './mobx'; -import runRemoteDevTest from './remotedev'; -import runXHRTest from './xhr-test'; -import './apollo'; +import './setup' +import runReduxTest from './redux' +import runMobXTest from './mobx' +import runRemoteDevTest from './remotedev' +import runXHRTest from './xhr-test' +import './apollo' -runReduxTest(); -runMobXTest(); -runRemoteDevTest(); -runXHRTest(); +runReduxTest() +runMobXTest() +runRemoteDevTest() +runXHRTest() diff --git a/__e2e__/fixture/mobx.js b/__e2e__/fixture/mobx.js index 5912e186..2ee67608 100644 --- a/__e2e__/fixture/mobx.js +++ b/__e2e__/fixture/mobx.js @@ -1,17 +1,17 @@ /* eslint prefer-arrow-callback: 0 */ -import { observable, action, useStrict } from 'mobx'; -import remotedev from 'mobx-remotedev/lib/dev'; +import { observable, action, useStrict } from 'mobx' +import remotedev from 'mobx-remotedev/lib/dev' -useStrict(true); +useStrict(true) export default function run() { - const store = observable({ value: 0 }); - store.testPassForMobXStore1 = action(function testPassForMobXStore1() {}); + const store = observable({ value: 0 }) + store.testPassForMobXStore1 = action(function testPassForMobXStore1() {}) - remotedev(store, { name: 'MobX store instance 1' }).testPassForMobXStore1(); + remotedev(store, { name: 'MobX store instance 1' }).testPassForMobXStore1() - const store2 = observable({ value: 1 }); - store2.testPassForMobXStore2 = action(function testPassForMobXStore2() {}); + const store2 = observable({ value: 1 }) + store2.testPassForMobXStore2 = action(function testPassForMobXStore2() {}) - remotedev(store2, { name: 'MobX store instance 2' }).testPassForMobXStore2(); + remotedev(store2, { name: 'MobX store instance 2' }).testPassForMobXStore2() } diff --git a/__e2e__/fixture/redux.js b/__e2e__/fixture/redux.js index f2f90de0..12739750 100644 --- a/__e2e__/fixture/redux.js +++ b/__e2e__/fixture/redux.js @@ -1,35 +1,35 @@ /* eslint no-underscore-dangle: 0 */ -import { createStore } from 'redux'; +import { createStore } from 'redux' export default function run() { // Enhancer const store1 = createStore( - state => state, + (state) => state, { value: 0 }, window.__REDUX_DEVTOOLS_EXTENSION__({ name: 'Redux store instance 1', actionsWhitelist: ['@@INIT', 'TEST_PASS_FOR_REDUX_STORE_1', '^SHOW_FOR_REDUX_STORE_1$'], - }) - ); + }), + ) // Compose enhancers const store2 = createStore( - state => state, + (state) => state, { value: 1 }, window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ name: 'Redux store instance 2', actionsBlacklist: ['NOT_SHOW_1_FOR_REDUX_STORE_2', 'NOT_SHOW_2_FOR_REDUX_STORE_2'], predicate: (state, action) => action.type !== 'NOT_SHOW_3_FOR_REDUX_STORE_2', - })(/* No enhancers */) - ); + })(/* No enhancers */), + ) - store1.dispatch({ type: 'TEST_PASS_FOR_REDUX_STORE_1' }); - store1.dispatch({ type: 'SHOW_FOR_REDUX_STORE_1' }); - store1.dispatch({ type: 'NOT_SHOW_FOR_REDUX_STORE_1' }); + store1.dispatch({ type: 'TEST_PASS_FOR_REDUX_STORE_1' }) + store1.dispatch({ type: 'SHOW_FOR_REDUX_STORE_1' }) + store1.dispatch({ type: 'NOT_SHOW_FOR_REDUX_STORE_1' }) - store2.dispatch({ type: 'TEST_PASS_FOR_REDUX_STORE_2' }); - store2.dispatch({ type: 'NOT_SHOW_1_FOR_REDUX_STORE_2' }); - store2.dispatch({ type: 'NOT_SHOW_2_FOR_REDUX_STORE_2' }); - store2.dispatch({ type: 'NOT_SHOW_3_FOR_REDUX_STORE_2' }); + store2.dispatch({ type: 'TEST_PASS_FOR_REDUX_STORE_2' }) + store2.dispatch({ type: 'NOT_SHOW_1_FOR_REDUX_STORE_2' }) + store2.dispatch({ type: 'NOT_SHOW_2_FOR_REDUX_STORE_2' }) + store2.dispatch({ type: 'NOT_SHOW_3_FOR_REDUX_STORE_2' }) } diff --git a/__e2e__/fixture/remotedev.js b/__e2e__/fixture/remotedev.js index d0205285..a2881106 100644 --- a/__e2e__/fixture/remotedev.js +++ b/__e2e__/fixture/remotedev.js @@ -1,25 +1,25 @@ -import { createStore } from 'redux'; +import { createStore } from 'redux' -const connectViaExtension = window.devToolsExtension.connect; +const connectViaExtension = window.devToolsExtension.connect -const logReducer = reducer => { +const logReducer = (reducer) => { const remotedev = connectViaExtension({ name: 'RemoteDev store instance 1', actionCreators: { test: () => {}, }, - }); + }) return (state, action) => { - const reducedState = reducer(state, action); - remotedev.send(action, reducedState); - return reducedState; - }; -}; + const reducedState = reducer(state, action) + remotedev.send(action, reducedState) + return reducedState + } +} -const logRemotely = next => (reducer, initialState) => next(logReducer(reducer), initialState); +const logRemotely = (next) => (reducer, initialState) => next(logReducer(reducer), initialState) export default function run() { - const store = logRemotely(createStore)(state => state, { value: 0 }); + const store = logRemotely(createStore)((state) => state, { value: 0 }) - store.dispatch({ type: 'TEST_PASS_FOR_REMOTEDEV_STORE_1' }); + store.dispatch({ type: 'TEST_PASS_FOR_REMOTEDEV_STORE_1' }) } diff --git a/__e2e__/fixture/setup.js b/__e2e__/fixture/setup.js index 03971866..ec11c56d 100644 --- a/__e2e__/fixture/setup.js +++ b/__e2e__/fixture/setup.js @@ -1,13 +1,14 @@ +/* eslint-disable no-restricted-globals */ /* eslint no-underscore-dangle: 0 */ -self.window = global; +self.window = global // Remove native fetch as react-native use whatwg-fetch polyfill -self.fetch = undefined; +self.fetch = undefined -const MessageQueue = function MessageQueue() {}; -MessageQueue.spy = () => {}; -MessageQueue.prototype.__spy = null; +const MessageQueue = function MessageQueue() {} +MessageQueue.spy = () => {} +MessageQueue.prototype.__spy = null const requiredModules = { NativeModules: {}, @@ -15,17 +16,17 @@ const requiredModules = { setupDevtools: undefined, AsyncStorage: {}, MessageQueue, -}; +} // Simulate React Native's window.require polyfill -window.require = moduleName => { +window.require = (moduleName) => { if (typeof moduleName !== 'number') { // From https://github.com/facebook/react-native/blob/5403946f098cc72c3d33ea5cee263fb3dd03891d/packager/src/Resolver/polyfills/require.js#L97 console.warn( - `Requiring module '${moduleName}' by name is only supported for ` + - 'debugging purposes and will BREAK IN PRODUCTION!' - ); + `Requiring module '${moduleName}' by name is only supported for ` + + 'debugging purposes and will BREAK IN PRODUCTION!', + ) } - return requiredModules[moduleName]; -}; -window.__DEV__ = true; -window.__fbBatchedBridge = new MessageQueue(); + return requiredModules[moduleName] +} +window.__DEV__ = true +window.__fbBatchedBridge = new MessageQueue() diff --git a/__e2e__/fixture/xhr-test.js b/__e2e__/fixture/xhr-test.js index 9250a827..f11327e4 100644 --- a/__e2e__/fixture/xhr-test.js +++ b/__e2e__/fixture/xhr-test.js @@ -1,4 +1,4 @@ -import 'whatwg-fetch'; +import 'whatwg-fetch' export default function run() { // Fetch with forbidden header names @@ -7,11 +7,11 @@ export default function run() { Origin: 'custom_origin_here', 'User-Agent': 'react-native', }, - }); + }) // It will log warning // because we can't use worker's FormData for upload file - const data = { uri: 'uri' }; - const form = new FormData(); - form.append('file', data); + const data = { uri: 'uri' } + const form = new FormData() + form.append('file', data) } diff --git a/__e2e__/mockRNServer.js b/__e2e__/mockRNServer.js index afc368e4..a9fd5c8c 100644 --- a/__e2e__/mockRNServer.js +++ b/__e2e__/mockRNServer.js @@ -1,14 +1,14 @@ -import http from 'http'; -import WebSocket from 'ws'; +import http from 'http' +import WebSocket from 'ws' export default function createMockRNServer(port = 8081) { const server = http.createServer((req, res) => { if (req.method === 'GET' && req.url === '/debugger-ui') { - res.writeHead(200, { 'Content-Type': 'text/html' }); - res.end(''); + res.writeHead(200, { 'Content-Type': 'text/html' }) + res.end('') } - }); - const wss = new WebSocket.Server({ server }); - server.listen(port); - return { server, wss }; + }) + const wss = new WebSocket.Server({ server }) + server.listen(port) + return { server, wss } } diff --git a/app/actions/debugger.js b/app/actions/debugger.js index d754e820..e2cece00 100644 --- a/app/actions/debugger.js +++ b/app/actions/debugger.js @@ -1,30 +1,30 @@ -export const SET_DEBUGGER_LOCATION = 'SET_DEBUGGER_LOCATION'; -export const SET_DEBUGGER_STATUS = 'SET_DEBUGGER_STATUS'; -export const SET_DEBUGGER_WORKER = 'SET_DEBUGGER_WORKER'; -export const SYNC_STATE = 'SYNC_STATE'; -export const BEFORE_WINDOW_CLOSE = 'BEFORE_WINDOW_CLOSE'; +export const SET_DEBUGGER_LOCATION = 'SET_DEBUGGER_LOCATION' +export const SET_DEBUGGER_STATUS = 'SET_DEBUGGER_STATUS' +export const SET_DEBUGGER_WORKER = 'SET_DEBUGGER_WORKER' +export const SYNC_STATE = 'SYNC_STATE' +export const BEFORE_WINDOW_CLOSE = 'BEFORE_WINDOW_CLOSE' -export const setDebuggerLocation = loc => ({ +export const setDebuggerLocation = (loc) => ({ type: SET_DEBUGGER_LOCATION, loc, -}); +}) -export const setDebuggerStatus = status => ({ +export const setDebuggerStatus = (status) => ({ type: SET_DEBUGGER_STATUS, status, -}); +}) export const setDebuggerWorker = (worker, status) => ({ type: SET_DEBUGGER_WORKER, worker, status, -}); +}) -export const syncState = payload => ({ +export const syncState = (payload) => ({ type: SYNC_STATE, payload, -}); +}) export const beforeWindowClose = () => ({ type: BEFORE_WINDOW_CLOSE, -}); +}) diff --git a/app/actions/setting.js b/app/actions/setting.js index 7a284244..22c707a5 100644 --- a/app/actions/setting.js +++ b/app/actions/setting.js @@ -1,18 +1,18 @@ -export const TOGGLE_DEVTOOLS = 'TOGGLE_DEVTOOLS'; -export const RESIZE_DEVTOOLS = 'RESIZE_DEVTOOLS'; -export const CHANGE_DEFAULT_THEME = 'CHANGE_DEFAULT_THEME'; +export const TOGGLE_DEVTOOLS = 'TOGGLE_DEVTOOLS' +export const RESIZE_DEVTOOLS = 'RESIZE_DEVTOOLS' +export const CHANGE_DEFAULT_THEME = 'CHANGE_DEFAULT_THEME' -export const toggleDevTools = name => ({ +export const toggleDevTools = (name) => ({ type: TOGGLE_DEVTOOLS, name, -}); +}) -export const resizeDevTools = size => ({ +export const resizeDevTools = (size) => ({ type: RESIZE_DEVTOOLS, size, -}); +}) -export const changeDefaultTheme = themeName => ({ +export const changeDefaultTheme = (themeName) => ({ type: CHANGE_DEFAULT_THEME, themeName, -}); +}) diff --git a/app/components/Draggable.js b/app/components/Draggable.js index 47e7a386..d4e01c04 100644 --- a/app/components/Draggable.js +++ b/app/components/Draggable.js @@ -1,5 +1,5 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' const styles = { draggable: { @@ -10,39 +10,51 @@ const styles = { margin: '-3px 0', width: '100%', }, -}; +} export default class Draggable extends PureComponent { - static propTypes = { - onStart: PropTypes.func, - onMove: PropTypes.func.isRequired, - onStop: PropTypes.func, - }; - - onMove = evt => { - evt.preventDefault(); - this.props.onMove(evt.pageX, evt.pageY); - }; + onMove = (evt) => { + evt.preventDefault() + const { onMove } = this.props + onMove?.(evt.pageX, evt.pageY) + } - onUp = evt => { - evt.preventDefault(); - document.removeEventListener('mousemove', this.onMove); - document.removeEventListener('mouseup', this.onUp); - if (this.props.onStop) { - this.props.onStop(); - } - }; + onUp = (evt) => { + evt.preventDefault() + document.removeEventListener('mousemove', this.onMove) + document.removeEventListener('mouseup', this.onUp) + const { onStop } = this.props + onStop?.() + } - startDragging = evt => { - evt.preventDefault(); - document.addEventListener('mousemove', this.onMove); - document.addEventListener('mouseup', this.onUp); - if (this.props.onStart) { - this.props.onStart(); - } - }; + startDragging = (evt) => { + evt.preventDefault() + document.addEventListener('mousemove', this.onMove) + document.addEventListener('mouseup', this.onUp) + const { onStart } = this.props + onStart?.() + } render() { - return
; + return ( +
+ ) } } + +Draggable.propTypes = { + onStart: PropTypes.func, + onMove: PropTypes.func.isRequired, + onStop: PropTypes.func, +} + +Draggable.defaultProps = { + onStart: undefined, + onStop: undefined, +} diff --git a/app/components/FormInput.js b/app/components/FormInput.js index e8b1d36f..bd21fbc5 100644 --- a/app/components/FormInput.js +++ b/app/components/FormInput.js @@ -1,5 +1,5 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' const styles = { form: { @@ -24,64 +24,69 @@ const styles = { border: 0, borderRadius: 2, }, -}; +} export default class FormInput extends PureComponent { - static propTypes = { - title: PropTypes.string, - inputProps: PropTypes.object, - button: PropTypes.string, - onInputChange: PropTypes.func, - onSubmit: PropTypes.func.isRequired, - }; - - static defaultValue = { - button: 'Confirm', - inputProps: { - type: 'input', - }, - }; - constructor(props) { - super(props); - this.state = { value: undefined }; + super(props) + this.state = { value: undefined } } - handleOnChange = evt => { - const { onInputChange } = this.props; - let { value } = evt.target; + handleOnChange = (evt) => { + const { onInputChange } = this.props + let { value } = evt.target if (onInputChange) { - value = onInputChange(value); + value = onInputChange(value) } - this.setState({ value }); - }; - handleOnClick = evt => this.props.onSubmit(evt, this.state.value || this.props.inputProps.value); + this.setState({ value }) + } + + handleClick = (evt) => { + const { inputProps, onSubmit } = this.props + const { value } = this.state + onSubmit(evt, value || inputProps.value) + } render() { - const { title, inputProps, button } = this.props; - const { value } = this.state; - const val = typeof value !== 'undefined' ? value : inputProps.value; + const { title, inputProps, button } = this.props + const { value } = this.state + const val = typeof value !== 'undefined' ? value : inputProps.value return (
{title}
{ - // Enter/Return key pressed - if (e.keyCode === 13) { - this.handleOnClick(); - } + onKeyDown={(e) => { + // Enter/Return key pressed + if (e.key === 'Enter') this.handleClick() }} - {...inputProps} + type={inputProps.type} value={val} style={styles.input} onChange={this.handleOnChange} /> -
- ); + ) } } + +FormInput.propTypes = { + title: PropTypes.string.isRequired, + inputProps: PropTypes.shape({ + type: PropTypes.string, + value: PropTypes.string, + }), + button: PropTypes.string, + onInputChange: PropTypes.func, + onSubmit: PropTypes.func.isRequired, +} + +FormInput.defaultProps = { + inputProps: { type: 'input' }, + button: 'Confirm', + onInputChange: null, +} diff --git a/app/containers/App.js b/app/containers/App.js index caed0f96..224492c0 100644 --- a/app/containers/App.js +++ b/app/containers/App.js @@ -1,18 +1,18 @@ -import { ipcRenderer } from 'electron'; -import { getCurrentWindow } from '@electron/remote'; -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { bindActionCreators } from 'redux'; -import { connect } from 'react-redux'; -import * as debuggerActions from '../actions/debugger'; -import * as settingActions from '../actions/setting'; -import ReduxDevTools from './redux/DevTools'; -import ReactInspector from './ReactInspector'; -import FormInput from '../components/FormInput'; -import Draggable from '../components/Draggable'; -import { catchConsoleLogLink } from '../../electron/devtools'; - -const currentWindow = getCurrentWindow(); +import { ipcRenderer } from 'electron' +import { getCurrentWindow } from '@electron/remote' +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' +import * as debuggerActionCreators from '../actions/debugger' +import * as settingActionCreators from '../actions/setting' +import ReduxDevTools from './redux/DevTools' +import ReactInspector from './ReactInspector' +import FormInput from '../components/FormInput' +import Draggable from '../components/Draggable' +import { catchConsoleLogLink } from '../../electron/devtools' + +const currentWindow = getCurrentWindow() const styles = { container: { @@ -40,127 +40,128 @@ const styles = { borderRadius: '4px', letterSpacing: '3px', }, -}; +} -const shortcutPrefix = process.platform === 'darwin' ? '⌥⌘' : 'Ctrl+Alt+'; +const shortcutPrefix = process.platform === 'darwin' ? '⌥⌘' : 'Ctrl+Alt+' -class App extends Component { - static propTypes = { - setting: PropTypes.object.isRequired, - debugger: PropTypes.object.isRequired, - actions: PropTypes.object.isRequired, - }; +const background = ( +
+
+ {`${shortcutPrefix}K`} + {' to toggle Redux DevTools'} +
+
+ {`${shortcutPrefix}J`} + {' to toggle React DevTools'} +
+
+) + +const removeAllIPCListeners = () => { + ipcRenderer.removeAllListeners('toggle-devtools') + ipcRenderer.removeAllListeners('set-debugger-loc') + ipcRenderer.removeAllListeners('sync-state') +} +class App extends Component { componentDidMount() { - const { toggleDevTools } = this.props.actions.setting; - ipcRenderer.on('toggle-devtools', (e, name) => toggleDevTools(name)); - ipcRenderer.on('sync-state', (event, arg) => this.props.actions.debugger.syncState(arg)); + const { settingActions, debuggerActions } = this.props + ipcRenderer.on('toggle-devtools', (e, name) => settingActions.toggleDevTools(name)) + ipcRenderer.on('sync-state', (event, arg) => debuggerActions.syncState(arg)) ipcRenderer.on('set-debugger-loc', (e, payload) => { - const location = JSON.parse(payload); - this.setDebuggerLocation(location); - catchConsoleLogLink(currentWindow, location.host || 'localhost', location.port); - }); - if (!this.props.debugger.isPortSettingRequired) { - this.setDebuggerLocation(JSON.parse(process.env.DEBUGGER_SETTING || '{}')); + const location = JSON.parse(payload) + this.setDebuggerLocation(location) + catchConsoleLogLink(currentWindow, location.host || 'localhost', location.port) + }) + const { debuggerState } = this.props + if (!debuggerState.isPortSettingRequired) { + this.setDebuggerLocation(JSON.parse(process.env.DEBUGGER_SETTING || '{}')) } - window.onbeforeunload = this.removeAllListeners; - window.notifyDevToolsThemeChange = this.props.actions.setting.changeDefaultTheme; + window.onbeforeunload = removeAllIPCListeners + window.notifyDevToolsThemeChange = settingActions.changeDefaultTheme } componentWillUnmount() { - this.removeAllListeners(); - window.notifyDevToolsThemeChange = null; + removeAllIPCListeners() + window.notifyDevToolsThemeChange = null } - onResize = (x, y) => this.props.actions.setting.resizeDevTools(y / window.innerHeight); + onResize = (x, y) => { + const { settingActions } = this.props + settingActions.resizeDevTools(y / window.innerHeight) + } setDebuggerLocation({ projectRoots, ...location }) { - this.props.actions.debugger.setDebuggerLocation(location); + const { debuggerActions } = this.props + debuggerActions.setDebuggerLocation(location) if (projectRoots) { - ReactInspector.setProjectRoots(projectRoots); + ReactInspector.setProjectRoots(projectRoots) } } getReactBackgroundColor = () => { - const { themeName } = this.props.setting; + const { settingState } = this.props + const { themeName } = settingState switch (themeName) { case 'dark': - return '#242424'; + return '#242424' case 'default': - return 'white'; + return 'white' default: - return 'transparent'; + return 'transparent' } - }; + } - getLayoutStyle = size => ({ + getLayoutStyle = (size) => ({ width: '100%', height: `${size * 100}%`, display: size ? 'inline-block' : 'none', backgroundColor: this.getReactBackgroundColor(), - }); + }) getDevToolsSize() { - const { redux, react, size } = this.props.setting; + const { settingState } = this.props + const { redux, react, size } = settingState if (!redux || !react) { return { redux: redux ? 1 : 0, react: react ? 1 : 0, - }; + } } - return { redux: size, react: 1 - size }; + return { redux: size, react: 1 - size } } - removeAllListeners() { - ipcRenderer.removeAllListeners('toggle-devtools'); - ipcRenderer.removeAllListeners('set-debugger-loc'); - ipcRenderer.removeAllListeners('sync-state'); - } - - background = ( -
-
- {`${shortcutPrefix}K`} - {' to toggle Redux DevTools'} -
-
- {`${shortcutPrefix}J`} - {' to toggle React DevTools'} -
-
- ); - handlePortOnSubmit = (evt, port) => { ipcRenderer.once('check-port-available-reply', (event, available) => { if (!available) { - alert(`The port ${port} is already used by another window.`); - return; + window.alert(`The port ${port} is already used by another window.`) + return } - const { setDebuggerLocation } = this.props.actions.debugger; - setDebuggerLocation({ + const { debuggerActions } = this.props + debuggerActions.setDebuggerLocation({ ...JSON.parse(process.env.DEBUGGER_SETTING || '{}'), port, - }); - currentWindow.openDevTools(); - }); - ipcRenderer.send('check-port-available', port); - }; + }) + currentWindow.openDevTools() + }) + ipcRenderer.send('check-port-available', port) + } renderPortSetting() { return (
Number(value.replace(/\D/g, '').substr(0, 5)) || ''} + onInputChange={(value) => Number(value.replace(/\D/g, '').substr(0, 5)) || ''} onSubmit={this.handlePortOnSubmit} />
- ); + ) } renderReduxDevTools(size) { @@ -169,7 +170,7 @@ class App extends Component {
- ); + ) } renderReactInspector(size) { @@ -177,34 +178,54 @@ class App extends Component {
- ); + ) } render() { - const { isPortSettingRequired } = this.props.debugger; + const { debuggerState } = this.props + const { isPortSettingRequired } = debuggerState if (isPortSettingRequired) { - return this.renderPortSetting(); + return this.renderPortSetting() } - const { redux, react } = this.getDevToolsSize(); + const { redux, react } = this.getDevToolsSize() return (
{this.renderReduxDevTools(redux)} {this.renderReactInspector(react)} - {!react && !redux && this.background} + {!react && !redux && background}
- ); + ) } } +App.propTypes = { + settingState: PropTypes.shape({ + redux: PropTypes.bool.isRequired, + react: PropTypes.bool.isRequired, + size: PropTypes.number.isRequired, + themeName: PropTypes.string.isRequired, + }).isRequired, + settingActions: PropTypes.shape({ + toggleDevTools: PropTypes.func.isRequired, + resizeDevTools: PropTypes.func.isRequired, + changeDefaultTheme: PropTypes.func.isRequired, + }).isRequired, + debuggerState: PropTypes.shape({ + isPortSettingRequired: PropTypes.bool.isRequired, + }).isRequired, + debuggerActions: PropTypes.shape({ + setDebuggerLocation: PropTypes.func.isRequired, + syncState: PropTypes.func.isRequired, + }).isRequired, +} + export default connect( - state => ({ - debugger: state.debugger, - setting: state.setting, + (state) => ({ + debuggerState: state.debugger, + settingState: state.setting, }), - dispatch => ({ - actions: { - debugger: bindActionCreators(debuggerActions, dispatch), - setting: bindActionCreators(settingActions, dispatch), - }, - }) -)(App); + (dispatch) => ({ + debuggerActions: bindActionCreators(debuggerActionCreators, dispatch), + settingActions: bindActionCreators(settingActionCreators, dispatch), + }), +)(App) diff --git a/app/containers/ReactInspector.js b/app/containers/ReactInspector.js index 46400b5f..5478f7aa 100644 --- a/app/containers/ReactInspector.js +++ b/app/containers/ReactInspector.js @@ -1,20 +1,17 @@ -/* eslint import/no-extraneous-dependencies: 0 import/no-unresolved: 0 */ +import { connect } from 'react-redux' +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import { tryADBReverse } from '../utils/adb' -import { connect } from 'react-redux'; -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { shell } from 'electron'; -import { tryADBReverse } from '../utils/adb'; - -let ReactServer; +let ReactServer const getReactInspector = () => { - if (ReactServer) return ReactServer; + if (ReactServer) return ReactServer // eslint-disable-next-line ReactServer = ReactServer || require('react-devtools-core/standalone').default; - return ReactServer; -}; -const containerId = 'react-devtools-container'; + return ReactServer +} +const containerId = 'react-devtools-container' const styles = { container: { @@ -37,127 +34,125 @@ const styles = { right: 0, bottom: 0, }, -}; +} -const isReactPanelOpen = props => props.setting.react; +const isReactPanelOpen = (props) => props.settingState.react class ReactInspector extends Component { - static propTypes = { - debugger: PropTypes.object, - setting: PropTypes.object, - }; - static setProjectRoots(projectRoots) { - getReactInspector().setProjectRoots(projectRoots); + getReactInspector().setProjectRoots(projectRoots) } + listeningPort = window.reactDevToolsPort + componentDidMount() { - const { worker } = this.props.debugger; + const { debuggerState } = this.props + const { worker } = debuggerState if (worker) { - this.server = this.startServer(); - worker.addEventListener('message', this.workerOnMessage); + this.server = this.startServer() + worker.addEventListener('message', this.workerOnMessage) } } - componentWillReceiveProps(nextProps) { - const { worker } = this.props.debugger; - const { worker: nextWorker } = nextProps.debugger; + UNSAFE_componentWillReceiveProps(nextProps) { + const { debuggerState } = this.props + const { worker } = debuggerState + const { worker: nextWorker } = nextProps.debuggerState if (nextWorker && nextWorker !== worker) { - this.closeServerIfExists(); + this.closeServerIfExists() if (isReactPanelOpen(this.props)) { - this.server = this.startServer(); + this.server = this.startServer() } - nextWorker.addEventListener('message', this.workerOnMessage); + nextWorker.addEventListener('message', this.workerOnMessage) } else if (!nextWorker) { - this.closeServerIfExists(); + this.closeServerIfExists() } // Open / Close server when react panel opened / hidden - if (!worker && !nextWorker) return; + if (!worker && !nextWorker) return if (isReactPanelOpen(this.props) && !isReactPanelOpen(nextProps)) { - this.closeServerIfExists(); + this.closeServerIfExists() } else if (!isReactPanelOpen(this.props) && isReactPanelOpen(nextProps)) { - this.closeServerIfExists(); - this.server = this.startServer(); + this.closeServerIfExists() + this.server = this.startServer() } } shouldComponentUpdate() { - return false; + return false } componentWillUnmount() { - this.closeServerIfExists(); + this.closeServerIfExists() } - listeningPort = window.reactDevToolsPort; + workerOnMessage = (message) => { + const { data } = message + if (!data || !data.__REPORT_REACT_DEVTOOLS_PORT__) return - workerOnMessage = message => { - const { data } = message; - if (!data || !data.__REPORT_REACT_DEVTOOLS_PORT__) return; - - const port = Number(data.__REPORT_REACT_DEVTOOLS_PORT__); - const platform = data.platform; + const port = Number(data.__REPORT_REACT_DEVTOOLS_PORT__) + const { platform } = data if (port && port !== this.listeningPort) { - this.listeningPort = port; - this.closeServerIfExists(); + this.listeningPort = port + this.closeServerIfExists() if (isReactPanelOpen(this.props)) { - this.server = this.startServer(port); + this.server = this.startServer(port) } - if (platform === 'android') tryADBReverse(port).catch(() => {}); + if (platform === 'android') tryADBReverse(port).catch(() => {}) + } + } + + closeServerIfExists = () => { + if (this.server) { + this.server.close() + this.server = null } - }; + } startServer(port = this.listeningPort) { - let loggedWarn = false; + let loggedWarn = false return getReactInspector() - .setStatusListener(status => { + .setStatusListener((status) => { if (!loggedWarn && status === 'Failed to start the server.') { - const message = - port !== 8097 - ? 're-open the debugger window might be helpful.' - : 'we recommended to upgrade React Native version to 0.39+ for random port support.'; + const message = port !== 8097 + ? 're-open the debugger window might be helpful.' + : 'we recommended to upgrade React Native version to 0.39+ for random port support.' console.error( '[RNDebugger]', `Failed to start React DevTools server with port \`${port}\`,`, 'because another server is listening,', - message - ); - loggedWarn = true; + message, + ) + loggedWarn = true } }) .setContentDOMNode(document.getElementById(containerId)) - .startServer(port); + .startServer(port) } - closeServerIfExists = () => { - if (this.server) { - this.server.close(); - this.server = null; - } - }; - - handleDocLinkClick = () => - shell.openExternal( - 'https://github.com/jhen0409/react-native-debugger/blob/master/docs/react-devtools-integration.md#how-to-use-it-with-real-device' - ); - render() { return (
-

{'Waiting for React to connect…'}

+

Waiting for React to connect…

- ); + ) } } +ReactInspector.propTypes = { + debuggerState: PropTypes.shape({ + worker: PropTypes.shape({ + addEventListener: PropTypes.func.isRequired, + }), + }).isRequired, +} export default connect( - state => ({ - debugger: state.debugger, - setting: state.setting, + (state) => ({ + settingState: state.setting, + debuggerState: state.debugger, }), - dispatch => ({ dispatch }) -)(ReactInspector); + (dispatch) => ({ dispatch }), +)(ReactInspector) diff --git a/app/containers/redux/DevTools.js b/app/containers/redux/DevTools.js index 25ad9d2a..ae37e542 100644 --- a/app/containers/redux/DevTools.js +++ b/app/containers/redux/DevTools.js @@ -1,25 +1,25 @@ -import React from 'react'; -import { useSelector, useDispatch } from 'react-redux'; -import { Container, Notification } from '@redux-devtools/ui'; -import { clearNotification } from '@redux-devtools/app/lib/esm/actions'; -import Actions from '@redux-devtools/app/lib/esm/containers/Actions'; -import Settings from './Settings'; -import Header from './Header'; +import React from 'react' +import { useSelector, useDispatch } from 'react-redux' +import { Container, Notification } from '@redux-devtools/ui' +import { clearNotification } from '@redux-devtools/app/lib/esm/actions' +import Actions from '@redux-devtools/app/lib/esm/containers/Actions' +import Settings from './Settings' +import Header from './Header' -const App = () => { - const section = useSelector(state => state.section); - const theme = useSelector(state => state.theme); - const notification = useSelector(state => state.notification); +function App() { + const section = useSelector((state) => state.section) + const theme = useSelector((state) => state.theme) + const notification = useSelector((state) => state.notification) - const dispatch = useDispatch(); + const dispatch = useDispatch() - let body; + let body switch (section) { case 'Settings': - body = ; - break; + body = + break default: - body = ; + body = } return ( @@ -35,7 +35,7 @@ const App = () => { )} - ); -}; + ) +} -export default App; +export default App diff --git a/app/containers/redux/Header.js b/app/containers/redux/Header.js index 1be5e8a7..1dcab1a2 100644 --- a/app/containers/redux/Header.js +++ b/app/containers/redux/Header.js @@ -1,11 +1,13 @@ -import React, { useCallback } from 'react'; -import PropTypes from 'prop-types'; -import { useDispatch } from 'react-redux'; -import { Tabs, Toolbar, Button, Divider } from '@redux-devtools/ui'; -import { GoBook } from 'react-icons/go'; -import styled from 'styled-components'; -import { changeSection } from '@redux-devtools/app/lib/esm/actions'; -import { shell } from 'electron'; +import React, { useCallback } from 'react' +import PropTypes from 'prop-types' +import { useDispatch } from 'react-redux' +import { + Tabs, Toolbar, Button, Divider, +} from '@redux-devtools/ui' +import { GoBook } from 'react-icons/go' +import styled from 'styled-components' +import { changeSection } from '@redux-devtools/app/lib/esm/actions' +import { shell } from 'electron' const WindowDraggable = styled.div` display: flex; @@ -13,21 +15,21 @@ const WindowDraggable = styled.div` height: 100%; -webkit-app-region: drag; -webkit-user-select: none; -`; +` -const tabs = [{ name: 'Actions' }, { name: 'Settings' }]; +const tabs = [{ name: 'Actions' }, { name: 'Settings' }] -const Header = (props) => { - const { section } = props; +function Header(props) { + const { section } = props - const dispatch = useDispatch(); + const dispatch = useDispatch() const handleChangeSection = useCallback( (sec) => dispatch(changeSection(sec)), [dispatch, changeSection], - ); + ) - const openHelp = useCallback(() => shell.openExternal('https://goo.gl/SHU4yL'), []); + const openHelp = useCallback(() => shell.openExternal('https://goo.gl/SHU4yL'), []) return ( @@ -49,11 +51,11 @@ const Header = (props) => { - ); -}; + ) +} Header.propTypes = { - section: PropTypes.string, -}; + section: PropTypes.string.isRequired, +} -export default Header; +export default Header diff --git a/app/containers/redux/Settings.js b/app/containers/redux/Settings.js index 9098d6e6..0fb480ab 100644 --- a/app/containers/redux/Settings.js +++ b/app/containers/redux/Settings.js @@ -1,26 +1,30 @@ /* eslint-disable import/no-named-as-default */ -import React, { Component } from 'react'; -import Tabs from '@redux-devtools/ui/lib/esm/Tabs/Tabs'; -import Themes from '@redux-devtools/app/lib/esm/components/Settings/Themes'; +import React, { Component } from 'react' +import Tabs from '@redux-devtools/ui/lib/esm/Tabs/Tabs' +import Themes from '@redux-devtools/app/lib/esm/components/Settings/Themes' export default class Settings extends Component { - state = { selected: 'Themes' }; - tabs = [ { name: 'Themes', component: Themes }, - ]; + ] + + constructor(props) { + super(props) + this.state = { selected: 'Themes' } + } handleSelect = (selected) => { - this.setState({ selected }); - }; + this.setState({ selected }) + } render() { + const { selected } = this.state return ( - ); + ) } } diff --git a/app/index.js b/app/index.js index 85e41a79..70ca391e 100644 --- a/app/index.js +++ b/app/index.js @@ -1,97 +1,101 @@ -import { findAPortNotInUse } from 'portscanner'; -import { webFrame } from 'electron'; -import { getCurrentWindow } from '@electron/remote'; -import React from 'react'; -import { render } from 'react-dom'; -import { Provider } from 'react-redux'; -import launchEditor from 'react-dev-utils/launchEditor'; -import { PersistGate } from 'redux-persist/integration/react'; -import './setup'; -import App from './containers/App'; -import configureStore from './store/configureStore'; -import { beforeWindowClose } from './actions/debugger'; -import { invokeDevMethod } from './utils/devMenu'; -import { client, tryADBReverse } from './utils/adb'; -import config from './utils/config'; -import { toggleOpenInEditor, isOpenInEditorEnabled } from './utils/devtools'; +import { findAPortNotInUse } from 'portscanner' +import { webFrame } from 'electron' +import { getCurrentWindow } from '@electron/remote' +import React from 'react' +import { createRoot } from 'react-dom/client' +import { Provider } from 'react-redux' +import launchEditor from 'react-dev-utils/launchEditor' +import { PersistGate } from 'redux-persist/integration/react' +import './setup' +import App from './containers/App' +import configureStore from './store/configureStore' +import { beforeWindowClose } from './actions/debugger' +import { invokeDevMethod } from './utils/devMenu' +import { client, tryADBReverse } from './utils/adb' +import config from './utils/config' +import { toggleOpenInEditor, isOpenInEditorEnabled } from './utils/devtools' -const currentWindow = getCurrentWindow(); +const currentWindow = getCurrentWindow() -webFrame.setZoomFactor(1); -webFrame.setVisualZoomLevelLimits(1, 1); +webFrame.setZoomFactor(1) +webFrame.setVisualZoomLevelLimits(1, 1) // Prevent dropped file -document.addEventListener('drop', e => { - e.preventDefault(); - e.stopPropagation(); -}); -document.addEventListener('dragover', e => { - e.preventDefault(); - e.stopPropagation(); -}); +document.addEventListener('drop', (e) => { + e.preventDefault() + e.stopPropagation() +}) +document.addEventListener('dragover', (e) => { + e.preventDefault() + e.stopPropagation() +}) -let store; -let persistor; +let store +let persistor const handleReady = () => { - const { defaultReactDevToolsPort = 19567 } = config; - findAPortNotInUse(Number(defaultReactDevToolsPort)).then(port => { - window.reactDevToolsPort = port; - render( + const { defaultReactDevToolsPort = 19567 } = config + findAPortNotInUse(Number(defaultReactDevToolsPort)).then((port) => { + window.reactDevToolsPort = port + const root = createRoot(document.getElementById('root')) + root.render( , - document.getElementById('root') - ); - }); + document.getElementById('root'), + ) + }) }; -({ store, persistor } = configureStore(handleReady)); +({ store, persistor } = configureStore(handleReady)) // Provide for user -window.adb = client; -window.adb.reverseAll = tryADBReverse; -window.adb.reversePackager = () => tryADBReverse(store.getState().debugger.location.port); +window.adb = client +window.adb.reverseAll = tryADBReverse +window.adb.reversePackager = () => tryADBReverse(store.getState().debugger.location.port) window.checkWindowInfo = () => { - const debuggerState = store.getState().debugger; + const debuggerState = store.getState().debugger return { isWorkerRunning: !!debuggerState.worker, location: debuggerState.location, isPortSettingRequired: debuggerState.isPortSettingRequired, - }; -}; + } +} -window.beforeWindowClose = () => - new Promise(resolve => - (store.dispatch(beforeWindowClose()) ? setTimeout(resolve, 200) : resolve()) - ); +window.beforeWindowClose = () => new Promise((resolve) => { + if (store.dispatch(beforeWindowClose())) { + setTimeout(resolve, 200) + } else { + resolve() + } +}) // For security, we should disable nodeIntegration when user use this open a website -const originWindowOpen = window.open; +const originWindowOpen = window.open window.open = (url, frameName, features = '') => { - const featureList = features.split(','); - featureList.push('nodeIntegration=0'); - return originWindowOpen.call(window, url, frameName, featureList.join(',')); -}; + const featureList = features.split(',') + featureList.push('nodeIntegration=0') + return originWindowOpen.call(window, url, frameName, featureList.join(',')) +} -window.openInEditor = (file, lineNumber) => launchEditor(file, lineNumber); +window.openInEditor = (file, lineNumber) => launchEditor(file, lineNumber) window.toggleOpenInEditor = () => { - const { port } = store.getState().debugger.location; - return toggleOpenInEditor(currentWindow, port); -}; -window.isOpenInEditorEnabled = () => isOpenInEditorEnabled(currentWindow); + const { port } = store.getState().debugger.location + return toggleOpenInEditor(currentWindow, port) +} +window.isOpenInEditorEnabled = () => isOpenInEditorEnabled(currentWindow) -window.invokeDevMethod = name => invokeDevMethod(name)(); +window.invokeDevMethod = (name) => invokeDevMethod(name)() // Package will missing /usr/local/bin, // we need fix it for ensure child process work // (like launchEditor of react-devtools) if ( - process.env.NODE_ENV === 'production' && - process.platform === 'darwin' && - process.env.PATH.indexOf('/usr/local/bin') === -1 + process.env.NODE_ENV === 'production' + && process.platform === 'darwin' + && process.env.PATH.indexOf('/usr/local/bin') === -1 ) { - process.env.PATH = `${process.env.PATH}:/usr/local/bin`; + process.env.PATH = `${process.env.PATH}:/usr/local/bin` } diff --git a/app/middlewares/debuggerAPI.js b/app/middlewares/debuggerAPI.js index 2f3e79fb..567680f9 100644 --- a/app/middlewares/debuggerAPI.js +++ b/app/middlewares/debuggerAPI.js @@ -9,35 +9,35 @@ // Take from https://github.com/facebook/react-native/blob/master/local-cli/server/util/debugger.html -import { getCurrentWindow } from '@electron/remote'; -import { bindActionCreators } from 'redux'; -import { checkPortStatus } from 'portscanner'; -import * as debuggerActions from '../actions/debugger'; -import { setDevMenuMethods, networkInspect } from '../utils/devMenu'; -import { tryADBReverse } from '../utils/adb'; -import { clearNetworkLogs, selectRNDebuggerWorkerContext } from '../utils/devtools'; -import config from '../utils/config'; - -const currentWindow = getCurrentWindow(); -const { SET_DEBUGGER_LOCATION, BEFORE_WINDOW_CLOSE } = debuggerActions; - -let worker; -let queuedMessages = []; -let scriptExecuted = false; -let actions; -let host; -let port; -let socket; - -const APOLLO_BACKEND = 'apollo-devtools-backend'; -const APOLLO_PROXY = 'apollo-devtools-proxy'; - -const workerOnMessage = message => { - const { data } = message; +import { getCurrentWindow } from '@electron/remote' +import { bindActionCreators } from 'redux' +import { checkPortStatus } from 'portscanner' +import * as debuggerActions from '../actions/debugger' +import { setDevMenuMethods, networkInspect } from '../utils/devMenu' +import { tryADBReverse } from '../utils/adb' +import { clearNetworkLogs, selectRNDebuggerWorkerContext } from '../utils/devtools' +import config from '../utils/config' + +const currentWindow = getCurrentWindow() +const { SET_DEBUGGER_LOCATION, BEFORE_WINDOW_CLOSE } = debuggerActions + +let worker +let queuedMessages = [] +let scriptExecuted = false +let actions +let host +let port +let socket + +const APOLLO_BACKEND = 'apollo-devtools-backend' +const APOLLO_PROXY = 'apollo-devtools-proxy' + +const workerOnMessage = (message) => { + const { data } = message if (data && data.source === APOLLO_BACKEND) { if (!window.__APOLLO_DEVTOOLS_SHOULD_DISPLAY_PANEL__) { - window.__APOLLO_DEVTOOLS_SHOULD_DISPLAY_PANEL__ = true; + window.__APOLLO_DEVTOOLS_SHOULD_DISPLAY_PANEL__ = true } postMessage( @@ -45,33 +45,33 @@ const workerOnMessage = message => { source: APOLLO_BACKEND, payload: data, }, - '*' - ); - return false; + '*', + ) + return false } if (data && (data.__IS_REDUX_NATIVE_MESSAGE__ || data.__REPORT_REACT_DEVTOOLS_PORT__)) { - return true; + return true } - const list = data && data.__AVAILABLE_METHODS_CAN_CALL_BY_RNDEBUGGER__; + const list = data && data.__AVAILABLE_METHODS_CAN_CALL_BY_RNDEBUGGER__ if (list) { - setDevMenuMethods(list, worker); - return false; + setDevMenuMethods(list, worker) + return false } - socket.send(JSON.stringify(data)); -}; + socket.send(JSON.stringify(data)) +} -const onWindowMessage = e => { - const { data } = e; +const onWindowMessage = (e) => { + const { data } = e if (data && data.source === APOLLO_PROXY) { - const message = typeof data.payload === 'string' ? { event: data.payload } : data.payload; + const message = typeof data.payload === 'string' ? { event: data.payload } : data.payload worker.postMessage({ method: 'emitApolloMessage', source: APOLLO_PROXY, ...message, - }); + }) } -}; +} const createJSRuntime = () => { // This worker will run the application javascript code, @@ -79,159 +79,158 @@ const createJSRuntime = () => { // document, to make it consistent with the JSC executor environment. // eslint-disable-next-line worker = new Worker(`${__webpack_public_path__}RNDebuggerWorker.js`); - worker.addEventListener('message', workerOnMessage); - window.addEventListener('message', onWindowMessage); - actions.setDebuggerWorker(worker, 'connected'); -}; + worker.addEventListener('message', workerOnMessage) + window.addEventListener('message', onWindowMessage) + actions.setDebuggerWorker(worker, 'connected') +} const shutdownJSRuntime = () => { - const { setDebuggerWorker } = actions; - scriptExecuted = false; + const { setDebuggerWorker } = actions + scriptExecuted = false if (worker) { - worker.terminate(); - window.removeEventListener('messsage', onWindowMessage); - setDevMenuMethods([]); + worker.terminate() + window.removeEventListener('messsage', onWindowMessage) + setDevMenuMethods([]) } - worker = null; - setDebuggerWorker(null, 'disconnected'); -}; + worker = null + setDebuggerWorker(null, 'disconnected') +} -const isScriptBuildForAndroid = url => - url && (url.indexOf('.android.bundle') > -1 || url.indexOf('platform=android') > -1); +const isScriptBuildForAndroid = (url) => url && (url.indexOf('.android.bundle') > -1 || url.indexOf('platform=android') > -1) -let preconnectTimeout; +let preconnectTimeout const preconnect = async (fn, firstTimeout) => { if (firstTimeout || (await checkPortStatus(port, host)) !== 'open') { - preconnectTimeout = setTimeout(() => preconnect(fn), 500); - return; + preconnectTimeout = setTimeout(() => preconnect(fn), 500) + return } - socket = await fn(); -}; + socket = await fn() +} const clearLogs = () => { if (process.env.NODE_ENV !== 'development') { - console.clear(); - clearNetworkLogs(currentWindow); + console.clear() + clearNetworkLogs(currentWindow) } -}; +} const flushQueuedMessages = () => { - if (!worker) return; + if (!worker) return // Flush any messages queued up and clear them - queuedMessages.forEach(message => worker.postMessage(message)); - queuedMessages = []; -}; + queuedMessages.forEach((message) => worker.postMessage(message)) + queuedMessages = [] +} -let loadCount = 0; +let loadCount = 0 const checkJSLoadCount = () => { - loadCount++; + loadCount += 1 if ( - currentWindow.webContents.isDevToolsOpened() && - config.timesJSLoadToRefreshDevTools >= 0 && - loadCount > 0 && - loadCount % config.timesJSLoadToRefreshDevTools === 0 + currentWindow.webContents.isDevToolsOpened() + && config.timesJSLoadToRefreshDevTools >= 0 + && loadCount > 0 + && loadCount % config.timesJSLoadToRefreshDevTools === 0 ) { - currentWindow.webContents.closeDevTools(); - currentWindow.webContents.openDevTools(); + currentWindow.webContents.closeDevTools() + currentWindow.webContents.openDevTools() console.warn( '[RNDebugger]', `Refreshed the devtools panel as React Native app was reloaded ${loadCount} times.`, 'If you want to update or disable this,', - 'Open `Debugger` -> `Open Config File` to change `timesJSLoadToRefreshDevTools` field.' - ); - loadCount = 0; + 'Open `Debugger` -> `Open Config File` to change `timesJSLoadToRefreshDevTools` field.', + ) + loadCount = 0 } -}; +} const connectToDebuggerProxy = async () => { - const ws = new WebSocket(`ws://${host}:${port}/debugger-proxy?role=debugger&name=Chrome`); + const ws = new WebSocket(`ws://${host}:${port}/debugger-proxy?role=debugger&name=Chrome`) - const { setDebuggerStatus } = actions; - ws.onopen = () => setDebuggerStatus('waiting'); - ws.onmessage = async message => { - if (!message.data) return; + const { setDebuggerStatus } = actions + ws.onopen = () => setDebuggerStatus('waiting') + ws.onmessage = async (message) => { + if (!message.data) return - const object = JSON.parse(message.data); + const object = JSON.parse(message.data) if (object.$event === 'client-disconnected') { - shutdownJSRuntime(); - return; + shutdownJSRuntime() + return } - if (!object.method) return; + if (!object.method) return // Special message that asks for a new JS runtime if (object.method === 'prepareJSRuntime') { - shutdownJSRuntime(); - createJSRuntime(); - clearLogs(); - selectRNDebuggerWorkerContext(currentWindow); - ws.send(JSON.stringify({ replyID: object.id })); + shutdownJSRuntime() + createJSRuntime() + clearLogs() + selectRNDebuggerWorkerContext(currentWindow) + ws.send(JSON.stringify({ replyID: object.id })) } else if (object.method === '$disconnected') { - shutdownJSRuntime(); + shutdownJSRuntime() } else { - if (!worker) return; + if (!worker) return if (object.method === 'executeApplicationScript') { - object.networkInspect = networkInspect.isEnabled(); - object.reactDevToolsPort = window.reactDevToolsPort; + object.networkInspect = networkInspect.isEnabled() + object.reactDevToolsPort = window.reactDevToolsPort if (isScriptBuildForAndroid(object.url)) { // Reserve React Inspector port for debug via USB on Android real device - tryADBReverse(window.reactDevToolsPort).catch(() => {}); + tryADBReverse(window.reactDevToolsPort).catch(() => {}) } // Clear logs even if no error catched - clearLogs(); - scriptExecuted = true; - checkJSLoadCount(); + clearLogs() + scriptExecuted = true + checkJSLoadCount() } if (scriptExecuted) { // Otherwise, pass through to the worker provided the // application script has been executed. If not add // it to a queue until it has been executed. - worker.postMessage(object); - flushQueuedMessages(); + worker.postMessage(object) + flushQueuedMessages() } else { - queuedMessages.push(object); + queuedMessages.push(object) } } - }; + } - ws.onerror = () => {}; - ws.onclose = e => { - shutdownJSRuntime(); + ws.onerror = () => {} + ws.onclose = (e) => { + shutdownJSRuntime() if (e.reason) { - console.warn(e.reason); + console.warn(e.reason) } - preconnect(connectToDebuggerProxy, true); - }; - return ws; -}; + preconnect(connectToDebuggerProxy, true) + } + return ws +} const setDebuggerLoc = ({ host: packagerHost, port: packagerPort }) => { - if (host === packagerHost && port === Number(packagerPort)) return; + if (host === packagerHost && port === Number(packagerPort)) return - host = packagerHost || 'localhost'; - port = packagerPort || config.port || 8081; + host = packagerHost || 'localhost' + port = packagerPort || config.port || 8081 if (socket) { - shutdownJSRuntime(); - socket.close(); + shutdownJSRuntime() + socket.close() } else { // Should ensure cleared timeout if called preconnect twice - clearTimeout(preconnectTimeout); - preconnect(connectToDebuggerProxy); + clearTimeout(preconnectTimeout) + preconnect(connectToDebuggerProxy) } -}; +} export default ({ dispatch }) => { - actions = bindActionCreators(debuggerActions, dispatch); + actions = bindActionCreators(debuggerActions, dispatch) - return next => action => { + return (next) => (action) => { if (action.type === SET_DEBUGGER_LOCATION) { - setDebuggerLoc(action.loc); + setDebuggerLoc(action.loc) } if (action.type === BEFORE_WINDOW_CLOSE) { // Return boolean instead of handle reducer - if (!worker) return false; - worker.postMessage({ method: 'beforeTerminate' }); - return true; + if (!worker) return false + worker.postMessage({ method: 'beforeTerminate' }) + return true } - return next(action); - }; -}; + return next(action) + } +} diff --git a/app/middlewares/reduxAPI.js b/app/middlewares/reduxAPI.js index b58f4e70..8d997153 100644 --- a/app/middlewares/reduxAPI.js +++ b/app/middlewares/reduxAPI.js @@ -1,34 +1,36 @@ -import { bindActionCreators } from 'redux'; -import { ipcRenderer } from 'electron'; -import { getGlobal } from '@electron/remote'; +import { bindActionCreators } from 'redux' +import { ipcRenderer } from 'electron' +import { getGlobal } from '@electron/remote' -import { UPDATE_STATE, LIFTED_ACTION } from '@redux-devtools/app/lib/esm/constants/actionTypes'; -import { DISCONNECTED } from '@redux-devtools/app/lib/esm/constants/socketActionTypes'; -import { nonReduxDispatch } from '@redux-devtools/app/lib/esm/utils/monitorActions'; -import { showNotification, liftedDispatch } from '@redux-devtools/app/lib/esm/actions'; -import { getActiveInstance } from '@redux-devtools/app/lib/esm/reducers/instances'; +import { UPDATE_STATE, LIFTED_ACTION } from '@redux-devtools/app/lib/esm/constants/actionTypes' +import { DISCONNECTED } from '@redux-devtools/app/lib/esm/constants/socketActionTypes' +import { nonReduxDispatch } from '@redux-devtools/app/lib/esm/utils/monitorActions' +import { showNotification, liftedDispatch } from '@redux-devtools/app/lib/esm/actions' +import { getActiveInstance } from '@redux-devtools/app/lib/esm/reducers/instances' -import { SET_DEBUGGER_WORKER, SYNC_STATE } from '../actions/debugger'; -import { setReduxDevToolsMethods, updateSliderContent } from '../utils/devMenu'; +import { SET_DEBUGGER_WORKER, SYNC_STATE } from '../actions/debugger' +import { setReduxDevToolsMethods, updateSliderContent } from '../utils/devMenu' const unboundActions = { showNotification, - updateState: request => ({ + updateState: (request) => ({ type: UPDATE_STATE, request: request.data ? { ...request.data, id: request.id } : request, }), liftedDispatch, -}; -let actions; -let worker; -let store; +} +let actions +let worker +let store -const toWorker = ({ message, action, state, toAll }) => { - if (!worker) return; +const toWorker = ({ + message, action, state, toAll, +}) => { + if (!worker) return - const instances = store.getState().instances; - const instanceId = getActiveInstance(instances); - const id = instances.options[instanceId].connectionId; + const { instances } = store.getState() + const instanceId = getActiveInstance(instances) + const id = instances.options[instanceId].connectionId worker.postMessage({ method: 'emitReduxMessage', content: { @@ -39,15 +41,15 @@ const toWorker = ({ message, action, state, toAll }) => { id, toAll, }, - }); -}; + }) +} -const postImportMessage = state => { - if (!worker) return; +const postImportMessage = (state) => { + if (!worker) return - const instances = store.getState().instances; - const instanceId = getActiveInstance(instances); - const id = instances.options[instanceId].connectionId; + const { instances } = store.getState() + const instanceId = getActiveInstance(instances) + const id = instances.options[instanceId].connectionId worker.postMessage({ method: 'emitReduxMessage', content: { @@ -56,83 +58,83 @@ const postImportMessage = state => { instanceId, id, }, - }); -}; + }) +} // Receive messages from worker -const messaging = message => { - const { data } = message; - if (!data || !data.__IS_REDUX_NATIVE_MESSAGE__) return; +const messaging = (message) => { + const { data } = message + if (!data || !data.__IS_REDUX_NATIVE_MESSAGE__) return - const { content: request } = data; + const { content: request } = data if (request.type === 'ERROR') { - actions.showNotification(request.payload); - return; + actions.showNotification(request.payload) + return } - actions.updateState(request); -}; + actions.updateState(request) +} -const initWorker = wkr => { - wkr.addEventListener('message', messaging); - worker = wkr; -}; +const initWorker = (wkr) => { + wkr.addEventListener('message', messaging) + worker = wkr +} const removeWorker = () => { - worker = null; -}; + worker = null +} -const syncLiftedState = liftedState => { - if (!getGlobal('isSyncState')()) return; +const syncLiftedState = (liftedState) => { + if (!getGlobal('isSyncState')()) return - const actionsById = liftedState.actionsById; - const payload = []; - liftedState.stagedActionIds.slice(1).forEach(id => { - payload.push(actionsById[id].action); - }); - const serialized = JSON.stringify({ payload: JSON.stringify(payload) }); - ipcRenderer.send('sync-state', serialized); -}; + const { actionsById } = liftedState + const payload = [] + liftedState.stagedActionIds.slice(1).forEach((id) => { + payload.push(actionsById[id].action) + }) + const serialized = JSON.stringify({ payload: JSON.stringify(payload) }) + ipcRenderer.send('sync-state', serialized) +} -export default inStore => { - store = inStore; - actions = bindActionCreators(unboundActions, store.dispatch); - return next => action => { +export default (inStore) => { + store = inStore + actions = bindActionCreators(unboundActions, store.dispatch) + return (next) => (action) => { if (action.type === SET_DEBUGGER_WORKER) { if (action.worker) { - initWorker(action.worker); + initWorker(action.worker) } else { - removeWorker(action.worker); - setReduxDevToolsMethods(false); - next({ type: DISCONNECTED }); + removeWorker(action.worker) + setReduxDevToolsMethods(false) + next({ type: DISCONNECTED }) } } if (action.type === LIFTED_ACTION) { - toWorker(action); + toWorker(action) } if ( - action.type === UPDATE_STATE || - action.type === LIFTED_ACTION || - action.type === SYNC_STATE + action.type === UPDATE_STATE + || action.type === LIFTED_ACTION + || action.type === SYNC_STATE ) { - next(action); - const state = store.getState(); - const instances = state.instances; - const id = getActiveInstance(instances); - const liftedState = instances.states[id]; + next(action) + const state = store.getState() + const { instances } = state + const id = getActiveInstance(instances) + const liftedState = instances.states[id] if (liftedState && liftedState.computedStates.length > 1) { - setReduxDevToolsMethods(true, actions.liftedDispatch); + setReduxDevToolsMethods(true, actions.liftedDispatch) } else if (liftedState && liftedState.computedStates.length <= 1) { - setReduxDevToolsMethods(false); + setReduxDevToolsMethods(false) } - updateSliderContent(liftedState, action.action && action.action.dontUpdateTouchBarSlider); + updateSliderContent(liftedState, action.action && action.action.dontUpdateTouchBarSlider) if (action.request && action.request.type === 'ACTION') { - syncLiftedState(liftedState); + syncLiftedState(liftedState) } if (action.type === SYNC_STATE) { - postImportMessage(action.payload); + postImportMessage(action.payload) } - return; + return } - return next(action); - }; -}; + return next(action) + } +} diff --git a/app/reducers/debugger.js b/app/reducers/debugger.js index 03b0112a..39096a37 100644 --- a/app/reducers/debugger.js +++ b/app/reducers/debugger.js @@ -2,33 +2,33 @@ import { SET_DEBUGGER_STATUS, SET_DEBUGGER_WORKER, SET_DEBUGGER_LOCATION, -} from '../actions/debugger'; -import config from '../utils/config'; +} from '../actions/debugger' +import config from '../utils/config' function getStatusMessage(status, port) { - let message; + let message switch (status) { case 'new': - message = 'New Window'; - break; + message = 'New Window' + break case 'waiting': - message = 'Waiting for client connection'; - break; + message = 'Waiting for client connection' + break case 'connected': - message = 'Connected'; - break; + message = 'Connected' + break case 'disconnected': default: - message = 'Attempting reconnection'; + message = 'Attempting reconnection' } if (status !== 'new') { - message += ` (port ${port})`; + message += ` (port ${port})` } - const title = `React Native Debugger - ${message}`; + const title = `React Native Debugger - ${message}` if (title !== document.title) { - document.title = title; + document.title = title } - return message; + return message } const initialState = { @@ -40,42 +40,42 @@ const initialState = { port: config.port || 8081, }, isPortSettingRequired: config.isPortSettingRequired, -}; +} const actionsMap = { [SET_DEBUGGER_STATUS]: (state, action) => { - const status = action.status || initialState.status; + const status = action.status || initialState.status const newState = { ...state, status, statusMessage: getStatusMessage(status, state.location.port), - }; - return newState; + } + return newState }, [SET_DEBUGGER_WORKER]: (state, action) => { - const status = action.status || initialState.status; + const status = action.status || initialState.status const newState = { ...state, worker: action.worker, status, statusMessage: getStatusMessage(status, state.location.port), - }; - return newState; + } + return newState }, [SET_DEBUGGER_LOCATION]: (state, action) => { - const location = { ...state.location, ...action.loc }; + const location = { ...state.location, ...action.loc } const newState = { ...state, location, statusMessage: getStatusMessage(state.status, location.port), isPortSettingRequired: false, - }; - return newState; + } + return newState }, -}; +} -export default (state = initialState, action) => { - const reduceFn = actionsMap[action.type]; - if (!reduceFn) return state; - return reduceFn(state, action); -}; +export default (state = initialState, action = {}) => { + const reduceFn = actionsMap[action.type] + if (!reduceFn) return state + return reduceFn(state, action) +} diff --git a/app/reducers/index.js b/app/reducers/index.js index d1376c05..59713b4c 100644 --- a/app/reducers/index.js +++ b/app/reducers/index.js @@ -1,15 +1,15 @@ -import { combineReducers } from 'redux'; -import { section } from '@redux-devtools/app/lib/esm/reducers/section'; +import { combineReducers } from 'redux' +import { section } from '@redux-devtools/app/lib/esm/reducers/section' // import { connection } from '@redux-devtools/app/lib/esm/reducers/connection'; // import { socket } from '@redux-devtools/app/lib/esm/reducers/socket'; -import { monitor } from '@redux-devtools/app/lib/esm/reducers/monitor'; -import { notification } from '@redux-devtools/app/lib/esm/reducers/notification'; -import { instances } from '@redux-devtools/app/lib/esm/reducers/instances'; -import { reports } from '@redux-devtools/app/lib/esm/reducers/reports'; -import { theme } from '@redux-devtools/app/lib/esm/reducers/theme'; +import { monitor } from '@redux-devtools/app/lib/esm/reducers/monitor' +import { notification } from '@redux-devtools/app/lib/esm/reducers/notification' +import { instances } from '@redux-devtools/app/lib/esm/reducers/instances' +import { reports } from '@redux-devtools/app/lib/esm/reducers/reports' +import { theme } from '@redux-devtools/app/lib/esm/reducers/theme' -import setting from './setting'; -import debuggerReducer from './debugger'; +import setting from './setting' +import debuggerReducer from './debugger' export default combineReducers({ section, @@ -21,4 +21,4 @@ export default combineReducers({ setting, debugger: debuggerReducer, -}); +}) diff --git a/app/reducers/setting.js b/app/reducers/setting.js index a332cea0..0116a5a6 100644 --- a/app/reducers/setting.js +++ b/app/reducers/setting.js @@ -1,11 +1,11 @@ -import { TOGGLE_DEVTOOLS, RESIZE_DEVTOOLS, CHANGE_DEFAULT_THEME } from '../actions/setting'; +import { TOGGLE_DEVTOOLS, RESIZE_DEVTOOLS, CHANGE_DEFAULT_THEME } from '../actions/setting' const initialState = { react: true, redux: true, size: 0.6, themeName: null, -}; +} const actionsMap = { [TOGGLE_DEVTOOLS]: (state, action) => ({ @@ -14,21 +14,21 @@ const actionsMap = { }), [RESIZE_DEVTOOLS]: (state, action) => { if (!state.redux || !state.react) { - return state; + return state } - const { size } = action; - if (size < 0.2) return { ...state, size: 0.2 }; - if (size > 0.8) return { ...state, size: 0.8 }; - return { ...state, size }; + const { size } = action + if (size < 0.2) return { ...state, size: 0.2 } + if (size > 0.8) return { ...state, size: 0.8 } + return { ...state, size } }, [CHANGE_DEFAULT_THEME]: (state, action) => ({ ...state, themeName: action.themeName, }), -}; +} -export default (state = initialState, action) => { - const reduceFn = actionsMap[action.type]; - if (!reduceFn) return state; - return reduceFn(state, action); -}; +export default (state = initialState, action = {}) => { + const reduceFn = actionsMap[action.type] + if (!reduceFn) return state + return reduceFn(state, action) +} diff --git a/app/setup.js b/app/setup.js index feb5a2e0..c25c4595 100644 --- a/app/setup.js +++ b/app/setup.js @@ -1,14 +1,14 @@ -import config from './utils/config'; +import config from './utils/config' if (config.editor) { - process.env.EDITOR = config.editor; + process.env.EDITOR = config.editor } if (config.fontFamily) { - const styleEl = document.createElement('style'); - document.head.appendChild(styleEl); + const styleEl = document.createElement('style') + document.head.appendChild(styleEl) styleEl.sheet.insertRule( `div *, span * { font-family: ${config.fontFamily} !important; }`, 0, - ); + ) } diff --git a/app/store/configureStore.js b/app/store/configureStore.js index a2506870..a6ff9bc4 100644 --- a/app/store/configureStore.js +++ b/app/store/configureStore.js @@ -1,41 +1,41 @@ -import { createStore, applyMiddleware, compose } from 'redux'; -import { persistReducer, persistStore } from 'redux-persist'; -import localForage from 'localforage'; -import { exportStateMiddleware } from '@redux-devtools/app/lib/cjs/middlewares/exportState'; -import { instancesInitialState } from '@redux-devtools/app/lib/esm/reducers/instances'; -import debuggerAPI from '../middlewares/debuggerAPI'; -import reduxAPI from '../middlewares/reduxAPI'; -import rootReducer from '../reducers'; +import { createStore, applyMiddleware, compose } from 'redux' +import { persistReducer, persistStore } from 'redux-persist' +import localForage from 'localforage' +import { exportStateMiddleware } from '@redux-devtools/app/lib/cjs/middlewares/exportState' +import { instancesInitialState } from '@redux-devtools/app/lib/esm/reducers/instances' +import debuggerAPI from '../middlewares/debuggerAPI' +import reduxAPI from '../middlewares/reduxAPI' +import rootReducer from '../reducers' const persistConfig = { key: 'redux-devtools', blacklist: ['instances', 'debugger'], storage: localForage, -}; +} -const persistedReducer = persistReducer(persistConfig, rootReducer); +const persistedReducer = persistReducer(persistConfig, rootReducer) const middlewares = applyMiddleware( debuggerAPI, exportStateMiddleware, reduxAPI, -); +) // If Redux DevTools Extension is installed use it, otherwise use Redux compose /* eslint-disable no-underscore-dangle */ -const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; +const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose /* eslint-enable no-underscore-dangle */ -const enhancer = composeEnhancers(middlewares); +const enhancer = composeEnhancers(middlewares) const initialState = { instances: { ...instancesInitialState, selected: '', }, -}; +} export default (callback) => { - const store = createStore(persistedReducer, initialState, enhancer); - const persistor = persistStore(store, null, () => callback?.(store)); - return { store, persistor }; -}; + const store = createStore(persistedReducer, initialState, enhancer) + const persistor = persistStore(store, null, () => callback?.(store)) + return { store, persistor } +} diff --git a/app/utils/adb.js b/app/utils/adb.js index 0d0495b3..4ff8c40f 100644 --- a/app/utils/adb.js +++ b/app/utils/adb.js @@ -1,10 +1,10 @@ -import adb from 'adbkit'; +import adb from 'adbkit' -export const client = adb.createClient(); +export const client = adb.createClient() -const reverse = (device, port) => client.reverse(device, `tcp:${port}`, `tcp:${port}`); +const reverse = (device, port) => client.reverse(device, `tcp:${port}`, `tcp:${port}`) -export const tryADBReverse = async port => { - const devices = await client.listDevices().filter(device => device.type === 'device'); - return Promise.all(devices.map(device => reverse(device.id, port))); -}; +export const tryADBReverse = async (port) => { + const devices = await client.listDevices().filter((device) => device.type === 'device') + return Promise.all(devices.map((device) => reverse(device.id, port))) +} diff --git a/app/utils/config.js b/app/utils/config.js index 961d4912..d6a95d6b 100644 --- a/app/utils/config.js +++ b/app/utils/config.js @@ -1,3 +1,3 @@ -import { getCurrentWindow } from '@electron/remote'; +import { getCurrentWindow } from '@electron/remote' -export default getCurrentWindow().debuggerConfig || {}; +export default getCurrentWindow().debuggerConfig || {} diff --git a/app/utils/devMenu.js b/app/utils/devMenu.js index b749b6cb..a40596d4 100644 --- a/app/utils/devMenu.js +++ b/app/utils/devMenu.js @@ -1,113 +1,108 @@ -import { TouchBar, nativeImage, getCurrentWindow } from '@electron/remote'; +import { TouchBar, nativeImage, getCurrentWindow } from '@electron/remote' -import { ipcRenderer } from 'electron'; -import config from './config'; +import { ipcRenderer } from 'electron' +import config from './config' -const { TouchBarButton, TouchBarSlider } = TouchBar || {}; -const currentWindow = getCurrentWindow(); +const { TouchBarButton, TouchBarSlider } = TouchBar || {} +const currentWindow = getCurrentWindow() -let worker; -let availableMethods = []; +let worker +let availableMethods = [] /* reload, toggleElementInspector, networkInspect */ -let leftBar = {}; +let leftBar = {} -let isSliderEnabled; -let storeLiftedState; +let isSliderEnabled +let storeLiftedState /* slider, prev, next */ -let rightBar = {}; - -const getBarItems = (bar) => - Object.keys(bar) - .map((key) => bar[key]) - .filter((barItem) => !!barItem); -const setTouchBar = () => - currentWindow.setTouchBar( - new TouchBar({ - items: [ - ...getBarItems(leftBar), - ...(isSliderEnabled ? getBarItems(rightBar) : []), - ], - }), - ); - -const invokeDevMenuMethod = ({ name, args }) => - worker && worker.postMessage({ method: 'invokeDevMenuMethod', name, args }); - -let networkInspectEnabled = !!config.networkInspect; +let rightBar = {} + +const getBarItems = (bar) => Object.keys(bar) + .map((key) => bar[key]) + .filter((barItem) => !!barItem) +const setTouchBar = () => currentWindow.setTouchBar( + new TouchBar({ + items: [ + ...getBarItems(leftBar), + ...(isSliderEnabled ? getBarItems(rightBar) : []), + ], + }), +) + +const invokeDevMenuMethod = ({ name, args }) => worker && worker.postMessage({ method: 'invokeDevMenuMethod', name, args }) + +let networkInspectEnabled = !!config.networkInspect const sendContextMenuUpdate = () => { ipcRenderer.send(`context-menu-available-methods-update-${currentWindow.id}`, { availableMethods, networkInspectEnabled, - }); -}; + }) +} export const networkInspect = { isEnabled: () => !!networkInspectEnabled, getHighlightColor: () => (networkInspectEnabled ? '#7A7A7A' : '#363636'), toggle() { - networkInspectEnabled = !networkInspectEnabled; - sendContextMenuUpdate(); + networkInspectEnabled = !networkInspectEnabled + sendContextMenuUpdate() }, -}; +} const devMenuMethods = { reload: () => invokeDevMenuMethod({ name: 'reload' }), - toggleElementInspector: () => - invokeDevMenuMethod({ name: 'toggleElementInspector' }), + toggleElementInspector: () => invokeDevMenuMethod({ name: 'toggleElementInspector' }), show: () => invokeDevMenuMethod({ name: 'show' }), networkInspect: () => { - networkInspect.toggle(); + networkInspect.toggle() if (leftBar.networkInspect) { - leftBar.networkInspect.backgroundColor = - networkInspect.getHighlightColor(); + leftBar.networkInspect.backgroundColor = networkInspect.getHighlightColor() } invokeDevMenuMethod({ name: 'networkInspect', args: [networkInspectEnabled], - }); + }) }, showAsyncStorage: () => { - invokeDevMenuMethod({ name: 'showAsyncStorage' }); + invokeDevMenuMethod({ name: 'showAsyncStorage' }) }, clearAsyncStorage: () => { if ( - confirm( + window.confirm( 'Call `AsyncStorage.clear()` in current React Native debug session?', ) ) { - invokeDevMenuMethod({ name: 'clearAsyncStorage' }); + invokeDevMenuMethod({ name: 'clearAsyncStorage' }) } }, -}; +} export const invokeDevMethod = (name) => () => { if (availableMethods.includes(name)) { - return devMenuMethods[name](); + return devMenuMethods[name]() } -}; +} -const hslShift = [0.5, 0.2, 0.8]; +const hslShift = [0.5, 0.2, 0.8] const icon = (name, resizeOpts) => { - const image = nativeImage.createFromNamedImage(name, hslShift); - return image.resize(resizeOpts); -}; + const image = nativeImage.createFromNamedImage(name, hslShift) + return image.resize(resizeOpts) +} -let namedImages; +let namedImages const initNamedImages = () => { - if (process.platform !== 'darwin' || namedImages) return; + if (process.platform !== 'darwin' || namedImages) return namedImages = { reload: icon('NSTouchBarRefreshTemplate', { height: 20 }), toggleElementInspector: icon('NSTouchBarQuickLookTemplate', { height: 18 }), networkInspect: icon('NSTouchBarRecordStartTemplate', { height: 20 }), prev: icon('NSTouchBarGoBackTemplate', { height: 20 }), next: icon('NSTouchBarGoForwardTemplate', { height: 20 }), - }; -}; + } +} const setDevMenuMethodsForTouchBar = () => { - if (process.platform !== 'darwin') return; - initNamedImages(); + if (process.platform !== 'darwin') return + initNamedImages() leftBar = { // Default items @@ -116,46 +111,45 @@ const setDevMenuMethodsForTouchBar = () => { click: devMenuMethods.networkInspect, backgroundColor: networkInspect.getHighlightColor(), }), - }; + } if (availableMethods.includes('reload')) { leftBar.reload = new TouchBarButton({ icon: namedImages.reload, click: devMenuMethods.reload, - }); + }) } if (availableMethods.includes('toggleElementInspector')) { leftBar.toggleElementInspector = new TouchBarButton({ icon: namedImages.toggleElementInspector, click: devMenuMethods.toggleElementInspector, - }); + }) } - setTouchBar(); -}; + setTouchBar() +} // Reset TouchBar when reload the app -setDevMenuMethodsForTouchBar([]); +setDevMenuMethodsForTouchBar([]) export const setDevMenuMethods = (list, wkr) => { - worker = wkr; - availableMethods = list; - sendContextMenuUpdate(); - setDevMenuMethodsForTouchBar(); -}; + worker = wkr + availableMethods = list + sendContextMenuUpdate() + setDevMenuMethodsForTouchBar() +} export const setReduxDevToolsMethods = (enabled, dispatch) => { - if (process.platform !== 'darwin') return; - initNamedImages(); + if (process.platform !== 'darwin') return + initNamedImages() // Already setup - if (enabled && isSliderEnabled) return; + if (enabled && isSliderEnabled) return - const handleSliderChange = (nextIndex, dontUpdateTouchBarSlider = false) => - dispatch({ - type: 'JUMP_TO_STATE', - actionId: storeLiftedState.stagedActionIds[nextIndex], - index: nextIndex, - dontUpdateTouchBarSlider, - }); + const handleSliderChange = (nextIndex, dontUpdateTouchBarSlider = false) => dispatch({ + type: 'JUMP_TO_STATE', + actionId: storeLiftedState.stagedActionIds[nextIndex], + index: nextIndex, + dontUpdateTouchBarSlider, + }) rightBar = { slider: new TouchBarSlider({ @@ -165,40 +159,40 @@ export const setReduxDevToolsMethods = (enabled, dispatch) => { change(nextIndex) { if (nextIndex !== storeLiftedState.currentStateIndex) { // Set `dontUpdateTouchBarSlider` true for keep slide experience - handleSliderChange(nextIndex, true); + handleSliderChange(nextIndex, true) } }, }), prev: new TouchBarButton({ icon: namedImages.prev, click() { - const nextIndex = storeLiftedState.currentStateIndex - 1; + const nextIndex = storeLiftedState.currentStateIndex - 1 if (nextIndex >= 0) { - handleSliderChange(nextIndex); + handleSliderChange(nextIndex) } }, }), next: new TouchBarButton({ icon: namedImages.next, click() { - const nextIndex = storeLiftedState.currentStateIndex + 1; + const nextIndex = storeLiftedState.currentStateIndex + 1 if (nextIndex < storeLiftedState.computedStates.length) { - handleSliderChange(nextIndex); + handleSliderChange(nextIndex) } }, }), - }; - isSliderEnabled = enabled; - setTouchBar(); -}; + } + isSliderEnabled = enabled + setTouchBar() +} export const updateSliderContent = (liftedState, dontUpdateTouchBarSlider) => { - if (process.platform !== 'darwin') return; + if (process.platform !== 'darwin') return - storeLiftedState = liftedState; + storeLiftedState = liftedState if (isSliderEnabled && !dontUpdateTouchBarSlider) { - const { currentStateIndex, computedStates } = liftedState; - rightBar.slider.maxValue = computedStates.length - 1; - rightBar.slider.value = currentStateIndex; + const { currentStateIndex, computedStates } = liftedState + rightBar.slider.maxValue = computedStates.length - 1 + rightBar.slider.value = currentStateIndex } -}; +} diff --git a/app/utils/devtools.js b/app/utils/devtools.js index 371e20f1..84d0e264 100644 --- a/app/utils/devtools.js +++ b/app/utils/devtools.js @@ -1,30 +1,30 @@ -import { getCatchConsoleLogScript } from '../../electron/devtools'; +import { getCatchConsoleLogScript } from '../../electron/devtools' -let enabled = false; +let enabled = false export const toggleOpenInEditor = (win, port) => { if (win.devToolsWebContents) { - enabled = !enabled; + enabled = !enabled return win.devToolsWebContents.executeJavaScript(`(() => { ${getCatchConsoleLogScript(port)} window.__IS_OPEN_IN_EDITOR_ENABLED__ = ${enabled}; - })()`); + })()`) } -}; +} -export const isOpenInEditorEnabled = () => enabled; +export const isOpenInEditorEnabled = () => enabled -export const clearNetworkLogs = win => { +export const clearNetworkLogs = (win) => { if (win.devToolsWebContents) { return win.devToolsWebContents.executeJavaScript(`setTimeout(() => { const { network } = UI.panels; if (network && network.networkLogView && network.networkLogView.reset) { network.networkLogView.reset() } - }, 100)`); + }, 100)`) } -}; +} -export const selectRNDebuggerWorkerContext = win => { +export const selectRNDebuggerWorkerContext = (win) => { if (win.devToolsWebContents) { return win.devToolsWebContents.executeJavaScript(`setTimeout(() => { const { console } = UI.panels; @@ -37,6 +37,6 @@ export const selectRNDebuggerWorkerContext = win => { selector.itemSelected(item); } } - }, 100)`); + }, 100)`) } -}; +} diff --git a/app/worker/.eslintrc b/app/worker/.eslintrc new file mode 100644 index 00000000..4ea2dacf --- /dev/null +++ b/app/worker/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "no-restricted-globals": "off" + } +} \ No newline at end of file diff --git a/app/worker/apollo.js b/app/worker/apollo.js index 9a5f1044..bd46e7d4 100644 --- a/app/worker/apollo.js +++ b/app/worker/apollo.js @@ -1,48 +1,48 @@ -import Bridge from 'apollo-client-devtools/src/bridge'; -import { initBackend, sendBridgeReady } from 'apollo-client-devtools/src/backend'; -import { version as devToolsVersion } from 'apollo-client-devtools/package.json'; -import { getSafeAsyncStorage } from './asyncStorage'; +import Bridge from 'apollo-client-devtools/src/bridge' +import { initBackend, sendBridgeReady } from 'apollo-client-devtools/src/backend' +import { version as devToolsVersion } from 'apollo-client-devtools/package.json' +import { getSafeAsyncStorage } from './asyncStorage' export function handleApolloClient({ NativeModules } = {}) { const interval = setInterval(() => { if (!self.__APOLLO_CLIENT__) { - return; + return } - clearInterval(interval); + clearInterval(interval) const hook = { ApolloClient: self.__APOLLO_CLIENT__, devToolsVersion, - }; + } - let listener; + let listener const bridge = new Bridge({ listen(fn) { - listener = self.addEventListener('message', evt => { + listener = self.addEventListener('message', (evt) => { if (evt.data.source === 'apollo-devtools-proxy') { - return fn(evt.data); + return fn(evt.data) } - }); + }) }, send(data) { postMessage({ ...data, source: 'apollo-devtools-backend', - }); + }) }, - }); + }) bridge.on('init', () => { - sendBridgeReady(); - }); + sendBridgeReady() + }) bridge.on('shutdown', () => { - self.removeEventListener('message', listener); - }); + self.removeEventListener('message', listener) + }) - initBackend(bridge, hook, getSafeAsyncStorage(NativeModules)); - }, 1000); - return interval; + initBackend(bridge, hook, getSafeAsyncStorage(NativeModules)) + }, 1000) + return interval } diff --git a/app/worker/asyncStorage.js b/app/worker/asyncStorage.js index 9b16d302..c6aea1c6 100644 --- a/app/worker/asyncStorage.js +++ b/app/worker/asyncStorage.js @@ -1,104 +1,104 @@ -export const getClearAsyncStorageFn = AsyncStorage => { - if (!AsyncStorage.clear) return; - return () => AsyncStorage.clear().catch(f => f); -}; +export const getClearAsyncStorageFn = (AsyncStorage) => { + if (!AsyncStorage.clear) return + return () => AsyncStorage.clear().catch((f) => f) +} function convertError(error) { if (!error) { - return null; + return null } - const out = new Error(error.message); - out.key = error.key; - return out; + const out = new Error(error.message) + out.key = error.key + return out } function convertErrors(errs) { if (!errs) { - return null; + return null } - return (Array.isArray(errs) ? errs : [errs]).map(e => convertError(e)); + return (Array.isArray(errs) ? errs : [errs]).map((e) => convertError(e)) } -export const getSafeAsyncStorage = NativeModules => { - const RCTAsyncStorage = - NativeModules && - (NativeModules.RNC_AsyncSQLiteDBStorage || - NativeModules.RNCAsyncStorage || - NativeModules.PlatformLocalStorage || - NativeModules.AsyncRocksDBStorage || - NativeModules.AsyncSQLiteDBStorage || - NativeModules.AsyncLocalStorage); +export const getSafeAsyncStorage = (NativeModules) => { + const RCTAsyncStorage = NativeModules + && (NativeModules.RNC_AsyncSQLiteDBStorage + || NativeModules.RNCAsyncStorage + || NativeModules.PlatformLocalStorage + || NativeModules.AsyncRocksDBStorage + || NativeModules.AsyncSQLiteDBStorage + || NativeModules.AsyncLocalStorage) return { getItem(key) { - if (!RCTAsyncStorage) return Promise.resolve(null); + if (!RCTAsyncStorage) return Promise.resolve(null) return new Promise((resolve, reject) => { RCTAsyncStorage.multiGet([key], (errors, result) => { // Unpack result to get value from [[key,value]] - const value = - result && result[0] && result[0][1] ? result[0][1] : null; - const errs = convertErrors(errors); + const value = result && result[0] && result[0][1] ? result[0][1] : null + const errs = convertErrors(errors) if (errs) { - reject(errs[0]); + reject(errs[0]) } else { - resolve(value); + resolve(value) } - }); - }); + }) + }) }, async setItem(key, value) { - if (!RCTAsyncStorage) return Promise.resolve(null); + if (!RCTAsyncStorage) return Promise.resolve(null) return new Promise((resolve, reject) => { - RCTAsyncStorage.multiSet([[key, value]], errors => { - const errs = convertErrors(errors); + RCTAsyncStorage.multiSet([[key, value]], (errors) => { + const errs = convertErrors(errors) if (errs) { - reject(errs[0]); + reject(errs[0]) } else { - resolve(null); + resolve(null) } - }); - }); + }) + }) }, clear() { - if (!RCTAsyncStorage) return Promise.resolve(null); + if (!RCTAsyncStorage) return Promise.resolve(null) return new Promise((resolve, reject) => { - RCTAsyncStorage.clear(error => { + RCTAsyncStorage.clear((error) => { if (error && convertError(error)) { - reject(convertError(error)); + reject(convertError(error)) } else { - resolve(null); + resolve(null) } - }); - }); + }) + }) }, getAllKeys() { - if (!RCTAsyncStorage) return Promise.resolve(null); + if (!RCTAsyncStorage) return Promise.resolve(null) return new Promise((resolve, reject) => { RCTAsyncStorage.getAllKeys((error, keys) => { if (error) { - reject(convertError(error)); + reject(convertError(error)) } else { - resolve(keys); + resolve(keys) } - }); - }); + }) + }) }, - }; -}; + } +} -export const getShowAsyncStorageFn = AsyncStorage => { - if (!AsyncStorage.getAllKeys || !AsyncStorage.getItem) return; +export const getShowAsyncStorageFn = (AsyncStorage) => { + if (!AsyncStorage.getAllKeys || !AsyncStorage.getItem) return return async () => { - const keys = await AsyncStorage.getAllKeys(); + const keys = await AsyncStorage.getAllKeys() if (keys && keys.length) { const items = await Promise.all( - keys.map(key => AsyncStorage.getItem(key)), - ); - const table = {}; - keys.forEach((key, index) => (table[key] = { content: items[index] })); - console.table(table); + keys.map((key) => AsyncStorage.getItem(key)), + ) + const table = {} + keys.forEach((key, index) => { + table[key] = { content: items[index] } + }) + console.table(table) } else { - console.log('[RNDebugger] No AsyncStorage content.'); + console.log('[RNDebugger] No AsyncStorage content.') } - }; -}; + } +} diff --git a/app/worker/devMenu.js b/app/worker/devMenu.js index a0567717..4e40bfd0 100644 --- a/app/worker/devMenu.js +++ b/app/worker/devMenu.js @@ -1,37 +1,36 @@ /* eslint-disable no-underscore-dangle */ -import { toggleNetworkInspect } from './networkInspect'; -import { getClearAsyncStorageFn, getShowAsyncStorageFn, getSafeAsyncStorage } from './asyncStorage'; +import { toggleNetworkInspect } from './networkInspect' +import { getClearAsyncStorageFn, getShowAsyncStorageFn, getSafeAsyncStorage } from './asyncStorage' -let availableDevMenuMethods = {}; +let availableDevMenuMethods = {} export const checkAvailableDevMenuMethods = ({ NativeModules }) => { // RN 0.43 use DevSettings, DevMenu will be deprecated - const DevSettings = NativeModules.DevSettings || NativeModules.DevMenu; + const DevSettings = NativeModules.DevSettings || NativeModules.DevMenu // Currently `show dev menu` is only on DevMenu - const showDevMenu = - (DevSettings && DevSettings.show) || - (NativeModules.DevMenu && NativeModules.DevMenu.show) || - undefined; + const showDevMenu = (DevSettings && DevSettings.show) + || (NativeModules.DevMenu && NativeModules.DevMenu.show) + || undefined - const AsyncStorage = getSafeAsyncStorage(NativeModules); + const AsyncStorage = getSafeAsyncStorage(NativeModules) const methods = { ...DevSettings, show: showDevMenu, networkInspect: toggleNetworkInspect, showAsyncStorage: getShowAsyncStorageFn(AsyncStorage), clearAsyncStorage: getClearAsyncStorageFn(AsyncStorage), - }; + } if (methods.showAsyncStorage) { - window.showAsyncStorageContentInDev = methods.showAsyncStorage; + window.showAsyncStorageContentInDev = methods.showAsyncStorage } - const result = Object.keys(methods).filter(key => !!methods[key]); - availableDevMenuMethods = methods; + const result = Object.keys(methods).filter((key) => !!methods[key]) + availableDevMenuMethods = methods - postMessage({ __AVAILABLE_METHODS_CAN_CALL_BY_RNDEBUGGER__: result }); -}; + postMessage({ __AVAILABLE_METHODS_CAN_CALL_BY_RNDEBUGGER__: result }) +} export const invokeDevMenuMethodIfAvailable = (name, args = []) => { - const method = availableDevMenuMethods[name]; - if (method) method(...args); -}; + const method = availableDevMenuMethods[name] + if (method) method(...args) +} diff --git a/app/worker/index.js b/app/worker/index.js index 877308fc..631d8088 100644 --- a/app/worker/index.js +++ b/app/worker/index.js @@ -6,127 +6,127 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ -/* global __fbBatchedBridge, self, importScripts, postMessage, addEventListener: true */ +/* global __fbBatchedBridge, importScripts: true */ // Edit from https://github.com/facebook/react-native/blob/master/local-cli/server/util/debuggerWorker.js -import './setup'; -import { checkAvailableDevMenuMethods, invokeDevMenuMethodIfAvailable } from './devMenu'; -import { reportDefaultReactDevToolsPort } from './reactDevTools'; -import devToolsEnhancer, { composeWithDevTools } from './reduxAPI'; -import * as RemoteDev from './remotedev'; -import { getRequiredModules, ignoreRNDIntervalSpy } from './utils'; -import { toggleNetworkInspect } from './networkInspect'; -import { handleApolloClient } from './apollo'; +import './setup' +import { checkAvailableDevMenuMethods, invokeDevMenuMethodIfAvailable } from './devMenu' +import { reportDefaultReactDevToolsPort } from './reactDevTools' +import devToolsEnhancer, { composeWithDevTools } from './reduxAPI' +import * as RemoteDev from './remotedev' +import { getRequiredModules, ignoreRNDIntervalSpy } from './utils' +import { toggleNetworkInspect } from './networkInspect' +import { handleApolloClient } from './apollo' /* eslint-disable no-underscore-dangle */ -self.__REMOTEDEV__ = RemoteDev; +self.__REMOTEDEV__ = RemoteDev -devToolsEnhancer.send = RemoteDev.send; -devToolsEnhancer.connect = RemoteDev.connect; -devToolsEnhancer.disconnect = RemoteDev.disconnect; +devToolsEnhancer.send = RemoteDev.send +devToolsEnhancer.connect = RemoteDev.connect +devToolsEnhancer.disconnect = RemoteDev.disconnect // Deprecated API, these may removed when redux-devtools-extension 3.0 release -self.devToolsExtension = devToolsEnhancer; -self.reduxNativeDevTools = devToolsEnhancer; -self.reduxNativeDevToolsCompose = composeWithDevTools; +self.devToolsExtension = devToolsEnhancer +self.reduxNativeDevTools = devToolsEnhancer +self.reduxNativeDevToolsCompose = composeWithDevTools -self.__REDUX_DEVTOOLS_EXTENSION__ = devToolsEnhancer; -self.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = composeWithDevTools; +self.__REDUX_DEVTOOLS_EXTENSION__ = devToolsEnhancer +self.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = composeWithDevTools -const setupRNDebuggerBeforeImportScript = message => { - self.__REACT_DEVTOOLS_PORT__ = message.reactDevToolsPort; +const setupRNDebuggerBeforeImportScript = (message) => { + self.__REACT_DEVTOOLS_PORT__ = message.reactDevToolsPort if (message.networkInspect) { - self.__NETWORK_INSPECT__ = toggleNetworkInspect; + self.__NETWORK_INSPECT__ = toggleNetworkInspect } -}; +} -const noop = f => f; -const setupRNDebugger = async message => { +const noop = (f) => f +const setupRNDebugger = async (message) => { // We need to regularly update JS runtime // because the changes of worker message (Redux DevTools, DevMenu) // doesn't notify to the remote JS runtime self.__RND_INTERVAL__ = setInterval(noop, 100); // eslint-disable-line - toggleNetworkInspect(message.networkInspect); - const modules = await getRequiredModules(message.moduleSize); - const apolloCheckInterval = handleApolloClient(modules); + toggleNetworkInspect(message.networkInspect) + const modules = await getRequiredModules(message.moduleSize) + const apolloCheckInterval = handleApolloClient(modules) if (modules) { - ignoreRNDIntervalSpy(modules, [apolloCheckInterval]); - checkAvailableDevMenuMethods(modules); - reportDefaultReactDevToolsPort(modules); + ignoreRNDIntervalSpy(modules, [apolloCheckInterval]) + checkAvailableDevMenuMethods(modules) + reportDefaultReactDevToolsPort(modules) } -}; +} const messageHandlers = { executeApplicationScript(message, sendReply) { - setupRNDebuggerBeforeImportScript(message); + setupRNDebuggerBeforeImportScript(message) - Object.keys(message.inject).forEach(key => { - self[key] = JSON.parse(message.inject[key]); - }); - let error; + Object.keys(message.inject).forEach((key) => { + self[key] = JSON.parse(message.inject[key]) + }) + let error try { - importScripts(message.url); + importScripts(message.url) } catch (err) { - error = err.message; + error = err.message } if (!error) { - setupRNDebugger(message); + setupRNDebugger(message) } - sendReply(null /* result */, error); + sendReply(null /* result */, error) - return false; + return false }, emitReduxMessage() { // pass to other listeners - return true; + return true }, emitApolloMessage() { // pass to other listeners - return true; + return true }, invokeDevMenuMethod({ name, args }) { - invokeDevMenuMethodIfAvailable(name, args); - return false; + invokeDevMenuMethodIfAvailable(name, args) + return false }, beforeTerminate() { // Clean for notify native bridge if (window.__RND_INTERVAL__) { - clearInterval(window.__RND_INTERVAL__); - window.__RND_INTERVAL__ = null; + clearInterval(window.__RND_INTERVAL__) + window.__RND_INTERVAL__ = null } - return false; + return false }, -}; +} -addEventListener('message', message => { - const object = message.data; +addEventListener('message', (message) => { + const object = message.data const sendReply = (result, error) => { - postMessage({ replyID: object.id, result, error }); - }; + postMessage({ replyID: object.id, result, error }) + } - const handler = messageHandlers[object.method]; + const handler = messageHandlers[object.method] if (handler) { // Special cased handlers - return handler(object, sendReply); + return handler(object, sendReply) } // Other methods get called on the bridge - let returnValue = [[], [], [], 0]; - let error; + let returnValue = [[], [], [], 0] + let error try { if (typeof __fbBatchedBridge === 'object') { - returnValue = __fbBatchedBridge[object.method].apply(null, object.arguments); + returnValue = __fbBatchedBridge[object.method].apply(null, object.arguments) } else { - error = 'Failed to call function, __fbBatchedBridge is undefined'; + error = 'Failed to call function, __fbBatchedBridge is undefined' } } catch (err) { - error = err.message; + error = err.message } finally { - sendReply(JSON.stringify(returnValue), error); + sendReply(JSON.stringify(returnValue), error) } - return false; -}); + return false +}) diff --git a/app/worker/networkInspect.js b/app/worker/networkInspect.js index 8b2a6b08..287c0ae6 100644 --- a/app/worker/networkInspect.js +++ b/app/worker/networkInspect.js @@ -1,33 +1,33 @@ -import getRNDebuggerFetchPolyfills from './polyfills/fetch'; +import getRNDebuggerFetchPolyfills from './polyfills/fetch' -const isWorkerMethod = fn => String(fn).indexOf('[native code]') > -1; +const isWorkerMethod = (fn) => String(fn).indexOf('[native code]') > -1 /* eslint-disable no-underscore-dangle */ -let networkInspect; +let networkInspect -export const toggleNetworkInspect = enabled => { +export const toggleNetworkInspect = (enabled) => { if (!enabled && networkInspect) { - self.fetch = networkInspect.fetch; - self.XMLHttpRequest = networkInspect.XMLHttpRequest; - self.FormData = networkInspect.FormData; - self.Headers = networkInspect.Headers; - self.Request = networkInspect.Request; - self.Response = networkInspect.Response; - networkInspect = null; - return; + self.fetch = networkInspect.fetch + self.XMLHttpRequest = networkInspect.XMLHttpRequest + self.FormData = networkInspect.FormData + self.Headers = networkInspect.Headers + self.Request = networkInspect.Request + self.Response = networkInspect.Response + networkInspect = null + return } - if (!enabled) return; - if (enabled && networkInspect) return; + if (!enabled) return + if (enabled && networkInspect) return if (isWorkerMethod(self.XMLHttpRequest) || isWorkerMethod(self.FormData)) { console.warn( - '[RNDebugger] ' + - 'I tried to enable Network Inspect but XHR ' + - "have been replaced by worker's XHR. " + - 'You can disable Network Inspect (documentation: https://goo.gl/BVvEkJ) ' + - 'or tracking your app code if you have called ' + - '`global.XMLHttpRequest = global.originalXMLHttpRequest`.' - ); - return; + '[RNDebugger] ' + + 'I tried to enable Network Inspect but XHR ' + + "have been replaced by worker's XHR. " + + 'You can disable Network Inspect (documentation: https://goo.gl/BVvEkJ) ' + + 'or tracking your app code if you have called ' + + '`global.XMLHttpRequest = global.originalXMLHttpRequest`.', + ) + return } networkInspect = { fetch: self.fetch, @@ -36,24 +36,26 @@ export const toggleNetworkInspect = enabled => { Headers: self.Headers, Request: self.Request, Response: self.Response, - }; + } self.XMLHttpRequest = self.originalXMLHttpRequest ? self.originalXMLHttpRequest - : self.XMLHttpRequest; - self.FormData = self.originalFormData ? self.originalFormData : self.FormData; - const { fetch, Headers, Request, Response } = getRNDebuggerFetchPolyfills(); - self.fetch = fetch; - self.Headers = Headers; - self.Request = Request; - self.Response = Response; + : self.XMLHttpRequest + self.FormData = self.originalFormData ? self.originalFormData : self.FormData + const { + fetch, Headers, Request, Response, + } = getRNDebuggerFetchPolyfills() + self.fetch = fetch + self.Headers = Headers + self.Request = Request + self.Response = Response console.log( '[RNDebugger]', 'Network Inspect is enabled,', - 'see the documentation (https://goo.gl/yEcRrU) for more information.' - ); -}; + 'see the documentation (https://goo.gl/yEcRrU) for more information.', + ) +} /* * `originalXMLHttpRequest` haven't permission to set forbidden header name @@ -83,40 +85,39 @@ const forbiddenHeaderNames = [ 'Via', // Actually it still blocked on Chrome 'User-Agent', -]; -forbiddenHeaderNames.forEach(name => forbiddenHeaderNames.push(name.toLowerCase())); +] +forbiddenHeaderNames.forEach((name) => forbiddenHeaderNames.push(name.toLowerCase())) -const isForbiddenHeaderName = header => - forbiddenHeaderNames.includes(header) || - header.startsWith('Proxy-') || - header.startsWith('proxy-') || - header.startsWith('Sec-') || - header.startsWith('sec-'); +const isForbiddenHeaderName = (header) => forbiddenHeaderNames.includes(header) + || header.startsWith('Proxy-') + || header.startsWith('proxy-') + || header.startsWith('Sec-') + || header.startsWith('sec-') export const replaceForbiddenHeadersForWorkerXHR = () => { - if (!isWorkerMethod(self.XMLHttpRequest)) return; - const originalSetRequestHeader = self.XMLHttpRequest.prototype.setRequestHeader; + if (!isWorkerMethod(self.XMLHttpRequest)) return + const originalSetRequestHeader = self.XMLHttpRequest.prototype.setRequestHeader self.XMLHttpRequest.prototype.setRequestHeader = function setRequestHeader(header, value) { - let replacedHeader = header; + let replacedHeader = header if (isForbiddenHeaderName(header)) { - replacedHeader = `__RN_DEBUGGER_SET_HEADER_REQUEST_${header}`; + replacedHeader = `__RN_DEBUGGER_SET_HEADER_REQUEST_${header}` } - return originalSetRequestHeader.call(this, replacedHeader, value); - }; -}; + return originalSetRequestHeader.call(this, replacedHeader, value) + } +} export const addURIWarningForWorkerFormData = () => { - if (!isWorkerMethod(self.FormData)) return; - const originAppend = FormData.prototype.append; + if (!isWorkerMethod(self.FormData)) return + const originAppend = FormData.prototype.append self.FormData.prototype.append = function append(key, value) { if (value && value.uri) { console.warn( - '[RNDebugger] ' + - "Detected you're enabled Network Inspect and using `uri` in FormData, " + - 'it will be a problem if you use it for upload, ' + - 'please see the documentation (https://goo.gl/yEcRrU) for more information.' - ); + '[RNDebugger] ' + + "Detected you're enabled Network Inspect and using `uri` in FormData, " + + 'it will be a problem if you use it for upload, ' + + 'please see the documentation (https://goo.gl/yEcRrU) for more information.', + ) } - return originAppend.call(this, key, value); - }; -}; + return originAppend.call(this, key, value) + } +} diff --git a/app/worker/polyfills/fetch.js b/app/worker/polyfills/fetch.js index dd895aa7..e722854b 100644 --- a/app/worker/polyfills/fetch.js +++ b/app/worker/polyfills/fetch.js @@ -12,13 +12,13 @@ export default function getRNDebuggerFetchPolyfills() { blob: false, // NOTE: Default for RNDebugger formData: 'FormData' in self, arrayBuffer: 'ArrayBuffer' in self, - }; + } function isDataView(obj) { - return obj && DataView.prototype.isPrototypeOf(obj); + return obj && DataView.prototype.isPrototypeOf(obj) } - let isArrayBufferView; + let isArrayBufferView if (support.arrayBuffer) { const viewClasses = [ '[object Int8Array]', @@ -30,375 +30,376 @@ export default function getRNDebuggerFetchPolyfills() { '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]', - ]; + ] - isArrayBufferView = - ArrayBuffer.isView || - function (obj) { - return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1; - }; + isArrayBufferView = ArrayBuffer.isView + || function (obj) { + return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 + } } function normalizeName(name) { if (typeof name !== 'string') { - name = String(name); + name = String(name) } if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name) || name === '') { - throw new TypeError('Invalid character in header field name'); + throw new TypeError('Invalid character in header field name') } - return name.toLowerCase(); + return name.toLowerCase() } function normalizeValue(value) { if (typeof value !== 'string') { - value = String(value); + value = String(value) } - return value; + return value } // Build a destructive iterator for the value list function iteratorFor(items) { const iterator = { next() { - const value = items.shift(); - return { done: value === undefined, value }; + const value = items.shift() + return { done: value === undefined, value } }, - }; + } if (support.iterable) { iterator[Symbol.iterator] = function () { - return iterator; - }; + return iterator + } } - return iterator; + return iterator } function Headers(headers) { - this.map = {}; + this.map = {} if (headers instanceof Headers) { headers.forEach(function (value, name) { - this.append(name, value); - }, this); + this.append(name, value) + }, this) } else if (Array.isArray(headers)) { headers.forEach(function (header) { - this.append(header[0], header[1]); - }, this); + this.append(header[0], header[1]) + }, this) } else if (headers) { Object.getOwnPropertyNames(headers).forEach(function (name) { - this.append(name, headers[name]); - }, this); + this.append(name, headers[name]) + }, this) } } Headers.prototype.append = function (name, value) { - name = normalizeName(name); - value = normalizeValue(value); - const oldValue = this.map[name]; - this.map[name] = oldValue ? `${oldValue}, ${value}` : value; - }; + name = normalizeName(name) + value = normalizeValue(value) + const oldValue = this.map[name] + this.map[name] = oldValue ? `${oldValue}, ${value}` : value + } Headers.prototype.delete = function (name) { - delete this.map[normalizeName(name)]; - }; + delete this.map[normalizeName(name)] + } Headers.prototype.get = function (name) { - name = normalizeName(name); - return this.has(name) ? this.map[name] : null; - }; + name = normalizeName(name) + return this.has(name) ? this.map[name] : null + } Headers.prototype.has = function (name) { - return this.map.hasOwnProperty(normalizeName(name)); - }; + return this.map.hasOwnProperty(normalizeName(name)) + } Headers.prototype.set = function (name, value) { - this.map[normalizeName(name)] = normalizeValue(value); - }; + this.map[normalizeName(name)] = normalizeValue(value) + } Headers.prototype.forEach = function (callback, thisArg) { for (const name in this.map) { if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this); + callback.call(thisArg, this.map[name], name, this) } } - }; + } Headers.prototype.keys = function () { - const items = []; + const items = [] this.forEach((value, name) => { - items.push(name); - }); - return iteratorFor(items); - }; + items.push(name) + }) + return iteratorFor(items) + } Headers.prototype.values = function () { - const items = []; - this.forEach(value => { - items.push(value); - }); - return iteratorFor(items); - }; + const items = [] + this.forEach((value) => { + items.push(value) + }) + return iteratorFor(items) + } Headers.prototype.entries = function () { - const items = []; + const items = [] this.forEach((value, name) => { - items.push([name, value]); - }); - return iteratorFor(items); - }; + items.push([name, value]) + }) + return iteratorFor(items) + } if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; + Headers.prototype[Symbol.iterator] = Headers.prototype.entries } function consumed(body) { if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')); + return Promise.reject(new TypeError('Already read')) } - body.bodyUsed = true; + body.bodyUsed = true } function fileReaderReady(reader) { return new Promise((resolve, reject) => { reader.onload = function () { - resolve(reader.result); - }; + resolve(reader.result) + } reader.onerror = function () { - reject(reader.error); - }; - }); + reject(reader.error) + } + }) } function readBlobAsArrayBuffer(blob) { - const reader = new FileReader(); - const promise = fileReaderReady(reader); - reader.readAsArrayBuffer(blob); - return promise; + const reader = new FileReader() + const promise = fileReaderReady(reader) + reader.readAsArrayBuffer(blob) + return promise } function readBlobAsText(blob) { - const reader = new FileReader(); - const promise = fileReaderReady(reader); - reader.readAsText(blob); - return promise; + const reader = new FileReader() + const promise = fileReaderReady(reader) + reader.readAsText(blob) + return promise } function readArrayBufferAsText(buf) { - const view = new Uint8Array(buf); - const chars = new Array(view.length); + const view = new Uint8Array(buf) + const chars = new Array(view.length) - for (let i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]); + for (let i = 0; i < view.length; i += 1) { + chars[i] = String.fromCharCode(view[i]) } - return chars.join(''); + return chars.join('') } function bufferClone(buf) { if (buf.slice) { - return buf.slice(0); + return buf.slice(0) } - const view = new Uint8Array(buf.byteLength); - view.set(new Uint8Array(buf)); - return view.buffer; + const view = new Uint8Array(buf.byteLength) + view.set(new Uint8Array(buf)) + return view.buffer } function decode(body) { - const form = new FormData(); + const form = new FormData() body .trim() .split('&') - .forEach(bytes => { + .forEach((bytes) => { if (bytes) { - const split = bytes.split('='); - const name = split.shift().replace(/\+/g, ' '); - const value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); + const split = bytes.split('=') + const name = split.shift().replace(/\+/g, ' ') + const value = split.join('=').replace(/\+/g, ' ') + form.append(decodeURIComponent(name), decodeURIComponent(value)) } - }); - return form; + }) + return form } function Body() { - this.bodyUsed = false; + this.bodyUsed = false this._initBody = function (body) { - this._bodyInit = body; + this._bodyInit = body if (!body) { - this._bodyText = ''; + this._bodyText = '' } else if (typeof body === 'string') { - this._bodyText = body; + this._bodyText = body } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; + this._bodyBlob = body } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; + this._bodyFormData = body } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString(); + this._bodyText = body.toString() } else if (support.arrayBuffer && support.blob && isDataView(body)) { - this._bodyArrayBuffer = bufferClone(body.buffer); + this._bodyArrayBuffer = bufferClone(body.buffer) // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]); + this._bodyInit = new Blob([this._bodyArrayBuffer]) } else if ( - support.arrayBuffer && - (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body)) + support.arrayBuffer + && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body)) ) { - this._bodyArrayBuffer = bufferClone(body); + this._bodyArrayBuffer = bufferClone(body) } else { - this._bodyText = body = Object.prototype.toString.call(body); + const bodyText = Object.prototype.toString.call(body) + body = bodyText + this._bodyText = bodyText } if (!this.headers.get('content-type')) { if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); + this.headers.set('content-type', 'text/plain;charset=UTF-8') } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); + this.headers.set('content-type', this._bodyBlob.type) } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); + this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8') } } - }; + } if (support.blob) { this.blob = function () { - const rejected = consumed(this); + const rejected = consumed(this) if (rejected) { - return rejected; + return rejected } if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob); - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])); - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob'); + return Promise.resolve(this._bodyBlob) + } if (this._bodyArrayBuffer) { + return Promise.resolve(new Blob([this._bodyArrayBuffer])) + } if (this._bodyFormData) { + throw new Error('could not read FormData body as blob') } else { - return Promise.resolve(new Blob([this._bodyText])); + return Promise.resolve(new Blob([this._bodyText])) } - }; + } this.arrayBuffer = function () { if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer); + return consumed(this) || Promise.resolve(this._bodyArrayBuffer) } - return this.blob().then(readBlobAsArrayBuffer); - }; + return this.blob().then(readBlobAsArrayBuffer) + } } this.text = function () { - const rejected = consumed(this); + const rejected = consumed(this) if (rejected) { - return rejected; + return rejected } if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob); - } else if (this._bodyArrayBuffer) { - return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text'); + return readBlobAsText(this._bodyBlob) + } if (this._bodyArrayBuffer) { + return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) + } if (this._bodyFormData) { + throw new Error('could not read FormData body as text') } else { - return Promise.resolve(this._bodyText); + return Promise.resolve(this._bodyText) } - }; + } if (support.formData) { this.formData = function () { - return this.text().then(decode); - }; + return this.text().then(decode) + } } this.json = function () { - return this.text().then(JSON.parse); - }; + return this.text().then(JSON.parse) + } - return this; + return this } // HTTP methods whose capitalization should be normalized - const methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; + const methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'] function normalizeMethod(method) { - const upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method; + const upcased = method.toUpperCase() + return methods.indexOf(upcased) > -1 ? upcased : method } function Request(input, options) { - options = options || {}; - let body = options.body; + options = options || {} + let { body } = options if (input instanceof Request) { if (input.bodyUsed) { - throw new TypeError('Already read'); + throw new TypeError('Already read') } - this.url = input.url; - this.credentials = input.credentials; + this.url = input.url + this.credentials = input.credentials if (!options.headers) { - this.headers = new Headers(input.headers); + this.headers = new Headers(input.headers) } - this.method = input.method; - this.mode = input.mode; - this.signal = input.signal; + this.method = input.method + this.mode = input.mode + this.signal = input.signal if (!body && input._bodyInit != null) { - body = input._bodyInit; - input.bodyUsed = true; + body = input._bodyInit + input.bodyUsed = true } } else { - this.url = String(input); + this.url = String(input) } - this.credentials = options.credentials || this.credentials || 'same-origin'; + this.credentials = options.credentials || this.credentials || 'same-origin' if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); + this.headers = new Headers(options.headers) } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.signal = options.signal || this.signal; - this.referrer = null; + this.method = normalizeMethod(options.method || this.method || 'GET') + this.mode = options.mode || this.mode || null + this.signal = options.signal || this.signal + this.referrer = null if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests'); + throw new TypeError('Body not allowed for GET or HEAD requests') } - this._initBody(body); + this._initBody(body) } Request.prototype.clone = function () { - return new Request(this, { body: this._bodyInit }); - }; + return new Request(this, { body: this._bodyInit }) + } function parseHeaders(rawHeaders) { - const headers = new Headers(); + const headers = new Headers() // Replace instances of \r\n and \n followed by // at least one space or horizontal tab with a space // https://tools.ietf.org/html/rfc7230#section-3.2 - const preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); - preProcessedHeaders.split(/\r?\n/).forEach(line => { - const parts = line.split(':'); - const key = parts.shift().trim(); + const preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ') + preProcessedHeaders.split(/\r?\n/).forEach((line) => { + const parts = line.split(':') + const key = parts.shift().trim() if (key) { - const value = parts.join(':').trim(); - headers.append(key, value); + const value = parts.join(':').trim() + headers.append(key, value) } - }); - return headers; + }) + return headers } - Body.call(Request.prototype); + Body.call(Request.prototype) function Response(bodyInit, options) { if (!options) { - options = {}; + options = {} } - this.type = 'default'; - this.status = options.status === undefined ? 200 : options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = 'statusText' in options ? options.statusText : 'OK'; - this.headers = new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); + this.type = 'default' + this.status = options.status === undefined ? 200 : options.status + this.ok = this.status >= 200 && this.status < 300 + this.statusText = 'statusText' in options ? options.statusText : 'OK' + this.headers = new Headers(options.headers) + this.url = options.url || '' + this._initBody(bodyInit) } - Body.call(Response.prototype); + Body.call(Response.prototype) Response.prototype.clone = function () { return new Response(this._bodyInit, { @@ -406,51 +407,52 @@ export default function getRNDebuggerFetchPolyfills() { statusText: this.statusText, headers: new Headers(this.headers), url: this.url, - }); - }; + }) + } Response.error = function () { - const response = new Response(null, { status: 0, statusText: '' }); - response.type = 'error'; - return response; - }; + const response = new Response(null, { status: 0, statusText: '' }) + response.type = 'error' + return response + } - const redirectStatuses = [301, 302, 303, 307, 308]; + const redirectStatuses = [301, 302, 303, 307, 308] Response.redirect = function (url, status) { if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code'); + throw new RangeError('Invalid status code') } - return new Response(null, { status, headers: { location: url } }); - }; + return new Response(null, { status, headers: { location: url } }) + } - let DOMException = self.DOMException; + let { DOMException } = self try { - new DOMException(); + new DOMException() } catch (err) { DOMException = function (message, name) { - this.message = message; - this.name = name; - const error = Error(message); - this.stack = error.stack; - }; - DOMException.prototype = Object.create(Error.prototype); - DOMException.prototype.constructor = DOMException; + this.message = message + this.name = name + const error = Error(message) + this.stack = error.stack + } + DOMException.prototype = Object.create(Error.prototype) + DOMException.prototype.constructor = DOMException } function fetch(input, init) { return new Promise((resolve, reject) => { - const request = new Request(input, init); + const request = new Request(input, init) if (request.signal && request.signal.aborted) { - return reject(new DOMException('Aborted', 'AbortError')); + reject(new DOMException('Aborted', 'AbortError')) + return } - const xhr = new XMLHttpRequest(); + const xhr = new XMLHttpRequest() function abortXhr() { - xhr.abort(); + xhr.abort() } xhr.onload = function () { @@ -458,61 +460,61 @@ export default function getRNDebuggerFetchPolyfills() { status: xhr.status, statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || ''), - }; - options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); - const body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; + } + options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL') + const body = 'response' in xhr ? xhr.response : xhr.responseText + resolve(new Response(body, options)) + } xhr.onerror = function () { - reject(new TypeError('Network request failed')); - }; + reject(new TypeError('Network request failed')) + } xhr.ontimeout = function () { - reject(new TypeError('Network request failed')); - }; + reject(new TypeError('Network request failed')) + } xhr.onabort = function () { - reject(new DOMException('Aborted', 'AbortError')); - }; + reject(new DOMException('Aborted', 'AbortError')) + } - xhr.open(request.method, request.url, true); + xhr.open(request.method, request.url, true) if (request.credentials === 'include') { - xhr.withCredentials = true; + xhr.withCredentials = true } else if (request.credentials === 'omit') { - xhr.withCredentials = false; + xhr.withCredentials = false } if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; + xhr.responseType = 'blob' } request.headers.forEach((value, name) => { - xhr.setRequestHeader(name, value); - }); + xhr.setRequestHeader(name, value) + }) if (request.signal) { - request.signal.addEventListener('abort', abortXhr); + request.signal.addEventListener('abort', abortXhr) xhr.onreadystatechange = function () { // DONE (success or failure) if (xhr.readyState === 4) { - request.signal.removeEventListener('abort', abortXhr); + request.signal.removeEventListener('abort', abortXhr) } - }; + } } - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }); + xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit) + }) } - fetch.polyfill = true; + fetch.polyfill = true return { fetch, Headers, Request, Response, - }; + } } diff --git a/app/worker/reactDevTools.js b/app/worker/reactDevTools.js index 43bb7762..0d77110f 100644 --- a/app/worker/reactDevTools.js +++ b/app/worker/reactDevTools.js @@ -1,27 +1,26 @@ /* eslint-disable no-underscore-dangle */ -const methodGlobalName = '__REPORT_REACT_DEVTOOLS_PORT__'; +const methodGlobalName = '__REPORT_REACT_DEVTOOLS_PORT__' -const reportReactDevToolsPort = (port, platform) => - postMessage({ - [methodGlobalName]: port, - platform, - }); +const reportReactDevToolsPort = (port, platform) => postMessage({ + [methodGlobalName]: port, + platform, +}) export const reportDefaultReactDevToolsPort = async ({ setupDevtools, Platform }) => { - if (Platform.__empty) return; + if (Platform.__empty) return /* * [Fallback] React Native version under 0.39 can't specified the port */ if ( - typeof setupDevtools === 'function' && - setupDevtools.toString().indexOf('window.__REACT_DEVTOOLS_PORT__') === -1 + typeof setupDevtools === 'function' + && setupDevtools.toString().indexOf('window.__REACT_DEVTOOLS_PORT__') === -1 ) { - reportReactDevToolsPort(8097, Platform.OS); + reportReactDevToolsPort(8097, Platform.OS) } else { // React Inspector will keep the last reported port even if reload JS, // because we don't want to icrease the user waiting time for reload JS. // We need back to use the random port if we don't need fallback - reportReactDevToolsPort(window.__REACT_DEVTOOLS_PORT__, Platform.OS); + reportReactDevToolsPort(window.__REACT_DEVTOOLS_PORT__, Platform.OS) } -}; +} diff --git a/app/worker/reduxAPI.js b/app/worker/reduxAPI.js index c99d96ed..043e167e 100644 --- a/app/worker/reduxAPI.js +++ b/app/worker/reduxAPI.js @@ -1,4 +1,4 @@ -import { instrument } from '@redux-devtools/instrument'; +import { instrument } from '@redux-devtools/instrument' import { evalAction, getActionsArray, @@ -10,60 +10,60 @@ import { isFiltered, filterStagedActions, filterState, -} from '@redux-devtools/utils'; -import { updateStackWithSourceMap } from './utils'; +} from '@redux-devtools/utils' +import { updateStackWithSourceMap } from './utils' function configureStore(next, subscriber, options) { - return instrument(subscriber, options)(next); + return instrument(subscriber, options)(next) } const instances = { /* [id]: { name, store, ... } */ -}; +} -let lastAction; -let isExcess; -let listenerAdded; -let locked; -let paused; +let lastAction +let isExcess +let listenerAdded +let locked +let paused function getStackTrace(config, toExcludeFromTrace) { - if (!config.trace) return undefined; - if (typeof config.trace === 'function') return config.trace(); + if (!config.trace) return undefined + if (typeof config.trace === 'function') return config.trace() - let stack; - let extraFrames = 0; - let prevStackTraceLimit; - const traceLimit = config.traceLimit; - const error = Error(); + let stack + let extraFrames = 0 + let prevStackTraceLimit + const { traceLimit } = config + const error = Error() if (Error.captureStackTrace) { if (Error.stackTraceLimit < traceLimit) { - prevStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = traceLimit; + prevStackTraceLimit = Error.stackTraceLimit + Error.stackTraceLimit = traceLimit } - Error.captureStackTrace(error, toExcludeFromTrace); + Error.captureStackTrace(error, toExcludeFromTrace) } else { - extraFrames = 3; + extraFrames = 3 } - stack = error.stack; - if (prevStackTraceLimit) Error.stackTraceLimit = prevStackTraceLimit; + stack = error.stack + if (prevStackTraceLimit) Error.stackTraceLimit = prevStackTraceLimit if ( - extraFrames || - typeof Error.stackTraceLimit !== 'number' || - Error.stackTraceLimit > traceLimit + extraFrames + || typeof Error.stackTraceLimit !== 'number' + || Error.stackTraceLimit > traceLimit ) { - const frames = stack.split('\n'); + const frames = stack.split('\n') if (frames.length > traceLimit) { stack = frames .slice(0, traceLimit + extraFrames + (frames[0] === 'Error' ? 1 : 0)) - .join('\n'); + .join('\n') } } - return updateStackWithSourceMap(stack); + return updateStackWithSourceMap(stack) } function getLiftedState(store, filters) { - return filterStagedActions(store.liftedStore.getState(), filters); + return filterStagedActions(store.liftedStore.getState(), filters) } function relay(type, state, instance, action, nextActionId) { @@ -74,76 +74,75 @@ function relay(type, state, instance, action, nextActionId) { actionSanitizer, serializeState, serializeAction, - } = instance; + } = instance const message = { type, id: instance.id, name: instance.name, - }; + } if (state) { - message.payload = - type === 'ERROR' - ? state - : stringify( - filterState( - state, - type, - filters, - stateSanitizer, - actionSanitizer, - nextActionId, - predicate - ), - serializeState - ); + message.payload = type === 'ERROR' + ? state + : stringify( + filterState( + state, + type, + filters, + stateSanitizer, + actionSanitizer, + nextActionId, + predicate, + ), + serializeState, + ) } if (type === 'ACTION') { - action.stack = getStackTrace(instance, true); + action.stack = getStackTrace(instance, true) message.action = stringify( !actionSanitizer ? action : actionSanitizer(action.action, nextActionId - 1), - serializeAction - ); - message.isExcess = isExcess; - message.nextActionId = nextActionId; + serializeAction, + ) + message.isExcess = isExcess + message.nextActionId = nextActionId } else if (instance) { message.libConfig = { type: 'redux', actionCreators: stringify(instance.actionCreators), serialize: !!instance.serialize, - }; + } } - postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message }); + postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message }) } function dispatchRemotely(action, instance) { try { - const { store, actionCreators } = instance; - const result = evalAction(action, actionCreators); - store.dispatch(result); + const { store, actionCreators } = instance + const result = evalAction(action, actionCreators) + store.dispatch(result) } catch (e) { - relay('ERROR', e.message, instance); + relay('ERROR', e.message, instance) } } function importPayloadFrom(store, state, instance) { try { - const nextLiftedState = importState(state, instance); - if (!nextLiftedState) return; - store.liftedStore.dispatch({ type: 'IMPORT_STATE', ...nextLiftedState }); - relay('STATE', getLiftedState(store, instance.filters), instance); + const nextLiftedState = importState(state, instance) + if (!nextLiftedState) return + store.liftedStore.dispatch({ type: 'IMPORT_STATE', ...nextLiftedState }) + relay('STATE', getLiftedState(store, instance.filters), instance) } catch (e) { - relay('ERROR', e.message, instance); + relay('ERROR', e.message, instance) } } function exportState({ id: instanceId, store, serializeState }) { - const liftedState = store.liftedStore.getState(); - const actionsById = liftedState.actionsById; - const payload = []; - liftedState.stagedActionIds.slice(1).forEach(id => { - payload.push(actionsById[id].action); - }); + const liftedState = store.liftedStore.getState() + const { actionsById } = liftedState + const payload = [] + liftedState.stagedActionIds.slice(1).forEach((id) => { + payload.push(actionsById[id].action) + }) postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: { @@ -155,98 +154,100 @@ function exportState({ id: instanceId, store, serializeState }) { : undefined, instanceId, }, - }); + }) } function handleMessages(message) { - const { id, instanceId, type, action, state, toAll } = message; + const { + id, instanceId, type, action, state, toAll, + } = message if (toAll) { - Object.keys(instances).forEach(key => { - handleMessages({ ...message, id: key, toAll: false }); - }); - return false; + Object.keys(instances).forEach((key) => { + handleMessages({ ...message, id: key, toAll: false }) + }) + return false } - const instance = instances[id || instanceId]; - if (!instance) return true; - const { store, filters } = instance; - if (!store) return false; + const instance = instances[id || instanceId] + if (!instance) return true + const { store, filters } = instance + if (!store) return false switch (type) { case 'DISPATCH': - store.liftedStore.dispatch(action); - break; + store.liftedStore.dispatch(action) + break case 'ACTION': - dispatchRemotely(action, instance); - break; + dispatchRemotely(action, instance) + break case 'IMPORT': - importPayloadFrom(store, state, instance); - break; + importPayloadFrom(store, state, instance) + break case 'EXPORT': - exportState(instance); - break; + exportState(instance) + break case 'UPDATE': - relay('STATE', getLiftedState(store, filters), instance); - break; + relay('STATE', getLiftedState(store, filters), instance) + break default: - break; + break } - return false; + return false } function start(instance) { if (!listenerAdded) { - self.addEventListener('message', message => { - const { method, content } = message.data; + self.addEventListener('message', (message) => { + const { method, content } = message.data if (method === 'emitReduxMessage') { - handleMessages(content); + handleMessages(content) } - }); - listenerAdded = true; + }) + listenerAdded = true } - const { store, actionCreators, filters } = instance; + const { store, actionCreators, filters } = instance if (typeof actionCreators === 'function') { - instance.actionCreators = actionCreators(); + instance.actionCreators = actionCreators() } - relay('STATE', getLiftedState(store, filters), instance); + relay('STATE', getLiftedState(store, filters), instance) } function checkForReducerErrors(liftedState, instance) { if (liftedState.computedStates[liftedState.currentStateIndex].error) { - relay('STATE', filterStagedActions(liftedState, instance.filters), instance); - return true; + relay('STATE', filterStagedActions(liftedState, instance.filters), instance) + return true } - return false; + return false } -function monitorReducer(state = {}, action) { - lastAction = action.type; - return state; +function monitorReducer(state = {}, action = {}) { + lastAction = action.type + return state } function handleChange(state, liftedState, maxAge, instance) { - if (checkForReducerErrors(liftedState, instance)) return; + if (checkForReducerErrors(liftedState, instance)) return - const { filters, predicate } = instance; + const { filters, predicate } = instance if (lastAction === 'PERFORM_ACTION') { - const nextActionId = liftedState.nextActionId; - const liftedAction = liftedState.actionsById[nextActionId - 1]; - if (isFiltered(liftedAction.action, filters)) return; - if (predicate && !predicate(state, liftedAction.action)) return; - relay('ACTION', state, instance, liftedAction, nextActionId); - if (!isExcess && maxAge) isExcess = liftedState.stagedActionIds.length >= maxAge; + const { nextActionId } = liftedState + const liftedAction = liftedState.actionsById[nextActionId - 1] + if (isFiltered(liftedAction.action, filters)) return + if (predicate && !predicate(state, liftedAction.action)) return + relay('ACTION', state, instance, liftedAction, nextActionId) + if (!isExcess && maxAge) isExcess = liftedState.stagedActionIds.length >= maxAge } else { - if (lastAction === 'JUMP_TO_STATE') return; + if (lastAction === 'JUMP_TO_STATE') return if (lastAction === 'PAUSE_RECORDING') { - paused = liftedState.isPaused; + paused = liftedState.isPaused } else if (lastAction === 'LOCK_CHANGES') { - locked = liftedState.isLocked; + locked = liftedState.isLocked } if (paused || locked) { - if (lastAction) lastAction = undefined; - else return; + if (lastAction) lastAction = undefined + else return } - relay('STATE', filterStagedActions(liftedState, filters), instance); + relay('STATE', filterStagedActions(liftedState, filters), instance) } } @@ -271,13 +272,13 @@ export default function devToolsEnhancer(options = {}) { predicate, trace, traceLimit, - } = options; - const id = generateId(options.instanceId); + } = options + const id = generateId(options.instanceId) - const serializeState = getSeralizeParameter(options, 'serializeState'); - const serializeAction = getSeralizeParameter(options, 'serializeAction'); + const serializeState = getSeralizeParameter(options, 'serializeState') + const serializeAction = getSeralizeParameter(options, 'serializeAction') - return next => (reducer, initialState) => { + return (next) => (reducer, initialState) => { const store = configureStore(next, monitorReducer, { maxAge, shouldCatchErrors, @@ -285,7 +286,7 @@ export default function devToolsEnhancer(options = {}) { shouldRecordChanges, shouldStartLocked, pauseActionType, - })(reducer, initialState); + })(reducer, initialState) instances[id] = { name: name || id, @@ -306,67 +307,67 @@ export default function devToolsEnhancer(options = {}) { predicate, trace, traceLimit, - }; + } - start(instances[id]); + start(instances[id]) store.subscribe(() => { - handleChange(store.getState(), store.liftedStore.getState(), maxAge, instances[id]); - }); - return store; - }; + handleChange(store.getState(), store.liftedStore.getState(), maxAge, instances[id]) + }) + return store + } } -const preEnhancer = instanceId => next => (reducer, initialState, enhancer) => { - const store = next(reducer, initialState, enhancer); +const preEnhancer = (instanceId) => (next) => (reducer, initialState, enhancer) => { + const store = next(reducer, initialState, enhancer) if (instances[instanceId]) { - instances[instanceId].store = store; + instances[instanceId].store = store } return { ...store, - dispatch: action => (locked ? action : store.dispatch(action)), - }; -}; + dispatch: (action) => (locked ? action : store.dispatch(action)), + } +} devToolsEnhancer.updateStore = (newStore, instanceId) => { console.warn( '[RNDebugger]', '`updateStore` is deprecated use `window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__` instead:', - 'https://github.com/jhen0409/react-native-debugger/blob/master/docs/redux-devtools-integration.md' - ); + 'https://github.com/jhen0409/react-native-debugger/blob/master/docs/redux-devtools-integration.md', + ) - const keys = Object.keys(instances); - if (!keys.length) return; + const keys = Object.keys(instances) + if (!keys.length) return if (keys.length > 1 && !instanceId) { console.warn( 'You have multiple stores,', - 'please provide `instanceId` argument (`updateStore(store, instanceId)`)' - ); + 'please provide `instanceId` argument (`updateStore(store, instanceId)`)', + ) } if (instanceId) { - const instance = instances[instanceId]; - if (!instance) return; - instance.store = newStore; + const instance = instances[instanceId] + if (!instance) return + instance.store = newStore } else { - instances[keys[0]].store = newStore; + instances[keys[0]].store = newStore } -}; +} -const compose = options => (...funcs) => (...args) => { - const instanceId = generateId(options.instanceId); +const compose = (options) => (...funcs) => (...args) => { + const instanceId = generateId(options.instanceId) return [preEnhancer(instanceId), ...funcs].reduceRight( (composed, f) => f(composed), - devToolsEnhancer({ ...options, instanceId })(...args) - ); -}; + devToolsEnhancer({ ...options, instanceId })(...args), + ) +} export function composeWithDevTools(...funcs) { if (funcs.length === 0) { - return devToolsEnhancer(); + return devToolsEnhancer() } if (funcs.length === 1 && typeof funcs[0] === 'object') { - return compose(funcs[0]); + return compose(funcs[0]) } - return compose({})(...funcs); + return compose({})(...funcs) } diff --git a/app/worker/remotedev.js b/app/worker/remotedev.js index de9761f9..31e08993 100644 --- a/app/worker/remotedev.js +++ b/app/worker/remotedev.js @@ -1,65 +1,65 @@ // Edit from https://github.com/zalmoxisus/remotedev/blob/master/src/devTools.js -import { stringify, parse } from 'jsan'; -import { generateId, getActionsArray } from '@redux-devtools/utils'; +import { stringify, parse } from 'jsan' +import { generateId, getActionsArray } from '@redux-devtools/utils' -let listenerAdded; -const listeners = {}; +let listenerAdded +const listeners = {} export function extractState(message) { - if (!message || !message.state) return undefined; - if (typeof message.state === 'string') return parse(message.state); - return message.state; + if (!message || !message.state) return undefined + if (typeof message.state === 'string') return parse(message.state) + return message.state } function handleMessages(message) { if (!message.payload) { - message.payload = message.action; + message.payload = message.action } - const fn = listeners[message.instanceId]; - if (!fn) return true; + const fn = listeners[message.instanceId] + if (!fn) return true if (typeof fn === 'function') { - fn(message); + fn(message) } else { - fn.forEach(func => func(message)); + fn.forEach((func) => func(message)) } - return false; + return false } export function start() { if (!listenerAdded) { - self.addEventListener('message', message => { - const { method, content } = message.data; + self.addEventListener('message', (message) => { + const { method, content } = message.data if (method === 'emitReduxMessage') { - return handleMessages(content); + return handleMessages(content) } - }); - listenerAdded = true; + }) + listenerAdded = true } } function transformAction(action, config) { - if (action.action) return action; - const liftedAction = { timestamp: Date.now() }; + if (action.action) return action + const liftedAction = { timestamp: Date.now() } if (action) { if (config.getActionType) { - liftedAction.action = config.getActionType(action); + liftedAction.action = config.getActionType(action) } else if (typeof action === 'string') { - liftedAction.action = { type: action }; + liftedAction.action = { type: action } } else if (!action.type) { - liftedAction.action = { type: 'update' }; + liftedAction.action = { type: 'update' } } else { - liftedAction.action = action; + liftedAction.action = action } } else { - liftedAction.action = { type: action }; + liftedAction.action = { type: action } } - return liftedAction; + return liftedAction } export function send(action, state, type, options) { - start(); + start() setTimeout(() => { const message = { payload: state ? stringify(state) : '', @@ -68,54 +68,54 @@ export function send(action, state, type, options) { id: options.instanceId, instanceId: options.instanceId, name: options.name, - }; + } message.libConfig = { type: options.type, name: options.name, serialize: !!options.serialize, actionCreators: options.actionCreators, - }; - postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message }); - }, 0); + } + postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message }) + }, 0) } export function connect(options = {}) { - const id = generateId(options.instanceId); + const id = generateId(options.instanceId) const opts = { ...options, instanceId: id, name: options.name || id, actionCreators: JSON.stringify(getActionsArray(options.actionCreators || {})), - }; - start(); + } + start() return { init(state, action) { - send(action || {}, state, 'INIT', opts); + send(action || {}, state, 'INIT', opts) }, subscribe(listener) { - if (!listener) return undefined; - if (!listeners[id]) listeners[id] = []; - listeners[id].push(listener); + if (!listener) return undefined + if (!listeners[id]) listeners[id] = [] + listeners[id].push(listener) return function unsubscribe() { - const index = listeners[id].indexOf(listener); - listeners[id].splice(index, 1); - }; + const index = listeners[id].indexOf(listener) + listeners[id].splice(index, 1) + } }, unsubscribe() { - delete listeners[id]; + delete listeners[id] }, send(action, payload) { if (action) { - send(action, payload, 'ACTION', opts); + send(action, payload, 'ACTION', opts) } else { - send(undefined, payload, 'STATE', opts); + send(undefined, payload, 'STATE', opts) } }, error(payload) { - send(undefined, payload, 'Error', opts); + send(undefined, payload, 'Error', opts) }, - }; + } } // Not implemented diff --git a/app/worker/setup.js b/app/worker/setup.js index 5163ebce..d8ce5617 100644 --- a/app/worker/setup.js +++ b/app/worker/setup.js @@ -1,10 +1,10 @@ import { replaceForbiddenHeadersForWorkerXHR, addURIWarningForWorkerFormData, -} from './networkInspect'; +} from './networkInspect' // Add the missing `global` for WebWorker -self.global = self; +self.global = self /* * Blob is not supported for RN < 0.54, @@ -18,26 +18,26 @@ if (self.Blob && self.Blob.toString() === 'function Blob() { [native code] }') { * We will need to be able to restore the original when running RN > 0.54 for networking tools, * so add the reference here as react-native will not do it if the original is deleted */ - self.originalBlob = self.Blob; - delete self.Blob; + self.originalBlob = self.Blob + delete self.Blob } if ( - self.XMLHttpRequest && - self.XMLHttpRequest.toString() === 'function XMLHttpRequest() { [native code] }' + self.XMLHttpRequest + && self.XMLHttpRequest.toString() === 'function XMLHttpRequest() { [native code] }' ) { - self.originalXMLHttpRequest = self.XMLHttpRequest; + self.originalXMLHttpRequest = self.XMLHttpRequest } if (self.FormData && self.FormData.toString() === 'function FormData() { [native code] }') { - self.originalFormData = self.FormData; + self.originalFormData = self.FormData } // Catch native fetch if (self.fetch && self.fetch.toString() === 'function fetch() { [native code] }') { /* eslint-disable-next-line no-underscore-dangle */ - self.__ORIGINAL_FETCH__ = self.fetch; + self.__ORIGINAL_FETCH__ = self.fetch } -replaceForbiddenHeadersForWorkerXHR(); -addURIWarningForWorkerFormData(); +replaceForbiddenHeadersForWorkerXHR() +addURIWarningForWorkerFormData() diff --git a/app/worker/utils.js b/app/worker/utils.js index 7155eb3b..ec761592 100644 --- a/app/worker/utils.js +++ b/app/worker/utils.js @@ -2,155 +2,152 @@ // Avoid warning of use metro require on dev mode // it actually unnecessary for RN >= 0.56, so it is backward compatibility -const avoidWarnForRequire = moduleNames => { - if (!moduleNames.length) moduleNames.push('NativeModules'); - return new Promise(resolve => +const avoidWarnForRequire = (moduleNames) => { + if (!moduleNames.length) moduleNames.push('NativeModules') + return new Promise((resolve) => { setTimeout(() => { // It's replaced console.warn of react-native - const originalWarn = console.warn; + const originalWarn = console.warn console.warn = (...args) => { if ( - args[0] && - moduleNames.some( - name => args[0].indexOf(`Requiring module '${name}' by name`) > -1, - ) + args[0] + && moduleNames.some( + (name) => args[0].indexOf(`Requiring module '${name}' by name`) > -1, + ) ) { - return; + return } - return originalWarn(...args); - }; + return originalWarn(...args) + } resolve(() => { - console.warn = originalWarn; - }); - }), - ); -}; + console.warn = originalWarn + }) + }) + }) +} -let reactNative; +let reactNative const getRequireMethod = () => { // RN >= 0.57 - if (typeof window.__r === 'function') return window.__r; + if (typeof window.__r === 'function') return window.__r // RN < 0.57 - if (typeof window.require === 'function') return window.require; -}; + if (typeof window.require === 'function') return window.require +} const lookupForRNModules = (size = 999) => { - const metroRequire = getRequireMethod(); - let actualSize = size; - let getModule = metroRequire; + const metroRequire = getRequireMethod() + let actualSize = size + let getModule = metroRequire if (metroRequire.getModules) { - const mods = metroRequire.getModules(); - actualSize = Object.keys(mods).length; - getModule = moduleId => { - const mod = mods && mods[moduleId]; - return (mod && mod.publicModule && mod.publicModule.exports) || null; - }; + const mods = metroRequire.getModules() + actualSize = Object.keys(mods).length + getModule = (moduleId) => { + const mod = mods && mods[moduleId] + return (mod && mod.publicModule && mod.publicModule.exports) || null + } } else { - getModule = moduleId => metroRequire(moduleId); + getModule = (moduleId) => metroRequire(moduleId) } - for (let moduleId = 0; moduleId <= actualSize - 1; moduleId++) { - const rn = getModule(moduleId); + for (let moduleId = 0; moduleId <= actualSize - 1; moduleId += 1) { + const rn = getModule(moduleId) if (rn && rn.requireNativeComponent && rn.NativeModules) { - return rn; + return rn } } - return null; -}; + return null +} const getModule = (name, size) => { - let result; + let result try { - const metroRequire = getRequireMethod(); + const metroRequire = getRequireMethod() // RN >= 0.56 if (metroRequire.name === 'metroRequire') { - reactNative = global.$reactNative = - reactNative || lookupForRNModules(size); - result = reactNative && reactNative[name]; + const rn = reactNative || lookupForRNModules(size) + reactNative = rn + global.$reactNative = rn + result = reactNative && reactNative[name] } else if (metroRequire.name === '_require') { - result = metroRequire(name); + result = metroRequire(name) } } catch (e) {} // eslint-disable-line - return result || { __empty: true }; -}; + return result || { __empty: true } +} const requiredModules = { - MessageQueue: size => - (self.__fbBatchedBridge && - Object.getPrototypeOf(self.__fbBatchedBridge).constructor) || - getModule('MessageQueue', size), - NativeModules: size => getModule('NativeModules', size), - Platform: size => getModule('Platform', size), - setupDevtools: size => getModule('setupDevtools', size), -}; + MessageQueue: (size) => (self.__fbBatchedBridge + && Object.getPrototypeOf(self.__fbBatchedBridge).constructor) + || getModule('MessageQueue', size), + NativeModules: (size) => getModule('NativeModules', size), + Platform: (size) => getModule('Platform', size), + setupDevtools: (size) => getModule('setupDevtools', size), +} -export const getRequiredModules = async size => { - if (!window.__DEV__ || !getRequireMethod()) return; - const done = await avoidWarnForRequire(Object.keys(requiredModules)); - const modules = {}; - for (const name of Object.keys(requiredModules)) { - modules[name] = requiredModules[name](size); - } - done(); - return modules; -}; +export const getRequiredModules = async (size) => { + if (!window.__DEV__ || !getRequireMethod()) return + const done = await avoidWarnForRequire(Object.keys(requiredModules)) + const modules = {} + Object.keys(requiredModules).forEach((name) => { + modules[name] = requiredModules[name](size) + }) + done() + return modules +} -const TO_JS = 0; -const isIntervalMatch = (intervalIdList, info) => - info.type === TO_JS && - (info.module === 'JSTimersExecution' || info.module === 'JSTimers') && - info.method === 'callTimers' && - info.args && - info.args[0] && - intervalIdList.includes(info.args[0][0]); +const TO_JS = 0 +const isIntervalMatch = (intervalIdList, info) => info.type === TO_JS + && (info.module === 'JSTimersExecution' || info.module === 'JSTimers') + && info.method === 'callTimers' + && info.args + && info.args[0] + && intervalIdList.includes(info.args[0][0]) export const ignoreRNDIntervalSpy = async ( { MessageQueue }, intervals = [], ) => { - if (MessageQueue.__empty) return; + if (MessageQueue.__empty) return // Wrap spy function if it already set - const intervalIdList = [self.__RND_INTERVAL__].concat(intervals); + const intervalIdList = [self.__RND_INTERVAL__].concat(intervals) if (MessageQueue.prototype.__spy) { - const originalSpyFn = MessageQueue.prototype.__spy; - MessageQueue.prototype.__spy = info => { - if (isIntervalMatch(intervalIdList, info)) return; - return originalSpyFn(info); - }; + const originalSpyFn = MessageQueue.prototype.__spy + MessageQueue.prototype.__spy = (info) => { + if (isIntervalMatch(intervalIdList, info)) return + return originalSpyFn(info) + } } - MessageQueue.spy = spyOrToggle => { + MessageQueue.spy = (spyOrToggle) => { if (spyOrToggle === true) { - MessageQueue.prototype.__spy = info => { - if (isIntervalMatch(intervalIdList, info)) return; + MessageQueue.prototype.__spy = (info) => { + if (isIntervalMatch(intervalIdList, info)) return console.log( - `${info.type === TO_JS ? 'N->JS' : 'JS->N'} : ` + - `${info.module ? `${info.module}.` : ''}${info.method}` + - `(${JSON.stringify(info.args)})`, - ); - }; + `${info.type === TO_JS ? 'N->JS' : 'JS->N'} : ` + + `${info.module ? `${info.module}.` : ''}${info.method}` + + `(${JSON.stringify(info.args)})`, + ) + } } else if (spyOrToggle === false) { - MessageQueue.prototype.__spy = null; + MessageQueue.prototype.__spy = null } else { - MessageQueue.prototype.__spy = info => { - if (isIntervalMatch(intervalIdList, info)) return; - return spyOrToggle(info); - }; + MessageQueue.prototype.__spy = (info) => { + if (isIntervalMatch(intervalIdList, info)) return + return spyOrToggle(info) + } } - }; -}; - + } +} -const RN_DEBUGGER_URL_PART = 'RNDebuggerWorker.js'; -const BUNDLE_URL_REGEXP = /(http[\S]*?index\.bundle\?[\S]*?)(:\d+:?\d?)/; +const RN_DEBUGGER_URL_PART = 'RNDebuggerWorker.js' +const BUNDLE_URL_REGEXP = /(http[\S]*?index\.bundle\?[\S]*?)(:\d+:?\d?)/ -const addInlineSourceMap = (_, urlGroup1, urlGroup2) => - `${urlGroup1}&inlineSourceMap=true${urlGroup2}`; -const mapStackLines = line => line.replace(BUNDLE_URL_REGEXP, addInlineSourceMap); -const filterRnDebuggerLines = line => !line.includes(RN_DEBUGGER_URL_PART); +const addInlineSourceMap = (_, urlGroup1, urlGroup2) => `${urlGroup1}&inlineSourceMap=true${urlGroup2}` +const mapStackLines = (line) => line.replace(BUNDLE_URL_REGEXP, addInlineSourceMap) +const filterRnDebuggerLines = (line) => !line.includes(RN_DEBUGGER_URL_PART) export function updateStackWithSourceMap(stack) { - const lines = stack.split('\n'); - const linesWithoutRNDebugger = lines.filter(filterRnDebuggerLines); - const lineWithSourceMap = linesWithoutRNDebugger.map(mapStackLines); - return lineWithSourceMap.join('\n'); + const lines = stack.split('\n') + const linesWithoutRNDebugger = lines.filter(filterRnDebuggerLines) + const lineWithSourceMap = linesWithoutRNDebugger.map(mapStackLines) + return lineWithSourceMap.join('\n') } diff --git a/babel.config.js b/babel.config.js index 738f6f0b..edfdd5bb 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,5 @@ module.exports = (api) => { - api.cache(true); + api.cache(true) return { presets: [['@babel/preset-env', { targets: { node: '18.5' } }], '@babel/preset-react'], plugins: [], @@ -12,5 +12,5 @@ module.exports = (api) => { ], }, }, - }; -}; + } +} diff --git a/electron/config/__tests__/index.test.js b/electron/config/__tests__/index.test.js index 23096df9..22bf17ba 100644 --- a/electron/config/__tests__/index.test.js +++ b/electron/config/__tests__/index.test.js @@ -1,40 +1,40 @@ -import fs from 'fs'; -import path from 'path'; +import fs from 'fs' +import path from 'path' jest.mock('electron', () => ({ shell: { openPath: jest.fn(), }, -})); +})) -const testFile = path.join(__dirname, 'config_test'); +const testFile = path.join(__dirname, 'config_test') -beforeAll(() => fs.existsSync(testFile) && fs.unlinkSync(testFile)); +beforeAll(() => fs.existsSync(testFile) && fs.unlinkSync(testFile)) /* eslint-disable global-require */ test('readConfig', () => { - const { readConfig } = require('..'); + const { readConfig } = require('..') - expect(readConfig(testFile)).toMatchSnapshot(); + expect(readConfig(testFile)).toMatchSnapshot() // User custom config - fs.writeFileSync(testFile, '{ autoUpdate: false, }'); - expect(readConfig(testFile)).toMatchSnapshot(); + fs.writeFileSync(testFile, '{ autoUpdate: false, }') + expect(readConfig(testFile)).toMatchSnapshot() // Broken config - fs.writeFileSync(testFile, '{ autoUpdate: is_broken, }'); - expect(readConfig(testFile)).toMatchSnapshot(); -}); + fs.writeFileSync(testFile, '{ autoUpdate: is_broken, }') + expect(readConfig(testFile)).toMatchSnapshot() +}) test('openConfigFile', () => { - const { readConfig, openConfigFile } = require('..'); - const { shell } = require('electron'); + const { readConfig, openConfigFile } = require('..') + const { shell } = require('electron') - openConfigFile(testFile); - expect(shell.openPath).toBeCalledWith(testFile); - shell.openPath.mockClear(); + openConfigFile(testFile) + expect(shell.openPath).toBeCalledWith(testFile) + shell.openPath.mockClear() - fs.unlinkSync(testFile); - openConfigFile(testFile); - expect(readConfig(testFile)).toMatchSnapshot(); -}); + fs.unlinkSync(testFile) + openConfigFile(testFile) + expect(readConfig(testFile)).toMatchSnapshot() +}) diff --git a/electron/config/index.js b/electron/config/index.js index 5276eac0..1bd0f44e 100644 --- a/electron/config/index.js +++ b/electron/config/index.js @@ -1,30 +1,30 @@ -import fs from 'fs'; -import path from 'path'; -import json5 from 'json5'; -import { shell } from 'electron'; -import template from './template'; +import fs from 'fs' +import path from 'path' +import json5 from 'json5' +import { shell } from 'electron' +import template from './template' export const filePath = path.join( process.env[process.platform === 'win32' ? 'USERPROFILE' : 'HOME'], - '.rndebuggerrc' -); + '.rndebuggerrc', +) export const readConfig = (configFile = filePath) => { if (!fs.existsSync(configFile)) { // Create a new one - fs.writeFileSync(configFile, template); - return { config: json5.parse(template) }; + fs.writeFileSync(configFile, template) + return { config: json5.parse(template) } } try { // eslint-disable-next-line return { config: json5.parse(fs.readFileSync(configFile, 'utf-8')) }; } catch (error) { // Alert parse config not successful - return { config: json5.parse(template), isConfigBroken: true, error }; + return { config: json5.parse(template), isConfigBroken: true, error } } -}; +} export const openConfigFile = (configFile = filePath) => { - readConfig(); - shell.openPath(configFile); -}; + readConfig() + shell.openPath(configFile) +} diff --git a/electron/config/template.js b/electron/config/template.js index be043186..72cbfaa1 100644 --- a/electron/config/template.js +++ b/electron/config/template.js @@ -50,4 +50,4 @@ module.exports = `{ // https://github.com/jhen0409/react-native-debugger/issues/405) in devtools. timesJSLoadToRefreshDevTools: -1, } -`; +` diff --git a/electron/context-menu.js b/electron/context-menu.js index 006f351e..678090f4 100644 --- a/electron/context-menu.js +++ b/electron/context-menu.js @@ -1,66 +1,59 @@ -import { ipcMain } from 'electron'; -import contextMenu from 'electron-context-menu'; -import { readConfig } from './config'; -import { toggleDevTools, n, item, separator } from './menu/common'; +import { ipcMain } from 'electron' +import contextMenu from 'electron-context-menu' +import { readConfig } from './config' +import { + toggleDevTools, n, item, separator, +} from './menu/common' -const invokeDevMethod = (win, name) => - win.webContents.executeJavaScript( - `window.invokeDevMethod && window.invokeDevMethod('${name}')`, - ); +const invokeDevMethod = (win, name) => win.webContents.executeJavaScript( + `window.invokeDevMethod && window.invokeDevMethod('${name}')`, +) export const registerContextMenu = (win) => { - const { config } = readConfig(); + const { config } = readConfig() const defaultContextMenuItems = [ item('Toggle Developer Tools', n, () => toggleDevTools(win, 'chrome')), item('Toggle React DevTools', n, () => toggleDevTools(win, 'react')), item('Toggle Redux DevTools', n, () => toggleDevTools(win, 'redux')), - ]; - let networkInspectEnabled = !!config.networkInspect; - let availableMethods = []; + ] + let networkInspectEnabled = !!config.networkInspect + let availableMethods = [] contextMenu({ window: win, showInspectElement: process.env.NODE_ENV === 'development', - prepend: () => - [ - availableMethods.includes('reload') && - item('Reload JS', n, () => invokeDevMethod(win, 'reload')), - availableMethods.includes('toggleElementInspector') && - item('Toggle Element Inspector', n, () => - invokeDevMethod(win, 'toggleElementInspector'), - ), - availableMethods.includes('show') && - item('Show Developer Menu', n, () => invokeDevMethod(win, 'show')), - item( - networkInspectEnabled - ? 'Disable Network Inspect' - : 'Enable Network Inspect', - n, - () => invokeDevMethod(win, 'networkInspect'), - ), - availableMethods.includes('showAsyncStorage') && - item('Log AsyncStorage content', n, () => - invokeDevMethod(win, 'showAsyncStorage'), - ), - availableMethods.includes('clearAsyncStorage') && - item('Clear AsyncStorage', n, () => - invokeDevMethod(win, 'clearAsyncStorage'), - ), - separator, - ] - .filter((menuItem) => !!menuItem) - .concat(defaultContextMenuItems), - }); + prepend: () => [ + availableMethods.includes('reload') + && item('Reload JS', n, () => invokeDevMethod(win, 'reload')), + availableMethods.includes('toggleElementInspector') + && item('Toggle Element Inspector', n, () => invokeDevMethod(win, 'toggleElementInspector')), + availableMethods.includes('show') + && item('Show Developer Menu', n, () => invokeDevMethod(win, 'show')), + item( + networkInspectEnabled + ? 'Disable Network Inspect' + : 'Enable Network Inspect', + n, + () => invokeDevMethod(win, 'networkInspect'), + ), + availableMethods.includes('showAsyncStorage') + && item('Log AsyncStorage content', n, () => invokeDevMethod(win, 'showAsyncStorage')), + availableMethods.includes('clearAsyncStorage') + && item('Clear AsyncStorage', n, () => invokeDevMethod(win, 'clearAsyncStorage')), + separator, + ] + .filter((menuItem) => !!menuItem) + .concat(defaultContextMenuItems), + }) const listener = (event, data) => { - availableMethods = data.availableMethods || availableMethods; - networkInspectEnabled = - typeof data.networkInspectEnabled === 'boolean' - ? data.networkInspectEnabled - : networkInspectEnabled; - }; + availableMethods = data.availableMethods || availableMethods + networkInspectEnabled = typeof data.networkInspectEnabled === 'boolean' + ? data.networkInspectEnabled + : networkInspectEnabled + } - ipcMain.on(`context-menu-available-methods-update-${win.id}`, listener); + ipcMain.on(`context-menu-available-methods-update-${win.id}`, listener) return () => { - ipcMain.off(`context-menu-available-methods-update-${win.id}`, listener); - }; -}; + ipcMain.off(`context-menu-available-methods-update-${win.id}`, listener) + } +} diff --git a/electron/devtools.js b/electron/devtools.js index bffec192..386cd126 100644 --- a/electron/devtools.js +++ b/electron/devtools.js @@ -26,21 +26,21 @@ export const getCatchConsoleLogScript = (port) => ` }, true); window.__INJECT_OPEN_IN_EDITOR_SCRIPT__ = true; } -`; +` export const catchConsoleLogLink = (win, host = 'localhost', port = 8081) => { if (win.devToolsWebContents) { return win.devToolsWebContents.executeJavaScript(`(() => { ${getCatchConsoleLogScript(host, port)} - })()`); + })()`) } -}; +} -export const removeUnecessaryTabs = win => { +export const removeUnecessaryTabs = (win) => { if ( - process.env.NODE_ENV === 'production' && - !process.env.DEBUG_RNDEBUGGER && - win.devToolsWebContents + process.env.NODE_ENV === 'production' + && !process.env.DEBUG_RNDEBUGGER + && win.devToolsWebContents ) { return win.devToolsWebContents.executeJavaScript(`(() => { const tabbedPane = UI.inspectorView.tabbedPane; @@ -53,16 +53,16 @@ export const removeUnecessaryTabs = win => { tabbedPane.leftToolbar().element.remove(); } - })()`); + })()`) } -}; +} -export const activeTabs = win => { +export const activeTabs = (win) => { if (win.devToolsWebContents) { // Active network tab so we can do clearNetworkLogs return win.devToolsWebContents.executeJavaScript(`(() => { DevToolsAPI.showPanel('network'); DevToolsAPI.showPanel('console'); - })()`); + })()`) } -}; +} diff --git a/electron/extensions.js b/electron/extensions.js index 49122f75..1a4dc6f1 100644 --- a/electron/extensions.js +++ b/electron/extensions.js @@ -1,42 +1,42 @@ -import path from 'path'; -import { session } from 'electron'; +import path from 'path' +import { session } from 'electron' export default async () => { if (process.env.NODE_ENV === 'development') { await session.defaultSession.loadExtension( path.resolve('dist/devtools-helper/'), { allowFileAccess: true }, - ); + ) await session.defaultSession.loadExtension( path.join( __dirname, '../node_modules/apollo-client-devtools/shells/webextension/', ), { allowFileAccess: true }, - ); + ) } else if (process.env.PACKAGE === 'no') { await session.defaultSession.loadExtension( path.join(__dirname, 'devtools-helper/'), { allowFileAccess: true }, - ); + ) await session.defaultSession.loadExtension( path.join( __dirname, 'node_modules/apollo-client-devtools/shells/webextension/', ), { allowFileAccess: true }, - ); + ) } else { await session.defaultSession.loadExtension( path.join(__dirname, '../devtools-helper/'), { allowFileAccess: true }, - ); + ) await session.defaultSession.loadExtension( path.join( __dirname, '../webextension/', ), { allowFileAccess: true }, - ); + ) } -}; +} diff --git a/electron/main.js b/electron/main.js index 41bfd109..f3f514ee 100644 --- a/electron/main.js +++ b/electron/main.js @@ -1,150 +1,162 @@ -import path from 'path'; -import { app, ipcMain, session, BrowserWindow, Menu } from 'electron'; -import { initialize } from '@electron/remote/main'; -import normalizeHeaderCase from 'header-case-normalizer'; -import installExtensions from './extensions'; -import { checkWindowInfo, createWindow } from './window'; -import { startListeningHandleURL, handleURL, parseUrl } from './url-handle'; -import { createMenuTemplate } from './menu'; -import { readConfig } from './config'; -import { sendSyncState } from './sync-state'; - -initialize(); +import path from 'path' +import { + app, ipcMain, session, BrowserWindow, Menu, +} from 'electron' +import { initialize } from '@electron/remote/main' +import normalizeHeaderCase from 'header-case-normalizer' +import installExtensions from './extensions' +import { checkWindowInfo, createWindow } from './window' +import { startListeningHandleURL, handleURL, parseUrl } from './url-handle' +import { createMenuTemplate } from './menu' +import { readConfig } from './config' +import { sendSyncState } from './sync-state' + +initialize() // Uncomment if want to debug devtools backend // app.commandLine.appendSwitch('remote-debugging-port', '9222'); -app.commandLine.appendSwitch('disable-http-cache'); - -process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 1; - -const iconPath = path.resolve(__dirname, 'logo.png'); -const defaultOptions = { iconPath }; - - -const findWindow = async (host, port) => { - const wins = BrowserWindow.getAllWindows(); - for (const win of wins) { - const { isWorkerRunning, isPortSettingRequired, location } = - await checkWindowInfo(win); - if ( - (!isWorkerRunning || location.port === port) && - !isPortSettingRequired - ) { - if (win.isMinimized()) win.restore(); - win.focus(); - return win; - } +app.commandLine.appendSwitch('disable-http-cache') + +process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 1 + +const iconPath = path.resolve(__dirname, 'logo.png') +const defaultOptions = { iconPath } + +const findWindow = async (_, port) => { + const browserWindows = BrowserWindow.getAllWindows() + const browserWindow = await browserWindows.reduce(async (promise, win) => { + const acc = await promise + if (acc) return acc + + const { isWorkerRunning, isPortSettingRequired, location } = await checkWindowInfo(win) + return (!isWorkerRunning || location.port === port) + && !isPortSettingRequired + ? win + : null + }, Promise.resolve(null)) + if (!browserWindow) createWindow(defaultOptions) + if (browserWindow) { + if (browserWindow.isMinimized()) browserWindow.restore() + browserWindow.focus() } - createWindow(defaultOptions); - return null; -}; + return browserWindow +} const handleCommandLine = async (commandLine) => { - const url = commandLine.find((arg) => arg.startsWith('rndebugger://')); + const url = commandLine.find((arg) => arg.startsWith('rndebugger://')) if (!url) { - return; + return } - await handleURL(findWindow, url); -}; + await handleURL(findWindow, url) +} if (process.platform === 'linux') { - const singleInstanceLock = app.requestSingleInstanceLock(); + const singleInstanceLock = app.requestSingleInstanceLock() if (!singleInstanceLock) { - process.exit(); + process.exit() } else { app.on('second-instance', async (event, commandLine) => { - await handleCommandLine(commandLine); - }); + await handleCommandLine(commandLine) + }) } } -startListeningHandleURL(findWindow); +startListeningHandleURL(findWindow) ipcMain.on('check-port-available', async (event, arg) => { - const port = Number(arg); - for (const win of BrowserWindow.getAllWindows()) { + const port = Number(arg) + const windows = BrowserWindow.getAllWindows() + const isPortAvailable = await windows.reduce(async (promise, win) => { + const isAvailable = await promise + if (!isAvailable) return false + if (win.webContents !== event.sender) { - const { isPortSettingRequired, location } = await checkWindowInfo(win); + const { isPortSettingRequired, location } = await checkWindowInfo(win) if (location.port === port && !isPortSettingRequired) { - event.sender.send('check-port-available-reply', false); - return; + return false } } - } - event.sender.send('check-port-available-reply', true); -}); + return true + }, Promise.resolve(true)) + event.sender.send('check-port-available-reply', isPortAvailable) +}) -ipcMain.on('sync-state', sendSyncState); +ipcMain.on('sync-state', sendSyncState) app.on('activate', () => { - if (BrowserWindow.getAllWindows().length !== 0) return; - createWindow(defaultOptions); -}); + if (BrowserWindow.getAllWindows().length !== 0) return + createWindow(defaultOptions) +}) -app.on('new-window-for-tab', () => +app.on('new-window-for-tab', () => { createWindow({ ...defaultOptions, isPortSettingRequired: true }) -); +}) app.on('window-all-closed', () => { if (process.platform !== 'darwin') { - app.quit(); + app.quit() } -}); +}) if (process.platform === 'darwin') { - app.on('before-quit', async event => { - event.preventDefault(); - for (const win of BrowserWindow.getAllWindows()) { - win.removeAllListeners('close'); - await win.close(); - } - process.exit(); - }); + app.on('before-quit', async (event) => { + event.preventDefault() + BrowserWindow.getAllWindows().forEach((win) => { + win.removeAllListeners('close') + win.close() + }) + process.exit() + }) } app.on('ready', async () => { - await installExtensions(); + await installExtensions() - const { config } = readConfig(); + const { config } = readConfig() - let { defaultRNPackagerPorts } = config; + let { defaultRNPackagerPorts } = config if (!Array.isArray(defaultRNPackagerPorts)) { - defaultRNPackagerPorts = [8081]; + defaultRNPackagerPorts = [8081] } if (process.platform === 'linux') { - const url = process.argv.find((arg) => arg.startsWith('rndebugger://')); - const query = url ? parseUrl(url) : undefined; + const url = process.argv.find((arg) => arg.startsWith('rndebugger://')) + const query = url ? parseUrl(url) : undefined if (query && query.port) { - defaultRNPackagerPorts = [query.port]; + defaultRNPackagerPorts = [query.port] } } - defaultRNPackagerPorts.forEach(port => { - createWindow({ port, ...defaultOptions }); - }); + defaultRNPackagerPorts.forEach((port) => { + createWindow({ port, ...defaultOptions }) + }) - const menuTemplate = createMenuTemplate(defaultOptions); - const menu = Menu.buildFromTemplate(menuTemplate); - Menu.setApplicationMenu(menu); + const menuTemplate = createMenuTemplate(defaultOptions) + const menu = Menu.buildFromTemplate(menuTemplate) + Menu.setApplicationMenu(menu) - const replaceHeaderPrefix = '__RN_DEBUGGER_SET_HEADER_REQUEST_'; + const replaceHeaderPrefix = '__RN_DEBUGGER_SET_HEADER_REQUEST_' session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => { - delete details.requestHeaders.Origin; + delete details.requestHeaders.Origin Object.entries(details.requestHeaders).forEach(([header, value]) => { if (header.startsWith(replaceHeaderPrefix)) { - const originalHeader = normalizeHeaderCase(header.replace(replaceHeaderPrefix, '')); - details.requestHeaders[originalHeader] = value; - delete details.requestHeaders[header]; + const originalHeader = normalizeHeaderCase( + header.replace(replaceHeaderPrefix, ''), + ) + details.requestHeaders[originalHeader] = value + delete details.requestHeaders[header] } - }); - callback({ cancel: false, requestHeaders: details.requestHeaders }); - }); -}); + }) + callback({ cancel: false, requestHeaders: details.requestHeaders }) + }) +}) // Pass all certificate errors in favor of Network Inspect feature -app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { - event.preventDefault(); - callback(true); -}); +app.on( + 'certificate-error', + (event, webContents, url, error, certificate, callback) => { + event.preventDefault() + callback(true) + }, +) diff --git a/electron/menu/common.js b/electron/menu/common.js index e4cdf0e4..efd870f5 100644 --- a/electron/menu/common.js +++ b/electron/menu/common.js @@ -1,35 +1,34 @@ export const toggleDevTools = (win, type) => { - if (!win || !type) return; + if (!win || !type) return if (type === 'chrome') { - win.toggleDevTools(); - return; + win.toggleDevTools() + return } - win.webContents.send('toggle-devtools', type); -}; + win.webContents.send('toggle-devtools', type) +} -export const toggleFullscreen = win => win && win.setFullScreen(!win.isFullScreen()); -export const setAlwaysOnTop = (win, checked) => win && win.setAlwaysOnTop(checked); -export const reload = win => win && win.webContents.reload(); -export const close = win => win && win.close(); +export const toggleFullscreen = (win) => win && win.setFullScreen(!win.isFullScreen()) +export const setAlwaysOnTop = (win, checked) => win && win.setAlwaysOnTop(checked) +export const reload = (win) => win && win.webContents.reload() +export const close = (win) => win && win.close() export const zoom = (win, val) => { - if (!win) return; - const contents = win.webContents; - contents.zoomLevel += val; -}; -export const resetZoom = win => { + if (!win) return + const contents = win.webContents + contents.zoomLevel += val +} +export const resetZoom = (win) => { if (win) { - win.webContents.zoomLevel = 0; + win.webContents.zoomLevel = 0 } -}; -export const toggleOpenInEditor = win => - win && win.webContents.executeJavaScript('window.toggleOpenInEditor()'); +} +export const toggleOpenInEditor = (win) => win && win.webContents.executeJavaScript('window.toggleOpenInEditor()') -export const menu = (label, submenu, role) => ({ label, submenu, role }); +export const menu = (label, submenu, role) => ({ label, submenu, role }) export const item = (label, accelerator, click, rest) => ({ label, accelerator, click, ...rest, -}); -export const separator = { type: 'separator' }; -export const n = undefined; +}) +export const separator = { type: 'separator' } +export const n = undefined diff --git a/electron/menu/darwin.js b/electron/menu/darwin.js index 1269f743..bfff10ed 100644 --- a/electron/menu/darwin.js +++ b/electron/menu/darwin.js @@ -1,6 +1,6 @@ -import { app, shell, BrowserWindow } from 'electron'; -import { createWindow } from '../window'; -import checkUpdate from '../update'; +import { app, shell, BrowserWindow } from 'electron' +import { createWindow } from '../window' +import checkUpdate from '../update' import { menu, item, @@ -13,17 +13,16 @@ import { zoom, resetZoom, toggleOpenInEditor, -} from './common'; -import { haveOpenedWindow, showAboutDialog } from './dialog'; -import { openConfigFile } from '../config'; -import { isSyncState, toggleSyncState } from '../sync-state'; +} from './common' +import { haveOpenedWindow, showAboutDialog } from './dialog' +import { openConfigFile } from '../config' +import { isSyncState, toggleSyncState } from '../sync-state' -const getWin = () => BrowserWindow.getFocusedWindow(); +const getWin = () => BrowserWindow.getFocusedWindow() -const viewItems = - process.env.NODE_ENV === 'developemnt' - ? [item('Reload Window', 'Alt+Command+R', () => reload(getWin()))] - : []; +const viewItems = process.env.NODE_ENV === 'developemnt' + ? [item('Reload Window', 'Alt+Command+R', () => reload(getWin()))] + : [] export default ({ iconPath }) => [ menu('React Native Debugger', [ @@ -39,9 +38,7 @@ export default ({ iconPath }) => [ menu( 'Debugger', [ - item('New Window', 'Command+T', () => - createWindow({ iconPath, isPortSettingRequired: haveOpenedWindow() }) - ), + item('New Window', 'Command+T', () => createWindow({ iconPath, isPortSettingRequired: haveOpenedWindow() })), item('Enable Open in Editor for Console Log', n, () => toggleOpenInEditor(getWin()), { type: 'checkbox', checked: false, @@ -61,7 +58,7 @@ export default ({ iconPath }) => [ checked: false, }), ], - 'window' + 'window', ), menu('Edit', [ item('Undo', 'Command+Z', n, { selector: 'undo:' }), @@ -83,17 +80,11 @@ export default ({ iconPath }) => [ item('Zoom In', 'Command+=', () => zoom(getWin(), 1)), item('Zoom Out', 'Command+-', () => zoom(getWin(), -1)), item('Reset Zoom', 'Command+0', () => resetZoom(getWin())), - ]) + ]), ), menu('Help', [ - item('Documentation', n, () => - shell.openExternal('https://github.com/jhen0409/react-native-debugger/tree/master/docs') - ), - item('Issues', n, () => - shell.openExternal('https://github.com/jhen0409/react-native-debugger/issues') - ), - item('Open Collective', n, () => - shell.openExternal('https://opencollective.com/react-native-debugger') - ), + item('Documentation', n, () => shell.openExternal('https://github.com/jhen0409/react-native-debugger/tree/master/docs')), + item('Issues', n, () => shell.openExternal('https://github.com/jhen0409/react-native-debugger/issues')), + item('Open Collective', n, () => shell.openExternal('https://opencollective.com/react-native-debugger')), ]), -]; +] diff --git a/electron/menu/dialog.js b/electron/menu/dialog.js index 110dfb6b..fee6095f 100644 --- a/electron/menu/dialog.js +++ b/electron/menu/dialog.js @@ -1,7 +1,7 @@ -import { app, dialog, BrowserWindow } from 'electron'; -import multiline from 'multiline-template'; +import { app, dialog, BrowserWindow } from 'electron' +import multiline from 'multiline-template' -const appName = app.name; +const appName = app.name const detail = multiline` | Created by Jhen-Jie Hong | (https://github.com/jhen0409) @@ -10,15 +10,14 @@ const detail = multiline` | https://github.com/facebook/react-devtools | https://github.com/zalmoxisus/remotedev-app -`; +` -export const showAboutDialog = iconPath => - dialog.showMessageBoxSync({ - title: 'About', - message: `${appName} ${app.getVersion()}`, - detail, - icon: iconPath, - buttons: [], - }); +export const showAboutDialog = (iconPath) => dialog.showMessageBoxSync({ + title: 'About', + message: `${appName} ${app.getVersion()}`, + detail, + icon: iconPath, + buttons: [], +}) -export const haveOpenedWindow = () => !!BrowserWindow.getAllWindows().length; +export const haveOpenedWindow = () => !!BrowserWindow.getAllWindows().length diff --git a/electron/menu/index.js b/electron/menu/index.js index c8ee0657..fdd3dd50 100644 --- a/electron/menu/index.js +++ b/electron/menu/index.js @@ -1,10 +1,10 @@ /* eslint global-require: 0 */ -import createMenuTemplateDarwin from './darwin'; -import createMenuTemplateLinuxWin from './linux+win'; +import createMenuTemplateDarwin from './darwin' +import createMenuTemplateLinuxWin from './linux+win' const createMenuTemplate = process.platform === 'darwin' ? createMenuTemplateDarwin - : createMenuTemplateLinuxWin; + : createMenuTemplateLinuxWin -export { createMenuTemplate }; +export { createMenuTemplate } diff --git a/electron/menu/linux+win.js b/electron/menu/linux+win.js index 1afe4a18..4ce2e152 100644 --- a/electron/menu/linux+win.js +++ b/electron/menu/linux+win.js @@ -1,6 +1,6 @@ -import { shell, BrowserWindow } from 'electron'; -import { createWindow } from '../window'; -import checkUpdate from '../update'; +import { shell, BrowserWindow } from 'electron' +import { createWindow } from '../window' +import checkUpdate from '../update' import { menu, item, @@ -14,19 +14,18 @@ import { zoom, resetZoom, toggleOpenInEditor, -} from './common'; +} from './common' import { showAboutDialog, haveOpenedWindow, -} from './dialog'; -import { openConfigFile } from '../config'; -import { toggleSyncState, isSyncState } from '../sync-state'; +} from './dialog' +import { openConfigFile } from '../config' +import { toggleSyncState, isSyncState } from '../sync-state' -const getWin = () => BrowserWindow.getFocusedWindow(); -const viewItems = - process.env.NODE_ENV === 'developemnt' - ? [item('Reload Window', 'Alt+CTRL+R', () => reload(getWin()))] - : []; +const getWin = () => BrowserWindow.getFocusedWindow() +const viewItems = process.env.NODE_ENV === 'developemnt' + ? [item('Reload Window', 'Alt+CTRL+R', () => reload(getWin()))] + : [] export default ({ iconPath }) => [ menu('RND', [ @@ -41,9 +40,7 @@ export default ({ iconPath }) => [ menu( 'Debugger', [ - item('New Window', 'Ctrl+T', () => - createWindow({ iconPath, isPortSettingRequired: haveOpenedWindow() }) - ), + item('New Window', 'Ctrl+T', () => createWindow({ iconPath, isPortSettingRequired: haveOpenedWindow() })), item('Enable Open in Editor for Console Log', n, () => toggleOpenInEditor(getWin()), { type: 'checkbox', checked: false, @@ -56,7 +53,7 @@ export default ({ iconPath }) => [ separator, item('Close', 'Ctrl+W', () => close(getWin())), ], - 'window' + 'window', ), menu('Edit', [ item('Undo', 'Ctrl+Z', n, { selector: 'undo:' }), @@ -78,17 +75,11 @@ export default ({ iconPath }) => [ item('Zoom In', 'Ctrl+=', () => zoom(getWin(), 1)), item('Zoom Out', 'Ctrl+-', () => zoom(getWin(), -1)), item('Reset Zoom', 'Ctrl+0', () => resetZoom(getWin())), - ]) + ]), ), menu('Help', [ - item('Documentation', n, () => - shell.openExternal('https://github.com/jhen0409/react-native-debugger/tree/master/docs') - ), - item('Issues', n, () => - shell.openExternal('https://github.com/jhen0409/react-native-debugger/issues') - ), - item('Open Collective', n, () => - shell.openExternal('https://opencollective.com/react-native-debugger') - ), + item('Documentation', n, () => shell.openExternal('https://github.com/jhen0409/react-native-debugger/tree/master/docs')), + item('Issues', n, () => shell.openExternal('https://github.com/jhen0409/react-native-debugger/issues')), + item('Open Collective', n, () => shell.openExternal('https://opencollective.com/react-native-debugger')), ]), -]; +] diff --git a/electron/sync-state.js b/electron/sync-state.js index 637a6e37..4681f6b6 100644 --- a/electron/sync-state.js +++ b/electron/sync-state.js @@ -1,22 +1,22 @@ -import { BrowserWindow } from 'electron'; +import { BrowserWindow } from 'electron' -let syncState = false; +let syncState = false -export const isSyncState = () => syncState; +export const isSyncState = () => syncState // Take by renderer -global.isSyncState = isSyncState; +global.isSyncState = isSyncState export const toggleSyncState = () => { - syncState = !syncState; -}; + syncState = !syncState +} export const sendSyncState = (event, payload) => { - if (!isSyncState) return; + if (!isSyncState) return BrowserWindow.getAllWindows() - .filter(win => Number(win.webContents.id) !== event.sender.id) - .forEach(win => { - win.webContents.send('sync-state', payload); - }); -}; + .filter((win) => Number(win.webContents.id) !== event.sender.id) + .forEach((win) => { + win.webContents.send('sync-state', payload) + }) +} diff --git a/electron/update.js b/electron/update.js index 98ad98ca..714cf02a 100644 --- a/electron/update.js +++ b/electron/update.js @@ -1,23 +1,21 @@ -import { app, dialog, shell } from 'electron'; -import GhReleases from 'electron-gh-releases'; -import fetch from 'electron-fetch'; +import { app, dialog, shell } from 'electron' +import GhReleases from 'electron-gh-releases' +import fetch from 'electron-fetch' -const repo = 'jhen0409/react-native-debugger'; +const repo = 'jhen0409/react-native-debugger' -const getFeed = () => - fetch(`https://raw.githubusercontent.com/${repo}/master/auto_update.json`).then(res => - res.json() - ); +const getFeed = () => fetch(`https://raw.githubusercontent.com/${repo}/master/auto_update.json`).then((res) => res.json()) -const showDialog = ({ icon, buttons, message, detail }) => - dialog.showMessageBoxSync({ - type: 'info', - buttons, - title: 'React Native Debugger', - icon, - message, - detail, - }); +const showDialog = ({ + icon, buttons, message, detail, +}) => dialog.showMessageBoxSync({ + type: 'info', + buttons, + title: 'React Native Debugger', + icon, + message, + detail, +}) const notifyUpdateAvailable = ({ icon, detail }) => { const index = showDialog({ @@ -25,31 +23,31 @@ const notifyUpdateAvailable = ({ icon, detail }) => { buttons: ['Download', 'Later'], icon, detail, - }); - return index === 0; -}; + }) + return index === 0 +} const notifyUpdateDownloaded = ({ icon }) => { const index = showDialog({ message: - 'The newer version has been downloaded. ' + - 'Please restart the application to apply the update.', + 'The newer version has been downloaded. ' + + 'Please restart the application to apply the update.', buttons: ['Restart', 'Later'], icon, - }); - return index === 0; -}; + }) + return index === 0 +} -let checking = false; +let checking = false export default (icon, notify) => { - if (checking) return; + if (checking) return - checking = true; + checking = true const updater = new GhReleases({ repo, currentVersion: app.getVersion(), - }); + }) updater.check(async (err, status) => { if (process.platform === 'linux' && err.message === 'This platform is not supported.') { @@ -57,34 +55,34 @@ export default (icon, notify) => { status = true; // eslint-disable-line } if (notify && err) { - showDialog({ message: err.message, buttons: ['OK'] }); - checking = false; - return; + showDialog({ message: err.message, buttons: ['OK'] }) + checking = false + return } if (err || !status) { - checking = false; - return; + checking = false + return } - const feed = await getFeed(); - const detail = `${feed.name}\n\n${feed.notes}`; + const feed = await getFeed() + const detail = `${feed.name}\n\n${feed.notes}` if (notify) { - const open = notifyUpdateAvailable({ icon, detail }); - if (open) shell.openExternal('https://github.com/jhen0409/react-native-debugger/releases'); + const open = notifyUpdateAvailable({ icon, detail }) + if (open) shell.openExternal('https://github.com/jhen0409/react-native-debugger/releases') } else if ( - process.env.NODE_ENV === 'production' && - process.platform === 'darwin' && - notifyUpdateAvailable({ icon, detail }) + process.env.NODE_ENV === 'production' + && process.platform === 'darwin' + && notifyUpdateAvailable({ icon, detail }) ) { - updater.download(); - console.log('[RNDebugger] Update downloading...'); + updater.download() + console.log('[RNDebugger] Update downloading...') } - checking = false; - }); + checking = false + }) updater.on('update-downloaded', () => { - console.log('[RNDebugger] Update downloaded'); + console.log('[RNDebugger] Update downloaded') if (notifyUpdateDownloaded({ icon })) { - updater.install(); + updater.install() } - }); -}; + }) +} diff --git a/electron/url-handle/handleURL.js b/electron/url-handle/handleURL.js index 74a60a8f..8aa8e579 100644 --- a/electron/url-handle/handleURL.js +++ b/electron/url-handle/handleURL.js @@ -1,94 +1,92 @@ -import { app } from 'electron'; -import net from 'net'; -import url from 'url'; -import qs from 'querystring'; -import fs from 'fs'; -import * as portfile from './port'; +import { app } from 'electron' +import net from 'net' +import url from 'url' +import qs from 'querystring' +import fs from 'fs' +import * as portfile from './port' -const filterPaths = list => { - const filteredList = list.filter(dir => { +const filterPaths = (list) => { + const filteredList = list.filter((dir) => { try { - return fs.lstatSync(dir).isDirectory(); + return fs.lstatSync(dir).isDirectory() } catch (e) { - return false; + return false } - }); + }) if (!filteredList.length) { - return; + return } - return filteredList; -}; + return filteredList +} const resolveHost = (host) => ( !host || host === 'undefined' || host === 'null' ? 'localhost' : host -); +) -export const parseUrl = _url => { - const route = url.parse(_url); - if (route.host !== 'set-debugger-loc') return; - const { host, port, projectRoots } = qs.parse(route.query); +export const parseUrl = (_url) => { + const route = url.parse(_url) + if (route.host !== 'set-debugger-loc') return + const { host, port, projectRoots } = qs.parse(route.query) const query = { host: resolveHost(host), port: Number(port) || 8081, projectRoots: filterPaths(Array.isArray(projectRoots) ? projectRoots : [projectRoots]), - }; - return query; -}; + } + return query +} export const handleURL = async (getWindow, path) => { - const query = parseUrl(path); + const query = parseUrl(path) if (!query) { - return; + return } - const payload = JSON.stringify(query); + const payload = JSON.stringify(query) // This env will be get by new debugger window - process.env.DEBUGGER_SETTING = payload; - const win = await getWindow(query.host, query.port); + process.env.DEBUGGER_SETTING = payload + const win = await getWindow(query.host, query.port) // if we can get the exists window, it will send the IPC event if (win) { - win.webContents.send('set-debugger-loc', payload); + win.webContents.send('set-debugger-loc', payload) } -}; +} -const listenOpenURL = getWindow => - app.on('open-url', (e, path) => { - handleURL(getWindow, path); - }); +const listenOpenURL = (getWindow) => app.on('open-url', (e, path) => { + handleURL(getWindow, path) +}) -const createHandleURLServer = getWindow => - net - .createServer(socket => { - socket.setEncoding('utf-8'); - socket.on('data', async data => { - try { - const obj = JSON.parse(data); - if (typeof obj.path === 'string') { - await handleURL(getWindow, obj.path); - } - socket.write('success'); - } catch (e) { - socket.write('fail'); - } finally { - socket.end(); +const createHandleURLServer = (getWindow) => net + .createServer((socket) => { + socket.setEncoding('utf-8') + socket.on('data', async (data) => { + try { + const obj = JSON.parse(data) + if (typeof obj.path === 'string') { + await handleURL(getWindow, obj.path) } - }); + socket.write('success') + } catch (e) { + socket.write('fail') + } finally { + socket.end() + } }) - .listen(0, '127.0.0.1') - .on('listening', function server() { - const { port } = this.address(); - portfile.write(port); - portfile.watchExists(port); - process.on('exit', () => portfile.unlink()); + }) + .listen(0, '127.0.0.1') + .on('listening', function server() { + const { port } = this.address() + portfile.write(port) + portfile.watchExists(port) + process.on('exit', () => portfile.unlink()) - console.log(`Starting listen set-debugger-loc request on port ${port}`); - console.log('Will save port to `$HOME/.rndebugger_port` file'); - }); + console.log(`Starting listen set-debugger-loc request on port ${port}`) + console.log('Will save port to `$HOME/.rndebugger_port` file') + }) -export default getWindow => { +export default (getWindow) => { // Handle set-debugger-loc for macOS // It's can be automatically open the app - listenOpenURL(getWindow); + listenOpenURL(getWindow) // Handle set-debugger-loc for macOS/Linux/Windows - createHandleURLServer(getWindow); -}; + createHandleURLServer(getWindow) +} diff --git a/electron/url-handle/index.js b/electron/url-handle/index.js index f35efa5c..f3737e49 100644 --- a/electron/url-handle/index.js +++ b/electron/url-handle/index.js @@ -1,4 +1,6 @@ -import startListeningHandleURL, { handleURL, parseUrl } from './handleURL'; -import * as port from './port'; +import startListeningHandleURL, { handleURL, parseUrl } from './handleURL' +import * as port from './port' -export { startListeningHandleURL, handleURL, parseUrl, port }; +export { + startListeningHandleURL, handleURL, parseUrl, port, +} diff --git a/electron/url-handle/port.js b/electron/url-handle/port.js index a4e0b552..12ad0054 100644 --- a/electron/url-handle/port.js +++ b/electron/url-handle/port.js @@ -1,29 +1,29 @@ -import fs from 'fs'; -import path from 'path'; +import fs from 'fs' +import path from 'path' -const homeEnv = process.platform === 'win32' ? 'USERPROFILE' : 'HOME'; -const portFile = path.join(process.env[homeEnv], '.rndebugger_port'); -let isWatching = false; +const homeEnv = process.platform === 'win32' ? 'USERPROFILE' : 'HOME' +const portFile = path.join(process.env[homeEnv], '.rndebugger_port') +let isWatching = false export const write = (port) => { - fs.writeFileSync(portFile, String(port)); -}; + fs.writeFileSync(portFile, String(port)) +} export function read() { - if (!fs.existsSync(portFile)) return null; - return Number(fs.readFileSync(portFile, 'utf8')); + if (!fs.existsSync(portFile)) return null + return Number(fs.readFileSync(portFile, 'utf8')) } export const unlink = () => { if (fs.existsSync(portFile)) { - fs.unlinkSync(portFile); + fs.unlinkSync(portFile) } -}; +} -export const watchExists = port => { - if (isWatching) return; - isWatching = true; +export const watchExists = (port) => { + if (isWatching) return + isWatching = true fs.watchFile(portFile, (curr, prev) => { - if (curr.mtime !== prev.mtime) write(port); - }); -}; + if (curr.mtime !== prev.mtime) write(port) + }) +} diff --git a/electron/window.js b/electron/window.js index f564200e..6d671e9a 100644 --- a/electron/window.js +++ b/electron/window.js @@ -1,66 +1,62 @@ -import path from 'path'; -import { BrowserWindow, Menu, globalShortcut, dialog } from 'electron'; -import Store from 'electron-store'; -import { enable } from '@electron/remote/main'; -import autoUpdate from './update'; -import { catchConsoleLogLink, removeUnecessaryTabs, activeTabs } from './devtools'; -import { selectRNDebuggerWorkerContext } from '../app/utils/devtools'; -import { readConfig, filePath as configFile } from './config'; -import { registerContextMenu } from './context-menu'; +import path from 'path' +import { + BrowserWindow, Menu, globalShortcut, dialog, +} from 'electron' +import Store from 'electron-store' +import { enable } from '@electron/remote/main' +import autoUpdate from './update' +import { catchConsoleLogLink, removeUnecessaryTabs, activeTabs } from './devtools' +import { selectRNDebuggerWorkerContext } from '../app/utils/devtools' +import { readConfig, filePath as configFile } from './config' +import { registerContextMenu } from './context-menu' -const store = new Store(); +const store = new Store() -const executeJavaScript = (win, script) => - win.webContents.executeJavaScript(script); +const executeJavaScript = (win, script) => win.webContents.executeJavaScript(script) -export const checkWindowInfo = (win) => - executeJavaScript(win, 'window.checkWindowInfo()'); +export const checkWindowInfo = (win) => executeJavaScript(win, 'window.checkWindowInfo()') -const checkIsOpenInEditorEnabled = (win) => - executeJavaScript(win, 'window.isOpenInEditorEnabled()'); +const checkIsOpenInEditorEnabled = (win) => executeJavaScript(win, 'window.isOpenInEditorEnabled()') const changeMenuItems = (menus) => { - const rootMenuItems = Menu.getApplicationMenu().items; + const rootMenuItems = Menu.getApplicationMenu().items Object.entries(menus).forEach(([key, subMenu]) => { - const rootMenuItem = rootMenuItems.find(({ label }) => label === key); - if (!rootMenuItem || !rootMenuItem.submenu) return; + const rootMenuItem = rootMenuItems.find(({ label }) => label === key) + if (!rootMenuItem || !rootMenuItem.submenu) return Object.entries(subMenu).forEach(([subKey, menuSet]) => { const menuItem = rootMenuItem.submenu.items.find( ({ label }) => label === subKey, - ); - if (!menuItem) return; + ) + if (!menuItem) return - Object.assign(menuItem, menuSet); - }); - }); -}; + Object.assign(menuItem, menuSet) + }) + }) +} -const invokeDevMethod = (win, name) => - executeJavaScript( - win, - `window.invokeDevMethod && window.invokeDevMethod('${name}')`, - ); +const invokeDevMethod = (win, name) => executeJavaScript( + win, + `window.invokeDevMethod && window.invokeDevMethod('${name}')`, +) const registerKeyboradShortcut = (win) => { - const prefix = process.platform === 'darwin' ? 'Command' : 'Ctrl'; + const prefix = process.platform === 'darwin' ? 'Command' : 'Ctrl' // If another window focused, register a new shortcut if ( - globalShortcut.isRegistered(`${prefix}+R`) || - globalShortcut.isRegistered(`${prefix}+I`) + globalShortcut.isRegistered(`${prefix}+R`) + || globalShortcut.isRegistered(`${prefix}+I`) ) { - globalShortcut.unregisterAll(); + globalShortcut.unregisterAll() } - globalShortcut.register(`${prefix}+R`, () => invokeDevMethod(win, 'reload')); - globalShortcut.register(`${prefix}+I`, () => - invokeDevMethod(win, 'toggleElementInspector'), - ); -}; + globalShortcut.register(`${prefix}+R`, () => invokeDevMethod(win, 'reload')) + globalShortcut.register(`${prefix}+I`, () => invokeDevMethod(win, 'toggleElementInspector')) +} -const unregisterKeyboradShortcut = () => globalShortcut.unregisterAll(); +const unregisterKeyboradShortcut = () => globalShortcut.unregisterAll() const registerShortcuts = async (win) => { - registerKeyboradShortcut(win); + registerKeyboradShortcut(win) changeMenuItems({ Debugger: { 'Stay in Front': { @@ -70,26 +66,28 @@ const registerShortcuts = async (win) => { checked: await checkIsOpenInEditorEnabled(win), }, }, - }); -}; + }) +} -const minSize = 100; +const minSize = 100 export const createWindow = ({ iconPath, isPortSettingRequired, port }) => { - const { config, isConfigBroken, error } = readConfig(); + const { config, isConfigBroken, error } = readConfig() if (isConfigBroken) { dialog.showErrorBox( 'Root config error', - `Parse root config failed, please checkout \`${configFile}\`, the error trace:\n\n` + - `${error}\n\n` + - 'RNDebugger will load default config instead. ' + - 'You can click `Debugger` -> `Open Config File` in application menu.', - ); + `Parse root config failed, please checkout \`${configFile}\`, the error trace:\n\n` + + `${error}\n\n` + + 'RNDebugger will load default config instead. ' + + 'You can click `Debugger` -> `Open Config File` in application menu.', + ) } - const winBounds = store.get('winBounds') || {}; - const increasePosition = BrowserWindow.getAllWindows().length * 10 || 0; - const { width, height, x = 0, y = 0 } = winBounds; + const winBounds = store.get('winBounds') || {} + const increasePosition = BrowserWindow.getAllWindows().length * 10 || 0 + const { + width, height, x = 0, y = 0, + } = winBounds const win = new BrowserWindow({ ...winBounds, width: width && width >= minSize ? width : 1024, @@ -108,12 +106,12 @@ export const createWindow = ({ iconPath, isPortSettingRequired, port }) => { // webviewTag: true, // Use this for new inspector in the future }, ...config.windowBounds, - }); - enable(win.webContents); + }) + enable(win.webContents) - const isFirstWindow = BrowserWindow.getAllWindows().length === 1; + const isFirstWindow = BrowserWindow.getAllWindows().length === 1 - const { timesJSLoadToRefreshDevTools = -1 } = config; + const { timesJSLoadToRefreshDevTools = -1 } = config win.debuggerConfig = { port, editor: config.editor, @@ -123,54 +121,54 @@ export const createWindow = ({ iconPath, isPortSettingRequired, port }) => { networkInspect: config.defaultNetworkInspect && 1, isPortSettingRequired: isPortSettingRequired && 1, timesJSLoadToRefreshDevTools, - }; - win.loadURL(`file://${path.resolve(__dirname)}/app.html`); - let unregisterContextMenu; + } + win.loadURL(`file://${path.resolve(__dirname)}/app.html`) + let unregisterContextMenu win.webContents.on('did-finish-load', () => { - win.webContents.zoomLevel = config.zoomLevel || store.get('zoomLevel', 0); - win.focus(); - unregisterContextMenu = registerContextMenu(win); - registerShortcuts(win); + win.webContents.zoomLevel = config.zoomLevel || store.get('zoomLevel', 0) + win.focus() + unregisterContextMenu = registerContextMenu(win) + registerShortcuts(win) if (process.env.E2E_TEST !== '1' && !isPortSettingRequired) { - win.openDevTools(); + win.openDevTools() } - const checkUpdate = config.autoUpdate !== false; + const checkUpdate = config.autoUpdate !== false if (checkUpdate && isFirstWindow) { - autoUpdate(iconPath); + autoUpdate(iconPath) } - }); + }) win.webContents.on('devtools-opened', async () => { - const { location } = await checkWindowInfo(win); - activeTabs(win); - catchConsoleLogLink(win, location.host, location.port); + const { location } = await checkWindowInfo(win) + activeTabs(win) + catchConsoleLogLink(win, location.host, location.port) if (config.showAllDevToolsTab !== true) { - removeUnecessaryTabs(win); + removeUnecessaryTabs(win) } - selectRNDebuggerWorkerContext(win); - }); + selectRNDebuggerWorkerContext(win) + }) win.on('show', () => { - if (!win.isFocused()) return; - registerShortcuts(win); - }); - win.on('focus', () => registerShortcuts(win)); - win.on('restore', () => registerShortcuts(win)); - win.on('hide', () => unregisterKeyboradShortcut()); - win.on('blur', () => unregisterKeyboradShortcut()); - win.on('minimize', () => unregisterKeyboradShortcut()); + if (!win.isFocused()) return + registerShortcuts(win) + }) + win.on('focus', () => registerShortcuts(win)) + win.on('restore', () => registerShortcuts(win)) + win.on('hide', () => unregisterKeyboradShortcut()) + win.on('blur', () => unregisterKeyboradShortcut()) + win.on('minimize', () => unregisterKeyboradShortcut()) win.close = async () => { - unregisterKeyboradShortcut(); - store.set('winBounds', win.getBounds()); - store.set('zoomLevel', win.webContents.zoomLevel); + unregisterKeyboradShortcut() + store.set('winBounds', win.getBounds()) + store.set('zoomLevel', win.webContents.zoomLevel) await executeJavaScript( win, 'window.beforeWindowClose && window.beforeWindowClose()', - ); - win.destroy(); - }; + ) + win.destroy() + } win.on('close', (event) => { - event.preventDefault(); - win.close(); - if (unregisterContextMenu) unregisterContextMenu(); - }); - return win; -}; + event.preventDefault() + win.close() + if (unregisterContextMenu) unregisterContextMenu() + }) + return win +} diff --git a/examples/test-old-bridge/App.js b/examples/test-old-bridge/App.js index 153e460a..4a33405e 100644 --- a/examples/test-old-bridge/App.js +++ b/examples/test-old-bridge/App.js @@ -1,14 +1,15 @@ -import { StatusBar } from 'expo-status-bar'; -import React from 'react'; -import { StyleSheet, View } from 'react-native'; -import ReduxApp from './examples/redux/App'; +/* eslint-disable react/style-prop-object */ +import { StatusBar } from 'expo-status-bar' +import React from 'react' +import { StyleSheet, View } from 'react-native' +import ReduxApp from './examples/redux/App' const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', }, -}); +}) export default function App() { return ( @@ -16,5 +17,5 @@ export default function App() { - ); + ) } diff --git a/examples/test-old-bridge/babel.config.js b/examples/test-old-bridge/babel.config.js index f6d217d3..9f057eaa 100644 --- a/examples/test-old-bridge/babel.config.js +++ b/examples/test-old-bridge/babel.config.js @@ -1,6 +1,6 @@ module.exports = (api) => { - api.cache(true); + api.cache(true) return { presets: ['babel-preset-expo'], - }; -}; + } +} diff --git a/examples/test-old-bridge/examples/redux/App.js b/examples/test-old-bridge/examples/redux/App.js index e8f612dd..629011ec 100644 --- a/examples/test-old-bridge/examples/redux/App.js +++ b/examples/test-old-bridge/examples/redux/App.js @@ -1,10 +1,12 @@ -import React from 'react'; -import { Provider } from 'react-redux'; -import { Counter } from './features/counter/Counter'; -import { store } from './app/store'; +import React from 'react' +import { Provider } from 'react-redux' +import { Counter } from './features/counter/Counter' +import { store } from './app/store' -export default () => ( - - - -); +export default function () { + return ( + + + + ) +} diff --git a/examples/test-old-bridge/examples/redux/app/store.js b/examples/test-old-bridge/examples/redux/app/store.js index 9eca6d24..012eb09a 100644 --- a/examples/test-old-bridge/examples/redux/app/store.js +++ b/examples/test-old-bridge/examples/redux/app/store.js @@ -1,8 +1,8 @@ -import { configureStore } from '@reduxjs/toolkit'; -import counterReducer from '../features/counter/counterSlice'; +import { configureStore } from '@reduxjs/toolkit' +import counterReducer from '../features/counter/counterSlice' export const store = configureStore({ reducer: { counter: counterReducer, }, -}); +}) diff --git a/examples/test-old-bridge/examples/redux/features/counter/Counter.js b/examples/test-old-bridge/examples/redux/features/counter/Counter.js index e0c2a6ea..8e7a6640 100644 --- a/examples/test-old-bridge/examples/redux/features/counter/Counter.js +++ b/examples/test-old-bridge/examples/redux/features/counter/Counter.js @@ -1,13 +1,15 @@ -import React from 'react'; -import { StyleSheet, View, Text, TouchableHighlight } from 'react-native'; -import { useSelector, useDispatch } from 'react-redux'; +import React from 'react' +import { + StyleSheet, View, Text, TouchableHighlight, +} from 'react-native' +import { useSelector, useDispatch } from 'react-redux' import { decrement, increment, incrementAsync, incrementIfOdd, selectCount, -} from './counterSlice'; +} from './counterSlice' const styles = StyleSheet.create({ container: { @@ -27,16 +29,20 @@ const styles = StyleSheet.create({ textAlign: 'center', margin: 10, }, -}); - +}) export function Counter() { - const count = useSelector(selectCount); - const dispatch = useDispatch(); + const count = useSelector(selectCount) + const dispatch = useDispatch() return ( Redux example - Clicked: {count} times + + Clicked: + {count} + {' '} + times + dispatch(increment())}> + @@ -50,7 +56,7 @@ export function Counter() { Increment async - ); + ) } -export default Counter; +export default Counter diff --git a/examples/test-old-bridge/examples/redux/features/counter/counterAPI.js b/examples/test-old-bridge/examples/redux/features/counter/counterAPI.js index cc9b4a44..4620bce1 100644 --- a/examples/test-old-bridge/examples/redux/features/counter/counterAPI.js +++ b/examples/test-old-bridge/examples/redux/features/counter/counterAPI.js @@ -1,6 +1,6 @@ // A mock function to mimic making an async request for data export function fetchCount(amount = 1) { - return new Promise((resolve) => + return new Promise((resolve) => { setTimeout(() => resolve({ data: amount }), 500) - ); + }) } diff --git a/examples/test-old-bridge/examples/redux/features/counter/counterSlice.js b/examples/test-old-bridge/examples/redux/features/counter/counterSlice.js index 8dc4b5cf..cd82f23c 100644 --- a/examples/test-old-bridge/examples/redux/features/counter/counterSlice.js +++ b/examples/test-old-bridge/examples/redux/features/counter/counterSlice.js @@ -1,10 +1,10 @@ -import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'; -import { fetchCount } from './counterAPI'; +import { createAsyncThunk, createSlice } from '@reduxjs/toolkit' +import { fetchCount } from './counterAPI' const initialState = { value: 0, status: 'idle', -}; +} // The function below is called a thunk and allows us to perform async logic. It // can be dispatched like a regular action: `dispatch(incrementAsync(10))`. This @@ -14,11 +14,11 @@ const initialState = { export const incrementAsync = createAsyncThunk( 'counter/fetchCount', async (amount) => { - const response = await fetchCount(amount); + const response = await fetchCount(amount) // The value we return becomes the `fulfilled` action payload - return response.data; - } -); + return response.data + }, +) export const counterSlice = createSlice({ name: 'counter', @@ -30,14 +30,14 @@ export const counterSlice = createSlice({ // doesn't actually mutate the state because it uses the Immer library, // which detects changes to a "draft state" and produces a brand new // immutable state based off those changes - state.value += 1; + state.value += 1 }, decrement: (state) => { - state.value -= 1; + state.value -= 1 }, // Use the PayloadAction type to declare the contents of `action.payload` incrementByAmount: (state, action) => { - state.value += action.payload; + state.value += action.payload }, }, // The `extraReducers` field lets the slice handle actions defined elsewhere, @@ -45,29 +45,29 @@ export const counterSlice = createSlice({ extraReducers: (builder) => { builder .addCase(incrementAsync.pending, (state) => { - state.status = 'loading'; + state.status = 'loading' }) .addCase(incrementAsync.fulfilled, (state, action) => { - state.status = 'idle'; - state.value += action.payload; - }); + state.status = 'idle' + state.value += action.payload + }) }, -}); +}) -export const { increment, decrement, incrementByAmount } = counterSlice.actions; +export const { increment, decrement, incrementByAmount } = counterSlice.actions // The function below is called a selector and allows us to select a value from // the state. Selectors can also be defined inline where they're used instead of // in the slice file. For example: `useSelector((state: RootState) => state.counter.value)` -export const selectCount = (state) => state.counter.value; +export const selectCount = (state) => state.counter.value // We can also write thunks by hand, which may contain both sync and async logic. // Here's an example of conditionally dispatching actions based on current state. export const incrementIfOdd = (amount) => (dispatch, getState) => { - const currentValue = selectCount(getState()); + const currentValue = selectCount(getState()) if (currentValue % 2 === 1) { - dispatch(incrementByAmount(amount)); + dispatch(incrementByAmount(amount)) } -}; +} -export default counterSlice.reducer; +export default counterSlice.reducer diff --git a/npm-package/.eslintrc b/npm-package/.eslintrc new file mode 100644 index 00000000..fea8b733 --- /dev/null +++ b/npm-package/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "global-require": "off" + } +} \ No newline at end of file diff --git a/npm-package/babel.config.js b/npm-package/babel.config.js index 938d5746..a6cd85ed 100644 --- a/npm-package/babel.config.js +++ b/npm-package/babel.config.js @@ -1,6 +1,6 @@ module.exports = (api) => { - api.cache(true); + api.cache(true) return { presets: [['@babel/preset-env', { targets: { node: '12' } }]], - }; -}; + } +} diff --git a/npm-package/bin/rndebugger-open.js b/npm-package/bin/rndebugger-open.js index d6e5bb89..7f53b37a 100755 --- a/npm-package/bin/rndebugger-open.js +++ b/npm-package/bin/rndebugger-open.js @@ -1,8 +1,8 @@ #! /usr/bin/env node -'use strict'; +'use strict' -const defaultPort = 8081; +const defaultPort = 8081 const argv = require('minimist')(process.argv.slice(2), { boolean: [ @@ -19,16 +19,17 @@ const argv = require('minimist')(process.argv.slice(2), { default: { inject: true, }, -}); +}) -let moduleName; -argv.port = Number(argv.port) || defaultPort; +argv.port = Number(argv.port) || defaultPort + +let mod if (argv.open && (argv.port || argv.host)) { - moduleName = '../lib/open'; + mod = require('../lib/open') } else { - moduleName = '../lib/main'; + mod = require('../lib/main') } -require(moduleName).default(argv, (pass, dontError) => { - if (!pass && !dontError) process.exit(1); -}); +mod.default(argv, (pass, dontError) => { + if (!pass && !dontError) process.exit(1) +}) diff --git a/npm-package/src/__tests__/injectDevToolsMiddleware.test.js b/npm-package/src/__tests__/injectDevToolsMiddleware.test.js index b0577945..e1da42ac 100644 --- a/npm-package/src/__tests__/injectDevToolsMiddleware.test.js +++ b/npm-package/src/__tests__/injectDevToolsMiddleware.test.js @@ -1,94 +1,91 @@ -import fs from 'fs-extra'; -import path from 'path'; -import fetch from 'node-fetch'; -import { inject, revert } from '../injectDevToolsMiddleware'; +import fs from 'fs-extra' +import path from 'path' +import fetch from 'node-fetch' +import { inject, revert } from '../injectDevToolsMiddleware' -const getRemoteMiddlewarePath = (version) => - `https://raw.githubusercontent.com/facebook/react-native/${version}-stable/local-cli/server/middleware/getDevToolsMiddleware.js`; +const getRemoteMiddlewarePath = (version) => `https://raw.githubusercontent.com/facebook/react-native/${version}-stable/local-cli/server/middleware/getDevToolsMiddleware.js` -const modulePath = path.join(__dirname, 'tmp'); +const modulePath = path.join(__dirname, 'tmp') -const middlewareDir = 'local-cli/server/middleware'; -const middlewarePath = path.join(middlewareDir, 'getDevToolsMiddleware.js'); +const middlewareDir = 'local-cli/server/middleware' +const middlewarePath = path.join(middlewareDir, 'getDevToolsMiddleware.js') -jest.setTimeout(30000); +jest.setTimeout(30000) describe('Inject to devtoolsMiddleware of React Native packager', () => { afterEach(() => { - fs.removeSync(path.join(__dirname, 'tmp')); - }); - const oldVersions = ['0.49', '0.50']; + fs.removeSync(path.join(__dirname, 'tmp')) + }) + const oldVersions = ['0.49', '0.50'] oldVersions.forEach((version) => { test(`inject / revert in react-native ${version}`, async () => { - const code = await fetch(getRemoteMiddlewarePath(version)).then((res) => - res.text(), - ); - fs.ensureDirSync(path.join(modulePath, 'react-native', middlewareDir)); + const code = await fetch(getRemoteMiddlewarePath(version)).then((res) => res.text()) + fs.ensureDirSync(path.join(modulePath, 'react-native', middlewareDir)) fs.outputFileSync( path.join(modulePath, 'react-native', middlewarePath), code, - ); + ) fs.outputFileSync( path.join(modulePath, 'react-native', 'package.json'), JSON.stringify({ version: `${version}.0`, name: 'react-native', }), - ); + ) - expect(code).toMatchSnapshot(); - inject(modulePath, 'react-native'); + expect(code).toMatchSnapshot() + inject(modulePath, 'react-native') expect( fs.readFileSync( path.join(modulePath, 'react-native', middlewarePath), 'utf-8', ), - ).toMatchSnapshot(); - revert(modulePath, 'react-native'); + ).toMatchSnapshot() + revert(modulePath, 'react-native') expect( fs.readFileSync( path.join(modulePath, 'react-native', middlewarePath), 'utf-8', ), - ).toMatchSnapshot(); - }); - }); + ).toMatchSnapshot() + }) + }) test('inject / revert in react-native-macos', async () => { const code = await fetch( 'https://raw.githubusercontent.com/ptmt/react-native-macos/merge-0.44.0/local-cli/server/middleware/getDevToolsMiddleware.js', - ).then((res) => res.text()); + ).then((res) => res.text()) fs.ensureDirSync( path.join(modulePath, 'react-native-macos', middlewareDir), - ); + ) fs.outputFileSync( path.join(modulePath, 'react-native-macos', middlewarePath), code, - ); + ) fs.outputFileSync( path.join(modulePath, 'react-native-macos', 'package.json'), JSON.stringify({ version: '0.8.7', name: 'react-native-macos', }), - ); + ) - expect(code).toMatchSnapshot(); - inject(modulePath, 'react-native-macos'); + expect(code).toMatchSnapshot() + inject(modulePath, 'react-native-macos') expect( fs.readFileSync( path.join(modulePath, 'react-native-macos', middlewarePath), 'utf-8', ), - ).toMatchSnapshot(); - revert(modulePath, 'react-native-macos'); + ).toMatchSnapshot() + revert(modulePath, 'react-native-macos') expect( fs.readFileSync( path.join(modulePath, 'react-native-macos', middlewarePath), 'utf-8', ), - ).toMatchSnapshot(); - }); + ).toMatchSnapshot() + }) const oldCliVersions = [ { @@ -103,82 +100,82 @@ describe('Inject to devtoolsMiddleware of React Native packager', () => { rn: '0.61.0', cli: ['3.0.0-alpha.7', '3.0.1'], }, - ]; - const oldPkgName = '@react-native-community/cli'; + ] + const oldPkgName = '@react-native-community/cli' oldCliVersions.forEach(({ rn, cli }) => { cli.forEach((version) => { test(`inject / revert in ${oldPkgName} (${rn} - v${version})`, async () => { - const mDir = 'build/commands/server/middleware'; - const mPath = path.join(mDir, 'getDevToolsMiddleware.js'); + const mDir = 'build/commands/server/middleware' + const mPath = path.join(mDir, 'getDevToolsMiddleware.js') const code = await fetch( `https://unpkg.com/${oldPkgName}@${version}/build/commands/server/middleware/getDevToolsMiddleware.js`, - ).then((res) => res.text()); + ).then((res) => res.text()) fs.ensureDirSync( path.join(modulePath, oldPkgName, mDir), - ); + ) fs.outputFileSync( path.join(modulePath, oldPkgName, mPath), code, - ); + ) fs.outputFileSync( path.join(modulePath, 'react-native', 'package.json'), JSON.stringify({ version: rn, name: 'react-native', }), - ); + ) - expect(code).toMatchSnapshot(); - inject(modulePath, 'react-native'); + expect(code).toMatchSnapshot() + inject(modulePath, 'react-native') expect( fs.readFileSync( path.join(modulePath, oldPkgName, mPath), 'utf-8', ), - ).toMatchSnapshot(); - revert(modulePath, 'react-native'); + ).toMatchSnapshot() + revert(modulePath, 'react-native') expect( fs.readFileSync( path.join(modulePath, oldPkgName, mPath), 'utf-8', ), - ).toMatchSnapshot(); - }); - }); - }); + ).toMatchSnapshot() + }) + }) + }) const newCliVersions = [ { rn: '0.71.8', cli: ['10.1.1'], }, - ]; - const newPkgName = '@react-native-community/cli-server-api'; + ] + const newPkgName = '@react-native-community/cli-server-api' newCliVersions.forEach(({ rn, cli }) => { cli.forEach((version) => { test(`inject / revert in ${newPkgName} (${rn} - v${version})`, async () => { - const mDir = 'build/'; - const mPath = path.join(mDir, 'devToolsMiddleware.js'); + const mDir = 'build/' + const mPath = path.join(mDir, 'devToolsMiddleware.js') const code = await fetch( `https://unpkg.com/${newPkgName}@${version}/build/devToolsMiddleware.js`, - ).then((res) => res.text()); + ).then((res) => res.text()) fs.ensureDirSync( path.join(modulePath, newPkgName, mDir), - ); + ) fs.outputFileSync( path.join(modulePath, newPkgName, mPath), code, - ); + ) fs.outputFileSync( path.join(modulePath, 'react-native', 'package.json'), JSON.stringify({ version: rn, name: 'react-native', }), - ); + ) - expect(code).toMatchSnapshot(); - inject(modulePath, 'react-native'); + expect(code).toMatchSnapshot() + inject(modulePath, 'react-native') expect( fs.readFileSync( path.join( @@ -188,8 +185,8 @@ describe('Inject to devtoolsMiddleware of React Native packager', () => { ), 'utf-8', ), - ).toMatchSnapshot(); - revert(modulePath, 'react-native'); + ).toMatchSnapshot() + revert(modulePath, 'react-native') expect( fs.readFileSync( path.join( @@ -199,8 +196,8 @@ describe('Inject to devtoolsMiddleware of React Native packager', () => { ), 'utf-8', ), - ).toMatchSnapshot(); - }); - }); - }); -}); + ).toMatchSnapshot() + }) + }) + }) +}) diff --git a/npm-package/src/injectDevToolsMiddleware.js b/npm-package/src/injectDevToolsMiddleware.js index b9389b1a..7bc11695 100644 --- a/npm-package/src/injectDevToolsMiddleware.js +++ b/npm-package/src/injectDevToolsMiddleware.js @@ -1,22 +1,22 @@ -import fs from 'fs'; -import { join } from 'path'; -import es6Template from 'es6-template'; -import semver from 'semver'; +import fs from 'fs' +import { join } from 'path' +import es6Template from 'es6-template' +import semver from 'semver' -const tmplPath = join(__dirname, 'injectDevToolsMiddleware.tmpl.js'); +const tmplPath = join(__dirname, 'injectDevToolsMiddleware.tmpl.js') const tmplPathInDev = join( __dirname, '../lib/injectDevToolsMiddleware.tmpl.js', -); +) const template = fs.readFileSync( fs.existsSync(tmplPath) ? tmplPath : tmplPathInDev, 'utf-8', -); +) -const name = 'react-native-debugger-patch'; -const startFlag = `/* ${name} start */`; -const endFlag = `/* ${name} end */`; +const name = 'react-native-debugger-patch' +const startFlag = `/* ${name} start */` +const endFlag = `/* ${name} end */` const rnFlags = { '0.50.0-rc.0': { @@ -62,12 +62,13 @@ const rnFlags = { func: 'function launchDevTools({\n port,\n watchFolders\n}, isDebuggerConnected) {', replaceFunc: - 'function launchDevTools({port, watchFolders},' + - ' isDebuggerConnected, skipRNDebugger) {', + 'function launchDevTools({port, watchFolders},' + + ' isDebuggerConnected, skipRNDebugger) {', funcCall: '({port, watchFolders}, isDebuggerConnected, true)', args: - "'localhost&port=' + port + '&watchFolders=' + " + - 'watchFolders.map(f => `"${f}"`).join(\',\')', + "'localhost&port=' + port + '&watchFolders=' + " + // eslint-disable-next-line no-template-curly-in-string + + 'watchFolders.map(f => `"${f}"`).join(\',\')', }, { target: '@react-native-community/cli', // 3.0.0 @@ -91,11 +92,11 @@ const rnFlags = { replaceFunc: "function launchDefaultDebugger(host, port, args = '', skipRNDebugger) {", funcCall: '(host, port, args, true)', - args: "(host || 'localhost') + '&port=' + port + '&projectRoots=' + process.cwd() + " + - "'&args=' + args", + args: "(host || 'localhost') + '&port=' + port + '&projectRoots=' + process.cwd() + " + + "'&args=' + args", }, ], -}; +} const flags = { 'react-native': rnFlags, @@ -123,25 +124,25 @@ const flags = { funcCall: '(port, true)', args: "'localhost&port=' + port", }, -}; +} const getModuleInfo = (modulePath, moduleName) => { const pkg = JSON.parse( fs.readFileSync(join(modulePath, moduleName, 'package.json')), ); // eslint-disable-line - return { version: pkg.version, name: pkg.name }; -}; + return { version: pkg.version, name: pkg.name } +} function getFlag(moduleName, version) { - const list = flags[moduleName || 'react-native'] || {}; - const versions = Object.keys(list); - let flag = flags.default; - for (let i = 0; i < versions.length; i++) { + const list = flags[moduleName || 'react-native'] || {} + const versions = Object.keys(list) + let flag = flags.default + for (let i = 0; i < versions.length; i += 1) { if (semver.gte(version, versions[i])) { - flag = list[versions[i]]; + flag = list[versions[i]] } } - return flag; + return flag } const injectCode = ( @@ -157,8 +158,8 @@ const injectCode = ( file, }, ) => { - const filePath = join(modulePath, target, dir, file); - if (!fs.existsSync(filePath)) return false; + const filePath = join(modulePath, target, dir, file) + if (!fs.existsSync(filePath)) return false const code = es6Template(template, { startFlag, replaceFuncFlag, @@ -166,73 +167,75 @@ const injectCode = ( funcCall, endFlag, args, - }); + }) - const middlewareCode = fs.readFileSync(filePath, 'utf-8'); - let start = middlewareCode.indexOf(startFlag); - let end = middlewareCode.indexOf(endFlag) + endFlag.length; + const middlewareCode = fs.readFileSync(filePath, 'utf-8') + let start = middlewareCode.indexOf(startFlag) + let end = middlewareCode.indexOf(endFlag) + endFlag.length // already injected if (start > -1 && middlewareCode.indexOf(replaceFuncFlag) === -1) { - start = -1; - end = -1; + start = -1 + end = -1 } if (start === -1) { - start = middlewareCode.indexOf(funcFlag); - end = start + funcFlag.length; + start = middlewareCode.indexOf(funcFlag) + end = start + funcFlag.length } - if (start === -1) return false; + if (start === -1) return false fs.writeFileSync( filePath, - middlewareCode.substr(0, start) + - code + - middlewareCode.substr(end, middlewareCode.length), - ); - return true; -}; + middlewareCode.substr(0, start) + + code + + middlewareCode.substr(end, middlewareCode.length), + ) + return true +} export const inject = (modulePath, moduleName) => { - const info = getModuleInfo(modulePath, moduleName); - const flagList = getFlag(info.name, info.version); + const info = getModuleInfo(modulePath, moduleName) + const flagList = getFlag(info.name, info.version) if (Array.isArray(flagList)) { - flagList.some(flag => injectCode(modulePath, flag)); + flagList.some((flag) => injectCode(modulePath, flag)) } else { - injectCode(modulePath, flagList); + injectCode(modulePath, flagList) } - return true; -}; + return true +} const revertCode = ( modulePath, - { func: funcFlag, replaceFunc: replaceFuncFlag, target, dir, file }, + { + func: funcFlag, replaceFunc: replaceFuncFlag, target, dir, file, + }, ) => { - const filePath = join(modulePath, target, dir, file); - if (!fs.existsSync(filePath)) return false; + const filePath = join(modulePath, target, dir, file) + if (!fs.existsSync(filePath)) return false - const middlewareCode = fs.readFileSync(filePath, 'utf-8'); - let start = middlewareCode.indexOf(startFlag); - let end = middlewareCode.indexOf(endFlag) + endFlag.length; + const middlewareCode = fs.readFileSync(filePath, 'utf-8') + let start = middlewareCode.indexOf(startFlag) + let end = middlewareCode.indexOf(endFlag) + endFlag.length // already injected if (start > -1 && middlewareCode.indexOf(replaceFuncFlag) === -1) { - start = -1; - end = -1; + start = -1 + end = -1 } - if (start === -1) return false; + if (start === -1) return false fs.writeFileSync( filePath, - middlewareCode.substr(0, start) + - funcFlag + - middlewareCode.substr(end, middlewareCode.length), - ); - return true; -}; + middlewareCode.substr(0, start) + + funcFlag + + middlewareCode.substr(end, middlewareCode.length), + ) + return true +} export const revert = (modulePath, moduleName) => { - const info = getModuleInfo(modulePath, moduleName); - const flagList = getFlag(info.name, info.version); + const info = getModuleInfo(modulePath, moduleName) + const flagList = getFlag(info.name, info.version) if (Array.isArray(flagList)) { - flagList.some(flag => revertCode(modulePath, flag)); + flagList.some((flag) => revertCode(modulePath, flag)) } else { - revertCode(modulePath, flagList); + revertCode(modulePath, flagList) } - return true; -}; + return true +} diff --git a/npm-package/src/main.js b/npm-package/src/main.js index 30dbb301..52165f45 100644 --- a/npm-package/src/main.js +++ b/npm-package/src/main.js @@ -1,60 +1,59 @@ -import fs from 'fs'; -import cp from 'child_process'; -import path from 'path'; -import chalk from 'chalk'; -import { inject as injectMiddleware, revert as revertMiddleware } from './injectDevToolsMiddleware'; +import fs from 'fs' +import cp from 'child_process' +import path from 'path' +import chalk from 'chalk' +import { inject as injectMiddleware, revert as revertMiddleware } from './injectDevToolsMiddleware' -const modulePath = path.join(process.cwd(), 'node_modules'); +const modulePath = path.join(process.cwd(), 'node_modules') const log = (pass, msg) => { - const prefix = pass ? chalk.green.bgBlack('PASS') : chalk.red.bgBlack('FAIL'); - const color = pass ? chalk.blue : chalk.red; - console.log(prefix, color(msg)); -}; + const prefix = pass ? chalk.green.bgBlack('PASS') : chalk.red.bgBlack('FAIL') + const color = pass ? chalk.blue : chalk.red + console.log(prefix, color(msg)) +} export default (argv, cb) => { - let moduleName; + let moduleName if (argv.macos) { - moduleName = 'react-native-macos'; + moduleName = 'react-native-macos' } else { - moduleName = 'react-native'; + moduleName = 'react-native' } // Revert injection if (argv.revert) { - const passMiddleware = revertMiddleware(modulePath, moduleName); - const msg = 'Revert injection of React Native Debugger from React Native packager'; - log(passMiddleware, msg + (!passMiddleware ? ', the file inject file not found.' : '.')); - return cb(passMiddleware); + const passMiddleware = revertMiddleware(modulePath, moduleName) + const msg = 'Revert injection of React Native Debugger from React Native packager' + log(passMiddleware, msg + (!passMiddleware ? ', the file inject file not found.' : '.')) + return cb(passMiddleware) } const inject = () => { - const pass = injectMiddleware(modulePath, moduleName); - const msg = 'Replace `open debugger-ui with Chrome` to `open React Native Debugger`'; - log(pass, msg + (pass ? '.' : ', the file inject file not found.')); - cb(pass); - }; + const pass = injectMiddleware(modulePath, moduleName) + const msg = 'Replace `open debugger-ui with Chrome` to `open React Native Debugger`' + log(pass, msg + (pass ? '.' : ', the file inject file not found.')) + cb(pass) + } if (process.platform !== 'darwin') { - inject(); + inject() } else { - const cwd = - '/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/'; // eslint-disable-line - const lsregisterPath = 'lsregister'; - if (!fs.existsSync(cwd + lsregisterPath)) return inject(); + const cwd = '/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/'; // eslint-disable-line + const lsregisterPath = 'lsregister' + if (!fs.existsSync(cwd + lsregisterPath)) return inject() cp.exec(`./${lsregisterPath} -dump | grep rndebugger:`, { cwd }, (err, stdout) => { if (stdout.length === 0) { log( false, - '[RNDebugger] The `rndebugger://` URI scheme seems not registered, ' + - "maybe you haven't install the app? " + - 'Run `brew update && brew install --cask react-native-debugger` ' + - 'or download from https://github.com/jhen0409/react-native-debugger/releases ' + - 'then open it to register the URI scheme.' - ); + '[RNDebugger] The `rndebugger://` URI scheme seems not registered, ' + + "maybe you haven't install the app? " + + 'Run `brew update && brew install --cask react-native-debugger` ' + + 'or download from https://github.com/jhen0409/react-native-debugger/releases ' + + 'then open it to register the URI scheme.', + ) } - inject(); - }); + inject() + }) } -}; +} diff --git a/npm-package/src/open.js b/npm-package/src/open.js index 332ff672..6ced9b07 100644 --- a/npm-package/src/open.js +++ b/npm-package/src/open.js @@ -1,77 +1,77 @@ -import fs from 'fs'; -import path from 'path'; -import net from 'net'; -import childProcess from 'child_process'; +import fs from 'fs' +import path from 'path' +import net from 'net' +import childProcess from 'child_process' -const homeEnv = process.platform === 'win32' ? 'USERPROFILE' : 'HOME'; -const portFile = path.join(process.env[homeEnv], '.rndebugger_port'); +const homeEnv = process.platform === 'win32' ? 'USERPROFILE' : 'HOME' +const portFile = path.join(process.env[homeEnv], '.rndebugger_port') function connectToRND(rndPath, log, cb) { - let port; + let port try { - port = fs.readFileSync(portFile, 'utf-8'); + port = fs.readFileSync(portFile, 'utf-8') } catch (e) { if (log) { console.log( - '\n[RNDebugger] The port file `$HOME/.rndebugger_port` not found\n' + - 'Maybe the React Native Debugger (^0.3) is not open?\n' + - '(Please visit https://github.com/jhen0409/react-native-debugger#installation)\n' - ); + '\n[RNDebugger] The port file `$HOME/.rndebugger_port` not found\n' + + 'Maybe the React Native Debugger (^0.3) is not open?\n' + + '(Please visit https://github.com/jhen0409/react-native-debugger#installation)\n', + ) } - return cb(false); + return cb(false) } const connection = net.createConnection({ host: '127.0.0.1', port }, () => { - let pass = false; - connection.setEncoding('utf-8'); - connection.write(JSON.stringify({ path: rndPath })); - connection.on('data', data => { - pass = data === 'success'; - connection.end(); - }); + let pass = false + connection.setEncoding('utf-8') + connection.write(JSON.stringify({ path: rndPath })) + connection.on('data', (data) => { + pass = data === 'success' + connection.end() + }) const timeoutId = setTimeout(() => { if (log) { - console.log(`\n[RNDebugger] Cannot connect to server with port ${port}.\n`); + console.log(`\n[RNDebugger] Cannot connect to server with port ${port}.\n`) } - connection.end(); - }, 1000); + connection.end() + }, 1000) connection.on('end', () => { - clearTimeout(timeoutId); + clearTimeout(timeoutId) if (!pass && log) { - console.log('\n[RNDebugger] Try to set port of React Native packager failed.\n'); + console.log('\n[RNDebugger] Try to set port of React Native packager failed.\n') } - cb(pass); - }); - }); + cb(pass) + }) + }) } export default ({ port, host = 'localhost' }, cb) => { - const rndPath = `rndebugger://set-debugger-loc?host=${host}&port=${port}`; + const rndPath = `rndebugger://set-debugger-loc?host=${host}&port=${port}` if (process.platform === 'darwin') { - const env = Object.assign({}, process.env); + const env = { ...process.env } // This env is specified from Expo (and CRNA), we need avoid it included in rndebugger - delete env.ELECTRON_RUN_AS_NODE; + delete env.ELECTRON_RUN_AS_NODE childProcess .spawn('open', ['-g', '-a', 'React Native Debugger', rndPath], { env }) - .once('close', code => { + .once('close', (code) => { if (code > 0) { - connectToRND(rndPath, false, pass => { + connectToRND(rndPath, false, (pass) => { if (!pass) { console.log( - "\n[RNDebugger] Cannot open the app, maybe you haven't install the app?\n" + - 'Run `brew update && brew cask install react-native-debugger` ' + - 'or download from https://github.com/jhen0409/react-native-debugger/releases\n' - ); + "\n[RNDebugger] Cannot open the app, maybe you haven't install the app?\n" + + 'Run `brew update && brew cask install react-native-debugger` ' + + 'or download from https://github.com/jhen0409/react-native-debugger/releases\n', + ) } - cb(pass, true); - }); + cb(pass, true) + }) } else { - cb(true); + cb(true) } - }); + }) } else { - connectToRND(rndPath, true, pass => { - cb(pass, true); - }); + connectToRND(rndPath, true, (pass) => { + cb(pass, true) + }) } -}; +} diff --git a/package.json b/package.json index 2637b07b..b3d67713 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "@redux-devtools/app": "^2.2.1", "@redux-devtools/core": "^3.13.1", "@redux-devtools/instrument": "^2.1.0", + "@redux-devtools/ui": "^1.3.0", "@redux-devtools/utils": "^2.0.1", "adbkit": "^2.11.0", "apollo-client-devtools": "^2.3.5", diff --git a/scripts/mac/createDMG.js b/scripts/mac/createDMG.js index 2c943559..2444cc3c 100644 --- a/scripts/mac/createDMG.js +++ b/scripts/mac/createDMG.js @@ -1,8 +1,8 @@ -const path = require('path'); -const createDMG = require('electron-installer-dmg'); -const pkg = require('../../package.json'); +const path = require('path') +const createDMG = require('electron-installer-dmg') +const pkg = require('../../package.json') -const appPath = path.join(__dirname, '../../release/React Native Debugger.app'); +const appPath = path.join(__dirname, '../../release/React Native Debugger.app') createDMG( { @@ -33,6 +33,6 @@ createDMG( ), }, (err) => { - if (err) console.log(err); + if (err) console.log(err) }, -); +) diff --git a/scripts/mac/createUniversalApp.js b/scripts/mac/createUniversalApp.js index 3b4a78af..a26e0571 100644 --- a/scripts/mac/createUniversalApp.js +++ b/scripts/mac/createUniversalApp.js @@ -1,37 +1,38 @@ -const path = require('path'); -const { version: electronVersion } = require('electron/package.json'); -const { makeUniversalApp } = require('@electron/universal'); -const { signAsync } = require('@electron/osx-sign'); -const { notarize } = require('@electron/notarize'); +const path = require('path') +const { version: electronVersion } = require('electron/package.json') +const { makeUniversalApp } = require('@electron/universal') +const { signAsync } = require('@electron/osx-sign') +const { notarize } = require('@electron/notarize') -const isNotarizeNeeded = process.argv.includes('--notarize'); +const isNotarizeNeeded = process.argv.includes('--notarize') -const developerId = `${process.env.APPLE_DEVELOPER_NAME} (${process.env.APPLE_TEAM_ID})`; +const developerId = `${process.env.APPLE_DEVELOPER_NAME} (${process.env.APPLE_TEAM_ID})` async function run() { const appPath = path.join( __dirname, '../../release/React Native Debugger.app', - ); + ) const x64AppPath = path.join( __dirname, '../../release/React Native Debugger-darwin-x64/React Native Debugger.app', - ); + ) const arm64AppPath = path.join( __dirname, '../../release/React Native Debugger-darwin-arm64/React Native Debugger.app', - ); + ) await makeUniversalApp({ force: true, x64AppPath, arm64AppPath, outAppPath: appPath, - }); + }) - if (!isNotarizeNeeded) return; + if (!isNotarizeNeeded) return - const pathes = [appPath, x64AppPath, arm64AppPath]; - for (const p of pathes) { + const pathes = [appPath, x64AppPath, arm64AppPath] + await pathes.reduce(async (promise, p) => { + await promise try { await signAsync({ app: p, @@ -42,18 +43,18 @@ async function run() { }), platform: 'darwin', version: electronVersion, - }); + }) + await notarize({ + tool: 'notarytool', + // xcrun notarytool store-credentials "AC_PASSWORD" + // --apple-id "xxx" --team-id "xxx" --password "" + keychainProfile: 'AC_PASSWORD', + appPath: p, + }) } catch (e) { - console.log(e); + console.log(e) } - await notarize({ - tool: 'notarytool', - // xcrun notarytool store-credentials "AC_PASSWORD" - // --apple-id "xxx" --team-id "xxx" --password "" - keychainProfile: 'AC_PASSWORD', - appPath: p, - }); - } + }, Promise.resolve()) } -run(); +run() diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 6ee28a05..5cc27061 100755 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -1,20 +1,20 @@ -const shell = require('shelljs'); +const shell = require('shelljs') async function run() { - shell.cd('npm-package'); - shell.exec('yarn'); - shell.cd('-'); - shell.cd('dist'); - shell.exec('yarn'); + shell.cd('npm-package') + shell.exec('yarn') + shell.cd('-') + shell.cd('dist') + shell.exec('yarn') shell.rm( '-rf', - 'node_modules/*/{example,examples,test,tests,*.md,*.markdown,CHANGELOG*,.*,Makefile}' - ); + 'node_modules/*/{example,examples,test,tests,*.md,*.markdown,CHANGELOG*,.*,Makefile}', + ) // Remove unnecessary files in apollo-client-devtools shell.rm( '-rf', - 'node_modules/apollo-client-devtools/{assets,build,development,shells/dev,src}' - ); + 'node_modules/apollo-client-devtools/{assets,build,development,shells/dev,src}', + ) } -run(); +run() diff --git a/webpack/base.js b/webpack/base.js index 3c82b5d8..1e84bc93 100644 --- a/webpack/base.js +++ b/webpack/base.js @@ -1,6 +1,6 @@ -const path = require('path'); -const electronPkg = require('electron/package.json'); -const babelConfig = require('../babel.config')({ cache: () => {} }); +const path = require('path') +const electronPkg = require('electron/package.json') +const babelConfig = require('../babel.config')({ cache: () => {} }) // Webpack 2 have native import / export support babelConfig.presets = [ @@ -12,8 +12,8 @@ babelConfig.presets = [ }, ], '@babel/preset-react', -]; -babelConfig.babelrc = false; +] +babelConfig.babelrc = false module.exports = { output: { @@ -47,4 +47,4 @@ module.exports = { 'adbkit', 'electron-named-image', ], -}; +} diff --git a/webpack/main.prod.js b/webpack/main.prod.js index 50e80b30..66e58e9e 100644 --- a/webpack/main.prod.js +++ b/webpack/main.prod.js @@ -1,7 +1,7 @@ -const path = require('path'); -const webpack = require('webpack'); -const TerserPlugin = require('terser-webpack-plugin'); -const baseConfig = require('./base'); +const path = require('path') +const webpack = require('webpack') +const TerserPlugin = require('terser-webpack-plugin') +const baseConfig = require('./base') module.exports = { ...baseConfig, @@ -32,4 +32,4 @@ module.exports = { __dirname: false, __filename: false, }, -}; +} diff --git a/webpack/renderer.dev.js b/webpack/renderer.dev.js index 51566893..04dc3c40 100644 --- a/webpack/renderer.dev.js +++ b/webpack/renderer.dev.js @@ -1,7 +1,7 @@ -const webpack = require('webpack'); -const baseConfig = require('./base'); +const webpack = require('webpack') +const baseConfig = require('./base') -const port = 3000; +const port = 3000 const baseDevConfig = { ...baseConfig, @@ -26,12 +26,12 @@ const baseDevConfig = { 'process.env.NODE_ENV': JSON.stringify('development'), }), ], -}; +} const buildDevConfig = (config) => ({ ...baseDevConfig, ...config, -}); +}) module.exports = [ buildDevConfig({ @@ -51,4 +51,4 @@ module.exports = [ }, target: 'webworker', }), -]; +] diff --git a/webpack/renderer.prod.js b/webpack/renderer.prod.js index ccde882f..e26a4e0a 100644 --- a/webpack/renderer.prod.js +++ b/webpack/renderer.prod.js @@ -1,7 +1,7 @@ -const webpack = require('webpack'); -const TerserPlugin = require('terser-webpack-plugin'); -const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); -const baseConfig = require('./base'); +const webpack = require('webpack') +const TerserPlugin = require('terser-webpack-plugin') +const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') +const baseConfig = require('./base') const baseProdConfig = { ...baseConfig, @@ -36,12 +36,12 @@ const baseProdConfig = { }), ], }, -}; +} -const buildProdConfig = config => ({ +const buildProdConfig = (config) => ({ ...baseProdConfig, ...config, -}); +}) module.exports = [ buildProdConfig({ @@ -65,4 +65,4 @@ module.exports = [ }, target: 'webworker', }), -]; +] From 6febbc9b9049d28f39f608c0c06b8a6054dd81e3 Mon Sep 17 00:00:00 2001 From: jhen Date: Tue, 25 Jul 2023 17:26:43 +0800 Subject: [PATCH 3/3] Add eslint-config-prettier --- .eslintrc | 2 +- package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index e725c336..1800c126 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,6 @@ { "parser": "@babel/eslint-parser", - "extends": "airbnb", + "extends": ["airbnb", "prettier"], "env": { "browser": true, "node": true, diff --git a/package.json b/package.json index b3d67713..ef084830 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "electron-packager": "^17.1.1", "eslint": "^8.45.0", "eslint-config-airbnb": "^19.0.4", + "eslint-config-prettier": "^8.8.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-react": "^7.33.0", diff --git a/yarn.lock b/yarn.lock index 54e1b9a6..9cbd954f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5292,6 +5292,11 @@ eslint-config-airbnb@^19.0.4: object.assign "^4.1.2" object.entries "^1.1.5" +eslint-config-prettier@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" + integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== + eslint-import-resolver-node@^0.3.7: version "0.3.7" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7"