From 13f00d68147b2735a07ecf756e8d90c7322e9fb8 Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 13:29:13 +0100 Subject: [PATCH 01/11] Updated dependencies --- .now/README.txt | 11 +++ .now/project.json | 1 + package-lock.json | 200 +++++++++++++++++++++++++++++----------------- package.json | 14 ++-- 4 files changed, 145 insertions(+), 81 deletions(-) create mode 100644 .now/README.txt create mode 100644 .now/project.json diff --git a/.now/README.txt b/.now/README.txt new file mode 100644 index 0000000..5be1475 --- /dev/null +++ b/.now/README.txt @@ -0,0 +1,11 @@ +> Why do I have a folder named ".now" in my project? +The ".now" folder is created when you link a directory to a ZEIT Now project. + +> What does the "project.json" file contain? +The "project.json" file contains: +- The ID of the ZEIT Now project that you linked ("projectId") +- The ID of the user or team your ZEIT Now project is owned by ("orgId") + +> Should I commit the ".now" folder? +No, you should not share the ".now" folder with anyone. +Upon creation, it will be automatically added to your ".gitignore" file. diff --git a/.now/project.json b/.now/project.json new file mode 100644 index 0000000..2c86e5f --- /dev/null +++ b/.now/project.json @@ -0,0 +1 @@ +{"projectId":"Qmae7ZYr7xx1PRwKXdShXbvoaQmjqtfRVdaDpdcDRnvMCW","orgId":"hZXVPteYXWGsSf56s6Oudqn4"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 216ba99..4c17f8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,10 +33,23 @@ "regenerator-runtime": "^0.13.2" } }, - "@types/node": { - "version": "13.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.1.tgz", - "integrity": "sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA==" + "@babel/runtime-corejs3": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.9.2.tgz", + "integrity": "sha512-HHxmgxbIzOfFlZ+tdeRKtaxWOMUoCG5Mu3wKeUmOxjYrwb3AAHgnmtCUbPPK11/raIWLIBK250t8E2BPO0p7jA==", + "dev": true, + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + } + } }, "acorn": { "version": "7.1.0", @@ -160,6 +173,12 @@ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, "axios": { "version": "0.19.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", @@ -366,6 +385,12 @@ "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, + "core-js-pure": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.4.tgz", + "integrity": "sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw==", + "dev": true + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -555,25 +580,25 @@ } }, "eslint-config-airbnb": { - "version": "18.0.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-18.0.1.tgz", - "integrity": "sha512-hLb/ccvW4grVhvd6CT83bECacc+s4Z3/AEyWQdIT2KeTsG9dR7nx1gs7Iw4tDmGKozCNHFn4yZmRm3Tgy+XxyQ==", + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-18.1.0.tgz", + "integrity": "sha512-kZFuQC/MPnH7KJp6v95xsLBf63G/w7YqdPfQ0MUanxQ7zcKUNG8j+sSY860g3NwCBOa62apw16J6pRN+AOgXzw==", "dev": true, "requires": { - "eslint-config-airbnb-base": "^14.0.0", + "eslint-config-airbnb-base": "^14.1.0", "object.assign": "^4.1.0", - "object.entries": "^1.1.0" + "object.entries": "^1.1.1" } }, "eslint-config-airbnb-base": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.0.0.tgz", - "integrity": "sha512-2IDHobw97upExLmsebhtfoD3NAKhV4H0CJWP3Uprd/uk+cHuWYOczPVxQ8PxLFUAw7o3Th1RAU8u1DoUpr+cMA==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.1.0.tgz", + "integrity": "sha512-+XCcfGyCnbzOnktDVhwsCAx+9DmrzEmuwxyHUJpw+kqBVT744OUBrB09khgFKlK1lshVww6qXGsYPZpavoNjJw==", "dev": true, "requires": { - "confusing-browser-globals": "^1.0.7", + "confusing-browser-globals": "^1.0.9", "object.assign": "^4.1.0", - "object.entries": "^1.1.0" + "object.entries": "^1.1.1" } }, "eslint-import-resolver-node": { @@ -598,9 +623,9 @@ } }, "eslint-module-utils": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.5.2.tgz", - "integrity": "sha512-LGScZ/JSlqGKiT8OC+cYRxseMjyqt6QO54nl281CK93unD89ijSeRV6An8Ci/2nvWVKe8K/Tqdm75RQoIOCr+Q==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", "dev": true, "requires": { "debug": "^2.6.9", @@ -619,9 +644,9 @@ } }, "eslint-plugin-import": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz", - "integrity": "sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw==", + "version": "2.20.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz", + "integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==", "dev": true, "requires": { "array-includes": "^3.0.3", @@ -685,9 +710,9 @@ } }, "eslint-plugin-react": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.18.3.tgz", - "integrity": "sha512-Bt56LNHAQCoou88s8ViKRjMB2+36XRejCQ1VoLj716KI1MoE99HpTVvIThJ0rvFmG4E4Gsq+UgToEjn+j044Bg==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz", + "integrity": "sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ==", "dev": true, "requires": { "array-includes": "^3.1.1", @@ -698,8 +723,10 @@ "object.fromentries": "^2.0.2", "object.values": "^1.1.1", "prop-types": "^15.7.2", - "resolve": "^1.14.2", - "string.prototype.matchall": "^4.0.2" + "resolve": "^1.15.1", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.2", + "xregexp": "^4.3.0" }, "dependencies": { "doctrine": { @@ -895,14 +922,15 @@ } }, "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", + "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", "dev": true, "requires": { + "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" } }, "fs.realpath": { @@ -1014,9 +1042,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "iconv-lite": { @@ -1229,12 +1257,13 @@ "dev": true }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "^4.1.6", + "universalify": "^1.0.0" } }, "jsx-ast-utils": { @@ -1286,12 +1315,12 @@ "dev": true }, "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", "dev": true, "requires": { - "chalk": "^2.0.1" + "chalk": "^2.4.2" } }, "loose-envify": { @@ -1356,9 +1385,9 @@ } }, "mocha": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.0.1.tgz", - "integrity": "sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.1.tgz", + "integrity": "sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -1372,9 +1401,9 @@ "growl": "1.10.5", "he": "1.2.0", "js-yaml": "3.13.1", - "log-symbols": "2.2.0", + "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", + "mkdirp": "0.5.3", "ms": "2.1.1", "node-environment-flags": "1.0.6", "object.assign": "4.1.0", @@ -1382,8 +1411,8 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "13.3.0", - "yargs-parser": "13.1.1", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", "yargs-unparser": "1.6.0" }, "dependencies": { @@ -1429,6 +1458,21 @@ "path-exists": "^3.0.0" } }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -1760,9 +1804,9 @@ "dev": true }, "picomatch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", - "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, "pify": { @@ -1810,14 +1854,14 @@ "dev": true }, "qs": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", - "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==" + "version": "6.9.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", + "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==" }, "react-is": { - "version": "16.12.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", - "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==", + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, "read-pkg": { @@ -2179,11 +2223,10 @@ } }, "telegraf": { - "version": "3.36.0", - "resolved": "https://registry.npmjs.org/telegraf/-/telegraf-3.36.0.tgz", - "integrity": "sha512-9o6AJKRiTm5vMWYI6WpTfBHzu4FMpWBNKxvnMxRds/cbMY9RnsVVjdi8i4bFFlfd+xbi73EbrnI3dybayryICA==", + "version": "3.37.0", + "resolved": "https://registry.npmjs.org/telegraf/-/telegraf-3.37.0.tgz", + "integrity": "sha512-V3448qwfOolBqkIc87yxjW4zMvR2P6AIF24pPTlX9WhZPwA1TF/x3nQhnWPRLtGh2SJuvDcr83iTkXPXT7Opnw==", "requires": { - "@types/node": "^13.1.0", "debug": "^4.0.1", "minimist": "^1.2.0", "module-alias": "^2.2.2", @@ -2193,9 +2236,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" } } }, @@ -2262,9 +2305,9 @@ "dev": true }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", "dev": true }, "uri-js": { @@ -2419,6 +2462,15 @@ "mkdirp": "^0.5.1" } }, + "xregexp": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", + "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==", + "dev": true, + "requires": { + "@babel/runtime-corejs3": "^7.8.3" + } + }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", @@ -2426,9 +2478,9 @@ "dev": true }, "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, "requires": { "cliui": "^5.0.0", @@ -2440,7 +2492,7 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" + "yargs-parser": "^13.1.2" }, "dependencies": { "emoji-regex": { @@ -2512,9 +2564,9 @@ } }, "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "requires": { "camelcase": "^5.0.0", diff --git a/package.json b/package.json index 2666c18..01e373a 100644 --- a/package.json +++ b/package.json @@ -19,19 +19,19 @@ "dotenv": "^8.2.0", "micro-bot": "^2.5.3", "moment": "^2.24.0", - "qs": "^6.9.1", - "telegraf": "^3.36.0", + "qs": "^6.9.3", + "telegraf": "^3.37.0", "wikidata-sdk": "^7.2.0" }, "devDependencies": { "chai": "^4.2.0", "eslint": "^6.8.0", - "eslint-config-airbnb": "^18.0.1", - "eslint-plugin-import": "^2.20.1", + "eslint-config-airbnb": "^18.1.0", + "eslint-plugin-import": "^2.20.2", "eslint-plugin-jsx-a11y": "^6.2.3", - "eslint-plugin-react": "^7.18.3", - "fs-extra": "^8.1.0", - "mocha": "^7.0.1", + "eslint-plugin-react": "^7.19.0", + "fs-extra": "^9.0.0", + "mocha": "^7.1.1", "moxios": "^0.4.0" } } From e99a8f3c710f280b6b4c0b32d42b0351871347a1 Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 13:33:26 +0100 Subject: [PATCH 02/11] Update nodejs to 12.x --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 01e373a..8963745 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test": "mocha tests/." }, "engines": { - "node": "8.2.1" + "node": "12.x" }, "author": "Weiran Zhang", "license": "ISC", From a355257513ab4bc3078d86f410f6bacddf1f0a2a Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 13:54:40 +0100 Subject: [PATCH 03/11] Use Telegraf directly --- index.js | 7 +++---- package.json | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 5067f89..a7387db 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,7 @@ require('dotenv').config(); -const { Composer } = require('micro-bot'); +const Telegraf = require('telegraf'); const BotRunner = require('./BotRunner'); -const bot = new Composer(); +const bot = new Telegraf(process.env.BOT_TOKEN); bot.on('text', BotRunner.textReceived); - -module.exports = bot; +bot.startPolling(); diff --git a/package.json b/package.json index 8963745..ed26219 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Telegram bot that tells you whether someone is dead or alive.", "main": "index.js", "scripts": { - "start": "micro-bot -d ${NOW_URL}", + "start": "node index", "debug": "node index-debug", "lint": "eslint ./", "test": "mocha tests/." From 3daae0cd8e3e5a2ec970a3ed6a33c8d23709d958 Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 14:02:09 +0100 Subject: [PATCH 04/11] Switch back to micro-bot --- index.js | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index a7387db..a6b2264 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,8 @@ require('dotenv').config(); -const Telegraf = require('telegraf'); +const { Composer } = require('micro-bot'); const BotRunner = require('./BotRunner'); -const bot = new Telegraf(process.env.BOT_TOKEN); +const bot = new Composer(); bot.on('text', BotRunner.textReceived); -bot.startPolling(); + +module.exports = bot; \ No newline at end of file diff --git a/package.json b/package.json index ed26219..97ff338 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Telegram bot that tells you whether someone is dead or alive.", "main": "index.js", "scripts": { - "start": "node index", + "start": "micro-bot -d ${BOT_URL}", "debug": "node index-debug", "lint": "eslint ./", "test": "mocha tests/." From e324c5ee89c4656bba53e4c45582d8e52fb992ee Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 14:17:54 +0100 Subject: [PATCH 05/11] Added Heroku Procfile --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..a46e67d --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: micro-bot -p $PORT \ No newline at end of file From 656305cb4b9c4e6ca6805e97dfcaa9f664c89013 Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 14:19:49 +0100 Subject: [PATCH 06/11] Added missing line --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index a6b2264..5067f89 100644 --- a/index.js +++ b/index.js @@ -5,4 +5,4 @@ const BotRunner = require('./BotRunner'); const bot = new Composer(); bot.on('text', BotRunner.textReceived); -module.exports = bot; \ No newline at end of file +module.exports = bot; From aa090d4ce7c5684abf0da816e7cb24ac36b4601e Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 14:21:31 +0100 Subject: [PATCH 07/11] Security updates --- package-lock.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4c17f8a..05c0d62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,9 +52,9 @@ } }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-jsx": { @@ -1348,9 +1348,9 @@ "integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==" }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" } } }, @@ -1370,18 +1370,18 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, "mocha": { From 0816852d0befeb22dc1f93562f2d4f2e8e012bc6 Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 14:22:37 +0100 Subject: [PATCH 08/11] Updated README --- README.md | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ab17f8d..3d5cc27 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,10 @@ A Telegram bot that searches Wikipedia (via WikiData) for people and informs you if they're dead or alive. Inspired by [@roguehousewife](https://twitter.com/roguehousewife)'s inability to remember if any celebrity is dead or alive. -Thanks to [@JonShort](https://github.com/JonShort) for the logo. +Thanks to [@JonShort](https://github.com/JonShort) for the logo and code. Known as [@dead_or_alive_bot](http://t.me/dead_or_alive_bot) on Telegram. - ## Usage * Query via direct message @@ -39,7 +38,7 @@ BOT_TOKEN_DEV=1234567:AAGdsf08sg9897fsdD89fsD Then run either: - `npm run debug` - debug the bot locally. - `npm run start` - run the bot in production. -> note - production requires the `NOW_URL` env var to be configured +> note - production requires the `BOT_URL` env var to be configured ## FAQ @@ -55,16 +54,6 @@ Then run either: > note - bot tokens can be managed by running the command `/mybots` within botfather. - -
- - I want to deploy to now - - - Deploy with your bot token as an environment variable: - now -e BOT_TOKEN='1234567:AAGdsf08sg9897fsdD89fsD' -
- ---

By Weiran Zhang
From 20f6714a5910714a8275e874b378ece4ddf0618a Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 14:34:34 +0100 Subject: [PATCH 09/11] Remove now files --- .now/README.txt | 11 ----------- .now/project.json | 1 - 2 files changed, 12 deletions(-) delete mode 100644 .now/README.txt delete mode 100644 .now/project.json diff --git a/.now/README.txt b/.now/README.txt deleted file mode 100644 index 5be1475..0000000 --- a/.now/README.txt +++ /dev/null @@ -1,11 +0,0 @@ -> Why do I have a folder named ".now" in my project? -The ".now" folder is created when you link a directory to a ZEIT Now project. - -> What does the "project.json" file contain? -The "project.json" file contains: -- The ID of the ZEIT Now project that you linked ("projectId") -- The ID of the user or team your ZEIT Now project is owned by ("orgId") - -> Should I commit the ".now" folder? -No, you should not share the ".now" folder with anyone. -Upon creation, it will be automatically added to your ".gitignore" file. diff --git a/.now/project.json b/.now/project.json deleted file mode 100644 index 2c86e5f..0000000 --- a/.now/project.json +++ /dev/null @@ -1 +0,0 @@ -{"projectId":"Qmae7ZYr7xx1PRwKXdShXbvoaQmjqtfRVdaDpdcDRnvMCW","orgId":"hZXVPteYXWGsSf56s6Oudqn4"} \ No newline at end of file From e81beb56a3729d18e16ce2da9a8245454ded31a5 Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 14:37:22 +0100 Subject: [PATCH 10/11] Updated travis nodejs to 12 --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75998e4..5346e60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,2 @@ language: node_js -node_js: 8 - \ No newline at end of file +node_js: 12 From 2e5b84b40bafeaa46a72abf0404affcc35c2fb3d Mon Sep 17 00:00:00 2001 From: Weiran Zhang Date: Sat, 4 Apr 2020 14:37:36 +0100 Subject: [PATCH 11/11] Updated the test that breaks every year --- tests/DeadOrAlive.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DeadOrAlive.spec.js b/tests/DeadOrAlive.spec.js index 9c3e886..677cc9e 100644 --- a/tests/DeadOrAlive.spec.js +++ b/tests/DeadOrAlive.spec.js @@ -207,7 +207,7 @@ describe('getResultModel', () => { resultModelInputWithoutDeath.dateOfDeath = null; const resultModel = DeadOrAlive._private.getResultModel(resultModelInputWithoutDeath); // TODO: inject a date for 'today' to calculate age statically - expect(resultModel.age).to.be.equal(44); + expect(resultModel.age).to.be.equal(45); expect(resultModel.hasDOB).to.be.equal(true); expect(resultModel.isDead).to.be.equal(false); expect(resultModel.dateOfDeath).to.be.equal(null);