From 5e1480be16e037d3c6bc9fb3cd66e5e704e074ca Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Tue, 7 Jan 2020 14:29:50 -0800 Subject: [PATCH 01/33] Update packages Signed-off-by: Vincent Tan --- Dockerfile | 14 +- ops.yml | 7 +- package-lock.json | 324 ++++++++++++++++++++++++++-------------------- package.json | 14 +- 4 files changed, 200 insertions(+), 159 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0cad749..6c6de30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,28 @@ ############################ # Build container ############################ -FROM node:10-alpine AS dep +FROM registry.cto.ai/official_images/node:latest AS dep WORKDIR /ops -RUN apk add python +RUN apt update && apt install -y python && mkdir lib ADD package.json . RUN npm install +RUN npx modclean -release && rm modclean*.log ADD . . -RUN mkdir lib - -RUN npm run build +RUN npm run build && rm -rf /ops/src package-lock.json .dockerignore ############################ # Final container ############################ -FROM node:10-alpine +FROM registry.cto.ai/official_images/node:latest WORKDIR /ops -RUN apk --update add git make vim && npm install -g typescript && npm install -g ts-node @types/node +# RUN apt update && apt install git make && npm install -g typescript && npm install -g ts-node @types/node && rm -rf /var/lib/apt/lists/* +RUN apt update && apt install -y git make ca-certificates && rm -rf /var/lib/apt/lists/* COPY --from=dep /ops . diff --git a/ops.yml b/ops.yml index fd72153..a824a75 100644 --- a/ops.yml +++ b/ops.yml @@ -1,12 +1,13 @@ version: "1" commands: - name: # Unique identifier for your op (required) - github:1.0.0 + github:1.0.0 description: # Short description for what your op does (required) An Op to simplify an opinionated GitHub workflow. public: # Determines whether this version of the op is visible to other people true sourceCodeURL: "https://github.com/cto-ai/github" + sdk: "2" run: # Command that is executed when op is started ("npm start", "./start_script.sh", etc.) (required) node /ops/lib/index.js env: @@ -30,8 +31,8 @@ commands: - /tmp:/tmp - ~/.ssh:/root/.ssh - ~/.ops/cto.ai/github:/root/.ops/cto.ai/github - port: # Map ports for your op container - - 3000:3000 + # port: # Map ports for your op container + # - 3000:3000 help: # Configure the output for when your op is run with `op --help` or `op -h` usage: "ops run github [ARGUMENT]" arguments: diff --git a/package-lock.json b/package-lock.json index 9a99ad6..6d87c1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -238,9 +238,9 @@ } }, "@cto.ai/inquirer": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@cto.ai/inquirer/-/inquirer-6.4.2.tgz", - "integrity": "sha512-/maBmJsMhGQUtUUvLzAeeACYcekuMPauzbcbZB11+eZClmMscU4ckodbardE9SO6+2igsUuzQJBlbm/8XKG+zg==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/@cto.ai/inquirer/-/inquirer-6.4.4.tgz", + "integrity": "sha512-GvKEFR//zy67O7OXbwNfE1ADgHf1884KZPrtVFTOOmrFGN5wfLzJSGTxESZl7FN/y0JxkZJi8uVNs/JGDJGgJg==", "requires": { "@types/inquirer": "^6.0.3", "ansi-escapes": "^3.2.0", @@ -266,11 +266,11 @@ } }, "@cto.ai/sdk": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@cto.ai/sdk/-/sdk-1.5.1.tgz", - "integrity": "sha512-+xjZ6pcAK9uf3EFB4xMlHyEV1jMCbtt7SXaZAOick1/gClFtvUhtPUlkwxBgInGk2SGI1G66gWmOcielZDTxAA==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@cto.ai/sdk/-/sdk-1.5.4.tgz", + "integrity": "sha512-jdl/+atuDdVOOclz88gzmpKj8NwyGce6c/JGVBkQU1lXplm6ZRbX87LTdiklsIkJLVuDsgycGjGe66kQAKLATQ==", "requires": { - "@cto.ai/inquirer": "^6.4.1", + "@cto.ai/inquirer": "^6.4.4", "@oclif/config": "^1.12.10", "@types/cli-progress": "^1.8.1", "@types/fs-extra": "^7.0.0", @@ -291,7 +291,7 @@ "fs-extra": "^8.0.1", "install": "^0.12.2", "is-docker": "^2.0.0", - "lodash": "^4.17.11", + "lodash": "^4.17.15", "mute-stream": "0.0.7", "node-notifier": "^5.4.0", "run-async": "^2.2.0", @@ -628,13 +628,13 @@ } }, "@oclif/plugin-help": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-2.2.1.tgz", - "integrity": "sha512-psEA3t41MSGBErLk6xCaAq2jKrRtx3Br+kHpd43vZeGEeZ7Gos4wgK0JAaHBbvhvUQskCHg8dzoqv4XEeTWeVQ==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-2.2.3.tgz", + "integrity": "sha512-bGHUdo5e7DjPJ0vTeRBMIrfqTRDBfyR5w0MP41u0n3r7YG5p14lvMmiCXxi6WDaP2Hw5nqx3PnkAIntCKZZN7g==", "requires": { "@oclif/command": "^1.5.13", "chalk": "^2.4.1", - "indent-string": "^3.2.0", + "indent-string": "^4.0.0", "lodash.template": "^4.4.0", "string-width": "^3.0.0", "strip-ansi": "^5.0.0", @@ -642,6 +642,11 @@ "wrap-ansi": "^4.0.0" }, "dependencies": { + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -689,48 +694,49 @@ "integrity": "sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw==" }, "@octokit/endpoint": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.1.5.tgz", - "integrity": "sha512-Es0Qj6ynp0mznTnayCX8veXev43/fGjwVvctynwgzcnW+KIK6nrHdqQXUnAA1Az0DsRgbGsh9fDHjP/3Ybfyyw==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.1.tgz", + "integrity": "sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg==", "requires": { - "deepmerge": "3.2.0", + "@octokit/types": "^2.0.0", "is-plain-object": "^3.0.0", - "universal-user-agent": "^2.1.0", - "url-template": "^2.0.8" + "universal-user-agent": "^4.0.0" } }, "@octokit/request": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-4.1.0.tgz", - "integrity": "sha512-RvpQAba4i+BNH0z8i0gPRc1ShlHidj4puQjI/Tno6s+Q3/Mzb0XRSHJiOhpeFrZ22V7Mwjq1E7QS27P5CgpWYA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.1.tgz", + "integrity": "sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg==", "requires": { - "@octokit/endpoint": "^5.1.0", + "@octokit/endpoint": "^5.5.0", "@octokit/request-error": "^1.0.1", + "@octokit/types": "^2.0.0", "deprecation": "^2.0.0", "is-plain-object": "^3.0.0", "node-fetch": "^2.3.0", "once": "^1.4.0", - "universal-user-agent": "^2.1.0" + "universal-user-agent": "^4.0.0" } }, "@octokit/request-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.0.2.tgz", - "integrity": "sha512-T9swMS/Vc4QlfWrvyeSyp/GjhXtYaBzCcibjGywV4k4D2qVrQKfEMPy8OxMDEj7zkIIdpHwqdpVbKCvnUPqkXw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.0.tgz", + "integrity": "sha512-DNBhROBYjjV/I9n7A8kVkmQNkqFAMem90dSxqvPq57e2hBr7mNTX98y3R2zDpqMQHVRpBDjsvsfIGgBzy+4PAg==", "requires": { + "@octokit/types": "^2.0.0", "deprecation": "^2.0.0", "once": "^1.4.0" } }, "@octokit/rest": { - "version": "16.28.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.28.1.tgz", - "integrity": "sha512-9H/5F0f2bSVhk78ypu/A9dkK5GCH/aI8CxRJ0L8JU/XEYNIYozxqD6HVC7shsofrCfR61YORfjTE+GxfZ/wasQ==", + "version": "16.36.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.36.0.tgz", + "integrity": "sha512-zoZj7Ya4vWBK4fjTwK2Cnmu7XBB1p9ygSvTk2TthN6DVJXM4hQZQoAiknWFLJWSTix4dnA3vuHtjPZbExYoCZA==", "requires": { - "@octokit/request": "^4.0.1", + "@octokit/request": "^5.2.0", "@octokit/request-error": "^1.0.2", "atob-lite": "^2.0.0", - "before-after-hook": "^1.4.0", + "before-after-hook": "^2.0.0", "btoa-lite": "^1.0.0", "deprecation": "^2.0.0", "lodash.get": "^4.4.2", @@ -738,8 +744,15 @@ "lodash.uniq": "^4.5.0", "octokit-pagination-methods": "^1.1.0", "once": "^1.4.0", - "universal-user-agent": "^2.0.0", - "url-template": "^2.0.8" + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.0.2.tgz", + "integrity": "sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ==", + "requires": { + "@types/node": ">= 8" } }, "@types/babel__core": { @@ -815,9 +828,9 @@ } }, "@types/inquirer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-6.0.3.tgz", - "integrity": "sha512-lBsdZScFMaFYYIE3Y6CWX22B9VeY2NerT1kyU2heTc3u/W6a+Om6Au2q0rMzBrzynN0l4QoABhI0cbNdyz6fDg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-6.5.0.tgz", + "integrity": "sha512-rjaYQ9b9y/VFGOpqBEXRavc3jh0a+e6evAbI31tMda8VlPaSy0AZJfXsvmIe3wklc7W6C3zCSfleuMXR7NOyXw==", "requires": { "@types/through": "*", "rxjs": "^6.4.0" @@ -849,24 +862,18 @@ } }, "@types/jest": { - "version": "24.0.18", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.18.tgz", - "integrity": "sha512-jcDDXdjTcrQzdN06+TSVsPPqxvsZA/5QkYfIZlq1JMw7FdP5AZylbOc+6B/cuDurctRe+MziUMtQ3xQdrbjqyQ==", + "version": "24.0.25", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.25.tgz", + "integrity": "sha512-hnP1WpjN4KbGEK4dLayul6lgtys6FPz0UfxMeMQCv0M+sTnzN3ConfiO72jHgLxl119guHgI8gLqDOrRLsyp2g==", "dev": true, "requires": { - "@types/jest-diff": "*" + "jest-diff": "^24.3.0" } }, - "@types/jest-diff": { - "version": "20.0.1", - "resolved": "https://registry.npmjs.org/@types/jest-diff/-/jest-diff-20.0.1.tgz", - "integrity": "sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==", - "dev": true - }, "@types/node": { - "version": "12.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.8.tgz", - "integrity": "sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg==" + "version": "12.12.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.24.tgz", + "integrity": "sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug==" }, "@types/node-notifier": { "version": "5.4.0", @@ -990,9 +997,17 @@ "integrity": "sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==" }, "arg": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", - "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==" + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz", + "integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } }, "arr-diff": { "version": "4.0.0", @@ -1096,12 +1111,11 @@ "dev": true }, "axios": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz", - "integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.1.tgz", + "integrity": "sha512-Yl+7nfreYKaLRvAvjNPkvfjnQHJM1yLBY3zhqAwcJSwR/6ETkanUgylgtIvkvz0xJ+p/vZuNw8X7Hnb7Whsbpw==", "requires": { - "follow-redirects": "1.5.10", - "is-buffer": "^2.0.2" + "follow-redirects": "1.5.10" } }, "babel-code-frame": { @@ -1520,9 +1534,9 @@ } }, "before-after-hook": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-1.4.0.tgz", - "integrity": "sha512-l5r9ir56nda3qu14nAXIlyq1MmUSs0meCIaFAh8HwkFwP1F8eToOuS3ah2VAHHcY04jaYD7FpJC5JTXHYRbkzg==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", + "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" }, "brace-expansion": { "version": "1.1.11", @@ -1783,9 +1797,9 @@ } }, "cli-ux": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/cli-ux/-/cli-ux-5.3.2.tgz", - "integrity": "sha512-H7gFNM5FxAZ+DUGTQNZfKs6lUOPKZGCIUNsYiQ1FuoeJjo9RLnBbUUnKhQ68DqfrH6i/BRmv8edOY0EfUHD6Mg==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/cli-ux/-/cli-ux-5.4.1.tgz", + "integrity": "sha512-x5CJXJPKBrEo6o8Uy/Upajb9OWYMhTzOpRvKZyZ68kkHysiGd9phGP71WyHZfLUkhwdvpNUFkY2tsDr0ogyocg==", "requires": { "@oclif/command": "^1.5.1", "@oclif/errors": "^1.2.1", @@ -1796,11 +1810,13 @@ "cardinal": "^2.1.1", "chalk": "^2.4.1", "clean-stack": "^2.0.0", + "cli-progress": "^3.4.0", "extract-stack": "^1.0.0", "fs-extra": "^7.0.1", "hyperlinker": "^1.0.0", - "indent-string": "^3.2.0", + "indent-string": "^4.0.0", "is-wsl": "^1.1.0", + "js-yaml": "^3.13.1", "lodash": "^4.17.11", "natural-orderby": "^2.0.1", "password-prompt": "^1.1.2", @@ -1813,6 +1829,34 @@ "tslib": "^1.9.3" }, "dependencies": { + "cli-progress": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.5.0.tgz", + "integrity": "sha512-S1wR4xfcfLWbVBH6RwYat1nMCm2UsuygxNoiRYVAXQsuWKjCRgWRZVohXLmsWfiuAK0FFf7t9OyZ2JBmDWaQGA==", + "requires": { + "colors": "^1.1.2", + "string-width": "^2.1.1" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -1823,6 +1867,11 @@ "universalify": "^0.1.0" } }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -1924,9 +1973,9 @@ } }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "optional": true }, @@ -1985,9 +2034,9 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" }, "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==" + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" }, "core-util-is": { "version": "1.0.2", @@ -2115,11 +2164,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "deepmerge": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-3.2.0.tgz", - "integrity": "sha512-6+LuZGU7QCNUnAJyX8cIrlzoEgggTM6B7mm+znKOX4t5ltluT9KLjN6g61ECMS0LTsLW7yDpNoxhix5FZcrIow==" - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -2178,9 +2222,9 @@ "dev": true }, "deprecation": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.0.0.tgz", - "integrity": "sha512-lbQN037mB3VfA2JFuguM5GCJ+zPinMeCrFe+AfSZ6eqrnJA/Fs+EYMnd6Nb2mn9lf2jO9xwEd9o9lic+D4vkcw==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, "detect-file": { "version": "1.0.0", @@ -2703,13 +2747,20 @@ "dev": true }, "fs-extra": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.0.1.tgz", - "integrity": "sha512-W+XLrggcDzlle47X/XnS7FXrXu9sDo+Ze9zpndeBxdgv88FHLm1HtmkhEwavruS6koanBjp098rUpHs65EmG7A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "requires": { - "graceful-fs": "^4.1.2", + "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + } } }, "fs.realpath": { @@ -3392,9 +3443,9 @@ "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=" }, "handlebars": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.3.tgz", - "integrity": "sha512-B0W4A2U1ww3q7VVthTKfh+epHx+q4mCt6iK+zEAzbMBpWQAwxCeKxEGpj/1oQTpzPXDNSOG7hmG14TsISH50yw==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -3693,11 +3744,6 @@ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, - "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==" - }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", @@ -4582,6 +4628,15 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -9086,9 +9141,9 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true }, "pretty-format": { @@ -9464,9 +9519,9 @@ } }, "rxjs-compat": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.5.3.tgz", - "integrity": "sha512-BIJX2yovz3TBpjJoAZyls2QYuU6ZiCaZ+U96SmxQpuSP/qDUfiXPKOVLbThBB2WZijNHkdTTJXKRwvv5Y48H7g==" + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.5.4.tgz", + "integrity": "sha512-rkn+lbOHUQOurdd74J/hjmDsG9nFx0z66fvnbs8M95nrtKvNqCKdk7iZqdY51CGmDemTQk+kUPy4s8HVOHtkfA==" }, "safe-buffer": { "version": "5.2.0", @@ -9622,26 +9677,11 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-git": { - "version": "1.113.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.113.0.tgz", - "integrity": "sha512-i9WVsrK2u0G/cASI9nh7voxOk9mhanWY9eGtWBDSYql6m49Yk5/Fan6uZsDr/xmzv8n+eQ8ahKCoEr8cvU3h+g==", + "version": "1.129.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.129.0.tgz", + "integrity": "sha512-XbzNmugMTeV2crZnPl+b1ZJn+nqXCUNyrZxDXpLM0kHL3B85sbPlpd8q9I4qtAHI9D2FxTB6w4BuiAGKYtyzKw==", "requires": { "debug": "^4.0.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } } }, "sisteransi": { @@ -9844,6 +9884,11 @@ "extend-shallow": "^3.0.0" } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -10264,9 +10309,9 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" }, "ts-jest": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.1.0.tgz", - "integrity": "sha512-HEGfrIEAZKfu1pkaxB9au17b1d9b56YZSqz5eCVE8mX68+5reOvlM93xGOzzCREIov9mdH7JBG+s0UyNAqr0tQ==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.3.0.tgz", + "integrity": "sha512-Hb94C/+QRIgjVZlJyiWwouYUF+siNJHJHknyspaOcZ+OQAIdFG/UrdQVXw/0B8Z3No34xkUXZJpOTy9alOWdVQ==", "dev": true, "requires": { "bs-logger": "0.x", @@ -10314,9 +10359,9 @@ } }, "ts-node": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.2.0.tgz", - "integrity": "sha512-m8XQwUurkbYqXrKqr3WHCW310utRNvV5OnRVeISeea7LoCWVcdfeB/Ntl8JYWFh+WRoUAdBgESrzKochQt7sMw==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.4.tgz", + "integrity": "sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw==", "requires": { "arg": "^4.1.0", "diff": "^4.0.1", @@ -10331,9 +10376,9 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -10377,19 +10422,19 @@ "dev": true }, "typescript": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz", - "integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", + "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", "dev": true }, "uglify-js": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.1.tgz", - "integrity": "sha512-+dSJLJpXBb6oMHP+Yvw8hUgElz4gLTh82XuX68QiJVTXaE5ibl6buzhNkQdYhBlIhozWOC9ge16wyRmjG4TwVQ==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.4.tgz", + "integrity": "sha512-tinYWE8X1QfCHxS1lBS8yiDekyhSXOO6R66yNOCdUJeojxxw+PX2BHAz/BWyW7PQ7pkiWVxJfIEbiDxyLWvUGg==", "dev": true, "optional": true, "requires": { - "commander": "2.20.0", + "commander": "~2.20.3", "source-map": "~0.6.1" }, "dependencies": { @@ -10419,11 +10464,11 @@ } }, "universal-user-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.1.0.tgz", - "integrity": "sha512-8itiX7G05Tu3mGDTdNY2fB4KJ8MgZLS54RdG6PkkfwMAavrXu1mV/lls/GABx9O3Rw4PnTtasxrvbMQoBYY92Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz", + "integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==", "requires": { - "os-name": "^3.0.0" + "os-name": "^3.1.0" } }, "universalify": { @@ -10494,11 +10539,6 @@ "prepend-http": "^1.0.1" } }, - "url-template": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", - "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" - }, "url-to-options": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", @@ -10823,9 +10863,9 @@ } }, "yn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", - "integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==" } } } diff --git a/package.json b/package.json index 96cd03a..b78a05e 100644 --- a/package.json +++ b/package.json @@ -15,17 +15,17 @@ "devDependencies": { "@types/concat-stream": "^1.6.0", "@types/debug": "^4.1.5", - "@types/inquirer": "^6.0.2", - "@types/jest": "^24.0.18", - "@types/node": "^12.0.1", + "@types/inquirer": "^6.5.0", + "@types/jest": "^24.0.25", + "@types/node": "^12.12.24", "child_process": "^1.0.2", "concat-stream": "^2.0.0", "fs": "0.0.1-security", "jest": "^24.9.0", "npm": "^6.13.4", - "prettier": "^1.17.1", - "ts-jest": "^24.1.0", - "typescript": "^3.4.5" + "prettier": "^1.19.1", + "ts-jest": "^24.3.0", + "typescript": "^3.7.4" }, "dependencies": { "@cto.ai/sdk": "^1.5.1", @@ -41,4 +41,4 @@ "strip-ansi": "^5.2.0", "ts-node": "^8.1.0" } -} \ No newline at end of file +} From f2e4f5596624829328127229400c6a859cd9e5a2 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Tue, 7 Jan 2020 15:06:08 -0800 Subject: [PATCH 02/33] Update @cto.ai/sdk version to ^2. Sort imports, and replace console.log with ux.print. Builds will be broken while undergoing conversion. Signed-off-by: Vincent Tan --- package-lock.json | 741 ++++++++++++++++--------- package.json | 6 +- src/commands/issue:create.ts | 9 +- src/commands/issue:done.ts | 18 +- src/commands/issue:list.ts | 10 +- src/commands/issue:save.ts | 6 +- src/commands/issue:search.ts | 25 +- src/commands/issue:start.ts | 8 +- src/commands/label:add.ts | 10 +- src/commands/label:edit.ts | 28 +- src/commands/label:remove.ts | 28 +- src/commands/label:sync.ts | 17 +- src/commands/pulls:list.ts | 12 +- src/commands/repo:clone.ts | 16 +- src/commands/repo:create.ts | 18 +- src/commands/token:update.ts | 6 +- src/errors/index.ts | 12 +- src/helpers/asyncPipe.ts | 2 +- src/helpers/checkCurrentRepo.ts | 4 +- src/helpers/execPromisified.ts | 2 +- src/helpers/getGithub.ts | 4 +- src/helpers/git.ts | 2 +- src/helpers/labels.ts | 6 +- src/helpers/saveRemoteRepoToConfig.ts | 3 +- src/index.ts | 22 +- src/types/Answers.ts | 15 +- src/types/IssueTypes.ts | 2 +- tests_e2e/commands/issue:create.e2e.ts | 2 +- tests_e2e/commands/issue:done.e2e.ts | 2 +- tests_e2e/utils/cleanupFn.ts | 4 +- tests_e2e/utils/cmd.ts | 6 +- 31 files changed, 613 insertions(+), 433 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6d87c1d..cecd520 100644 --- a/package-lock.json +++ b/package-lock.json @@ -263,44 +263,42 @@ "string-width": "^2.1.0", "strip-ansi": "^5.1.0", "through": "^2.3.6" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + } } }, "@cto.ai/sdk": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@cto.ai/sdk/-/sdk-1.5.4.tgz", - "integrity": "sha512-jdl/+atuDdVOOclz88gzmpKj8NwyGce6c/JGVBkQU1lXplm6ZRbX87LTdiklsIkJLVuDsgycGjGe66kQAKLATQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@cto.ai/sdk/-/sdk-2.0.4.tgz", + "integrity": "sha512-YWF5mv8fcvVutpAt+eq81qtMXGx4TiwAcDr7V3/lQHBRg3oJz9/lzq++/XY6xQtabfoMhmdoB++7/qGkjNDdhA==", "requires": { - "@cto.ai/inquirer": "^6.4.4", "@oclif/config": "^1.12.10", - "@types/cli-progress": "^1.8.1", - "@types/fs-extra": "^7.0.0", + "@types/fs-extra": "^8.0.1", "@types/node": "^12.0.4", - "@types/node-notifier": "^5.4.0", - "@types/yargs": "^13.0.0", - "ansi-escapes": "^3.2.0", "axios": "^0.19.0", "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-progress": "^2.1.1", - "cli-ux": "^5.2.1", - "cli-width": "^2.0.0", - "dateformat": "^3.0.3", - "datejs": "^1.0.0-rc3", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "fs-extra": "^8.0.1", - "install": "^0.12.2", - "is-docker": "^2.0.0", - "lodash": "^4.17.15", - "mute-stream": "0.0.7", - "node-notifier": "^5.4.0", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "terminal-link": "^1.3.0", - "through": "^2.3.6", - "yargs": "^13.2.4" + "cli-ux": "^5.3.3", + "fs-extra": "^8.1.0", + "terminal-link": "^1.3.0" } }, "@jest/console": { @@ -590,25 +588,10 @@ "universalify": "^0.1.0" } }, - "wrap-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", - "integrity": "sha512-uMTsj9rDb0/7kk1PbcbCcwvHUxp60fGDB/NNXpVa0Q+ic/e7y5+BwTxKfQ33VYgDppSwi/FBzpetYzo8s6tfbg==", - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" } } }, @@ -640,52 +623,6 @@ "strip-ansi": "^5.0.0", "widest-line": "^2.0.1", "wrap-ansi": "^4.0.0" - }, - "dependencies": { - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "wrap-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", - "integrity": "sha512-uMTsj9rDb0/7kk1PbcbCcwvHUxp60fGDB/NNXpVa0Q+ic/e7y5+BwTxKfQ33VYgDppSwi/FBzpetYzo8s6tfbg==", - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - } } }, "@oclif/screen": { @@ -796,13 +733,10 @@ "@babel/types": "^7.3.0" } }, - "@types/cli-progress": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-1.8.1.tgz", - "integrity": "sha512-W31ZRQPQ1CM42pb5iqs3TzQlMv/RDRsPZ6pTCsl71oLFqFI/TYors3Pukj6tMinlUmXmv+Az5RD/94fZPcxMrw==", - "requires": { - "@types/node": "*" - } + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" }, "@types/concat-stream": { "version": "1.6.0", @@ -820,9 +754,9 @@ "dev": true }, "@types/fs-extra": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-7.0.0.tgz", - "integrity": "sha512-ndoMMbGyuToTy4qB6Lex/inR98nPiNHacsgMPvy+zqMLgSxbt8VtWpDArpGp69h1fEDQHn1KB+9DWD++wgbwYA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.0.1.tgz", + "integrity": "sha512-J00cVDALmi/hJOYsunyT52Hva5TnJeKP5yd1r+mH/ZU0mbYZflR0Z5kw5kITtKTRYMhm1JMClOFYdHnQszEvqw==", "requires": { "@types/node": "*" } @@ -875,14 +809,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.24.tgz", "integrity": "sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug==" }, - "@types/node-notifier": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@types/node-notifier/-/node-notifier-5.4.0.tgz", - "integrity": "sha512-M1XvCG6Rwej6+W0+kWultE46YS7erOy+W7suRmXtKwLGT3ytj6YEe9lqo47nRfL1xILzg9xJpKeNczIsWR8ymw==", - "requires": { - "@types/node": "*" - } - }, "@types/stack-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", @@ -901,6 +827,7 @@ "version": "13.0.3", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.3.tgz", "integrity": "sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ==", + "dev": true, "requires": { "@types/yargs-parser": "*" } @@ -908,7 +835,8 @@ "@types/yargs-parser": { "version": "13.1.0", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-13.1.0.tgz", - "integrity": "sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg==" + "integrity": "sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg==", + "dev": true }, "abab": { "version": "2.0.2", @@ -1788,12 +1716,31 @@ } }, "cli-progress": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-2.1.1.tgz", - "integrity": "sha512-TSJw3LY9ZRSis7yYzQ7flIdtQMbacd9oYoiFphJhI4SzgmqF0zErO+uNv0lbUjk1L4AGfHQJ4OVYYzW+JV66KA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.5.0.tgz", + "integrity": "sha512-S1wR4xfcfLWbVBH6RwYat1nMCm2UsuygxNoiRYVAXQsuWKjCRgWRZVohXLmsWfiuAK0FFf7t9OyZ2JBmDWaQGA==", "requires": { "colors": "^1.1.2", "string-width": "^2.1.1" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "cli-ux": { @@ -1829,34 +1776,6 @@ "tslib": "^1.9.3" }, "dependencies": { - "cli-progress": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.5.0.tgz", - "integrity": "sha512-S1wR4xfcfLWbVBH6RwYat1nMCm2UsuygxNoiRYVAXQsuWKjCRgWRZVohXLmsWfiuAK0FFf7t9OyZ2JBmDWaQGA==", - "requires": { - "colors": "^1.1.2", - "string-width": "^2.1.1" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -1866,21 +1785,6 @@ "jsonfile": "^4.0.0", "universalify": "^0.1.0" } - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } } } }, @@ -1899,33 +1803,78 @@ } }, "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" }, "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" } }, "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } } } @@ -2045,11 +1994,13 @@ "dev": true }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "requires": { - "lru-cache": "^4.0.1", + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } @@ -2429,6 +2380,18 @@ "p-finally": "^1.0.0", "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } } }, "exit": { @@ -3440,7 +3403,8 @@ "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=" + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true }, "handlebars": { "version": "4.5.3", @@ -3645,9 +3609,9 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" }, "inflight": { "version": "1.0.6", @@ -3681,6 +3645,13 @@ "lodash.isequal": "^4.5.0", "log-update": "^2.1.0", "prop-types": "^15.5.10" + }, + "dependencies": { + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" + } } }, "ink-text-input": { @@ -3703,11 +3674,6 @@ "run-async": "^2.3.0" } }, - "install": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/install/-/install-0.12.2.tgz", - "integrity": "sha512-+7thTb4Rpvs9mnlhHKGZFJbGOO6kyMgy+gg0sgM5vFzIFK0wrCYXqdlaM71Bi289DTuPHf61puMFsaZBcwDIrg==" - }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -4100,6 +4066,32 @@ "jest-cli": "^24.9.0" }, "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, "jest-cli": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.9.0.tgz", @@ -4119,6 +4111,81 @@ "prompts": "^2.0.1", "realpath-native": "^1.1.0", "yargs": "^13.3.0" + }, + "dependencies": { + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + } + } + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -4476,6 +4543,66 @@ "yargs": "^13.3.0" }, "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -4487,6 +4614,45 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -4869,6 +5035,34 @@ "ansi-escapes": "^3.0.0", "cli-cursor": "^2.0.0", "wrap-ansi": "^3.0.1" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz", + "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=", + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0" + } + } } }, "loose-envify": { @@ -5161,6 +5355,7 @@ "version": "5.4.3", "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.3.tgz", "integrity": "sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q==", + "dev": true, "requires": { "growly": "^1.3.0", "is-wsl": "^1.1.0", @@ -8961,20 +9156,6 @@ "requires": { "ansi-escapes": "^3.1.0", "cross-spawn": "^6.0.5" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } } }, "path": { @@ -9669,7 +9850,8 @@ "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==" + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true }, "signal-exit": { "version": "3.0.2", @@ -9959,22 +10141,13 @@ } }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } + "strip-ansi": "^5.1.0" } }, "string.prototype.trimleft": { @@ -10668,6 +10841,25 @@ "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", "requires": { "string-width": "^2.1.1" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "windows-release": { @@ -10721,14 +10913,24 @@ "dev": true }, "wrap-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz", - "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", + "integrity": "sha512-uMTsj9rDb0/7kk1PbcbCcwvHUxp60fGDB/NNXpVa0Q+ic/e7y5+BwTxKfQ33VYgDppSwi/FBzpetYzo8s6tfbg==", "requires": { + "ansi-styles": "^3.2.0", "string-width": "^2.1.1", "strip-ansi": "^4.0.0" }, "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -10780,53 +10982,69 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.1.0.tgz", + "integrity": "sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==", "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^3.0.0", + "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" + "yargs-parser": "^16.1.0" }, "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "requires": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, - "locate-path": { + "is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "p-limit": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", - "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", "requires": { "p-try": "^2.0.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "requires": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" } }, "p-try": { @@ -10834,22 +11052,35 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" } } } }, "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz", + "integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==", "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/package.json b/package.json index b78a05e..c6d3b2b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "typescript": "^3.7.4" }, "dependencies": { - "@cto.ai/sdk": "^1.5.1", + "@cto.ai/inquirer": "^6.4.4", + "@cto.ai/sdk": "^2.0.4", "@octokit/rest": "^16.25.5", "debug": "^4.1.1", "fs-extra": "^8.0.1", @@ -39,6 +40,7 @@ "path": "^0.12.7", "simple-git": "^1.113.0", "strip-ansi": "^5.2.0", - "ts-node": "^8.1.0" + "ts-node": "^8.1.0", + "yargs": "^15.1.0" } } diff --git a/src/commands/issue:create.ts b/src/commands/issue:create.ts index a7a29e2..6c9f643 100644 --- a/src/commands/issue:create.ts +++ b/src/commands/issue:create.ts @@ -1,14 +1,13 @@ import { sdk, ux } from '@cto.ai/sdk' +import Debug from 'debug' import * as fs from 'fs' import * as path from 'path' -import Debug from 'debug' +import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' -import { CommandOptions } from '../types/Config' -import { AnsIssueTitleType, AnsIssueDescription } from '../types/Answers' -import { setConfig } from '../helpers/config' -import { ParseAndHandleError } from '../errors' import { hasIssueEnabled } from '../helpers/git' +import { AnsIssueDescription, AnsIssueTitleType } from '../types/Answers' +import { CommandOptions } from '../types/Config' const debug = Debug('github:issueCreate') diff --git a/src/commands/issue:done.ts b/src/commands/issue:done.ts index dd8c918..5aff5ee 100644 --- a/src/commands/issue:done.ts +++ b/src/commands/issue:done.ts @@ -1,18 +1,14 @@ -import branch from 'git-branch' +import { Question } from '@cto.ai/inquirer' +import { sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' -import { sdk, ux } from '@cto.ai/sdk' -import { checkCurrentRepo } from '../helpers/checkCurrentRepo' -import { CommandOptions } from '../types/Config' -import { getGithub } from '../helpers/getGithub' +import branch from 'git-branch' import { LABELS } from '../constants' -import { - AnsSelectYesNo, - AnsSelectContributor, - AnsPullRequest, -} from '../types/Answers' -import { Question } from '@cto.ai/inquirer' import { ParseAndHandleError } from '../errors' +import { checkCurrentRepo } from '../helpers/checkCurrentRepo' +import { getGithub } from '../helpers/getGithub' +import { AnsPullRequest, AnsSelectContributor, AnsSelectYesNo } from '../types/Answers' +import { CommandOptions } from '../types/Config' const debug = Debug('github:issueDone') const pullRequestQuestions: Question[] = [ diff --git a/src/commands/issue:list.ts b/src/commands/issue:list.ts index c87b292..48be57f 100644 --- a/src/commands/issue:list.ts +++ b/src/commands/issue:list.ts @@ -1,14 +1,14 @@ +import { Question } from '@cto.ai/inquirer' import { sdk, ux } from '@cto.ai/sdk' -import * as fuzzy from 'fuzzy' import * as Github from '@octokit/rest' import Debug from 'debug' +import * as fuzzy from 'fuzzy' +import { ParseAndHandleError } from '../errors' +import { getConfig } from '../helpers/config' import { getGithub } from '../helpers/getGithub' import { isRepoCloned } from '../helpers/isRepoCloned' -import { IssueListFuzzy, IssueListValue } from '../types/IssueTypes' import { AnsIssueList } from '../types/Answers' -import { Question } from '@cto.ai/inquirer' -import { getConfig } from '../helpers/config' -import { ParseAndHandleError } from '../errors' +import { IssueListFuzzy, IssueListValue } from '../types/IssueTypes' const debug = Debug('github:issueList') diff --git a/src/commands/issue:save.ts b/src/commands/issue:save.ts index 0800766..d19e8ed 100644 --- a/src/commands/issue:save.ts +++ b/src/commands/issue:save.ts @@ -1,11 +1,11 @@ +import { Question } from '@cto.ai/inquirer' import { sdk, ux } from '@cto.ai/sdk' -import branch from 'git-branch' import Debug from 'debug' -import { Question } from '@cto.ai/inquirer' +import branch from 'git-branch' +import { ParseAndHandleError } from '../errors' import { execPromisified } from '../helpers/execPromisified' import { checkLocalChanges } from '../helpers/git' import { AnsIssueSave } from '../types/Answers' -import { ParseAndHandleError } from '../errors' const debug = Debug('github:issueSave') diff --git a/src/commands/issue:search.ts b/src/commands/issue:search.ts index ec922af..f45e203 100644 --- a/src/commands/issue:search.ts +++ b/src/commands/issue:search.ts @@ -1,25 +1,20 @@ -import { ux, sdk } from '@cto.ai/sdk' +import { AutoCompleteQuestion, CheckboxQuestion } from '@cto.ai/inquirer' +import { sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' +import stripAnsi from 'strip-ansi' import { LABELS } from '../constants' -import { getGithub } from '../helpers/getGithub' +import { ParseAndHandleError } from '../errors' +import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { execPromisified } from '../helpers/execPromisified' +import { getGithub } from '../helpers/getGithub' import { checkForLocalBranch, makeInitialCommit } from '../helpers/git' -import { CheckboxQuestion } from '@cto.ai/inquirer' -import { AutoCompleteQuestion } from '@cto.ai/inquirer' -import stripAnsi from 'strip-ansi' -import { CommandOptions } from '../types/Config' -import { checkCurrentRepo } from '../helpers/checkCurrentRepo' -import { - IssueSelection, - IssueSelectionItem, - HelpInfo, - DataForFilter, -} from '../types/IssueTypes' import { AnsFilterSelect, AnsIssueSelect } from '../types/Answers' -import { ParseAndHandleError } from '../errors' +import { CommandOptions } from '../types/Config' +import { DataForFilter, HelpInfo, IssueSelection, IssueSelectionItem } from '../types/IssueTypes' const debug = Debug('github:issueSearch') +const yargs = require('yargs') const filterSelectPrompt = ( list: string[], @@ -148,7 +143,7 @@ export const issueSearch = async (cmdOptions: CommandOptions) => { let q = `is:issue+repo:${owner}/${repo}` //checks for query flag: -q || --query - const argv = sdk.yargs.alias('q', 'query').nargs('q', 1).argv + const argv = yargs.alias('q', 'query').nargs('q', 1).argv if (!argv.q) { const checkBoxlist = [ { diff --git a/src/commands/issue:start.ts b/src/commands/issue:start.ts index 8bb1e68..3490280 100644 --- a/src/commands/issue:start.ts +++ b/src/commands/issue:start.ts @@ -1,14 +1,14 @@ +import { Question } from '@cto.ai/inquirer' import { sdk, ux } from '@cto.ai/sdk' import Debug from 'debug' -import { CommandOptions } from '../types/Config' +import { LABELS } from '../constants' +import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { execPromisified } from '../helpers/execPromisified' import { getGithub } from '../helpers/getGithub' -import { LABELS } from '../constants' import { checkForLocalBranch, makeInitialCommit } from '../helpers/git' -import { Question } from '@cto.ai/inquirer' import { AnsSelectIssueStart } from '../types/Answers' -import { ParseAndHandleError } from '../errors' +import { CommandOptions } from '../types/Config' const debug = Debug('github:issueStart') diff --git a/src/commands/label:add.ts b/src/commands/label:add.ts index d753d33..48b348a 100644 --- a/src/commands/label:add.ts +++ b/src/commands/label:add.ts @@ -1,14 +1,14 @@ +import { Question } from '@cto.ai/inquirer' import { sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' +import { ParseAndHandleError } from '../errors' +import { checkCurrentRepo } from '../helpers/checkCurrentRepo' +import { getGithub } from '../helpers/getGithub' import { createLabels } from '../helpers/labels' +import { AnsSelectReposForLabel, AnsSelectYesNo } from '../types/Answers' import { CommandOptions } from '../types/Config' -import { getGithub } from '../helpers/getGithub' import { LabelKeys } from '../types/Labels' -import { Question } from '@cto.ai/inquirer' -import { AnsSelectYesNo, AnsSelectReposForLabel } from '../types/Answers' -import { checkCurrentRepo } from '../helpers/checkCurrentRepo' -import { ParseAndHandleError } from '../errors' const debug = Debug('github:labelAdd') diff --git a/src/commands/label:edit.ts b/src/commands/label:edit.ts index 130efdd..c7968a0 100644 --- a/src/commands/label:edit.ts +++ b/src/commands/label:edit.ts @@ -1,27 +1,15 @@ +import { Question } from '@cto.ai/inquirer' +import { sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' -import { ux, sdk } from '@cto.ai/sdk' -import * as fuzzy from 'fuzzy' import Debug from 'debug' +import * as fuzzy from 'fuzzy' +import { ParseAndHandleError } from '../errors' +import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' -import { - getAllLabelsForRepo, - editLabel, - findReposWithSelectedLabel, -} from '../helpers/labels' +import { editLabel, findReposWithSelectedLabel, getAllLabelsForRepo } from '../helpers/labels' +import { AnsSelectLabelEdit, AnsSelectReposForLabel, AnsSelectYesNo } from '../types/Answers' import { CommandOptions } from '../types/Config' -import { - LabelEditFormattedItem, - LabelKeys, - RepoWithOwnerAndName, -} from '../types/Labels' -import { Question } from '@cto.ai/inquirer' -import { - AnsSelectLabelEdit, - AnsSelectYesNo, - AnsSelectReposForLabel, -} from '../types/Answers' -import { checkCurrentRepo } from '../helpers/checkCurrentRepo' -import { ParseAndHandleError } from '../errors' +import { LabelEditFormattedItem, LabelKeys, RepoWithOwnerAndName } from '../types/Labels' const debug = Debug('github:labelEdit') diff --git a/src/commands/label:remove.ts b/src/commands/label:remove.ts index 9b2ae2d..ab80de3 100644 --- a/src/commands/label:remove.ts +++ b/src/commands/label:remove.ts @@ -1,27 +1,15 @@ -import * as Github from '@octokit/rest' -import { sdk, ux } from '@cto.ai/sdk' -import * as fuzzy from 'fuzzy' import { Question } from '@cto.ai/inquirer' +import { sdk, ux } from '@cto.ai/sdk' +import * as Github from '@octokit/rest' import Debug from 'debug' +import * as fuzzy from 'fuzzy' +import { ParseAndHandleError } from '../errors' +import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' -import { - getAllLabelsForRepo, - removeLabel, - findReposWithSelectedLabel, -} from '../helpers/labels' +import { findReposWithSelectedLabel, getAllLabelsForRepo, removeLabel } from '../helpers/labels' +import { AnsSelectLabelRemove, AnsSelectReposForLabel, AnsSelectYesNo } from '../types/Answers' import { CommandOptions } from '../types/Config' -import { - LabelRemoveFormattedItem, - LabelRemoveFormattedItemValue, - RepoWithOwnerAndName, -} from '../types/Labels' -import { - AnsSelectLabelRemove, - AnsSelectYesNo, - AnsSelectReposForLabel, -} from '../types/Answers' -import { checkCurrentRepo } from '../helpers/checkCurrentRepo' -import { ParseAndHandleError } from '../errors' +import { LabelRemoveFormattedItem, LabelRemoveFormattedItemValue, RepoWithOwnerAndName } from '../types/Labels' const debug = Debug('github:labelRemove') diff --git a/src/commands/label:sync.ts b/src/commands/label:sync.ts index 62ab7ec..aef317b 100644 --- a/src/commands/label:sync.ts +++ b/src/commands/label:sync.ts @@ -1,18 +1,13 @@ +import { AutoCompleteQuestion, Question } from '@cto.ai/inquirer' +import { sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' -import { ux, sdk } from '@cto.ai/sdk' -import { Question, AutoCompleteQuestion } from '@cto.ai/inquirer' import Debug from 'debug' +import { ParseAndHandleError } from '../errors' import { getGithub } from '../helpers/getGithub' -import { getAllLabelsForRepo, createLabels } from '../helpers/labels' -import { - LabelEditFormattedItem, - LabelKeys, - RepoWithOwnerAndName, - RepoWithLabelsToAdd, -} from '../types/Labels' -import { AnsBaseRepo, AnsSyncRepo } from '../types/Answers' import { listRepos } from '../helpers/git' -import { ParseAndHandleError } from '../errors' +import { createLabels, getAllLabelsForRepo } from '../helpers/labels' +import { AnsBaseRepo, AnsSyncRepo } from '../types/Answers' +import { LabelEditFormattedItem, LabelKeys, RepoWithLabelsToAdd, RepoWithOwnerAndName } from '../types/Labels' const debug = Debug('github:labelSync') diff --git a/src/commands/pulls:list.ts b/src/commands/pulls:list.ts index 668ad03..6184763 100644 --- a/src/commands/pulls:list.ts +++ b/src/commands/pulls:list.ts @@ -1,14 +1,14 @@ +import { Question } from '@cto.ai/inquirer' import { sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' -import * as fuzzy from 'fuzzy' -import { Question } from '@cto.ai/inquirer' import Debug from 'debug' -import { CommandOptions } from '../types/Config' +import * as fuzzy from 'fuzzy' +import { ParseAndHandleError } from '../errors' +import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' -import { PullsListFuzzy, PullsListValue } from '../types/PullsTypes' import { AnsSelectPull } from '../types/Answers' -import { checkCurrentRepo } from '../helpers/checkCurrentRepo' -import { ParseAndHandleError } from '../errors' +import { CommandOptions } from '../types/Config' +import { PullsListFuzzy, PullsListValue } from '../types/PullsTypes' let formattedList = [] diff --git a/src/commands/repo:clone.ts b/src/commands/repo:clone.ts index c550a07..b8d8c92 100644 --- a/src/commands/repo:clone.ts +++ b/src/commands/repo:clone.ts @@ -1,18 +1,18 @@ -import { sdk, ux } from '@cto.ai/sdk' -import * as fuzzy from 'fuzzy' import { Question } from '@cto.ai/inquirer' +import { sdk, ux } from '@cto.ai/sdk' import Debug from 'debug' -import { CommandOptions } from '../types/Config' -import { SelectedRepoClone, FormattedRepoClone } from '../types/RepoTypes' -import { Fuzzy } from '../types/Fuzzy' +import * as fuzzy from 'fuzzy' +import { ParseAndHandleError } from '../errors' +import { getConfig } from '../helpers/config' import { getGithub } from '../helpers/getGithub' -import { saveRemoteRepoToConfig } from '../helpers/saveRemoteRepoToConfig' import { cloneRepo } from '../helpers/git' import { insertTokenInUrl } from '../helpers/insertTokenInUrl' import { isRepoCloned } from '../helpers/isRepoCloned' +import { saveRemoteRepoToConfig } from '../helpers/saveRemoteRepoToConfig' import { AnsRepoCloneSelect } from '../types/Answers' -import { getConfig } from '../helpers/config' -import { ParseAndHandleError } from '../errors' +import { CommandOptions } from '../types/Config' +import { Fuzzy } from '../types/Fuzzy' +import { FormattedRepoClone, SelectedRepoClone } from '../types/RepoTypes' const debug = Debug('github:repoClone') diff --git a/src/commands/repo:create.ts b/src/commands/repo:create.ts index 61e854e..14449b3 100644 --- a/src/commands/repo:create.ts +++ b/src/commands/repo:create.ts @@ -1,19 +1,19 @@ +import { Question } from '@cto.ai/inquirer' import { sdk, ux } from '@cto.ai/sdk' +import * as Github from '@octokit/rest' +import Debug from 'debug' import * as fs from 'fs-extra' import * as path from 'path' -import * as Github from '@octokit/rest' import simplegit from 'simple-git/promise' -import { Question } from '@cto.ai/inquirer' -import Debug from 'debug' +import { LABELS } from '../constants' +import { ParseAndHandleError } from '../errors' +import { execPromisified } from '../helpers/execPromisified' import { getGithub } from '../helpers/getGithub' import { insertTokenInUrl } from '../helpers/insertTokenInUrl' -import { execPromisified } from '../helpers/execPromisified' -import { saveRemoteRepoToConfig } from '../helpers/saveRemoteRepoToConfig' -import { LABELS } from '../constants' import { createLabels } from '../helpers/labels' +import { saveRemoteRepoToConfig } from '../helpers/saveRemoteRepoToConfig' import { AnsRepoCreate } from '../types/Answers' import { CommandOptions } from '../types/Config' -import { ParseAndHandleError } from '../errors' const debug = Debug('github:repoCreate') @@ -136,7 +136,7 @@ const createGithubRepo = async ( const response = await github.repos.createInOrg({ org, ...options }) return response } catch (err) { - console.log(err) + ux.print(err) ux.spinner.stop('failed!') await ParseAndHandleError(err, 'createRepo()') } @@ -155,7 +155,7 @@ export const repoCreate = async ({ accessToken }: CommandOptions) => { const answers = await getRepoInfoFromUser(orgs, personalAccountLogin) - ux.spinner.start('Creating repo') + await ux.spinner.start('Creating repo') const { data: { clone_url, name, owner }, diff --git a/src/commands/token:update.ts b/src/commands/token:update.ts index 3c82173..0d12f73 100644 --- a/src/commands/token:update.ts +++ b/src/commands/token:update.ts @@ -1,9 +1,9 @@ +import { Question } from '@cto.ai/inquirer' import { ux } from '@cto.ai/sdk' import Debug from 'debug' -import { Question } from '@cto.ai/inquirer' -import { AnsToken } from '../types/Answers' -import { setConfig } from '../helpers/config' import { ParseAndHandleError } from '../errors' +import { setConfig } from '../helpers/config' +import { AnsToken } from '../types/Answers' const debug = Debug('github:tokenUpdate') diff --git a/src/errors/index.ts b/src/errors/index.ts index 5f799f6..bfd7f45 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -1,10 +1,6 @@ import { sdk, ux } from '@cto.ai/sdk' -import { - CREDS_ERROR_MSG, - NOT_GIT_REPO_ERROR_MSG, - NO_CMD_ERROR_MSG, -} from './constants' import { setConfig } from '@cto.ai/sdk/dist/sdk' +import { CREDS_ERROR_MSG, NOT_GIT_REPO_ERROR_MSG, NO_CMD_ERROR_MSG } from './constants' export * from './credentials' const ERROR_TAGS = ['github', 'error handler'] @@ -55,7 +51,7 @@ export const ParseAndHandleError = async ( sdk.log(`šŸ˜… The label ${labelName} does not exist for this repo!`) process.exit() } else if (err.status && err.status === 404) { - console.log(err) + ux.print(err) sdk.log( `šŸ˜… This Github repo either does not exist, or you do not have user permissions to access this repo's details!`, ) @@ -75,7 +71,7 @@ export const ParseAndHandleError = async ( err.status === 422 && command === 'Creating Pull Request' ) { - console.log(err) + ux.print(err) sdk.log( `āŒ Creating pull request failed due to validation error. \nšŸ· Make sure to commit and push code using ${callOutCyan( 'issue:save', @@ -89,7 +85,7 @@ export const ParseAndHandleError = async ( process.exit() } else { // base case - console.log(err) + ux.print(err) // process.exit() } } diff --git a/src/helpers/asyncPipe.ts b/src/helpers/asyncPipe.ts index ab3e195..9852b34 100644 --- a/src/helpers/asyncPipe.ts +++ b/src/helpers/asyncPipe.ts @@ -4,7 +4,7 @@ const asyncPipe = (...fns: Function[]) => (param?: any) => fns.reduce(async (acc, fn) => fn(await acc), param) const _trace = (msg: string) => (x: any) => { - console.log(msg, x) + ux.print(msg + ' ' + x) return x } diff --git a/src/helpers/checkCurrentRepo.ts b/src/helpers/checkCurrentRepo.ts index 26d126e..b81f673 100644 --- a/src/helpers/checkCurrentRepo.ts +++ b/src/helpers/checkCurrentRepo.ts @@ -1,9 +1,9 @@ const parse = require('parse-git-config') -import { ux, sdk } from '@cto.ai/sdk' +import { sdk, ux } from '@cto.ai/sdk' +import { ParseAndHandleError } from '../errors' import { CommandOptions } from '../types/Config' import { execPromisified } from './execPromisified' import { saveRemoteRepoToConfig } from './saveRemoteRepoToConfig' -import { ParseAndHandleError } from '../errors' const REPO_OWNER_REGEX = /(?<=github\.com(\/|:))[a-z0-9A-Z]+/g const REPO_NAME_REGEX = /(?<=github\.com(\/|:)[a-z0-9A-Z]+\/)[a-z0-9A-Z-]+/g diff --git a/src/helpers/execPromisified.ts b/src/helpers/execPromisified.ts index 7072b9d..86a8bf3 100644 --- a/src/helpers/execPromisified.ts +++ b/src/helpers/execPromisified.ts @@ -1,4 +1,4 @@ -import * as util from 'util' import { exec } from 'child_process' +import * as util from 'util' export const execPromisified = util.promisify(exec) diff --git a/src/helpers/getGithub.ts b/src/helpers/getGithub.ts index 50155ab..fc6d8af 100644 --- a/src/helpers/getGithub.ts +++ b/src/helpers/getGithub.ts @@ -1,8 +1,8 @@ import Github from '@octokit/rest' import Debug from 'debug' - -import { getConfig } from './config' import { CredentialsError, ParseAndHandleError } from '../errors' +import { getConfig } from './config' + const debug = Debug('github:getGithub') diff --git a/src/helpers/git.ts b/src/helpers/git.ts index c6426be..b9033a1 100644 --- a/src/helpers/git.ts +++ b/src/helpers/git.ts @@ -1,7 +1,7 @@ -import { execPromisified } from '../helpers/execPromisified' import * as Github from '@octokit/rest' import Debug from 'debug' import { ParseAndHandleError } from '../errors' +import { execPromisified } from '../helpers/execPromisified' const debug = Debug('github:gitHelpers') diff --git a/src/helpers/labels.ts b/src/helpers/labels.ts index 438bc23..b19767a 100644 --- a/src/helpers/labels.ts +++ b/src/helpers/labels.ts @@ -1,9 +1,9 @@ import * as Github from '@octokit/rest' import Debug from 'debug' -import { RepoLabel } from '../types/RepoTypes' -import { LabelKeys, RepoWithOwnerAndName } from '../types/Labels' -import { listReposForOrg } from '../helpers/git' import { ParseAndHandleError } from '../errors' +import { listReposForOrg } from '../helpers/git' +import { LabelKeys, RepoWithOwnerAndName } from '../types/Labels' +import { RepoLabel } from '../types/RepoTypes' const debug = Debug('github:labelHelper') /** diff --git a/src/helpers/saveRemoteRepoToConfig.ts b/src/helpers/saveRemoteRepoToConfig.ts index b0ba920..512cfb3 100644 --- a/src/helpers/saveRemoteRepoToConfig.ts +++ b/src/helpers/saveRemoteRepoToConfig.ts @@ -1,7 +1,6 @@ import Debug from 'debug' - -import { getConfig, setConfig } from './config' import { ParseAndHandleError } from '../errors' +import { getConfig, setConfig } from './config' const debug = Debug('github:saveToConfig') diff --git a/src/index.ts b/src/index.ts index 820cf2d..1f3c0cb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,27 +2,27 @@ const parse = require('parse-git-config') const util = require('util') const exec = util.promisify(require('child_process').exec) const Debug = require('debug') +const yargs = require('yargs') -import { getGithub } from './helpers/getGithub' -import { asyncPipe } from './helpers/asyncPipe' -import { getConfig, setConfig } from './helpers/config' -import { updateAccessToken } from './commands/token:update' -import { issueList } from './commands/issue:list' import { issueCreate } from './commands/issue:create' import { issueDone } from './commands/issue:done' +import { issueList } from './commands/issue:list' import { issueSave } from './commands/issue:save' -import { issueStart } from './commands/issue:start' import { issueSearch } from './commands/issue:search' -import { repoClone } from './commands/repo:clone' -import { repoCreate } from './commands/repo:create' +import { issueStart } from './commands/issue:start' import { labelAdd } from './commands/label:add' import { labelEdit } from './commands/label:edit' import { labelRemove } from './commands/label:remove' import { labelSync } from './commands/label:sync' import { pullsList } from './commands/pulls:list' -import { logProvideCmdMsg } from './helpers/logProvideCmdMsg' -import { sdk } from '@cto.ai/sdk' +import { repoClone } from './commands/repo:clone' +import { repoCreate } from './commands/repo:create' +import { updateAccessToken } from './commands/token:update' import { ParseAndHandleError } from './errors' +import { asyncPipe } from './helpers/asyncPipe' +import { getConfig, setConfig } from './helpers/config' +import { getGithub } from './helpers/getGithub' +import { logProvideCmdMsg } from './helpers/logProvideCmdMsg' const debug = Debug('github') @@ -74,7 +74,7 @@ const shouldSkipTokenAuthentication = (args: string[]): boolean => !!commands[args[0]].skipTokenAuthentication const parseArguments = async (): Promise> => { - const args = sdk.yargs.argv + const args = yargs.argv if (!args._.length) { // log user friendly message when user does not provide a command diff --git a/src/types/Answers.ts b/src/types/Answers.ts index ff5e46b..c2e1a6f 100644 --- a/src/types/Answers.ts +++ b/src/types/Answers.ts @@ -1,16 +1,7 @@ -import { SelectedRepoClone } from './RepoTypes' +import { IssueListValue, IssueStartValue, IssueValue, RepoContributor } from './IssueTypes' +import { LabelKeys, LabelRemoveFormattedItemValue, RepoWithOwnerAndName } from './Labels' import { PullsListValue } from './PullsTypes' -import { - LabelRemoveFormattedItemValue, - RepoWithOwnerAndName, - LabelKeys, -} from './Labels' -import { - IssueStartValue, - IssueListValue, - RepoContributor, - IssueValue, -} from './IssueTypes' +import { SelectedRepoClone } from './RepoTypes' export interface AnsIssueTitleType { title: string diff --git a/src/types/IssueTypes.ts b/src/types/IssueTypes.ts index 0eee2af..11db609 100644 --- a/src/types/IssueTypes.ts +++ b/src/types/IssueTypes.ts @@ -1,4 +1,4 @@ -import { AutoCompleteQuestion } from '@cto.ai/inquirer' +import { AutoCompleteQuestion } from '@cto.ai/inquirer'; export interface IssueListValue { title: string diff --git a/tests_e2e/commands/issue:create.e2e.ts b/tests_e2e/commands/issue:create.e2e.ts index ac1ff7f..0e3c73c 100644 --- a/tests_e2e/commands/issue:create.e2e.ts +++ b/tests_e2e/commands/issue:create.e2e.ts @@ -39,7 +39,7 @@ describe('issue:create happy path', () => { const originUrl = gitconfig['remote "origin"'].url const github = await getGithub() if (!originUrl.includes('github')) { - console.log( + ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() diff --git a/tests_e2e/commands/issue:done.e2e.ts b/tests_e2e/commands/issue:done.e2e.ts index 6a777c5..56c36f3 100644 --- a/tests_e2e/commands/issue:done.e2e.ts +++ b/tests_e2e/commands/issue:done.e2e.ts @@ -31,7 +31,7 @@ describe('issue:done happy path', () => { const originUrl = gitconfig['remote "origin"'].url const github = await getGithub() if (!originUrl.includes('github')) { - console.log( + ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() diff --git a/tests_e2e/utils/cleanupFn.ts b/tests_e2e/utils/cleanupFn.ts index 2e8fe1a..1b3c532 100644 --- a/tests_e2e/utils/cleanupFn.ts +++ b/tests_e2e/utils/cleanupFn.ts @@ -13,7 +13,7 @@ const cleanRepoCreate = async () => { const originUrl = gitconfig['remote "origin"'].url const github = await getGithub() if (!originUrl.includes('github')) { - console.log( + ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() @@ -64,7 +64,7 @@ const cleanIssueCreate = async () => { const originUrl = gitconfig['remote "origin"'].url const github = await getGithub() if (!originUrl.includes('github')) { - console.log( + ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() diff --git a/tests_e2e/utils/cmd.ts b/tests_e2e/utils/cmd.ts index 2514921..d5e29cb 100644 --- a/tests_e2e/utils/cmd.ts +++ b/tests_e2e/utils/cmd.ts @@ -68,7 +68,7 @@ async function run({ }) } -const sendInput = function( +const sendInput = function ( inputs: string[], child: ChildProcess, timeout: number, @@ -85,7 +85,7 @@ const sendInput = function( child.stdin.write(firstInput) } } catch (error) { - console.log('%O', error) + ux.print('%O' + error) } sendInput(remainingInputs, child, timeout) @@ -95,7 +95,7 @@ const sendInput = function( const cleanup = async (command: string) => { try { await cleanupFn[command]() - console.log('cleanup endpoint hit successfully') + ux.print('cleanup endpoint hit successfully') } catch (err) { console.error({ err }) } From 214d10917aed5edc3eeab28bac69af7e7366e678 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Tue, 7 Jan 2020 15:14:48 -0800 Subject: [PATCH 03/33] Await ux.print. Fix tests. Signed-off-by: Vincent Tan --- src/commands/repo:create.ts | 2 +- src/errors/index.ts | 6 +++--- src/helpers/asyncPipe.ts | 4 +++- tests_e2e/commands/issue:create.e2e.ts | 11 ++++++----- tests_e2e/commands/issue:done.e2e.ts | 11 ++++++----- tests_e2e/commands/issue:start.e2e.ts | 6 +++--- tests_e2e/commands/repo:clone.e2e.ts | 4 ++-- tests_e2e/commands/repo:create.e2e.ts | 4 ++-- tests_e2e/utils/cleanupFn.ts | 12 +++++------- tests_e2e/utils/cmd.ts | 19 ++++++++----------- tsconfig.json | 7 +++++-- 11 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/commands/repo:create.ts b/src/commands/repo:create.ts index 14449b3..68680c7 100644 --- a/src/commands/repo:create.ts +++ b/src/commands/repo:create.ts @@ -136,7 +136,7 @@ const createGithubRepo = async ( const response = await github.repos.createInOrg({ org, ...options }) return response } catch (err) { - ux.print(err) + await ux.print(err) ux.spinner.stop('failed!') await ParseAndHandleError(err, 'createRepo()') } diff --git a/src/errors/index.ts b/src/errors/index.ts index bfd7f45..f502697 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -51,7 +51,7 @@ export const ParseAndHandleError = async ( sdk.log(`šŸ˜… The label ${labelName} does not exist for this repo!`) process.exit() } else if (err.status && err.status === 404) { - ux.print(err) + await ux.print(err) sdk.log( `šŸ˜… This Github repo either does not exist, or you do not have user permissions to access this repo's details!`, ) @@ -71,7 +71,7 @@ export const ParseAndHandleError = async ( err.status === 422 && command === 'Creating Pull Request' ) { - ux.print(err) + await ux.print(err) sdk.log( `āŒ Creating pull request failed due to validation error. \nšŸ· Make sure to commit and push code using ${callOutCyan( 'issue:save', @@ -85,7 +85,7 @@ export const ParseAndHandleError = async ( process.exit() } else { // base case - ux.print(err) + await ux.print(err) // process.exit() } } diff --git a/src/helpers/asyncPipe.ts b/src/helpers/asyncPipe.ts index 9852b34..8deb049 100644 --- a/src/helpers/asyncPipe.ts +++ b/src/helpers/asyncPipe.ts @@ -1,10 +1,12 @@ +import { ux } from "@cto.ai/sdk" + // based on https://github.com/obengwilliam/pipeawait const asyncPipe = (...fns: Function[]) => (param?: any) => fns.reduce(async (acc, fn) => fn(await acc), param) const _trace = (msg: string) => (x: any) => { - ux.print(msg + ' ' + x) + await ux.print(msg + ' ' + x) return x } diff --git a/tests_e2e/commands/issue:create.e2e.ts b/tests_e2e/commands/issue:create.e2e.ts index 0e3c73c..6de66c1 100644 --- a/tests_e2e/commands/issue:create.e2e.ts +++ b/tests_e2e/commands/issue:create.e2e.ts @@ -1,9 +1,10 @@ -import { run, cleanup, signin } from '../utils/cmd' -import { ENTER, A, Q, COLON } from '../utils/constants' -import { getGithub } from '../../src/helpers/getGithub' -import { execPromisified } from '../../src/helpers/execPromisified' +import { ux } from '@cto.ai/sdk' import parse from 'parse-git-config' import { filterForRepoInfo } from '../../src/helpers/checkCurrentRepo' +import { execPromisified } from '../../src/helpers/execPromisified' +import { getGithub } from '../../src/helpers/getGithub' +import { cleanup, run, signin } from '../utils/cmd' +import { A, COLON, ENTER, Q } from '../utils/constants' beforeAll(async () => { await signin() @@ -39,7 +40,7 @@ describe('issue:create happy path', () => { const originUrl = gitconfig['remote "origin"'].url const github = await getGithub() if (!originUrl.includes('github')) { - ux.print( + await ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() diff --git a/tests_e2e/commands/issue:done.e2e.ts b/tests_e2e/commands/issue:done.e2e.ts index 56c36f3..2e3d668 100644 --- a/tests_e2e/commands/issue:done.e2e.ts +++ b/tests_e2e/commands/issue:done.e2e.ts @@ -1,9 +1,10 @@ -import { run, cleanup, signin } from '../utils/cmd' -import { ENTER, A, Q, N, COLON } from '../utils/constants' -import { getGithub } from '../../src/helpers/getGithub' -import { execPromisified } from '../../src/helpers/execPromisified' +import { ux } from '@cto.ai/sdk' import parse from 'parse-git-config' import { filterForRepoInfo } from '../../src/helpers/checkCurrentRepo' +import { execPromisified } from '../../src/helpers/execPromisified' +import { getGithub } from '../../src/helpers/getGithub' +import { cleanup, run, signin } from '../utils/cmd' +import { A, COLON, ENTER, N, Q } from '../utils/constants' beforeAll(async () => { await signin() @@ -31,7 +32,7 @@ describe('issue:done happy path', () => { const originUrl = gitconfig['remote "origin"'].url const github = await getGithub() if (!originUrl.includes('github')) { - ux.print( + await ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() diff --git a/tests_e2e/commands/issue:start.e2e.ts b/tests_e2e/commands/issue:start.e2e.ts index 5695bdf..96ec9c9 100644 --- a/tests_e2e/commands/issue:start.e2e.ts +++ b/tests_e2e/commands/issue:start.e2e.ts @@ -1,7 +1,7 @@ -import { run, cleanup, signin } from '../utils/cmd' -import { ENTER, A, Q, COLON } from '../utils/constants' -import { checkForLocalBranch } from '../../src/helpers/git' import { execPromisified } from '../../src/helpers/execPromisified' +import { checkForLocalBranch } from '../../src/helpers/git' +import { cleanup, run, signin } from '../utils/cmd' +import { A, COLON, ENTER, Q } from '../utils/constants' beforeAll(async () => { await signin() diff --git a/tests_e2e/commands/repo:clone.e2e.ts b/tests_e2e/commands/repo:clone.e2e.ts index 930714a..c523679 100644 --- a/tests_e2e/commands/repo:clone.e2e.ts +++ b/tests_e2e/commands/repo:clone.e2e.ts @@ -1,6 +1,6 @@ -import { run, cleanup, signin, signout } from '../utils/cmd' -import { ENTER } from '../utils/constants' import { execPromisified } from '../../src/helpers/execPromisified' +import { cleanup, run, signin } from '../utils/cmd' +import { ENTER } from '../utils/constants' beforeAll(async () => { await signin() diff --git a/tests_e2e/commands/repo:create.e2e.ts b/tests_e2e/commands/repo:create.e2e.ts index 602e68f..18dcff4 100644 --- a/tests_e2e/commands/repo:create.e2e.ts +++ b/tests_e2e/commands/repo:create.e2e.ts @@ -1,6 +1,6 @@ -import { run, cleanup, sleep, signin, signout } from '../utils/cmd' -import { ENTER, A } from '../utils/constants' import { execPromisified } from '../../src/helpers/execPromisified' +import { cleanup, run, sleep } from '../utils/cmd' +import { A, ENTER } from '../utils/constants' beforeAll(async () => { // await signin() diff --git a/tests_e2e/utils/cleanupFn.ts b/tests_e2e/utils/cleanupFn.ts index 1b3c532..a84cb3b 100644 --- a/tests_e2e/utils/cleanupFn.ts +++ b/tests_e2e/utils/cleanupFn.ts @@ -1,10 +1,8 @@ -import { getGithub } from '../../src/helpers/getGithub' -import { filterForRepoInfo } from '../../src/helpers/checkCurrentRepo' -import { execPromisified } from '../../src/helpers/execPromisified' -import { getConfig, setConfig } from '../../src/helpers/config' -import { sdk } from '@cto.ai/sdk' import fs from 'fs' import parse from 'parse-git-config' +import { filterForRepoInfo } from '../../src/helpers/checkCurrentRepo' +import { execPromisified } from '../../src/helpers/execPromisified' +import { getGithub } from '../../src/helpers/getGithub' import { TEAM_NAME_IDENTIFIER } from './constants' const cleanRepoCreate = async () => { @@ -13,7 +11,7 @@ const cleanRepoCreate = async () => { const originUrl = gitconfig['remote "origin"'].url const github = await getGithub() if (!originUrl.includes('github')) { - ux.print( + await ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() @@ -64,7 +62,7 @@ const cleanIssueCreate = async () => { const originUrl = gitconfig['remote "origin"'].url const github = await getGithub() if (!originUrl.includes('github')) { - ux.print( + await ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() diff --git a/tests_e2e/utils/cmd.ts b/tests_e2e/utils/cmd.ts index d5e29cb..e91d2e2 100644 --- a/tests_e2e/utils/cmd.ts +++ b/tests_e2e/utils/cmd.ts @@ -1,14 +1,10 @@ -import { spawn, ChildProcess, SpawnOptions } from 'child_process' -import { cleanupFn } from '../utils/cleanupFn' -import Debug from 'debug' +import { ux } from '@cto.ai/sdk' +import { ChildProcess, spawn, SpawnOptions } from 'child_process' import concat from 'concat-stream' -import { - OP_NAME, - OP_PATH, - EXISTING_USER_NAME, - EXISTING_USER_PASSWORD, -} from '../utils/constants' +import Debug from 'debug' import { execPromisified } from '../../src/helpers/execPromisified' +import { cleanupFn } from '../utils/cleanupFn' +import { EXISTING_USER_NAME, EXISTING_USER_PASSWORD, OP_NAME, OP_PATH } from '../utils/constants' const debugVerbose = Debug('cmd:verbose') @@ -85,7 +81,7 @@ const sendInput = function ( child.stdin.write(firstInput) } } catch (error) { - ux.print('%O' + error) + await ux.print('%O' + error) } sendInput(remainingInputs, child, timeout) @@ -95,7 +91,7 @@ const sendInput = function ( const cleanup = async (command: string) => { try { await cleanupFn[command]() - ux.print('cleanup endpoint hit successfully') + await ux.print('cleanup endpoint hit successfully') } catch (err) { console.error({ err }) } @@ -118,3 +114,4 @@ const signout = async () => { } export { run, sleep, cleanup, signin, signout } + diff --git a/tsconfig.json b/tsconfig.json index fdd2b19..d78e4bf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,8 +3,11 @@ "module": "commonjs", "target": "ESNext", "outDir": "lib/", - "rootDir": "src/", - "lib": ["es2015", "esnext"], + "rootDir": "./", + "lib": [ + "es2015", + "esnext" + ], "sourceMap": true, "esModuleInterop": true } From 771d05d07e403fea4e623b29f1a10110ba990a5a Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Tue, 7 Jan 2020 15:19:44 -0800 Subject: [PATCH 04/33] Temporarily fix prints that are now async, inside non-async functions Signed-off-by: Vincent Tan --- src/helpers/asyncPipe.ts | 3 ++- tests_e2e/utils/cleanupFn.ts | 1 + tests_e2e/utils/cmd.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/helpers/asyncPipe.ts b/src/helpers/asyncPipe.ts index 8deb049..6e23916 100644 --- a/src/helpers/asyncPipe.ts +++ b/src/helpers/asyncPipe.ts @@ -6,7 +6,8 @@ const asyncPipe = (...fns: Function[]) => (param?: any) => fns.reduce(async (acc, fn) => fn(await acc), param) const _trace = (msg: string) => (x: any) => { - await ux.print(msg + ' ' + x) + //TODO: this should/should not be async + ux.print(msg + ' ' + x) return x } diff --git a/tests_e2e/utils/cleanupFn.ts b/tests_e2e/utils/cleanupFn.ts index a84cb3b..7fa045b 100644 --- a/tests_e2e/utils/cleanupFn.ts +++ b/tests_e2e/utils/cleanupFn.ts @@ -4,6 +4,7 @@ import { filterForRepoInfo } from '../../src/helpers/checkCurrentRepo' import { execPromisified } from '../../src/helpers/execPromisified' import { getGithub } from '../../src/helpers/getGithub' import { TEAM_NAME_IDENTIFIER } from './constants' +import { ux } from '@cto.ai/sdk' const cleanRepoCreate = async () => { try { diff --git a/tests_e2e/utils/cmd.ts b/tests_e2e/utils/cmd.ts index e91d2e2..faecbd5 100644 --- a/tests_e2e/utils/cmd.ts +++ b/tests_e2e/utils/cmd.ts @@ -81,7 +81,8 @@ const sendInput = function ( child.stdin.write(firstInput) } } catch (error) { - await ux.print('%O' + error) + //TODO: this should/should not be async + ux.print('%O' + error) } sendInput(remainingInputs, child, timeout) From 856c36f2bfbd22ae268dd7acbc8dbd7d1e47e1b7 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Tue, 7 Jan 2020 15:43:27 -0800 Subject: [PATCH 05/33] Removed inquirer. Use sdk for types Signed-off-by: Vincent Tan --- package-lock.json | 1328 ++-------------------------------- package.json | 2 - src/commands/issue:create.ts | 4 +- src/commands/issue:done.ts | 7 +- src/commands/issue:list.ts | 3 +- src/commands/issue:save.ts | 5 +- src/commands/issue:search.ts | 5 +- src/commands/issue:start.ts | 3 +- src/commands/label:add.ts | 9 +- src/commands/label:edit.ts | 9 +- src/commands/label:remove.ts | 3 +- src/commands/pulls:list.ts | 3 +- src/commands/repo:clone.ts | 3 +- src/commands/repo:create.ts | 11 +- src/commands/token:update.ts | 4 +- src/helpers/asyncPipe.ts | 1 + src/helpers/getGithub.ts | 1 - tests_e2e/utils/cleanupFn.ts | 2 +- 18 files changed, 89 insertions(+), 1314 deletions(-) diff --git a/package-lock.json b/package-lock.json index cecd520..9231449 100644 --- a/package-lock.json +++ b/package-lock.json @@ -237,55 +237,6 @@ } } }, - "@cto.ai/inquirer": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/@cto.ai/inquirer/-/inquirer-6.4.4.tgz", - "integrity": "sha512-GvKEFR//zy67O7OXbwNfE1ADgHf1884KZPrtVFTOOmrFGN5wfLzJSGTxESZl7FN/y0JxkZJi8uVNs/JGDJGgJg==", - "requires": { - "@types/inquirer": "^6.0.3", - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "chalk-pipe": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "dateformat": "^3.0.3", - "datejs": "^1.0.0-rc3", - "emoj": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "fuzzy": "^0.1.3", - "inquirer-autocomplete-prompt": "^1.0.1", - "lodash": "^4.17.15", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "rxjs-compat": "^6.5.2", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - } - } - }, "@cto.ai/sdk": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@cto.ai/sdk/-/sdk-2.0.4.tgz", @@ -761,15 +712,6 @@ "@types/node": "*" } }, - "@types/inquirer": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-6.5.0.tgz", - "integrity": "sha512-rjaYQ9b9y/VFGOpqBEXRavc3jh0a+e6evAbI31tMda8VlPaSy0AZJfXsvmIe3wklc7W6C3zCSfleuMXR7NOyXw==", - "requires": { - "@types/through": "*", - "rxjs": "^6.4.0" - } - }, "@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -815,14 +757,6 @@ "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", "dev": true }, - "@types/through": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.29.tgz", - "integrity": "sha512-9a7C5VHh+1BKblaYiq+7Tfc+EOmjMdZaD1MYtkQjSoxgB69tBjW98ry6SKsi4zEIWztLOMRuL87A3bdT/Fc/4w==", - "requires": { - "@types/node": "*" - } - }, "@types/yargs": { "version": "13.0.3", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.3.tgz", @@ -919,11 +853,6 @@ "normalize-path": "^2.1.1" } }, - "arch": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.1.1.tgz", - "integrity": "sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==" - }, "arg": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz", @@ -958,21 +887,11 @@ "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" - }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -1021,11 +940,6 @@ "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=" }, - "auto-bind": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-1.2.1.tgz", - "integrity": "sha512-/W9yj1yKmBLwpexwAujeD9YHwYmRuWFGV8HWE7smQab797VeHa4/cnE2NFeDhA+E+5e/OGBI8763EhLjfZ/MXA==" - }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -1046,131 +960,6 @@ "follow-redirects": "1.5.10" } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - } - } - }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - } - }, - "babel-helper-builder-react-jsx": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", - "integrity": "sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "esutils": "^2.0.2" - } - }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, "babel-jest": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.9.0.tgz", @@ -1194,14 +983,6 @@ } } }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, "babel-plugin-istanbul": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz", @@ -1268,43 +1049,6 @@ "@types/babel__traverse": "^7.0.6" } }, - "babel-plugin-syntax-jsx": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", - "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" - }, - "babel-plugin-syntax-object-rest-spread": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=" - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-object-rest-spread": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", - "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", - "requires": { - "babel-plugin-syntax-object-rest-spread": "^6.8.0", - "babel-runtime": "^6.26.0" - } - }, - "babel-plugin-transform-react-jsx": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", - "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", - "requires": { - "babel-helper-builder-react-jsx": "^6.24.1", - "babel-plugin-syntax-jsx": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, "babel-preset-jest": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz", @@ -1315,87 +1059,11 @@ "babel-plugin-jest-hoist": "^24.9.0" } }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", - "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", @@ -1470,6 +1138,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1581,41 +1250,6 @@ } } }, - "caller-callsite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", - "requires": { - "callsites": "^2.0.0" - } - }, - "caller-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", - "requires": { - "caller-callsite": "^2.0.0" - } - }, - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, "capture-exit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", @@ -1650,20 +1284,6 @@ "supports-color": "^5.3.0" } }, - "chalk-pipe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chalk-pipe/-/chalk-pipe-2.0.0.tgz", - "integrity": "sha512-+sflG/DXM9q47GMiNQIGKuzUr86FHrZfTO+Em6+s90jBJqCp4fv4O/ZOu2Uj4G5PVPXW6LqCqg3HJlBkPus4Pw==", - "requires": { - "chalk": "^2.4.1", - "css-color-names": "0.0.4" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" - }, "child_process": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/child_process/-/child_process-1.0.2.tgz", @@ -1707,14 +1327,6 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "requires": { - "restore-cursor": "^2.0.0" - } - }, "cli-progress": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.5.0.tgz", @@ -1788,20 +1400,6 @@ } } }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" - }, - "clipboardy": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-1.2.3.tgz", - "integrity": "sha512-2WNImOvCRe6r63Gk9pShfkwXsVtKCroMAevIbiae021mS850UkWPbevxsBz3tnvjZIEGvlwaqCPsw+4ulzNgJA==", - "requires": { - "arch": "^2.1.0", - "execa": "^0.8.0" - } - }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -1936,7 +1534,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "2.0.0", @@ -1950,22 +1549,11 @@ "typedarray": "^0.0.6" } }, - "conf": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/conf/-/conf-1.4.0.tgz", - "integrity": "sha512-bzlVWS2THbMetHqXKB8ypsXN4DQ/1qopGwNJi1eYbpwesJcd86FBjFciCQX/YwAhp9bM7NVnPFqZ5LpV7gP0Dg==", - "requires": { - "dot-prop": "^4.1.0", - "env-paths": "^1.0.0", - "make-dir": "^1.0.0", - "pkg-up": "^2.0.0", - "write-file-atomic": "^2.3.0" - } - }, "convert-source-map": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, "requires": { "safe-buffer": "~5.1.1" }, @@ -1973,7 +1561,8 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, @@ -1982,11 +1571,6 @@ "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" }, - "core-js": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", - "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -2005,11 +1589,6 @@ "which": "^1.2.9" } }, - "css-color-names": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", - "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=" - }, "cssom": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", @@ -2025,14 +1604,6 @@ "cssom": "0.3.x" } }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "requires": { - "array-find-index": "^1.0.1" - } - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -2066,16 +1637,6 @@ } } }, - "dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==" - }, - "datejs": { - "version": "1.0.0-rc3", - "resolved": "https://registry.npmjs.org/datejs/-/datejs-1.0.0-rc3.tgz", - "integrity": "sha1-v/oe/t7+tB/diiQq9Vr6AftY3lc=" - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -2101,14 +1662,6 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "requires": { - "mimic-response": "^1.0.0" - } - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2182,14 +1735,6 @@ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "requires": { - "repeating": "^2.0.0" - } - }, "detect-newline": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", @@ -2216,19 +1761,6 @@ "webidl-conversions": "^4.0.2" } }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "requires": { - "is-obj": "^1.0.0" - } - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -2239,25 +1771,6 @@ "safer-buffer": "^2.1.0" } }, - "emoj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/emoj/-/emoj-2.0.0.tgz", - "integrity": "sha512-f+jc5ZC+EAqRK84plziuC4sfKspUcnnxwZzxLFSFsH0MZn9VbU0iQh5qTONewYXsoRaacNioMOLxYV637MLBDQ==", - "requires": { - "auto-bind": "^1.1.0", - "clipboardy": "^1.1.4", - "conf": "^1.0.0", - "got": "^7.1.0", - "has-ansi": "^3.0.0", - "import-jsx": "^1.2.0", - "ink": "^0.3.0", - "ink-text-input": "^1.0.0", - "lodash.debounce": "^4.0.6", - "mem": "^1.1.0", - "meow": "^3.7.0", - "skin-tone": "^1.0.0" - } - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -2271,15 +1784,11 @@ "once": "^1.4.0" } }, - "env-paths": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz", - "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=" - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -2360,7 +1869,8 @@ "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true }, "exec-sh": { "version": "0.3.2", @@ -2368,32 +1878,6 @@ "integrity": "sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==", "dev": true }, - "execa": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz", - "integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, "exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", @@ -2500,16 +1984,6 @@ } } }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -2607,14 +2081,6 @@ "bser": "^2.0.0" } }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -2636,14 +2102,6 @@ } } }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "requires": { - "locate-path": "^2.0.0" - } - }, "findup-sync": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", @@ -3296,16 +2754,6 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" - }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -3369,32 +2817,6 @@ "which": "^1.2.14" } }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" - }, - "got": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", - "requires": { - "decompress-response": "^3.2.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", - "url-to-options": "^1.0.1" - } - }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", @@ -3451,38 +2873,17 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-3.0.0.tgz", - "integrity": "sha1-Ngd+8dFfMzSEqn+neihgbxxlWzc=", - "requires": { - "ansi-regex": "^3.0.0" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, - "has-symbol-support-x": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", - "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" - }, "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "has-to-string-tag-x": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -3524,15 +2925,6 @@ } } }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, "homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -3544,7 +2936,8 @@ "hosted-git-info": { "version": "2.8.4", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.4.tgz", - "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==" + "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==", + "dev": true }, "html-encoding-sniffer": { "version": "1.0.2", @@ -3575,24 +2968,11 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, - "import-jsx": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/import-jsx/-/import-jsx-1.3.2.tgz", - "integrity": "sha512-9y2DexZ7+6XqcaJljFcLDAP7kwlfDQb+KhgfwWyWACAbNIXykB7YI21Kz/17oOqkPH9RS/YEf3f4YCFGXH8gmw==", - "requires": { - "babel-core": "^6.25.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-object-rest-spread": "^6.23.0", - "babel-plugin-transform-react-jsx": "^6.24.1", - "caller-path": "^2.0.0", - "require-from-string": "^1.2.1", - "resolve-from": "^3.0.0" - } - }, "import-local": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", @@ -3606,7 +2986,8 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true }, "indent-string": { "version": "4.0.0", @@ -3633,51 +3014,11 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, - "ink": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/ink/-/ink-0.3.1.tgz", - "integrity": "sha512-e3JOOBLE6cDO2aWWkIYXXT7qhb9HN4mBHSiOj2Hv94VAMDiDb0J50koYtxY0tZBq9N117QENGoURmL+tunxQJw==", - "requires": { - "arrify": "^1.0.1", - "chalk": "^2.0.1", - "indent-string": "^3.1.0", - "lodash.flattendeep": "^4.4.0", - "lodash.isequal": "^4.5.0", - "log-update": "^2.1.0", - "prop-types": "^15.5.10" - }, - "dependencies": { - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" - } - } - }, - "ink-text-input": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ink-text-input/-/ink-text-input-1.1.1.tgz", - "integrity": "sha512-bOblvdmbXFC/UYbBj0WsKGkVhQaiZXK8A/O0e7/eh8HVr0DAbuZgQKatPzZ2ySsrpmcaMUGSVPbeuJOPO53X/g==", - "requires": { - "has-ansi": "^3.0.0", - "prop-types": "^15.5.10" - } - }, - "inquirer-autocomplete-prompt": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-1.0.1.tgz", - "integrity": "sha512-Y4V6ifAu9LNrNjcEtYq8YUKhrgmmufUn5fsDQqeWgHY8rEO6ZAQkNUiZtBm2kw2uUQlC9HdgrRCHDhTPPguH5A==", - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "figures": "^2.0.0", - "run-async": "^2.3.0" - } - }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, "requires": { "loose-envify": "^1.0.0" } @@ -3708,7 +3049,8 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true }, "is-callable": { "version": "1.1.4", @@ -3786,14 +3128,6 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -3836,21 +3170,6 @@ } } }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" - }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" - }, "is-plain-object": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", @@ -3859,11 +3178,6 @@ "isobject": "^4.0.0" } }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" - }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -3873,11 +3187,6 @@ "has": "^1.0.1" } }, - "is-retry-allowed": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", - "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==" - }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -3898,11 +3207,6 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -4047,15 +3351,6 @@ "handlebars": "^4.1.2" } }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, "jest": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/jest/-/jest-24.9.0.tgz", @@ -4792,7 +4087,8 @@ "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true }, "js-yaml": { "version": "3.13.1", @@ -4843,11 +4139,6 @@ "xml-name-validator": "^3.0.0" } }, - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" - }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -4872,11 +4163,6 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -4920,42 +4206,14 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "lodash": { @@ -4968,26 +4226,11 @@ "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=" - }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" - }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -5027,88 +4270,20 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, - "log-update": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz", - "integrity": "sha1-iDKP19HOeTiykoN0bwsbwSayRwg=", - "requires": { - "ansi-escapes": "^3.0.0", - "cli-cursor": "^2.0.0", - "wrap-ansi": "^3.0.1" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "wrap-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz", - "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=", - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0" - } - } - } - }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, "requires": { "js-tokens": "^3.0.0 || ^4.0.0" } }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "macos-release": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==" }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "requires": { - "pify": "^3.0.0" - } - }, "make-error": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", @@ -5128,11 +4303,6 @@ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -5141,38 +4311,6 @@ "object-visit": "^1.0.0" } }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - } - } - }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -5214,20 +4352,11 @@ "mime-db": "1.40.0" } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" - }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5235,7 +4364,8 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true }, "mixin-deep": { "version": "1.3.2", @@ -5273,6 +4403,7 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" } @@ -5282,11 +4413,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" - }, "nan": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", @@ -5368,6 +4494,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, "requires": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -8883,11 +8010,6 @@ "path-key": "^2.0.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, "nwsapi": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", @@ -8900,11 +8022,6 @@ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -9003,14 +8120,6 @@ "wrappy": "1" } }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "requires": { - "mimic-fn": "^1.0.0" - } - }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -9043,11 +8152,6 @@ } } }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, "os-name": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", @@ -9057,16 +8161,6 @@ "windows-release": "^3.1.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "p-cancelable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==" - }, "p-each-series": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", @@ -9081,41 +8175,12 @@ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "requires": { - "p-limit": "^1.1.0" - } - }, "p-reduce": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", "dev": true }, - "p-timeout": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", - "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", - "requires": { - "p-finally": "^1.0.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" - }, "parse-git-config": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-3.0.0.tgz", @@ -9125,14 +8190,6 @@ "ini": "^1.3.5" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -9170,12 +8227,14 @@ "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-key": { "version": "2.0.1", @@ -9185,24 +8244,8 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true }, "performance-now": { "version": "2.1.0", @@ -9213,20 +8256,8 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true }, "pirates": { "version": "4.0.1", @@ -9291,14 +8322,6 @@ } } }, - "pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "requires": { - "find-up": "^2.1.0" - } - }, "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", @@ -9316,11 +8339,6 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" - }, "prettier": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", @@ -9347,11 +8365,6 @@ } } }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" - }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -9367,21 +8380,6 @@ "sisteransi": "^1.0.3" } }, - "prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.8.1" - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "psl": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", @@ -9412,45 +8410,8 @@ "react-is": { "version": "16.9.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz", - "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==" - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - } - } + "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==", + "dev": true }, "readable-stream": { "version": "3.4.0", @@ -9472,25 +8433,6 @@ "util.promisify": "^1.0.0" } }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - }, - "dependencies": { - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "requires": { - "repeating": "^2.0.0" - } - } - } - }, "redeyed": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", @@ -9499,11 +8441,6 @@ "esprima": "~4.0.0" } }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -9529,14 +8466,6 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "^1.0.0" - } - }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", @@ -9608,11 +8537,6 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, - "require-from-string": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", - "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=" - }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -9622,6 +8546,7 @@ "version": "1.12.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "dev": true, "requires": { "path-parse": "^1.0.6" } @@ -9647,22 +8572,14 @@ "resolve-from": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -9683,31 +8600,11 @@ "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", "dev": true }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "requires": { - "is-promise": "^2.1.0" - } - }, - "rxjs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", - "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", - "requires": { - "tslib": "^1.9.0" - } - }, - "rxjs-compat": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.5.4.tgz", - "integrity": "sha512-rkn+lbOHUQOurdd74J/hjmDsG9nFx0z66fvnbs8M95nrtKvNqCKdk7iZqdY51CGmDemTQk+kUPy4s8HVOHtkfA==" - }, "safe-buffer": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "dev": true }, "safe-regex": { "version": "1.1.0", @@ -9720,7 +8617,8 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "sane": { "version": "4.1.0", @@ -9872,19 +8770,6 @@ "integrity": "sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg==", "dev": true }, - "skin-tone": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-1.0.0.tgz", - "integrity": "sha1-1Lo+jl6Sdg5NHTtgPXcoBcbLJW8=", - "requires": { - "unicode-emoji-modifier-base": "^1.0.0" - } - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" - }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -10017,14 +8902,6 @@ "urix": "^0.1.0" } }, - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "requires": { - "source-map": "^0.5.6" - } - }, "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", @@ -10034,6 +8911,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -10042,12 +8920,14 @@ "spdx-exceptions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -10056,7 +8936,8 @@ "spdx-license-ids": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true }, "split-string": { "version": "3.1.0", @@ -10194,27 +9075,11 @@ } } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "requires": { - "get-stdin": "^4.0.1" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -10375,35 +9240,12 @@ "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", "dev": true }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } - }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", "dev": true }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" - }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -10471,16 +9313,6 @@ "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", "integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==" }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" - }, "ts-jest": { "version": "24.3.0", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.3.0.tgz", @@ -10620,11 +9452,6 @@ } } }, - "unicode-emoji-modifier-base": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", - "integrity": "sha1-271bVLow8ofiqNWiSdpsDO82lFk=" - }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -10704,19 +9531,6 @@ "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "requires": { - "prepend-http": "^1.0.1" - } - }, - "url-to-options": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" - }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -10756,6 +9570,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -10870,18 +9685,6 @@ "execa": "^1.0.0" }, "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "execa": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", @@ -10946,16 +9749,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, "ws": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", @@ -10976,11 +9769,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, "yargs": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.1.0.tgz", diff --git a/package.json b/package.json index c6d3b2b..03624c4 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "devDependencies": { "@types/concat-stream": "^1.6.0", "@types/debug": "^4.1.5", - "@types/inquirer": "^6.5.0", "@types/jest": "^24.0.25", "@types/node": "^12.12.24", "child_process": "^1.0.2", @@ -28,7 +27,6 @@ "typescript": "^3.7.4" }, "dependencies": { - "@cto.ai/inquirer": "^6.4.4", "@cto.ai/sdk": "^2.0.4", "@octokit/rest": "^16.25.5", "debug": "^4.1.1", diff --git a/src/commands/issue:create.ts b/src/commands/issue:create.ts index 6c9f643..5e79a4c 100644 --- a/src/commands/issue:create.ts +++ b/src/commands/issue:create.ts @@ -44,7 +44,7 @@ export const issueCreate = async (cmdOptions: CommandOptions) => { type: 'input', name: 'title', message: `\nšŸ“ Please enter your issue title:`, - afterMessage: `Title: `, + // afterMessage: `Title: `, }, { type: 'list', @@ -53,7 +53,7 @@ export const issueCreate = async (cmdOptions: CommandOptions) => { 'Your default editor will be opened to allow editing of the issue details.', )}`, choices: fs.readdirSync(templateDir), - afterMessage: `Type: `, + // afterMessage: `Type: `, }, ]) diff --git a/src/commands/issue:done.ts b/src/commands/issue:done.ts index 5aff5ee..218e1ff 100644 --- a/src/commands/issue:done.ts +++ b/src/commands/issue:done.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import branch from 'git-branch' @@ -16,13 +15,13 @@ const pullRequestQuestions: Question[] = [ type: 'input', name: 'title', message: 'Enter a title for the Pull Request:', - afterMessage: `${ux.colors.reset.green('āœ“')} Title`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Title`, }, { type: 'input', name: 'comment', message: 'Enter a comment or description for your Pull Request', - afterMessage: `${ux.colors.reset.green('āœ“')} Comment`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Comment`, }, ] diff --git a/src/commands/issue:list.ts b/src/commands/issue:list.ts index 48be57f..4a0912b 100644 --- a/src/commands/issue:list.ts +++ b/src/commands/issue:list.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fuzzy from 'fuzzy' diff --git a/src/commands/issue:save.ts b/src/commands/issue:save.ts index d19e8ed..829ed2e 100644 --- a/src/commands/issue:save.ts +++ b/src/commands/issue:save.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import Debug from 'debug' import branch from 'git-branch' import { ParseAndHandleError } from '../errors' @@ -13,7 +12,7 @@ const question: Question = { type: 'input', name: 'message', message: `\nšŸ“ Please enter a commit message:\n`, - afterMessage: `Message: `, + // afterMessage: `Message: `, validate: input => { if (input === '') { return ' Commit message cannot be empty!' diff --git a/src/commands/issue:search.ts b/src/commands/issue:search.ts index f45e203..9b5bcc7 100644 --- a/src/commands/issue:search.ts +++ b/src/commands/issue:search.ts @@ -1,5 +1,4 @@ -import { AutoCompleteQuestion, CheckboxQuestion } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import stripAnsi from 'strip-ansi' @@ -18,7 +17,7 @@ const yargs = require('yargs') const filterSelectPrompt = ( list: string[], -): AutoCompleteQuestion[] => [ +): Question[] => [ { type: 'autocomplete', name: 'filter', diff --git a/src/commands/issue:start.ts b/src/commands/issue:start.ts index 3490280..75a29a2 100644 --- a/src/commands/issue:start.ts +++ b/src/commands/issue:start.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import Debug from 'debug' import { LABELS } from '../constants' import { ParseAndHandleError } from '../errors' diff --git a/src/commands/label:add.ts b/src/commands/label:add.ts index 48b348a..3a54304 100644 --- a/src/commands/label:add.ts +++ b/src/commands/label:add.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import { ParseAndHandleError } from '../errors' @@ -18,7 +17,7 @@ const promptUserInput = async () => { type: 'input', name: 'name', message: `\nPlease enter your label name:`, - afterMessage: `Name: `, + // afterMessage: `Name: `, validate: input => { if (input === '') { return ' Label name cannot be blank!' @@ -31,7 +30,7 @@ const promptUserInput = async () => { type: 'input', name: 'description', message: `\nPlease enter your label description:`, - afterMessage: `Description: `, + // afterMessage: `Description: `, validate: input => { if (input === '') { return ' Label description cannot be blank!' @@ -46,7 +45,7 @@ const promptUserInput = async () => { type: 'input', name: 'color', message: `\nProvide a valid hex code for your label color (without #):`, - afterMessage: `Color: `, + // afterMessage: `Color: `, validate: input => { if (!isValidColor(input)) { return ' That is not a valid hex code!' diff --git a/src/commands/label:edit.ts b/src/commands/label:edit.ts index c7968a0..1890239 100644 --- a/src/commands/label:edit.ts +++ b/src/commands/label:edit.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fuzzy from 'fuzzy' @@ -82,21 +81,21 @@ const promptLabelEdit = async ({ name: 'name', message: 'Enter a new name for the label:', default: name, - afterMessage: `${ux.colors.reset.green('āœ“')} Name`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Name`, }, { type: 'input', name: 'description', message: 'Enter a new description for the label:', default: description, - afterMessage: `${ux.colors.reset.green('āœ“')} Description`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Description`, }, { type: 'input', name: 'color', message: 'Enter a new color for the label:', default: color, - afterMessage: `${ux.colors.reset.green('āœ“')} Color`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Color`, }, ] diff --git a/src/commands/label:remove.ts b/src/commands/label:remove.ts index ab80de3..c2a9719 100644 --- a/src/commands/label:remove.ts +++ b/src/commands/label:remove.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fuzzy from 'fuzzy' diff --git a/src/commands/pulls:list.ts b/src/commands/pulls:list.ts index 6184763..dcfc708 100644 --- a/src/commands/pulls:list.ts +++ b/src/commands/pulls:list.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fuzzy from 'fuzzy' diff --git a/src/commands/repo:clone.ts b/src/commands/repo:clone.ts index b8d8c92..962126d 100644 --- a/src/commands/repo:clone.ts +++ b/src/commands/repo:clone.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import Debug from 'debug' import * as fuzzy from 'fuzzy' import { ParseAndHandleError } from '../errors' diff --git a/src/commands/repo:create.ts b/src/commands/repo:create.ts index 68680c7..662045c 100644 --- a/src/commands/repo:create.ts +++ b/src/commands/repo:create.ts @@ -1,5 +1,4 @@ -import { Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fs from 'fs-extra' @@ -72,14 +71,14 @@ const getRepoInfoFromUser = async ( name: 'org', message: `\nPlease select the organization of your repo →`, choices: orgsList, - afterMessage: `${ux.colors.reset.green('āœ“')} Org`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Org`, }, { type: 'input', name: 'name', message: `\nPlease enter the name of the repo → \n${ux.colors.white('šŸ“ Enter Name')}`, - afterMessage: `${ux.colors.reset.green('āœ“')} Name`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Name`, validate: input => { if (input === '') { return 'The repo name cannot be blank!' @@ -93,7 +92,7 @@ const getRepoInfoFromUser = async ( name: 'description', message: `\nPlease enter the description of the repo → \n${ux.colors.white('šŸ“ Enter Description')}`, - afterMessage: `${ux.colors.reset.green('āœ“')} Description`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Description`, }, { type: 'list', @@ -103,7 +102,7 @@ const getRepoInfoFromUser = async ( { name: 'šŸ” private', value: 'private' }, { name: 'šŸŒŽ public', value: 'public' }, ], - afterMessage: `${ux.colors.reset.green('āœ“')} Type`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Type`, }, ] const answers = await ux.prompt(questions) diff --git a/src/commands/token:update.ts b/src/commands/token:update.ts index 0d12f73..a683160 100644 --- a/src/commands/token:update.ts +++ b/src/commands/token:update.ts @@ -22,8 +22,8 @@ export const promptForToken = async () => { `'admin'`, )} scopes to grant to this access token.\n\n• Copy the access token and provide it below šŸ‘‡.`, )} \n\n\nšŸ”‘ Please enter your github token:`, - afterMessage: `${ux.colors.reset.green('āœ“')} Access Token`, - afterMessageAppend: `${ux.colors.reset(' added!')}`, + // afterMessage: `${ux.colors.reset.green('āœ“')} Access Token`, + // afterMessageAppend: `${ux.colors.reset(' added!')}`, validate: (input: string) => !!input.trim() || 'Please enter a valid Github Access Token', } diff --git a/src/helpers/asyncPipe.ts b/src/helpers/asyncPipe.ts index 6e23916..a3741d6 100644 --- a/src/helpers/asyncPipe.ts +++ b/src/helpers/asyncPipe.ts @@ -12,3 +12,4 @@ const _trace = (msg: string) => (x: any) => { } export { asyncPipe, _trace } + diff --git a/src/helpers/getGithub.ts b/src/helpers/getGithub.ts index fc6d8af..a174dc0 100644 --- a/src/helpers/getGithub.ts +++ b/src/helpers/getGithub.ts @@ -3,7 +3,6 @@ import Debug from 'debug' import { CredentialsError, ParseAndHandleError } from '../errors' import { getConfig } from './config' - const debug = Debug('github:getGithub') export const getToken = async () => { diff --git a/tests_e2e/utils/cleanupFn.ts b/tests_e2e/utils/cleanupFn.ts index 7fa045b..0e41e3d 100644 --- a/tests_e2e/utils/cleanupFn.ts +++ b/tests_e2e/utils/cleanupFn.ts @@ -1,10 +1,10 @@ +import { ux } from '@cto.ai/sdk' import fs from 'fs' import parse from 'parse-git-config' import { filterForRepoInfo } from '../../src/helpers/checkCurrentRepo' import { execPromisified } from '../../src/helpers/execPromisified' import { getGithub } from '../../src/helpers/getGithub' import { TEAM_NAME_IDENTIFIER } from './constants' -import { ux } from '@cto.ai/sdk' const cleanRepoCreate = async () => { try { From f84eed0ac6f0f847810410044234743c5cd4dad2 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Tue, 7 Jan 2020 15:57:52 -0800 Subject: [PATCH 06/33] Removed empty input validation, as SDK does that. Further remove inquirer references. Signed-off-by: Vincent Tan --- src/helpers/validatedPrompts.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/helpers/validatedPrompts.ts diff --git a/src/helpers/validatedPrompts.ts b/src/helpers/validatedPrompts.ts new file mode 100644 index 0000000..428c166 --- /dev/null +++ b/src/helpers/validatedPrompts.ts @@ -0,0 +1,17 @@ +import { Question, Questions, ux } from '@cto.ai/sdk'; + +//This re-prompts user until their answer passes validation +//validate takes in the return value of ux.prompt, and forces re-prompt if it returns false +//errorMessage is displayed to user when validation fails +export const validatedPrompt = async (prompt: Question | Questions, validate: (response: any) => boolean, errorMessage: string) => { + let response: any + let repeatedPrompt = false + do { + if (repeatedPrompt) { + await ux.print(errorMessage) + } + response = await ux.prompt(prompt) + repeatedPrompt = true + } while (!validate(response)); + return response +} \ No newline at end of file From bbe674818130f0864bd6cbd20ce5bd22cf18dc9f Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Tue, 7 Jan 2020 16:13:54 -0800 Subject: [PATCH 07/33] Reimplement validated prompts. Use Question typing alias Signed-off-by: Vincent Tan --- src/commands/issue:save.ts | 8 ------ src/commands/issue:search.ts | 6 ++--- src/commands/label:add.ts | 52 +++++++++++++++++++----------------- src/commands/label:sync.ts | 19 +++++++------ src/commands/repo:clone.ts | 2 +- src/commands/repo:create.ts | 17 ++++-------- src/commands/token:update.ts | 13 +++++---- src/types/IssueTypes.ts | 4 +-- 8 files changed, 55 insertions(+), 66 deletions(-) diff --git a/src/commands/issue:save.ts b/src/commands/issue:save.ts index 829ed2e..52ed7b6 100644 --- a/src/commands/issue:save.ts +++ b/src/commands/issue:save.ts @@ -12,14 +12,6 @@ const question: Question = { type: 'input', name: 'message', message: `\nšŸ“ Please enter a commit message:\n`, - // afterMessage: `Message: `, - validate: input => { - if (input === '') { - return ' Commit message cannot be empty!' - } else { - return true - } - }, } export const issueSave = async () => { diff --git a/src/commands/issue:search.ts b/src/commands/issue:search.ts index 9b5bcc7..5238cb8 100644 --- a/src/commands/issue:search.ts +++ b/src/commands/issue:search.ts @@ -29,7 +29,7 @@ const filterSelectPrompt = ( const issueSelectPrompt = ( list: IssueSelection[], -): AutoCompleteQuestion[] => [ +): Question[] => [ { type: 'autocomplete', name: 'issue', @@ -39,14 +39,14 @@ const issueSelectPrompt = ( }, ] -const checkboxPrompt = (list): CheckboxQuestion[] => { +const checkboxPrompt = (list): Question[] => { return [ { type: 'checkbox', name: 'issueFilter', message: 'Please select the filter', choices: list, - pageSize: process.stdout.rows, + // pageSize: process.stdout.rows, }, ] } diff --git a/src/commands/label:add.ts b/src/commands/label:add.ts index 3a54304..47b5617 100644 --- a/src/commands/label:add.ts +++ b/src/commands/label:add.ts @@ -5,6 +5,7 @@ import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' import { createLabels } from '../helpers/labels' +import { validatedPrompt } from '../helpers/validatedPrompts' import { AnsSelectReposForLabel, AnsSelectYesNo } from '../types/Answers' import { CommandOptions } from '../types/Config' import { LabelKeys } from '../types/Labels' @@ -17,46 +18,47 @@ const promptUserInput = async () => { type: 'input', name: 'name', message: `\nPlease enter your label name:`, - // afterMessage: `Name: `, - validate: input => { - if (input === '') { - return ' Label name cannot be blank!' - } else { - return true - } - }, }, { type: 'input', name: 'description', message: `\nPlease enter your label description:`, // afterMessage: `Description: `, - validate: input => { - if (input === '') { - return ' Label description cannot be blank!' - } else if (input.length > 100) { - return ' Label description must be under 100 characters in length!' - } else { - return true - } - }, + // validate: input => { + // if (input.length > 100) { + // return ' Label description must be under 100 characters in length!' + // } else { + // return true + // } + // }, }, { type: 'input', name: 'color', message: `\nProvide a valid hex code for your label color (without #):`, // afterMessage: `Color: `, - validate: input => { - if (!isValidColor(input)) { - return ' That is not a valid hex code!' - } else { - return true - } - }, + // validate: input => { + // if (!isValidColor(input)) { + // return ' That is not a valid hex code!' + // } else { + // return true + // } + // }, }, ] - const answers = await ux.prompt(questions) + //TODO: not sure if setting errMess in validation function works. Will have to test. + // let errMess: string = "" + const answers = await validatedPrompt(questions, (response: any) => { + if (response[questions[1].name].length > 100) { + // errMess = ' Label description must be under 100 characters in length!' + return false + } else if (!isValidColor(response[questions[2].name])) { + // errMess = ' That is not a valid hex code!' + return false + } + return true + }, 'Label description must be under 100 characters in length, and colour must be a valid hex code!') return answers } diff --git a/src/commands/label:sync.ts b/src/commands/label:sync.ts index aef317b..0eb0c99 100644 --- a/src/commands/label:sync.ts +++ b/src/commands/label:sync.ts @@ -1,5 +1,4 @@ -import { AutoCompleteQuestion, Question } from '@cto.ai/inquirer' -import { sdk, ux } from '@cto.ai/sdk' +import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import { ParseAndHandleError } from '../errors' @@ -39,14 +38,14 @@ const formatList = ( const selectBaseRepoPrompt = ( repoList: RepoWithOwnerAndName[], -): AutoCompleteQuestion[] => [ - { - type: 'autocomplete', - name: 'baseRepo', - message: 'Please select the base repo that you want to sync to.', - autocomplete: repoList.map(repo => `${repo.owner}/${repo.repo}`), - }, -] +): Question[] => [ + { + type: 'autocomplete', + name: 'baseRepo', + message: 'Please select the base repo that you want to sync to.', + autocomplete: repoList.map(repo => `${repo.owner}/${repo.repo}`), + }, + ] const selectReposToSync = ( repoList: RepoWithOwnerAndName[], diff --git a/src/commands/repo:clone.ts b/src/commands/repo:clone.ts index 962126d..ff750e5 100644 --- a/src/commands/repo:clone.ts +++ b/src/commands/repo:clone.ts @@ -72,7 +72,7 @@ const selectRepo = async (): Promise => { const list: Question = { type: 'autocomplete', name: 'repo', - pageSize: 7, + // pageSize: 7, message: 'Select a repo to clone. Repos with šŸ¤– are already cloned.\n', source: autocompleteSearch, bottomContent: '', diff --git a/src/commands/repo:create.ts b/src/commands/repo:create.ts index 662045c..7a2de2e 100644 --- a/src/commands/repo:create.ts +++ b/src/commands/repo:create.ts @@ -78,14 +78,6 @@ const getRepoInfoFromUser = async ( name: 'name', message: `\nPlease enter the name of the repo → \n${ux.colors.white('šŸ“ Enter Name')}`, - // afterMessage: `${ux.colors.reset.green('āœ“')} Name`, - validate: input => { - if (input === '') { - return 'The repo name cannot be blank!' - } else { - return true - } - }, }, { type: 'input', @@ -98,10 +90,11 @@ const getRepoInfoFromUser = async ( type: 'list', name: 'privateOrPublic', message: 'Do you want to create a public repo or a private repo?', - choices: [ - { name: 'šŸ” private', value: 'private' }, - { name: 'šŸŒŽ public', value: 'public' }, - ], + // choices: [ + // { name: 'šŸ” private', value: 'private' }, + // { name: 'šŸŒŽ public', value: 'public' }, + // ], + choices: ['private', 'public'] // afterMessage: `${ux.colors.reset.green('āœ“')} Type`, }, ] diff --git a/src/commands/token:update.ts b/src/commands/token:update.ts index a683160..0f05699 100644 --- a/src/commands/token:update.ts +++ b/src/commands/token:update.ts @@ -1,8 +1,8 @@ -import { Question } from '@cto.ai/inquirer' -import { ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import Debug from 'debug' import { ParseAndHandleError } from '../errors' import { setConfig } from '../helpers/config' +import { validatedPrompt } from '../helpers/validatedPrompts' import { AnsToken } from '../types/Answers' const debug = Debug('github:tokenUpdate') @@ -24,10 +24,13 @@ export const promptForToken = async () => { )} \n\n\nšŸ”‘ Please enter your github token:`, // afterMessage: `${ux.colors.reset.green('āœ“')} Access Token`, // afterMessageAppend: `${ux.colors.reset(' added!')}`, - validate: (input: string) => - !!input.trim() || 'Please enter a valid Github Access Token', + // validate: (input: string) => + // !!input.trim() || 'Please enter a valid Github Access Token', } - return await ux.prompt(question) + // return await ux.prompt(question) + return await validatedPrompt(question, (input: any) => { + return !!input[question.name].trim() ? false : true + }, 'Please enter a valid Github Access Token') } export const updateAccessToken = async () => { diff --git a/src/types/IssueTypes.ts b/src/types/IssueTypes.ts index 11db609..88339b0 100644 --- a/src/types/IssueTypes.ts +++ b/src/types/IssueTypes.ts @@ -1,4 +1,4 @@ -import { AutoCompleteQuestion } from '@cto.ai/inquirer'; +import { Question } from '@cto.ai/sdk'; export interface IssueListValue { title: string @@ -53,5 +53,5 @@ export interface HelpInfo { export interface DataForFilter { name: string - prompt: AutoCompleteQuestion[] + prompt: Question[] } From 411be5f7e83325d116bed74c20c771bfa8d5d824 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Tue, 7 Jan 2020 17:16:57 -0800 Subject: [PATCH 08/33] Further progress in migrating to SDK 2 Signed-off-by: Vincent Tan --- src/commands/issue:search.ts | 4 ++-- src/commands/label:add.ts | 22 ++++++++++++---------- src/commands/label:remove.ts | 32 ++++++++++++++++++++------------ 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/src/commands/issue:search.ts b/src/commands/issue:search.ts index 5238cb8..bd44645 100644 --- a/src/commands/issue:search.ts +++ b/src/commands/issue:search.ts @@ -22,8 +22,8 @@ const filterSelectPrompt = ( type: 'autocomplete', name: 'filter', message: 'Please select the filter', - autocomplete: list, - pageSize: process.stdout.rows, + choices: list, + // pageSize: process.stdout.rows, }, ] diff --git a/src/commands/label:add.ts b/src/commands/label:add.ts index 47b5617..67ddcf8 100644 --- a/src/commands/label:add.ts +++ b/src/commands/label:add.ts @@ -111,23 +111,25 @@ export const labelAdd = async (cmdOptions: CommandOptions) => { } if (repos.length > 0) { + let repoKV = repos.map(repo => { + return { + name: repo.name, + value: { + repo: repo.name, + owner: repo.owner.login, + }, + } + }) const repoListSelect: Question = { type: 'checkbox', name: 'reposSelected', message: 'Select from the list below', - choices: repos.map(repo => { - return { - name: repo.name, - value: { - repo: repo.name, - owner: repo.owner.login, - }, - } - }), + choices: repoKV.map((val) => { return val.name }), } - const { reposSelected } = await ux.prompt( + const reposSelectedUnmapped: string[] = await ux.prompt( repoListSelect, ) + const reposSelected = reposSelectedUnmapped.map((value) => { return repoKV[value] }) try { await Promise.all( diff --git a/src/commands/label:remove.ts b/src/commands/label:remove.ts index c2a9719..dc8656c 100644 --- a/src/commands/label:remove.ts +++ b/src/commands/label:remove.ts @@ -60,8 +60,9 @@ const labelSelection = async (): Promise => { type: 'autocomplete', message: 'Choose a label to remove:\n', name: 'label', - source: autocompleteSearch, - bottomContent: '', + choices: formattedList + // source: autocompleteSearch, + // bottomContent: '', } const { label } = await ux.prompt(questions) @@ -84,25 +85,32 @@ const promptYesNo = async (): Promise => { const selectRepos = async ( filteredRepos: RepoWithOwnerAndName[], ): Promise => { + let repoKV = filteredRepos.map(repo => { + return { + name: `${repo.owner}/${repo.repo}`, + value: { + repo: repo.repo, + owner: repo.owner, + }, + } + }) const repoListSelect: Question = { type: 'checkbox', name: 'reposSelected', message: 'Select from the list below', - choices: filteredRepos.map(repo => { - return { - name: `${repo.owner}/${repo.repo}`, - value: { - repo: repo.repo, - owner: repo.owner, - }, - } + choices: repoKV.map(repo => { + return repo.name }), } - const { reposSelected } = await ux.prompt( + const reposSelectedUnmapped: string[] = await ux.prompt( repoListSelect, ) - return reposSelected + + return reposSelectedUnmapped.map((value: string) => { + return repoKV.find((repoEntry) => { return repoEntry.name == value }).value + }) + // return reposSelected } export const labelRemove = async (cmdOptions: CommandOptions) => { From 6bcbb1670efe6952da1bcdd5608b24dc86467dd7 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 09:46:36 -0800 Subject: [PATCH 09/33] Rename validatedPrompts file to promptUtils Signed-off-by: Vincent Tan --- src/commands/label:add.ts | 2 +- src/commands/token:update.ts | 2 +- src/helpers/{validatedPrompts.ts => promptUtils.ts} | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) rename src/helpers/{validatedPrompts.ts => promptUtils.ts} (61%) diff --git a/src/commands/label:add.ts b/src/commands/label:add.ts index 67ddcf8..f379121 100644 --- a/src/commands/label:add.ts +++ b/src/commands/label:add.ts @@ -5,7 +5,7 @@ import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' import { createLabels } from '../helpers/labels' -import { validatedPrompt } from '../helpers/validatedPrompts' +import { validatedPrompt } from '../helpers/promptUtils' import { AnsSelectReposForLabel, AnsSelectYesNo } from '../types/Answers' import { CommandOptions } from '../types/Config' import { LabelKeys } from '../types/Labels' diff --git a/src/commands/token:update.ts b/src/commands/token:update.ts index 0f05699..2a3fae9 100644 --- a/src/commands/token:update.ts +++ b/src/commands/token:update.ts @@ -2,7 +2,7 @@ import { Question, ux } from '@cto.ai/sdk' import Debug from 'debug' import { ParseAndHandleError } from '../errors' import { setConfig } from '../helpers/config' -import { validatedPrompt } from '../helpers/validatedPrompts' +import { validatedPrompt } from '../helpers/promptUtils' import { AnsToken } from '../types/Answers' const debug = Debug('github:tokenUpdate') diff --git a/src/helpers/validatedPrompts.ts b/src/helpers/promptUtils.ts similarity index 61% rename from src/helpers/validatedPrompts.ts rename to src/helpers/promptUtils.ts index 428c166..507074a 100644 --- a/src/helpers/validatedPrompts.ts +++ b/src/helpers/promptUtils.ts @@ -14,4 +14,14 @@ export const validatedPrompt = async (prompt: Question | Questions, validate: (r repeatedPrompt = true } while (!validate(response)); return response +} + +export const keyValPrompt = async (prompt: Question, choices: { name: string, value: any }[]) => { + //TODO: more specific question type + //TODO: handle question that only returns 1 val / question that returns 0 or more val + const nameList: string[] = choices.map((value) => { return value.name }) + let filledPrompt = prompt + filledPrompt['choices'] = nameList + const resp = await ux.prompt(prompt) + } \ No newline at end of file From 7157d886bb736db4832646f624de407461987819 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 10:49:44 -0800 Subject: [PATCH 10/33] Fleshed out keyValPrompt Signed-off-by: Vincent Tan --- package-lock.json | 178 ++++++++++++++++++------------------- src/helpers/promptUtils.ts | 39 ++++++-- 2 files changed, 121 insertions(+), 96 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9231449..cfbb868 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1250,6 +1250,11 @@ } } }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, "capture-exit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", @@ -1878,6 +1883,20 @@ "integrity": "sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==", "dev": true }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, "exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", @@ -2102,6 +2121,22 @@ } } }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "dependencies": { + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + } + } + }, "findup-sync": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", @@ -2754,6 +2789,14 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -4216,6 +4259,14 @@ "type-check": "~0.3.2" } }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", @@ -8175,12 +8226,33 @@ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, + "p-limit": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, "p-reduce": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", "dev": true }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, "parse-git-config": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-3.0.0.tgz", @@ -8902,6 +8974,22 @@ "urix": "^0.1.0" } }, + "source-map-support": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", @@ -9373,22 +9461,6 @@ "make-error": "^1.1.1", "source-map-support": "^0.5.6", "yn": "^3.0.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - } } }, "tslib": { @@ -9683,30 +9755,6 @@ "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", "requires": { "execa": "^1.0.0" - }, - "dependencies": { - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - } } }, "wordwrap": { @@ -9797,54 +9845,11 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -9872,13 +9877,6 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - } } }, "yn": { diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index 507074a..c4e2ae9 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -6,8 +6,11 @@ import { Question, Questions, ux } from '@cto.ai/sdk'; export const validatedPrompt = async (prompt: Question | Questions, validate: (response: any) => boolean, errorMessage: string) => { let response: any let repeatedPrompt = false + //keep asking as long as validation fails do { if (repeatedPrompt) { + //not our first prompt + //must have errored, so print the error message await ux.print(errorMessage) } response = await ux.prompt(prompt) @@ -16,12 +19,36 @@ export const validatedPrompt = async (prompt: Question | Questions, validate: (r return response } +//this replicates the SDK 1.x functionality, +//where you can have a separate display name and actual value returned +//prompt should be a ListQuestion (the only one that makes sense, really) +//name must be unique, as it is used as a key +//having duplicate name causes undefined behaviour (probably just returns one of the matching at random) export const keyValPrompt = async (prompt: Question, choices: { name: string, value: any }[]) => { - //TODO: more specific question type - //TODO: handle question that only returns 1 val / question that returns 0 or more val - const nameList: string[] = choices.map((value) => { return value.name }) - let filledPrompt = prompt - filledPrompt['choices'] = nameList - const resp = await ux.prompt(prompt) + //the ListQuestion interface is not actually exported + if (prompt?.type != 'list') { + throw "prompt must be a ListQuestion!" + } + let nameList: string[] = new Array(choices.length) + let keyValMap: Map = new Map() + for (let index = 0; index < choices.length; index++) { + //iterate through choices, getting an array of names + //and a key-value map + const element = choices[index]; + nameList[index] = element.name; + keyValMap.set(element.name, element.value) + } + + //have the use select the key... + const resp = await ux.prompt(Object.assign(prompt, { choices: nameList })) + if (prompt?.name && resp[prompt?.name]) { + //and return the associated value + // let retVal = {} + // retVal[prompt.name] = keyValMap.get(resp[prompt?.name]) + // return retVal + return { [prompt.name]: keyValMap.get(resp[prompt?.name]) }; + } else { + throw "keyValPrompt: Failed to get the value associated with the key" + } } \ No newline at end of file From 8ba3363940c6325640e12d5d9eaa42a2aec84405 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 11:33:12 -0800 Subject: [PATCH 11/33] keyValPrompt now supports multiple Question types Signed-off-by: Vincent Tan --- src/helpers/promptUtils.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index c4e2ae9..d58fbb7 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -21,13 +21,14 @@ export const validatedPrompt = async (prompt: Question | Questions, validate: (r //this replicates the SDK 1.x functionality, //where you can have a separate display name and actual value returned -//prompt should be a ListQuestion (the only one that makes sense, really) +//prompt should be a ListQuestion, AutoCompleteQuestion, CheckboxQuestion //name must be unique, as it is used as a key -//having duplicate name causes undefined behaviour (probably just returns one of the matching at random) +//having duplicate names causes undefined behaviour (probably just returns one of the matching at random) +//prompt.choices will be overwritten, so feel free to set it to anything export const keyValPrompt = async (prompt: Question, choices: { name: string, value: any }[]) => { //the ListQuestion interface is not actually exported - if (prompt?.type != 'list') { - throw "prompt must be a ListQuestion!" + if (['list', 'autocomplete', 'checkbox'].includes(prompt?.name)) { + throw `prompt must be one of [list, autocomplete, checkbox], but got ${prompt?.name}!` } let nameList: string[] = new Array(choices.length) @@ -40,14 +41,17 @@ export const keyValPrompt = async (prompt: Question, choices: { name: string, va keyValMap.set(element.name, element.value) } - //have the use select the key... + //have the use select the key(s)... const resp = await ux.prompt(Object.assign(prompt, { choices: nameList })) if (prompt?.name && resp[prompt?.name]) { - //and return the associated value - // let retVal = {} - // retVal[prompt.name] = keyValMap.get(resp[prompt?.name]) - // return retVal - return { [prompt.name]: keyValMap.get(resp[prompt?.name]) }; + //and return the associated value(s) + if (prompt.type == 'checkbox') { + //multiple values + return { [prompt.name]: resp[prompt.name].map((currentValue: string) => { keyValMap.get(currentValue) }) } + } else { + //single value + return { [prompt.name]: keyValMap.get(resp[prompt.name]) }; + } } else { throw "keyValPrompt: Failed to get the value associated with the key" } From 316a51ccc22a7587b8f2f42c9efed7368d316410 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 13:24:57 -0800 Subject: [PATCH 12/33] Migrations to SDK 2 for a few more commands --- src/commands/issue:list.ts | 14 ++++++++--- src/commands/issue:search.ts | 42 +++++++++++++++---------------- src/commands/label:edit.ts | 30 +++++++++++----------- src/commands/label:sync.ts | 48 +++++++++++++++--------------------- 4 files changed, 65 insertions(+), 69 deletions(-) diff --git a/src/commands/issue:list.ts b/src/commands/issue:list.ts index 4a0912b..3820c0c 100644 --- a/src/commands/issue:list.ts +++ b/src/commands/issue:list.ts @@ -6,12 +6,19 @@ import { ParseAndHandleError } from '../errors' import { getConfig } from '../helpers/config' import { getGithub } from '../helpers/getGithub' import { isRepoCloned } from '../helpers/isRepoCloned' +import { keyValPrompt } from '../helpers/promptUtils' import { AnsIssueList } from '../types/Answers' import { IssueListFuzzy, IssueListValue } from '../types/IssueTypes' const debug = Debug('github:issueList') -let formattedList = [] +let formattedList: { + name: string; + value: { + number: number; + title: string; + }; +}[] = [] //see formatListRepo() const formatListRepo = (issues: Github.IssuesListForRepoResponse) => { return issues.map(issue => { @@ -63,10 +70,9 @@ const promptIssueSelection = async (): Promise => { `šŸ” Start work on an issue by running 'ops issue:start'!`, )}\n`, name: 'issue', - source: autocompleteSearch, - bottomContent: '', + choices: [] } - const { issue } = await ux.prompt(question) + const { issue } = await keyValPrompt(question, formattedList) return issue } diff --git a/src/commands/issue:search.ts b/src/commands/issue:search.ts index bd44645..bbc1a57 100644 --- a/src/commands/issue:search.ts +++ b/src/commands/issue:search.ts @@ -8,9 +8,10 @@ import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { execPromisified } from '../helpers/execPromisified' import { getGithub } from '../helpers/getGithub' import { checkForLocalBranch, makeInitialCommit } from '../helpers/git' -import { AnsFilterSelect, AnsIssueSelect } from '../types/Answers' +import { keyValPrompt } from '../helpers/promptUtils' +import { AnsFilterSelect } from '../types/Answers' import { CommandOptions } from '../types/Config' -import { DataForFilter, HelpInfo, IssueSelection, IssueSelectionItem } from '../types/IssueTypes' +import { DataForFilter, HelpInfo, IssueSelectionItem } from '../types/IssueTypes' const debug = Debug('github:issueSearch') const yargs = require('yargs') @@ -18,26 +19,23 @@ const yargs = require('yargs') const filterSelectPrompt = ( list: string[], ): Question[] => [ - { - type: 'autocomplete', - name: 'filter', - message: 'Please select the filter', - choices: list, - // pageSize: process.stdout.rows, - }, -] + { + type: 'autocomplete', + name: 'filter', + message: 'Please select the filter', + choices: list, + // pageSize: process.stdout.rows, + }, + ] -const issueSelectPrompt = ( - list: IssueSelection[], -): Question[] => [ - { - type: 'autocomplete', - name: 'issue', - message: 'Please select the issue (use āž”ļø key to view body)', - autocomplete: list, - pageSize: process.stdout.rows, - }, -] +const issueSelectPrompt: Question = +{ + type: 'autocomplete', + name: 'issue', + message: 'Please select the issue (use āž”ļø key to view body)', + choices: [], + // pageSize: process.stdout.rows, +} const checkboxPrompt = (list): Question[] => { return [ @@ -240,7 +238,7 @@ ${stateStr}\t ${commentStr}\t ${assigneeStr}\n` } }) - const { issue } = await ux.prompt(issueSelectPrompt(issueSelectionList)) + const { issue } = await keyValPrompt(issueSelectPrompt, issueSelectionList) await ux.spinner.start('🚧 Setting up a branch...') const branchName = `${issue.number}-${issue.title.replace(/\s/g, '-')}` diff --git a/src/commands/label:edit.ts b/src/commands/label:edit.ts index 1890239..b44cebd 100644 --- a/src/commands/label:edit.ts +++ b/src/commands/label:edit.ts @@ -6,6 +6,7 @@ import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' import { editLabel, findReposWithSelectedLabel, getAllLabelsForRepo } from '../helpers/labels' +import { keyValPrompt } from '../helpers/promptUtils' import { AnsSelectLabelEdit, AnsSelectReposForLabel, AnsSelectYesNo } from '../types/Answers' import { CommandOptions } from '../types/Config' import { LabelEditFormattedItem, LabelKeys, RepoWithOwnerAndName } from '../types/Labels' @@ -62,11 +63,10 @@ const labelSelection = async (): Promise => { type: 'autocomplete', message: 'Choose a label to edit:\n', name: 'label', - source: autocompleteSearch, - bottomContent: '', + choices: [], } - const { label } = await ux.prompt(questions) + const { label } = await keyValPrompt(questions, formattedList) return label } @@ -123,20 +123,20 @@ const selectRepos = async ( type: 'checkbox', name: 'reposSelected', message: 'Select from the list below', - choices: filteredRepos.map(repo => { - return { - name: `${repo.owner}/${repo.repo}`, - value: { - repo: repo.repo, - owner: repo.owner, - }, - } - }), + choices: [], } - const { reposSelected } = await ux.prompt( - repoListSelect, - ) + const choices = filteredRepos.map(repo => { + return { + name: `${repo.owner}/${repo.repo}`, + value: { + repo: repo.repo, + owner: repo.owner, + }, + } + }) + + const { reposSelected } = await keyValPrompt(repoListSelect, choices) return reposSelected } diff --git a/src/commands/label:sync.ts b/src/commands/label:sync.ts index 0eb0c99..2137a4c 100644 --- a/src/commands/label:sync.ts +++ b/src/commands/label:sync.ts @@ -5,7 +5,8 @@ import { ParseAndHandleError } from '../errors' import { getGithub } from '../helpers/getGithub' import { listRepos } from '../helpers/git' import { createLabels, getAllLabelsForRepo } from '../helpers/labels' -import { AnsBaseRepo, AnsSyncRepo } from '../types/Answers' +import { keyValPrompt } from '../helpers/promptUtils' +import { AnsBaseRepo } from '../types/Answers' import { LabelEditFormattedItem, LabelKeys, RepoWithLabelsToAdd, RepoWithOwnerAndName } from '../types/Labels' const debug = Debug('github:labelSync') @@ -43,33 +44,15 @@ const selectBaseRepoPrompt = ( type: 'autocomplete', name: 'baseRepo', message: 'Please select the base repo that you want to sync to.', - autocomplete: repoList.map(repo => `${repo.owner}/${repo.repo}`), + choices: repoList.map(repo => `${repo.owner}/${repo.repo}`), }, ] -const selectReposToSync = ( - repoList: RepoWithOwnerAndName[], - baseRepo: string, -): Question[] => { - const filteredRepoList = repoList.filter( - repo => `${repo.owner}/${repo.repo}` !== baseRepo, - ) - return [ - { - type: 'checkbox', - name: 'reposToSync', - message: 'Select the repos you wish to sync the labels of.', - choices: filteredRepoList.map(repo => { - return { - name: `${repo.owner}/${repo.repo}`, - value: { - owner: repo.owner, - repo: repo.repo, - }, - } - }), - }, - ] +const selectReposToSync: Question = { + type: 'checkbox', + name: 'reposToSync', + message: 'Select the repos you wish to sync the labels of.', + choices: [], } const formatRepoList = ( @@ -115,9 +98,18 @@ export const labelSync = async () => { const { baseRepo } = await ux.prompt( selectBaseRepoPrompt(formattedRepoList), ) - const { reposToSync } = await ux.prompt( - selectReposToSync(formattedRepoList, baseRepo), - ) + const { reposToSync } = await keyValPrompt(selectReposToSync, formattedRepoList + .filter( + repo => `${repo.owner}/${repo.repo}` !== baseRepo, + ).map(repo => { + return { + name: `${repo.owner}/${repo.repo}`, + value: { + owner: repo.owner, + repo: repo.repo, + }, + } + })) const { owner, repo } = findRepoObj(formattedRepoList, baseRepo) const baseRepoLabelList = await getAllLabelsForRepo(owner, repo, github) const formattedBaseRepoLabels = formatList(baseRepoLabelList) From bc755fa27b1ddf5379d44dc467b9f0788eddd7fe Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 13:38:33 -0800 Subject: [PATCH 13/33] Migrate pulls:list and repo:clone to SDK 2 --- src/commands/pulls:list.ts | 30 +++++++++++++----------------- src/commands/repo:clone.ts | 23 ++++------------------- 2 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/commands/pulls:list.ts b/src/commands/pulls:list.ts index dcfc708..d131b95 100644 --- a/src/commands/pulls:list.ts +++ b/src/commands/pulls:list.ts @@ -1,15 +1,22 @@ import { Question, sdk, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' -import * as fuzzy from 'fuzzy' import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' +import { keyValPrompt } from '../helpers/promptUtils' import { AnsSelectPull } from '../types/Answers' import { CommandOptions } from '../types/Config' -import { PullsListFuzzy, PullsListValue } from '../types/PullsTypes' +import { PullsListValue } from '../types/PullsTypes' -let formattedList = [] +let formattedList: { + name: string; + value: { + number: number; + title: string; + url: string; + }; +}[] = [] const debug = Debug('github:pullsList') @@ -33,17 +40,6 @@ const formatList = (pulls: Github.PullsListResponseItem[]) => { }) } -/** - * Does fuzzy search in the list for the matching characters - * - * @param {string} [input=''] - */ -const autocompleteSearch = async (_: any, input = '') => { - const fuzzyResult = await fuzzy.filter(input, formattedList, { - extract: el => el.name, - }) - return fuzzyResult.map(result => result.original) -} /** * prompt user to select a pull request * @@ -56,11 +52,11 @@ const promptPullRequestSelection = async ( type: 'autocomplete', message: `Here's a list of pull requests for ${repo}:`, name: 'pullRequest', - source: autocompleteSearch, - bottomContent: '', + choices: [], + // bottomContent: '', } - const { pullRequest } = await ux.prompt(questions) + const { pullRequest } = await keyValPrompt(questions, formattedList) return pullRequest } diff --git a/src/commands/repo:clone.ts b/src/commands/repo:clone.ts index ff750e5..8e01980 100644 --- a/src/commands/repo:clone.ts +++ b/src/commands/repo:clone.ts @@ -1,16 +1,15 @@ import { Question, sdk, ux } from '@cto.ai/sdk' import Debug from 'debug' -import * as fuzzy from 'fuzzy' import { ParseAndHandleError } from '../errors' import { getConfig } from '../helpers/config' import { getGithub } from '../helpers/getGithub' import { cloneRepo } from '../helpers/git' import { insertTokenInUrl } from '../helpers/insertTokenInUrl' import { isRepoCloned } from '../helpers/isRepoCloned' +import { keyValPrompt } from '../helpers/promptUtils' import { saveRemoteRepoToConfig } from '../helpers/saveRemoteRepoToConfig' import { AnsRepoCloneSelect } from '../types/Answers' import { CommandOptions } from '../types/Config' -import { Fuzzy } from '../types/Fuzzy' import { FormattedRepoClone, SelectedRepoClone } from '../types/RepoTypes' const debug = Debug('github:repoClone') @@ -48,20 +47,6 @@ const formatList = async (): Promise => { return formattedRepos } -/** - * Does fuzzy search in the list for the matching characters - * - * @param {any} _ - * @param {string} [input=''] - * @returns - */ -const autocompleteSearch = async (_: any, input = '') => { - const list = await formatList() - const fuzzyResult: Fuzzy[] = await fuzzy.filter(input, list, { - extract: el => el.name, - }) - return fuzzyResult.map(result => result.original) -} /** * Displays list of repo and returns the repo selected by the user @@ -74,11 +59,11 @@ const selectRepo = async (): Promise => { name: 'repo', // pageSize: 7, message: 'Select a repo to clone. Repos with šŸ¤– are already cloned.\n', - source: autocompleteSearch, - bottomContent: '', + choices: [], + // bottomContent: '', } // assign type SelectedRepoClone to remoteRepo - const { repo } = await ux.prompt(list) + const { repo } = await keyValPrompt(list, await formatList()) const { owner, name } = repo const remoteRepos = (await getConfig('remoteRepos')) || [] From 13e2d739a70333220e99d37ca05e3b0236a1889b Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 14:28:33 -0800 Subject: [PATCH 14/33] Migrated all commands to SDK 2 --- src/commands/repo:create.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/commands/repo:create.ts b/src/commands/repo:create.ts index 7a2de2e..be39be8 100644 --- a/src/commands/repo:create.ts +++ b/src/commands/repo:create.ts @@ -10,6 +10,7 @@ import { execPromisified } from '../helpers/execPromisified' import { getGithub } from '../helpers/getGithub' import { insertTokenInUrl } from '../helpers/insertTokenInUrl' import { createLabels } from '../helpers/labels' +import { keyValPrompt } from '../helpers/promptUtils' import { saveRemoteRepoToConfig } from '../helpers/saveRemoteRepoToConfig' import { AnsRepoCreate } from '../types/Answers' import { CommandOptions } from '../types/Config' @@ -65,14 +66,14 @@ const getRepoInfoFromUser = async ( return { name: org.login, value: org.login } }), ] + const orgQuestion: Question = { + type: 'list', + name: 'org', + message: `\nPlease select the organization of your repo →`, + choices: [], + // afterMessage: `${ux.colors.reset.green('āœ“')} Org`, + } const questions: Question[] = [ - { - type: 'list', - name: 'org', - message: `\nPlease select the organization of your repo →`, - choices: orgsList, - // afterMessage: `${ux.colors.reset.green('āœ“')} Org`, - }, { type: 'input', name: 'name', @@ -98,7 +99,9 @@ const getRepoInfoFromUser = async ( // afterMessage: `${ux.colors.reset.green('āœ“')} Type`, }, ] - const answers = await ux.prompt(questions) + const { org } = await keyValPrompt(orgQuestion, orgsList) + let answers = await ux.prompt(questions) + answers.org = org return answers } From a7026f42b2bc5d05e7d585d74d2eddc8bdcb9fce Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 14:29:47 -0800 Subject: [PATCH 15/33] Optional chaining is not supported yet by the node version in base image --- src/helpers/promptUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index d58fbb7..da5af75 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -27,8 +27,8 @@ export const validatedPrompt = async (prompt: Question | Questions, validate: (r //prompt.choices will be overwritten, so feel free to set it to anything export const keyValPrompt = async (prompt: Question, choices: { name: string, value: any }[]) => { //the ListQuestion interface is not actually exported - if (['list', 'autocomplete', 'checkbox'].includes(prompt?.name)) { - throw `prompt must be one of [list, autocomplete, checkbox], but got ${prompt?.name}!` + if (['list', 'autocomplete', 'checkbox'].includes(prompt.name)) { + throw `prompt must be one of [list, autocomplete, checkbox], but got ${prompt.name}!` } let nameList: string[] = new Array(choices.length) @@ -43,7 +43,7 @@ export const keyValPrompt = async (prompt: Question, choices: { name: string, va //have the use select the key(s)... const resp = await ux.prompt(Object.assign(prompt, { choices: nameList })) - if (prompt?.name && resp[prompt?.name]) { + if (resp[prompt.name]) { //and return the associated value(s) if (prompt.type == 'checkbox') { //multiple values From 2930212a928bf36067b4c9a2296d954d416f49cd Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 14:41:45 -0800 Subject: [PATCH 16/33] Fix building Signed-off-by: Vincent Tan --- Dockerfile | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c6de30..da20e78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN npx modclean -release && rm modclean*.log ADD . . -RUN npm run build && rm -rf /ops/src package-lock.json .dockerignore +RUN npm run build && rm -rf /ops/src package-lock.json .dockerignore && mv /ops/lib/templates /ops/lib/src/ && mv /ops/lib/src/* /ops/lib/ && rm -r /ops/lib/src/ ############################ # Final container diff --git a/package.json b/package.json index 03624c4..9242569 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "path": "^0.12.7", "simple-git": "^1.113.0", "strip-ansi": "^5.2.0", - "ts-node": "^8.1.0", + "ts-node": "^8.5.4", "yargs": "^15.1.0" } } From 90285ee05f4ce5b9ec2730324362d4a09293567a Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 15:10:16 -0800 Subject: [PATCH 17/33] Update dependencies, remove dead dependencies, add package-lock.json during build --- Dockerfile | 4 +- ops.yml | 1 + package-lock.json | 153 ++++++++++++++++++++++++++++++----- package.json | 14 ++-- src/commands/issue:search.ts | 28 +++---- 5 files changed, 159 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index da20e78..42d43c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,9 @@ WORKDIR /ops RUN apt update && apt install -y python && mkdir lib -ADD package.json . +ADD package.json package-lock.json ./ RUN npm install -RUN npx modclean -release && rm modclean*.log +RUN du -sh /ops/node_modules && npx modclean -release && rm modclean*.log && du -sh /ops/node_modules ADD . . diff --git a/ops.yml b/ops.yml index a824a75..a98260a 100644 --- a/ops.yml +++ b/ops.yml @@ -21,6 +21,7 @@ commands: - src - Dockerfile - package.json + - package-lock.json - .dockerignore - tsconfig.json mountCwd: # If set to `true`, binds the host's current working directory to `/cwd`; default value: `false` - working directory `/ops` diff --git a/package-lock.json b/package-lock.json index cfbb868..ac3a301 100644 --- a/package-lock.json +++ b/package-lock.json @@ -307,11 +307,26 @@ "strip-ansi": "^5.0.0" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, "slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } } } }, @@ -524,6 +539,11 @@ "wrap-ansi": "^4.0.0" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, "clean-stack": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", @@ -543,6 +563,14 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } } } }, @@ -574,6 +602,21 @@ "strip-ansi": "^5.0.0", "widest-line": "^2.0.1", "wrap-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "@oclif/screen": { @@ -1289,12 +1332,6 @@ "supports-color": "^5.3.0" } }, - "child_process": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/child_process/-/child_process-1.0.2.tgz", - "integrity": "sha1-sffn/HPSXn/R1FWtyU4UODAYK1o=", - "dev": true - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", @@ -1393,6 +1430,11 @@ "tslib": "^1.9.3" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -1402,6 +1444,14 @@ "jsonfile": "^4.0.0", "universalify": "^0.1.0" } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } } } }, @@ -2196,12 +2246,6 @@ "map-cache": "^0.2.2" } }, - "fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=", - "dev": true - }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -3404,6 +3448,12 @@ "jest-cli": "^24.9.0" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -3419,6 +3469,17 @@ "string-width": "^3.1.0", "strip-ansi": "^5.2.0", "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "find-up": { @@ -3514,6 +3575,17 @@ "ansi-styles": "^3.2.0", "string-width": "^3.0.0", "strip-ansi": "^5.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "yargs-parser": { @@ -3881,6 +3953,12 @@ "yargs": "^13.3.0" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -3896,6 +3974,17 @@ "string-width": "^3.1.0", "strip-ansi": "^5.2.0", "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "find-up": { @@ -3962,6 +4051,17 @@ "ansi-styles": "^3.2.0", "string-width": "^3.0.0", "strip-ansi": "^5.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "yargs": { @@ -9117,6 +9217,21 @@ "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "string.prototype.trimleft": { @@ -9149,17 +9264,17 @@ } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" } } }, diff --git a/package.json b/package.json index 9242569..1a94427 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,16 @@ }, "author": "CTO.ai", "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/cto-ai/github.git" + }, "devDependencies": { "@types/concat-stream": "^1.6.0", "@types/debug": "^4.1.5", "@types/jest": "^24.0.25", "@types/node": "^12.12.24", - "child_process": "^1.0.2", "concat-stream": "^2.0.0", - "fs": "0.0.1-security", "jest": "^24.9.0", "npm": "^6.13.4", "prettier": "^1.19.1", @@ -28,16 +30,16 @@ }, "dependencies": { "@cto.ai/sdk": "^2.0.4", - "@octokit/rest": "^16.25.5", + "@octokit/rest": "^16.36.0", "debug": "^4.1.1", - "fs-extra": "^8.0.1", + "fs-extra": "^8.1.0", "fuzzy": "^0.1.3", "git-branch": "^2.0.1", "is-docker": "^2.0.0", "parse-git-config": "^3.0.0", "path": "^0.12.7", - "simple-git": "^1.113.0", - "strip-ansi": "^5.2.0", + "simple-git": "^1.129.0", + "strip-ansi": "^6.0.0", "ts-node": "^8.5.4", "yargs": "^15.1.0" } diff --git a/src/commands/issue:search.ts b/src/commands/issue:search.ts index bbc1a57..843eb74 100644 --- a/src/commands/issue:search.ts +++ b/src/commands/issue:search.ts @@ -1,17 +1,17 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' -import * as Github from '@octokit/rest' -import Debug from 'debug' -import stripAnsi from 'strip-ansi' -import { LABELS } from '../constants' -import { ParseAndHandleError } from '../errors' -import { checkCurrentRepo } from '../helpers/checkCurrentRepo' -import { execPromisified } from '../helpers/execPromisified' -import { getGithub } from '../helpers/getGithub' -import { checkForLocalBranch, makeInitialCommit } from '../helpers/git' -import { keyValPrompt } from '../helpers/promptUtils' -import { AnsFilterSelect } from '../types/Answers' -import { CommandOptions } from '../types/Config' -import { DataForFilter, HelpInfo, IssueSelectionItem } from '../types/IssueTypes' +import { Question, sdk, ux } from '@cto.ai/sdk'; +import * as Github from '@octokit/rest'; +import Debug from 'debug'; +import { LABELS } from '../constants'; +import { ParseAndHandleError } from '../errors'; +import { checkCurrentRepo } from '../helpers/checkCurrentRepo'; +import { execPromisified } from '../helpers/execPromisified'; +import { getGithub } from '../helpers/getGithub'; +import { checkForLocalBranch, makeInitialCommit } from '../helpers/git'; +import { keyValPrompt } from '../helpers/promptUtils'; +import { AnsFilterSelect } from '../types/Answers'; +import { CommandOptions } from '../types/Config'; +import { DataForFilter, HelpInfo, IssueSelectionItem } from '../types/IssueTypes'; +import stripAnsi = require('strip-ansi'); const debug = Debug('github:issueSearch') const yargs = require('yargs') From d4d2b4a3ff0542765b8c7f1670dbb12c383bda18 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 15:43:08 -0800 Subject: [PATCH 18/33] Use ux.print to print to stdout Signed-off-by: Vincent Tan --- src/commands/issue:create.ts | 4 +- src/commands/issue:done.ts | 12 ++-- src/commands/issue:list.ts | 24 ++++--- src/commands/issue:save.ts | 6 +- src/commands/issue:search.ts | 57 ++++++++-------- src/commands/issue:start.ts | 8 ++- src/commands/label:add.ts | 42 +++++++----- src/commands/label:edit.ts | 28 +++++--- src/commands/label:remove.ts | 36 ++++++---- src/commands/label:sync.ts | 53 +++++++------- src/commands/pulls:list.ts | 14 ++-- src/commands/repo:clone.ts | 7 +- src/commands/repo:create.ts | 6 +- src/commands/token:update.ts | 10 ++- src/errors/index.ts | 30 ++++---- src/helpers/asyncPipe.ts | 3 +- src/helpers/checkCurrentRepo.ts | 12 ++-- src/helpers/logProvideCmdMsg.ts | 6 +- src/helpers/promptUtils.ts | 95 ++++++++++++++------------ src/types/Answers.ts | 13 +++- src/types/IssueTypes.ts | 2 +- tests_e2e/commands/issue:create.e2e.ts | 2 +- tests_e2e/commands/issue:done.e2e.ts | 2 +- tests_e2e/utils/cleanupFn.ts | 4 +- 24 files changed, 275 insertions(+), 201 deletions(-) diff --git a/src/commands/issue:create.ts b/src/commands/issue:create.ts index 5e79a4c..4ca3329 100644 --- a/src/commands/issue:create.ts +++ b/src/commands/issue:create.ts @@ -22,7 +22,7 @@ export const issueCreate = async (cmdOptions: CommandOptions) => { if (!hasIssues) { try { await ux.spinner.stop('āŒ') - sdk.log(`šŸƒ Trying to update repo to enable issues!`) + await ux.print(`šŸƒ Trying to update repo to enable issues!`) await github.repos.update({ name: repo, owner, @@ -86,7 +86,7 @@ export const issueCreate = async (cmdOptions: CommandOptions) => { body, }) - sdk.log( + await ux.print( `\nšŸŽ‰ Successfully created issue ${ux.colors.callOutCyan( `${title}`, )} for the ${ux.colors.callOutCyan( diff --git a/src/commands/issue:done.ts b/src/commands/issue:done.ts index 218e1ff..14b8b05 100644 --- a/src/commands/issue:done.ts +++ b/src/commands/issue:done.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import branch from 'git-branch' @@ -6,7 +6,11 @@ import { LABELS } from '../constants' import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' -import { AnsPullRequest, AnsSelectContributor, AnsSelectYesNo } from '../types/Answers' +import { + AnsPullRequest, + AnsSelectContributor, + AnsSelectYesNo, +} from '../types/Answers' import { CommandOptions } from '../types/Config' const debug = Debug('github:issueDone') @@ -97,7 +101,7 @@ export const issueDone = async (cmdOptions: CommandOptions) => { const currentBranch = await branch() if (currentBranch === 'master') { - sdk.log( + await ux.print( `\nāŒ Sorry, you cannot create a pull request with master as head. Checkout to a feature branch.\n`, ) process.exit() @@ -157,7 +161,7 @@ export const issueDone = async (cmdOptions: CommandOptions) => { const selected = await selectContributor(contributorsArr) await createComment(github, owner, repo, issue_number, selected) } - sdk.log( + await ux.print( `\nšŸŽ‰ Successfully created your pull-request! \nāž”ļø You can find it here: ${ux.colors.callOutCyan( url, )}\n`, diff --git a/src/commands/issue:list.ts b/src/commands/issue:list.ts index 3820c0c..ae14f7f 100644 --- a/src/commands/issue:list.ts +++ b/src/commands/issue:list.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fuzzy from 'fuzzy' @@ -13,11 +13,11 @@ import { IssueListFuzzy, IssueListValue } from '../types/IssueTypes' const debug = Debug('github:issueList') let formattedList: { - name: string; + name: string value: { - number: number; - title: string; - }; + number: number + title: string + } }[] = [] //see formatListRepo() const formatListRepo = (issues: Github.IssuesListForRepoResponse) => { @@ -70,7 +70,7 @@ const promptIssueSelection = async (): Promise => { `šŸ” Start work on an issue by running 'ops issue:start'!`, )}\n`, name: 'issue', - choices: [] + choices: [], } const { issue } = await keyValPrompt(question, formattedList) return issue @@ -125,14 +125,16 @@ export const issueList = async ({ currentRepo }) => { // check if issues exist if (!issues || !issues.length) { - sdk.log(`\nāŒ There are no issues. Create one with 'issue:create'.\n`) + await ux.print( + `\nāŒ There are no issues. Create one with 'issue:create'.\n`, + ) process.exit() } // format list for repo specific issues formattedList = formatListRepo(issues) const { number, title } = await promptIssueSelection() - sdk.log( + await ux.print( `\nāœ… Run '$ ops run github issue:start' to get started with the issue '# ${number} - ${title}'.\n`, ) process.exit() @@ -143,7 +145,7 @@ export const issueList = async ({ currentRepo }) => { // check if issues exist if (!issues || !issues.length) { - sdk.log(`āŒ There are no issues. Create one with 'issue:create'.`) + await ux.print(`āŒ There are no issues. Create one with 'issue:create'.`) process.exit() } @@ -152,12 +154,12 @@ export const issueList = async ({ currentRepo }) => { const remoteRepos = (await getConfig('remoteRepos')) || [] if (isRepoCloned(repoOwner, repoName, remoteRepos)) { - sdk.log( + await ux.print( `\nāœ… cd ${repoName} and use command 'ops run github issue:start' to get started with the issue.\n`, ) process.exit() } - sdk.log( + await ux.print( `\nšŸ¤– Repo ${repoName} is not yet cloned. Clone the repo using command repo:clone and then use issue:start to get started on the issue.\n`, ) } catch (err) { diff --git a/src/commands/issue:save.ts b/src/commands/issue:save.ts index 52ed7b6..717d223 100644 --- a/src/commands/issue:save.ts +++ b/src/commands/issue:save.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import Debug from 'debug' import branch from 'git-branch' import { ParseAndHandleError } from '../errors' @@ -18,7 +18,7 @@ export const issueSave = async () => { try { const hasLocalChanges = await checkLocalChanges() if (!hasLocalChanges) { - sdk.log('\nāŒ Nothing to save!\n') + await ux.print('\nāŒ Nothing to save!\n') return } await execPromisified(`git add .`) @@ -26,7 +26,7 @@ export const issueSave = async () => { await execPromisified(`git commit -m "${message}"`) const currentBranch = await branch() await execPromisified(`git push --set-upstream origin ${currentBranch}`) - sdk.log('\nšŸŽ‰ Successfully committed and pushed your code!\n') + await ux.print('\nšŸŽ‰ Successfully committed and pushed your code!\n') } catch (err) { debug(err) await ParseAndHandleError(err, 'issue:save') diff --git a/src/commands/issue:search.ts b/src/commands/issue:search.ts index 843eb74..912662d 100644 --- a/src/commands/issue:search.ts +++ b/src/commands/issue:search.ts @@ -1,35 +1,36 @@ -import { Question, sdk, ux } from '@cto.ai/sdk'; -import * as Github from '@octokit/rest'; -import Debug from 'debug'; -import { LABELS } from '../constants'; -import { ParseAndHandleError } from '../errors'; -import { checkCurrentRepo } from '../helpers/checkCurrentRepo'; -import { execPromisified } from '../helpers/execPromisified'; -import { getGithub } from '../helpers/getGithub'; -import { checkForLocalBranch, makeInitialCommit } from '../helpers/git'; -import { keyValPrompt } from '../helpers/promptUtils'; -import { AnsFilterSelect } from '../types/Answers'; -import { CommandOptions } from '../types/Config'; -import { DataForFilter, HelpInfo, IssueSelectionItem } from '../types/IssueTypes'; -import stripAnsi = require('strip-ansi'); +import { Question, ux } from '@cto.ai/sdk' +import * as Github from '@octokit/rest' +import Debug from 'debug' +import { LABELS } from '../constants' +import { ParseAndHandleError } from '../errors' +import { checkCurrentRepo } from '../helpers/checkCurrentRepo' +import { execPromisified } from '../helpers/execPromisified' +import { getGithub } from '../helpers/getGithub' +import { checkForLocalBranch, makeInitialCommit } from '../helpers/git' +import { keyValPrompt } from '../helpers/promptUtils' +import { AnsFilterSelect } from '../types/Answers' +import { CommandOptions } from '../types/Config' +import { + DataForFilter, + HelpInfo, + IssueSelectionItem, +} from '../types/IssueTypes' +import stripAnsi = require('strip-ansi') const debug = Debug('github:issueSearch') const yargs = require('yargs') -const filterSelectPrompt = ( - list: string[], -): Question[] => [ - { - type: 'autocomplete', - name: 'filter', - message: 'Please select the filter', - choices: list, - // pageSize: process.stdout.rows, - }, - ] +const filterSelectPrompt = (list: string[]): Question[] => [ + { + type: 'autocomplete', + name: 'filter', + message: 'Please select the filter', + choices: list, + // pageSize: process.stdout.rows, + }, +] -const issueSelectPrompt: Question = -{ +const issueSelectPrompt: Question = { type: 'autocomplete', name: 'issue', message: 'Please select the issue (use āž”ļø key to view body)', @@ -273,7 +274,7 @@ ${stateStr}\t ${commentStr}\t ${assigneeStr}\n` LABELS.PM_TASKS.name, ) } - sdk.log( + await ux.print( `\nšŸ™Œ Issue ${ux.colors.callOutCyan( `${issue.number}-${issue.title}`, )} has been checked out and ready to be worked on.\nUse ${ux.colors.callOutCyan( diff --git a/src/commands/issue:start.ts b/src/commands/issue:start.ts index 75a29a2..7a39e40 100644 --- a/src/commands/issue:start.ts +++ b/src/commands/issue:start.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import Debug from 'debug' import { LABELS } from '../constants' import { ParseAndHandleError } from '../errors' @@ -31,7 +31,9 @@ export const issueStart = async (cmdOptions: CommandOptions) => { }) if (!filteredIssues || !filteredIssues.length) { - sdk.log(`\nāŒ There are no issues. Create one with 'issue:create'.\n`) + await ux.print( + `\nāŒ There are no issues. Create one with 'issue:create'.\n`, + ) return } @@ -90,7 +92,7 @@ export const issueStart = async (cmdOptions: CommandOptions) => { } catch (err) { await ParseAndHandleError(err, 'Local git branch creation/checkout') } - sdk.log( + await ux.print( `\nšŸ™Œ Issue ${ux.colors.callOutCyan( `# ${answers.issue.number} - ${answers.issue.title}`, )} has been checked out and read to be worked on.\nUse ${ux.colors.callOutCyan( diff --git a/src/commands/label:add.ts b/src/commands/label:add.ts index f379121..e92a4cd 100644 --- a/src/commands/label:add.ts +++ b/src/commands/label:add.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import { ParseAndHandleError } from '../errors' @@ -49,16 +49,20 @@ const promptUserInput = async () => { //TODO: not sure if setting errMess in validation function works. Will have to test. // let errMess: string = "" - const answers = await validatedPrompt(questions, (response: any) => { - if (response[questions[1].name].length > 100) { - // errMess = ' Label description must be under 100 characters in length!' - return false - } else if (!isValidColor(response[questions[2].name])) { - // errMess = ' That is not a valid hex code!' - return false - } - return true - }, 'Label description must be under 100 characters in length, and colour must be a valid hex code!') + const answers = await validatedPrompt( + questions, + (response: any) => { + if (response[questions[1].name].length > 100) { + // errMess = ' Label description must be under 100 characters in length!' + return false + } else if (!isValidColor(response[questions[2].name])) { + // errMess = ' That is not a valid hex code!' + return false + } + return true + }, + 'Label description must be under 100 characters in length, and colour must be a valid hex code!', + ) return answers } @@ -124,12 +128,14 @@ export const labelAdd = async (cmdOptions: CommandOptions) => { type: 'checkbox', name: 'reposSelected', message: 'Select from the list below', - choices: repoKV.map((val) => { return val.name }), + choices: repoKV.map(val => { + return val.name + }), } - const reposSelectedUnmapped: string[] = await ux.prompt( - repoListSelect, - ) - const reposSelected = reposSelectedUnmapped.map((value) => { return repoKV[value] }) + const reposSelectedUnmapped: string[] = await ux.prompt(repoListSelect) + const reposSelected = reposSelectedUnmapped.map(value => { + return repoKV[value] + }) try { await Promise.all( @@ -143,7 +149,7 @@ export const labelAdd = async (cmdOptions: CommandOptions) => { await ParseAndHandleError(err, 'createLabels()') } - sdk.log( + await ux.print( `šŸŽ‰ ${ux.colors.green( 'Label has been added to the selected repos.', )}`, @@ -158,7 +164,7 @@ export const labelAdd = async (cmdOptions: CommandOptions) => { await ParseAndHandleError(err, 'createLabels()') } - sdk.log(`šŸŽ‰ ${ux.colors.green('Label has been added.')}`) + await ux.print(`šŸŽ‰ ${ux.colors.green('Label has been added.')}`) process.exit() } catch (err) { debug('label add failed', err) diff --git a/src/commands/label:edit.ts b/src/commands/label:edit.ts index b44cebd..f3d7f4b 100644 --- a/src/commands/label:edit.ts +++ b/src/commands/label:edit.ts @@ -1,15 +1,27 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fuzzy from 'fuzzy' import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' -import { editLabel, findReposWithSelectedLabel, getAllLabelsForRepo } from '../helpers/labels' +import { + editLabel, + findReposWithSelectedLabel, + getAllLabelsForRepo, +} from '../helpers/labels' import { keyValPrompt } from '../helpers/promptUtils' -import { AnsSelectLabelEdit, AnsSelectReposForLabel, AnsSelectYesNo } from '../types/Answers' +import { + AnsSelectLabelEdit, + AnsSelectReposForLabel, + AnsSelectYesNo, +} from '../types/Answers' import { CommandOptions } from '../types/Config' -import { LabelEditFormattedItem, LabelKeys, RepoWithOwnerAndName } from '../types/Labels' +import { + LabelEditFormattedItem, + LabelKeys, + RepoWithOwnerAndName, +} from '../types/Labels' const debug = Debug('github:labelEdit') @@ -168,7 +180,7 @@ export const labelEdit = async (cmdOptions: CommandOptions) => { const yesOrNo = await promptYesNo() if (yesOrNo) { - sdk.log(`Finding repos that has the label ${labelName}...`) + await ux.print(`Finding repos that has the label ${labelName}...`) try { // find all repos that has the selected label @@ -187,7 +199,7 @@ export const labelEdit = async (cmdOptions: CommandOptions) => { return await editLabel(owner, repo, labelName, newLabel, github) }), ) - sdk.log( + await ux.print( `šŸŽ‰ ${ux.colors.green( `Label ${labelName} has been updated in the selected repos.`, )}`, @@ -198,7 +210,7 @@ export const labelEdit = async (cmdOptions: CommandOptions) => { await ParseAndHandleError(err, 'editLabel()') } } catch (err) { - sdk.log(`${err}\nšŸƒ Updating label in the current repo!`) + await ux.print(`${err}\nšŸƒ Updating label in the current repo!`) await ParseAndHandleError(err, 'Update label') } } @@ -217,7 +229,7 @@ export const labelEdit = async (cmdOptions: CommandOptions) => { await ParseAndHandleError(err, 'editLabel()') } - sdk.log( + await ux.print( `šŸŽ‰ ${ux.colors.green( `Label ${labelName} has been updated in the current repo.`, )}`, diff --git a/src/commands/label:remove.ts b/src/commands/label:remove.ts index dc8656c..3bedcce 100644 --- a/src/commands/label:remove.ts +++ b/src/commands/label:remove.ts @@ -1,14 +1,26 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fuzzy from 'fuzzy' import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' -import { findReposWithSelectedLabel, getAllLabelsForRepo, removeLabel } from '../helpers/labels' -import { AnsSelectLabelRemove, AnsSelectReposForLabel, AnsSelectYesNo } from '../types/Answers' +import { + findReposWithSelectedLabel, + getAllLabelsForRepo, + removeLabel, +} from '../helpers/labels' +import { + AnsSelectLabelRemove, + AnsSelectReposForLabel, + AnsSelectYesNo, +} from '../types/Answers' import { CommandOptions } from '../types/Config' -import { LabelRemoveFormattedItem, LabelRemoveFormattedItemValue, RepoWithOwnerAndName } from '../types/Labels' +import { + LabelRemoveFormattedItem, + LabelRemoveFormattedItemValue, + RepoWithOwnerAndName, +} from '../types/Labels' const debug = Debug('github:labelRemove') @@ -60,7 +72,7 @@ const labelSelection = async (): Promise => { type: 'autocomplete', message: 'Choose a label to remove:\n', name: 'label', - choices: formattedList + choices: formattedList, // source: autocompleteSearch, // bottomContent: '', } @@ -103,12 +115,12 @@ const selectRepos = async ( }), } - const reposSelectedUnmapped: string[] = await ux.prompt( - repoListSelect, - ) + const reposSelectedUnmapped: string[] = await ux.prompt(repoListSelect) return reposSelectedUnmapped.map((value: string) => { - return repoKV.find((repoEntry) => { return repoEntry.name == value }).value + return repoKV.find(repoEntry => { + return repoEntry.name == value + }).value }) // return reposSelected } @@ -136,7 +148,7 @@ export const labelRemove = async (cmdOptions: CommandOptions) => { const yesOrNo = await promptYesNo() if (yesOrNo) { - sdk.log(`Finding repos that has the label ${labelName}...`) + await ux.print(`Finding repos that has the label ${labelName}...`) try { // find all repos that has the selected label const filteredRepos = await findReposWithSelectedLabel( @@ -160,7 +172,7 @@ export const labelRemove = async (cmdOptions: CommandOptions) => { await ParseAndHandleError(err, 'Label removed from organzation repos') } - sdk.log( + await ux.print( `šŸŽ‰ ${ux.colors.green( 'Label has been removed from the selected repos.', )}`, @@ -179,7 +191,7 @@ export const labelRemove = async (cmdOptions: CommandOptions) => { debug('remove label failed', err) await ParseAndHandleError(err, 'label:remove') } - sdk.log( + await ux.print( `šŸŽ‰ ${ux.colors.green('Label has been removed from the current repo.')}`, ) process.exit() diff --git a/src/commands/label:sync.ts b/src/commands/label:sync.ts index 2137a4c..2e869fc 100644 --- a/src/commands/label:sync.ts +++ b/src/commands/label:sync.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import { ParseAndHandleError } from '../errors' @@ -7,7 +7,12 @@ import { listRepos } from '../helpers/git' import { createLabels, getAllLabelsForRepo } from '../helpers/labels' import { keyValPrompt } from '../helpers/promptUtils' import { AnsBaseRepo } from '../types/Answers' -import { LabelEditFormattedItem, LabelKeys, RepoWithLabelsToAdd, RepoWithOwnerAndName } from '../types/Labels' +import { + LabelEditFormattedItem, + LabelKeys, + RepoWithLabelsToAdd, + RepoWithOwnerAndName, +} from '../types/Labels' const debug = Debug('github:labelSync') @@ -40,13 +45,13 @@ const formatList = ( const selectBaseRepoPrompt = ( repoList: RepoWithOwnerAndName[], ): Question[] => [ - { - type: 'autocomplete', - name: 'baseRepo', - message: 'Please select the base repo that you want to sync to.', - choices: repoList.map(repo => `${repo.owner}/${repo.repo}`), - }, - ] + { + type: 'autocomplete', + name: 'baseRepo', + message: 'Please select the base repo that you want to sync to.', + choices: repoList.map(repo => `${repo.owner}/${repo.repo}`), + }, +] const selectReposToSync: Question = { type: 'checkbox', @@ -98,18 +103,20 @@ export const labelSync = async () => { const { baseRepo } = await ux.prompt( selectBaseRepoPrompt(formattedRepoList), ) - const { reposToSync } = await keyValPrompt(selectReposToSync, formattedRepoList - .filter( - repo => `${repo.owner}/${repo.repo}` !== baseRepo, - ).map(repo => { - return { - name: `${repo.owner}/${repo.repo}`, - value: { - owner: repo.owner, - repo: repo.repo, - }, - } - })) + const { reposToSync } = await keyValPrompt( + selectReposToSync, + formattedRepoList + .filter(repo => `${repo.owner}/${repo.repo}` !== baseRepo) + .map(repo => { + return { + name: `${repo.owner}/${repo.repo}`, + value: { + owner: repo.owner, + repo: repo.repo, + }, + } + }), + ) const { owner, repo } = findRepoObj(formattedRepoList, baseRepo) const baseRepoLabelList = await getAllLabelsForRepo(owner, repo, github) const formattedBaseRepoLabels = formatList(baseRepoLabelList) @@ -146,11 +153,11 @@ export const labelSync = async () => { const labelStr = labels.map( label => `${ux.colors.hex(label.color)(label.name)}`, ) - sdk.log( + await ux.print( `Adding labels: ${labelStr.join('. ')} to ${owner}/${repo}.`, ) } else { - sdk.log( + await ux.print( `${owner}/${repo} already has labels synced with base repo!`, ) } diff --git a/src/commands/pulls:list.ts b/src/commands/pulls:list.ts index d131b95..535ea96 100644 --- a/src/commands/pulls:list.ts +++ b/src/commands/pulls:list.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import { ParseAndHandleError } from '../errors' @@ -10,12 +10,12 @@ import { CommandOptions } from '../types/Config' import { PullsListValue } from '../types/PullsTypes' let formattedList: { - name: string; + name: string value: { - number: number; - title: string; - url: string; - }; + number: number + title: string + url: string + } }[] = [] const debug = Debug('github:pullsList') @@ -92,7 +92,7 @@ export const pullsList = async (cmdOptions: CommandOptions) => { formattedList = formatList(pulls) const { url } = await promptPullRequestSelection(repo) - sdk.log( + await ux.print( `\nView the pull request here: šŸ”— ${ux.colors.actionBlue(`${url}`)}\n`, ) } catch (err) { diff --git a/src/commands/repo:clone.ts b/src/commands/repo:clone.ts index 8e01980..d2df9c6 100644 --- a/src/commands/repo:clone.ts +++ b/src/commands/repo:clone.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import Debug from 'debug' import { ParseAndHandleError } from '../errors' import { getConfig } from '../helpers/config' @@ -47,7 +47,6 @@ const formatList = async (): Promise => { return formattedRepos } - /** * Displays list of repo and returns the repo selected by the user * @@ -68,10 +67,10 @@ const selectRepo = async (): Promise => { const remoteRepos = (await getConfig('remoteRepos')) || [] if (isRepoCloned(owner, name, remoteRepos)) { - sdk.log(`\n āŒ You have already cloned this repo!`) + await ux.print(`\n āŒ You have already cloned this repo!`) process.exit() } - sdk.log( + await ux.print( `\n šŸŽ‰ ${ux.colors.callOutCyan( `Successfully cloned repo! ${ux.colors.white( `'cd ${name}'`, diff --git a/src/commands/repo:create.ts b/src/commands/repo:create.ts index be39be8..d551270 100644 --- a/src/commands/repo:create.ts +++ b/src/commands/repo:create.ts @@ -1,4 +1,4 @@ -import { Question, sdk, ux } from '@cto.ai/sdk' +import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' import * as fs from 'fs-extra' @@ -95,7 +95,7 @@ const getRepoInfoFromUser = async ( // { name: 'šŸ” private', value: 'private' }, // { name: 'šŸŒŽ public', value: 'public' }, // ], - choices: ['private', 'public'] + choices: ['private', 'public'], // afterMessage: `${ux.colors.reset.green('āœ“')} Type`, }, ] @@ -182,7 +182,7 @@ export const repoCreate = async ({ accessToken }: CommandOptions) => { ux.spinner.stop(`${ux.colors.green('done!')}`) - sdk.log( + await ux.print( `\nšŸŽ‰ ${ux.colors.callOutCyan( `Successfully created repo ${ux.colors.white( name, diff --git a/src/commands/token:update.ts b/src/commands/token:update.ts index 2a3fae9..c65a068 100644 --- a/src/commands/token:update.ts +++ b/src/commands/token:update.ts @@ -28,9 +28,13 @@ export const promptForToken = async () => { // !!input.trim() || 'Please enter a valid Github Access Token', } // return await ux.prompt(question) - return await validatedPrompt(question, (input: any) => { - return !!input[question.name].trim() ? false : true - }, 'Please enter a valid Github Access Token') + return await validatedPrompt( + question, + (input: any) => { + return !!input[question.name].trim() + }, + 'Please enter a valid Github Access Token', + ) } export const updateAccessToken = async () => { diff --git a/src/errors/index.ts b/src/errors/index.ts index f502697..77a061a 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -1,6 +1,10 @@ import { sdk, ux } from '@cto.ai/sdk' import { setConfig } from '@cto.ai/sdk/dist/sdk' -import { CREDS_ERROR_MSG, NOT_GIT_REPO_ERROR_MSG, NO_CMD_ERROR_MSG } from './constants' +import { + CREDS_ERROR_MSG, + NOT_GIT_REPO_ERROR_MSG, + NO_CMD_ERROR_MSG, +} from './constants' export * from './credentials' const ERROR_TAGS = ['github', 'error handler'] @@ -20,7 +24,7 @@ export const ParseAndHandleError = async ( const errorMessage = err.message.toLowerCase() if (errorMessage.includes(CREDS_ERROR_MSG.toLowerCase())) { - sdk.log( + await ux.print( "😢 Looks like you're using an invalid token. Try running token:update to update your token", ) // This removes the invalid token from the config @@ -29,40 +33,42 @@ export const ParseAndHandleError = async ( await setConfig('accessToken', '') process.exit() } else if (errorMessage.includes(NOT_GIT_REPO_ERROR_MSG)) { - sdk.log( + await ux.print( `This directory is not a git repository, please run ${actionBlue( 'repo:create', )} or ${actionBlue('repo:clone')} to get started!`, ) process.exit() } else if (errorMessage.includes(NO_CMD_ERROR_MSG)) { - sdk.log(`āœ‹ Sorry, we didn't recognize ${command} as a valid command!`) + await ux.print( + `āœ‹ Sorry, we didn't recognize ${command} as a valid command!`, + ) process.exit() } else if ( err.status && err.status === 404 && command === 'Remove and Add Labels' ) { - sdk.log(`šŸ˜… This issue did not contain the label ${labelName}!`) + await ux.print(`šŸ˜… This issue did not contain the label ${labelName}!`) } else if (err.status && err.status === 404 && command === 'listForOrg()') { - sdk.log(`šŸ˜… This repo does not belong to any organizations!`) + await ux.print(`šŸ˜… This repo does not belong to any organizations!`) process.exit() } else if (err.status && err.status === 404 && command === 'getLabel()') { - sdk.log(`šŸ˜… The label ${labelName} does not exist for this repo!`) + await ux.print(`šŸ˜… The label ${labelName} does not exist for this repo!`) process.exit() } else if (err.status && err.status === 404) { await ux.print(err) - sdk.log( + await ux.print( `šŸ˜… This Github repo either does not exist, or you do not have user permissions to access this repo's details!`, ) process.exit() } else if (err.status && err.status === 410) { - sdk.log( + await ux.print( `The repo you are trying to access is moved. Refer to the error message for more details: ${err.message}`, ) process.exit() } else if (err.status && err.status === 422 && command === 'createLabel()') { - sdk.log( + await ux.print( `āŒ Label ${labelName} already exists in the repo ${repoName}! Create a label with a different name!`, ) process.exit() @@ -72,14 +78,14 @@ export const ParseAndHandleError = async ( command === 'Creating Pull Request' ) { await ux.print(err) - sdk.log( + await ux.print( `āŒ Creating pull request failed due to validation error. \nšŸ· Make sure to commit and push code using ${callOutCyan( 'issue:save', )} before using ${secondary('issue:done')}!\n`, ) process.exit() } else if (command === 'createLabel()') { - sdk.log( + await ux.print( `šŸ˜… Sorry, failed to create ${labelName} in repo ${repoName}. Refer to ${errorMessage} for more details.`, ) process.exit() diff --git a/src/helpers/asyncPipe.ts b/src/helpers/asyncPipe.ts index a3741d6..9dee5ed 100644 --- a/src/helpers/asyncPipe.ts +++ b/src/helpers/asyncPipe.ts @@ -1,4 +1,4 @@ -import { ux } from "@cto.ai/sdk" +import { ux } from '@cto.ai/sdk' // based on https://github.com/obengwilliam/pipeawait @@ -12,4 +12,3 @@ const _trace = (msg: string) => (x: any) => { } export { asyncPipe, _trace } - diff --git a/src/helpers/checkCurrentRepo.ts b/src/helpers/checkCurrentRepo.ts index b81f673..12f02dd 100644 --- a/src/helpers/checkCurrentRepo.ts +++ b/src/helpers/checkCurrentRepo.ts @@ -1,5 +1,5 @@ const parse = require('parse-git-config') -import { sdk, ux } from '@cto.ai/sdk' +import { ux } from '@cto.ai/sdk' import { ParseAndHandleError } from '../errors' import { CommandOptions } from '../types/Config' import { execPromisified } from './execPromisified' @@ -8,7 +8,7 @@ import { saveRemoteRepoToConfig } from './saveRemoteRepoToConfig' const REPO_OWNER_REGEX = /(?<=github\.com(\/|:))[a-z0-9A-Z]+/g const REPO_NAME_REGEX = /(?<=github\.com(\/|:)[a-z0-9A-Z]+\/)[a-z0-9A-Z-]+/g -export const filterForRepoInfo = (url: string) => { +export const filterForRepoInfo = async (url: string) => { const repoOwnerMatch = url.match(REPO_OWNER_REGEX) const repoNameMatch = url.match(REPO_NAME_REGEX) if (repoOwnerMatch && repoNameMatch) { @@ -17,7 +17,7 @@ export const filterForRepoInfo = (url: string) => { repo: repoNameMatch[0], } } else { - sdk.log( + await ux.print( `ā—ļø Failed to parse gitconfig for repo info! Please make sure the repo's remote "origin" is set to a valid Github repo!`, ) process.exit() @@ -26,7 +26,7 @@ export const filterForRepoInfo = (url: string) => { export const checkCurrentRepo = async (cmdOptions: CommandOptions) => { if (!cmdOptions.accessToken) { - sdk.log( + await ux.print( `šŸ¤” It seems like you have not configured your Github access token. Please run ${ux.colors.actionBlue( 'token:update', )} to set your access token!`, @@ -39,12 +39,12 @@ export const checkCurrentRepo = async (cmdOptions: CommandOptions) => { const gitconfig = await parse() const originUrl = gitconfig['remote "origin"'].url if (!originUrl.includes('github')) { - sdk.log( + await ux.print( `ā— This repo's remote "origin" is not currently set for a Github repo`, ) process.exit() } else { - const { owner, repo } = filterForRepoInfo(originUrl) + const { owner, repo } = await filterForRepoInfo(originUrl) const url = await saveRemoteRepoToConfig(owner, repo) await execPromisified(`git remote set-url origin ${url}`) cmdOptions.currentRepo = { owner, repo } diff --git a/src/helpers/logProvideCmdMsg.ts b/src/helpers/logProvideCmdMsg.ts index 6609a64..45ee8c8 100644 --- a/src/helpers/logProvideCmdMsg.ts +++ b/src/helpers/logProvideCmdMsg.ts @@ -1,4 +1,4 @@ -import { sdk, ux } from '@cto.ai/sdk' +import { ux } from '@cto.ai/sdk' const getTable = async commands => { const data = Object.keys(commands).map(item => { @@ -30,8 +30,8 @@ export const logProvideCmdMsg = async commands => { const msgPost = `\nāž”ļø Try cloning a repo using ${ux.colors.multiPurple( 'ops run github repo:clone', )} to get started!\n` - sdk.log(msgPre) + await ux.print(msgPre) // ux.table returns void but console logs the table await getTable(commands) - sdk.log(msgPost) + await ux.print(msgPost) } diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index da5af75..3a70d9b 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -1,22 +1,26 @@ -import { Question, Questions, ux } from '@cto.ai/sdk'; +import { Question, Questions, ux } from '@cto.ai/sdk' //This re-prompts user until their answer passes validation //validate takes in the return value of ux.prompt, and forces re-prompt if it returns false //errorMessage is displayed to user when validation fails -export const validatedPrompt = async (prompt: Question | Questions, validate: (response: any) => boolean, errorMessage: string) => { - let response: any - let repeatedPrompt = false - //keep asking as long as validation fails - do { - if (repeatedPrompt) { - //not our first prompt - //must have errored, so print the error message - await ux.print(errorMessage) - } - response = await ux.prompt(prompt) - repeatedPrompt = true - } while (!validate(response)); - return response +export const validatedPrompt = async ( + prompt: Question | Questions, + validate: (response: any) => boolean, + errorMessage: string, +) => { + let response: any + let repeatedPrompt = false + //keep asking as long as validation fails + do { + if (repeatedPrompt) { + //not our first prompt + //must have errored, so print the error message + await ux.print(errorMessage) + } + response = await ux.prompt(prompt) + repeatedPrompt = true + } while (!validate(response)) + return response } //this replicates the SDK 1.x functionality, @@ -25,34 +29,41 @@ export const validatedPrompt = async (prompt: Question | Questions, validate: (r //name must be unique, as it is used as a key //having duplicate names causes undefined behaviour (probably just returns one of the matching at random) //prompt.choices will be overwritten, so feel free to set it to anything -export const keyValPrompt = async (prompt: Question, choices: { name: string, value: any }[]) => { - //the ListQuestion interface is not actually exported - if (['list', 'autocomplete', 'checkbox'].includes(prompt.name)) { - throw `prompt must be one of [list, autocomplete, checkbox], but got ${prompt.name}!` - } +export const keyValPrompt = async ( + prompt: Question, + choices: { name: string; value: any }[], +) => { + //the ListQuestion interface is not actually exported + if (['list', 'autocomplete', 'checkbox'].includes(prompt.name)) { + throw `prompt must be one of [list, autocomplete, checkbox], but got ${prompt.name}!` + } - let nameList: string[] = new Array(choices.length) - let keyValMap: Map = new Map() - for (let index = 0; index < choices.length; index++) { - //iterate through choices, getting an array of names - //and a key-value map - const element = choices[index]; - nameList[index] = element.name; - keyValMap.set(element.name, element.value) - } + let nameList: string[] = new Array(choices.length) + let keyValMap: Map = new Map() + for (let index = 0; index < choices.length; index++) { + //iterate through choices, getting an array of names + //and a key-value map + const element = choices[index] + nameList[index] = element.name + keyValMap.set(element.name, element.value) + } - //have the use select the key(s)... - const resp = await ux.prompt(Object.assign(prompt, { choices: nameList })) - if (resp[prompt.name]) { - //and return the associated value(s) - if (prompt.type == 'checkbox') { - //multiple values - return { [prompt.name]: resp[prompt.name].map((currentValue: string) => { keyValMap.get(currentValue) }) } - } else { - //single value - return { [prompt.name]: keyValMap.get(resp[prompt.name]) }; - } + //have the use select the key(s)... + const resp = await ux.prompt(Object.assign(prompt, { choices: nameList })) + if (resp[prompt.name]) { + //and return the associated value(s) + if (prompt.type == 'checkbox') { + //multiple values + return { + [prompt.name]: resp[prompt.name].map((currentValue: string) => { + keyValMap.get(currentValue) + }), + } } else { - throw "keyValPrompt: Failed to get the value associated with the key" + //single value + return { [prompt.name]: keyValMap.get(resp[prompt.name]) } } -} \ No newline at end of file + } else { + throw 'keyValPrompt: Failed to get the value associated with the key' + } +} diff --git a/src/types/Answers.ts b/src/types/Answers.ts index c2e1a6f..6dc7fa0 100644 --- a/src/types/Answers.ts +++ b/src/types/Answers.ts @@ -1,5 +1,14 @@ -import { IssueListValue, IssueStartValue, IssueValue, RepoContributor } from './IssueTypes' -import { LabelKeys, LabelRemoveFormattedItemValue, RepoWithOwnerAndName } from './Labels' +import { + IssueListValue, + IssueStartValue, + IssueValue, + RepoContributor, +} from './IssueTypes' +import { + LabelKeys, + LabelRemoveFormattedItemValue, + RepoWithOwnerAndName, +} from './Labels' import { PullsListValue } from './PullsTypes' import { SelectedRepoClone } from './RepoTypes' diff --git a/src/types/IssueTypes.ts b/src/types/IssueTypes.ts index 88339b0..2094ea7 100644 --- a/src/types/IssueTypes.ts +++ b/src/types/IssueTypes.ts @@ -1,4 +1,4 @@ -import { Question } from '@cto.ai/sdk'; +import { Question } from '@cto.ai/sdk' export interface IssueListValue { title: string diff --git a/tests_e2e/commands/issue:create.e2e.ts b/tests_e2e/commands/issue:create.e2e.ts index 6de66c1..48a795f 100644 --- a/tests_e2e/commands/issue:create.e2e.ts +++ b/tests_e2e/commands/issue:create.e2e.ts @@ -45,7 +45,7 @@ describe('issue:create happy path', () => { ) process.exit() } - const { owner, repo } = filterForRepoInfo(originUrl) + const { owner, repo } = await filterForRepoInfo(originUrl) await github.repos .get({ diff --git a/tests_e2e/commands/issue:done.e2e.ts b/tests_e2e/commands/issue:done.e2e.ts index 2e3d668..d96e166 100644 --- a/tests_e2e/commands/issue:done.e2e.ts +++ b/tests_e2e/commands/issue:done.e2e.ts @@ -37,7 +37,7 @@ describe('issue:done happy path', () => { ) process.exit() } - const { owner, repo } = filterForRepoInfo(originUrl) + const { owner, repo } = await filterForRepoInfo(originUrl) process.chdir('a') diff --git a/tests_e2e/utils/cleanupFn.ts b/tests_e2e/utils/cleanupFn.ts index 0e41e3d..0827c55 100644 --- a/tests_e2e/utils/cleanupFn.ts +++ b/tests_e2e/utils/cleanupFn.ts @@ -17,7 +17,7 @@ const cleanRepoCreate = async () => { ) process.exit() } - const { owner, repo } = filterForRepoInfo(originUrl) + const { owner, repo } = await filterForRepoInfo(originUrl) await github.repos.delete({ owner, repo, @@ -68,7 +68,7 @@ const cleanIssueCreate = async () => { ) process.exit() } - const { owner, repo } = filterForRepoInfo(originUrl) + const { owner, repo } = await filterForRepoInfo(originUrl) await github.repos.delete({ owner, repo, From 29ec2de18258caae2cecc1929d83d0632e13ca0b Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 15:55:27 -0800 Subject: [PATCH 19/33] await spinners --- src/commands/repo:create.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/repo:create.ts b/src/commands/repo:create.ts index d551270..361b113 100644 --- a/src/commands/repo:create.ts +++ b/src/commands/repo:create.ts @@ -132,7 +132,7 @@ const createGithubRepo = async ( return response } catch (err) { await ux.print(err) - ux.spinner.stop('failed!') + await ux.spinner.stop('failed!') await ParseAndHandleError(err, 'createRepo()') } } @@ -180,7 +180,7 @@ export const repoCreate = async ({ accessToken }: CommandOptions) => { `cd ${name} && git add . && git commit --allow-empty -m 'initial commit' && git push`, ) - ux.spinner.stop(`${ux.colors.green('done!')}`) + await ux.spinner.stop(`${ux.colors.green('done!')}`) await ux.print( `\nšŸŽ‰ ${ux.colors.callOutCyan( @@ -192,7 +192,7 @@ export const repoCreate = async ({ accessToken }: CommandOptions) => { )} \n`, ) } catch (err) { - ux.spinner.stop(`${ux.colors.red('failed!')}\n`) + await ux.spinner.stop(`${ux.colors.red('failed!')}\n`) debug('repo:create failed', err) await ParseAndHandleError(err, 'repo:create') } From a46d7c60f9ead8c1c65ad9a5546898dad8f03982 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Wed, 8 Jan 2020 16:07:15 -0800 Subject: [PATCH 20/33] Remove unused autocomplete stuff Signed-off-by: Vincent Tan --- src/commands/issue:create.ts | 2 +- src/commands/issue:list.ts | 15 +-------------- src/commands/label:edit.ts | 18 ------------------ src/commands/label:remove.ts | 17 ----------------- 4 files changed, 2 insertions(+), 50 deletions(-) diff --git a/src/commands/issue:create.ts b/src/commands/issue:create.ts index 4ca3329..aa15e5a 100644 --- a/src/commands/issue:create.ts +++ b/src/commands/issue:create.ts @@ -1,4 +1,4 @@ -import { sdk, ux } from '@cto.ai/sdk' +import { ux } from '@cto.ai/sdk' import Debug from 'debug' import * as fs from 'fs' import * as path from 'path' diff --git a/src/commands/issue:list.ts b/src/commands/issue:list.ts index ae14f7f..0a29807 100644 --- a/src/commands/issue:list.ts +++ b/src/commands/issue:list.ts @@ -1,14 +1,13 @@ import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' -import * as fuzzy from 'fuzzy' import { ParseAndHandleError } from '../errors' import { getConfig } from '../helpers/config' import { getGithub } from '../helpers/getGithub' import { isRepoCloned } from '../helpers/isRepoCloned' import { keyValPrompt } from '../helpers/promptUtils' import { AnsIssueList } from '../types/Answers' -import { IssueListFuzzy, IssueListValue } from '../types/IssueTypes' +import { IssueListValue } from '../types/IssueTypes' const debug = Debug('github:issueList') @@ -51,18 +50,6 @@ const formatListAll = (issues: Github.IssuesListResponse) => { }) } -/** - * Does fuzzy search in the list for the matching characters - * - * @param {string} [input=''] - */ -const autocompleteSearch = async (_: any, input = '') => { - const fuzzyResult = await fuzzy.filter(input, formattedList, { - extract: el => el.name, - }) - return fuzzyResult.map(result => result.original) -} - const promptIssueSelection = async (): Promise => { const question: Question = { type: 'autocomplete', diff --git a/src/commands/label:edit.ts b/src/commands/label:edit.ts index f3d7f4b..0bc9a45 100644 --- a/src/commands/label:edit.ts +++ b/src/commands/label:edit.ts @@ -1,7 +1,6 @@ import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' -import * as fuzzy from 'fuzzy' import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' @@ -22,7 +21,6 @@ import { LabelKeys, RepoWithOwnerAndName, } from '../types/Labels' - const debug = Debug('github:labelEdit') let formattedList = [] @@ -49,22 +47,6 @@ const formatList = ( }) } -/** - * Does fuzzy search in the list for the matching characters - * - * @param {string} [input=''] - */ -const autocompleteSearch = async (_: any, input = '') => { - const fuzzyResult = await fuzzy.filter( - input, - formattedList, - { - extract: el => el.name, - }, - ) - return fuzzyResult.map(result => result.original) -} - /** * Prompt user to select or fuzzy search for label from the labels list * diff --git a/src/commands/label:remove.ts b/src/commands/label:remove.ts index 3bedcce..d2eeb82 100644 --- a/src/commands/label:remove.ts +++ b/src/commands/label:remove.ts @@ -1,7 +1,6 @@ import { Question, ux } from '@cto.ai/sdk' import * as Github from '@octokit/rest' import Debug from 'debug' -import * as fuzzy from 'fuzzy' import { ParseAndHandleError } from '../errors' import { checkCurrentRepo } from '../helpers/checkCurrentRepo' import { getGithub } from '../helpers/getGithub' @@ -46,22 +45,6 @@ const formatList = ( }) } -/** - * Does fuzzy search in the list for the matching characters - * - * @param {string} [input=''] - */ -const autocompleteSearch = async (_: any, input = '') => { - const fuzzyResult = await fuzzy.filter( - input, - formattedList, - { - extract: el => el.name, - }, - ) - return fuzzyResult.map(result => result.original) -} - /** * Prompt user to select or fuzzy search for label from the labels list * From 72afd34eeb05f595bae377adc4d81d2384ba7a4a Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Thu, 16 Jan 2020 16:27:39 -0800 Subject: [PATCH 21/33] Remove commented out code Signed-off-by: Vincent Tan --- ops.yml | 2 -- package-lock.json | 36 ++++++++++++++++++------------------ package.json | 8 ++++---- src/commands/issue:create.ts | 2 -- src/commands/issue:done.ts | 2 -- src/commands/issue:list.ts | 2 +- src/commands/issue:search.ts | 3 --- src/commands/label:add.ts | 17 ----------------- src/commands/label:edit.ts | 3 --- src/commands/label:remove.ts | 3 --- src/commands/pulls:list.ts | 1 - src/commands/repo:clone.ts | 2 -- src/commands/repo:create.ts | 7 ------- src/commands/token:update.ts | 5 ----- 14 files changed, 23 insertions(+), 70 deletions(-) diff --git a/ops.yml b/ops.yml index a98260a..8c658ff 100644 --- a/ops.yml +++ b/ops.yml @@ -32,8 +32,6 @@ commands: - /tmp:/tmp - ~/.ssh:/root/.ssh - ~/.ops/cto.ai/github:/root/.ops/cto.ai/github - # port: # Map ports for your op container - # - 3000:3000 help: # Configure the output for when your op is run with `op --help` or `op -h` usage: "ops run github [ARGUMENT]" arguments: diff --git a/package-lock.json b/package-lock.json index ac3a301..c36a814 100644 --- a/package-lock.json +++ b/package-lock.json @@ -781,9 +781,9 @@ } }, "@types/jest": { - "version": "24.0.25", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.25.tgz", - "integrity": "sha512-hnP1WpjN4KbGEK4dLayul6lgtys6FPz0UfxMeMQCv0M+sTnzN3ConfiO72jHgLxl119guHgI8gLqDOrRLsyp2g==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.9.0.tgz", + "integrity": "sha512-dXvuABY9nM1xgsXlOtLQXJKdacxZJd7AtvLsKZ/0b57ruMXDKCOXAC/M75GbllQX6o1pcZ5hAG4JzYy7Z/wM2w==", "dev": true, "requires": { "jest-diff": "^24.3.0" @@ -1797,9 +1797,9 @@ "dev": true }, "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" }, "diff-sequences": { "version": "24.9.0", @@ -4663,9 +4663,9 @@ } }, "npm": { - "version": "6.13.4", - "resolved": "https://registry.npmjs.org/npm/-/npm-6.13.4.tgz", - "integrity": "sha512-vTcUL4SCg3AzwInWTbqg1OIaOXlzKSS8Mb8kc5avwrJpcvevDA5J9BhYSuei+fNs3pwOp4lzA5x2FVDXACvoXA==", + "version": "6.13.6", + "resolved": "https://registry.npmjs.org/npm/-/npm-6.13.6.tgz", + "integrity": "sha512-NomC08kv7HIl1FOyLOe9Hp89kYsOsvx52huVIJ7i8hFW8Xp65lDwe/8wTIrh9q9SaQhA8hTrfXPh3BEL3TmMpw==", "dev": true, "requires": { "JSONStream": "^1.3.5", @@ -4753,7 +4753,7 @@ "once": "~1.4.0", "opener": "^1.5.1", "osenv": "^0.1.5", - "pacote": "^9.5.11", + "pacote": "^9.5.12", "path-is-inside": "~1.0.2", "promise-inflight": "~1.0.1", "qrcode-terminal": "^0.12.0", @@ -7035,7 +7035,7 @@ } }, "pacote": { - "version": "9.5.11", + "version": "9.5.12", "bundled": true, "dev": true, "requires": { @@ -9567,15 +9567,15 @@ } }, "ts-node": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.4.tgz", - "integrity": "sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw==", + "version": "8.6.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz", + "integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==", "requires": { "arg": "^4.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "source-map-support": "^0.5.6", - "yn": "^3.0.0" + "yn": "3.1.1" } }, "tslib": { @@ -9614,9 +9614,9 @@ "dev": true }, "typescript": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", - "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz", + "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 1a94427..1306523 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,14 @@ "devDependencies": { "@types/concat-stream": "^1.6.0", "@types/debug": "^4.1.5", - "@types/jest": "^24.0.25", + "@types/jest": "^24.9.0", "@types/node": "^12.12.24", "concat-stream": "^2.0.0", "jest": "^24.9.0", - "npm": "^6.13.4", + "npm": "^6.13.6", "prettier": "^1.19.1", "ts-jest": "^24.3.0", - "typescript": "^3.7.4" + "typescript": "^3.7.5" }, "dependencies": { "@cto.ai/sdk": "^2.0.4", @@ -40,7 +40,7 @@ "path": "^0.12.7", "simple-git": "^1.129.0", "strip-ansi": "^6.0.0", - "ts-node": "^8.5.4", + "ts-node": "^8.6.2", "yargs": "^15.1.0" } } diff --git a/src/commands/issue:create.ts b/src/commands/issue:create.ts index aa15e5a..57adb80 100644 --- a/src/commands/issue:create.ts +++ b/src/commands/issue:create.ts @@ -44,7 +44,6 @@ export const issueCreate = async (cmdOptions: CommandOptions) => { type: 'input', name: 'title', message: `\nšŸ“ Please enter your issue title:`, - // afterMessage: `Title: `, }, { type: 'list', @@ -53,7 +52,6 @@ export const issueCreate = async (cmdOptions: CommandOptions) => { 'Your default editor will be opened to allow editing of the issue details.', )}`, choices: fs.readdirSync(templateDir), - // afterMessage: `Type: `, }, ]) diff --git a/src/commands/issue:done.ts b/src/commands/issue:done.ts index 14b8b05..ddedecf 100644 --- a/src/commands/issue:done.ts +++ b/src/commands/issue:done.ts @@ -19,13 +19,11 @@ const pullRequestQuestions: Question[] = [ type: 'input', name: 'title', message: 'Enter a title for the Pull Request:', - // afterMessage: `${ux.colors.reset.green('āœ“')} Title`, }, { type: 'input', name: 'comment', message: 'Enter a comment or description for your Pull Request', - // afterMessage: `${ux.colors.reset.green('āœ“')} Comment`, }, ] diff --git a/src/commands/issue:list.ts b/src/commands/issue:list.ts index 0a29807..ff6f8ad 100644 --- a/src/commands/issue:list.ts +++ b/src/commands/issue:list.ts @@ -127,7 +127,7 @@ export const issueList = async ({ currentRepo }) => { process.exit() } - // if cuurent repo is undefined, list all issues + // if current repo is undefined, list all issues const issues = await getIssuesAll(github) // check if issues exist diff --git a/src/commands/issue:search.ts b/src/commands/issue:search.ts index 912662d..e7c7bec 100644 --- a/src/commands/issue:search.ts +++ b/src/commands/issue:search.ts @@ -26,7 +26,6 @@ const filterSelectPrompt = (list: string[]): Question[] => [ name: 'filter', message: 'Please select the filter', choices: list, - // pageSize: process.stdout.rows, }, ] @@ -35,7 +34,6 @@ const issueSelectPrompt: Question = { name: 'issue', message: 'Please select the issue (use āž”ļø key to view body)', choices: [], - // pageSize: process.stdout.rows, } const checkboxPrompt = (list): Question[] => { @@ -45,7 +43,6 @@ const checkboxPrompt = (list): Question[] => { name: 'issueFilter', message: 'Please select the filter', choices: list, - // pageSize: process.stdout.rows, }, ] } diff --git a/src/commands/label:add.ts b/src/commands/label:add.ts index e92a4cd..272f2b8 100644 --- a/src/commands/label:add.ts +++ b/src/commands/label:add.ts @@ -23,32 +23,15 @@ const promptUserInput = async () => { type: 'input', name: 'description', message: `\nPlease enter your label description:`, - // afterMessage: `Description: `, - // validate: input => { - // if (input.length > 100) { - // return ' Label description must be under 100 characters in length!' - // } else { - // return true - // } - // }, }, { type: 'input', name: 'color', message: `\nProvide a valid hex code for your label color (without #):`, - // afterMessage: `Color: `, - // validate: input => { - // if (!isValidColor(input)) { - // return ' That is not a valid hex code!' - // } else { - // return true - // } - // }, }, ] //TODO: not sure if setting errMess in validation function works. Will have to test. - // let errMess: string = "" const answers = await validatedPrompt( questions, (response: any) => { diff --git a/src/commands/label:edit.ts b/src/commands/label:edit.ts index 0bc9a45..6169b57 100644 --- a/src/commands/label:edit.ts +++ b/src/commands/label:edit.ts @@ -75,21 +75,18 @@ const promptLabelEdit = async ({ name: 'name', message: 'Enter a new name for the label:', default: name, - // afterMessage: `${ux.colors.reset.green('āœ“')} Name`, }, { type: 'input', name: 'description', message: 'Enter a new description for the label:', default: description, - // afterMessage: `${ux.colors.reset.green('āœ“')} Description`, }, { type: 'input', name: 'color', message: 'Enter a new color for the label:', default: color, - // afterMessage: `${ux.colors.reset.green('āœ“')} Color`, }, ] diff --git a/src/commands/label:remove.ts b/src/commands/label:remove.ts index d2eeb82..5763412 100644 --- a/src/commands/label:remove.ts +++ b/src/commands/label:remove.ts @@ -56,8 +56,6 @@ const labelSelection = async (): Promise => { message: 'Choose a label to remove:\n', name: 'label', choices: formattedList, - // source: autocompleteSearch, - // bottomContent: '', } const { label } = await ux.prompt(questions) @@ -105,7 +103,6 @@ const selectRepos = async ( return repoEntry.name == value }).value }) - // return reposSelected } export const labelRemove = async (cmdOptions: CommandOptions) => { diff --git a/src/commands/pulls:list.ts b/src/commands/pulls:list.ts index 535ea96..d8032a3 100644 --- a/src/commands/pulls:list.ts +++ b/src/commands/pulls:list.ts @@ -53,7 +53,6 @@ const promptPullRequestSelection = async ( message: `Here's a list of pull requests for ${repo}:`, name: 'pullRequest', choices: [], - // bottomContent: '', } const { pullRequest } = await keyValPrompt(questions, formattedList) diff --git a/src/commands/repo:clone.ts b/src/commands/repo:clone.ts index d2df9c6..ea7c6b7 100644 --- a/src/commands/repo:clone.ts +++ b/src/commands/repo:clone.ts @@ -56,10 +56,8 @@ const selectRepo = async (): Promise => { const list: Question = { type: 'autocomplete', name: 'repo', - // pageSize: 7, message: 'Select a repo to clone. Repos with šŸ¤– are already cloned.\n', choices: [], - // bottomContent: '', } // assign type SelectedRepoClone to remoteRepo const { repo } = await keyValPrompt(list, await formatList()) diff --git a/src/commands/repo:create.ts b/src/commands/repo:create.ts index 361b113..f78636a 100644 --- a/src/commands/repo:create.ts +++ b/src/commands/repo:create.ts @@ -71,7 +71,6 @@ const getRepoInfoFromUser = async ( name: 'org', message: `\nPlease select the organization of your repo →`, choices: [], - // afterMessage: `${ux.colors.reset.green('āœ“')} Org`, } const questions: Question[] = [ { @@ -85,18 +84,12 @@ const getRepoInfoFromUser = async ( name: 'description', message: `\nPlease enter the description of the repo → \n${ux.colors.white('šŸ“ Enter Description')}`, - // afterMessage: `${ux.colors.reset.green('āœ“')} Description`, }, { type: 'list', name: 'privateOrPublic', message: 'Do you want to create a public repo or a private repo?', - // choices: [ - // { name: 'šŸ” private', value: 'private' }, - // { name: 'šŸŒŽ public', value: 'public' }, - // ], choices: ['private', 'public'], - // afterMessage: `${ux.colors.reset.green('āœ“')} Type`, }, ] const { org } = await keyValPrompt(orgQuestion, orgsList) diff --git a/src/commands/token:update.ts b/src/commands/token:update.ts index c65a068..f91e1fb 100644 --- a/src/commands/token:update.ts +++ b/src/commands/token:update.ts @@ -22,12 +22,7 @@ export const promptForToken = async () => { `'admin'`, )} scopes to grant to this access token.\n\n• Copy the access token and provide it below šŸ‘‡.`, )} \n\n\nšŸ”‘ Please enter your github token:`, - // afterMessage: `${ux.colors.reset.green('āœ“')} Access Token`, - // afterMessageAppend: `${ux.colors.reset(' added!')}`, - // validate: (input: string) => - // !!input.trim() || 'Please enter a valid Github Access Token', } - // return await ux.prompt(question) return await validatedPrompt( question, (input: any) => { From 66f6b1d55a549fcc81bc34ab3f5afd04a656cd6c Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Thu, 16 Jan 2020 16:35:16 -0800 Subject: [PATCH 22/33] Cleaned up commented out code Signed-off-by: Vincent Tan --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 42d43c6..fc51944 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,6 @@ FROM registry.cto.ai/official_images/node:latest WORKDIR /ops -# RUN apt update && apt install git make && npm install -g typescript && npm install -g ts-node @types/node && rm -rf /var/lib/apt/lists/* RUN apt update && apt install -y git make ca-certificates && rm -rf /var/lib/apt/lists/* COPY --from=dep /ops . From 592f93bf69d688781e3978753c3b65bf97ee859b Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Thu, 16 Jan 2020 16:35:42 -0800 Subject: [PATCH 23/33] Bump version to v1.1.0 Signed-off-by: Vincent Tan --- ops.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops.yml b/ops.yml index 8c658ff..c483457 100644 --- a/ops.yml +++ b/ops.yml @@ -1,7 +1,7 @@ version: "1" commands: - name: # Unique identifier for your op (required) - github:1.0.0 + github:1.1.0 description: # Short description for what your op does (required) An Op to simplify an opinionated GitHub workflow. public: # Determines whether this version of the op is visible to other people From b1007c1930d2c1d0c158769450e7ae0394cd385c Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Thu, 16 Jan 2020 16:36:01 -0800 Subject: [PATCH 24/33] Validate message for issue:save Signed-off-by: Vincent Tan --- src/commands/issue:save.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/issue:save.ts b/src/commands/issue:save.ts index 717d223..d5a8941 100644 --- a/src/commands/issue:save.ts +++ b/src/commands/issue:save.ts @@ -5,6 +5,7 @@ import { ParseAndHandleError } from '../errors' import { execPromisified } from '../helpers/execPromisified' import { checkLocalChanges } from '../helpers/git' import { AnsIssueSave } from '../types/Answers' +import { validatedPrompt } from '../helpers/promptUtils' const debug = Debug('github:issueSave') @@ -22,7 +23,7 @@ export const issueSave = async () => { return } await execPromisified(`git add .`) - const { message } = await ux.prompt(question) + const message = await validatedPrompt(question, (resp) => { return resp == '' ? true : false }, ' Commit message cannot be empty!') await execPromisified(`git commit -m "${message}"`) const currentBranch = await branch() await execPromisified(`git push --set-upstream origin ${currentBranch}`) From ae8fc0996b5f203d4bdb522c153193e9ace64305 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Thu, 16 Jan 2020 16:36:22 -0800 Subject: [PATCH 25/33] Fixed missing NOT Signed-off-by: Vincent Tan --- src/helpers/promptUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index 3a70d9b..5e25ac1 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -34,7 +34,7 @@ export const keyValPrompt = async ( choices: { name: string; value: any }[], ) => { //the ListQuestion interface is not actually exported - if (['list', 'autocomplete', 'checkbox'].includes(prompt.name)) { + if (!['list', 'autocomplete', 'checkbox'].includes(prompt.name)) { throw `prompt must be one of [list, autocomplete, checkbox], but got ${prompt.name}!` } From 85adcd6d1f5ddc09f46df573a89784b744e92753 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Thu, 16 Jan 2020 16:39:41 -0800 Subject: [PATCH 26/33] Renamed symbol nameList -> choicesArr Signed-off-by: Vincent Tan --- src/helpers/promptUtils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index 5e25ac1..44d1d6b 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -38,18 +38,18 @@ export const keyValPrompt = async ( throw `prompt must be one of [list, autocomplete, checkbox], but got ${prompt.name}!` } - let nameList: string[] = new Array(choices.length) + let choicesArr: string[] = new Array(choices.length) let keyValMap: Map = new Map() for (let index = 0; index < choices.length; index++) { //iterate through choices, getting an array of names //and a key-value map const element = choices[index] - nameList[index] = element.name + choicesArr[index] = element.name keyValMap.set(element.name, element.value) } - //have the use select the key(s)... - const resp = await ux.prompt(Object.assign(prompt, { choices: nameList })) + //have the user select the key(s)... + const resp = await ux.prompt(Object.assign(prompt, { choices: choicesArr })) if (resp[prompt.name]) { //and return the associated value(s) if (prompt.type == 'checkbox') { From 251af041770e89768517d3a0805c4c6e73eabbbd Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Thu, 16 Jan 2020 16:49:42 -0800 Subject: [PATCH 27/33] Cleaned up promptUtils Signed-off-by: Vincent Tan --- src/helpers/promptUtils.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index 44d1d6b..53d7553 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -33,9 +33,10 @@ export const keyValPrompt = async ( prompt: Question, choices: { name: string; value: any }[], ) => { + const { name, type } = prompt //the ListQuestion interface is not actually exported - if (!['list', 'autocomplete', 'checkbox'].includes(prompt.name)) { - throw `prompt must be one of [list, autocomplete, checkbox], but got ${prompt.name}!` + if (!['list', 'autocomplete', 'checkbox'].includes(name)) { + throw `prompt must be one of [list, autocomplete, checkbox], but got ${name}!` } let choicesArr: string[] = new Array(choices.length) @@ -50,18 +51,18 @@ export const keyValPrompt = async ( //have the user select the key(s)... const resp = await ux.prompt(Object.assign(prompt, { choices: choicesArr })) - if (resp[prompt.name]) { + if (resp[name]) { //and return the associated value(s) - if (prompt.type == 'checkbox') { + if (type == 'checkbox') { //multiple values return { - [prompt.name]: resp[prompt.name].map((currentValue: string) => { + [name]: resp[name].map((currentValue: string) => { keyValMap.get(currentValue) }), } } else { //single value - return { [prompt.name]: keyValMap.get(resp[prompt.name]) } + return { [name]: keyValMap.get(resp[name]) } } } else { throw 'keyValPrompt: Failed to get the value associated with the key' From 5a2a10431ac1348a01b2dfe2fcd21c08daacfcbd Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Mon, 20 Jan 2020 14:40:24 -0800 Subject: [PATCH 28/33] Add typing to keyValPrompt and update packages Signed-off-by: Vincent Tan --- package-lock.json | 24 ++++++++++++------------ package.json | 6 +++--- src/helpers/promptUtils.ts | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index c36a814..7ee2687 100644 --- a/package-lock.json +++ b/package-lock.json @@ -660,9 +660,9 @@ } }, "@octokit/rest": { - "version": "16.36.0", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.36.0.tgz", - "integrity": "sha512-zoZj7Ya4vWBK4fjTwK2Cnmu7XBB1p9ygSvTk2TthN6DVJXM4hQZQoAiknWFLJWSTix4dnA3vuHtjPZbExYoCZA==", + "version": "16.37.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.37.0.tgz", + "integrity": "sha512-qLPK9FOCK4iVpn6ghknNuv/gDDxXQG6+JBQvoCwWjQESyis9uemakjzN36nvvp8SCny7JuzHI2RV8ChbV5mYdQ==", "requires": { "@octokit/request": "^5.2.0", "@octokit/request-error": "^1.0.2", @@ -679,9 +679,9 @@ } }, "@octokit/types": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.0.2.tgz", - "integrity": "sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.1.0.tgz", + "integrity": "sha512-n1GUYFgKm5glcy0E+U5jnqAFY2p04rnK4A0YhuM70C7Vm9Vyx+xYwd/WOTEr8nUJcbPSR/XL+/26+rirY6jJQA==", "requires": { "@types/node": ">= 8" } @@ -790,9 +790,9 @@ } }, "@types/node": { - "version": "12.12.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.24.tgz", - "integrity": "sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug==" + "version": "12.12.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.25.tgz", + "integrity": "sha512-nf1LMGZvgFX186geVZR1xMZKKblJiRfiASTHw85zED2kI1yDKHDwTKMdkaCbTlXoRKlGKaDfYywt+V0As30q3w==" }, "@types/stack-utils": { "version": "1.0.1", @@ -8929,9 +8929,9 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-git": { - "version": "1.129.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.129.0.tgz", - "integrity": "sha512-XbzNmugMTeV2crZnPl+b1ZJn+nqXCUNyrZxDXpLM0kHL3B85sbPlpd8q9I4qtAHI9D2FxTB6w4BuiAGKYtyzKw==", + "version": "1.130.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.130.0.tgz", + "integrity": "sha512-gQsPA1uuAkGUa6S+yG4NRknKHVEV+Vnp437w8dJpDpzjtEH566WRSz5z6DoIxlBFaLC7Xwypznsuf1S/J0gtFg==", "requires": { "debug": "^4.0.1" } diff --git a/package.json b/package.json index 1306523..d286413 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@types/concat-stream": "^1.6.0", "@types/debug": "^4.1.5", "@types/jest": "^24.9.0", - "@types/node": "^12.12.24", + "@types/node": "^12.12.25", "concat-stream": "^2.0.0", "jest": "^24.9.0", "npm": "^6.13.6", @@ -30,7 +30,7 @@ }, "dependencies": { "@cto.ai/sdk": "^2.0.4", - "@octokit/rest": "^16.36.0", + "@octokit/rest": "^16.37.0", "debug": "^4.1.1", "fs-extra": "^8.1.0", "fuzzy": "^0.1.3", @@ -38,7 +38,7 @@ "is-docker": "^2.0.0", "parse-git-config": "^3.0.0", "path": "^0.12.7", - "simple-git": "^1.129.0", + "simple-git": "^1.130.0", "strip-ansi": "^6.0.0", "ts-node": "^8.6.2", "yargs": "^15.1.0" diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index 53d7553..444a70c 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -29,7 +29,7 @@ export const validatedPrompt = async ( //name must be unique, as it is used as a key //having duplicate names causes undefined behaviour (probably just returns one of the matching at random) //prompt.choices will be overwritten, so feel free to set it to anything -export const keyValPrompt = async ( +export const keyValPrompt: (prompt: Question, choices: { name: string; value: any;}[]) => Promise<{[x: string]: any;}> = async ( prompt: Question, choices: { name: string; value: any }[], ) => { From e342ddf1b603cfbbeca9f2577dca36d69723eba6 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Mon, 20 Jan 2020 14:53:00 -0800 Subject: [PATCH 29/33] Remove TODO Signed-off-by: Vincent Tan --- src/commands/label:add.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/commands/label:add.ts b/src/commands/label:add.ts index 272f2b8..5856a62 100644 --- a/src/commands/label:add.ts +++ b/src/commands/label:add.ts @@ -31,7 +31,6 @@ const promptUserInput = async () => { }, ] - //TODO: not sure if setting errMess in validation function works. Will have to test. const answers = await validatedPrompt( questions, (response: any) => { From 71251fc63615e35e5c3a2a82c41c76d34d0a9ddb Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Mon, 20 Jan 2020 14:53:21 -0800 Subject: [PATCH 30/33] Revert debugging-only function from ux.print back to console.log Signed-off-by: Vincent Tan --- src/helpers/asyncPipe.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/helpers/asyncPipe.ts b/src/helpers/asyncPipe.ts index 9dee5ed..27076c4 100644 --- a/src/helpers/asyncPipe.ts +++ b/src/helpers/asyncPipe.ts @@ -1,13 +1,10 @@ -import { ux } from '@cto.ai/sdk' - // based on https://github.com/obengwilliam/pipeawait const asyncPipe = (...fns: Function[]) => (param?: any) => fns.reduce(async (acc, fn) => fn(await acc), param) const _trace = (msg: string) => (x: any) => { - //TODO: this should/should not be async - ux.print(msg + ' ' + x) + console.log(msg + ' ' + x) return x } From 4550c84e09cc5ebbcd1a0441f2eb821fbc24b579 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Mon, 20 Jan 2020 14:54:00 -0800 Subject: [PATCH 31/33] validatedPrompt error message is now optional Signed-off-by: Vincent Tan --- src/helpers/promptUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index 444a70c..d58214c 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -6,13 +6,13 @@ import { Question, Questions, ux } from '@cto.ai/sdk' export const validatedPrompt = async ( prompt: Question | Questions, validate: (response: any) => boolean, - errorMessage: string, + errorMessage?: string, ) => { let response: any let repeatedPrompt = false //keep asking as long as validation fails do { - if (repeatedPrompt) { + if (repeatedPrompt && errorMessage) { //not our first prompt //must have errored, so print the error message await ux.print(errorMessage) From 5f75372eb0d1d064ccfe7f7c7e8568bf021bb463 Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Mon, 20 Jan 2020 16:38:03 -0800 Subject: [PATCH 32/33] Improve comments for promptUtils functions Signed-off-by: Vincent Tan --- src/helpers/promptUtils.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index d58214c..21e5efe 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -1,8 +1,12 @@ import { Question, Questions, ux } from '@cto.ai/sdk' -//This re-prompts user until their answer passes validation -//validate takes in the return value of ux.prompt, and forces re-prompt if it returns false -//errorMessage is displayed to user when validation fails +/** + * Re-prompt until the answer passes validation + * @param {Question | Questions} prompt + * @param {(response: any) => boolean} validate takes in the return value of ux.prompt, and forces re-prompt if it returns false + * @param {string} errorMessage is displayed to user when validation fails + * @returns {string} validated response + */ export const validatedPrompt = async ( prompt: Question | Questions, validate: (response: any) => boolean, @@ -23,13 +27,13 @@ export const validatedPrompt = async ( return response } -//this replicates the SDK 1.x functionality, -//where you can have a separate display name and actual value returned -//prompt should be a ListQuestion, AutoCompleteQuestion, CheckboxQuestion -//name must be unique, as it is used as a key -//having duplicate names causes undefined behaviour (probably just returns one of the matching at random) -//prompt.choices will be overwritten, so feel free to set it to anything -export const keyValPrompt: (prompt: Question, choices: { name: string; value: any;}[]) => Promise<{[x: string]: any;}> = async ( +/** + * Shows prompt(s) with choices.name as options, but returns choices.value + * @param {Question} prompt whose choices will be overwritten by this function + * @param {{ name: string; value: any;}[]} choices consists of display names offered to users, and value which is actually returned when selected + * @returns {any} the corresponding values of any choices selected + */ +export const keyValPrompt: (prompt: Question, choices: { name: string; value: any; }[]) => Promise<{ [x: string]: any; }> = async ( prompt: Question, choices: { name: string; value: any }[], ) => { From 528d03aff8e30e11257e5de108e0d2eec9f5a77f Mon Sep 17 00:00:00 2001 From: Vincent Tan Date: Thu, 23 Jan 2020 10:55:44 -0800 Subject: [PATCH 33/33] Fix typo breaking keyValPrompt Signed-off-by: Vincent Tan --- src/helpers/promptUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/promptUtils.ts b/src/helpers/promptUtils.ts index 21e5efe..faad2fd 100644 --- a/src/helpers/promptUtils.ts +++ b/src/helpers/promptUtils.ts @@ -39,8 +39,8 @@ export const keyValPrompt: (prompt: Question, choices: { name: string; value: an ) => { const { name, type } = prompt //the ListQuestion interface is not actually exported - if (!['list', 'autocomplete', 'checkbox'].includes(name)) { - throw `prompt must be one of [list, autocomplete, checkbox], but got ${name}!` + if (!['list', 'autocomplete', 'checkbox'].includes(type)) { + throw `prompt must be one of [list, autocomplete, checkbox], but got ${type}!` } let choicesArr: string[] = new Array(choices.length)