From 2484c63d77e05fff384cc08b6ea46a29a22a62ec Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 5 Oct 2021 16:46:55 +0200 Subject: chore: repo maintenance (#732) --- .eslintignore | 2 - .eslintrc | 23 - .eslintrc.js | 15 + package.json | 13 +- pnpm-lock.yaml | 793 +++++++++++++------------------ recipes/NewsBlur/webview.js | 3 +- recipes/basecamp/webview.js | 25 +- recipes/box/webview.js | 3 +- recipes/devRant/index.js | 3 +- recipes/devdocs/webview.js | 3 +- recipes/easy-redmine/webview.js | 3 +- recipes/feedbin/webview.js | 5 +- recipes/figma/webview.js | 3 +- recipes/franz-custom-website/index.js | 11 +- recipes/franz-custom-website/webview.js | 4 +- recipes/google-voice/webview.js | 15 +- recipes/googlecalendar/webview-unsafe.js | 13 +- recipes/iCloud/webview.js | 3 +- recipes/icloud-reminders/webview.js | 3 +- recipes/keybase.io/webview.js | 3 +- recipes/line-me/webview.js | 3 +- recipes/mastodon/index.js | 4 +- recipes/mastodon/webview.js | 8 +- recipes/messenger/webview.js | 37 +- recipes/misskey/index.js | 54 ++- recipes/misskey/webview.js | 6 +- recipes/netatmo-energy/webview.js | 3 +- recipes/odoo/webview.js | 9 +- recipes/paymo/webview.js | 3 +- recipes/pinterest/webview.js | 3 +- recipes/plan/webview.js | 3 +- recipes/pleroma/webview.js | 42 +- recipes/pushbullet/index.js | 36 +- recipes/reddit/webview.js | 18 +- recipes/redditchat/webview.js | 1 + recipes/snapdrop/webview.js | 2 +- recipes/tawk/webview.js | 3 +- recipes/teamweek/webview.js | 2 +- recipes/toggl/webview.js | 3 +- recipes/tweetdeck/index.js | 36 +- recipes/zimbra/index.js | 11 +- scripts/create.js | 13 +- scripts/package.js | 221 ++++++--- 43 files changed, 727 insertions(+), 740 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc create mode 100644 .eslintrc.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 6532945..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -/docs/ -/scripts/ diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 5e9153b..0000000 --- a/.eslintrc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "root": true, - "parser": "babel-eslint", - "rules": { - "consistent-return": 0, - "no-param-reassign": 0, - "import/extensions": 0, - "import/no-extraneous-dependencies": 0, - "import/prefer-default-export": 0, - "linebreak-style": 0, - "prefer-destructuring": 1, - "no-underscore-dangle": 0, - "max-len": 0, - "class-methods-use-this": 0, - "no-console": 0, - "no-restricted-syntax": [0, "ForInStatement"] - }, - "globals": { - "window": true, - "document": true, - "ENV": true - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..d9be6f9 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + root: true, + parserOptions: { + ecmaVersion: 12, + sourceType: 'module', + }, + env: { + browser: true, + es2021: true, + node: true, + jquery: true, + }, + extends: ['eslint:recommended'], + rules: {}, +}; diff --git a/package.json b/package.json index 7f3c0af..60d8e2f 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "prepare": "npx husky install", "package": "node scripts/package.js", "create": "node scripts/create.js", - "lint": "eslint --quiet --fix recipes", + "lint": "eslint . --fix", "reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,json,scss}\"" }, "repository": { @@ -27,14 +27,13 @@ "homepage": "https://github.com/getferdi/recipes#readme", "devDependencies": { "@types/targz": "1.0.1", - "babel-eslint": "10.0.3", - "eslint": "5.10.0", + "eslint": "7.32.0", "fs-extra": "10.0.0", - "husky": "7.0.1", + "husky": "7.0.2", "image-size": "1.0.0", - "open": "8.2.0", - "prettier": "2.3.2", - "simple-git": "2.39.0", + "open": "8.2.1", + "prettier": "2.4.1", + "simple-git": "2.46.0", "targz": "1.0.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2aca6a2..8ceb3a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,78 +2,36 @@ lockfileVersion: 5.3 specifiers: '@types/targz': 1.0.1 - babel-eslint: 10.0.3 - eslint: 5.10.0 + eslint: 7.32.0 fs-extra: 10.0.0 - husky: 7.0.1 + husky: 7.0.2 image-size: 1.0.0 - open: 8.2.0 - prettier: 2.3.2 - simple-git: 2.39.0 + open: 8.2.1 + prettier: 2.4.1 + simple-git: 2.46.0 targz: 1.0.1 devDependencies: '@types/targz': 1.0.1 - babel-eslint: 10.0.3_eslint@5.10.0 - eslint: 5.10.0 + eslint: 7.32.0 fs-extra: 10.0.0 - husky: 7.0.1 + husky: 7.0.2 image-size: 1.0.0 - open: 8.2.0 - prettier: 2.3.2 - simple-git: 2.39.0 + open: 8.2.1 + prettier: 2.4.1 + simple-git: 2.46.0 targz: 1.0.1 packages: - /@babel/code-frame/7.14.5: - resolution: {integrity: sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==} - engines: {node: '>=6.9.0'} + /@babel/code-frame/7.12.11: + resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} dependencies: '@babel/highlight': 7.14.5 dev: true - /@babel/generator/7.15.0: - resolution: {integrity: sha512-eKl4XdMrbpYvuB505KTta4AV9g+wWzmVBW69tX0H2NwKVKd2YJbKgyK6M8j/rgLbmHOYJn6rUklV677nOyJrEQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.15.0 - jsesc: 2.5.2 - source-map: 0.5.7 - dev: true - - /@babel/helper-function-name/7.14.5: - resolution: {integrity: sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-get-function-arity': 7.14.5 - '@babel/template': 7.14.5 - '@babel/types': 7.15.0 - dev: true - - /@babel/helper-get-function-arity/7.14.5: - resolution: {integrity: sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.15.0 - dev: true - - /@babel/helper-hoist-variables/7.14.5: - resolution: {integrity: sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.15.0 - dev: true - - /@babel/helper-split-export-declaration/7.14.5: - resolution: {integrity: sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.15.0 - dev: true - - /@babel/helper-validator-identifier/7.14.9: - resolution: {integrity: sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==} + /@babel/helper-validator-identifier/7.15.7: + resolution: {integrity: sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==} engines: {node: '>=6.9.0'} dev: true @@ -81,49 +39,41 @@ packages: resolution: {integrity: sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.14.9 + '@babel/helper-validator-identifier': 7.15.7 chalk: 2.4.2 js-tokens: 4.0.0 dev: true - /@babel/parser/7.15.0: - resolution: {integrity: sha512-0v7oNOjr6YT9Z2RAOTv4T9aP+ubfx4Q/OhVtAet7PFDt0t9Oy6Jn+/rfC6b8HJ5zEqrQCiMxJfgtHpmIminmJQ==} - engines: {node: '>=6.0.0'} - hasBin: true - dev: true - - /@babel/template/7.14.5: - resolution: {integrity: sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==} - engines: {node: '>=6.9.0'} + /@eslint/eslintrc/0.4.3: + resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} + engines: {node: ^10.12.0 || >=12.0.0} dependencies: - '@babel/code-frame': 7.14.5 - '@babel/parser': 7.15.0 - '@babel/types': 7.15.0 + ajv: 6.12.6 + debug: 4.3.2 + espree: 7.3.1 + globals: 13.11.0 + ignore: 4.0.6 + import-fresh: 3.3.0 + js-yaml: 3.14.1 + minimatch: 3.0.4 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color dev: true - /@babel/traverse/7.15.0: - resolution: {integrity: sha512-392d8BN0C9eVxVWd8H6x9WfipgVH5IaIoLp23334Sc1vbKKWINnvwRpb4us0xtPaCumlwbTtIYNA0Dv/32sVFw==} - engines: {node: '>=6.9.0'} + /@humanwhocodes/config-array/0.5.0: + resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} + engines: {node: '>=10.10.0'} dependencies: - '@babel/code-frame': 7.14.5 - '@babel/generator': 7.15.0 - '@babel/helper-function-name': 7.14.5 - '@babel/helper-hoist-variables': 7.14.5 - '@babel/helper-split-export-declaration': 7.14.5 - '@babel/parser': 7.15.0 - '@babel/types': 7.15.0 + '@humanwhocodes/object-schema': 1.2.0 debug: 4.3.2 - globals: 11.12.0 + minimatch: 3.0.4 transitivePeerDependencies: - supports-color dev: true - /@babel/types/7.15.0: - resolution: {integrity: sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.14.9 - to-fast-properties: 2.0.0 + /@humanwhocodes/object-schema/1.2.0: + resolution: {integrity: sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==} dev: true /@kwsites/file-exists/1.1.1: @@ -161,16 +111,16 @@ packages: '@types/tar-fs': 2.0.1 dev: true - /acorn-jsx/5.3.2_acorn@6.4.2: + /acorn-jsx/5.3.2_acorn@7.4.1: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 6.4.2 + acorn: 7.4.1 dev: true - /acorn/6.4.2: - resolution: {integrity: sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==} + /acorn/7.4.1: + resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -184,19 +134,23 @@ packages: uri-js: 4.4.1 dev: true - /ansi-escapes/3.2.0: - resolution: {integrity: sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==} - engines: {node: '>=4'} + /ajv/8.6.3: + resolution: {integrity: sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 dev: true - /ansi-regex/3.0.0: - resolution: {integrity: sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=} - engines: {node: '>=4'} + /ansi-colors/4.1.1: + resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} + engines: {node: '>=6'} dev: true - /ansi-regex/4.1.0: - resolution: {integrity: sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==} - engines: {node: '>=6'} + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} dev: true /ansi-styles/3.2.1: @@ -206,33 +160,22 @@ packages: color-convert: 1.9.3 dev: true + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + /argparse/1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 dev: true - /astral-regex/1.0.0: - resolution: {integrity: sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==} - engines: {node: '>=4'} - dev: true - - /babel-eslint/10.0.3_eslint@5.10.0: - resolution: {integrity: sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA==} - engines: {node: '>=6'} - deprecated: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates. - peerDependencies: - eslint: '>= 4.12.1' - dependencies: - '@babel/code-frame': 7.14.5 - '@babel/parser': 7.15.0 - '@babel/traverse': 7.15.0 - '@babel/types': 7.15.0 - eslint: 5.10.0 - eslint-visitor-keys: 1.3.0 - resolve: 1.20.0 - transitivePeerDependencies: - - supports-color + /astral-regex/2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} dev: true /balanced-match/1.0.2: @@ -268,16 +211,9 @@ packages: resolution: {integrity: sha1-+PeLdniYiO858gXNY39o5wISKyw=} dev: true - /caller-path/0.1.0: - resolution: {integrity: sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=} - engines: {node: '>=0.10.0'} - dependencies: - callsites: 0.2.0 - dev: true - - /callsites/0.2.0: - resolution: {integrity: sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=} - engines: {node: '>=0.10.0'} + /callsites/3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} dev: true /chalk/2.4.2: @@ -289,40 +225,39 @@ packages: supports-color: 5.5.0 dev: true - /chardet/0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + /chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 dev: true /chownr/1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} dev: true - /circular-json/0.3.3: - resolution: {integrity: sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==} - deprecated: CircularJSON is in maintenance only, flatted is its successor. - dev: true - - /cli-cursor/2.1.0: - resolution: {integrity: sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=} - engines: {node: '>=4'} - dependencies: - restore-cursor: 2.0.0 - dev: true - - /cli-width/2.2.1: - resolution: {integrity: sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==} - dev: true - /color-convert/1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: color-name: 1.1.3 dev: true + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + /color-name/1.1.3: resolution: {integrity: sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=} dev: true + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} dev: true @@ -331,15 +266,13 @@ packages: resolution: {integrity: sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=} dev: true - /cross-spawn/6.0.5: - resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} - engines: {node: '>=4.8'} + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} dependencies: - nice-try: 1.0.5 - path-key: 2.0.1 - semver: 5.7.1 - shebang-command: 1.2.0 - which: 1.3.1 + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 dev: true /debug/4.3.2: @@ -363,15 +296,15 @@ packages: engines: {node: '>=8'} dev: true - /doctrine/2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} + /doctrine/3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} dependencies: esutils: 2.0.3 dev: true - /emoji-regex/7.0.3: - resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true /end-of-stream/1.4.4: @@ -380,21 +313,33 @@ packages: once: 1.4.0 dev: true + /enquirer/2.3.6: + resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} + engines: {node: '>=8.6'} + dependencies: + ansi-colors: 4.1.1 + dev: true + /escape-string-regexp/1.0.5: resolution: {integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=} engines: {node: '>=0.8.0'} dev: true - /eslint-scope/4.0.3: - resolution: {integrity: sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==} - engines: {node: '>=4.0.0'} + /escape-string-regexp/4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: true + + /eslint-scope/5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} dependencies: esrecurse: 4.3.0 estraverse: 4.3.0 dev: true - /eslint-utils/1.4.3: - resolution: {integrity: sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==} + /eslint-utils/2.1.0: + resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} engines: {node: '>=6'} dependencies: eslint-visitor-keys: 1.3.0 @@ -405,58 +350,66 @@ packages: engines: {node: '>=4'} dev: true - /eslint/5.10.0: - resolution: {integrity: sha512-HpqzC+BHULKlnPwWae9MaVZ5AXJKpkxCVXQHrFaRw3hbDj26V/9ArYM4Rr/SQ8pi6qUPLXSSXC4RBJlyq2Z2OQ==} - engines: {node: ^6.14.0 || ^8.10.0 || >=9.10.0} + /eslint-visitor-keys/2.1.0: + resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} + engines: {node: '>=10'} + dev: true + + /eslint/7.32.0: + resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} + engines: {node: ^10.12.0 || >=12.0.0} hasBin: true dependencies: - '@babel/code-frame': 7.14.5 + '@babel/code-frame': 7.12.11 + '@eslint/eslintrc': 0.4.3 + '@humanwhocodes/config-array': 0.5.0 ajv: 6.12.6 - chalk: 2.4.2 - cross-spawn: 6.0.5 + chalk: 4.1.2 + cross-spawn: 7.0.3 debug: 4.3.2 - doctrine: 2.1.0 - eslint-scope: 4.0.3 - eslint-utils: 1.4.3 - eslint-visitor-keys: 1.3.0 - espree: 5.0.1 + doctrine: 3.0.0 + enquirer: 2.3.6 + escape-string-regexp: 4.0.0 + eslint-scope: 5.1.1 + eslint-utils: 2.1.0 + eslint-visitor-keys: 2.1.0 + espree: 7.3.1 esquery: 1.4.0 esutils: 2.0.3 - file-entry-cache: 2.0.0 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 functional-red-black-tree: 1.0.1 - glob: 7.1.7 - globals: 11.12.0 + glob-parent: 5.1.2 + globals: 13.11.0 ignore: 4.0.6 + import-fresh: 3.3.0 imurmurhash: 0.1.4 - inquirer: 6.5.2 + is-glob: 4.0.3 js-yaml: 3.14.1 json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.3.0 - lodash: 4.17.21 + levn: 0.4.1 + lodash.merge: 4.6.2 minimatch: 3.0.4 - mkdirp: 0.5.5 natural-compare: 1.4.0 - optionator: 0.8.3 - path-is-inside: 1.0.2 - pluralize: 7.0.0 + optionator: 0.9.1 progress: 2.0.3 - regexpp: 2.0.1 - require-uncached: 1.0.3 - semver: 5.7.1 - strip-ansi: 4.0.0 - strip-json-comments: 2.0.1 - table: 5.4.6 + regexpp: 3.2.0 + semver: 7.3.5 + strip-ansi: 6.0.1 + strip-json-comments: 3.1.1 + table: 6.7.2 text-table: 0.2.0 + v8-compile-cache: 2.3.0 transitivePeerDependencies: - supports-color dev: true - /espree/5.0.1: - resolution: {integrity: sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==} - engines: {node: '>=6.0.0'} + /espree/7.3.1: + resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==} + engines: {node: ^10.12.0 || >=12.0.0} dependencies: - acorn: 6.4.2 - acorn-jsx: 5.3.2_acorn@6.4.2 + acorn: 7.4.1 + acorn-jsx: 5.3.2_acorn@7.4.1 eslint-visitor-keys: 1.3.0 dev: true @@ -495,15 +448,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /external-editor/3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - dev: true - /fast-deep-equal/3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -516,29 +460,23 @@ packages: resolution: {integrity: sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=} dev: true - /figures/2.0.0: - resolution: {integrity: sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=} - engines: {node: '>=4'} + /file-entry-cache/6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} dependencies: - escape-string-regexp: 1.0.5 + flat-cache: 3.0.4 dev: true - /file-entry-cache/2.0.0: - resolution: {integrity: sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=} - engines: {node: '>=0.10.0'} + /flat-cache/3.0.4: + resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} + engines: {node: ^10.12.0 || >=12.0.0} dependencies: - flat-cache: 1.3.4 - object-assign: 4.1.1 + flatted: 3.2.2 + rimraf: 3.0.2 dev: true - /flat-cache/1.3.4: - resolution: {integrity: sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==} - engines: {node: '>=0.10.0'} - dependencies: - circular-json: 0.3.3 - graceful-fs: 4.2.8 - rimraf: 2.6.3 - write: 0.2.1 + /flatted/3.2.2: + resolution: {integrity: sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==} dev: true /fs-constants/1.0.0: @@ -558,14 +496,17 @@ packages: resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} dev: true - /function-bind/1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true - /functional-red-black-tree/1.0.1: resolution: {integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=} dev: true + /glob-parent/5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + /glob/7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} dependencies: @@ -577,9 +518,11 @@ packages: path-is-absolute: 1.0.1 dev: true - /globals/11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} + /globals/13.11.0: + resolution: {integrity: sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 dev: true /graceful-fs/4.2.8: @@ -591,26 +534,17 @@ packages: engines: {node: '>=4'} dev: true - /has/1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} - dependencies: - function-bind: 1.1.1 + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} dev: true - /husky/7.0.1: - resolution: {integrity: sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA==} + /husky/7.0.2: + resolution: {integrity: sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==} engines: {node: '>=12'} hasBin: true dev: true - /iconv-lite/0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - dependencies: - safer-buffer: 2.1.2 - dev: true - /ignore/4.0.6: resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} engines: {node: '>= 4'} @@ -624,6 +558,14 @@ packages: queue: 6.0.2 dev: true + /import-fresh/3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + /imurmurhash/0.1.4: resolution: {integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o=} engines: {node: '>=0.8.19'} @@ -640,40 +582,27 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true - /inquirer/6.5.2: - resolution: {integrity: sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==} - engines: {node: '>=6.0.0'} - dependencies: - ansi-escapes: 3.2.0 - chalk: 2.4.2 - cli-cursor: 2.1.0 - cli-width: 2.2.1 - external-editor: 3.1.0 - figures: 2.0.0 - lodash: 4.17.21 - mute-stream: 0.0.7 - run-async: 2.4.1 - rxjs: 6.6.7 - string-width: 2.1.1 - strip-ansi: 5.2.0 - through: 2.3.8 + /is-docker/2.2.1: + resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} + engines: {node: '>=8'} + hasBin: true dev: true - /is-core-module/2.5.0: - resolution: {integrity: sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==} - dependencies: - has: 1.0.3 + /is-extglob/2.1.1: + resolution: {integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=} + engines: {node: '>=0.10.0'} dev: true - /is-docker/2.2.1: - resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - hasBin: true dev: true - /is-fullwidth-code-point/2.0.0: - resolution: {integrity: sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=} - engines: {node: '>=4'} + /is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 dev: true /is-wsl/2.2.0: @@ -703,16 +632,14 @@ packages: esprima: 4.0.1 dev: true - /jsesc/2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - dev: true - /json-schema-traverse/0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} dev: true + /json-schema-traverse/1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + dev: true + /json-stable-stringify-without-jsonify/1.0.1: resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=} dev: true @@ -725,21 +652,31 @@ packages: graceful-fs: 4.2.8 dev: true - /levn/0.3.0: - resolution: {integrity: sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=} + /levn/0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} dependencies: - prelude-ls: 1.1.2 - type-check: 0.3.2 + prelude-ls: 1.2.1 + type-check: 0.4.0 dev: true - /lodash/4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + /lodash.clonedeep/4.5.0: + resolution: {integrity: sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=} dev: true - /mimic-fn/1.2.0: - resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==} - engines: {node: '>=4'} + /lodash.merge/4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true + + /lodash.truncate/4.4.2: + resolution: {integrity: sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=} + dev: true + + /lru-cache/6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 dev: true /minimatch/3.0.4: @@ -763,38 +700,18 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - /mute-stream/0.0.7: - resolution: {integrity: sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=} - dev: true - /natural-compare/1.4.0: resolution: {integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=} dev: true - /nice-try/1.0.5: - resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} - dev: true - - /object-assign/4.1.1: - resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=} - engines: {node: '>=0.10.0'} - dev: true - /once/1.4.0: resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=} dependencies: wrappy: 1.0.2 dev: true - /onetime/2.0.1: - resolution: {integrity: sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=} - engines: {node: '>=4'} - dependencies: - mimic-fn: 1.2.0 - dev: true - - /open/8.2.0: - resolution: {integrity: sha512-O8uInONB4asyY3qUcEytpgwxQG3O0fJ/hlssoUHsBboOIRVZzT6Wq+Rwj5nffbeUhOdMjpXeISpDDzHCMRDuOQ==} + /open/8.2.1: + resolution: {integrity: sha512-rXILpcQlkF/QuFez2BJDf3GsqpjGKbkUUToAIGo9A0Q6ZkoSGogZJulrUdwRkrAsoQvoZsrjCYt8+zblOk7JQQ==} engines: {node: '>=12'} dependencies: define-lazy-prop: 2.0.0 @@ -802,21 +719,23 @@ packages: is-wsl: 2.2.0 dev: true - /optionator/0.8.3: - resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} + /optionator/0.9.1: + resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} engines: {node: '>= 0.8.0'} dependencies: deep-is: 0.1.3 fast-levenshtein: 2.0.6 - levn: 0.3.0 - prelude-ls: 1.1.2 - type-check: 0.3.2 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 word-wrap: 1.2.3 dev: true - /os-tmpdir/1.0.2: - resolution: {integrity: sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=} - engines: {node: '>=0.10.0'} + /parent-module/1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 dev: true /path-is-absolute/1.0.1: @@ -824,31 +743,18 @@ packages: engines: {node: '>=0.10.0'} dev: true - /path-is-inside/1.0.2: - resolution: {integrity: sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=} - dev: true - - /path-key/2.0.1: - resolution: {integrity: sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=} - engines: {node: '>=4'} - dev: true - - /path-parse/1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true - - /pluralize/7.0.0: - resolution: {integrity: sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==} - engines: {node: '>=4'} + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} dev: true - /prelude-ls/1.1.2: - resolution: {integrity: sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=} + /prelude-ls/1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} dev: true - /prettier/2.3.2: - resolution: {integrity: sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==} + /prettier/2.4.1: + resolution: {integrity: sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==} engines: {node: '>=10.13.0'} hasBin: true dev: true @@ -892,58 +798,28 @@ packages: util-deprecate: 1.0.2 dev: true - /regexpp/2.0.1: - resolution: {integrity: sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==} - engines: {node: '>=6.5.0'} - dev: true - - /require-uncached/1.0.3: - resolution: {integrity: sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=} - engines: {node: '>=0.10.0'} - dependencies: - caller-path: 0.1.0 - resolve-from: 1.0.1 + /regexpp/3.2.0: + resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} + engines: {node: '>=8'} dev: true - /resolve-from/1.0.1: - resolution: {integrity: sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=} + /require-from-string/2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} dev: true - /resolve/1.20.0: - resolution: {integrity: sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==} - dependencies: - is-core-module: 2.5.0 - path-parse: 1.0.7 - dev: true - - /restore-cursor/2.0.0: - resolution: {integrity: sha1-n37ih/gv0ybU/RYpI9YhKe7g368=} + /resolve-from/4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} - dependencies: - onetime: 2.0.1 - signal-exit: 3.0.3 dev: true - /rimraf/2.6.3: - resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} hasBin: true dependencies: glob: 7.1.7 dev: true - /run-async/2.4.1: - resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} - engines: {node: '>=0.12.0'} - dev: true - - /rxjs/6.6.7: - resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} - engines: {npm: '>=2.0.0'} - dependencies: - tslib: 1.14.1 - dev: true - /safe-buffer/5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: true @@ -952,33 +828,28 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true - /safer-buffer/2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: true - - /semver/5.7.1: - resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + /semver/7.3.5: + resolution: {integrity: sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==} + engines: {node: '>=10'} hasBin: true - dev: true - - /shebang-command/1.2.0: - resolution: {integrity: sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=} - engines: {node: '>=0.10.0'} dependencies: - shebang-regex: 1.0.0 + lru-cache: 6.0.0 dev: true - /shebang-regex/1.0.0: - resolution: {integrity: sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=} - engines: {node: '>=0.10.0'} + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 dev: true - /signal-exit/3.0.3: - resolution: {integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==} + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} dev: true - /simple-git/2.39.0: - resolution: {integrity: sha512-VOsrmc3fpp1lGVIpo+1SKNqJzrdVJeSGZCeenPKnJPNo5UouAlSkWFc037pfm9wRYtfxBdwp2deVJGCG8J6C8A==} + /simple-git/2.46.0: + resolution: {integrity: sha512-6eumII1vfP4NpRqxZcVWCcIT5xHH6dRyvBZSjkH4dJRDRpv+0f75hrN5ysp++y23Mfr3AbRC/dO2NDbfj1lJpQ==} dependencies: '@kwsites/file-exists': 1.1.1 '@kwsites/promise-deferred': 1.1.1 @@ -987,39 +858,26 @@ packages: - supports-color dev: true - /slice-ansi/2.1.0: - resolution: {integrity: sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==} - engines: {node: '>=6'} + /slice-ansi/4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} dependencies: - ansi-styles: 3.2.1 - astral-regex: 1.0.0 - is-fullwidth-code-point: 2.0.0 - dev: true - - /source-map/0.5.7: - resolution: {integrity: sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=} - engines: {node: '>=0.10.0'} + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 dev: true /sprintf-js/1.0.3: resolution: {integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=} dev: true - /string-width/2.1.1: - resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} - engines: {node: '>=4'} - dependencies: - is-fullwidth-code-point: 2.0.0 - strip-ansi: 4.0.0 - dev: true - - /string-width/3.1.0: - resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} - engines: {node: '>=6'} + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} dependencies: - emoji-regex: 7.0.3 - is-fullwidth-code-point: 2.0.0 - strip-ansi: 5.2.0 + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 dev: true /string_decoder/1.1.1: @@ -1028,23 +886,16 @@ packages: safe-buffer: 5.1.2 dev: true - /strip-ansi/4.0.0: - resolution: {integrity: sha1-qEeQIusaw2iocTibY1JixQXuNo8=} - engines: {node: '>=4'} - dependencies: - ansi-regex: 3.0.0 - dev: true - - /strip-ansi/5.2.0: - resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} - engines: {node: '>=6'} + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} dependencies: - ansi-regex: 4.1.0 + ansi-regex: 5.0.1 dev: true - /strip-json-comments/2.0.1: - resolution: {integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo=} - engines: {node: '>=0.10.0'} + /strip-json-comments/3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} dev: true /supports-color/5.5.0: @@ -1054,14 +905,23 @@ packages: has-flag: 3.0.0 dev: true - /table/5.4.6: - resolution: {integrity: sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==} - engines: {node: '>=6.0.0'} + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} dependencies: - ajv: 6.12.6 - lodash: 4.17.21 - slice-ansi: 2.1.0 - string-width: 3.1.0 + has-flag: 4.0.0 + dev: true + + /table/6.7.2: + resolution: {integrity: sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==} + engines: {node: '>=10.0.0'} + dependencies: + ajv: 8.6.3 + lodash.clonedeep: 4.5.0 + lodash.truncate: 4.4.2 + slice-ansi: 4.0.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 dev: true /tar-fs/1.16.3: @@ -1096,35 +956,20 @@ packages: resolution: {integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=} dev: true - /through/2.3.8: - resolution: {integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=} - dev: true - - /tmp/0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - dependencies: - os-tmpdir: 1.0.2 - dev: true - /to-buffer/1.1.1: resolution: {integrity: sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==} dev: true - /to-fast-properties/2.0.0: - resolution: {integrity: sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=} - engines: {node: '>=4'} - dev: true - - /tslib/1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - dev: true - - /type-check/0.3.2: - resolution: {integrity: sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=} + /type-check/0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} dependencies: - prelude-ls: 1.1.2 + prelude-ls: 1.2.1 + dev: true + + /type-fest/0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} dev: true /universalify/2.0.0: @@ -1142,8 +987,13 @@ packages: resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=} dev: true - /which/1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + /v8-compile-cache/2.3.0: + resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} + dev: true + + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} hasBin: true dependencies: isexe: 2.0.0 @@ -1158,14 +1008,11 @@ packages: resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=} dev: true - /write/0.2.1: - resolution: {integrity: sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=} - engines: {node: '>=0.10.0'} - dependencies: - mkdirp: 0.5.5 - dev: true - /xtend/4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} dev: true + + /yallist/4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true diff --git a/recipes/NewsBlur/webview.js b/recipes/NewsBlur/webview.js index 7e19dff..23607bd 100644 --- a/recipes/NewsBlur/webview.js +++ b/recipes/NewsBlur/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/basecamp/webview.js b/recipes/basecamp/webview.js index e7b7dde..16eced3 100644 --- a/recipes/basecamp/webview.js +++ b/recipes/basecamp/webview.js @@ -1,9 +1,10 @@ const _path = _interopRequireDefault(require('path')); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} -module.exports = (Ferdi) => { - let updates = 0; +module.exports = Ferdi => { const modal = document.createElement('div'); const waitFor = (condition, callback) => { @@ -16,13 +17,11 @@ module.exports = (Ferdi) => { function showModal(text) { show(modal); modal.querySelector('p').innerHTML = text; - updates += 1; } function hideModal() { hide(modal); modal.querySelector('p').innerHTML = ''; - updates -= 1; } // Replace window.alert to hide alerts in Ferdi @@ -41,11 +40,19 @@ module.exports = (Ferdi) => { } modal.id = 'franz-modal'; - modal.innerHTML = ''; + modal.innerHTML = + ''; modal.querySelector('.close').addEventListener('click', hideModal); - waitFor(() => document.body, () => document.body.appendChild(modal)); - - document.addEventListener('keydown', (e) => { if (e.keyCode === 27) { hideModal(); } }); + waitFor( + () => document.body, + () => document.body.appendChild(modal), + ); + + document.addEventListener('keydown', e => { + if (e.key === 'Escape') { + hideModal(); + } + }); Ferdi.injectCSS(_path.default.join(__dirname, 'css', 'modal.css')); }; diff --git a/recipes/box/webview.js b/recipes/box/webview.js index 7e19dff..23607bd 100644 --- a/recipes/box/webview.js +++ b/recipes/box/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/devRant/index.js b/recipes/devRant/index.js index 7e19dff..23607bd 100644 --- a/recipes/devRant/index.js +++ b/recipes/devRant/index.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/devdocs/webview.js b/recipes/devdocs/webview.js index 7e19dff..23607bd 100644 --- a/recipes/devdocs/webview.js +++ b/recipes/devdocs/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/easy-redmine/webview.js b/recipes/easy-redmine/webview.js index 7e19dff..23607bd 100644 --- a/recipes/easy-redmine/webview.js +++ b/recipes/easy-redmine/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/feedbin/webview.js b/recipes/feedbin/webview.js index 5c08892..197814e 100644 --- a/recipes/feedbin/webview.js +++ b/recipes/feedbin/webview.js @@ -1,8 +1,9 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { const getMessages = () => { + // eslint-disable-next-line no-undef const count = feedbin.count_data.unread_entries.length || 0; Ferdi.setBadge(count); - } + }; Ferdi.loop(getMessages); }; diff --git a/recipes/figma/webview.js b/recipes/figma/webview.js index 7e19dff..23607bd 100644 --- a/recipes/figma/webview.js +++ b/recipes/figma/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/franz-custom-website/index.js b/recipes/franz-custom-website/index.js index c0f91cb..6e4f228 100644 --- a/recipes/franz-custom-website/index.js +++ b/recipes/franz-custom-website/index.js @@ -1,5 +1,6 @@ -module.exports = Ferdi => class CustomWebsite extends Ferdi { - async validateUrl(url) { - return true; - } -}; +module.exports = Ferdi => + class CustomWebsite extends Ferdi { + async validateUrl() { + return true; + } + }; diff --git a/recipes/franz-custom-website/webview.js b/recipes/franz-custom-website/webview.js index ca6a9f7..9eec086 100644 --- a/recipes/franz-custom-website/webview.js +++ b/recipes/franz-custom-website/webview.js @@ -1,6 +1,8 @@ const _path = _interopRequireDefault(require('path')); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} module.exports = Ferdi => { Ferdi.injectCSS(_path.default.join(__dirname, 'style.css')); diff --git a/recipes/google-voice/webview.js b/recipes/google-voice/webview.js index 7cada87..eb3004d 100644 --- a/recipes/google-voice/webview.js +++ b/recipes/google-voice/webview.js @@ -9,16 +9,23 @@ module.exports = Ferdi => { let count; if (el) { + // eslint-disable-next-line no-useless-escape count = Ferdi.safeParseInt(el.innerHTML.replace(/[\(\) ]/gi, '')); } else { - const count_messages = parseQuery('gv-nav-tab[tooltip="Messages"] div[aria-label="Unread count"]'); - const count_calls = parseQuery('gv-nav-tab[tooltip="Calls"] div[aria-label="Unread count"]'); - const count_voicemails = parseQuery('gv-nav-tab[tooltip="Voicemail"] div[aria-label="Unread count"]'); + const count_messages = parseQuery( + 'gv-nav-tab[tooltip="Messages"] div[aria-label="Unread count"]', + ); + const count_calls = parseQuery( + 'gv-nav-tab[tooltip="Calls"] div[aria-label="Unread count"]', + ); + const count_voicemails = parseQuery( + 'gv-nav-tab[tooltip="Voicemail"] div[aria-label="Unread count"]', + ); count = count_messages + count_calls + count_voicemails; } Ferdi.setBadge(count); - } + }; Ferdi.loop(getMessages); }; diff --git a/recipes/googlecalendar/webview-unsafe.js b/recipes/googlecalendar/webview-unsafe.js index c47f572..54a7338 100644 --- a/recipes/googlecalendar/webview-unsafe.js +++ b/recipes/googlecalendar/webview-unsafe.js @@ -26,7 +26,8 @@ const hideModal = () => { const createModal = () => { const modalDialog = document.createElement('div'); modalDialog.setAttribute('id', 'franz-modal'); - modalDialog.innerHTML = ''; + modalDialog.innerHTML = + ''; modalDialog.querySelector('.close').addEventListener('click', hideModal); return modalDialog; @@ -35,5 +36,11 @@ const createModal = () => { window.alert = showModal; modal = createModal(); -waitFor(() => document.body, () => document.body.appendChild(modal)); -document.addEventListener('keydown', event => event.keyCode === 27 && hideModal()); +waitFor( + () => document.body, + () => document.body.appendChild(modal), +); +document.addEventListener( + 'keydown', + event => event.key === 'Escape' && hideModal(), +); diff --git a/recipes/iCloud/webview.js b/recipes/iCloud/webview.js index 7e19dff..23607bd 100644 --- a/recipes/iCloud/webview.js +++ b/recipes/iCloud/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/icloud-reminders/webview.js b/recipes/icloud-reminders/webview.js index 7e19dff..23607bd 100644 --- a/recipes/icloud-reminders/webview.js +++ b/recipes/icloud-reminders/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/keybase.io/webview.js b/recipes/keybase.io/webview.js index 7e19dff..23607bd 100644 --- a/recipes/keybase.io/webview.js +++ b/recipes/keybase.io/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/line-me/webview.js b/recipes/line-me/webview.js index 7e19dff..23607bd 100644 --- a/recipes/line-me/webview.js +++ b/recipes/line-me/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/mastodon/index.js b/recipes/mastodon/index.js index 1dd93cc..9be0938 100644 --- a/recipes/mastodon/index.js +++ b/recipes/mastodon/index.js @@ -1,9 +1,9 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { class Mastodon extends Ferdi { validateServer(URL) { const api = `${URL}`; return new Promise((resolve, reject) => { - $.get(api, (resp) => { + $.get(api, () => { resolve(); }).fail(reject); }); diff --git a/recipes/mastodon/webview.js b/recipes/mastodon/webview.js index 4b450a1..8fb448f 100644 --- a/recipes/mastodon/webview.js +++ b/recipes/mastodon/webview.js @@ -1,11 +1,11 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { let latestStatement = $('.status time').attr('datetime'); let latestNotify = $($('.notification__message span').get(0)).text(); - $($('div.column div.scrollable').get(0)).on('scroll', (ev) => { + $($('div.column div.scrollable').get(0)).on('scroll', () => { latestStatement = $('.status time').attr('datetime'); }); - $($('div.column div.scrollable').get(1)).on('scroll', (ev) => { + $($('div.column div.scrollable').get(1)).on('scroll', () => { latestNotify = $($('.notification__message span').get(0)).text(); }); @@ -22,7 +22,7 @@ module.exports = (Ferdi) => { } Ferdi.setBadge(reply, unread); - } + }; Ferdi.loop(getMessages); }; diff --git a/recipes/messenger/webview.js b/recipes/messenger/webview.js index 954f843..5b2f2ad 100644 --- a/recipes/messenger/webview.js +++ b/recipes/messenger/webview.js @@ -8,18 +8,23 @@ module.exports = Ferdi => { * Notification case for group chats, workaround by tamas646 * see https://github.com/getferdi/ferdi/issues/1113#issuecomment-783409154 */ - if (isNotification) { + if (isNotification) { count = Ferdi.safeParseInt(/^\((\d+)\)/.exec(document.title)[1]); } else { /* - * Notification case for direct messages, workaround by manavortex - * see https://github.com/getferdi/ferdi/issues/1113#issuecomment-846611765 - */ - count = document.querySelectorAll('._5fx8:not(._569x),._1ht3:not(._569x)').length; + * Notification case for direct messages, workaround by manavortex + * see https://github.com/getferdi/ferdi/issues/1113#issuecomment-846611765 + */ + count = document.querySelectorAll( + '._5fx8:not(._569x),._1ht3:not(._569x)', + ).length; if (count === 0) { - count = document.querySelectorAll('.pq6dq46d.is6700om.qu0x051f.esr5mh6w.e9989ue4.r7d6kgcz.s45kfl79.emlxlaya.bkmhp75w.spb7xbtv.cyypbtt7.fwizqjfa').length; + count = document.querySelectorAll( + '.pq6dq46d.is6700om.qu0x051f.esr5mh6w.e9989ue4.r7d6kgcz.s45kfl79.emlxlaya.bkmhp75w.spb7xbtv.cyypbtt7.fwizqjfa', + ).length; } - if (count === 0) { // might be obsolete, not sure - never ran into this case + if (count === 0) { + // might be obsolete, not sure - never ran into this case count = document.querySelectorAll('[aria-label="Mark as read"]').length; } } @@ -36,19 +41,25 @@ module.exports = Ferdi => { Ferdi.loop(getMessages); - localStorage.setItem('_cs_desktopNotifsEnabled', JSON.stringify({ - __t: new Date().getTime(), - __v: true, - })); + localStorage.setItem( + '_cs_desktopNotifsEnabled', + JSON.stringify({ + __t: new Date().getTime(), + __v: true, + }), + ); if (typeof Ferdi.onNotify === 'function') { Ferdi.onNotify(notification => { if (typeof notification.title !== 'string') { - notification.title = ((notification.title.props || {}).content || [])[0] || 'Messenger'; + notification.title = + ((notification.title.props || {}).content || [])[0] || 'Messenger'; } if (typeof notification.options.body !== 'string') { - notification.options.body = (((notification.options.body || {}).props || {}).content || [])[0] || ''; + notification.options.body = + (((notification.options.body || {}).props || {}).content || [])[0] || + ''; } return notification; diff --git a/recipes/misskey/index.js b/recipes/misskey/index.js index 3f51bf9..5805c37 100644 --- a/recipes/misskey/index.js +++ b/recipes/misskey/index.js @@ -1,28 +1,30 @@ -module.exports = Ferdi => class Misskey extends Ferdi { - constructor(...args) { - let _temp; - return _temp = super(...args), this.events = { - }, _temp; - } +module.exports = Ferdi => + class Misskey extends Ferdi { + constructor(...args) { + let _temp; + // eslint-disable-next-line constructor-super + return (_temp = super(...args)), (this.events = {}), _temp; + } - async validateUrl(url) { - try { - const res = await window.fetch(`${url}/api/stats`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }); - const data = await res.json(); - // check any field in API response - return [ - 'originalUsersCount', 'usersCount', 'notesCount', 'originalNotesCount' - ].reduce((r, key) => ( - r && Object.hasOwnProperty.call(data, 'uri') - ), true); - } catch (err) { - console.error(err); + async validateUrl(url) { + try { + const res = await window.fetch(`${url}/api/stats`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }); + const data = await res.json(); + // check any field in API response + return [ + 'originalUsersCount', + 'usersCount', + 'notesCount', + 'originalNotesCount', + ].reduce(r => r && Object.hasOwnProperty.call(data, 'uri'), true); + } catch (err) { + console.error(err); + } + return false; } - return false; - } -}; + }; diff --git a/recipes/misskey/webview.js b/recipes/misskey/webview.js index c174266..65fa237 100644 --- a/recipes/misskey/webview.js +++ b/recipes/misskey/webview.js @@ -1,7 +1,9 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { const getMessages = () => { // check notification badge for Ferdi badge - let hasNotification = !!document.querySelector('#app div.notifications > button > i.circle'); + let hasNotification = !!document.querySelector( + '#app div.notifications > button > i.circle', + ); Ferdi.setBadge(0, hasNotification ? 1 : 0); }; diff --git a/recipes/netatmo-energy/webview.js b/recipes/netatmo-energy/webview.js index 7e19dff..23607bd 100644 --- a/recipes/netatmo-energy/webview.js +++ b/recipes/netatmo-energy/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/odoo/webview.js b/recipes/odoo/webview.js index 8f02c8f..453b3fc 100644 --- a/recipes/odoo/webview.js +++ b/recipes/odoo/webview.js @@ -1,4 +1,9 @@ -module.exports = (Ferdi) => { +const _path = _interopRequireDefault(require('path')); - Ferdi.injectCSS(_path.default.join(__dirname, "service.css")); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +module.exports = Ferdi => { + Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); }; diff --git a/recipes/paymo/webview.js b/recipes/paymo/webview.js index 7e19dff..23607bd 100644 --- a/recipes/paymo/webview.js +++ b/recipes/paymo/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/pinterest/webview.js b/recipes/pinterest/webview.js index 7e19dff..23607bd 100644 --- a/recipes/pinterest/webview.js +++ b/recipes/pinterest/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/plan/webview.js b/recipes/plan/webview.js index 7e19dff..23607bd 100644 --- a/recipes/plan/webview.js +++ b/recipes/plan/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/pleroma/webview.js b/recipes/pleroma/webview.js index da76955..2ba184e 100644 --- a/recipes/pleroma/webview.js +++ b/recipes/pleroma/webview.js @@ -1,6 +1,6 @@ const titleRegex = /^\((\d+)\)/; -const getJson = async (relativeUri) => { +const getJson = async relativeUri => { const req = await window.fetch(`${window.origin}${relativeUri}`, { Accept: 'application/json', }); @@ -8,10 +8,11 @@ const getJson = async (relativeUri) => { }; const getInstanceConfig = async () => { - const origin = window.origin; const staticConfig = await getJson('/static/config.json'); try { - const frontendConfig = await getJson('/api/pleroma/frontend_configurations'); + const frontendConfig = await getJson( + '/api/pleroma/frontend_configurations', + ); const pleromaFeConfig = frontendConfig.pleroma_fe || {}; return { ...staticConfig, ...pleromaFeConfig }; } catch (e) { @@ -33,8 +34,12 @@ const getInstanceLogo = async () => { logoMask: config.logoMask, }); }); - img.addEventListener('error', (event) => { - reject(new Error(`${event.type} error loading ${config.logo}: ${event.message}`)); + img.addEventListener('error', event => { + reject( + new Error( + `${event.type} error loading ${config.logo}: ${event.message}`, + ), + ); }); img.src = `${origin}${config.logo}`; }); @@ -146,16 +151,19 @@ module.exports = Ferdi => { Ferdi.setBadge(directCount); }; - getInstanceLogo().then(({ logo, logoMask }) => { - const updater = new LogoUpdater(logo, logoMask); - Ferdi.loop(() => { - getMessages(); - if (updater.update()) { - Ferdi.setAvatarImage(updater.toDataURL()); - } - }); - }, (e) => { - console.log('Failed to load instance logo', e); - Ferdi.loop(getMessages); - }); + getInstanceLogo().then( + ({ logo, logoMask }) => { + const updater = new LogoUpdater(logo, logoMask); + Ferdi.loop(() => { + getMessages(); + if (updater.update()) { + Ferdi.setAvatarImage(updater.toDataURL()); + } + }); + }, + e => { + console.log('Failed to load instance logo', e); + Ferdi.loop(getMessages); + }, + ); }; diff --git a/recipes/pushbullet/index.js b/recipes/pushbullet/index.js index 556cab6..ace403b 100644 --- a/recipes/pushbullet/index.js +++ b/recipes/pushbullet/index.js @@ -1,16 +1,26 @@ -module.exports = Ferdi => class PushBullet extends Ferdi { - constructor(...args) { - let _temp; +module.exports = Ferdi => + class PushBullet extends Ferdi { + constructor(...args) { + let _temp; - return _temp = super(...args), this.events = { - 'did-get-redirect-request': '_redirectFix', - }, _temp; - } + return ( + // eslint-disable-next-line constructor-super + (_temp = super(...args)), + (this.events = { + 'did-get-redirect-request': '_redirectFix', + }), + _temp + ); + } - _redirectFix(event) { - if (event.newURL !== undefined && event.oldURL !== undefined && event.isMainFrame) { - setTimeout(() => this.send('redirect-url', event.newURL), 100); - event.preventDefault(); + _redirectFix(event) { + if ( + event.newURL !== undefined && + event.oldURL !== undefined && + event.isMainFrame + ) { + setTimeout(() => this.send('redirect-url', event.newURL), 100); + event.preventDefault(); + } } - } -}; + }; diff --git a/recipes/reddit/webview.js b/recipes/reddit/webview.js index 327bd89..5095ba1 100644 --- a/recipes/reddit/webview.js +++ b/recipes/reddit/webview.js @@ -1,10 +1,14 @@ const _path = _interopRequireDefault(require('path')); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} -module.exports = (Ferdi) => { +module.exports = Ferdi => { const getMessages = () => { - const elements = document.querySelectorAll('#HeaderUserActions--Messages > a > span'); + const elements = document.querySelectorAll( + '#HeaderUserActions--Messages > a > span', + ); let count = 0; if (elements[0]) { @@ -15,7 +19,7 @@ module.exports = (Ferdi) => { }; if (document.querySelectorAll('.promotedlink').length > 0) { - document.querySelectorAll('.promotedlink').forEach((sponsoredLink) => { + document.querySelectorAll('.promotedlink').forEach(sponsoredLink => { sponsoredLink.parentElement.parentElement.style.display = 'none'; }); } @@ -25,17 +29,17 @@ module.exports = (Ferdi) => { // Use CSS to hide Google Ads Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); - Ferdi.handleDarkMode((isEnabled, config) => { + Ferdi.handleDarkMode(isEnabled => { // Open dropdown menu if not already open const menu = document.querySelector('#USER_DROPDOWN_ID'); - if (menu.getAttribute('aria-expanded') === 'false') { + if (menu && menu.getAttribute('aria-expanded') === 'false') { menu.click(); } setTimeout(() => { // Check if service is already in right mode const btn = document.querySelector('[role=menu] button button'); - const checked = btn.getAttribute('aria-checked') === 'true'; + const checked = btn && btn.getAttribute('aria-checked') === 'true'; if ((checked && !isEnabled) || (!checked && isEnabled)) { // Click the button to switch between modes diff --git a/recipes/redditchat/webview.js b/recipes/redditchat/webview.js index 7000e53..14f7f6c 100644 --- a/recipes/redditchat/webview.js +++ b/recipes/redditchat/webview.js @@ -1,5 +1,6 @@ module.exports = Ferdi => { // Regular expression for (*) or (1), will extract the asterisk or the number + // eslint-disable-next-line no-useless-escape const titleRegEx = /^\(([\*\d])\)/; const getMessages = function unreadCount() { let directCount = 0; diff --git a/recipes/snapdrop/webview.js b/recipes/snapdrop/webview.js index 22ca24c..23607bd 100644 --- a/recipes/snapdrop/webview.js +++ b/recipes/snapdrop/webview.js @@ -1 +1 @@ -module.exports = (Ferdi) => {}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/tawk/webview.js b/recipes/tawk/webview.js index 7e19dff..23607bd 100644 --- a/recipes/tawk/webview.js +++ b/recipes/tawk/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/teamweek/webview.js b/recipes/teamweek/webview.js index 22ca24c..23607bd 100644 --- a/recipes/teamweek/webview.js +++ b/recipes/teamweek/webview.js @@ -1 +1 @@ -module.exports = (Ferdi) => {}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/toggl/webview.js b/recipes/toggl/webview.js index 7e19dff..23607bd 100644 --- a/recipes/toggl/webview.js +++ b/recipes/toggl/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/tweetdeck/index.js b/recipes/tweetdeck/index.js index 3dc2463..f54a64a 100644 --- a/recipes/tweetdeck/index.js +++ b/recipes/tweetdeck/index.js @@ -1,16 +1,26 @@ -module.exports = Ferdi => class Tweetdeck extends Ferdi { - constructor(...args) { - let _temp; +module.exports = Ferdi => + class Tweetdeck extends Ferdi { + constructor(...args) { + let _temp; - return _temp = super(...args), this.events = { - 'did-get-redirect-request': '_redirectFix', - }, _temp; - } + return ( + // eslint-disable-next-line constructor-super + (_temp = super(...args)), + (this.events = { + 'did-get-redirect-request': '_redirectFix', + }), + _temp + ); + } - _redirectFix(event) { - if (event.newURL !== undefined && event.oldURL !== undefined && event.isMainFrame) { - setTimeout(() => this.send('redirect-url', event.newURL), 100); - event.preventDefault(); + _redirectFix(event) { + if ( + event.newURL !== undefined && + event.oldURL !== undefined && + event.isMainFrame + ) { + setTimeout(() => this.send('redirect-url', event.newURL), 100); + event.preventDefault(); + } } - } -}; + }; diff --git a/recipes/zimbra/index.js b/recipes/zimbra/index.js index 1b0a47f..50c3cf2 100644 --- a/recipes/zimbra/index.js +++ b/recipes/zimbra/index.js @@ -1,5 +1,6 @@ -module.exports = Ferdi => class Zimbra extends Ferdi { - async validateUrl(url) { - return true; - } -}; +module.exports = Ferdi => + class Zimbra extends Ferdi { + async validateUrl() { + return true; + } + }; diff --git a/scripts/create.js b/scripts/create.js index 0e785fa..184dc70 100644 --- a/scripts/create.js +++ b/scripts/create.js @@ -14,14 +14,19 @@ You can set "Folder name" to "FerdiDev" to use Ferdi's development instance inst pnpm run create WhatsApp FerdiDev `); - return; + throw new Error('Please provide the correct number of args!'); } const recipeName = process.argv[2]; const recipe = recipeName.toLowerCase().replace(/\s/g, '-'); const cleanRecipeId = recipe.replace(/[^a-z]/g, ''); // Clean recipe ID only containing a-z, for usage as the JavaScript class name const folderName = process.argv[3] || 'Ferdi'; -const filesThatNeedTextReplace = ['package.json', 'index.js', 'webview.js', 'README.md']; +const filesThatNeedTextReplace = [ + 'package.json', + 'index.js', + 'webview.js', + 'README.md', +]; (async () => { // Folder paths @@ -36,7 +41,7 @@ const filesThatNeedTextReplace = ['package.json', 'index.js', 'webview.js', 'REA const sampleRecipe = path.join(__dirname, 'sample_recipe'); // Make sure dev recipe folder exists - if (!(await fs.exists(recipesFolder))) { + if (!fs.existsSync(recipesFolder)) { console.log( `Couldn't find your recipe folder (${recipesFolder}). Is Ferdi installed?`, ); @@ -44,7 +49,7 @@ const filesThatNeedTextReplace = ['package.json', 'index.js', 'webview.js', 'REA } await fs.ensureDir(devRecipeFolder); - if (await fs.exists(newRecipeFolder)) { + if (fs.existsSync(newRecipeFolder)) { console.log('⚠️ Recipe already exists'); return; } diff --git a/scripts/package.js b/scripts/package.js index 0f2ae6f..4fc02f1 100644 --- a/scripts/package.js +++ b/scripts/package.js @@ -13,24 +13,28 @@ const pkgVersionChangedMatcher = new RegExp(/\n\+.*version.*/); const repo = 'https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/'; // Helper: Compress src folder into dest file -const compress = (src, dest) => new Promise((resolve, reject) => { - targz.compress({ - src, - dest, - tar: { - // Don't package .DS_Store files and .md files - ignore: function(name) { - return path.basename(name) === '.DS_Store' || name.endsWith('.md') - } - }, - }, (err) => { - if (err) { - reject(err); - } else { - resolve(dest); - } +const compress = (src, dest) => + new Promise((resolve, reject) => { + targz.compress( + { + src, + dest, + tar: { + // Don't package .DS_Store files and .md files + ignore: function (name) { + return path.basename(name) === '.DS_Store' || name.endsWith('.md'); + }, + }, + }, + err => { + if (err) { + reject(err); + } else { + resolve(dest); + } + }, + ); }); -}); // Let us work in an async environment (async () => { @@ -51,20 +55,23 @@ const compress = (src, dest) => new Promise((resolve, reject) => { const git = await simpleGit(repoRoot); const isGitRepo = await git.checkIsRepo(); if (!isGitRepo) { - console.debug("NOT A git repo: will bypass dirty state checks"); + console.debug('NOT A git repo: will bypass dirty state checks'); } - const availableRecipes = fs.readdirSync(recipesFolder, { withFileTypes: true }) + const availableRecipes = fs + .readdirSync(recipesFolder, { withFileTypes: true }) .filter(dir => dir.isDirectory()) .map(dir => dir.name); - for(let recipe of availableRecipes) { + for (let recipe of availableRecipes) { const recipeSrc = path.join(recipesFolder, recipe); const packageJson = path.join(recipeSrc, 'package.json'); // Check that package.json exists - if (!await fs.pathExists(packageJson)) { - console.log(`⚠️ Couldn't package "${recipe}": Folder doesn't contain a "package.json".`); + if (!(await fs.pathExists(packageJson))) { + console.log( + `⚠️ Couldn't package "${recipe}": Folder doesn't contain a "package.json".`, + ); unsuccessful++; continue; } @@ -73,7 +80,9 @@ const compress = (src, dest) => new Promise((resolve, reject) => { const svgIcon = path.join(recipeSrc, 'icon.svg'); const hasSvg = await fs.pathExists(svgIcon); if (!hasSvg) { - console.log(`⚠️ Couldn't package "${recipe}": Recipe doesn't contain an icon SVG`); + console.log( + `⚠️ Couldn't package "${recipe}": Recipe doesn't contain an icon SVG`, + ); unsuccessful++; continue; } @@ -82,7 +91,9 @@ const compress = (src, dest) => new Promise((resolve, reject) => { const svgSize = sizeOf(svgIcon); const svgHasRightSize = svgSize.width === svgSize.height; if (!svgHasRightSize) { - console.log(`⚠️ Couldn't package "${recipe}": Recipe SVG icon isn't a square`); + console.log( + `⚠️ Couldn't package "${recipe}": Recipe SVG icon isn't a square`, + ); unsuccessful++; continue; } @@ -90,61 +101,114 @@ const compress = (src, dest) => new Promise((resolve, reject) => { // Check that user.js does not exist const userJs = path.join(recipeSrc, 'user.js'); if (await fs.pathExists(userJs)) { - console.log(`⚠️ Couldn't package "${recipe}": Folder contains a "user.js".`); + console.log( + `⚠️ Couldn't package "${recipe}": Folder contains a "user.js".`, + ); unsuccessful++; continue; } // Read package.json - const config = await fs.readJson(packageJson) + const config = await fs.readJson(packageJson); // Make sure it contains all required fields if (!config) { - console.log(`⚠️ Couldn't package "${recipe}": Could not read or parse "package.json"`); + console.log( + `⚠️ Couldn't package "${recipe}": Could not read or parse "package.json"`, + ); unsuccessful++; continue; } let configErrors = []; if (!config.id) { - configErrors.push("The recipe's package.json contains no 'id' field. This field should contain a unique ID made of lowercase letters (a-z), numbers (0-9), hyphens (-), periods (.), and underscores (_)"); + configErrors.push( + "The recipe's package.json contains no 'id' field. This field should contain a unique ID made of lowercase letters (a-z), numbers (0-9), hyphens (-), periods (.), and underscores (_)", + ); + // eslint-disable-next-line no-useless-escape } else if (!/^[a-zA-Z0-9._\-]+$/.test(config.id)) { - configErrors.push("The recipe's package.json defines an invalid recipe ID. Please make sure the 'id' field only contains lowercase letters (a-z), numbers (0-9), hyphens (-), periods (.), and underscores (_)"); + configErrors.push( + "The recipe's package.json defines an invalid recipe ID. Please make sure the 'id' field only contains lowercase letters (a-z), numbers (0-9), hyphens (-), periods (.), and underscores (_)", + ); } if (config.id !== recipe) { - configErrors.push(`The recipe's id (${config.id}) does not match the folder name (${recipe})`); + configErrors.push( + `The recipe's id (${config.id}) does not match the folder name (${recipe})`, + ); } if (!config.name) { - configErrors.push("The recipe's package.json contains no 'name' field. This field should contain the name of the service (e.g. 'Google Keep')"); + configErrors.push( + "The recipe's package.json contains no 'name' field. This field should contain the name of the service (e.g. 'Google Keep')", + ); } if (!config.version) { - configErrors.push("The recipe's package.json contains no 'version' field. This field should contain the a semver-compatible version number for your recipe (e.g. '1.0.0')"); + configErrors.push( + "The recipe's package.json contains no 'version' field. This field should contain the a semver-compatible version number for your recipe (e.g. '1.0.0')", + ); } - if (!config.config || typeof config.config !== "object") { - configErrors.push("The recipe's package.json contains no 'config' object. This field should contain a configuration for your service."); + if (!config.config || typeof config.config !== 'object') { + configErrors.push( + "The recipe's package.json contains no 'config' object. This field should contain a configuration for your service.", + ); } const topLevelKeys = Object.keys(config); topLevelKeys.forEach(key => { - if (typeof(config[key]) === 'string') { + if (typeof config[key] === 'string') { if (config[key] === '') { - configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); + configErrors.push( + `The recipe's package.json contains empty value for key: ${key}`, + ); } - } else if ((key === 'config' || key === 'aliases') && typeof(config[key]) !== 'object') { - configErrors.push(`The recipe's package.json contains unexpected value for key: ${key}`); + } else if ( + (key === 'config' || key === 'aliases') && + typeof config[key] !== 'object' + ) { + configErrors.push( + `The recipe's package.json contains unexpected value for key: ${key}`, + ); } }); - const knownTopLevelKeys = ['id', 'name', 'version', 'license', 'repository', 'aliases', 'config']; - const unrecognizedKeys = topLevelKeys.filter(x => !knownTopLevelKeys.includes(x)); + const knownTopLevelKeys = [ + 'id', + 'name', + 'version', + 'license', + 'repository', + 'aliases', + 'config', + ]; + const unrecognizedKeys = topLevelKeys.filter( + x => !knownTopLevelKeys.includes(x), + ); if (unrecognizedKeys.length > 0) { - configErrors.push(`The recipe's package.json contains the following keys that are not recognized: ${unrecognizedKeys}`); + configErrors.push( + `The recipe's package.json contains the following keys that are not recognized: ${unrecognizedKeys}`, + ); } - if (config.config && typeof config.config === "object") { + if (config.config && typeof config.config === 'object') { const configKeys = Object.keys(config.config); - const knownConfigKeys = ['serviceURL', 'hasTeamId', 'urlInputPrefix', 'urlInputSuffix', 'hasHostedOption', 'hasCustomUrl', 'hasNotificationSound', 'hasDirectMessages', 'hasIndirectMessages', 'allowFavoritesDelineationInUnreadCount', 'message', 'disablewebsecurity']; - const unrecognizedConfigKeys = configKeys.filter(x => !knownConfigKeys.includes(x)); + const knownConfigKeys = [ + 'serviceURL', + 'hasTeamId', + 'urlInputPrefix', + 'urlInputSuffix', + 'hasHostedOption', + 'hasCustomUrl', + 'hasNotificationSound', + 'hasDirectMessages', + 'hasIndirectMessages', + 'allowFavoritesDelineationInUnreadCount', + 'message', + 'disablewebsecurity', + ]; + const unrecognizedConfigKeys = configKeys.filter( + x => !knownConfigKeys.includes(x), + ); if (unrecognizedConfigKeys.length > 0) { - configErrors.push(`The recipe's package.json contains the following keys that are not recognized: ${unrecognizedConfigKeys}`); + configErrors.push( + `The recipe's package.json contains the following keys that are not recognized: ${unrecognizedConfigKeys}`, + ); } // if (config.config.hasCustomUrl !== undefined && config.config.hasHostedOption !== undefined) { @@ -152,8 +216,13 @@ const compress = (src, dest) => new Promise((resolve, reject) => { // } configKeys.forEach(key => { - if (typeof(config.config[key]) === 'string' && config.config[key] === '') { - configErrors.push(`The recipe's package.json contains empty value for key: ${key}`); + if ( + typeof config.config[key] === 'string' && + config.config[key] === '' + ) { + configErrors.push( + `The recipe's package.json contains empty value for key: ${key}`, + ); } }); } @@ -164,38 +233,50 @@ const compress = (src, dest) => new Promise((resolve, reject) => { // Check for changes in recipe's directory, and if changes are present, then the changes should contain a version bump await git.diffSummary(relativeRepoSrc, (err, result) => { if (err) { - configErrors.push(`Got the following error while checking for git changes: ${err}`); - } else if (result && (result.changed !== 0 || result.insertions !== 0 || result.deletions !== 0)) { + configErrors.push( + `Got the following error while checking for git changes: ${err}`, + ); + } else if ( + result && + (result.changed !== 0 || + result.insertions !== 0 || + result.deletions !== 0) + ) { const pkgJsonRelative = path.relative(repoRoot, packageJson); - if (!result.files.find(({file}) => file === pkgJsonRelative)) { - configErrors.push(`Found changes in '${relativeRepoSrc}' without the corresponding version bump in '${pkgJsonRelative}'`); + if (!result.files.find(({ file }) => file === pkgJsonRelative)) { + configErrors.push( + `Found changes in '${relativeRepoSrc}' without the corresponding version bump in '${pkgJsonRelative}'`, + ); } else { git.diff(pkgJsonRelative, (_diffErr, diffResult) => { if (diffResult && !pkgVersionChangedMatcher.test(diffResult)) { - configErrors.push(`Found changes in '${relativeRepoSrc}' without the corresponding version bump in '${pkgJsonRelative}' (found other changes though)`); + configErrors.push( + `Found changes in '${relativeRepoSrc}' without the corresponding version bump in '${pkgJsonRelative}' (found other changes though)`, + ); } }); } } }); - }; + } if (configErrors.length > 0) { console.log(`⚠️ Couldn't package "${recipe}": There were errors in the recipe's package.json: ${configErrors.reduce((str, err) => `${str}\n${err}`)}`); unsuccessful++; - continue; } - if (!await fs.exists(path.join(recipeSrc, 'webview.js'))) { - console.log(`⚠️ Couldn't package "${recipe}": The recipe doesn't contain a "webview.js"`); + if (!fs.existsSync(path.join(recipeSrc, 'webview.js'))) { + console.log( + `⚠️ Couldn't package "${recipe}": The recipe doesn't contain a "webview.js"`, + ); unsuccessful++; - continue; } - if (!await fs.exists(path.join(recipeSrc, 'index.js'))) { - console.log(`⚠️ Couldn't package "${recipe}": The recipe doesn't contain a "index.js"`); + if (!fs.existsSync(path.join(recipeSrc, 'index.js'))) { + console.log( + `⚠️ Couldn't package "${recipe}": The recipe doesn't contain a "index.js"`, + ); unsuccessful++; - continue; } // Package to .tar.gz @@ -204,13 +285,13 @@ const compress = (src, dest) => new Promise((resolve, reject) => { // Add recipe to all.json const isFeatured = featuredRecipes.includes(config.id); const packageInfo = { - "featured": isFeatured, - "id": config.id, - "name": config.name, - "version": config.version, - "aliases": config.aliases, - "icons": { - "svg": `${repo}${config.id}/icon.svg`, + featured: isFeatured, + id: config.id, + name: config.name, + version: config.version, + aliases: config.aliases, + icons: { + svg: `${repo}${config.id}/icon.svg`, }, }; recipeList.push(packageInfo); @@ -220,14 +301,16 @@ const compress = (src, dest) => new Promise((resolve, reject) => { recipeList = recipeList.sort((a, b) => { var textA = a.id.toLowerCase(); var textB = b.id.toLowerCase(); - return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + return textA < textB ? -1 : textA > textB ? 1 : 0; }); await fs.writeJson(allJson, recipeList, { spaces: 2, EOL: '\n', }); - console.log(`✅ Successfully packaged and added ${recipeList.length} recipes (${unsuccessful} unsuccessful recipes)`); + console.log( + `✅ Successfully packaged and added ${recipeList.length} recipes (${unsuccessful} unsuccessful recipes)`, + ); if (unsuccessful > 0) { process.exit(1); -- cgit v1.2.3-54-g00ecf