diff --git a/.eslintrc.json b/.eslintrc.json index 0b5cb28..1ca6c98 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,4 +1,11 @@ { - "extends": ["@exabyte-io/eslint-config"] + "extends": ["@exabyte-io/eslint-config"], + "ignorePatterns": ["dist/"], + "settings": { + "import/resolver": { + "node": { + "extensions": [".js", ".jsx", ".ts", ".tsx"] + } + } + } } - diff --git a/package-lock.json b/package-lock.json index 3588efa..3292011 100644 --- a/package-lock.json +++ b/package-lock.json @@ -575,6 +575,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.18.6" } @@ -856,6 +857,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.18.6.tgz", "integrity": "sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.18.6" } @@ -864,6 +866,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.18.6.tgz", "integrity": "sha512-Mz7xMPxoy9kPS/JScj6fJs03TZ/fZ1dJPlMjRAgTaxaS0fUBk8FV/A2rRgfPsVCZqALNwMexD+0Uaf5zlcKPpw==", + "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-module-imports": "^7.18.6", @@ -876,6 +879,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.18.6.tgz", "integrity": "sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA==", + "dev": true, "requires": { "@babel/plugin-transform-react-jsx": "^7.18.6" } @@ -884,6 +888,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.18.6.tgz", "integrity": "sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==", + "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-plugin-utils": "^7.18.6" @@ -1068,6 +1073,7 @@ "version": "7.16.7", "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.16.7.tgz", "integrity": "sha512-fWpyI8UM/HE6DfPBzD8LnhQ/OcH8AgTaqcqP2nGOXEUV+VKBR5JRN9hCk9ai+zQQ57vtm9oWeXguBCPNUjytgA==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.16.7", "@babel/helper-validator-option": "^7.16.7", @@ -1081,6 +1087,7 @@ "version": "7.18.9", "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.18.9.tgz", "integrity": "sha512-ZlbnXDcNYHMR25ITwwNKT88JiaukkdVj/nG7r3wnuXkOTHc60Uy05PwMCPre0hSkY68E6zK3xz+vUJSP2jWmcw==", + "dev": true, "requires": { "clone-deep": "^4.0.1", "find-cache-dir": "^2.0.0", @@ -1119,6 +1126,7 @@ "version": "7.16.8", "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.16.8.tgz", "integrity": "sha512-3fKhuICS1lMz0plI5ktOE/yEtBRMVxplzRkdn6mJQ197XiY0JnrzYV0+Mxozq3JZ8SBV9Ecurmw1XsGbwOf+Sg==", + "dev": true, "requires": { "core-js-pure": "^3.20.2", "regenerator-runtime": "^0.13.4" @@ -1235,6 +1243,29 @@ } } }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, + "@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true + }, "@eslint/eslintrc": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", @@ -1342,8 +1373,8 @@ } }, "@exabyte-io/code.js": { - "version": "git+https://github.com/Exabyte-io/code.js.git#87c1ddfd731798de978e6c579efad44d5738ac6a", - "from": "git+https://github.com/Exabyte-io/code.js.git#87c1ddfd731798de978e6c579efad44d5738ac6a", + "version": "git+https://github.com/Exabyte-io/code.js.git#20d456ad83bd59b5a075bc499513fd076f46c6ce", + "from": "git+https://github.com/Exabyte-io/code.js.git#20d456ad83bd59b5a075bc499513fd076f46c6ce", "dev": true, "requires": { "@babel/cli": "7.16.0", @@ -1423,6 +1454,12 @@ "requires": { "lru-cache": "^6.0.0" } + }, + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true } } }, @@ -1433,61 +1470,44 @@ "dev": true }, "@exabyte-io/made.js": { - "version": "2022.6.15-0", - "resolved": "https://registry.npmjs.org/@exabyte-io/made.js/-/made.js-2022.6.15-0.tgz", - "integrity": "sha512-pAaexkSt2K0s/U8KKwlE11q++AMgeRqlLUaBehEUc7lCZ96tbmmqUEqM5o3O/BDVUO6vXbbgW52NupEo9txy1g==", + "version": "2024.1.8-0", + "resolved": "https://registry.npmjs.org/@exabyte-io/made.js/-/made.js-2024.1.8-0.tgz", + "integrity": "sha512-QvlwiwfhFfPeydG7Gvn5DWyVXBD0R1DgCFYKK3OOKhahGHFj5D81voWkeyY/oG9YE80N0bKpmoH350x1UUm4qA==", "dev": true, "requires": { - "@babel/cli": "^7.16.0", "@babel/core": "^7.16.0", - "@babel/eslint-parser": "^7.16.3", - "@babel/plugin-proposal-class-properties": "^7.16.0", - "@babel/preset-env": "^7.16.4", - "@babel/register": "^7.16.0", - "@exabyte-io/code.js": "2022.6.15-1", - "@exabyte-io/periodic-table.js": "2022.5.5-2", + "@exabyte-io/periodic-table.js": "2022.5.28-0", + "@types/chai": "^4.3.5", + "@types/mocha": "^10.0.1", + "@types/node": "^20.4.2", + "@types/underscore": "^1.11.6", + "@types/underscore.string": "^0.0.40", "array-almost-equal": "^1.0.0", "crypto-js": "^3.1.9-1", "lodash": "^4.17.4", "mathjs": "^3.9.0", - "mixwith": "^0.1.1", + "typescript": "^4.5.5", "underscore": "^1.8.3", "underscore.string": "^3.3.4" }, "dependencies": { - "@exabyte-io/code.js": { - "version": "2022.6.15-1", - "resolved": "https://registry.npmjs.org/@exabyte-io/code.js/-/code.js-2022.6.15-1.tgz", - "integrity": "sha512-Meugu4ogq+UOCvkjfpB5l3FyXKPI4AgFkuw1VUFGXaYsJ8KeYVOLFVkNQXlHNBS7KwlJftAMHBHPZyNAMMBc7g==", + "@babel/register": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.16.0.tgz", + "integrity": "sha512-lzl4yfs0zVXnooeLE0AAfYaT7F3SPA8yB2Bj4W1BiZwLbMS3MZH35ZvCWSRHvneUugwuM+Wsnrj7h0F7UmU3NQ==", "dev": true, "requires": { - "@babel/cli": "7.16.0", - "@babel/core": "7.16.0", - "@babel/eslint-parser": "7.16.3", - "@babel/plugin-proposal-class-properties": "7.16.0", - "@babel/preset-env": "7.16.4", - "@babel/preset-react": "7.16.7", - "@babel/register": "^7.16.0", - "@babel/runtime-corejs3": "7.16.8", - "crypto-js": "^4.1.1", - "lodash": "^4.17.21", - "mathjs": "^3.9.0", - "mixwith": "^0.1.1", - "underscore": "^1.13.3" - }, - "dependencies": { - "crypto-js": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", - "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==", - "dev": true - } + "clone-deep": "^4.0.1", + "find-cache-dir": "^2.0.0", + "make-dir": "^2.1.0", + "pirates": "^4.0.0", + "source-map-support": "^0.5.16" } }, "@exabyte-io/periodic-table.js": { - "version": "2022.5.5-2", - "resolved": "https://registry.npmjs.org/@exabyte-io/periodic-table.js/-/periodic-table.js-2022.5.5-2.tgz", - "integrity": "sha512-LhM3TygrhP1qAJHlfjDcpLHS1jFxapLIquB5a1BlgRgn7ew9V8Dvfde2NNT3gQoBL16TmXk4OiwX0ApbEGDnEA==", + "version": "2022.5.28-0", + "resolved": "https://registry.npmjs.org/@exabyte-io/periodic-table.js/-/periodic-table.js-2022.5.28-0.tgz", + "integrity": "sha512-BA+u07dkt4e8yqcBHTv5szXXeMyNFcW0G2Ki3Vbugv6ku6dfl4+Sji8cs5PUr+hkYptc7rTg5r89lfr6Vt+oJw==", "dev": true, "requires": { "@babel/cli": "7.16.0", @@ -1499,19 +1519,6 @@ "underscore": "1.8.3" }, "dependencies": { - "@babel/register": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.16.0.tgz", - "integrity": "sha512-lzl4yfs0zVXnooeLE0AAfYaT7F3SPA8yB2Bj4W1BiZwLbMS3MZH35ZvCWSRHvneUugwuM+Wsnrj7h0F7UmU3NQ==", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "find-cache-dir": "^2.0.0", - "make-dir": "^2.1.0", - "pirates": "^4.0.0", - "source-map-support": "^0.5.16" - } - }, "underscore": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", @@ -1519,6 +1526,12 @@ "dev": true } } + }, + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true } } }, @@ -1744,6 +1757,32 @@ "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", "optional": true }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -1771,8 +1810,7 @@ "@types/chai": { "version": "4.3.11", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.11.tgz", - "integrity": "sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==", - "dev": true + "integrity": "sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==" }, "@types/crypto-js": { "version": "4.2.2", @@ -1840,14 +1878,12 @@ "@types/mocha": { "version": "10.0.6", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", - "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", - "dev": true + "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==" }, "@types/node": { "version": "20.11.16", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", - "dev": true, "requires": { "undici-types": "~5.26.4" } @@ -1865,9 +1901,9 @@ "dev": true }, "@types/react": { - "version": "18.2.54", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.54.tgz", - "integrity": "sha512-039k+vrVJymDoe2y+HLk3O3oI3sa+C8KNjuDKofqrIJK26ramnqLNj9VJTaxAzFGMvpW/79HrrAJapHzpQ9fGQ==", + "version": "18.2.55", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz", + "integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==", "dev": true, "requires": { "@types/prop-types": "*", @@ -1891,12 +1927,171 @@ "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==", "dev": true }, + "@types/semver": { + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", + "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", + "dev": true + }, "@types/underscore": { "version": "1.11.15", "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.15.tgz", - "integrity": "sha512-HP38xE+GuWGlbSRq9WrZkousaQ7dragtZCruBVMi0oX1migFZavZ3OROKHSkNp/9ouq82zrWtZpg18jFnVN96g==", + "integrity": "sha512-HP38xE+GuWGlbSRq9WrZkousaQ7dragtZCruBVMi0oX1migFZavZ3OROKHSkNp/9ouq82zrWtZpg18jFnVN96g==" + }, + "@types/underscore.string": { + "version": "0.0.40", + "resolved": "https://registry.npmjs.org/@types/underscore.string/-/underscore.string-0.0.40.tgz", + "integrity": "sha512-6J3Wp6PnuXhSxVSVaSoh9SKiormScoa2pPLKpZk5QsjKD3RKQZQj/mwBVfULd2MUl5gM/UlLSvr+cynd/7VWQA==", + "requires": { + "@types/underscore": "*" + } + }, + "@typescript-eslint/eslint-plugin": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "dev": true, + "requires": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/types": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true }, + "@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "dependencies": { + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -2089,6 +2284,12 @@ "is-string": "^1.0.7" } }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "array.prototype.flat": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", @@ -2593,7 +2794,8 @@ "core-js-pure": { "version": "3.24.0", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.24.0.tgz", - "integrity": "sha512-uzMmW8cRh7uYw4JQtzqvGWRyC2T5+4zipQLQdi2FmiRqP83k3d6F3stv2iAlNhOs6cXN401FCD5TL0vvleuHgA==" + "integrity": "sha512-uzMmW8cRh7uYw4JQtzqvGWRyC2T5+4zipQLQdi2FmiRqP83k3d6F3stv2iAlNhOs6cXN401FCD5TL0vvleuHgA==", + "dev": true }, "create-require": { "version": "1.1.1", @@ -2705,14 +2907,15 @@ } }, "define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.2.tgz", + "integrity": "sha512-SRtsSqsDbgpJBbW3pABMCOt6rQyeM8s8RiyeSN8jYG8sYmt/kGJejbydttUsnDs1tadr19tvhT4ShwMyoqAm4g==", "dev": true, "requires": { - "get-intrinsic": "^1.2.1", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.2", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.1" }, "dependencies": { "function-bind": { @@ -2722,17 +2925,26 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.3.tgz", - "integrity": "sha512-JIcZczvcMVE7AUOP+X72bh8HqHBRxFdz5PDHYtNG/lE3yk9b3KZBJlwFcTyPYjg3L4RLLmZJzvjxhaZVapxFrQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "es-errors": "^1.0.0", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" } + }, + "has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.2" + } } } }, @@ -2751,6 +2963,15 @@ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -3497,6 +3718,19 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -3509,6 +3743,15 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "file": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/file/-/file-0.2.2.tgz", @@ -3729,6 +3972,34 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + } + } + }, "gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -3745,12 +4016,12 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.3.tgz", - "integrity": "sha512-JIcZczvcMVE7AUOP+X72bh8HqHBRxFdz5PDHYtNG/lE3yk9b3KZBJlwFcTyPYjg3L4RLLmZJzvjxhaZVapxFrQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "es-errors": "^1.0.0", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", @@ -3765,6 +4036,12 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -4414,14 +4691,15 @@ }, "dependencies": { "call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.6.tgz", + "integrity": "sha512-Mj50FLHtlsoVfRfnHaZvyrooHcrlceNZdL/QBvJJVd9Ta55qCQK0gs4ss2oZDeV9zFCs6ewzYgVE5yfVmfFpVg==", "dev": true, "requires": { + "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "get-intrinsic": "^1.2.3", + "set-function-length": "^1.2.0" } }, "function-bind": { @@ -4431,12 +4709,12 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.3.tgz", - "integrity": "sha512-JIcZczvcMVE7AUOP+X72bh8HqHBRxFdz5PDHYtNG/lE3yk9b3KZBJlwFcTyPYjg3L4RLLmZJzvjxhaZVapxFrQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "es-errors": "^1.0.0", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", @@ -4860,6 +5138,12 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, "micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -5105,6 +5389,12 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "next-tick": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", @@ -5562,6 +5852,12 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -5655,6 +5951,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -5835,6 +6137,12 @@ "signal-exit": "^3.0.2" } }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", @@ -5850,6 +6158,15 @@ "glob": "^7.1.3" } }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "rxjs": { "version": "7.5.6", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz", @@ -5891,14 +6208,15 @@ "dev": true }, "set-function-length": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz", - "integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", "dev": true, "requires": { - "define-data-property": "^1.1.1", + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.2", + "get-intrinsic": "^1.2.3", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.1" }, @@ -5910,12 +6228,12 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.3.tgz", - "integrity": "sha512-JIcZczvcMVE7AUOP+X72bh8HqHBRxFdz5PDHYtNG/lE3yk9b3KZBJlwFcTyPYjg3L4RLLmZJzvjxhaZVapxFrQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "es-errors": "^1.0.0", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", @@ -6388,6 +6706,23 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, "type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", @@ -6431,10 +6766,9 @@ } }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", - "dev": true + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==" }, "uglify-js": { "version": "2.4.24", @@ -6517,8 +6851,7 @@ "undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", diff --git a/package.json b/package.json index aafafc2..8e78012 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,12 @@ "version": "0.0.0", "description": "Application DEfinitions", "scripts": { + "prepublishOnly": "rm -rf lib; npm run transpile", + "transpile": "tsc", + "postinstall": "npm run transpile", "test": "nyc --reporter=text mocha --recursive --bail --require @babel/register/lib --require tests/setup.js tests", "lint": "eslint src tests && prettier --write src tests", "lint:fix": "eslint --fix --cache src tests && prettier --write src tests", - "transpile": "babel --out-dir dist src", - "postinstall": "npm run transpile", "prettier": "prettier --check src tests", "prepare": "husky install" }, @@ -16,11 +17,6 @@ "url": "https://github.com/Exabyte-io/ade.js.git" }, "main": "dist/index.js", - "files": [ - "/dist", - "/src", - ".babelrc" - ], "author": "Exabyte Inc.", "bugs": { "url": "https://github.com/Exabyte-io/ade.js/issues" @@ -30,24 +26,32 @@ "dependencies": { "@babel/cli": "7.16.0", "@babel/core": "7.16.0", - "@babel/eslint-parser": "7.16.3", - "@babel/plugin-proposal-class-properties": "7.16.0", - "@babel/preset-env": "7.16.4", - "@babel/preset-react": "7.16.7", - "@babel/register": "^7.16.0", - "@babel/runtime-corejs3": "7.16.8", "@exabyte-io/periodic-table.js": "2022.6.8-0", + "@types/chai": "^4.3.5", + "@types/mocha": "^10.0.1", + "@types/node": "^20.4.2", + "@types/underscore": "^1.11.6", + "@types/underscore.string": "^0.0.40", "lodash": "^4.17.21", "mixwith": "^0.1.1", "swig": "^1.4.2", + "typescript": "^5.3.3", "underscore": "^1.13.3", "underscore.string": "^3.3.4" }, "devDependencies": { - "@exabyte-io/code.js": "https://github.com/Exabyte-io/code.js.git#87c1ddfd731798de978e6c579efad44d5738ac6a", - "@exabyte-io/eslint-config": "^2022.11.17-0", - "@exabyte-io/made.js": "2022.6.15-0", + "@babel/eslint-parser": "7.16.3", + "@babel/plugin-proposal-class-properties": "7.16.0", + "@babel/preset-env": "7.16.4", + "@babel/preset-react": "7.16.7", + "@babel/register": "^7.16.0", + "@babel/runtime-corejs3": "7.16.8", "@exabyte-io/application-flavors.js": "2024.1.23-1", + "@exabyte-io/code.js": "https://github.com/Exabyte-io/code.js.git#20d456ad83bd59b5a075bc499513fd076f46c6ce", + "@exabyte-io/eslint-config": "^2022.11.17-0", + "@exabyte-io/made.js": "^2024.1.8-0", + "@typescript-eslint/eslint-plugin": "^5.9.1", + "@typescript-eslint/parser": "^5.9.1", "chai": "^4.3.4", "eslint": "7.32.0", "eslint-config-airbnb": "19.0.2", @@ -65,7 +69,7 @@ "prettier": "^2.7.1" }, "peerDependencies": { - "@exabyte-io/code.js": "https://github.com/Exabyte-io/code.js.git#87c1ddfd731798de978e6c579efad44d5738ac6a", + "@exabyte-io/code.js": "*", "@exabyte-io/made.js": "*", "@exabyte-io/application-flavors.js": "*" }, diff --git a/src/application.ts b/src/application.ts index b287613..3774be7 100644 --- a/src/application.ts +++ b/src/application.ts @@ -1,31 +1,28 @@ +// @ts-ignore import { allApplications, getAppData, getAppTree } from "@exabyte-io/application-flavors.js"; import { NamedDefaultableHashedInMemoryEntity } from "@exabyte-io/code.js/dist/entity"; +import { type Constructor } from "@exabyte-io/code.js/dist/context"; + import lodash from "lodash"; import { Executable } from "./executable"; import { getApplicationConfig, getExecutableConfig } from "./tree"; +import { ApplicationConfig, ApplicationData } from "./types"; -export type ApplicationConfig = { - name: string; - version?: string; - build?: string; -}; - -type ApplicationBaseEntity = InstanceType; - -export type ApplicationBaseEntityConstructor = new ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ...args: any[] -) => T; +type ApplicationBase = InstanceType; +// @ts-ignore export function ApplicationMixin< - T extends ApplicationBaseEntityConstructor = ApplicationBaseEntityConstructor, + T extends Constructor = Constructor >(superclass: T) { - return class extends superclass { + return class AdeApplication extends superclass { static Executable = Executable; - constructor(...config: any[]) { + constructor(...args: any[]) { + const config = args[0] as ApplicationConfig; + if (!config || typeof config.name !== "string") throw new Error("Invalid application configuration object."); const staticConfig = getApplicationConfig(config); + if (!staticConfig) throw new Error(`Application "${config.name} (${config.version}-${config.build})" is not supported.`); super({ ...staticConfig, ...config }); } @@ -40,12 +37,24 @@ export function ApplicationMixin< }; } - static create(config) { + static create(config: { + name: string, + version?: string, + build?: string + }) { return this.createFromNameVersionBuild(config); } - static createFromNameVersionBuild({ name, version = null, build = "Default" }: {name: string, version?: string | null, build?: string}) { - return new Application({ name, version, build }); + static createFromNameVersionBuild({ + name, + version = undefined, + build = "Default" + }: { + name: string, + version?: string, + build?: string + }) { + return new AdeApplication({ name, version, build }); } getExecutables() { @@ -53,7 +62,7 @@ export function ApplicationMixin< } getBuilds() { - const data = getAppData(this.prop("name")); + const data = getAppData(this.prop("name")) as ApplicationData; const { versions } = data; const builds = ["Default"]; versions.map((v) => v.build && builds.push(v.build)); @@ -61,7 +70,7 @@ export function ApplicationMixin< } getVersions() { - const data = getAppData(this.prop("name")); + const data = getAppData(this.prop("name")) as ApplicationData; const { versions } = data; const these: string[] = versions.map((v) => v.version); return lodash.uniq(these); @@ -71,8 +80,8 @@ export function ApplicationMixin< return allApplications; } - getExecutableByName(name: string | null = null) { - return new Application.Executable( + getExecutableByName(name?: string) { + return new AdeApplication.Executable( getExecutableConfig({ appName: this.prop("name"), execName: name, @@ -121,7 +130,7 @@ export function ApplicationMixin< ); }) .map((key) => { - return new Application.Executable({ ...tree[key], name: key }); + return new AdeApplication.Executable({ ...tree[key], name: key }); }); } @@ -140,8 +149,5 @@ export function ApplicationMixin< } } -export const Application = ApplicationMixin( - NamedDefaultableHashedInMemoryEntity, -); - +export const Application = ApplicationMixin(NamedDefaultableHashedInMemoryEntity); export type Application = InstanceType; diff --git a/src/context/providers.ts b/src/context/providers.ts index ed607e4..501c950 100644 --- a/src/context/providers.ts +++ b/src/context/providers.ts @@ -1,7 +1,8 @@ import { ContextProvider } from "@exabyte-io/code.js/dist/context"; +import { ContextProviderConfig } from "@exabyte-io/code.js/dist/context/provider"; export class ExecutableContextProvider extends ContextProvider { - constructor(config) { + constructor(config: ContextProviderConfig) { super({ ...config, domain: "executable", diff --git a/src/context/providers/nwchem/providers.js b/src/context/providers/nwchem/providers.js new file mode 100644 index 0000000..ecfb802 --- /dev/null +++ b/src/context/providers/nwchem/providers.js @@ -0,0 +1,80 @@ +import { + JobContextMixin, + MaterialContextMixin, + MethodDataContextMixin, + WorkflowContextMixin, +} from "@exabyte-io/code.js/dist/context"; +import { Made } from "@exabyte-io/made.js"; +import { PERIODIC_TABLE } from "@exabyte-io/periodic-table.js"; +import lodash from "lodash"; +import { mix } from "mixwith"; +import _ from "underscore"; +import s from "underscore.string"; + +import { ExecutableContextProvider } from "../../providers.ts"; + +export class NWChemTotalEnergyContextProvider extends mix(ExecutableContextProvider).with( + MaterialContextMixin, + MethodDataContextMixin, + WorkflowContextMixin, + JobContextMixin, +) { + static Material = Made.Material; + + get atomSymbols() { + return this.material.Basis.uniqueElements; + } + + get atomicPositionsWithoutConstraints() { + return this.material.Basis.atomicPositions; + } + + get atomicPositions() { + return this.material.Basis.atomicPositionsWithConstraints; + } + + get cartesianAtomicPositions() { + return this.material.toCartesian(); + } + + /* + * @NOTE: Overriding getData makes this provider "stateless", ie. delivering data from scratch each time and not + * considering the content of `this.data`, and `this.isEdited` field(s). + */ + getData() { + /* + TODO: Create ability for user to define CHARGE, MULT, BASIS and FUNCTIONAL parameters. + */ + const CHARGE = 0; + const MULT = 1; + const BASIS = "6-31G"; + const FUNCTIONAL = "B3LYP"; + + return { + CHARGE, + MULT, + BASIS, + NAT: this.atomicPositions.length, + NTYP: this.atomSymbols.length, + ATOMIC_POSITIONS: this.atomicPositions.join("\n"), + ATOMIC_POSITIONS_WITHOUT_CONSTRAINTS: this.atomicPositionsWithoutConstraints.join("\n"), + ATOMIC_SPECIES: this.ATOMIC_SPECIES, + FUNCTIONAL, + CARTESIAN: this.cartesianAtomicPositions, + }; + } + + get ATOMIC_SPECIES() { + return _.map(this.atomSymbols, (symbol) => { + return NWChemTotalEnergyContextProvider.symbolToAtomicSpecies(symbol); + }).join("\n"); + } + + static symbolToAtomicSpecies(symbol, pseudo) { + const el = PERIODIC_TABLE[symbol]; + const filename = pseudo + ? lodash.get(pseudo, "filename", s.strRightBack(pseudo.path, "/")) + : ""; + return el ? s.sprintf("%s %f %s", symbol, el.atomic_mass, filename) : undefined; + } +} diff --git a/src/context/providers/nwchem/providers.ts b/src/context/providers/nwchem/providers.ts deleted file mode 100644 index e5899d0..0000000 --- a/src/context/providers/nwchem/providers.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { - JobContextMixin, - MaterialContextMixin, - MethodDataContextMixin, - WorkflowContextMixin, -} from "@exabyte-io/code.js/dist/context"; -import { Made } from "@exabyte-io/made.js"; -import { PERIODIC_TABLE } from "@exabyte-io/periodic-table.js"; -import lodash from "lodash"; -import _ from "underscore"; -import s from "underscore.string"; - -import { ExecutableContextProvider } from "../../providers"; - -export function NWChemTotalEnergyContextProviderMixin {}>(superclass: T) { - const Base = JobContextMixin(WorkflowContextMixin(MethodDataContextMixin(MaterialContextMixin(superclass)))); - return class extends Base { - static Material = Made.Material; - - get atomSymbols() { - return this.material.Basis.uniqueElements; - } - - get atomicPositionsWithoutConstraints() { - return this.material.Basis.atomicPositions; - } - - get atomicPositions() { - return this.material.Basis.atomicPositionsWithConstraints; - } - - get cartesianAtomicPositions() { - return this.material.toCartesian(); - } - - /* - * @NOTE: Overriding getData makes this provider "stateless", ie. delivering data from scratch each time and not - * considering the content of `this.data`, and `this.isEdited` field(s). - */ - getData() { - /* - TODO: Create ability for user to define CHARGE, MULT, BASIS and FUNCTIONAL parameters. - */ - const CHARGE = 0; - const MULT = 1; - const BASIS = "6-31G"; - const FUNCTIONAL = "B3LYP"; - - return { - CHARGE, - MULT, - BASIS, - NAT: this.atomicPositions.length, - NTYP: this.atomSymbols.length, - ATOMIC_POSITIONS: this.atomicPositions.join("\n"), - ATOMIC_POSITIONS_WITHOUT_CONSTRAINTS: this.atomicPositionsWithoutConstraints.join("\n"), - ATOMIC_SPECIES: this.ATOMIC_SPECIES, - FUNCTIONAL, - CARTESIAN: this.cartesianAtomicPositions, - }; - } - - get ATOMIC_SPECIES() { - return _.map(this.atomSymbols, (symbol) => { - return NWChemTotalEnergyContextProvider.symbolToAtomicSpecies(symbol); - }).join("\n"); - } - - static symbolToAtomicSpecies(symbol, pseudo: { filename: string; path: string } | undefined = undefined) { - const el = PERIODIC_TABLE[symbol]; - const filename = pseudo - ? lodash.get(pseudo, "filename", s.strRightBack(pseudo.path, "/")) - : ""; - return el ? s.sprintf("%s %f %s", symbol, el.atomic_mass, filename) : undefined; - } - }; -} - -export const NWChemTotalEnergyContextProvider = NWChemTotalEnergyContextProviderMixin(ExecutableContextProvider); -export type NWChemTotalEnergyContextProvider = InstanceType; diff --git a/src/executable.ts b/src/executable.ts index 7129a63..e46bf0d 100644 --- a/src/executable.ts +++ b/src/executable.ts @@ -3,31 +3,32 @@ import { RuntimeItemsMixin, } from "@exabyte-io/code.js/dist/entity"; import { Flavor } from "./flavor"; +import { Constructor } from "@exabyte-io/code.js/dist/context"; +import { FlavorData } from "./types"; -const RuntimeItemsEntity = RuntimeItemsMixin(NamedDefaultableHashedInMemoryEntity); -type ExecutableBaseEntity = InstanceType; +const ExecutableBase = RuntimeItemsMixin(NamedDefaultableHashedInMemoryEntity); +type ExecutableBase = InstanceType; -export type ExecutableBaseEntityConstructor = new ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ...args: any[] -) => T; +export const Executable = ExecutableMixin(ExecutableBase); +export type Executable = InstanceType; export function ExecutableMixin< - T extends ExecutableBaseEntityConstructor = ExecutableBaseEntityConstructor, + T extends Constructor = Constructor, >(superclass: T) { - return class extends superclass { + return class AdeExecutable extends superclass { static Flavor = Flavor; + // @ts-ignore toJSON(exclude) { return super.toJSON(["flavors"].concat(exclude)); } get flavorsTree() { - return this.prop("flavors"); + return this.prop>("flavors"); } get flavors() { - return Object.keys(this.flavorsTree).map((key) => { + return Object.keys(this.flavorsTree).map((key: string) => { return AdeExecutable.Flavor.create({ ...this.flavorsTree[key], name: key, @@ -37,7 +38,7 @@ export function ExecutableMixin< } get flavorsFromTree() { - return Object.keys(this.flavorsTree).map((key) => { + return Object.keys(this.flavorsTree).map((key: string) => { return new AdeExecutable.Flavor({ ...this.flavorsTree[key], name: key }); }); } @@ -47,14 +48,14 @@ export function ExecutableMixin< } getFlavorByName(name?: string | null) { - return this.getEntityByName(this.flavors, "flavor", name) as Flavor; + return name ? this.getEntityByName(this.flavors, "flavor", name) as Flavor : undefined; } getFlavorByConfig(config?: {name: string}) { return config ? this.getFlavorByName(config.name) : this.defaultFlavor; } - getFlavorsByApplicationVersion(version) { + getFlavorsByApplicationVersion(version: string) { const filteredFlavors = this.flavors.filter((flavor) => { const supportedApplicationVersions = flavor.prop("supportedApplicationVersions"); return !supportedApplicationVersions || supportedApplicationVersions.includes(version); @@ -64,11 +65,3 @@ export function ExecutableMixin< } } } - -export const Executable = ExecutableMixin( - RuntimeItemsMixin( - NamedDefaultableHashedInMemoryEntity - ) -); - -export type Executable = InstanceType; diff --git a/src/flavor.ts b/src/flavor.ts index 6445826..7334216 100644 --- a/src/flavor.ts +++ b/src/flavor.ts @@ -4,22 +4,20 @@ import { } from "@exabyte-io/code.js/dist/entity"; import { Template } from "./template"; +import { Constructor } from "@exabyte-io/code.js/dist/context"; -const RuntimeItemsEntity = RuntimeItemsMixin(NamedDefaultableHashedInMemoryEntity); +const FlavorBase = RuntimeItemsMixin(NamedDefaultableHashedInMemoryEntity); +type FlavorBase = InstanceType; -type FlavorBaseEntity = InstanceType - -export type FlavorBaseEntityConstructor = new ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ...args: any[] -) => T; +export const Flavor = FlavorMixin(FlavorBase); +export type Flavor = InstanceType; type NamedTemplate = {name: string} | {templateName: string}; export function FlavorMixin< - T extends FlavorBaseEntityConstructor = FlavorBaseEntityConstructor, + T extends Constructor = Constructor, >(superclass: T) { - return class extends superclass { + return class AdeFlavor extends superclass { get input() { return this.prop("input", []); } @@ -39,7 +37,7 @@ export function FlavorMixin< }); } - getInputAsRenderedTemplates(context) { + getInputAsRenderedTemplates(context: object) { return this.inputAsTemplates.map((t) => t.getRenderedJSON(context)); } @@ -48,11 +46,3 @@ export function FlavorMixin< } } } - -export const Flavor = FlavorMixin( - RuntimeItemsMixin( - NamedDefaultableHashedInMemoryEntity - ) -); - -export type Flavor = InstanceType; diff --git a/src/index.ts b/src/index.ts index c1d3523..dd2ec5f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import { allowedMonitors, allowedResults, allTemplates, +// @ts-ignore } from "@exabyte-io/application-flavors.js"; import { Application } from "./application"; diff --git a/src/template.ts b/src/template.ts index 0f0d015..42c285c 100644 --- a/src/template.ts +++ b/src/template.ts @@ -1,3 +1,4 @@ +// @ts-ignore import { allTemplates } from "@exabyte-io/application-flavors.js"; import { HashedEntityMixin, @@ -5,27 +6,24 @@ import { NamedInMemoryEntity, } from "@exabyte-io/code.js/dist/entity"; import { deepClone } from "@exabyte-io/code.js/dist/utils"; +// @ts-ignore import jinja from "swig"; import _ from "underscore"; import { ContextProviderRegistry } from "./context/registry"; -import { ContextProvider } from "@exabyte-io/code.js/dist/context"; +import { Constructor, ContextProvider } from "@exabyte-io/code.js/dist/context"; +import { TemplateData } from "./types"; -// create entity instances to extract type -const HashedEntity = HashedEntityMixin(NamedInMemoryEntity); -const HashedInputArrayEntity = HashedInputArrayMixin(HashedEntity); +const TemplateBase = HashedInputArrayMixin(HashedEntityMixin(NamedInMemoryEntity)); +type TemplateBase = InstanceType; -type TemplateBaseEntity = InstanceType; - -export type TemplateBaseEntityConstructor = new ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ...args: any[] -) => T; +export const Template = TemplateMixin(TemplateBase); +export type Template = InstanceType; export function TemplateMixin< - T extends TemplateBaseEntityConstructor = TemplateBaseEntityConstructor, + T extends Constructor = Constructor, >(superclass: T) { - return class extends superclass { + return class AdeTemplate extends superclass { static providerRegistry = ContextProviderRegistry; get isManuallyChanged() { @@ -36,7 +34,7 @@ export function TemplateMixin< return this.prop("content"); } - setContent(text) { + setContent(text: string) { return this.setProp("content", text); } @@ -44,7 +42,7 @@ export function TemplateMixin< return this.prop("rendered") || this.content; } - setRendered(text) { + setRendered(text: string) { return this.setProp("rendered", text); } @@ -64,7 +62,7 @@ export function TemplateMixin< this.setProp("contextProviders", this.contextProviders.push(provider)); } - removeContextProvider(provider) { + removeContextProvider(provider: ContextProvider) { this.setProp( "contextProviders", this.contextProviders.filter( @@ -73,7 +71,7 @@ export function TemplateMixin< ); } - render(externalContext) { + render(externalContext: object) { const renderingContext = this.getRenderingContext(externalContext); let template, rendered; if (!this.isManuallyChanged) { @@ -88,7 +86,7 @@ export function TemplateMixin< } } - getRenderedJSON(context) { + getRenderedJSON(context: object) { this.render(context); return this.toJSON(); } @@ -96,14 +94,14 @@ export function TemplateMixin< // Remove "bulky" items and JSON stringify before passing it to rendering engine (eg. jinja) to compile. // This way the context should still be passed in full to contextProviders, but not to final text template. // eslint-disable-next-line class-methods-use-this - _cleanRenderingContext(object) { + _cleanRenderingContext(object: { [key: string]: any }) { const { job, ...clone } = object; return deepClone(clone); } static fromFlavor(appName: string, execName: string, inputName: string): Template { const filtered = allTemplates.filter( - (temp) => + (temp: TemplateData) => temp.applicationName === appName && temp.executableName === execName && temp.name === inputName, @@ -142,7 +140,9 @@ export function TemplateMixin< const context = contextProvider.yieldDataForRendering(); Object.keys(context).forEach((key) => { // merge context keys if they are objects otherwise override them. + // @ts-ignore result[key] = _.isObject(result[key]) + // @ts-ignore ? { ...result[key], ...context[key] } : context[key]; }); @@ -176,13 +176,3 @@ export function TemplateMixin< } } } - -export const Template = TemplateMixin( - HashedEntityMixin( - HashedInputArrayMixin( - NamedInMemoryEntity - ), - ) -); - -export type Template = InstanceType; diff --git a/src/tree.ts b/src/tree.ts index e4c4b1d..f11672a 100644 --- a/src/tree.ts +++ b/src/tree.ts @@ -1,24 +1,25 @@ -/* eslint-disable new-cap */ +// @ts-ignore import { allApplications, getAppData, getAppTree } from "@exabyte-io/application-flavors.js"; import { getOneMatchFromObject } from "@exabyte-io/code.js/dist/utils"; -import type { ApplicationConfig } from "@exabyte-io/application-flavors.js"; +import { AppTree, ApplicationArray, ApplicationConfig, ApplicationData, ApplicationTree, ExecutableData, VersionData } from "./types"; /** * @summary Return all applications as both a nested object of Applications and an array of config objects - * @param cls {*} optional class to use to create applications - * @returns {Object} containing applications and applicationConfigs + * @param cls optional class to use to create applications + * @returns containing applications and applicationConfigs */ export function getAllApplications(cls: InstanceType | null) { - const applicationsTree = {}; - const applicationsArray = []; - allApplications.forEach((appName) => { - applicationsTree[appName] = {}; - const { versions, defaultVersion, build = "Default", ...appData } = getAppData(appName); + const applicationsTree: ApplicationTree = {}; + const applicationsArray: ApplicationArray = []; + allApplications.forEach((appName: string) => { + // applicationsTree[appName] = {}; + const { versions, defaultVersion, ...appData } = getAppData(appName) as ApplicationData; applicationsTree[appName].defaultVersion = defaultVersion; - versions.forEach((options) => { - const { version } = options; + versions.forEach(({ version, build, ...versionData }) => { + // add version to applicationsTree if it doesn't exist if (!(version in applicationsTree[appName])) applicationsTree[appName][version] = {}; - const config = { ...appData, build, ...options }; + // convert to class instance if cls is provided otherwise use the config + const config: ApplicationConfig = { ...appData, version, build, ...versionData }; if (cls) { applicationsTree[appName][version][build] = new cls(config); applicationsArray.push(new cls(config)); @@ -33,29 +34,60 @@ export function getAllApplications(cls: InstanceType | null) { /** * @summary Get an application from the constructed applications - * @param applicationsTree {Object} See getAllApplications applicationsTree object structure - * @param name {String} name of the application - * @param version {String|null} version of the application (optional, defaults to defaultVersion) - * @param build {String} the build to use (optional, defaults to Default) - * @return {*} an application + * @param applicationsTree See getAllApplications applicationsTree object structure + * @param name name of the application + * @param version version of the application (optional, defaults to defaultVersion) + * @param build the build to use (optional, defaults to Default) + * @return an application */ -export function getApplication({ applicationsTree, name, version = null, build = "Default" }: {applicationsTree: any, name: string, version: string | null, build: string}) { +export function getApplication({ + applicationsTree, + name, + version = undefined, + build = "Default" +}: { + applicationsTree: ApplicationTree, + name: string + version?: string + build?: string +}): ApplicationConfig | undefined { const app = applicationsTree[name]; + if (!app) { + console.log(`Application ${name} not found!`); + return undefined; + } const version_ = version || app.defaultVersion; - if (!app[version_]) console.log(`Version ${version_} not available for ${name} !`); - return app[version_]?.[build]; + const appData = app[version_][build]; + if (!appData) { + console.log(`Version ${version_} not available for ${name}!`); + return undefined; + } + return { + ...app, + ...appData, + version: appData.version, // Explicitly set version and build in case they are different in app and versionData + build: appData.build || build + }; } const { applicationsTree } = getAllApplications(null); /** * @summary Get pre-defined application config from an already generated applicationsTree of configs - * @param name - * @param version {String|null} - * @param build - * @returns {*} + * @param name name of the application + * @param version version of the application (optional, defaults to defaultVersion) + * @param build the build to use (optional, defaults to Default) + * @returns an application config */ -export function getApplicationConfig({ name, version = null, build = "Default" }: ApplicationConfig) { +export function getApplicationConfig({ + name, + version = undefined, + build = "Default" +}: { + name: string, + version?: string, + build?: string +}) { return getApplication({ applicationsTree, name, @@ -66,26 +98,22 @@ export function getApplicationConfig({ name, version = null, build = "Default" } /** * @summary Get executable config - * @param appName {String} name of application to get executable for - * @param execName {String|null} if not provided, find the executable with isDefault === true - * @returns {*} + * @param appName name of application to get executable for + * @param execName if not provided, find the executable with isDefault === true + * @returns an executable config */ -export function getExecutableConfig({ appName, execName }: { appName: string, execName: string | null }) { - const appTree = getAppTree(appName); +export function getExecutableConfig({ appName, execName = undefined }: { appName: string, execName: string | undefined }): ExecutableData | undefined { + const appTree: AppTree = getAppTree(appName); Object.entries(appTree).forEach(([name, exec]) => { exec.name = name; }); - if (!execName) return getOneMatchFromObject(appTree, "isDefault", true); + if (!execName) { + console.log("No executable name provided, using default executable"); + return getOneMatchFromObject(appTree, "isDefault", true) as ExecutableData | undefined; + } + if (!appTree[execName]) { + console.log(`Executable ${execName} not found for application ${appName}`); + return undefined; + } return appTree[execName]; } - -/** - * @summary Get flavor config - * @param appName - * @param execName - * @param flavorName - */ -// eslint-disable-next-line no-unused-vars -export function getFlavorConfig({ appName, execName, flavorName }) { - // TODO : reduce redundancy of object construction in getting flavors from executable -} diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..3441269 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,56 @@ +// TODO: remove these types once application-flavors is moved to TypeScript +export type VersionData = { + version: string; + build: string; + hasAdvancedComputeOptions: boolean; + isDefault: boolean; +} + +export type ApplicationData = { + name: string; + shortName: string; + summary: string; + defaultVersion: string; + versions: VersionData[]; +} + +export type ApplicationTree = Record>>; + +export type ApplicationConfig = Omit & VersionData; + +export type ApplicationArray = ApplicationConfig[]; + +export type AppTree = { + [applicationName: string]: ExecutableData; +} + +export type ExecutableData = { + name?: string; + isDefault: boolean; + hasAdvancedComputeOptions?: boolean; + results: string[]; + monitors?: string[]; + preProcessors?: string[]; + postProcessors?: string[]; + flavors: {[flavorName: string]: FlavorData}; +} + +export type FlavorData = { + isDefault: boolean; + monitors?: string[]; + results?: string[]; + preProcessors?: string[]; + postProcessors?: string[]; + input: TemplateData[]; + applicationName: string; + executableName: string; +} + +export type TemplateData = { + name: string; + templateName: string; + applicationName?: string; + executableName?: string; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..238a552 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "target": "ES2018", + "jsx": "react", + "lib": ["ES2019", "dom"], + "allowJs": true, + "module": "commonjs", + "moduleResolution": "Node", + "declaration": true, + "outDir": "./dist", + "noEmitOnError": false, + "isolatedModules": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "types": ["mocha", "node"], + "rootDir": "./src", + "baseUrl": "./" + }, + "include": [ + "./src" + ], + "exclude": [ + "node_modules", + "dist" + ], + "ts-node": { + "files": true, + "compilerOptions": {} + }, + }