From e3bc71502bf389c1eabd0ab351a009d14ebbab98 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Wed, 5 Jul 2023 09:36:20 -0500 Subject: [PATCH 1/8] chore(deps): use shifty@3.0.1 (#422) --- package-lock.json | 11 +++++++---- package.json | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0cbfe08bc..e334c7ca9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "react-zoom-pan-pinch": "^1.6.1", "redis": "^3.0.2", "seedrandom": "^3.0.5", - "shifty": "^2.15.2", + "shifty": "^3.0.1", "source-map-explorer": "^2.3.1", "stream": "npm:stream-browserify@^3.0.0", "trystero": "^0.11.8", @@ -30041,8 +30041,9 @@ } }, "node_modules/shifty": { - "version": "2.19.1", - "license": "MIT", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shifty/-/shifty-3.0.1.tgz", + "integrity": "sha512-jGbnl1VR0dG2J+x5u9E0c1gt9QqDjeFrOtopRmKhMw2zmtzZAWG4voYZD5lSpW6THct6G2STxICAPvqfU6J1Pg==", "optionalDependencies": { "fsevents": "^2.3.2" } @@ -54424,7 +54425,9 @@ "dev": true }, "shifty": { - "version": "2.19.1", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shifty/-/shifty-3.0.1.tgz", + "integrity": "sha512-jGbnl1VR0dG2J+x5u9E0c1gt9QqDjeFrOtopRmKhMw2zmtzZAWG4voYZD5lSpW6THct6G2STxICAPvqfU6J1Pg==", "requires": { "fsevents": "^2.3.2" } diff --git a/package.json b/package.json index 168f76529..e4ab2f179 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "react-zoom-pan-pinch": "^1.6.1", "redis": "^3.0.2", "seedrandom": "^3.0.5", - "shifty": "^2.15.2", + "shifty": "^3.0.1", "source-map-explorer": "^2.3.1", "stream": "npm:stream-browserify@^3.0.0", "trystero": "^0.11.8", From 0ca35422994226a192162ef2374af21217253f76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 09:44:45 -0500 Subject: [PATCH 2/8] chore(deps): bump engine.io and socket.io (#411) Bumps [engine.io](https://github.com/socketio/engine.io) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together. Updates `engine.io` from 6.2.1 to 6.4.2 - [Release notes](https://github.com/socketio/engine.io/releases) - [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/engine.io/compare/6.2.1...6.4.2) Updates `socket.io` from 4.5.4 to 4.6.1 - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/4.5.4...4.6.1) --- updated-dependencies: - dependency-name: engine.io dependency-type: indirect - dependency-name: socket.io dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 112 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 86 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index e334c7ca9..ab3e45645 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6690,11 +6690,13 @@ }, "node_modules/@types/cookie": { "version": "0.4.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" }, "node_modules/@types/cors": { "version": "2.8.13", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", + "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", "dependencies": { "@types/node": "*" } @@ -9157,7 +9159,8 @@ }, "node_modules/base64id": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "engines": { "node": "^4.5.0 || >= 5.9" } @@ -10968,7 +10971,8 @@ }, "node_modules/cookie": { "version": "0.4.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "engines": { "node": ">= 0.6" } @@ -11042,7 +11046,8 @@ }, "node_modules/cors": { "version": "2.8.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "dependencies": { "object-assign": "^4", "vary": "^1" @@ -12757,8 +12762,9 @@ } }, "node_modules/engine.io": { - "version": "6.2.1", - "license": "MIT", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.2.tgz", + "integrity": "sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg==", "dependencies": { "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", @@ -12769,7 +12775,7 @@ "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" + "ws": "~8.11.0" }, "engines": { "node": ">=10.0.0" @@ -12813,8 +12819,9 @@ } }, "node_modules/engine.io/node_modules/ws": { - "version": "8.2.3", - "license": "MIT", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", "engines": { "node": ">=10.0.0" }, @@ -30454,14 +30461,15 @@ } }, "node_modules/socket.io": { - "version": "4.5.4", - "license": "MIT", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.1.tgz", + "integrity": "sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA==", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", "debug": "~4.3.2", - "engine.io": "~6.2.1", - "socket.io-adapter": "~2.4.0", + "engine.io": "~6.4.1", + "socket.io-adapter": "~2.5.2", "socket.io-parser": "~4.2.1" }, "engines": { @@ -30469,8 +30477,32 @@ } }, "node_modules/socket.io-adapter": { - "version": "2.4.0", - "license": "MIT" + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", + "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", + "dependencies": { + "ws": "~8.11.0" + } + }, + "node_modules/socket.io-adapter/node_modules/ws": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } }, "node_modules/socket.io-client": { "version": "4.5.4", @@ -38586,10 +38618,14 @@ } }, "@types/cookie": { - "version": "0.4.1" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" }, "@types/cors": { "version": "2.8.13", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", + "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", "requires": { "@types/node": "*" } @@ -40378,7 +40414,9 @@ "version": "1.5.1" }, "base64id": { - "version": "2.0.0" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" }, "batch": { "version": "0.6.1", @@ -41585,7 +41623,9 @@ "version": "1.9.0" }, "cookie": { - "version": "0.4.2" + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" }, "cookie-signature": { "version": "1.0.6", @@ -41628,6 +41668,8 @@ }, "cors": { "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "requires": { "object-assign": "^4", "vary": "^1" @@ -42785,7 +42827,9 @@ } }, "engine.io": { - "version": "6.2.1", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.2.tgz", + "integrity": "sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg==", "requires": { "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", @@ -42796,11 +42840,13 @@ "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" + "ws": "~8.11.0" }, "dependencies": { "ws": { - "version": "8.2.3" + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==" } } }, @@ -54691,18 +54737,32 @@ } }, "socket.io": { - "version": "4.5.4", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.1.tgz", + "integrity": "sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA==", "requires": { "accepts": "~1.3.4", "base64id": "~2.0.0", "debug": "~4.3.2", - "engine.io": "~6.2.1", - "socket.io-adapter": "~2.4.0", + "engine.io": "~6.4.1", + "socket.io-adapter": "~2.5.2", "socket.io-parser": "~4.2.1" } }, "socket.io-adapter": { - "version": "2.4.0" + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", + "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", + "requires": { + "ws": "~8.11.0" + }, + "dependencies": { + "ws": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==" + } + } }, "socket.io-client": { "version": "4.5.4", From 035c14d61e5c05499df6ddf43e4e9e97ef04451b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 09:50:36 -0500 Subject: [PATCH 3/8] chore(deps): bump xml2js, @motrix/nat-api and jimp (#417) Bumps [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) to 0.5.0 and updates ancestor dependencies [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js), [@motrix/nat-api](https://github.com/alxhotel/nat-api) and [jimp](https://github.com/jimp-dev/jimp). These dependencies need to be updated together. Updates `xml2js` from 0.4.23 to 0.5.0 - [Commits](https://github.com/Leonidas-from-XIV/node-xml2js/commits/0.5.0) Updates `@motrix/nat-api` from 0.3.2 to 0.3.4 - [Release notes](https://github.com/alxhotel/nat-api/releases) - [Commits](https://github.com/alxhotel/nat-api/commits) Updates `jimp` from 0.16.2 to 0.22.8 - [Release notes](https://github.com/jimp-dev/jimp/releases) - [Changelog](https://github.com/jimp-dev/jimp/blob/main/CHANGELOG.md) - [Commits](https://github.com/jimp-dev/jimp/compare/v0.16.2...v0.22.8) --- updated-dependencies: - dependency-name: xml2js dependency-type: indirect - dependency-name: "@motrix/nat-api" dependency-type: indirect - dependency-name: jimp dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 1409 ++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 832 insertions(+), 579 deletions(-) diff --git a/package-lock.json b/package-lock.json index ab3e45645..5bcfe7aa8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,7 +103,7 @@ "husky": "^4.2.3", "jest-extended": "^0.11.5", "jest-junit": "^14.0.1", - "jimp": "^0.16.1", + "jimp": "^0.22.8", "jsdoc": "^3.5.5", "jsdom": "^16.2.1", "markdown-table": "^2.0.0", @@ -4798,12 +4798,12 @@ } }, "node_modules/@jimp/bmp": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.22.8.tgz", + "integrity": "sha512-JEMKgM1AEvvWfn9ZCHn62nK+QCE3Pb/ZhPdL3NF0ZgKNww6pqOmo6KqXzqY18JLB7c0epuTp4GPDPDhOh/ou1g==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", + "@jimp/utils": "^0.22.8", "bmp-js": "^0.1.0" }, "peerDependencies": { @@ -4811,25 +4811,26 @@ } }, "node_modules/@jimp/core": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.22.8.tgz", + "integrity": "sha512-vkN28aFikzQieA6bGxN+qe20pseCAemCyUI0YmRkJIArlb6OujtAwWAKyokv2lylV56bq8EQGIz+Y30OXUnRqg==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", + "@jimp/utils": "^0.22.8", "any-base": "^1.1.0", "buffer": "^5.2.0", "exif-parser": "^0.1.12", - "file-type": "^9.0.0", - "load-bmfont": "^1.3.1", - "mkdirp": "^0.5.1", - "phin": "^2.9.1", + "file-type": "^16.5.4", + "isomorphic-fetch": "^3.0.0", + "mkdirp": "^2.1.3", "pixelmatch": "^4.0.2", - "tinycolor2": "^1.4.1" + "tinycolor2": "^1.6.0" } }, "node_modules/@jimp/core/node_modules/buffer": { "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "funding": [ { @@ -4845,28 +4846,42 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, + "node_modules/@jimp/core/node_modules/mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@jimp/custom": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.22.8.tgz", + "integrity": "sha512-u6lP9x/HNeGHB0Oojv4c2mhuDvn7G0ikzYbK4IKLsH4HzHxt62faMjBzQMcFhKJhR6UiiKE/jiHrhGvBT/fMkw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/core": "^0.16.2" + "@jimp/core": "^0.22.8" } }, "node_modules/@jimp/gif": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.22.8.tgz", + "integrity": "sha512-I0l6koS67IPU40RPxCJTD1NvePEd8vUIHTejx1ly0jrjGnumbqdarAlBUkDrKfPPc+Fnqp84hBbSN1w5hNPT6w==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", + "@jimp/utils": "^0.22.8", "gifwrap": "^0.9.2", "omggif": "^1.0.9" }, @@ -4875,74 +4890,74 @@ } }, "node_modules/@jimp/jpeg": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.22.8.tgz", + "integrity": "sha512-hLXrQ7/0QiUhAVAF10dfGCSq3hvyqjKltlpu/87b3wqMDKe9KdvhX1AJHiUUrAbJv1fAcnOmQGTyXGuySa1D6A==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", - "jpeg-js": "^0.4.2" + "@jimp/utils": "^0.22.8", + "jpeg-js": "^0.4.4" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-blit": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.22.8.tgz", + "integrity": "sha512-rQ19txVCKIwo74HtgFodFt4//0ATPCJK+f24riqzb+nx+1JaOo1xRvpJqg4moirHwKR2fhwdDxmY7KX20kCeYA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-blur": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.22.8.tgz", + "integrity": "sha512-GWbNK3YW6k2EKiGJdpAFEr0jezPBtiVxj2wG/lCPuWJz7KmzSSN99hQjIy73xQxoBCRdALfJlkhe3leFNRueSQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-circle": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-0.22.8.tgz", + "integrity": "sha512-qPCw8XFW8opT89ciFDuvs+eB3EB1mZIJWVajD2qAlprHiE7YGr34TkM7N5MNr3qZ1pJgkYdW6+HbBrJwBaonqw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-color": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.22.8.tgz", + "integrity": "sha512-ogkbg6rpDVH/mMLgAQKg17z3oZE0VN7ZWxNoH12fUHchqKz1I57zpa65fxZe2I8T5Xz97HR3x+7V7oI8qQGdSA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", - "tinycolor2": "^1.4.1" + "@jimp/utils": "^0.22.8", + "tinycolor2": "^1.6.0" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-contain": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.22.8.tgz", + "integrity": "sha512-oiaPLdJt9Dk+XEEhM/OU3lFemM51mA9NgMCAdburSCjDzKacJYBGFSHjTOhXzcxOie/ZDpOYN/UzFGKy8Dgl9A==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5", @@ -4952,12 +4967,12 @@ } }, "node_modules/@jimp/plugin-cover": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.22.8.tgz", + "integrity": "sha512-mO68w1m/LhfuHU8LKHY05a4/hhWnY4t+T+8JCw9t+5yfzA4+LofBZZKtFtWgwf/QGe1y3X2rtUU/avAzDUKyyA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5", @@ -4967,60 +4982,60 @@ } }, "node_modules/@jimp/plugin-crop": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.22.8.tgz", + "integrity": "sha512-ns4oH0h0gezYsbuH8RThcMLY5uTLk/vnqOVjWCehMHEzxi0DHMWCmpcb6bC//vJ+XFNhtVGn1ALN7+ROmPrj+A==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-displace": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.22.8.tgz", + "integrity": "sha512-Cj8nHYgsdFynOIx3dbbiVwRuZn3xO+RVfwkTRy0JBye+K2AU8SQJS+hSFNMQFTZt5djivh6kh0TzvR/6LkOd1w==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-dither": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.22.8.tgz", + "integrity": "sha512-oE0Us/6bEgrgEg56plU3jSBzvB9iGhweKUHmxYMWnQbFCHP4mNCtPAs8+Fmq6c+m98ZgBgRcrJTnC7lphHkGyw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-fisheye": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-0.22.8.tgz", + "integrity": "sha512-bWvYY/nfMcKclWEaRyAir+YsT6C5St823HUQAsewZowTrJmme+w4U2a6InsryTHUL01BBcV5BLH0aDHuV3StvA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-flip": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.22.8.tgz", + "integrity": "sha512-0NFTNzjsdmOQkaIkNjZqO3/yU4SQb9nnWQXsLS1fFo+9QrIL5v8vVkXpk/rhiND6PyTj2mMTNjOa76GuZcC+iQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5", @@ -5028,61 +5043,61 @@ } }, "node_modules/@jimp/plugin-gaussian": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.22.8.tgz", + "integrity": "sha512-E/f14aLzCS50QAM7K+InI9V61KVy/Zx52vy7Jjfo1h7qKhQHss3PYaydaH0N6qlXRNeXgh+4/32P9JfieLMcdw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-invert": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.22.8.tgz", + "integrity": "sha512-UauP39FF2cwbA5VU+Tz9VlNa9rtULPSHZb0Huwcjqjm9/G/xVN69VJ8+RKiFC4zM1/kYAUp/6IRwPa6qdKJpSw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-mask": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.22.8.tgz", + "integrity": "sha512-bhg5+3i8x1CmYj6cjvPBQZLwZEI3iK3gJWF25ZHF+12d3cqDuJngtr8oRQOQLlAgvKmrj9FXIiEPDczUI9cnWQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-normalize": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.22.8.tgz", + "integrity": "sha512-Yg5nreAR1JYuSObu3ExlgaLxVeW6VvjVL5qFwiPFxSNlG8JIwL1Ir3K3ChSnnvymyZvJMHb6YKTYNfXKw5Da6g==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-print": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.22.8.tgz", + "integrity": "sha512-86O5ejCDi543IYl0TykSmNWErzAjEYhiAxNQb2F7rFRT38WJYNVsvJ6QhxhDQHKxSmF5iwmqbk0jYk5Wp2Z1kw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", - "load-bmfont": "^1.4.0" + "@jimp/utils": "^0.22.8", + "load-bmfont": "^1.4.1" }, "peerDependencies": { "@jimp/custom": ">=0.3.5", @@ -5090,24 +5105,24 @@ } }, "node_modules/@jimp/plugin-resize": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.22.8.tgz", + "integrity": "sha512-kg8ArQRPqv/iU3DWNXCa8kcVIhoq64Ze0aGCAeFLKlAq/59f5pzAci6m6vV4L/uOVdYmUa9/kYwIFY6RWKpfzQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/plugin-rotate": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.22.8.tgz", + "integrity": "sha512-9a+VPZWMN/Cks76wf8LjM5RVA3ntP9+NAdsS1SZhhXel7U3Re/dWMouIEbo3QTt6K+igRo4txUCdZiw4ZucvkQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5", @@ -5117,12 +5132,12 @@ } }, "node_modules/@jimp/plugin-scale": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.22.8.tgz", + "integrity": "sha512-dQS4pG6DX6endu8zUpvBBOEtGC+ljDDDNw0scSXY71TxyQdNo5Ro0apfsppjmuAr8rNotRkfyxbITKkXQDRUDQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5", @@ -5130,12 +5145,12 @@ } }, "node_modules/@jimp/plugin-shadow": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-shadow/-/plugin-shadow-0.22.8.tgz", + "integrity": "sha512-HyAhr7OblTQh+BoKHQg4qbS9MweNlH77yfpBqUEyDtfyjI5r06+5chf1ZdLRIPEWv/BdCfdI/g81Wv69muCMwA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5", @@ -5144,12 +5159,12 @@ } }, "node_modules/@jimp/plugin-threshold": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-0.22.8.tgz", + "integrity": "sha512-ZmkfH0PtjvF1UcKsjw0H7V6r+LC0yKzEfg76Jhs2nIqIgsxsSOVfHwS7z0/1IWnyXxSw36m+NjCAotNHRILGmA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" }, "peerDependencies": { "@jimp/custom": ">=0.3.5", @@ -5158,32 +5173,32 @@ } }, "node_modules/@jimp/plugins": { - "version": "0.16.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/plugin-blit": "^0.16.2", - "@jimp/plugin-blur": "^0.16.2", - "@jimp/plugin-circle": "^0.16.2", - "@jimp/plugin-color": "^0.16.2", - "@jimp/plugin-contain": "^0.16.2", - "@jimp/plugin-cover": "^0.16.2", - "@jimp/plugin-crop": "^0.16.2", - "@jimp/plugin-displace": "^0.16.2", - "@jimp/plugin-dither": "^0.16.2", - "@jimp/plugin-fisheye": "^0.16.2", - "@jimp/plugin-flip": "^0.16.2", - "@jimp/plugin-gaussian": "^0.16.2", - "@jimp/plugin-invert": "^0.16.2", - "@jimp/plugin-mask": "^0.16.2", - "@jimp/plugin-normalize": "^0.16.2", - "@jimp/plugin-print": "^0.16.2", - "@jimp/plugin-resize": "^0.16.2", - "@jimp/plugin-rotate": "^0.16.2", - "@jimp/plugin-scale": "^0.16.2", - "@jimp/plugin-shadow": "^0.16.2", - "@jimp/plugin-threshold": "^0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.22.8.tgz", + "integrity": "sha512-ieI2+kCpmIfjwVlT7B67ULCzxMizfj7LspJh9HnIZCDXQB9GBOZ9KImLYc75Krae0dP/3FR7FglLiSI7fkOHbw==", + "dev": true, + "dependencies": { + "@jimp/plugin-blit": "^0.22.8", + "@jimp/plugin-blur": "^0.22.8", + "@jimp/plugin-circle": "^0.22.8", + "@jimp/plugin-color": "^0.22.8", + "@jimp/plugin-contain": "^0.22.8", + "@jimp/plugin-cover": "^0.22.8", + "@jimp/plugin-crop": "^0.22.8", + "@jimp/plugin-displace": "^0.22.8", + "@jimp/plugin-dither": "^0.22.8", + "@jimp/plugin-fisheye": "^0.22.8", + "@jimp/plugin-flip": "^0.22.8", + "@jimp/plugin-gaussian": "^0.22.8", + "@jimp/plugin-invert": "^0.22.8", + "@jimp/plugin-mask": "^0.22.8", + "@jimp/plugin-normalize": "^0.22.8", + "@jimp/plugin-print": "^0.22.8", + "@jimp/plugin-resize": "^0.22.8", + "@jimp/plugin-rotate": "^0.22.8", + "@jimp/plugin-scale": "^0.22.8", + "@jimp/plugin-shadow": "^0.22.8", + "@jimp/plugin-threshold": "^0.22.8", "timm": "^1.6.1" }, "peerDependencies": { @@ -5191,41 +5206,41 @@ } }, "node_modules/@jimp/png": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.22.8.tgz", + "integrity": "sha512-XOj11kcCr8zKg24QSwlRfH9k4hbV6rkMGUVxMS3puRzzB0FBSQy42NBYEfYf2XlY2QJSAByPl4AYerOtKb805w==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", - "pngjs": "^3.3.3" + "@jimp/utils": "^0.22.8", + "pngjs": "^6.0.0" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/tiff": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.22.8.tgz", + "integrity": "sha512-K0hYUVW5MLgwq3jiHVHa6LvP05J1rXOlRCC+5dMTUnAXVwi45+MKsqA/8lzzwhHYJ65CNhZwy6D3+ZNzM9SIBQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "utif": "^2.0.1" + "utif2": "^4.0.1" }, "peerDependencies": { "@jimp/custom": ">=0.3.5" } }, "node_modules/@jimp/types": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.22.8.tgz", + "integrity": "sha512-9+xc+mzuYwu0i+6dsnhXiUgfcS+Ktqn5q2jczoKyyBT0cOKgsk+57EIeFLgpTfVGRKRR0y/UIdHByeCzGguF3A==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/bmp": "^0.16.2", - "@jimp/gif": "^0.16.2", - "@jimp/jpeg": "^0.16.2", - "@jimp/png": "^0.16.2", - "@jimp/tiff": "^0.16.2", + "@jimp/bmp": "^0.22.8", + "@jimp/gif": "^0.22.8", + "@jimp/jpeg": "^0.22.8", + "@jimp/png": "^0.22.8", + "@jimp/tiff": "^0.22.8", "timm": "^1.6.1" }, "peerDependencies": { @@ -5233,11 +5248,11 @@ } }, "node_modules/@jimp/utils": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.22.8.tgz", + "integrity": "sha512-AaqjfqDeLzSFzrbGRKHMXg/ntiWKvoG9tpVgWzgOx5/gPWj/IyGfztojLTTvY8HqZCr25z8z91u2lAQD2v46Jw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", "regenerator-runtime": "^0.13.3" } }, @@ -5633,143 +5648,77 @@ } }, "node_modules/@motrix/nat-api": { - "version": "0.3.2", - "license": "MIT", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@motrix/nat-api/-/nat-api-0.3.4.tgz", + "integrity": "sha512-RIH5sSP329Xn8TjDcAHYHn82VTajhdu2Ee4PTLA+9jCAi5x0D219D1XYW7nCK22ptcLrC+qzBXlWG/j16iuoLQ==", "dependencies": { - "async": "^3.2.0", - "debug": "^4.3.1", + "async": "^3.2.4", + "debug": "^4.3.4", "default-gateway": "^6.0.3", - "request": "^2.88.2", + "node-fetch": "^2.6.9", "unordered-array-remove": "^1.0.2", - "xml2js": "^0.4.23" + "xml2js": "^0.5.0" }, "engines": { "node": ">=10.0.0" } }, - "node_modules/@motrix/nat-api/node_modules/assert-plus": { - "version": "1.0.0", - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/@motrix/nat-api/node_modules/aws-sign2": { - "version": "0.7.0", - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/@motrix/nat-api/node_modules/caseless": { - "version": "0.12.0", - "license": "Apache-2.0" - }, - "node_modules/@motrix/nat-api/node_modules/form-data": { - "version": "2.3.3", - "license": "MIT", + "node_modules/@motrix/nat-api/node_modules/node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "whatwg-url": "^5.0.0" }, "engines": { - "node": ">= 0.12" - } - }, - "node_modules/@motrix/nat-api/node_modules/har-validator": { - "version": "5.1.5", - "license": "MIT", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" + "node": "4.x || >=6.0.0" }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@motrix/nat-api/node_modules/http-signature": { - "version": "1.2.0", - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "peerDependencies": { + "encoding": "^0.1.0" }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/@motrix/nat-api/node_modules/oauth-sign": { - "version": "0.9.0", - "license": "Apache-2.0", - "engines": { - "node": "*" + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, - "node_modules/@motrix/nat-api/node_modules/punycode": { - "version": "2.1.1", - "license": "MIT", - "engines": { - "node": ">=6" - } + "node_modules/@motrix/nat-api/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, - "node_modules/@motrix/nat-api/node_modules/qs": { - "version": "6.5.3", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.6" - } + "node_modules/@motrix/nat-api/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, - "node_modules/@motrix/nat-api/node_modules/request": { - "version": "2.88.2", - "license": "Apache-2.0", + "node_modules/@motrix/nat-api/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } }, - "node_modules/@motrix/nat-api/node_modules/tough-cookie": { - "version": "2.5.0", - "license": "BSD-3-Clause", + "node_modules/@motrix/nat-api/node_modules/xml2js": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" }, "engines": { - "node": ">=0.8" + "node": ">=4.0.0" } }, - "node_modules/@motrix/nat-api/node_modules/tunnel-agent": { - "version": "0.6.0", - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - }, + "node_modules/@motrix/nat-api/node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", "engines": { - "node": "*" + "node": ">=4.0" } }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { @@ -6536,6 +6485,12 @@ "@testing-library/dom": ">=7.21.4" } }, + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "dev": true + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "dev": true, @@ -8126,6 +8081,7 @@ }, "node_modules/ajv": { "version": "6.12.6", + "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -8261,8 +8217,9 @@ }, "node_modules/any-base": { "version": "1.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz", + "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==", + "dev": true }, "node_modules/any-signal": { "version": "2.1.2", @@ -8658,6 +8615,7 @@ "node_modules/asn1": { "version": "0.2.6", "license": "MIT", + "optional": true, "dependencies": { "safer-buffer": "~2.1.0" } @@ -8815,10 +8773,6 @@ "node": "*" } }, - "node_modules/aws4": { - "version": "1.11.0", - "license": "MIT" - }, "node_modules/axe-core": { "version": "4.6.1", "dev": true, @@ -9173,6 +9127,7 @@ "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "license": "BSD-3-Clause", + "optional": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -9378,8 +9333,9 @@ }, "node_modules/bmp-js": { "version": "0.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz", + "integrity": "sha512-vHdS19CnY3hwiNdkaqk93DvjVLfbEcI8mys4UjuWrlX1haDmroo8o4xCzh4wD6DGV6HxRCyauwhHRqMTfERtjw==", + "dev": true }, "node_modules/bn.js": { "version": "5.2.1", @@ -11529,6 +11485,7 @@ "node_modules/dashdash": { "version": "1.14.1", "license": "MIT", + "optional": true, "dependencies": { "assert-plus": "^1.0.0" }, @@ -11539,6 +11496,7 @@ "node_modules/dashdash/node_modules/assert-plus": { "version": "1.0.0", "license": "MIT", + "optional": true, "engines": { "node": ">=0.8" } @@ -12373,6 +12331,7 @@ "node_modules/ecc-jsbn": { "version": "0.1.2", "license": "MIT", + "optional": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -14285,6 +14244,8 @@ }, "node_modules/exif-parser": { "version": "0.1.12", + "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz", + "integrity": "sha512-c2bQfLNbMzLPmzQuOr8fy0csy84WmwnER81W88DzTp9CYNPJ6yzOj2EZAh9pywYpqHnshVLHQJ8WzldAyfY+Iw==", "dev": true }, "node_modules/exit": { @@ -14653,7 +14614,8 @@ "engines": [ "node >=0.6.0" ], - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -14680,6 +14642,7 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", + "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { @@ -14785,11 +14748,20 @@ "license": "MIT" }, "node_modules/file-type": { - "version": "9.0.0", + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-16.5.4.tgz", + "integrity": "sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==", "dev": true, - "license": "MIT", + "dependencies": { + "readable-web-to-node-stream": "^3.0.0", + "strtok3": "^6.2.4", + "token-types": "^4.1.1" + }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" } }, "node_modules/file-uri-to-path": { @@ -15065,6 +15037,7 @@ "node_modules/forever-agent": { "version": "0.6.1", "license": "Apache-2.0", + "optional": true, "engines": { "node": "*" } @@ -15598,6 +15571,7 @@ "node_modules/getpass": { "version": "0.1.7", "license": "MIT", + "optional": true, "dependencies": { "assert-plus": "^1.0.0" } @@ -15605,14 +15579,16 @@ "node_modules/getpass/node_modules/assert-plus": { "version": "1.0.0", "license": "MIT", + "optional": true, "engines": { "node": ">=0.8" } }, "node_modules/gifwrap": { "version": "0.9.4", + "resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.9.4.tgz", + "integrity": "sha512-MDMwbhASQuVeD4JKd1fKgNgCRL3fGqMM4WaqpNhWO0JiMOAjbQdumbs4BbBZEy9/M00EHEjKN3HieVhCUlwjeQ==", "dev": true, - "license": "MIT", "dependencies": { "image-q": "^4.0.0", "omggif": "^1.0.10" @@ -15947,13 +15923,6 @@ "dev": true, "license": "MIT" }, - "node_modules/har-schema": { - "version": "2.0.0", - "license": "ISC", - "engines": { - "node": ">=4" - } - }, "node_modules/har-validator": { "version": "2.0.6", "license": "ISC", @@ -16752,16 +16721,18 @@ }, "node_modules/image-q": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/image-q/-/image-q-4.0.0.tgz", + "integrity": "sha512-PfJGVgIfKQJuq3s0tTDOKtztksibuUEbJQIYT3by6wctQo+Rdlh7ef4evJ5NCdxY4CfMbvFkocEwbl4BF8RlJw==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "16.9.1" } }, "node_modules/image-q/node_modules/@types/node": { "version": "16.9.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", + "dev": true }, "node_modules/immediate": { "version": "3.0.6", @@ -17712,8 +17683,9 @@ }, "node_modules/is-function": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", + "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", + "dev": true }, "node_modules/is-generator-fn": { "version": "2.1.0", @@ -18219,9 +18191,20 @@ "node": ">=0.10.0" } }, + "node_modules/isomorphic-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", + "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", + "dev": true, + "dependencies": { + "node-fetch": "^2.6.1", + "whatwg-fetch": "^3.4.1" + } + }, "node_modules/isstream": { "version": "0.1.2", - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", @@ -21205,14 +21188,14 @@ } }, "node_modules/jimp": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/jimp/-/jimp-0.22.8.tgz", + "integrity": "sha512-pBbrooJMX7795sDcxx1XpwNZC8B/ITyDV+JK2/1qNbQl/1UWqWeh5Dq7qQpMZl5jLdcFDv5IVTM+OhpafSqSFA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/custom": "^0.16.2", - "@jimp/plugins": "^0.16.2", - "@jimp/types": "^0.16.2", + "@jimp/custom": "^0.22.8", + "@jimp/plugins": "^0.22.8", + "@jimp/types": "^0.22.8", "regenerator-runtime": "^0.13.3" } }, @@ -21230,8 +21213,9 @@ }, "node_modules/jpeg-js": { "version": "0.4.4", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", + "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", + "dev": true }, "node_modules/js-base64": { "version": "2.6.4", @@ -21275,7 +21259,8 @@ }, "node_modules/jsbn": { "version": "0.1.1", - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/jsdoc": { "version": "3.6.11", @@ -21447,6 +21432,7 @@ }, "node_modules/json-schema": { "version": "0.4.0", + "devOptional": true, "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-to-ts": { @@ -21461,6 +21447,7 @@ }, "node_modules/json-schema-traverse": { "version": "0.4.1", + "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { @@ -21470,7 +21457,8 @@ }, "node_modules/json-stringify-safe": { "version": "5.0.1", - "license": "ISC" + "license": "ISC", + "optional": true }, "node_modules/json5": { "version": "2.2.3", @@ -21504,6 +21492,7 @@ "node_modules/jsprim": { "version": "1.4.2", "license": "MIT", + "optional": true, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -21517,13 +21506,15 @@ "node_modules/jsprim/node_modules/assert-plus": { "version": "1.0.0", "license": "MIT", + "optional": true, "engines": { "node": ">=0.8" } }, "node_modules/jsprim/node_modules/core-util-is": { "version": "1.0.2", - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/jsprim/node_modules/verror": { "version": "1.10.0", @@ -21531,6 +21522,7 @@ "node >=0.6.0" ], "license": "MIT", + "optional": true, "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -22625,8 +22617,9 @@ }, "node_modules/load-bmfont": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz", + "integrity": "sha512-8UyQoYmdRDy81Brz6aLAUhfZLwr5zV0L3taTQ4hju7m6biuwiWiJXjPhBJxbUQJA8PrkvJ/7Enqmwk2sM14soA==", "dev": true, - "license": "MIT", "dependencies": { "buffer-equal": "0.0.1", "mime": "^1.3.4", @@ -22640,16 +22633,18 @@ }, "node_modules/load-bmfont/node_modules/buffer-equal": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", + "integrity": "sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/load-bmfont/node_modules/mime": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true, - "license": "MIT", "bin": { "mime": "cli.js" }, @@ -24693,8 +24688,9 @@ }, "node_modules/omggif": { "version": "1.0.10", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", + "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==", + "dev": true }, "node_modules/on-finished": { "version": "2.4.1", @@ -25208,18 +25204,21 @@ }, "node_modules/parse-bmfont-ascii": { "version": "1.0.6", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz", + "integrity": "sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==", + "dev": true }, "node_modules/parse-bmfont-binary": { "version": "1.0.6", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz", + "integrity": "sha512-GxmsRea0wdGdYthjuUeWTMWPqm2+FAd4GI8vCvhgJsFnoGhTrLhXDDupwTo7rXVAgaLIGoVHDZS9p/5XbSqeWA==", + "dev": true }, "node_modules/parse-bmfont-xml": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz", + "integrity": "sha512-bjnliEOmGv3y1aMEfREMBJ9tfL3WR0i0CKPj61DnSLaoxWR3nLrsQrEbCId/8rF4NyRF0cCqisSVXyQYWM+mCQ==", "dev": true, - "license": "MIT", "dependencies": { "xml-parse-from-string": "^1.0.0", "xml2js": "^0.4.5" @@ -25243,8 +25242,9 @@ }, "node_modules/parse-headers": { "version": "2.0.5", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", + "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==", + "dev": true }, "node_modules/parse-json": { "version": "5.2.0", @@ -25390,6 +25390,19 @@ "node": ">=8" } }, + "node_modules/peek-readable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.1.0.tgz", + "integrity": "sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/peer-id": { "version": "0.15.4", "license": "MIT", @@ -25459,6 +25472,7 @@ }, "node_modules/performance-now": { "version": "2.1.0", + "dev": true, "license": "MIT" }, "node_modules/phantomjs": { @@ -25633,8 +25647,9 @@ }, "node_modules/phin": { "version": "2.9.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz", + "integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==", + "dev": true }, "node_modules/picocolors": { "version": "1.0.0", @@ -25713,8 +25728,9 @@ }, "node_modules/pixelmatch": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", + "integrity": "sha512-J8B6xqiO37sU/gkcMglv6h5Jbd9xNER7aHzpfRdNmV4IbQBzBpe4l9XmbG+xPF/znacgu2jfEw+wHffaq/YkXA==", "dev": true, - "license": "ISC", "dependencies": { "pngjs": "^3.0.0" }, @@ -25722,6 +25738,15 @@ "pixelmatch": "bin/pixelmatch" } }, + "node_modules/pixelmatch/node_modules/pngjs": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", + "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/pkg-dir": { "version": "5.0.0", "license": "MIT", @@ -25821,11 +25846,12 @@ } }, "node_modules/pngjs": { - "version": "3.4.0", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", + "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", "dev": true, - "license": "MIT", "engines": { - "node": ">=4.0.0" + "node": ">=12.13.0" } }, "node_modules/popper.js": { @@ -27436,6 +27462,7 @@ }, "node_modules/psl": { "version": "1.9.0", + "dev": true, "license": "MIT" }, "node_modules/pstree.remy": { @@ -28616,6 +28643,36 @@ "version": "5.1.2", "license": "MIT" }, + "node_modules/readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "dev": true, + "dependencies": { + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/readable-web-to-node-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "dev": true, @@ -30829,6 +30886,7 @@ "node_modules/sshpk": { "version": "1.17.0", "license": "MIT", + "optional": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -30852,6 +30910,7 @@ "node_modules/sshpk/node_modules/assert-plus": { "version": "1.0.0", "license": "MIT", + "optional": true, "engines": { "node": ">=0.8" } @@ -31301,6 +31360,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strtok3": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.3.0.tgz", + "integrity": "sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==", + "dev": true, + "dependencies": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^4.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/style-loader": { "version": "3.3.1", "dev": true, @@ -32028,8 +32104,9 @@ }, "node_modules/timm": { "version": "1.7.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz", + "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==", + "dev": true }, "node_modules/tiny-invariant": { "version": "1.3.1", @@ -32040,12 +32117,10 @@ "license": "MIT" }, "node_modules/tinycolor2": { - "version": "1.5.1", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "dev": true }, "node_modules/tmp": { "version": "0.2.1", @@ -32153,6 +32228,23 @@ "node": ">=0.6" } }, + "node_modules/token-types": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-4.2.1.tgz", + "integrity": "sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ==", + "dev": true, + "dependencies": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/touch": { "version": "3.1.0", "dev": true, @@ -32435,7 +32527,8 @@ }, "node_modules/tweetnacl": { "version": "0.14.5", - "license": "Unlicense" + "license": "Unlicense", + "optional": true }, "node_modules/type-check": { "version": "0.4.0", @@ -32926,6 +33019,7 @@ }, "node_modules/uri-js": { "version": "4.4.1", + "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -32933,6 +33027,7 @@ }, "node_modules/uri-js/node_modules/punycode": { "version": "2.1.1", + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -33013,12 +33108,13 @@ "version": "1.0.4", "license": "WTFPL" }, - "node_modules/utif": { - "version": "2.0.1", + "node_modules/utif2": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/utif2/-/utif2-4.1.0.tgz", + "integrity": "sha512-+oknB9FHrJ7oW7A2WZYajOcv4FcDR4CfoGB0dPNfxbi4GO05RRnFmt5oa23+9w32EanrYcSJWspUiJkLMs+37w==", "dev": true, - "license": "MIT", "dependencies": { - "pako": "^1.0.5" + "pako": "^1.0.11" } }, "node_modules/util": { @@ -34190,8 +34286,9 @@ }, "node_modules/xhr": { "version": "2.6.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", + "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", "dev": true, - "license": "MIT", "dependencies": { "global": "~4.4.0", "is-function": "^1.0.1", @@ -34211,11 +34308,13 @@ }, "node_modules/xml-parse-from-string": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz", + "integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g==", + "dev": true }, "node_modules/xml2js": { "version": "0.4.23", + "dev": true, "license": "MIT", "dependencies": { "sax": ">=0.6.0", @@ -34227,6 +34326,7 @@ }, "node_modules/xml2js/node_modules/xmlbuilder": { "version": "11.0.1", + "dev": true, "license": "MIT", "engines": { "node": ">=4.0" @@ -37387,302 +37487,340 @@ } }, "@jimp/bmp": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.22.8.tgz", + "integrity": "sha512-JEMKgM1AEvvWfn9ZCHn62nK+QCE3Pb/ZhPdL3NF0ZgKNww6pqOmo6KqXzqY18JLB7c0epuTp4GPDPDhOh/ou1g==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", + "@jimp/utils": "^0.22.8", "bmp-js": "^0.1.0" } }, "@jimp/core": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.22.8.tgz", + "integrity": "sha512-vkN28aFikzQieA6bGxN+qe20pseCAemCyUI0YmRkJIArlb6OujtAwWAKyokv2lylV56bq8EQGIz+Y30OXUnRqg==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", + "@jimp/utils": "^0.22.8", "any-base": "^1.1.0", "buffer": "^5.2.0", "exif-parser": "^0.1.12", - "file-type": "^9.0.0", - "load-bmfont": "^1.3.1", - "mkdirp": "^0.5.1", - "phin": "^2.9.1", + "file-type": "^16.5.4", + "isomorphic-fetch": "^3.0.0", + "mkdirp": "^2.1.3", "pixelmatch": "^4.0.2", - "tinycolor2": "^1.4.1" + "tinycolor2": "^1.6.0" }, "dependencies": { "buffer": { "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } + }, + "mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "dev": true } } }, "@jimp/custom": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.22.8.tgz", + "integrity": "sha512-u6lP9x/HNeGHB0Oojv4c2mhuDvn7G0ikzYbK4IKLsH4HzHxt62faMjBzQMcFhKJhR6UiiKE/jiHrhGvBT/fMkw==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/core": "^0.16.2" + "@jimp/core": "^0.22.8" } }, "@jimp/gif": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.22.8.tgz", + "integrity": "sha512-I0l6koS67IPU40RPxCJTD1NvePEd8vUIHTejx1ly0jrjGnumbqdarAlBUkDrKfPPc+Fnqp84hBbSN1w5hNPT6w==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", + "@jimp/utils": "^0.22.8", "gifwrap": "^0.9.2", "omggif": "^1.0.9" } }, "@jimp/jpeg": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.22.8.tgz", + "integrity": "sha512-hLXrQ7/0QiUhAVAF10dfGCSq3hvyqjKltlpu/87b3wqMDKe9KdvhX1AJHiUUrAbJv1fAcnOmQGTyXGuySa1D6A==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", - "jpeg-js": "^0.4.2" + "@jimp/utils": "^0.22.8", + "jpeg-js": "^0.4.4" } }, "@jimp/plugin-blit": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.22.8.tgz", + "integrity": "sha512-rQ19txVCKIwo74HtgFodFt4//0ATPCJK+f24riqzb+nx+1JaOo1xRvpJqg4moirHwKR2fhwdDxmY7KX20kCeYA==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-blur": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.22.8.tgz", + "integrity": "sha512-GWbNK3YW6k2EKiGJdpAFEr0jezPBtiVxj2wG/lCPuWJz7KmzSSN99hQjIy73xQxoBCRdALfJlkhe3leFNRueSQ==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-circle": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-0.22.8.tgz", + "integrity": "sha512-qPCw8XFW8opT89ciFDuvs+eB3EB1mZIJWVajD2qAlprHiE7YGr34TkM7N5MNr3qZ1pJgkYdW6+HbBrJwBaonqw==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-color": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.22.8.tgz", + "integrity": "sha512-ogkbg6rpDVH/mMLgAQKg17z3oZE0VN7ZWxNoH12fUHchqKz1I57zpa65fxZe2I8T5Xz97HR3x+7V7oI8qQGdSA==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", - "tinycolor2": "^1.4.1" + "@jimp/utils": "^0.22.8", + "tinycolor2": "^1.6.0" } }, "@jimp/plugin-contain": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.22.8.tgz", + "integrity": "sha512-oiaPLdJt9Dk+XEEhM/OU3lFemM51mA9NgMCAdburSCjDzKacJYBGFSHjTOhXzcxOie/ZDpOYN/UzFGKy8Dgl9A==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-cover": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.22.8.tgz", + "integrity": "sha512-mO68w1m/LhfuHU8LKHY05a4/hhWnY4t+T+8JCw9t+5yfzA4+LofBZZKtFtWgwf/QGe1y3X2rtUU/avAzDUKyyA==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-crop": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.22.8.tgz", + "integrity": "sha512-ns4oH0h0gezYsbuH8RThcMLY5uTLk/vnqOVjWCehMHEzxi0DHMWCmpcb6bC//vJ+XFNhtVGn1ALN7+ROmPrj+A==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-displace": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.22.8.tgz", + "integrity": "sha512-Cj8nHYgsdFynOIx3dbbiVwRuZn3xO+RVfwkTRy0JBye+K2AU8SQJS+hSFNMQFTZt5djivh6kh0TzvR/6LkOd1w==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-dither": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.22.8.tgz", + "integrity": "sha512-oE0Us/6bEgrgEg56plU3jSBzvB9iGhweKUHmxYMWnQbFCHP4mNCtPAs8+Fmq6c+m98ZgBgRcrJTnC7lphHkGyw==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-fisheye": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-0.22.8.tgz", + "integrity": "sha512-bWvYY/nfMcKclWEaRyAir+YsT6C5St823HUQAsewZowTrJmme+w4U2a6InsryTHUL01BBcV5BLH0aDHuV3StvA==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-flip": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.22.8.tgz", + "integrity": "sha512-0NFTNzjsdmOQkaIkNjZqO3/yU4SQb9nnWQXsLS1fFo+9QrIL5v8vVkXpk/rhiND6PyTj2mMTNjOa76GuZcC+iQ==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-gaussian": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.22.8.tgz", + "integrity": "sha512-E/f14aLzCS50QAM7K+InI9V61KVy/Zx52vy7Jjfo1h7qKhQHss3PYaydaH0N6qlXRNeXgh+4/32P9JfieLMcdw==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-invert": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.22.8.tgz", + "integrity": "sha512-UauP39FF2cwbA5VU+Tz9VlNa9rtULPSHZb0Huwcjqjm9/G/xVN69VJ8+RKiFC4zM1/kYAUp/6IRwPa6qdKJpSw==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-mask": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.22.8.tgz", + "integrity": "sha512-bhg5+3i8x1CmYj6cjvPBQZLwZEI3iK3gJWF25ZHF+12d3cqDuJngtr8oRQOQLlAgvKmrj9FXIiEPDczUI9cnWQ==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-normalize": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.22.8.tgz", + "integrity": "sha512-Yg5nreAR1JYuSObu3ExlgaLxVeW6VvjVL5qFwiPFxSNlG8JIwL1Ir3K3ChSnnvymyZvJMHb6YKTYNfXKw5Da6g==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-print": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.22.8.tgz", + "integrity": "sha512-86O5ejCDi543IYl0TykSmNWErzAjEYhiAxNQb2F7rFRT38WJYNVsvJ6QhxhDQHKxSmF5iwmqbk0jYk5Wp2Z1kw==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", - "load-bmfont": "^1.4.0" + "@jimp/utils": "^0.22.8", + "load-bmfont": "^1.4.1" } }, "@jimp/plugin-resize": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.22.8.tgz", + "integrity": "sha512-kg8ArQRPqv/iU3DWNXCa8kcVIhoq64Ze0aGCAeFLKlAq/59f5pzAci6m6vV4L/uOVdYmUa9/kYwIFY6RWKpfzQ==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-rotate": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.22.8.tgz", + "integrity": "sha512-9a+VPZWMN/Cks76wf8LjM5RVA3ntP9+NAdsS1SZhhXel7U3Re/dWMouIEbo3QTt6K+igRo4txUCdZiw4ZucvkQ==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-scale": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.22.8.tgz", + "integrity": "sha512-dQS4pG6DX6endu8zUpvBBOEtGC+ljDDDNw0scSXY71TxyQdNo5Ro0apfsppjmuAr8rNotRkfyxbITKkXQDRUDQ==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-shadow": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-shadow/-/plugin-shadow-0.22.8.tgz", + "integrity": "sha512-HyAhr7OblTQh+BoKHQg4qbS9MweNlH77yfpBqUEyDtfyjI5r06+5chf1ZdLRIPEWv/BdCfdI/g81Wv69muCMwA==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugin-threshold": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-0.22.8.tgz", + "integrity": "sha512-ZmkfH0PtjvF1UcKsjw0H7V6r+LC0yKzEfg76Jhs2nIqIgsxsSOVfHwS7z0/1IWnyXxSw36m+NjCAotNHRILGmA==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2" + "@jimp/utils": "^0.22.8" } }, "@jimp/plugins": { - "version": "0.16.2", - "dev": true, - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/plugin-blit": "^0.16.2", - "@jimp/plugin-blur": "^0.16.2", - "@jimp/plugin-circle": "^0.16.2", - "@jimp/plugin-color": "^0.16.2", - "@jimp/plugin-contain": "^0.16.2", - "@jimp/plugin-cover": "^0.16.2", - "@jimp/plugin-crop": "^0.16.2", - "@jimp/plugin-displace": "^0.16.2", - "@jimp/plugin-dither": "^0.16.2", - "@jimp/plugin-fisheye": "^0.16.2", - "@jimp/plugin-flip": "^0.16.2", - "@jimp/plugin-gaussian": "^0.16.2", - "@jimp/plugin-invert": "^0.16.2", - "@jimp/plugin-mask": "^0.16.2", - "@jimp/plugin-normalize": "^0.16.2", - "@jimp/plugin-print": "^0.16.2", - "@jimp/plugin-resize": "^0.16.2", - "@jimp/plugin-rotate": "^0.16.2", - "@jimp/plugin-scale": "^0.16.2", - "@jimp/plugin-shadow": "^0.16.2", - "@jimp/plugin-threshold": "^0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.22.8.tgz", + "integrity": "sha512-ieI2+kCpmIfjwVlT7B67ULCzxMizfj7LspJh9HnIZCDXQB9GBOZ9KImLYc75Krae0dP/3FR7FglLiSI7fkOHbw==", + "dev": true, + "requires": { + "@jimp/plugin-blit": "^0.22.8", + "@jimp/plugin-blur": "^0.22.8", + "@jimp/plugin-circle": "^0.22.8", + "@jimp/plugin-color": "^0.22.8", + "@jimp/plugin-contain": "^0.22.8", + "@jimp/plugin-cover": "^0.22.8", + "@jimp/plugin-crop": "^0.22.8", + "@jimp/plugin-displace": "^0.22.8", + "@jimp/plugin-dither": "^0.22.8", + "@jimp/plugin-fisheye": "^0.22.8", + "@jimp/plugin-flip": "^0.22.8", + "@jimp/plugin-gaussian": "^0.22.8", + "@jimp/plugin-invert": "^0.22.8", + "@jimp/plugin-mask": "^0.22.8", + "@jimp/plugin-normalize": "^0.22.8", + "@jimp/plugin-print": "^0.22.8", + "@jimp/plugin-resize": "^0.22.8", + "@jimp/plugin-rotate": "^0.22.8", + "@jimp/plugin-scale": "^0.22.8", + "@jimp/plugin-shadow": "^0.22.8", + "@jimp/plugin-threshold": "^0.22.8", "timm": "^1.6.1" } }, "@jimp/png": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.22.8.tgz", + "integrity": "sha512-XOj11kcCr8zKg24QSwlRfH9k4hbV6rkMGUVxMS3puRzzB0FBSQy42NBYEfYf2XlY2QJSAByPl4AYerOtKb805w==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.2", - "pngjs": "^3.3.3" + "@jimp/utils": "^0.22.8", + "pngjs": "^6.0.0" } }, "@jimp/tiff": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.22.8.tgz", + "integrity": "sha512-K0hYUVW5MLgwq3jiHVHa6LvP05J1rXOlRCC+5dMTUnAXVwi45+MKsqA/8lzzwhHYJ65CNhZwy6D3+ZNzM9SIBQ==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "utif": "^2.0.1" + "utif2": "^4.0.1" } }, "@jimp/types": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.22.8.tgz", + "integrity": "sha512-9+xc+mzuYwu0i+6dsnhXiUgfcS+Ktqn5q2jczoKyyBT0cOKgsk+57EIeFLgpTfVGRKRR0y/UIdHByeCzGguF3A==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/bmp": "^0.16.2", - "@jimp/gif": "^0.16.2", - "@jimp/jpeg": "^0.16.2", - "@jimp/png": "^0.16.2", - "@jimp/tiff": "^0.16.2", + "@jimp/bmp": "^0.22.8", + "@jimp/gif": "^0.22.8", + "@jimp/jpeg": "^0.22.8", + "@jimp/png": "^0.22.8", + "@jimp/tiff": "^0.22.8", "timm": "^1.6.1" } }, "@jimp/utils": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.22.8.tgz", + "integrity": "sha512-AaqjfqDeLzSFzrbGRKHMXg/ntiWKvoG9tpVgWzgOx5/gPWj/IyGfztojLTTvY8HqZCr25z8z91u2lAQD2v46Jw==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", "regenerator-runtime": "^0.13.3" } }, @@ -37927,94 +38065,58 @@ } }, "@motrix/nat-api": { - "version": "0.3.2", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@motrix/nat-api/-/nat-api-0.3.4.tgz", + "integrity": "sha512-RIH5sSP329Xn8TjDcAHYHn82VTajhdu2Ee4PTLA+9jCAi5x0D219D1XYW7nCK22ptcLrC+qzBXlWG/j16iuoLQ==", "requires": { - "async": "^3.2.0", - "debug": "^4.3.1", + "async": "^3.2.4", + "debug": "^4.3.4", "default-gateway": "^6.0.3", - "request": "^2.88.2", + "node-fetch": "^2.6.9", "unordered-array-remove": "^1.0.2", - "xml2js": "^0.4.23" + "xml2js": "^0.5.0" }, "dependencies": { - "assert-plus": { - "version": "1.0.0" - }, - "aws-sign2": { - "version": "0.7.0" - }, - "caseless": { - "version": "0.12.0" - }, - "form-data": { - "version": "2.3.3", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "har-validator": { - "version": "5.1.5", - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "http-signature": { - "version": "1.2.0", + "node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "whatwg-url": "^5.0.0" } }, - "oauth-sign": { - "version": "0.9.0" - }, - "punycode": { - "version": "2.1.1" + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, - "qs": { - "version": "6.5.3" - }, - "request": { - "version": "2.88.2", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, - "tough-cookie": { - "version": "2.5.0", + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } }, - "tunnel-agent": { - "version": "0.6.0", + "xml2js": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", "requires": { - "safe-buffer": "^5.0.1" + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" } } }, @@ -38486,6 +38588,12 @@ "@babel/runtime": "^7.12.5" } }, + "@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "dev": true + }, "@tootallnate/once": { "version": "2.0.0", "dev": true @@ -39741,6 +39849,7 @@ }, "ajv": { "version": "6.12.6", + "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -39819,6 +39928,8 @@ }, "any-base": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz", + "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==", "dev": true }, "any-signal": { @@ -40088,6 +40199,7 @@ }, "asn1": { "version": "0.2.6", + "optional": true, "requires": { "safer-buffer": "~2.1.0" } @@ -40180,9 +40292,6 @@ "version": "0.6.0", "optional": true }, - "aws4": { - "version": "1.11.0" - }, "axe-core": { "version": "4.6.1", "dev": true @@ -40424,6 +40533,7 @@ }, "bcrypt-pbkdf": { "version": "1.0.2", + "optional": true, "requires": { "tweetnacl": "^0.14.3" } @@ -40567,6 +40677,8 @@ }, "bmp-js": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz", + "integrity": "sha512-vHdS19CnY3hwiNdkaqk93DvjVLfbEcI8mys4UjuWrlX1haDmroo8o4xCzh4wD6DGV6HxRCyauwhHRqMTfERtjw==", "dev": true }, "bn.js": { @@ -41954,12 +42066,14 @@ }, "dashdash": { "version": "1.14.1", + "optional": true, "requires": { "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { - "version": "1.0.0" + "version": "1.0.0", + "optional": true } } }, @@ -42534,6 +42648,7 @@ }, "ecc-jsbn": { "version": "0.1.2", + "optional": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -43757,6 +43872,8 @@ }, "exif-parser": { "version": "0.1.12", + "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz", + "integrity": "sha512-c2bQfLNbMzLPmzQuOr8fy0csy84WmwnER81W88DzTp9CYNPJ6yzOj2EZAh9pywYpqHnshVLHQJ8WzldAyfY+Iw==", "dev": true }, "exit": { @@ -44015,7 +44132,8 @@ } }, "extsprintf": { - "version": "1.3.0" + "version": "1.3.0", + "optional": true }, "fast-deep-equal": { "version": "3.1.3" @@ -44035,7 +44153,8 @@ } }, "fast-json-stable-stringify": { - "version": "2.1.0" + "version": "2.1.0", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -44113,8 +44232,15 @@ "version": "2.0.5" }, "file-type": { - "version": "9.0.0", - "dev": true + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-16.5.4.tgz", + "integrity": "sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==", + "dev": true, + "requires": { + "readable-web-to-node-stream": "^3.0.0", + "strtok3": "^6.2.4", + "token-types": "^4.1.1" + } }, "file-uri-to-path": { "version": "1.0.0" @@ -44300,7 +44426,8 @@ "version": "2.0.6" }, "forever-agent": { - "version": "0.6.1" + "version": "0.6.1", + "optional": true }, "fork-ts-checker-webpack-plugin": { "version": "6.5.2", @@ -44659,17 +44786,21 @@ }, "getpass": { "version": "0.1.7", + "optional": true, "requires": { "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { - "version": "1.0.0" + "version": "1.0.0", + "optional": true } } }, "gifwrap": { "version": "0.9.4", + "resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.9.4.tgz", + "integrity": "sha512-MDMwbhASQuVeD4JKd1fKgNgCRL3fGqMM4WaqpNhWO0JiMOAjbQdumbs4BbBZEy9/M00EHEjKN3HieVhCUlwjeQ==", "dev": true, "requires": { "image-q": "^4.0.0", @@ -44903,9 +45034,6 @@ "version": "2.0.1", "dev": true }, - "har-schema": { - "version": "2.0.0" - }, "har-validator": { "version": "2.0.6", "optional": true, @@ -45422,6 +45550,8 @@ }, "image-q": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/image-q/-/image-q-4.0.0.tgz", + "integrity": "sha512-PfJGVgIfKQJuq3s0tTDOKtztksibuUEbJQIYT3by6wctQo+Rdlh7ef4evJ5NCdxY4CfMbvFkocEwbl4BF8RlJw==", "dev": true, "requires": { "@types/node": "16.9.1" @@ -45429,6 +45559,8 @@ "dependencies": { "@types/node": { "version": "16.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", "dev": true } } @@ -46125,6 +46257,8 @@ }, "is-function": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", + "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", "dev": true }, "is-generator-fn": { @@ -46425,8 +46559,19 @@ "version": "3.0.1", "dev": true }, + "isomorphic-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", + "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", + "dev": true, + "requires": { + "node-fetch": "^2.6.1", + "whatwg-fetch": "^3.4.1" + } + }, "isstream": { - "version": "0.1.2" + "version": "0.1.2", + "optional": true }, "istanbul-lib-coverage": { "version": "3.2.0", @@ -48592,13 +48737,14 @@ } }, "jimp": { - "version": "0.16.2", + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/jimp/-/jimp-0.22.8.tgz", + "integrity": "sha512-pBbrooJMX7795sDcxx1XpwNZC8B/ITyDV+JK2/1qNbQl/1UWqWeh5Dq7qQpMZl5jLdcFDv5IVTM+OhpafSqSFA==", "dev": true, "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/custom": "^0.16.2", - "@jimp/plugins": "^0.16.2", - "@jimp/types": "^0.16.2", + "@jimp/custom": "^0.22.8", + "@jimp/plugins": "^0.22.8", + "@jimp/types": "^0.22.8", "regenerator-runtime": "^0.13.3" } }, @@ -48615,6 +48761,8 @@ }, "jpeg-js": { "version": "0.4.4", + "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", + "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", "dev": true }, "js-base64": { @@ -48645,7 +48793,8 @@ } }, "jsbn": { - "version": "0.1.1" + "version": "0.1.1", + "optional": true }, "jsdoc": { "version": "3.6.11", @@ -48761,7 +48910,8 @@ "dev": true }, "json-schema": { - "version": "0.4.0" + "version": "0.4.0", + "devOptional": true }, "json-schema-to-ts": { "version": "1.6.4", @@ -48774,14 +48924,16 @@ } }, "json-schema-traverse": { - "version": "0.4.1" + "version": "0.4.1", + "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "dev": true }, "json-stringify-safe": { - "version": "5.0.1" + "version": "5.0.1", + "optional": true }, "json5": { "version": "2.2.3", @@ -48804,6 +48956,7 @@ }, "jsprim": { "version": "1.4.2", + "optional": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -48812,13 +48965,16 @@ }, "dependencies": { "assert-plus": { - "version": "1.0.0" + "version": "1.0.0", + "optional": true }, "core-util-is": { - "version": "1.0.2" + "version": "1.0.2", + "optional": true }, "verror": { "version": "1.10.0", + "optional": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -49719,6 +49875,8 @@ }, "load-bmfont": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz", + "integrity": "sha512-8UyQoYmdRDy81Brz6aLAUhfZLwr5zV0L3taTQ4hju7m6biuwiWiJXjPhBJxbUQJA8PrkvJ/7Enqmwk2sM14soA==", "dev": true, "requires": { "buffer-equal": "0.0.1", @@ -49733,10 +49891,14 @@ "dependencies": { "buffer-equal": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", + "integrity": "sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA==", "dev": true }, "mime": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true } } @@ -51096,6 +51258,8 @@ }, "omggif": { "version": "1.0.10", + "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", + "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==", "dev": true }, "on-finished": { @@ -51440,14 +51604,20 @@ }, "parse-bmfont-ascii": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz", + "integrity": "sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==", "dev": true }, "parse-bmfont-binary": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz", + "integrity": "sha512-GxmsRea0wdGdYthjuUeWTMWPqm2+FAd4GI8vCvhgJsFnoGhTrLhXDDupwTo7rXVAgaLIGoVHDZS9p/5XbSqeWA==", "dev": true }, "parse-bmfont-xml": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz", + "integrity": "sha512-bjnliEOmGv3y1aMEfREMBJ9tfL3WR0i0CKPj61DnSLaoxWR3nLrsQrEbCId/8rF4NyRF0cCqisSVXyQYWM+mCQ==", "dev": true, "requires": { "xml-parse-from-string": "^1.0.0", @@ -51470,6 +51640,8 @@ }, "parse-headers": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", + "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==", "dev": true }, "parse-json": { @@ -51567,6 +51739,12 @@ "version": "4.0.0", "dev": true }, + "peek-readable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.1.0.tgz", + "integrity": "sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg==", + "dev": true + }, "peer-id": { "version": "0.15.4", "requires": { @@ -51616,7 +51794,8 @@ "devOptional": true }, "performance-now": { - "version": "2.1.0" + "version": "2.1.0", + "dev": true }, "phantomjs": { "version": "2.1.7+deprecated", @@ -51751,6 +51930,8 @@ }, "phin": { "version": "2.9.3", + "resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz", + "integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==", "dev": true }, "picocolors": { @@ -51795,9 +51976,19 @@ }, "pixelmatch": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", + "integrity": "sha512-J8B6xqiO37sU/gkcMglv6h5Jbd9xNER7aHzpfRdNmV4IbQBzBpe4l9XmbG+xPF/znacgu2jfEw+wHffaq/YkXA==", "dev": true, "requires": { "pngjs": "^3.0.0" + }, + "dependencies": { + "pngjs": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", + "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", + "dev": true + } } }, "pkg-dir": { @@ -51866,7 +52057,9 @@ } }, "pngjs": { - "version": "3.4.0", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", + "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", "dev": true }, "popper.js": { @@ -52722,7 +52915,8 @@ "version": "1.0.1" }, "psl": { - "version": "1.9.0" + "version": "1.9.0", + "dev": true }, "pstree.remy": { "version": "1.1.8", @@ -53525,6 +53719,28 @@ } } }, + "readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "dev": true, + "requires": { + "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "readdirp": { "version": "3.6.0", "dev": true, @@ -54997,6 +55213,7 @@ }, "sshpk": { "version": "1.17.0", + "optional": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -55010,7 +55227,8 @@ }, "dependencies": { "assert-plus": { - "version": "1.0.0" + "version": "1.0.0", + "optional": true } } }, @@ -55323,6 +55541,16 @@ "version": "3.1.1", "dev": true }, + "strtok3": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.3.0.tgz", + "integrity": "sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==", + "dev": true, + "requires": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^4.1.0" + } + }, "style-loader": { "version": "3.3.1", "dev": true @@ -55806,6 +56034,8 @@ }, "timm": { "version": "1.7.1", + "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz", + "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==", "dev": true }, "tiny-invariant": { @@ -55815,7 +56045,9 @@ "version": "1.0.3" }, "tinycolor2": { - "version": "1.5.1", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", "dev": true }, "tmp": { @@ -55893,6 +56125,16 @@ "version": "1.0.1", "dev": true }, + "token-types": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-4.2.1.tgz", + "integrity": "sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ==", + "dev": true, + "requires": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + } + }, "touch": { "version": "3.1.0", "dev": true, @@ -56086,7 +56328,8 @@ "version": "1.2.0" }, "tweetnacl": { - "version": "0.14.5" + "version": "0.14.5", + "optional": true }, "type-check": { "version": "0.4.0", @@ -56418,12 +56661,14 @@ }, "uri-js": { "version": "4.4.1", + "dev": true, "requires": { "punycode": "^2.1.0" }, "dependencies": { "punycode": { - "version": "2.1.1" + "version": "2.1.1", + "dev": true } } }, @@ -56482,11 +56727,13 @@ "utf8-byte-length": { "version": "1.0.4" }, - "utif": { - "version": "2.0.1", + "utif2": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/utif2/-/utif2-4.1.0.tgz", + "integrity": "sha512-+oknB9FHrJ7oW7A2WZYajOcv4FcDR4CfoGB0dPNfxbi4GO05RRnFmt5oa23+9w32EanrYcSJWspUiJkLMs+37w==", "dev": true, "requires": { - "pako": "^1.0.5" + "pako": "^1.0.11" } }, "util": { @@ -57313,6 +57560,8 @@ }, "xhr": { "version": "2.6.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", + "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", "dev": true, "requires": { "global": "~4.4.0", @@ -57331,17 +57580,21 @@ }, "xml-parse-from-string": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz", + "integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g==", "dev": true }, "xml2js": { "version": "0.4.23", + "dev": true, "requires": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" }, "dependencies": { "xmlbuilder": { - "version": "11.0.1" + "version": "11.0.1", + "dev": true } } }, diff --git a/package.json b/package.json index e4ab2f179..2f674a33c 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "husky": "^4.2.3", "jest-extended": "^0.11.5", "jest-junit": "^14.0.1", - "jimp": "^0.16.1", + "jimp": "^0.22.8", "jsdoc": "^3.5.5", "jsdom": "^16.2.1", "markdown-table": "^2.0.0", From 6a31ec502b7934c21c79570b6cd007a2e3b8d8d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:00:17 -0500 Subject: [PATCH 4/8] chore(deps): bump socket.io-parser from 4.2.1 to 4.2.4 (#423) Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.1 to 4.2.4. - [Release notes](https://github.com/socketio/socket.io-parser/releases) - [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io-parser/compare/4.2.1...4.2.4) --- updated-dependencies: - dependency-name: socket.io-parser dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5bcfe7aa8..e13e11cc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30575,8 +30575,9 @@ } }, "node_modules/socket.io-parser": { - "version": "4.2.1", - "license": "MIT", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" @@ -54990,7 +54991,9 @@ } }, "socket.io-parser": { - "version": "4.2.1", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", "requires": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" From 607ea2db994701700d6fd63d5d7f2b0bee64f05f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 18:58:39 -0500 Subject: [PATCH 5/8] chore(deps): bump semver from 5.7.1 to 5.7.2 (#424) Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 222 ++++++++++++++++++++++++++++------------------ 1 file changed, 138 insertions(+), 84 deletions(-) diff --git a/package-lock.json b/package-lock.json index e13e11cc9..ad166a642 100644 --- a/package-lock.json +++ b/package-lock.json @@ -210,9 +210,10 @@ } }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -243,9 +244,10 @@ } }, "node_modules/@babel/eslint-parser/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -324,9 +326,10 @@ } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -388,9 +391,10 @@ } }, "node_modules/@babel/helper-define-polyfill-provider/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -1748,9 +1752,10 @@ } }, "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -1960,9 +1965,10 @@ } }, "node_modules/@babel/preset-env/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -2146,9 +2152,9 @@ } }, "node_modules/@babel/register/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -2584,9 +2590,9 @@ } }, "node_modules/@electron/get/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -8955,9 +8961,10 @@ } }, "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -12910,9 +12917,10 @@ "license": "MIT" }, "node_modules/enzyme-adapter-react-16/node_modules/semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver" } @@ -12938,9 +12946,10 @@ } }, "node_modules/enzyme-adapter-utils/node_modules/semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver" } @@ -13835,9 +13844,10 @@ } }, "node_modules/eslint-plugin-jsx-a11y/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -13909,9 +13919,10 @@ } }, "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -18230,9 +18241,10 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -22879,9 +22891,10 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -23811,9 +23824,9 @@ } }, "node_modules/node-environment-flags/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -24144,9 +24157,10 @@ } }, "node_modules/nodemon/node_modules/semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver" } @@ -24336,9 +24350,10 @@ } }, "node_modules/npm-run-all/node_modules/semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver" } @@ -25170,9 +25185,9 @@ } }, "node_modules/package-json/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -28572,9 +28587,10 @@ } }, "node_modules/read-pkg-up/node_modules/semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver" } @@ -28615,9 +28631,10 @@ } }, "node_modules/read-pkg/node_modules/semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver" } @@ -29676,8 +29693,9 @@ } }, "node_modules/semver": { - "version": "7.3.8", - "license": "ISC", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -29706,9 +29724,9 @@ } }, "node_modules/semver-diff/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -34520,7 +34538,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -34539,7 +34559,9 @@ "dev": true }, "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -34596,7 +34618,9 @@ } }, "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true }, "yallist": { @@ -34639,7 +34663,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -35417,7 +35443,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -35564,7 +35592,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -35694,9 +35724,9 @@ } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true } } @@ -35932,9 +35962,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -40417,7 +40447,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -43060,7 +43092,9 @@ "dev": true }, "semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true } } @@ -43079,7 +43113,9 @@ }, "dependencies": { "semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true } } @@ -43651,7 +43687,9 @@ } }, "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -43694,7 +43732,9 @@ } }, "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -46590,7 +46630,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -50061,7 +50103,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -50690,9 +50734,9 @@ }, "dependencies": { "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true } } @@ -50921,7 +50965,9 @@ "dev": true }, "semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true }, "supports-color": { @@ -51037,7 +51083,9 @@ "dev": true }, "semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true }, "shebang-command": { @@ -51578,9 +51626,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -53617,7 +53665,9 @@ } }, "semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true } } @@ -53691,7 +53741,9 @@ } }, "semver": { - "version": "5.7.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true }, "type-fest": { @@ -54376,7 +54428,9 @@ } }, "semver": { - "version": "7.3.8", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -54395,9 +54449,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } From ea69b10b6338db9a272fd6db7e622c94e6033486 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sun, 30 Jul 2023 13:06:05 -0500 Subject: [PATCH 6/8] refactor(types): Set up type checking (#427) * chore(types): set up tsconfig.json * chore(types): install some library types * chore(types): link enums in top-level typedefs * fix(types): correct some types related to utils * chore(types): improve memoize typing * chore: remove JSDoc tooling * chore(deps) update browserslist config * refactor(types): make getPlotImage type safe * fix(findInField): return plot instead of row * refactor(types): fix all remaining type errors in utils/index.js * docs(adr): record decision to adopt Typed JavaScript --- .github/workflows/ci.yml | 1 - .github/workflows/run-release.yml | 1 - .jsdoc | 16 - README.md | 1 - doc/adr/0005-type-system.md | 26 ++ jsdoc-ts.js | 28 -- package-lock.json | 445 +++++++--------------------- package.json | 9 +- src/components/Farmhand/Farmhand.js | 4 +- src/enums.js | 2 +- src/index.js | 46 +-- src/utils/index.js | 338 +++++++++++---------- src/utils/memoize.js | 9 +- tsconfig.json | 74 +++++ 14 files changed, 413 insertions(+), 587 deletions(-) delete mode 100644 .jsdoc create mode 100644 doc/adr/0005-type-system.md delete mode 100644 jsdoc-ts.js create mode 100644 tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c9717ca5..c38095564 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,6 @@ jobs: - name: 'Build web app artifacts' run: | npm run build - npm run doc - uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/run-release.yml b/.github/workflows/run-release.yml index 7a7c021ad..943ad52ae 100644 --- a/.github/workflows/run-release.yml +++ b/.github/workflows/run-release.yml @@ -95,7 +95,6 @@ jobs: - run: | PUBLIC_URL='/farmhand' npm run build - npm run doc # https://github.com/marketplace/actions/deploy-to-github-pages - name: Deploy to jeremyckahn.github.io/farmhand diff --git a/.jsdoc b/.jsdoc deleted file mode 100644 index b5f762377..000000000 --- a/.jsdoc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "plugins": [ - "plugins/markdown", - "./jsdoc-ts.js" - ], - "opts": { - "destination": "build/docs", - "template": "node_modules/@jeremyckahn/minami", - "readme": "README.md" - }, - "templates": { - "cleverLinks": true, - "useLongnameInNav": false, - "showInheritedInNav": true - } -} diff --git a/README.md b/README.md index 941963a6b..48e0a3a5d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ - Includes native app downloads for Linux, MacOS and Windows. - All versioned releases available at [unpkg](https://unpkg.com/browse/@jeremyckahn/farmhand/build/) - [Wiki](https://github.com/jeremyckahn/farmhand/wiki) -- [Data model documentation](https://jeremyckahn.github.io/farmhand/docs/index.html) - [API deployment logs](https://farmhand.vercel.app/_logs) Community links: diff --git a/doc/adr/0005-type-system.md b/doc/adr/0005-type-system.md new file mode 100644 index 000000000..b45d132e3 --- /dev/null +++ b/doc/adr/0005-type-system.md @@ -0,0 +1,26 @@ +# 5. Type system + +Date: 2023-07-23 + +## Status + +Accepted + +## Context + +Farmhand is implemented with JavaScript. Given the size of the codebase, the dynamic nature of JavaScript creates some ambiguity and confusion during development. A type system helps to mitigate these challenges. The ideal type system solution would be a migration to TypeScript, but that is a significant undertaking that would take an outsize amount of effort to complete and get value from. A more approachable solution is to incorporate [Typed JavaScript](https://depth-first.com/articles/2021/11/03/typed-javascript/). Typed JavaScript can be adopted incrementally and does not introduce new syntaxes or tooling needs. + +## Decision + +Farmhand will transition to using Typed JavaScript. This transition will take a long time and may never be fully completed, but effort should be made to update preexisting code as it modified. Type violations will not be used to break builds until all type violations have been fixed. + +## Consequences + +- Code will be more clearly and completely documented +- Data type errors will be more obvious +- Improved support for automated refactoring for editors that support such features +- More verbose code +- Many features of TypeScript are unavailable in Typed JavaScript, such as proper enums and interface extension +- Errors will be shown during development in editors that support Typed JavaScript until the code has been updated to be type safe +- The transition may never be complete +- At will be much easier to transition to TypeScript if the transition to Typed JavaScript is ever completed diff --git a/jsdoc-ts.js b/jsdoc-ts.js deleted file mode 100644 index 5427bfc4a..000000000 --- a/jsdoc-ts.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * A small JSDoc plugin that replaces TSDoc (typescript flavored JSDoc) - * with regular JSDoc for not crashing documentation generation, while - * still having accurate types. - * @author arthuro555 - */ - -const TYPESCRIPT_IMPORT_TYPE = /typedef {import\(.*\)/ -const TYPESCRIPT_RECORD_TYPE = /Record<.*,(.*)>/ - -exports.astNodeVisitor = { - visitNode: function(node) { - if (node.type === 'File') { - if (node.comments) { - node.comments.forEach((/** @type {{ value: string }} */ comment) => { - // Remove imports as they are only necessary for typescript and crash jsdoc - if (TYPESCRIPT_IMPORT_TYPE.test(comment.value)) comment.value = '' - - // Replace typescript Record syntax with JSDoc Object. - comment.value = comment.value.replace( - TYPESCRIPT_RECORD_TYPE, - `Object.<$1>` - ) - }) - } - } - }, -} diff --git a/package-lock.json b/package-lock.json index ad166a642..88004ddec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,16 +77,19 @@ }, "devDependencies": { "@babel/node": "^7.20.7", - "@jeremyckahn/minami": "^1.3.1", "@testing-library/dom": "^8.3.0", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.0.0", "@testing-library/user-event": "^13.2.1", + "@types/dinero.js": "^1.9.0", + "@types/lodash.sortby": "^4.7.7", "@types/markdown-table": "^2.0.0", "@types/react": "^17.0.2", + "@types/uuid": "^9.0.2", "@typescript-eslint/eslint-plugin": "^2.23.0", "@typescript-eslint/parser": "^2.23.0", "bittorrent-tracker": "^9.19.0", + "browserslist": "^4.21.9", "cross-env": "^7.0.2", "electron": "^22.1.0", "electron-builder": "^23.1.0", @@ -104,7 +107,6 @@ "jest-extended": "^0.11.5", "jest-junit": "^14.0.1", "jimp": "^0.22.8", - "jsdoc": "^3.5.5", "jsdom": "^16.2.1", "markdown-table": "^2.0.0", "mprocs": "^0.6.4", @@ -4106,13 +4108,6 @@ "node": ">=8" } }, - "node_modules/@jeremyckahn/minami": { - "version": "1.3.1", - "dev": true, - "peerDependencies": { - "jsdoc": "^3.5.5" - } - }, "node_modules/@jest/console": { "version": "27.5.1", "dev": true, @@ -6669,6 +6664,12 @@ "@types/ms": "*" } }, + "node_modules/@types/dinero.js": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@types/dinero.js/-/dinero.js-1.9.0.tgz", + "integrity": "sha512-H2XdE6N/A2wJ/TJhGqeHDMUhCaey2R/Lcq9ichGBncKsFGvqrroXZWPNdDkCcgQOBPoCD4n9QuSBUC/35wuJiw==", + "dev": true + }, "node_modules/@types/eslint": { "version": "8.4.10", "dev": true, @@ -6847,35 +6848,31 @@ "@types/node": "*" } }, - "node_modules/@types/linkify-it": { - "version": "3.0.2", + "node_modules/@types/lodash": { + "version": "4.14.195", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.195.tgz", + "integrity": "sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==", + "dev": true + }, + "node_modules/@types/lodash.sortby": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/@types/lodash.sortby/-/lodash.sortby-4.7.7.tgz", + "integrity": "sha512-J/4IS+jQopGBrrRetBXDCX0KnSeXJZ0rOTmGAxR9MWGV24YdHxX8IRi9LCGAU9GKWlBov9KRSfQpuup9PReqrw==", "dev": true, - "license": "MIT" + "dependencies": { + "@types/lodash": "*" + } }, "node_modules/@types/long": { "version": "4.0.2", "license": "MIT" }, - "node_modules/@types/markdown-it": { - "version": "12.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/linkify-it": "*", - "@types/mdurl": "*" - } - }, "node_modules/@types/markdown-table": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@types/markdown-table/-/markdown-table-2.0.0.tgz", "integrity": "sha512-fVZN/DRjZvjuk+lo7ovlI/ZycS51gpYU5vw5EcFeqkcX6lucQ+UWgEOH2O4KJHkSck4DHAY7D7CkVLD0wzc5qw==", "dev": true }, - "node_modules/@types/mdurl": { - "version": "1.0.2", - "dev": true, - "license": "MIT" - }, "node_modules/@types/mime": { "version": "3.0.1", "dev": true, @@ -7064,6 +7061,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/uuid": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.2.tgz", + "integrity": "sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ==", + "dev": true + }, "node_modules/@types/verror": { "version": "1.10.6", "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.6.tgz", @@ -9624,7 +9627,9 @@ "license": "ISC" }, "node_modules/browserslist": { - "version": "4.21.4", + "version": "4.21.9", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", + "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", "dev": true, "funding": [ { @@ -9634,14 +9639,17 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001400", - "electron-to-chromium": "^1.4.251", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.9" + "caniuse-lite": "^1.0.30001503", + "electron-to-chromium": "^1.4.431", + "node-releases": "^2.0.12", + "update-browserslist-db": "^1.0.11" }, "bin": { "browserslist": "cli.js" @@ -10059,7 +10067,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001441", + "version": "1.0.30001517", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", + "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", "dev": true, "funding": [ { @@ -10069,9 +10079,12 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" + ] }, "node_modules/case-sensitive-paths-webpack-plugin": { "version": "2.4.0", @@ -10093,17 +10106,6 @@ "node": ">=6" } }, - "node_modules/catharsis": { - "version": "0.9.0", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.15" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/cborg": { "version": "1.9.6", "license": "Apache-2.0", @@ -12602,9 +12604,10 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.284", - "dev": true, - "license": "ISC" + "version": "1.4.467", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.467.tgz", + "integrity": "sha512-2qI70O+rR4poYeF2grcuS/bCps5KJh6y1jtZMDDEteyKJQrzLOEhFyXCLcHW6DTBjKjWkk26JhWoAi+Ux9A0fg==", + "dev": true }, "node_modules/electron-updater": { "version": "5.3.0", @@ -21261,66 +21264,11 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/js2xmlparser": { - "version": "4.0.2", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "xmlcreate": "^2.0.4" - } - }, "node_modules/jsbn": { "version": "0.1.1", "license": "MIT", "optional": true }, - "node_modules/jsdoc": { - "version": "3.6.11", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/parser": "^7.9.4", - "@types/markdown-it": "^12.2.3", - "bluebird": "^3.7.2", - "catharsis": "^0.9.0", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.2", - "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", - "marked": "^4.0.10", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "taffydb": "2.6.2", - "underscore": "~1.13.2" - }, - "bin": { - "jsdoc": "jsdoc.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/jsdoc/node_modules/escape-string-regexp": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/jsdoc/node_modules/mkdirp": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/jsdom": { "version": "16.7.0", "dev": true, @@ -21695,14 +21643,6 @@ "node": ">=0.10.0" } }, - "node_modules/klaw": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.9" - } - }, "node_modules/kleur": { "version": "3.0.3", "dev": true, @@ -22619,14 +22559,6 @@ "dev": true, "license": "MIT" }, - "node_modules/linkify-it": { - "version": "3.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "uc.micro": "^1.0.1" - } - }, "node_modules/load-bmfont": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz", @@ -22985,38 +22917,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/markdown-it": { - "version": "12.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "bin": { - "markdown-it": "bin/markdown-it.js" - } - }, - "node_modules/markdown-it-anchor": { - "version": "8.6.6", - "dev": true, - "license": "Unlicense", - "peerDependencies": { - "@types/markdown-it": "*", - "markdown-it": "*" - } - }, - "node_modules/markdown-it/node_modules/entities": { - "version": "2.1.0", - "dev": true, - "license": "BSD-2-Clause", - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/markdown-table": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", @@ -23030,17 +22930,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/marked": { - "version": "4.2.5", - "dev": true, - "license": "MIT", - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 12" - } - }, "node_modules/matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", @@ -23065,11 +22954,6 @@ "version": "2.0.14", "license": "CC0-1.0" }, - "node_modules/mdurl": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/media-typer": { "version": "0.3.0", "dev": true, @@ -24074,9 +23958,10 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.8", - "dev": true, - "license": "MIT" + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true }, "node_modules/node-sass": { "version": "8.0.0", @@ -29138,14 +29023,6 @@ "dev": true, "license": "MIT" }, - "node_modules/requizzle": { - "version": "0.2.4", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.21" - } - }, "node_modules/resize-observer-polyfill": { "version": "1.5.1", "license": "MIT" @@ -31728,10 +31605,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/taffydb": { - "version": "2.6.2", - "dev": true - }, "node_modules/tailwindcss": { "version": "3.2.4", "dev": true, @@ -32631,11 +32504,6 @@ "node": ">=4.2.0" } }, - "node_modules/uc.micro": { - "version": "1.0.6", - "dev": true, - "license": "MIT" - }, "node_modules/uint8arrays": { "version": "2.1.10", "license": "MIT", @@ -32662,11 +32530,6 @@ "dev": true, "license": "MIT" }, - "node_modules/underscore": { - "version": "1.13.6", - "dev": true, - "license": "MIT" - }, "node_modules/unherit": { "version": "1.1.3", "license": "MIT", @@ -32904,7 +32767,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "dev": true, "funding": [ { @@ -32914,15 +32779,18 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -34365,11 +34233,6 @@ "dev": true, "license": "MIT" }, - "node_modules/xmlcreate": { - "version": "2.0.4", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/xmlhttprequest-ssl": { "version": "2.0.0", "engines": { @@ -36991,10 +36854,6 @@ "version": "0.1.3", "dev": true }, - "@jeremyckahn/minami": { - "version": "1.3.1", - "dev": true - }, "@jest/console": { "version": "27.5.1", "dev": true, @@ -38775,6 +38634,12 @@ "@types/ms": "*" } }, + "@types/dinero.js": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@types/dinero.js/-/dinero.js-1.9.0.tgz", + "integrity": "sha512-H2XdE6N/A2wJ/TJhGqeHDMUhCaey2R/Lcq9ichGBncKsFGvqrroXZWPNdDkCcgQOBPoCD4n9QuSBUC/35wuJiw==", + "dev": true + }, "@types/eslint": { "version": "8.4.10", "dev": true, @@ -38927,31 +38792,30 @@ "@types/node": "*" } }, - "@types/linkify-it": { - "version": "3.0.2", + "@types/lodash": { + "version": "4.14.195", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.195.tgz", + "integrity": "sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==", "dev": true }, - "@types/long": { - "version": "4.0.2" - }, - "@types/markdown-it": { - "version": "12.2.3", + "@types/lodash.sortby": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/@types/lodash.sortby/-/lodash.sortby-4.7.7.tgz", + "integrity": "sha512-J/4IS+jQopGBrrRetBXDCX0KnSeXJZ0rOTmGAxR9MWGV24YdHxX8IRi9LCGAU9GKWlBov9KRSfQpuup9PReqrw==", "dev": true, "requires": { - "@types/linkify-it": "*", - "@types/mdurl": "*" + "@types/lodash": "*" } }, + "@types/long": { + "version": "4.0.2" + }, "@types/markdown-table": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@types/markdown-table/-/markdown-table-2.0.0.tgz", "integrity": "sha512-fVZN/DRjZvjuk+lo7ovlI/ZycS51gpYU5vw5EcFeqkcX6lucQ+UWgEOH2O4KJHkSck4DHAY7D7CkVLD0wzc5qw==", "dev": true }, - "@types/mdurl": { - "version": "1.0.2", - "dev": true - }, "@types/mime": { "version": "3.0.1", "dev": true @@ -39120,6 +38984,12 @@ "version": "2.0.2", "dev": true }, + "@types/uuid": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.2.tgz", + "integrity": "sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ==", + "dev": true + }, "@types/verror": { "version": "1.10.6", "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.6.tgz", @@ -40903,13 +40773,15 @@ "version": "1.0.3" }, "browserslist": { - "version": "4.21.4", + "version": "4.21.9", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", + "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001400", - "electron-to-chromium": "^1.4.251", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.9" + "caniuse-lite": "^1.0.30001503", + "electron-to-chromium": "^1.4.431", + "node-releases": "^2.0.12", + "update-browserslist-db": "^1.0.11" } }, "bser": { @@ -41198,7 +41070,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001441", + "version": "1.0.30001517", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", + "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", "dev": true }, "case-sensitive-paths-webpack-plugin": { @@ -41212,13 +41086,6 @@ "catering": { "version": "2.1.1" }, - "catharsis": { - "version": "0.9.0", - "dev": true, - "requires": { - "lodash": "^4.17.15" - } - }, "cborg": { "version": "1.9.6" }, @@ -42882,7 +42749,9 @@ } }, "electron-to-chromium": { - "version": "1.4.284", + "version": "1.4.467", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.467.tgz", + "integrity": "sha512-2qI70O+rR4poYeF2grcuS/bCps5KJh6y1jtZMDDEteyKJQrzLOEhFyXCLcHW6DTBjKjWkk26JhWoAi+Ux9A0fg==", "dev": true }, "electron-updater": { @@ -48828,48 +48697,10 @@ "argparse": "^2.0.1" } }, - "js2xmlparser": { - "version": "4.0.2", - "dev": true, - "requires": { - "xmlcreate": "^2.0.4" - } - }, "jsbn": { "version": "0.1.1", "optional": true }, - "jsdoc": { - "version": "3.6.11", - "dev": true, - "requires": { - "@babel/parser": "^7.9.4", - "@types/markdown-it": "^12.2.3", - "bluebird": "^3.7.2", - "catharsis": "^0.9.0", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.2", - "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", - "marked": "^4.0.10", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "taffydb": "2.6.2", - "underscore": "~1.13.2" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "dev": true - }, - "mkdirp": { - "version": "1.0.4", - "dev": true - } - } - }, "jsdom": { "version": "16.7.0", "dev": true, @@ -49155,13 +48986,6 @@ "version": "6.0.3", "dev": true }, - "klaw": { - "version": "3.0.0", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, "kleur": { "version": "3.0.3", "dev": true @@ -49909,13 +49733,6 @@ "version": "1.2.4", "dev": true }, - "linkify-it": { - "version": "3.0.3", - "dev": true, - "requires": { - "uc.micro": "^1.0.1" - } - }, "load-bmfont": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz", @@ -50169,27 +49986,6 @@ "markdown-escapes": { "version": "1.0.4" }, - "markdown-it": { - "version": "12.3.2", - "dev": true, - "requires": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "dependencies": { - "entities": { - "version": "2.1.0", - "dev": true - } - } - }, - "markdown-it-anchor": { - "version": "8.6.6", - "dev": true - }, "markdown-table": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", @@ -50199,10 +49995,6 @@ "repeat-string": "^1.0.0" } }, - "marked": { - "version": "4.2.5", - "dev": true - }, "matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", @@ -50222,10 +50014,6 @@ "mdn-data": { "version": "2.0.14" }, - "mdurl": { - "version": "1.0.1", - "dev": true - }, "media-typer": { "version": "0.3.0", "dev": true @@ -50910,7 +50698,9 @@ "dev": true }, "node-releases": { - "version": "2.0.8", + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "dev": true }, "node-sass": { @@ -54104,13 +53894,6 @@ "version": "1.0.0", "dev": true }, - "requizzle": { - "version": "0.2.4", - "dev": true, - "requires": { - "lodash": "^4.17.21" - } - }, "resize-observer-polyfill": { "version": "1.5.1" }, @@ -55834,10 +55617,6 @@ } } }, - "taffydb": { - "version": "2.6.2", - "dev": true - }, "tailwindcss": { "version": "3.2.4", "dev": true, @@ -56439,10 +56218,6 @@ "integrity": "sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==", "dev": true }, - "uc.micro": { - "version": "1.0.6", - "dev": true - }, "uint8arrays": { "version": "2.1.10", "requires": { @@ -56463,10 +56238,6 @@ "version": "2.0.5", "dev": true }, - "underscore": { - "version": "1.13.6", - "dev": true - }, "unherit": { "version": "1.1.3", "requires": { @@ -56629,7 +56400,9 @@ "dev": true }, "update-browserslist-db": { - "version": "1.0.10", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "dev": true, "requires": { "escalade": "^3.1.1", @@ -57665,10 +57438,6 @@ "version": "2.2.0", "dev": true }, - "xmlcreate": { - "version": "2.0.4", - "dev": true - }, "xmlhttprequest-ssl": { "version": "2.0.0" }, diff --git a/package.json b/package.json index 2f674a33c..7eb763c4b 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,6 @@ "dev": "mprocs \"cross-env REACT_APP_TRACKER_URL='ws://localhost:8000' npm run start\" \"npm run start:api\" \"npm run start:backend\" \"npm run start:tracker\"", "dev:native": "mprocs \"BROWSER=none npm run start\" \"npm run start:api\" \"npm run start:backend\" \"npm run electron\"", "electron": "wait-on tcp:3000 && electron .", - "doc": "jsdoc -c .jsdoc -r src", - "doc:view": "serve -S dist/doc", - "doc:watch": "nodemon --exec \"npm run doc\" --watch src --watch ./ --ext js,md --ignore dist", "print:crops": "npx -p @babel/core -p @babel/node babel-node --presets @babel/preset-env src/scripts/generate-crop-table.js", "lint": "eslint src --max-warnings=0", "prettier": "prettier 'src/**/*.js' --write", @@ -42,16 +39,19 @@ }, "devDependencies": { "@babel/node": "^7.20.7", - "@jeremyckahn/minami": "^1.3.1", "@testing-library/dom": "^8.3.0", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.0.0", "@testing-library/user-event": "^13.2.1", + "@types/dinero.js": "^1.9.0", + "@types/lodash.sortby": "^4.7.7", "@types/markdown-table": "^2.0.0", "@types/react": "^17.0.2", + "@types/uuid": "^9.0.2", "@typescript-eslint/eslint-plugin": "^2.23.0", "@typescript-eslint/parser": "^2.23.0", "bittorrent-tracker": "^9.19.0", + "browserslist": "^4.21.9", "cross-env": "^7.0.2", "electron": "^22.1.0", "electron-builder": "^23.1.0", @@ -69,7 +69,6 @@ "jest-extended": "^0.11.5", "jest-junit": "^14.0.1", "jimp": "^0.22.8", - "jsdoc": "^3.5.5", "jsdom": "^16.2.1", "markdown-table": "^2.0.0", "mprocs": "^0.6.4", diff --git a/src/components/Farmhand/Farmhand.js b/src/components/Farmhand/Farmhand.js index 916f71be8..67a129853 100644 --- a/src/components/Farmhand/Farmhand.js +++ b/src/components/Farmhand/Farmhand.js @@ -270,8 +270,8 @@ const applyPriceEvents = (valueAdjustments, priceCrashes, priceSurges) => { * @property {Object} todaysPurchases Keys are item names, values are their * respective quantities. * @property {number} todaysRevenue Should always be a positive number. - * @property {Object} todaysStartingInventory Keys are item names, values are - * their respective quantities. + * @property {Record} todaysStartingInventory Keys + * are item names, values are their respective quantities. * @property {boolean} useAlternateEndDayButtonPosition Option to display the * Bed button on the left side of the screen. * @property {Object.} valueAdjustments diff --git a/src/enums.js b/src/enums.js index e550c220a..9ab5257c3 100644 --- a/src/enums.js +++ b/src/enums.js @@ -5,7 +5,7 @@ /** * @param {Array.} keys - * @returns {Object.} + * @returns {Record} */ export const enumify = keys => keys.reduce((acc, key) => ({ [key]: key, ...acc }), {}) diff --git a/src/index.js b/src/index.js index 0e02ad048..bf4cf27cb 100644 --- a/src/index.js +++ b/src/index.js @@ -2,24 +2,32 @@ * @namespace farmhand */ +/** + * @typedef {import("./enums").cropType} cropType + * @typedef {import("./enums").cowColors} cowColors + * @typedef {import("./enums").recipeType} recipeType + * @typedef {import("./enums").toolLevel} toolLevel + * @typedef {import("./enums").toolType} toolType + * @typedef {import("./enums").fertilizerType} fertilizerType + */ + /** * Lookup table for the lifecycle durations of a crop (in days). * @typedef farmhand.cropTimetable - * @readonly - * @type {Object} * @property {number} seed * @property {number} growing + * @readonly */ /** * Reference object for an item. * @typedef farmhand.item - * @type {Object} * @property {string} id * @property {string} name * @property {string} type + * @property {number} value * @property {farmhand.cropTimetable} [cropTimetable] - * @property {farmhand.module:enums.cropType} [cropType] + * @property {cropType} [cropType] * @property {string} [description] A user-friendly description of the item. * @property {string} [enablesFieldMode] The fieldMode that this item enables. * @property {string|Array.} [growsInto] The id of farmhand.item or list of ids of other farmhand.items that this farmhand.item (likely a crop seed) will grow into. @@ -36,28 +44,28 @@ /** * @typedef farmhand.cropVariety - * @type {farmhand.item} * @property {string} imageId + * @extends farmhand.item */ /** * This is a minimalist base type to be inherited and expanded on by types like * farmhand.crop. This also represents non-crop plot content like scarecrows * and sprinklers. - * @typedef farmhand.plotContent - * @type {Object} + * @typedef farmhand.plotContentType * @property {string} itemId + * @property {boolean=} isFertilized Deprecated by fertilizerType. + * @property {fertilizerType} fertilizerType + * @typedef {farmhand.plotContentType} farmhand.plotContent */ /** * Represents a crop as it proceeds through the lifecycle. - * @typedef farmhand.crop - * @type {farmhand.plotContent} + * @typedef farmhand.cropType * @property {number} daysOld * @property {number} daysWatered - * @property {boolean?} isFertilized Deprecated by fertilizerType. - * @property {farmhand.module:enums.fertilizerType} fertilizerType * @property {boolean} wasWateredToday + * @typedef {farmhand.plotContent & farmhand.cropType} farmhand.crop */ /** @@ -76,7 +84,7 @@ * @type {Object} * @property {number} baseWeight * @property {string} color - * @property {Object.} colorsInBloodline + * @property {Object.} colorsInBloodline * @property {number} daysOld * @property {number} daysSinceMilking Only applies to female cows. * @property {number} daysSinceProducingFertilizer Only applies to male cows. @@ -109,14 +117,14 @@ /** * @typedef farmhand.recipe - * @readonly * @type {farmhand.item} - * @property {farmhand.module:enums.recipeType} recipeType The type of recipe + * @property {recipeType} recipeType The type of recipe * this is. * @property {{string: number}} ingredients An object where each * key is the id of a farmhand.item and the value is the quantity of that item. * @property {farmhand.recipeCondition} condition This must return `true` for * the recipe to be made available to the player. + * @readonly */ /** @@ -151,7 +159,6 @@ /** * @typedef farmhand.achievement - * @readonly * @type {Object} * @property {string} id * @property {string} name @@ -159,15 +166,16 @@ * @property {string} rewardDescription * @property {farmhand.achievementCondition} condition * @property {farmhand.achievementReward} reward + * @readonly */ /** * @typedef farmhand.level - * @readonly * @type {Object} * @property {number} id * @property {boolean} [increasesSprinklerRange] * @property {string} [unlocksShopItem] Must reference a farmhand.item id. + * @readonly */ /** @@ -192,14 +200,14 @@ * @property {string} id * @property {string?} description * @property {string} name - * @property {Object.?} ingredients - * @property {farmhand.module:enums.toolLevel?} nextLevel + * @property {Record?} ingredients + * @property {toolLevel?} nextLevel * @property {boolean?} isMaxLevel */ /** * @typedef farmhand.upgradesMetadata - * @type {Object.} + * @type {Object.} */ /** diff --git a/src/utils/index.js b/src/utils/index.js index cc2c358c1..72b6359cc 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,6 +1,16 @@ /** @typedef {import("../index").farmhand.crop} farmhand.crop */ /** @typedef {import("../index").farmhand.item} farmhand.item */ /** @typedef {import("../index").farmhand.plotContent} farmhand.plotContent */ +/** @typedef {import("../index").farmhand.shoveledPlot} farmhand.shoveledPlot */ +/** @typedef {import("../index").farmhand.cropTimetable} farmhand.cropTimetable */ +/** @typedef {import("../index").farmhand.cow} farmhand.cow */ +/** @typedef {import("../index").farmhand.recipe} farmhand.recipe */ +/** @typedef {import("../index").farmhand.priceEvent} farmhand.priceEvent */ +/** @typedef {import("../index").farmhand.cowBreedingPen} farmhand.cowBreedingPen */ +/** @typedef {import("../enums").cropLifeStage} farmhand.cropLifeStage */ +/** @typedef {import("../enums").toolLevel} farmhand.toolLevel */ +/** @typedef {import("../enums").toolType} farmhand.toolType */ +/** @typedef {import("../components/Farmhand/Farmhand").farmhand.state} farmhand.state */ /** * @module farmhand.utils @@ -37,7 +47,6 @@ import { fertilizerType, genders, itemType, - stageFocusType, standardCowColors, toolLevel, } from '../enums' @@ -86,6 +95,20 @@ const Jimp = configureJimp({ const { SEED, GROWING, GROWN } = cropLifeStage +/** + * @param {unknown} obj + * @returns {obj is farmhand.plotContent} + */ +const isPlotContent = (obj = {}) => + Boolean(obj && obj['itemId'] && obj['fertilizerType']) + +/** + * @param {unknown} obj + * @returns {obj is farmhand.shoveledPlot} + */ +const isShoveledPlot = (obj = {}) => + Boolean(obj && obj['isShoveled'] && obj['daysUntilClear']) + const purchasableItemMap = [...cowShopInventory, ...shopInventory].reduce( (acc, item) => { acc[item.id] = item @@ -107,11 +130,14 @@ export const chooseRandomIndex = list => */ export const chooseRandom = list => list[chooseRandomIndex(list)] -// Ensures that the condition argument to memoize() is not ignored, per -// https://github.com/caiogondim/fast-memoize.js#function-arguments -// -// Pass this is the `serializer` option to any memoize()-ed functions that -// accept function arguments. +/** + * Ensures that the condition argument to memoize() is not ignored, per + * https://github.com/caiogondim/fast-memoize.js#function-arguments + * + * Pass this is the `serializer` option to any memoize()-ed functions that + * accept function arguments. + * @param {any[]} args + */ const memoizationSerializer = args => JSON.stringify( [...args].map(arg => (typeof arg === 'function' ? arg.toString() : arg)) @@ -125,11 +151,14 @@ const memoizationSerializer = args => export const clampNumber = (num, min, max) => num <= min ? min : num >= max ? max : num +/** + * @param {number} num + */ export const castToMoney = num => Math.round(num * 100) / 100 /** * Safely adds dollar figures to avoid IEEE 754 rounding errors. - * @param {...number} num Numbers that represent money values. + * @param {...number} args Numbers that represent money values. * @returns {number} * @see http://adripofjavascript.com/blog/drips/avoiding-problems-with-decimal-math-in-javascript.html */ @@ -192,7 +221,7 @@ export const percentageString = number => `${Math.round(number * 100)}%` /** * @param {farmhand.item} item - * @param {Object.} valueAdjustments + * @param {Record} valueAdjustments * @returns {number} */ export const getItemCurrentValue = ({ id }, valueAdjustments) => @@ -207,7 +236,7 @@ export const getItemCurrentValue = ({ id }, valueAdjustments) => }).toUnit() /** - * @param {Object} valueAdjustments + * @param {Record} valueAdjustments * @param {string} itemId * @returns {number} Rounded to a money value. */ @@ -239,11 +268,10 @@ export const getPlotContentFromItemId = itemId => ({ * @param {string} itemId * @returns {farmhand.crop} */ -export const getCropFromItemId = itemId => ({ +export const getCropFromItemId = itemId => /** @type farmhand.crop */ ({ ...getPlotContentFromItemId(itemId), daysOld: 0, daysWatered: 0, - fertilizerType: fertilizerType.NONE, wasWateredToday: false, }) @@ -259,7 +287,7 @@ export const getPlotContentType = ({ itemId }) => * @returns {boolean} */ export const doesPlotContainCrop = plot => - plot && getPlotContentType(plot) === itemType.CROP + plot !== null && getPlotContentType(plot) === itemType.CROP /** * @param {farmhand.item} item @@ -279,12 +307,13 @@ export const isItemAFarmProduct = item => item.type === itemType.CRAFTED_ITEM ) -/** - * @param {farmhand.cropTimetable} cropTimetable - * @returns {Array.} - */ -export const getLifeStageRange = memoize(cropTimetable => +export const getLifeStageRange = memoize(( + /** @type {farmhand.cropTimetable} */ cropTimetable +) => [SEED, GROWING].reduce( + /** + * @param {farmhand.cropLifeStage[]} acc + */ (acc, stage) => acc.concat(Array(cropTimetable[stage]).fill(stage)), [] ) @@ -292,51 +321,60 @@ export const getLifeStageRange = memoize(cropTimetable => /** * @param {farmhand.crop} crop - * @returns {enums.cropLifeStage} + * @returns {farmhand.cropLifeStage} */ -export const getCropLifeStage = ({ itemId, daysWatered }) => - getLifeStageRange(itemsMap[itemId].cropTimetable)[Math.floor(daysWatered)] || - GROWN +export const getCropLifeStage = crop => { + const { itemId, daysWatered } = crop + const { cropTimetable } = itemsMap[itemId] + + if (!cropTimetable) { + throw new Error(`${itemId} has no cropTimetable`) + } + + return getLifeStageRange(cropTimetable)[Math.floor(daysWatered)] || GROWN +} /** - * @param {farmhand.plotContent} plotContent + * @param {farmhand.plotContent | farmhand.shoveledPlot | null} plotContents * @param {number} x * @param {number} y * @returns {?string} */ -export const getPlotImage = (plotContent, x, y) => { - if (plotContent) { - if (getPlotContentType(plotContent) === itemType.CROP) { +export const getPlotImage = (plotContents, x, y) => { + if (isPlotContent(plotContents)) { + if (isPlotContentACrop(plotContents)) { let itemImageId - switch (getCropLifeStage(plotContent)) { + switch (getCropLifeStage(plotContents)) { case GROWN: - itemImageId = plotContent.itemId + itemImageId = plotContents.itemId break case GROWING: - itemImageId = `${plotContent.itemId}-growing` + itemImageId = `${plotContents.itemId}-growing` break default: - const seedItem = cropItemIdToSeedItemMap[plotContent.itemId] + const seedItem = cropItemIdToSeedItemMap[plotContents.itemId] itemImageId = seedItem.id } return itemImages[itemImageId] } - if (getPlotContentType(plotContent) === itemType.WEED) { + if (getPlotContentType(plotContents) === itemType.WEED) { const weedColors = ['yellow', 'orange', 'pink'] const color = weedColors[(x * y) % weedColors.length] return itemImages[`weed-${color}`] - } else if (plotContent?.oreId) { - return itemImages[plotContent.oreId] - } else { - return itemImages[plotContent.itemId] } } + if (isShoveledPlot(plotContents) && plotContents?.oreId) { + return itemImages[plotContents.oreId] + } else if (isPlotContent(plotContents)) { + return itemImages[plotContents.itemId] + } + return null } @@ -344,7 +382,7 @@ export const getPlotImage = (plotContent, x, y) => { * @param {number} rangeSize * @param {number} centerX * @param {number} centerY - * @returns {Array.>} + * @returns {{x: number, y: number}[][]} */ export const getRangeCoords = (rangeSize, centerX, centerY) => { const squareSize = 2 * rangeSize + 1 @@ -352,26 +390,28 @@ export const getRangeCoords = (rangeSize, centerX, centerY) => { const rangeStartY = centerY - rangeSize return new Array(squareSize) - .fill() + .fill(null) .map((_, y) => new Array(squareSize) - .fill() + .fill(null) .map((_, x) => ({ x: rangeStartX + x, y: rangeStartY + y })) ) } /** * @param {farmhand.item} item - * @param {number} [variationIdx=0] - * @returns {farmhand.item} + * @param {number} [variantIdx] */ -export const getFinalCropItemFromSeedItem = ({ id }, variantIdx = 0) => - itemsMap[getFinalCropItemIdFromSeedItemId(id, variantIdx)] +export const getFinalCropItemFromSeedItem = ({ id }, variantIdx = 0) => { + const itemId = getFinalCropItemIdFromSeedItemId(id, variantIdx) + + if (itemId) return itemsMap[itemId] +} /** * @param {string} seedItemId * @param {number} [variationIdx] - * @returns {string} + * @returns {string=} */ export const getFinalCropItemIdFromSeedItemId = ( seedItemId, @@ -386,19 +426,22 @@ export const getFinalCropItemIdFromSeedItemId = ( } } -/** - * @param {string} cropItemId - * @returns {string} - */ export const getSeedItemIdFromFinalStageCropItemId = memoize( - cropItemId => { - return Object.values(itemsMap).find(({ growsInto }) => { + (/** @type {string} */ cropItemId) => { + const seedItemId = Object.values(itemsMap).find(({ growsInto }) => { if (Array.isArray(growsInto)) { return growsInto.includes(cropItemId) } else { return growsInto === cropItemId } - }).id + })?.id + + if (!seedItemId) + throw new Error( + `Crop item ID ${cropItemId} does not have a corresponding seed` + ) + + return seedItemId }, { cacheSize: Object.keys(itemsMap).length, @@ -599,6 +642,9 @@ export const getCowValue = (cow, computeSaleValue = false) => ) : getCowWeight(cow) * 1.5 +/** + * @param {farmhand.cow} cow + */ export const getCowSellValue = cow => getCowValue(cow, true) /** @@ -620,7 +666,7 @@ export const maxYieldOfRecipe = memoize(({ ingredients }, inventory) => { /** * @param {farmhand.recipe} recipe - * @param {Array.} inventory + * @param {farmhand.item[]} inventory * @param {number} howMany * @returns {boolean} */ @@ -628,8 +674,8 @@ export const canMakeRecipe = (recipe, inventory, howMany) => maxYieldOfRecipe(recipe, inventory) >= howMany /** - * @param {Array.} itemIds - * @returns {Array.} + * @param {string[]} itemsIds + * @returns {string[]} */ export const filterItemIdsToSeeds = itemsIds => itemsIds.filter(id => itemsMap[id].type === itemType.CROP) @@ -645,10 +691,17 @@ export const getRandomUnlockedCrop = unlockedSeedItemIds => { ? chooseRandomIndex(seedItem.growsInto) : 0 - const cropItem = - itemsMap[getFinalCropItemIdFromSeedItemId(seedItemId, variationIdx)] + const finalCropItemId = getFinalCropItemIdFromSeedItemId( + seedItemId, + variationIdx + ) - return cropItem + if (!finalCropItemId) + throw new Error( + `Seed item ID ${seedItemId} has no corresponding final crop ID` + ) + + return itemsMap[finalCropItemId] } /** @@ -661,39 +714,25 @@ export const getPriceEventForCrop = cropItem => ({ getCropLifecycleDuration(cropItem) - PRICE_EVENT_STANDARD_DURATION_DECREASE, }) -/** - * @param {Array.>} field - * @param {function(?farmhand.plotContent)} condition - * @returns {?farmhand.plotContent} - */ export const findInField = memoize( - (field, condition) => field.find(row => row.find(condition)) || null, - { - serializer: memoizationSerializer, - } -) - -// This is currently unused, but it could be useful later. -/** - * @param {Array.>} field - * @param {function(?farmhand.plotContent)} filterCondition - * @returns {Array.>} - */ -export const getCrops = memoize( - (field, filterCondition) => - field.reduce((acc, row) => { - acc.push(...row.filter(filterCondition)) + /** + * @param {(?farmhand.plotContent)[][]} field + * @param {function(?farmhand.plotContent): boolean} condition + * @returns {?farmhand.plotContent} + */ + (field, condition) => { + const [plot = null] = + field.find(row => { + return row.find(condition) + }) ?? [] - return acc - }, []), + return plot + }, { serializer: memoizationSerializer, } ) -/** - * @returns {boolean} - */ export const doesMenuObstructStage = () => window.innerWidth < BREAKPOINTS.MD const itemTypesToShowInReverse = new Set([itemType.MILK]) @@ -719,12 +758,12 @@ export const sortItems = items => { return sortItemIdsByTypeAndValue(items.map(({ id }) => id)).map(id => map[id]) } -/** - * @param {Array.} inventory - * @returns {number} - */ -export const inventorySpaceConsumed = memoize(inventory => - inventory.reduce((sum, { quantity }) => sum + quantity, 0) +export const inventorySpaceConsumed = memoize( + /** + * @param {farmhand.item[]} inventory + * @returns {number} + */ + inventory => inventory.reduce((sum, { quantity = 0 }) => sum + quantity, 0) ) /** @@ -762,25 +801,26 @@ export const nullArray = memoize( } ) -/** - * @param {Array.} cowInventory - * @param {string} id - * @returns {farmhand.cow|undefined} - */ -export const findCowById = memoize((cowInventory, id) => - cowInventory.find(cow => id === cow.id) +export const findCowById = memoize( + /** + * @param {Array.} cowInventory + * @param {string} id + * @returns {farmhand.cow|undefined} + */ + (cowInventory, id) => cowInventory.find(cow => id === cow.id) ) -/** - * @param {Object.} itemsSold - * @returns {number} - */ -export const farmProductsSold = memoize(itemsSold => - Object.entries(itemsSold).reduce( - (sum, [itemId, numberSold]) => - sum + (isItemAFarmProduct(itemsMap[itemId]) ? numberSold : 0), - 0 - ) +export const farmProductsSold = memoize( + /** + * @param {Record} itemsSold + * @returns {number} + */ + itemsSold => + Object.entries(itemsSold).reduce( + (sum, [itemId, numberSold]) => + sum + (isItemAFarmProduct(itemsMap[itemId]) ? numberSold : 0), + 0 + ) ) /** @@ -905,9 +945,9 @@ export const getProfitRecord = ( ) => Math.max(recordSingleDayProfit, getProfit(todaysRevenue, todaysLosses)) /** - * @param {Object} todaysStartingInventory - * @param {Object} todaysPurchases - * @param {Array.<{ id: farmhand.item, quantity: number }>} inventory + * @param {farmhand.state['todaysStartingInventory']} todaysStartingInventory + * @param {farmhand.state['todaysPurchases']} todaysPurchases + * @param {{ id: farmhand.item['id'], quantity: number }[]} inventory * @return {Object} Keys are item IDs, values are either 1 or -1. */ export const computeMarketPositions = ( @@ -941,8 +981,8 @@ export const computeMarketPositions = ( }, {}) /** - * @param {Object.} currentToolLevels - * @param {farmhand.module:enums.toolType} toolType + * @param {Object.} currentToolLevels + * @param {farmhand.toolType} toolType * @returns {farmhand.state} */ export const unlockTool = (currentToolLevels, toolType) => { @@ -956,71 +996,15 @@ export const unlockTool = (currentToolLevels, toolType) => { } /** - * @param {Farmhand.state} state - * @return {Object} + * @param {farmhand.state} state + * @return {farmhand.state} */ export const transformStateDataForImport = state => { const sanitizedState = { ...state } - const { id } = sanitizedState const rejectedKeys = ['version'] rejectedKeys.forEach(rejectedKey => delete sanitizedState[rejectedKey]) - // Update old data models - - if (sanitizedState.field) { - // Update plot data - sanitizedState.field = sanitizedState.field.map(row => - row.map(plot => { - if (plot === null) { - return null - } - - const { isFertilized, ...rest } = plot - - return { - ...rest, - - // Convert from isFertilized (boolean) to fertilizerType (enum) - fertilizerType: - rest.fertilizerType || - (isFertilized ? fertilizerType.STANDARD : fertilizerType.NONE), - } - }) - ) - } - - const { tools: unlockedTools } = getLevelEntitlements( - levelAchieved(farmProductsSold(sanitizedState.itemsSold)) - ) - - for (const tool of Object.keys(unlockedTools)) { - sanitizedState.toolLevels = unlockTool(sanitizedState.toolLevels, tool) - } - - if ( - !sanitizedState.showHomeScreen && - sanitizedState.stageFocus === stageFocusType.HOME - ) { - sanitizedState.stageFocus = stageFocusType.SHOP - } - - // TODO: Remove these cowInventory and cowForSale transformations after - // 3/15/2023 - sanitizedState.cowInventory = sanitizedState.cowInventory.map(cow => ({ - ownerId: id, - originalOwnerId: id, - timesTraded: 0, - ...cow, - })) - - sanitizedState.cowForSale = { - ownerId: '', - originalOwnerId: '', - timesTraded: 0, - ...sanitizedState.cowForSale, - } - return sanitizedState } @@ -1048,7 +1032,8 @@ export const getCostOfNextStorageExpansion = currentInventoryLimit => { /** * Create a no-op Promise that resolves in a specified amount of time. - * @returns {Promise} + * @param {number} ms + * @returns {Promise} */ export const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) @@ -1070,6 +1055,13 @@ export const getSalePriceMultiplier = (completedAchievements = {}) => { return salePriceMultiplier } +/** + * @param {farmhand.plotContent} plotContents + * @returns {plotContents is farmhand.crop} + */ +const isPlotContentACrop = plotContents => + getPlotContentType(plotContents) === itemType.CROP + /** * @param {Array} weightedOptions an array of objects each containing a `weight` property * @returns {Object} one of the items from weightedOptions @@ -1104,14 +1096,16 @@ const colorizeCowTemplate = (() => { const cowImageWidth = 48 const cowImageHeight = 48 const cowImageFactoryCanvas = document.createElement('canvas') - cowImageFactoryCanvas.setAttribute('height', cowImageHeight) - cowImageFactoryCanvas.setAttribute('width', cowImageWidth) + cowImageFactoryCanvas.setAttribute('height', String(cowImageHeight)) + cowImageFactoryCanvas.setAttribute('width', String(cowImageWidth)) const cachedCowImages = {} // https://stackoverflow.com/a/5624139 const hexToRgb = memoize(hex => { - const [, r, g, b] = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) + const [, r, g, b] = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec( + hex + ) ?? ['', '0', '0', '0'] return { r: parseInt(r, 16), @@ -1177,7 +1171,7 @@ const colorizeCowTemplate = (() => { /** * @param {farmhand.cow} cow - * @returns {string} Base64 representation of an image + * @returns {Promise} Base64 representation of an image */ export const getCowImage = async cow => { const cowIdNumber = convertStringToInteger(cow.id) diff --git a/src/utils/memoize.js b/src/utils/memoize.js index 8ae7f73d1..d748da507 100644 --- a/src/utils/memoize.js +++ b/src/utils/memoize.js @@ -1,3 +1,5 @@ +/** @typedef {import("fast-memoize").Options} MemoizeOptions */ + import fastMemoize from 'fast-memoize' import { MEMOIZE_CACHE_CLEAR_THRESHOLD } from '../constants' @@ -40,9 +42,10 @@ export class MemoizeCache { } /** - * @param {function} fn - * @param {Object} [config] - * @param {number} [config.cacheSize] + * @template {(...args: any[]) => any} T Copied from https://github.com/caiogondim/fast-memoize.js/blob/5cdfc8dde23d86b16e0104bae1b04cd447b98c63/typings/fast-memoize.d.ts#L1 + * @param {T} fn + * @param {MemoizeOptions & Partial<{ cacheSize: number }>} [config] + * @returns T * @see https://github.com/caiogondim/fast-memoize.js */ export const memoize = (fn, config) => diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..6a464d57b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,74 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + "checkJs": true /* Report errors in .js files. */, + "jsx": "preserve" /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */, + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./build/types" /* Redirect output structure to the directory. */, + // "rootDir": "./" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + "noEmit": true /* Do not emit outputs. */, + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */, + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + + /* Advanced Options */ + "skipLibCheck": true /* Skip type checking of declaration files. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + }, + //"include": ["src/utils/index.js"], + "exclude": ["build"] +} From 5d6feec503990dc404dac861ed6f8203843bb2f1 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sat, 5 Aug 2023 14:58:18 -0500 Subject: [PATCH 7/8] refactor(types): Make `Farmhand` component type-safe (#428) * refactor(types): fix types for Farmhand component * refactor(types): make reducer patching type-safe * fix(types): use correct state types in utils * chore(ci): check types * refactor(utils): use global noop --- .github/workflows/ci.yml | 14 +- package.json | 2 + src/components/AppBar/AppBar.test.js | 4 +- src/components/CowCard/CowCard.test.js | 9 +- src/components/CowPen/CowPen.test.js | 5 +- .../CowPenContextMenu.test.js | 17 +- src/components/DebugMenu/DebugMenu.test.js | 6 +- src/components/Farmhand/Farmhand.js | 322 +++++++++--------- src/components/Farmhand/FarmhandReducers.js | 227 ++++++++++++ src/components/Field/Field.test.js | 9 +- src/components/Item/Item.js | 3 +- src/components/Navigation/Navigation.test.js | 18 +- src/components/Plot/Plot.rtl.test.js | 32 +- src/components/Plot/Plot.test.js | 5 +- .../QuantityInput/QuantityInput.test.js | 8 +- .../QuickSelect/QuickSelect.test.js | 4 +- .../SettingsView/SettingsView.test.js | 16 +- src/components/Shop/Shop.test.js | 12 +- src/components/Toolbelt/Toolbelt.js | 3 +- src/game-logic/reducers/fertilizePlot.test.js | 2 - src/index.js | 2 +- src/react-app-env.d.ts | 8 + src/utils/index.js | 10 +- src/utils/noop.js | 1 + 24 files changed, 495 insertions(+), 244 deletions(-) create mode 100644 src/components/Farmhand/FarmhandReducers.js create mode 100644 src/utils/noop.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c38095564..7e0fadb6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + # https://stackoverflow.com/a/69634516 - name: Reconfigure git to use HTTP authentication run: > @@ -18,8 +19,13 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - - run: npm ci - - run: npm test -- --reporters=default --reporters=jest-junit + + - name: 'Install dependencies' + run: npm ci + + - name: 'Run tests' + run: npm test -- --reporters=default --reporters=jest-junit + - name: Test Report uses: dorny/test-reporter@v1 with: @@ -27,6 +33,10 @@ jobs: path: reports/jest-*.xml # Path to test results reporter: jest-junit # Format of test results + - name: 'Check types' + # TODO: Change this to check:types when all type errors are fixed + run: npm run check:types:noerror + - name: 'Build web app artifacts' run: | npm run build diff --git a/package.json b/package.json index 7eb763c4b..6a31b8872 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ "build": "react-scripts --openssl-legacy-provider build", "build:native": "cross-env PUBLIC_URL='./' npm run build && electron-builder --publish=always", "build:analyze": "npm run build && source-map-explorer 'build/static/js/*.js'", + "check:types": "tsc", + "check:types:noerror": "tsc; exit 0", "dev": "mprocs \"cross-env REACT_APP_TRACKER_URL='ws://localhost:8000' npm run start\" \"npm run start:api\" \"npm run start:backend\" \"npm run start:tracker\"", "dev:native": "mprocs \"BROWSER=none npm run start\" \"npm run start:api\" \"npm run start:backend\" \"npm run electron\"", "electron": "wait-on tcp:3000 && electron .", diff --git a/src/components/AppBar/AppBar.test.js b/src/components/AppBar/AppBar.test.js index ac5f0af6b..70330f1ac 100644 --- a/src/components/AppBar/AppBar.test.js +++ b/src/components/AppBar/AppBar.test.js @@ -1,6 +1,8 @@ import React from 'react' import { shallow } from 'enzyme' +import { noop } from '../../utils/noop' + import AppBar from './AppBar' let component @@ -9,7 +11,7 @@ beforeEach(() => { component = shallow( {}, + handleClickNotificationIndicator: noop, money: 0, showNotifications: false, todaysNotifications: [], diff --git a/src/components/CowCard/CowCard.test.js b/src/components/CowCard/CowCard.test.js index 58f432fe3..9aef44ce8 100644 --- a/src/components/CowCard/CowCard.test.js +++ b/src/components/CowCard/CowCard.test.js @@ -2,6 +2,7 @@ import React from 'react' import { render, screen } from '@testing-library/react' import { generateCow } from '../../utils' +import { noop } from '../../utils/noop' import { PURCHASEABLE_COW_PENS } from '../../constants' import { cowColors, genders } from '../../enums' @@ -23,10 +24,10 @@ describe('CowCard', () => { daysUntilBirth: -1, }, cowIdOfferedForTrade: '', - handleCowSelect: () => {}, - handleCowNameInputChange: () => {}, - handleCowPurchaseClick: () => {}, - handleCowTradeClick: () => {}, + handleCowSelect: noop, + handleCowNameInputChange: noop, + handleCowPurchaseClick: noop, + handleCowTradeClick: noop, id: '', isSelected: false, isOnline: false, diff --git a/src/components/CowPen/CowPen.test.js b/src/components/CowPen/CowPen.test.js index 35b16283a..7831af53c 100644 --- a/src/components/CowPen/CowPen.test.js +++ b/src/components/CowPen/CowPen.test.js @@ -4,6 +4,7 @@ import { shallow } from 'enzyme' import { generateCow } from '../../utils' import { cowColors } from '../../enums' import { pixel } from '../../img' +import { noop } from '../../utils/noop' import { Cow } from './CowPen' @@ -27,8 +28,8 @@ describe('Cow', () => { color: cowColors.WHITE, }, cowInventory: [], - handleCowPenUnmount: () => {}, - handleCowClick: () => {}, + handleCowPenUnmount: noop, + handleCowClick: noop, id: '', isSelected: false, }} diff --git a/src/components/CowPenContextMenu/CowPenContextMenu.test.js b/src/components/CowPenContextMenu/CowPenContextMenu.test.js index 2e5beb87b..f3257fd66 100644 --- a/src/components/CowPenContextMenu/CowPenContextMenu.test.js +++ b/src/components/CowPenContextMenu/CowPenContextMenu.test.js @@ -2,6 +2,7 @@ import React from 'react' import { render, screen } from '@testing-library/react' import { generateCow } from '../../utils' +import { noop } from '../../utils/noop' import { CowPenContextMenu } from './CowPenContextMenu' @@ -23,14 +24,14 @@ describe('CowPenContextMenu', () => { cowBreedingPen: { cowId1: null, cowId2: null, daysUntilBirth: -1 }, cowForSale: generateCow(), cowInventory: [], - handleCowAutomaticHugChange: () => {}, - handleCowBreedChange: () => {}, - handleCowHugClick: () => {}, - handleCowNameInputChange: () => {}, - handleCowOfferClick: () => {}, - handleCowSelect: () => {}, - handleCowSellClick: () => {}, - handleCowWithdrawClick: () => {}, + handleCowAutomaticHugChange: noop, + handleCowBreedChange: noop, + handleCowHugClick: noop, + handleCowNameInputChange: noop, + handleCowOfferClick: noop, + handleCowSelect: noop, + handleCowSellClick: noop, + handleCowWithdrawClick: noop, purchasedCowPen: 1, selectedCowId: '', } diff --git a/src/components/DebugMenu/DebugMenu.test.js b/src/components/DebugMenu/DebugMenu.test.js index 9fad5e20a..3d23e6225 100644 --- a/src/components/DebugMenu/DebugMenu.test.js +++ b/src/components/DebugMenu/DebugMenu.test.js @@ -1,6 +1,8 @@ import React from 'react' import { shallow } from 'enzyme' +import { noop } from '../../utils/noop' + import { DebugMenu } from './DebugMenu' let component @@ -9,8 +11,8 @@ beforeEach(() => { component = shallow( {}, - handleItemPurchaseClick: () => {}, + handleAddMoneyClick: noop, + handleItemPurchaseClick: noop, }} /> ) diff --git a/src/components/Farmhand/Farmhand.js b/src/components/Farmhand/Farmhand.js index 67a129853..9f35b23b7 100644 --- a/src/components/Farmhand/Farmhand.js +++ b/src/components/Farmhand/Farmhand.js @@ -1,10 +1,19 @@ /** * @typedef {import("../../index").farmhand.item} farmhand.item * @typedef {import("../../index").farmhand.cow} farmhand.cow + * @typedef {import("../../index").farmhand.cowBreedingPen} farmhand.cowBreedingPen * @typedef {import("../../index").farmhand.keg} farmhand.keg - * @typedef {import("../../index").farmhand.notification} notification + * @typedef {import("../../index").farmhand.plotContent} farmhand.plotContent + * @typedef {import("../../index").farmhand.peerMessage} farmhand.peerMessage + * @typedef {import("../../index").farmhand.priceEvent} farmhand.priceEvent + * @typedef {import("../../index").farmhand.notification} farmhand.notification + * @typedef {import("../../enums").cowColors} farmhand.cowColors + * @typedef {import("../../enums").cropType} farmhand.cropType + * @typedef {import("../../enums").dialogView} farmhand.dialogView + * @typedef {import("../../enums").fieldMode} farmhand.fieldMode + * @typedef {import("../../enums").stageFocusType} farmhand.stageFocusType */ -import React, { Component } from 'react' +import React from 'react' import window from 'global/window' import { Redirect } from 'react-router-dom' import { GlobalHotKeys } from 'react-hotkeys' @@ -51,6 +60,7 @@ import { createNewField, doesMenuObstructStage, farmProductsSold, + generateCow, getAvailableShopInventory, getItemCurrentValue, getPeerMetadata, @@ -62,6 +72,7 @@ import { sleep, transformStateDataForImport, } from '../../utils' +import { noop } from '../../utils/noop' import { getLevelEntitlements } from '../../utils/getLevelEntitlements' import { memoize } from '../../utils/memoize' import { getData, postData } from '../../fetch-utils' @@ -109,6 +120,7 @@ import { scarecrow } from '../../data/items' import { getInventoryQuantities } from './helpers/getInventoryQuantities' import FarmhandContext from './Farmhand.context' +import { FarmhandReducers } from './FarmhandReducers' const { CLEANUP, HARVEST, MINE, OBSERVE, WATER, PLANT } = fieldMode @@ -153,10 +165,10 @@ export const getPlantableCropInventory = memoize(inventory => ) /** - * @param {Object.} valueAdjustments - * @param {farmhand.priceEvent} priceCrashes - * @param {farmhand.priceEvent} priceSurges - * @returns {Object.} + * @param {Record} valueAdjustments + * @param {Record} priceCrashes + * @param {Record} priceSurges + * @returns {Record} */ const applyPriceEvents = (valueAdjustments, priceCrashes, priceSurges) => { const patchedValueAdjustments = { ...valueAdjustments } @@ -177,27 +189,28 @@ const applyPriceEvents = (valueAdjustments, priceCrashes, priceSurges) => { * @property {number?} activePlayers * @property {boolean} allowCustomPeerCowNames * @property {Array.} cellarInventory - * @property {farmhand.module:enums.dialogView} currentDialogView + * @property {farmhand.dialogView} currentDialogView * @property {Object.} completedAchievements Keys are * achievement ids. * @property {farmhand.cow} cowForSale * @property {farmhand.cowBreedingPen} cowBreedingPen * @property {Array.} cowInventory - * @property {Object.} - * cowColorsPurchased Keys are color enums, values are the number of that color - * of cow purchased. + * @property {Object.} cowColorsPurchased Keys are + * color enums, values are the number of that color of cow purchased. * @property {string} cowIdOfferedForTrade The ID of the cow that is currently * set to be traded with online peers. * @property {Object} cowsSold Keys are items IDs, values are the id references * of cow colors (rainbow-cow, etc.). * @property {number} cowsTraded * @property {number?} cowTradeTimeoutId - * @property {Object.} cropsHarvested A - * map of totals of crops harvested. Keys are crop type IDs, values are the - * number of that crop harvested. + * @property {Object.} cropsHarvested A map of + * totals of crops harvested. Keys are crop type IDs, values are the number of + * that crop harvested. * @property {number} dayCount - * @property {Array.>} field - * @property {farmhand.module:enums.fieldMode} fieldMode + * @property {string} farmName + * @property {boolean} hasBooted + * @property {(?farmhand.plotContent)[][]} field + * @property {farmhand.fieldMode} fieldMode * @property {Function?} getCowAccept https://github.com/dmotz/trystero#receiver * @property {Function?} getCowReject https://github.com/dmotz/trystero#receiver * @property {Function?} getCowTradeRequest https://github.com/dmotz/trystero#receiver @@ -205,13 +218,13 @@ const applyPriceEvents = (valueAdjustments, priceCrashes, priceSurges) => { * @property {number?} heartbeatTimeoutId * @property {Array.} historicalDailyLosses * @property {Array.} historicalDailyRevenue - * @property {Array.>} historicalValueAdjustments Currently - * there is only one element in this array, but it will be used for more - * historical price data analysis in the future. It is an array for + * @property {Record[]} historicalValueAdjustments + * Currently there is only one element in this array, but it will be used for + * more historical price data analysis in the future. It is an array for * future-facing flexibility. * @property {number} hoveredPlotRangeSize * @property {string} id - * @property {Array.<{ id: farmhand.item.id, quantity: number }>} inventory + * @property {{ id: farmhand.item['id'], quantity: number }[]} inventory * @property {number} inventoryLimit Is -1 if inventory is unlimited. * @property {boolean} isAwaitingCowTradeRequest * @property {boolean} isAwaitingNetworkRequest @@ -231,15 +244,15 @@ const applyPriceEvents = (valueAdjustments, priceCrashes, priceSurges) => { * @property {number} loanBalance * @property {number} loansTakenOut * @property {number} money - * @property {notification} latestNotification - * @property {Array.} newDayNotifications - * @property {Array.} notificationLog + * @property {farmhand.notification?} latestNotification + * @property {Array.} newDayNotifications + * @property {Array.} notificationLog * @property {Object} peers Keys are (Trystero) peer ids, values are their respective metadata or null. * @property {Object?} peerRoom See https://github.com/dmotz/trystero - * @property {Array.} pendingPeerMessages An array of - * messages to be sent to the Trystero peer room upon the next broadcast. - * @property {Array.} latestPeerMessages An array of - * messages that have been received from peers. + * @property {farmhand.peerMessage[]} pendingPeerMessages An array of messages + * to be sent to the Trystero peer room upon the next broadcast. + * @property {farmhand.peerMessage[]} latestPeerMessages An array of messages + * that have been received from peers. * @property {function?} sendPeerMetadata See https://github.com/dmotz/trystero * @property {string} selectedCowId * @property {string} selectedItemId @@ -248,9 +261,11 @@ const applyPriceEvents = (valueAdjustments, priceCrashes, priceSurges) => { * @property {Object.} priceSurges Keys are * itemIds. * @property {number} purchasedCombine + * @property {number} purchasedComposter * @property {number} purchasedCowPen * @property {number} purchasedCellar * @property {number} purchasedField + * @property {number} purchasedSmelter * @property {number} profitabilityStreak * @property {number} record7dayProfitAverage * @property {number} recordProfitabilityStreak @@ -264,28 +279,41 @@ const applyPriceEvents = (valueAdjustments, priceCrashes, priceSurges) => { * @property {Function?} sendPeerMetadata https://github.com/dmotz/trystero#sender * @property {boolean} showHomeScreen Option to show the Home Screen * @property {boolean} showNotifications - * @property {farmhand.module:enums.stageFocusType} stageFocus - * @property {Array.} todaysNotifications + * @property {farmhand.stageFocusType} stageFocus + * @property {Array.} todaysNotifications * @property {number} todaysLosses Should always be a negative number. * @property {Object} todaysPurchases Keys are item names, values are their * respective quantities. * @property {number} todaysRevenue Should always be a positive number. * @property {Record} todaysStartingInventory Keys * are item names, values are their respective quantities. + * @property {Record} toolLevels * @property {boolean} useAlternateEndDayButtonPosition Option to display the * Bed button on the left side of the screen. - * @property {Object.} valueAdjustments + * @property {Record} valueAdjustments * @property {string} version Comes from the `version` property in * package.json. */ -export default class Farmhand extends Component { +export default class Farmhand extends FarmhandReducers { /*! * @member farmhand.Farmhand#state * @type {farmhand.state} */ state = this.createInitialState() + handlers = { debounced: {} } + + /** + * @type {Record} + */ + keyMap = {} + + /** + * @type {Record void>} + */ + keyHandlers = {} + static defaultProps = { localforage: localforage.createInstance({ name: 'farmhand', @@ -295,13 +323,15 @@ export default class Farmhand extends Component { match: { path: '', params: {} }, } - constructor() { - super(...arguments) + /** + * @param {typeof Farmhand.defaultProps} props + */ + constructor(props) { + super(props) this.initInputHandlers() - this.initReducers() - // This is antipattern, but it's useful for debugging. The Farmhand + // This is an antipattern, but it's useful for debugging. The Farmhand // component assumes that it is a singleton. window.farmhand = this } @@ -379,7 +409,7 @@ export default class Farmhand extends Component { cellarInventory: [], currentDialogView: dialogView.NONE, completedAchievements: {}, - cowForSale: {}, + cowForSale: generateCow(), cowBreedingPen: { cowId1: null, cowId2: null, @@ -390,10 +420,16 @@ export default class Farmhand extends Component { cowInventory: [], cowsSold: {}, cowsTraded: 0, + cowTradeTimeoutId: -1, cropsHarvested: {}, dayCount: 0, farmName: 'Unnamed', field: createNewField(), + fieldMode: OBSERVE, + getCowAccept: noop, + getCowReject: noop, + getCowTradeRequest: noop, + getPeerMetadata: noop, hasBooted: false, heartbeatTimeoutId: null, historicalDailyLosses: [], @@ -426,7 +462,6 @@ export default class Farmhand extends Component { sendPeerMetadata: null, selectedCowId: '', selectedItemId: '', - fieldMode: OBSERVE, priceCrashes: {}, priceSurges: {}, profitabilityStreak: 0, @@ -436,12 +471,15 @@ export default class Farmhand extends Component { revenue: 0, redirect: '', room: decodeURIComponent(this.props.match.params.room || DEFAULT_ROOM), + sendCowAccept: noop, + sendCowReject: noop, purchasedCombine: 0, purchasedComposter: 0, purchasedCowPen: 0, purchasedCellar: 0, purchasedField: 0, purchasedSmelter: 0, + sendCowTradeRequest: noop, showHomeScreen: true, showNotifications: true, stageFocus: stageFocusType.HOME, @@ -458,15 +496,13 @@ export default class Farmhand extends Component { }, useAlternateEndDayButtonPosition: false, valueAdjustments: {}, - version: process.env.REACT_APP_VERSION, + version: process.env.REACT_APP_VERSION ?? '', } } initInputHandlers() { const debouncedInputRate = 50 - this.handlers = { debounced: {} } - Object.keys(eventHandlers).forEach(method => { this.handlers[method] = eventHandlers[method].bind(this) @@ -537,69 +573,7 @@ export default class Farmhand extends Component { Object.assign(this.keyHandlers, { clearPersistedData: () => this.clearPersistedData(), - waterAllPlots: () => this.waterAllPlots(this.state), - }) - } - - initReducers() { - ;[ - 'addCowToInventory', - 'addPeer', - 'adjustLoan', - 'changeCowAutomaticHugState', - 'changeCowBreedingPenResident', - 'changeCowName', - 'clearPlot', - 'computeStateForNextDay', - 'fertilizePlot', - 'forRange', - 'harvestPlot', - 'hugCow', - 'makeRecipe', - 'makeFermentationRecipe', - 'modifyCow', - 'offerCow', - 'plantInPlot', - 'prependPendingPeerMessage', - 'purchaseCombine', - 'purchaseComposter', - 'purchaseCow', - 'purchaseCowPen', - 'purchaseCellar', - 'purchaseField', - 'purchaseItem', - 'purchaseSmelter', - 'purchaseStorageExpansion', - 'removeCowFromInventory', - 'removeKegFromCellar', - 'removePeer', - 'selectCow', - 'sellCow', - 'sellItem', - 'sellKeg', - 'setScarecrow', - 'setSprinkler', - 'showNotification', - 'updatePeer', - 'upgradeTool', - 'waterAllPlots', - 'waterField', - 'waterPlot', - 'withdrawCow', - ].forEach(reducerName => { - const reducer = reducers[reducerName] - - if (process.env.NODE_ENV === 'development') { - if (typeof reducer === 'undefined') { - throw new Error( - `Reducer ${reducerName} is not exported from reducers/index.js` - ) - } - } - - this[reducerName] = (...args) => { - this.setState(state => reducer(state, ...args)) - } + waterAllPlots: () => this.waterAllPlots(), }) } @@ -678,7 +652,7 @@ export default class Farmhand extends Component { if (isOnline !== prevState.isOnline || room !== prevState.room) { this.syncToRoom().catch(errorCode => this.handleRoomSyncError(errorCode)) - if (!isOnline) { + if (!isOnline && typeof heartbeatTimeoutId === 'number') { clearTimeout(heartbeatTimeoutId) this.setState({ activePlayers: null, @@ -733,18 +707,30 @@ export default class Farmhand extends Component { const [sendPeerMetadata, getPeerMetadata] = peerRoom.makeAction( 'peerMetadata' ) - getPeerMetadata((...args) => handlePeerMetadataRequest(this, ...args)) + getPeerMetadata(( + /** @type {[object, string]} */ + ...args + ) => handlePeerMetadataRequest(this, ...args)) const [sendCowTradeRequest, getCowTradeRequest] = peerRoom.makeAction( 'cowTrade' ) - getCowTradeRequest((...args) => handleCowTradeRequest(this, ...args)) + getCowTradeRequest(( + /** @type {[object, string]} */ + ...args + ) => handleCowTradeRequest(this, ...args)) const [sendCowAccept, getCowAccept] = peerRoom.makeAction('cowAccept') - getCowAccept((...args) => handleCowTradeRequestAccept(this, ...args)) + getCowAccept(( + /** @type {[object, string]} */ + ...args + ) => handleCowTradeRequestAccept(this, ...args)) const [sendCowReject, getCowReject] = peerRoom.makeAction('cowReject') - getCowReject((...args) => handleCowTradeRequestReject(this, ...args)) + getCowReject(( + /** @type {[object]} */ + ...args + ) => handleCowTradeRequestReject(this, ...args)) this.setState({ getCowAccept, @@ -799,64 +785,61 @@ export default class Farmhand extends Component { * @param {farmhand.cow} peerPlayerCow */ tradeForPeerCow(peerPlayerCow) { - this.setState( - state => { - const { - cowIdOfferedForTrade, - cowInventory, - peers, - sendCowTradeRequest, - } = state + this.setState(state => { + const { + cowIdOfferedForTrade, + cowInventory, + peers, + sendCowTradeRequest, + } = state - if (!sendCowTradeRequest) return null + if (!sendCowTradeRequest) return null - const { ownerId } = peerPlayerCow + const { ownerId } = peerPlayerCow - const [peerId] = - Object.entries(peers).find(([, peer]) => peer?.id === ownerId) ?? [] + const [peerId] = + Object.entries(peers).find(([, peer]) => peer?.id === ownerId) ?? [] - if (!peerId) { - console.error( - `Owner not found for cow ${JSON.stringify(peerPlayerCow)}` - ) - return null - } - - const playerAlreadyOwnsRequestedCow = cowInventory.find( - ({ id }) => id === peerPlayerCow.id + if (!peerId) { + console.error( + `Owner not found for cow ${JSON.stringify(peerPlayerCow)}` ) + return null + } - if (playerAlreadyOwnsRequestedCow) { - console.error(`Cow ID ${peerPlayerCow.id} is already in inventory`) - return reducers.showNotification(state, COW_ALREADY_OWNED, 'error') - } + const playerAlreadyOwnsRequestedCow = cowInventory.find( + ({ id }) => id === peerPlayerCow.id + ) - const cowToTradeAway = cowInventory.find( - ({ id }) => id === cowIdOfferedForTrade - ) + if (playerAlreadyOwnsRequestedCow) { + console.error(`Cow ID ${peerPlayerCow.id} is already in inventory`) + return reducers.showNotification(state, COW_ALREADY_OWNED, 'error') + } - if (!cowToTradeAway) { - console.error(`Cow ID ${cowIdOfferedForTrade} not found`) - return null - } + const cowToTradeAway = cowInventory.find( + ({ id }) => id === cowIdOfferedForTrade + ) - const cowTradeTimeoutId = setTimeout( - this.handleCowTradeTimeout, - COW_TRADE_TIMEOUT - ) + if (!cowToTradeAway) { + console.error(`Cow ID ${cowIdOfferedForTrade} not found`) + return null + } - sendCowTradeRequest( - { - cowOffered: { ...cowToTradeAway, isUsingHuggingMachine: false }, - cowRequested: peerPlayerCow, - }, - peerId - ) + const cowTradeTimeoutId = setTimeout( + this.handleCowTradeTimeout, + COW_TRADE_TIMEOUT + ) - return { cowTradeTimeoutId, isAwaitingCowTradeRequest: true } - }, - () => {} - ) + sendCowTradeRequest( + { + cowOffered: { ...cowToTradeAway, isUsingHuggingMachine: false }, + cowRequested: peerPlayerCow, + }, + peerId + ) + + return { cowTradeTimeoutId, isAwaitingCowTradeRequest: true } + }, noop) } handleCowTradeTimeout = () => { @@ -928,13 +911,15 @@ export default class Farmhand extends Component { this.showNotification(CONNECTED_TO_ROOM`${room}`, 'success') } catch (e) { + const message = e instanceof Error ? e.message : 'Unexpected error' + // TODO: Add some reasonable fallback behavior in case the server request // fails. Possibility: Regenerate valueAdjustments and notify the user // they are offline. - if (SERVER_ERRORS[e.message]) { + if (SERVER_ERRORS[message]) { // Bubble up the errorCode to be handled by game logic - throw e.message + throw message } this.showNotification(SERVER_ERROR, 'error') @@ -954,7 +939,7 @@ export default class Farmhand extends Component { switch (errorCode) { case SERVER_ERRORS.ROOM_FULL: const roomNameChunks = room.split('-') - const roomNumber = parseInt(roomNameChunks.slice(-1)) // May be NaN + const roomNumber = parseInt(roomNameChunks.slice(-1)[0]) // May be NaN const nextRoomNumber = isNaN(roomNumber) ? 2 : roomNumber + 1 const roomBaseName = roomNameChunks .slice(0, isNaN(roomNumber) ? undefined : -1) @@ -978,7 +963,7 @@ export default class Farmhand extends Component { scheduleHeartbeat() { const { heartbeatTimeoutId, id, room } = this.state - clearTimeout(heartbeatTimeoutId) + clearTimeout(heartbeatTimeoutId ?? -1) this.setState(() => ({ heartbeatTimeoutId: setTimeout(async () => { @@ -1016,9 +1001,11 @@ export default class Farmhand extends Component { peerRoom, })) } catch (e) { - if (SERVER_ERRORS[e.message]) { + const message = e instanceof Error ? e.message : 'Unexpected error' + + if (SERVER_ERRORS[message]) { // Bubble up the errorCode to be handled by game logic - throw e.message + throw message } this.showNotification(SERVER_ERROR, 'error') @@ -1033,7 +1020,7 @@ export default class Farmhand extends Component { })) } - /*! + /** * @param {farmhand.state} prevState */ showInventoryFullNotifications(prevState) { @@ -1160,8 +1147,11 @@ export default class Farmhand extends Component { // shown to the player when the app reloads. newDayNotifications: pendingNotifications, }) - ;[] - .concat(pendingNotifications) + + /** @type {farmhand.notification[]} */ + const notifications = [...pendingNotifications] + + notifications .concat( isFirstDay ? [] @@ -1208,7 +1198,7 @@ export default class Farmhand extends Component { } focusNextView() { - if (document.activeElement.getAttribute('role') === 'tab') return + if (document.activeElement?.getAttribute('role') === 'tab') return const { viewList } = this @@ -1220,7 +1210,7 @@ export default class Farmhand extends Component { } focusPreviousView() { - if (document.activeElement.getAttribute('role') === 'tab') return + if (document.activeElement?.getAttribute('role') === 'tab') return const { viewList } = this @@ -1358,6 +1348,8 @@ export default class Farmhand extends Component { position="static" activeStep={viewList.indexOf(this.state.stageFocus)} className="" + backButton={null} + nextButton={null} />
key !== 'constructor') + + for (const reducerName of reducerNames) { + const reducer = reducers[reducerName] + + if ( + process.env.NODE_ENV === 'development' && + typeof reducer === 'undefined' + ) { + throw new Error( + `Reducer ${reducerName} is not exported from reducers/index.js` + ) + } + + // Bind the reducer to this class instance + this[reducerName] = (/** @type any[] */ ...args) => { + this.setState((/** @type {farmhand.state} */ state) => + reducer(state, ...args) + ) + } + } + } +} diff --git a/src/components/Field/Field.test.js b/src/components/Field/Field.test.js index b84060422..fdfd1ce8f 100644 --- a/src/components/Field/Field.test.js +++ b/src/components/Field/Field.test.js @@ -5,6 +5,7 @@ import { fieldMode } from '../../enums' import { testItem } from '../../test-utils' import { INFINITE_STORAGE_LIMIT } from '../../constants' +import { noop } from '../../utils/noop' import { Field, FieldContent, isInHoverRange, MemoPlot } from './Field' @@ -22,8 +23,8 @@ beforeEach(() => { {...{ columns: 0, hoveredPlotRangeSize: 0, - handleCombineEnabledChange: () => {}, - handleFieldActionRangeChange: () => {}, + handleCombineEnabledChange: noop, + handleFieldActionRangeChange: noop, itemsSold: {}, rows: 0, field: [ @@ -48,7 +49,7 @@ describe('field rendering', () => { {}, + handleCombineEnabledChange: noop, field: [ [null, null], [null, null], @@ -61,7 +62,7 @@ describe('field rendering', () => { itemsSold: {}, purchasedCombine: 0, rows: 0, - setHoveredPlot: () => {}, + setHoveredPlot: noop, }} /> ) diff --git a/src/components/Item/Item.js b/src/components/Item/Item.js index 3d5886d9e..b133cb165 100644 --- a/src/components/Item/Item.js +++ b/src/components/Item/Item.js @@ -15,6 +15,7 @@ import FarmhandContext from '../Farmhand/Farmhand.context' import { items } from '../../img' import { itemsMap } from '../../data/maps' import { itemIds as shopItemIds } from '../../data/shop-inventory' +import { noop } from '../../utils/noop' import { moneyString } from '../../utils/moneyString' import { inventorySpaceRemaining, @@ -31,8 +32,6 @@ import AnimatedNumber from '../AnimatedNumber' import './Item.sass' -const noop = () => {} - const ValueIndicator = ({ poorValue }) => ( { currentDialogView: dialogView.NONE, dayCount: 0, farmName: '', - handleActivePlayerButtonClick: () => {}, - handleClickDialogViewButton: () => {}, - handleCloseDialogView: () => {}, - handleDialogViewExited: () => {}, - handleFarmNameUpdate: () => {}, - handleOnlineToggleChange: () => {}, - handleRoomChange: () => {}, - handleViewChange: () => {}, + handleActivePlayerButtonClick: noop, + handleClickDialogViewButton: noop, + handleCloseDialogView: noop, + handleDialogViewExited: noop, + handleFarmNameUpdate: noop, + handleOnlineToggleChange: noop, + handleRoomChange: noop, + handleViewChange: noop, inventory: [], inventoryLimit: INFINITE_STORAGE_LIMIT, itemsSold: {}, diff --git a/src/components/Plot/Plot.rtl.test.js b/src/components/Plot/Plot.rtl.test.js index bc9fba1a0..2ce9b384f 100644 --- a/src/components/Plot/Plot.rtl.test.js +++ b/src/components/Plot/Plot.rtl.test.js @@ -5,7 +5,7 @@ import userEvent from '@testing-library/user-event' import { cropLifeStage } from '../../enums' import { testCrop, testShoveledPlot } from '../../test-utils' import { getCropFromItemId, getPlotContentFromItemId } from '../../utils' - +import { noop } from '../../utils/noop' import { items } from '../../img' import { Plot } from './Plot' @@ -19,10 +19,10 @@ describe('class states', () => { render( {}, + handlePlotClick: noop, isInHoverRange: false, selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, x: 0, y: 0, }} @@ -44,10 +44,10 @@ describe('plot label', () => { render( {}, + handlePlotClick: noop, isInHoverRange: false, selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, plotContent: getCropFromItemId('carrot'), x: 0, y: 0, @@ -63,10 +63,10 @@ describe('plot label', () => { render( {}, + handlePlotClick: noop, isInHoverRange: false, selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, plotContent: getCropFromItemId('grape-chardonnay'), x: 0, y: 0, @@ -82,10 +82,10 @@ describe('plot label', () => { render( {}, + handlePlotClick: noop, isInHoverRange: false, selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, plotContent: { ...getCropFromItemId('carrot'), daysOld: 9, @@ -108,14 +108,14 @@ describe('background image', () => { render( {}, + handlePlotClick: noop, isInHoverRange: false, lifeStage: cropLifeStage.GROWN, plotContent: testCrop({ itemId: 'sample-crop-1', }), selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, x: 0, y: 0, }} @@ -159,7 +159,7 @@ describe('background image', () => { plotProps: { isInHoverRange: false, selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, x: 0, y: 0, }, @@ -194,13 +194,13 @@ describe('background image', () => { render( {}, + handlePlotClick: noop, isInHoverRange: false, plotContent: { ...getPlotContentFromItemId('scarecrow'), }, selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, x: 0, y: 0, }} @@ -219,13 +219,13 @@ describe('background image', () => { render( {}, + handlePlotClick: noop, isInHoverRange: false, plotContent: { ...getPlotContentFromItemId('sprinkler'), }, selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, x: 0, y: 0, }} diff --git a/src/components/Plot/Plot.test.js b/src/components/Plot/Plot.test.js index d3eb2a45c..e7d8ba34e 100644 --- a/src/components/Plot/Plot.test.js +++ b/src/components/Plot/Plot.test.js @@ -2,6 +2,7 @@ import React from 'react' import { shallow } from 'enzyme' import { getPlotContentFromItemId } from '../../utils' +import { noop } from '../../utils/noop' import { testCrop } from '../../test-utils' import { pixel, plotStates } from '../../img' import { cropLifeStage, fertilizerType } from '../../enums' @@ -21,11 +22,11 @@ beforeEach(() => { component = shallow( {}, + handlePlotClick: noop, isInHoverRange: false, lifeStage: cropLifeStage.SEED, selectedItemId: '', - setHoveredPlot: () => {}, + setHoveredPlot: noop, x: 0, y: 0, }} diff --git a/src/components/QuantityInput/QuantityInput.test.js b/src/components/QuantityInput/QuantityInput.test.js index 0506d87a4..e38431d5c 100644 --- a/src/components/QuantityInput/QuantityInput.test.js +++ b/src/components/QuantityInput/QuantityInput.test.js @@ -1,6 +1,8 @@ import React from 'react' import { shallow } from 'enzyme' +import { noop } from '../../utils/noop' + import QuantityInput from './QuantityInput' let component @@ -9,10 +11,10 @@ beforeEach(() => { component = shallow( {}, - handleUpdateNumber: () => {}, + handleSubmit: noop, + handleUpdateNumber: noop, maxQuantity: 0, - setQuantity: () => {}, + setQuantity: noop, value: 0, }} /> diff --git a/src/components/QuickSelect/QuickSelect.test.js b/src/components/QuickSelect/QuickSelect.test.js index aa433788b..9c4bbce80 100644 --- a/src/components/QuickSelect/QuickSelect.test.js +++ b/src/components/QuickSelect/QuickSelect.test.js @@ -1,6 +1,8 @@ import React from 'react' import { shallow } from 'enzyme' +import { noop } from '../../utils/noop' + import QuickSelect from './QuickSelect' let component @@ -10,7 +12,7 @@ beforeEach(() => { {}, + handleItemSelectClick: noop, playerInventoryQuantities: {}, plantableCropInventory: [], selectedItemId: '', diff --git a/src/components/SettingsView/SettingsView.test.js b/src/components/SettingsView/SettingsView.test.js index 0fcf0daa1..576e28723 100644 --- a/src/components/SettingsView/SettingsView.test.js +++ b/src/components/SettingsView/SettingsView.test.js @@ -1,6 +1,8 @@ import React from 'react' import { shallow } from 'enzyme' +import { noop } from '../../utils/noop' + import SettingsView from './SettingsView' let component @@ -10,13 +12,13 @@ beforeEach(() => { {}, - handleExportDataClick: () => {}, - handleImportDataClick: () => {}, - handleSaveButtonClick: () => {}, - handleShowNotificationsChange: () => {}, - handleUseAlternateEndDayButtonPositionChange: () => {}, - handleShowHomeScreenChange: () => {}, + handleClearPersistedDataClick: noop, + handleExportDataClick: noop, + handleImportDataClick: noop, + handleSaveButtonClick: noop, + handleShowNotificationsChange: noop, + handleUseAlternateEndDayButtonPositionChange: noop, + handleShowHomeScreenChange: noop, showNotifications: true, useAlternateEndDayButtonPosition: false, showHomeScreen: false, diff --git a/src/components/Shop/Shop.test.js b/src/components/Shop/Shop.test.js index 436810a27..52450e97d 100644 --- a/src/components/Shop/Shop.test.js +++ b/src/components/Shop/Shop.test.js @@ -2,8 +2,8 @@ import React from 'react' import { shallow } from 'enzyme' import Inventory from '../Inventory' - import { INFINITE_STORAGE_LIMIT } from '../../constants' +import { noop } from '../../utils/noop' import { Shop } from './Shop' @@ -13,11 +13,11 @@ beforeEach(() => { component = shallow( {}, - handleCowPenPurchase: () => {}, - handleCellarPurchase: () => {}, - handleFieldPurchase: () => {}, - handleStorageExpansionPurchase: () => {}, + handleCombinePurchase: noop, + handleCowPenPurchase: noop, + handleCellarPurchase: noop, + handleFieldPurchase: noop, + handleStorageExpansionPurchase: noop, inventoryLimit: INFINITE_STORAGE_LIMIT, money: 0, purchasedCombine: 0, diff --git a/src/components/Toolbelt/Toolbelt.js b/src/components/Toolbelt/Toolbelt.js index 1b44fc6ef..a74ea4d9e 100644 --- a/src/components/Toolbelt/Toolbelt.js +++ b/src/components/Toolbelt/Toolbelt.js @@ -8,6 +8,7 @@ import Tooltip from '@material-ui/core/Tooltip' import { toolLevel } from '../../enums' import { memoize } from '../../utils/memoize' +import { noop } from '../../utils/noop' import FarmhandContext from '../Farmhand/Farmhand.context' import toolsData from '../../data/tools' @@ -15,8 +16,6 @@ import { tools as toolImages, craftedItems, pixel } from '../../img' import './Toolbelt.sass' -const noop = () => {} - const getTools = memoize(toolLevels => { const tools = [] diff --git a/src/game-logic/reducers/fertilizePlot.test.js b/src/game-logic/reducers/fertilizePlot.test.js index 2bf10c46b..793574ef4 100644 --- a/src/game-logic/reducers/fertilizePlot.test.js +++ b/src/game-logic/reducers/fertilizePlot.test.js @@ -118,8 +118,6 @@ describe('fertilizePlot', () => { describe('FERTILIZE field mode updating', () => { describe('multiple fertilizer units remaining', () => { - beforeEach(() => {}) - test('does not change fieldMode', () => { const state = fertilizePlot( { diff --git a/src/index.js b/src/index.js index bf4cf27cb..9d27ca489 100644 --- a/src/index.js +++ b/src/index.js @@ -182,7 +182,7 @@ * @typedef farmhand.notification * @type {Object} * @property {'error'|'info'|'success'|'warning'} severity - * @property {Function?} onClick + * @property {Function=} onClick * @property {string} message */ diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 6ab1b73d2..7b3a6e368 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -1,8 +1,16 @@ /// +import Farmhand from './components/Farmhand' + // TODO: Contribute type definitions for 'global' package to // https://github.com/DefinitelyTyped/DefinitelyTyped // @see https://github.com/jeremyckahn/farmhand/issues/399 declare module 'global/window' { export default window as Window } + +declare global { + interface Window { + farmhand?: typeof Farmhand + } +} diff --git a/src/utils/index.js b/src/utils/index.js index 72b6359cc..8fa17ebbb 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -760,14 +760,14 @@ export const sortItems = items => { export const inventorySpaceConsumed = memoize( /** - * @param {farmhand.item[]} inventory + * @param {farmhand.state['inventory']} inventory * @returns {number} */ inventory => inventory.reduce((sum, { quantity = 0 }) => sum + quantity, 0) ) /** - * @param {{ inventory: Array., inventoryLimit: number}} state + * @param {farmhand.state} state * @returns {number} */ export const inventorySpaceRemaining = ({ inventory, inventoryLimit }) => @@ -776,11 +776,11 @@ export const inventorySpaceRemaining = ({ inventory, inventoryLimit }) => : Math.max(0, inventoryLimit - inventorySpaceConsumed(inventory)) /** - * @param {{ inventory: Array., inventoryLimit: number}} state + * @param {farmhand.state} state * @returns {boolean} */ -export const doesInventorySpaceRemain = ({ inventory, inventoryLimit }) => - inventorySpaceRemaining({ inventory, inventoryLimit }) > 0 +export const doesInventorySpaceRemain = state => + inventorySpaceRemaining(state) > 0 /** * @param {Array.} inventory diff --git a/src/utils/noop.js b/src/utils/noop.js new file mode 100644 index 000000000..9f9f125dd --- /dev/null +++ b/src/utils/noop.js @@ -0,0 +1 @@ +export const noop = () => {} From dec631faa6af8f0535c0c70a514d69155a8c7c17 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 5 Aug 2023 20:05:57 +0000 Subject: [PATCH 8/8] 1.17.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 88004ddec..47faf8f5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jeremyckahn/farmhand", - "version": "1.17.2", + "version": "1.17.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@jeremyckahn/farmhand", - "version": "1.17.2", + "version": "1.17.3", "license": "GPL-2.0-or-later", "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.27", diff --git a/package.json b/package.json index 6a31b8872..a2f237889 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jeremyckahn/farmhand", - "version": "1.17.2", + "version": "1.17.3", "publishConfig": { "access": "public" },