From c2a0acd6506f4cc55a57293cb4968fc0000220f8 Mon Sep 17 00:00:00 2001 From: Nicolas Froidure Date: Fri, 17 Jul 2020 16:55:33 +0200 Subject: [PATCH 1/3] feat(dev): watch mode and API types Adds a watch mode that restart and empty the require cache when needed. Also adds the API types automatically generated and updated on changes. concerns #75 #51 --- package-lock.json | 639 +++++++++--------- package.json | 2 +- packages/whook-authorization/package.json | 2 +- packages/whook-aws-lambda/package.json | 2 +- packages/whook-cli/package.json | 2 +- packages/whook-create/package.json | 2 +- .../__snapshots__/createWhook.test.ts.snap | 8 +- .../src/services/createWhook.test.ts | 12 +- packages/whook-example/bin/dev.js | 4 +- packages/whook-example/package.json | 4 +- packages/whook-example/src/dev.ts | 89 +++ .../whook-example/src/handlers/getDelay.ts | 2 +- .../src/handlers/getDiagnostic.ts | 15 +- .../src/handlers/getParameters.ts | 35 +- .../src/handlers/getTime.test.ts | 2 +- .../whook-example/src/handlers/getTime.ts | 4 +- .../whook-example/src/handlers/putEcho.ts | 33 +- packages/whook-example/src/openAPISchema.d.ts | 77 +++ .../services/__snapshots__/API.test.ts.snap | 65 +- packages/whook-gcp-functions/package.json | 2 +- packages/whook-graphql/package.json | 2 +- packages/whook-http-transaction/package.json | 2 +- packages/whook-method-override/package.json | 2 +- packages/whook-oauth2/package.json | 2 +- packages/whook/package.json | 2 +- 25 files changed, 631 insertions(+), 380 deletions(-) create mode 100644 packages/whook-example/src/dev.ts create mode 100644 packages/whook-example/src/openAPISchema.d.ts diff --git a/package-lock.json b/package-lock.json index af08782b..79f84116 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,67 +5,87 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", - "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { - "@babel/highlight": "^7.10.1" + "@babel/highlight": "^7.10.4" } }, "@babel/helper-validator-identifier": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", - "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, "@babel/highlight": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", - "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.1", + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@commitlint/execute-rule": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-8.3.4.tgz", - "integrity": "sha512-f4HigYjeIBn9f7OuNv5zh2y5vWaAhNFrfeul8CRJDy82l3Y+09lxOTGxfF3uMXKrZq4LmuK6qvvRCZ8mUrVvzQ==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-9.1.1.tgz", + "integrity": "sha512-kCncHMXfVDfmUx1NExl7T+s7udAWEOh039DFGR9R5MWoy+zm2cJsCdsbWFFuNbcPWCKor57ywdIUN2t048P6Yg==", "dev": true, "optional": true }, "@commitlint/load": { - "version": "8.3.5", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-8.3.5.tgz", - "integrity": "sha512-poF7R1CtQvIXRmVIe63FjSQmN9KDqjRtU5A6hxqXBga87yB2VUJzic85TV6PcQc+wStk52cjrMI+g0zFx+Zxrw==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-9.1.1.tgz", + "integrity": "sha512-RCIX44M8nq3bW98vuxA6C2rM0wAnZlneFls2OVi5l2BvD/rsQ2R9CZYwPt/MYU6RbwMmlGhkuHdScwK6pJeUqA==", "dev": true, "optional": true, "requires": { - "@commitlint/execute-rule": "^8.3.4", - "@commitlint/resolve-extends": "^8.3.5", - "babel-runtime": "^6.23.0", - "chalk": "2.4.2", - "cosmiconfig": "^5.2.0", - "lodash": "4.17.15", + "@commitlint/execute-rule": "^9.1.1", + "@commitlint/resolve-extends": "^9.1.1", + "@commitlint/types": "^9.1.1", + "chalk": "4.1.0", + "cosmiconfig": "^6.0.0", + "lodash": "^4.17.15", "resolve-from": "^5.0.0" + }, + "dependencies": { + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, "@commitlint/resolve-extends": { - "version": "8.3.5", - "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-8.3.5.tgz", - "integrity": "sha512-nHhFAK29qiXNe6oH6uG5wqBnCR+BQnxlBW/q5fjtxIaQALgfoNLHwLS9exzbIRFqwJckpR6yMCfgMbmbAOtklQ==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-9.1.1.tgz", + "integrity": "sha512-IxxNaSUT+dPhSCQPAMpQyHQlcSVikDxQWJFP6uwGJUU5rQff+0yQTuC3taWI2NWaATukjNWboAbH2vgBDnrDrg==", "dev": true, "optional": true, "requires": { "import-fresh": "^3.0.0", - "lodash": "4.17.15", + "lodash": "^4.17.15", "resolve-from": "^5.0.0", "resolve-global": "^1.0.0" } }, + "@commitlint/types": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-9.1.1.tgz", + "integrity": "sha512-SXY8bCQ1qacJ8AUTUxjabY8G6OjSmMPLN9MBCzGaKOjpPNX6z8zbXTbk9oU3GHZLtcxweWLCi2n49IRS4iQlwg==", + "dev": true, + "optional": true + }, "@evocateur/libnpmaccess": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz", @@ -881,6 +901,16 @@ "type-fest": "^0.3.0" } }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -955,6 +985,18 @@ "write-json-file": "^3.2.0" }, "dependencies": { + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", @@ -964,6 +1006,24 @@ "is-obj": "^1.0.0" } }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, "load-json-file": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", @@ -977,6 +1037,16 @@ "type-fest": "^0.3.0" } }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -1230,6 +1300,16 @@ "type-fest": "^0.3.0" } }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -1286,39 +1366,27 @@ } }, "@octokit/endpoint": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.3.tgz", - "integrity": "sha512-Y900+r0gIz+cWp6ytnkibbD95ucEzDSKzlEnaWS52hbCDNcCJYO5mRmWW7HRAnDc7am+N/5Lnd8MppSaTYx1Yg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.4.tgz", + "integrity": "sha512-ZJHIsvsClEE+6LaZXskDvWIqD3Ao7+2gc66pRG5Ov4MQtMvCU9wGu1TItw9aGNmRuU9x3Fei1yb+uqGaQnm0nw==", "dev": true, "requires": { "@octokit/types": "^5.0.0", "is-plain-object": "^3.0.0", - "universal-user-agent": "^5.0.0" + "universal-user-agent": "^6.0.0" }, "dependencies": { "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz", + "integrity": "sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==", "dev": true }, "universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "dev": true, - "requires": { - "os-name": "^3.1.0" - } + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true } } }, @@ -1376,9 +1444,9 @@ } }, "@octokit/request": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.5.tgz", - "integrity": "sha512-atAs5GAGbZedvJXXdjtKljin+e2SltEs48B3naJjqWupYl2IUBbB/CJisyjbNHcKpHzb3E+OYEZ46G8eakXgQg==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.6.tgz", + "integrity": "sha512-9r8Sn4CvqFI9LDLHl9P17EZHwj3ehwQnTpTE+LEneb0VBBqSiI/VS4rWIBfBhDrDs/aIGEGZRSB0QWAck8u+2g==", "dev": true, "requires": { "@octokit/endpoint": "^6.0.1", @@ -1388,54 +1456,31 @@ "is-plain-object": "^3.0.0", "node-fetch": "^2.3.0", "once": "^1.4.0", - "universal-user-agent": "^5.0.0" + "universal-user-agent": "^6.0.0" }, "dependencies": { "@octokit/request-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.1.tgz", - "integrity": "sha512-5lqBDJ9/TOehK82VvomQ6zFiZjPeSom8fLkFVLuYL3sKiIb5RB8iN/lenLkY7oBmyQcGP7FBMGiIZTO8jufaRQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz", + "integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==", "dev": true, "requires": { - "@octokit/types": "^4.0.1", + "@octokit/types": "^5.0.1", "deprecation": "^2.0.0", "once": "^1.4.0" - }, - "dependencies": { - "@octokit/types": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-4.1.10.tgz", - "integrity": "sha512-/wbFy1cUIE5eICcg0wTKGXMlKSbaAxEr00qaBXzscLXpqhcwgXeS6P8O0pkysBhRfyjkKjJaYrvR1ExMO5eOXQ==", - "dev": true, - "requires": { - "@types/node": ">= 8" - } - } } }, "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz", + "integrity": "sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==", "dev": true }, "universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "dev": true, - "requires": { - "os-name": "^3.1.0" - } + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true } } }, @@ -1462,9 +1507,9 @@ } }, "@octokit/rest": { - "version": "16.43.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz", - "integrity": "sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==", + "version": "16.43.2", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz", + "integrity": "sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==", "dev": true, "requires": { "@octokit/auth-token": "^2.4.0", @@ -1486,9 +1531,9 @@ } }, "@octokit/types": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.0.0.tgz", - "integrity": "sha512-3LVS+MbeqwSd5G4KS8123cZz+hWomsiGeMnQ/QJIBFDwL/YHX8kkr0FZXrgWEMO7Fgi2/VOrhbiFnk9sZ+s4qA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.1.0.tgz", + "integrity": "sha512-OFxUBgrEllAbdEmWp/wNmKIu5EuumKHG4sgy56vjZ8lXPgMhF05c76hmulfOdFHHYRpPj49ygOZJ8wgVsPecuA==", "dev": true, "requires": { "@types/node": ">= 8" @@ -1501,9 +1546,9 @@ "dev": true }, "@types/glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-VgNIkxK+j7Nz5P7jvUZlRvhuPSmsEfS03b0alKcq5V/STUKAa3Plemsn5mrQUO7am6OErJ4rhGEGJbACclrtRA==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", "dev": true, "requires": { "@types/minimatch": "*", @@ -1523,9 +1568,9 @@ "dev": true }, "@types/node": { - "version": "14.0.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz", - "integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA==", + "version": "14.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.23.tgz", + "integrity": "sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==", "dev": true }, "@types/normalize-package-data": { @@ -1534,6 +1579,13 @@ "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", "dev": true }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true, + "optional": true + }, "@zkochan/cmd-shim": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", @@ -1586,9 +1638,9 @@ } }, "ajv": { - "version": "6.12.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", - "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "version": "6.12.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", + "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -1610,12 +1662,13 @@ "dev": true }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, "any-promise": { @@ -1801,17 +1854,6 @@ "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", "dev": true }, - "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=", - "dev": true, - "optional": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -2094,6 +2136,47 @@ "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "chardet": { @@ -2210,18 +2293,18 @@ } }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "columnify": { @@ -2261,11 +2344,10 @@ } }, "commander": { - "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 + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true }, "commitizen": { "version": "4.1.2", @@ -2726,13 +2808,6 @@ "is-error": "^2.2.0" } }, - "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==", - "dev": true, - "optional": true - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -2740,33 +2815,17 @@ "dev": true }, "cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", "dev": true, + "optional": true, "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" - }, - "dependencies": { - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", - "dev": true, - "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" } }, "coveralls": { @@ -3124,12 +3183,23 @@ "dev": true }, "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", "dev": true, "requires": { - "iconv-lite": "~0.4.13" + "iconv-lite": "^0.6.2" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } } }, "end-of-stream": { @@ -3169,22 +3239,22 @@ } }, "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", "object-inspect": "^1.7.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" } }, "es-to-primitive": { @@ -3862,6 +3932,17 @@ "pinkie-promise": "^2.0.0" } }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", @@ -4325,9 +4406,9 @@ } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "has-symbols": { @@ -5173,9 +5254,9 @@ } }, "macos-release": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", - "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.0.tgz", + "integrity": "sha512-ko6deozZYiAkqa/0gmcsz+p4jSy3gY7/ZsCEokPaYd8k+6/aXGkiTgr61+Owup7Sf+xjqW8u2ElhoM9SEcEfuA==", "dev": true }, "make-dir": { @@ -5256,18 +5337,6 @@ "yargs-parser": "^18.1.3" }, "dependencies": { - "parse-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", - "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" - } - }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -5341,16 +5410,6 @@ "yerror": "^5.0.0" }, "dependencies": { - "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==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -5361,27 +5420,6 @@ "supports-color": "^7.1.0" } }, - "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==", - "dev": true, - "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==", - "dev": true - }, - "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", - "dev": true - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -5405,12 +5443,6 @@ "path-is-absolute": "^1.0.0" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -5446,15 +5478,6 @@ "requires": { "is-plain-obj": "^2.0.0" } - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, @@ -5769,9 +5792,9 @@ } }, "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, "nice-try": { @@ -6020,9 +6043,9 @@ } }, "object-inspect": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", - "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", "dev": true }, "object-keys": { @@ -6262,13 +6285,15 @@ "dev": true }, "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", "dev": true, "requires": { + "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" } }, "parse-passwd": { @@ -6336,15 +6361,11 @@ "dev": true }, "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } + "optional": true }, "performance-now": { "version": "2.1.0", @@ -6604,6 +6625,16 @@ "strip-bom": "^3.0.0" } }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, "path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", @@ -6730,13 +6761,6 @@ "strip-indent": "^3.0.0" } }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true, - "optional": true - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -6914,9 +6938,9 @@ } }, "rxjs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", - "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.0.tgz", + "integrity": "sha512-3HMA8z/Oz61DUHe+SdOiQyzIf4tOx5oQHmMir7IZEu6TMqCLHT4LRcmNaUS0NwOz8VLvmmBduMsoaUvMaIiqzg==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -7410,28 +7434,6 @@ "es-abstract": "^1.17.5" } }, - "string.prototype.trimleft": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", - "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimstart": "^1.0.0" - } - }, - "string.prototype.trimright": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", - "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimend": "^1.0.0" - } - }, "string.prototype.trimstart": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", @@ -7507,12 +7509,12 @@ } }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, "tar": { @@ -7581,9 +7583,9 @@ "dev": true }, "thenify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", - "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, "requires": { "any-promise": "^1.0.0" @@ -7605,11 +7607,12 @@ "dev": true }, "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "dev": true, "requires": { + "inherits": "^2.0.4", "readable-stream": "2 || 3" } }, @@ -7729,14 +7732,11 @@ "dev": true }, "uglify-js": { - "version": "3.9.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", - "integrity": "sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", + "integrity": "sha512-Esj5HG5WAyrLIdYU74Z3JdG2PxdIusvj6IWHMtlyESxc7kcDz7zYlYjpnSokn1UbpV0d/QX9fan7gkCNd/9BQA==", "dev": true, - "optional": true, - "requires": { - "commander": "~2.20.3" - } + "optional": true }, "uid-number": { "version": "0.0.6", @@ -7995,6 +7995,30 @@ "strip-ansi": "^5.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -8125,6 +8149,13 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true, + "optional": true + }, "yargs": { "version": "14.2.3", "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", diff --git a/package.json b/package.json index fec823e8..85b96319 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "lerna": "lerna", "lint": "lerna run lint", "metapak": "metapak", - "postinstall": "lerna bootstrap --hoist && npm run compile && lerna link", + "postinstall": "lerna bootstrap --hoist && npm run compile && lerna link && npm run lerna -- run types", "postmetapak": "lerna run metapak", "precz": "npm t && npm run lint && npm run compile && npm run lerna -- run types && npm run metapak -- -s", "prettier": "prettier --write 'src/**/*.js'", diff --git a/packages/whook-authorization/package.json b/packages/whook-authorization/package.json index b970f2bc..02e16be9 100644 --- a/packages/whook-authorization/package.json +++ b/packages/whook-authorization/package.json @@ -55,7 +55,7 @@ "homepage": "https://github.com/nfroidure/whook", "dependencies": { "@whook/whook": "^4.0.4", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "http-auth-utils": "^2.5.0", "knifecycle": "^9.1.1" }, diff --git a/packages/whook-aws-lambda/package.json b/packages/whook-aws-lambda/package.json index 51bb4d6f..07e0c134 100644 --- a/packages/whook-aws-lambda/package.json +++ b/packages/whook-aws-lambda/package.json @@ -55,7 +55,7 @@ "ajv": "^6.12.2", "bytes": "^3.1.0", "camelcase": "^6.0.0", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "cpr": "3.0.1", "knifecycle": "^9.1.1", "memfs": "3.2.0", diff --git a/packages/whook-cli/package.json b/packages/whook-cli/package.json index 7a471e19..a6d7eb58 100644 --- a/packages/whook-cli/package.json +++ b/packages/whook-cli/package.json @@ -81,7 +81,7 @@ "@whook/whook": "^4.0.4", "ajv": "^6.12.2", "camelcase": "^6.0.0", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "fs-extra": "^9.0.0", "inquirer": "^7.1.0", "knifecycle": "^9.1.1", diff --git a/packages/whook-create/package.json b/packages/whook-create/package.json index b552a503..f794c420 100644 --- a/packages/whook-create/package.json +++ b/packages/whook-create/package.json @@ -76,7 +76,7 @@ "@whook/cli": "^4.0.4", "@whook/example": "^4.0.4", "axios": "^0.19.2", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "debug": "^4.1.1", "fs-extra": "^9.0.0", "inquirer": "^7.1.0", diff --git a/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap b/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap index 107d4ad6..955453c2 100644 --- a/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap +++ b/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap @@ -66,7 +66,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.4\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -191,7 +191,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.4\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -388,7 +388,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.4\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -572,7 +572,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.4\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", diff --git a/packages/whook-create/src/services/createWhook.test.ts b/packages/whook-create/src/services/createWhook.test.ts index 9ca63c67..13b00086 100644 --- a/packages/whook-create/src/services/createWhook.test.ts +++ b/packages/whook-create/src/services/createWhook.test.ts @@ -189,7 +189,7 @@ Mr Bean "@whook/http-transaction": "", "@whook/swagger-ui": "", "@whook/whook": "", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "http-auth-utils": "^2.5.0", "jwt-service": "^5.0.0", "knifecycle": "^9.1.1", @@ -215,6 +215,8 @@ Mr Bean "axios": "^0.19.2", "babel-eslint": "^10.1.0", "babel-plugin-knifecycle": "^1.2.0", + "chokidar": "^3.4.1", + "dtsgenerator": "^3.1.1", "eslint": "^7.0.0", "eslint-plugin-prettier": "^3.1.3", "jest": "^26.0.1", @@ -449,7 +451,7 @@ Mr Bean "@whook/http-transaction": "", "@whook/swagger-ui": "", "@whook/whook": "", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "http-auth-utils": "^2.5.0", "jwt-service": "^5.0.0", "knifecycle": "^9.1.1", @@ -475,6 +477,8 @@ Mr Bean "axios": "^0.19.2", "babel-eslint": "^10.1.0", "babel-plugin-knifecycle": "^1.2.0", + "chokidar": "^3.4.1", + "dtsgenerator": "^3.1.1", "eslint": "^7.0.0", "eslint-plugin-prettier": "^3.1.3", "jest": "^26.0.1", @@ -694,7 +698,7 @@ Mr Bean "@whook/http-transaction": "", "@whook/swagger-ui": "", "@whook/whook": "", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "http-auth-utils": "^2.5.0", "jwt-service": "^5.0.0", "knifecycle": "^9.1.1", @@ -720,6 +724,8 @@ Mr Bean "axios": "^0.19.2", "babel-eslint": "^10.1.0", "babel-plugin-knifecycle": "^1.2.0", + "chokidar": "^3.4.1", + "dtsgenerator": "^3.1.1", "eslint": "^7.0.0", "eslint-plugin-prettier": "^3.1.3", "jest": "^26.0.1", diff --git a/packages/whook-example/bin/dev.js b/packages/whook-example/bin/dev.js index d64b2a6b..9756618e 100644 --- a/packages/whook-example/bin/dev.js +++ b/packages/whook-example/bin/dev.js @@ -1,3 +1,3 @@ -import { runServer } from '../src/index'; +import { watchDevServer } from '../src/dev'; -runServer(); +watchDevServer(); diff --git a/packages/whook-example/package.json b/packages/whook-example/package.json index 9074b664..baf350c8 100644 --- a/packages/whook-example/package.json +++ b/packages/whook-example/package.json @@ -82,7 +82,7 @@ "@whook/http-transaction": "^4.0.4", "@whook/swagger-ui": "^4.0.4", "@whook/whook": "^4.0.4", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "http-auth-utils": "^2.5.0", "jwt-service": "^5.0.0", "knifecycle": "^9.1.1", @@ -107,6 +107,8 @@ "axios": "^0.19.2", "babel-eslint": "^10.1.0", "babel-plugin-knifecycle": "^1.2.0", + "chokidar": "^3.4.1", + "dtsgenerator": "^3.1.1", "eslint": "^7.0.0", "eslint-plugin-prettier": "^3.1.3", "jest": "^26.0.1", diff --git a/packages/whook-example/src/dev.ts b/packages/whook-example/src/dev.ts new file mode 100644 index 00000000..fd856aed --- /dev/null +++ b/packages/whook-example/src/dev.ts @@ -0,0 +1,89 @@ +import chokidar from 'chokidar'; +import dtsgenerator, { parseSchema } from 'dtsgenerator'; +import path from 'path'; +import crypto from 'crypto'; +import { writeFileSync } from 'fs'; +import type { Schema } from 'dtsgenerator'; +import type { Knifecycle } from 'knifecycle'; +import type { DelayService } from 'common-services'; + +let $instance: Knifecycle; +let delay: DelayService; +let delayPromise: Promise; +let hash: string; + +export async function watchDevServer() { + await restartDevServer(); + chokidar + .watch(['**/*.ts', 'package*.json', ''], { + ignored: ['node_modules', 'coverage', '*.d.ts'], + ignoreInitial: true, + }) + .on('all', (_event, filePath) => { + const absolutePath = path.join(process.cwd(), filePath); + + if (filePath.match(/package.*\.json/)) { + for (let key in require.cache) { + delete require.cache[key]; + } + } else { + delete require.cache[absolutePath]; + } + + if (delay) { + if (!delayPromise) { + delayPromise = delay.create(2000); + restartDevServer(); + } + } + }); +} + +export async function restartDevServer() { + if ($instance) { + console.log( + 'info', + '➡️ Changes detected : Will restart the server soon...', + ); + await delayPromise; + await $instance.destroy(); + delayPromise = undefined; + } + + const { runServer, prepareEnvironment, prepareServer } = await import('.'); + + const { + PROJECT_SRC, + $instance: _instance, + delay: _delay, + getOpenAPI, + } = await runServer(prepareEnvironment, prepareServer, [ + 'PROJECT_SRC', + '$instance', + 'delay', + 'getOpenAPI', + ]); + + $instance = _instance; + delay = _delay; + + const response = await getOpenAPI({ + authenticated: true, + mutedMethods: ['options'], + mutedParameters: [], + }); + const openAPIData = JSON.stringify(response.body); + const newHash = crypto.createHash('md5').update(openAPIData).digest('hex'); + + if (hash !== newHash) { + hash = newHash; + console.log('info', '🦄 - API Changed : Generating API types...'); + + const schema = await parseSchema(response.body); + const typesDefs = await dtsgenerator({ + contents: [schema], + }); + + writeFileSync(path.join(PROJECT_SRC, 'openAPISchema.d.ts'), typesDefs); + } +} diff --git a/packages/whook-example/src/handlers/getDelay.ts b/packages/whook-example/src/handlers/getDelay.ts index e4d7c419..02d5b331 100644 --- a/packages/whook-example/src/handlers/getDelay.ts +++ b/packages/whook-example/src/handlers/getDelay.ts @@ -46,7 +46,7 @@ async function getDelay( }: { delay: DelayService; }, - { duration }: { duration: number }, + { duration }: { duration: Components.Parameters.Duration.Duration }, ): Promise> { await delay.create(duration); return { diff --git a/packages/whook-example/src/handlers/getDiagnostic.ts b/packages/whook-example/src/handlers/getDiagnostic.ts index 578aaf59..142805a1 100644 --- a/packages/whook-example/src/handlers/getDiagnostic.ts +++ b/packages/whook-example/src/handlers/getDiagnostic.ts @@ -21,7 +21,13 @@ export const definition: WhookAPIHandlerDefinition = { 'application/json': { schema: { type: 'object', - additionalProperties: true, + required: ['transactions'], + properties: { + transactions: { + type: 'object', + additionalProperties: true, + }, + }, }, }, }, @@ -32,14 +38,11 @@ export const definition: WhookAPIHandlerDefinition = { export default autoHandler(getDiagnostic); -type Transaction = {}; -type Transactions = { [id: string]: Transaction }; - async function getDiagnostic({ TRANSACTIONS, }: { - TRANSACTIONS: Transactions; -}): Promise> { + TRANSACTIONS: Paths.GetDiagnostic.Responses.$200['transactions']; +}): Promise> { return { status: 200, body: { diff --git a/packages/whook-example/src/handlers/getParameters.ts b/packages/whook-example/src/handlers/getParameters.ts index 09dddf9c..e714c9e1 100644 --- a/packages/whook-example/src/handlers/getParameters.ts +++ b/packages/whook-example/src/handlers/getParameters.ts @@ -60,6 +60,27 @@ export const definition: WhookAPIHandlerDefinition = { responses: { 204: { description: 'Delay expired', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + aHeader: { + type: 'boolean', + }, + pathParam1: { + type: 'number', + }, + pathParam2: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + }, + }, }, }, }, @@ -72,17 +93,11 @@ async function getParameters( pathParam1, pathParam2, }: { - aHeader: boolean; - pathParam1: number; - pathParam2: string[]; + aHeader: Paths.GetParameters.Parameters.AHeader; + pathParam1: Components.Parameters.PathParam1.PathParam1; + pathParam2: Components.Parameters.PathParam2.PathParam2; }, -): Promise< - WhookResponse< - 200, - {}, - { aHeader: boolean; pathParam1: number; pathParam2: string[] } - > -> { +): Promise> { return { status: 200, body: { diff --git a/packages/whook-example/src/handlers/getTime.test.ts b/packages/whook-example/src/handlers/getTime.test.ts index d3a1db9f..27420883 100644 --- a/packages/whook-example/src/handlers/getTime.test.ts +++ b/packages/whook-example/src/handlers/getTime.test.ts @@ -18,7 +18,7 @@ describe('getTime', () => { Object { "response": Object { "body": Object { - "time": 1390694400000, + "currentDate": "2014-01-26T00:00:00.000Z", }, "status": 200, }, diff --git a/packages/whook-example/src/handlers/getTime.ts b/packages/whook-example/src/handlers/getTime.ts index 60350cfa..c34e6a6e 100644 --- a/packages/whook-example/src/handlers/getTime.ts +++ b/packages/whook-example/src/handlers/getTime.ts @@ -45,11 +45,11 @@ async function getTime({ time, }: { time: TimeService; -}): Promise> { +}): Promise> { return { status: 200, body: { - time: time(), + currentDate: new Date(time()).toISOString(), }, }; } diff --git a/packages/whook-example/src/handlers/putEcho.ts b/packages/whook-example/src/handlers/putEcho.ts index 685f62a3..39d26279 100644 --- a/packages/whook-example/src/handlers/putEcho.ts +++ b/packages/whook-example/src/handlers/putEcho.ts @@ -1,16 +1,19 @@ import { autoHandler } from 'knifecycle'; import YHTTPError from 'yhttperror'; import type { WhookAPIHandlerDefinition, WhookResponse } from '@whook/whook'; -import type { OpenAPIV3 } from 'openapi-types'; import type { LogService } from 'common-services'; +import type { WhookAPISchemaDefinition } from '@whook/whook'; -const echoSchema: OpenAPIV3.SchemaObject = { - type: 'object', - required: ['echo'], - additionalProperties: false, - properties: { - echo: { - type: 'string', +export const echoSchema: WhookAPISchemaDefinition = { + name: 'Echo', + schema: { + type: 'object', + required: ['echo'], + additionalProperties: false, + properties: { + echo: { + type: 'string', + }, }, }, }; @@ -27,7 +30,9 @@ export const definition: WhookAPIHandlerDefinition = { required: true, content: { 'application/json': { - schema: echoSchema, + schema: { + $ref: `#/components/schemas/${echoSchema.name}`, + }, example: { echo: 'Repeat this!', }, @@ -39,7 +44,9 @@ export const definition: WhookAPIHandlerDefinition = { description: 'The actual echo', content: { 'application/json': { - schema: echoSchema, + schema: { + $ref: `#/components/schemas/${echoSchema.name}`, + }, }, }, }, @@ -49,12 +56,10 @@ export const definition: WhookAPIHandlerDefinition = { export default autoHandler(putEcho); -type Echo = { echo: string }; - async function putEcho( { log }: { log: LogService }, - { body }: { body: Echo }, -): Promise> { + { body }: { body: Components.Schemas.Echo }, +): Promise> { if (body.echo.includes('Voldemort')) { throw new YHTTPError(400, 'E_MUST_NOT_BE_NAMED', body.echo); } diff --git a/packages/whook-example/src/openAPISchema.d.ts b/packages/whook-example/src/openAPISchema.d.ts new file mode 100644 index 00000000..dfb20701 --- /dev/null +++ b/packages/whook-example/src/openAPISchema.d.ts @@ -0,0 +1,77 @@ +declare namespace Components { + namespace Parameters { + namespace Duration { + export type Duration = number; + } + namespace PathParam1 { + export type PathParam1 = number; + } + namespace PathParam2 { + export type PathParam2 = string[]; + } + } + namespace Schemas { + export interface Echo { + echo: string; + } + export interface TimeSchema { + currentDate?: string; // date-time + } + } +} +declare namespace Paths { + namespace GetDelay { + namespace Responses { + export interface $204 { + } + } + } + namespace GetDiagnostic { + namespace Responses { + export interface $200 { + transactions: { + [name: string]: any; + }; + } + } + } + namespace GetOpenAPI { + namespace Responses { + export interface $200 { + } + } + } + namespace GetParameters { + export interface HeaderParameters { + aHeader?: Parameters.AHeader; + } + namespace Parameters { + export type AHeader = boolean; + } + namespace Responses { + export interface $204 { + aHeader?: boolean; + pathParam1?: number; + pathParam2?: string[]; + } + } + } + namespace GetPing { + namespace Responses { + export interface $200 { + pong?: "pong"; + } + } + } + namespace GetTime { + namespace Responses { + export type $200 = Components.Schemas.TimeSchema; + } + } + namespace PutEcho { + export type RequestBody = Components.Schemas.Echo; + namespace Responses { + export type $200 = Components.Schemas.Echo; + } + } +} diff --git a/packages/whook-example/src/services/__snapshots__/API.test.ts.snap b/packages/whook-example/src/services/__snapshots__/API.test.ts.snap index d5aa3ed0..8e640b35 100644 --- a/packages/whook-example/src/services/__snapshots__/API.test.ts.snap +++ b/packages/whook-example/src/services/__snapshots__/API.test.ts.snap @@ -101,6 +101,18 @@ Object { }, }, "schemas": Object { + "Echo": Object { + "additionalProperties": false, + "properties": Object { + "echo": Object { + "type": "string", + }, + }, + "required": Array [ + "echo", + ], + "type": "object", + }, "TimeSchema": Object { "additionalProperties": false, "properties": Object { @@ -184,7 +196,15 @@ Object { "content": Object { "application/json": Object { "schema": Object { - "additionalProperties": true, + "properties": Object { + "transactions": Object { + "additionalProperties": true, + "type": "object", + }, + }, + "required": Array [ + "transactions", + ], "type": "object", }, }, @@ -261,16 +281,7 @@ Object { "echo": "Repeat this!", }, "schema": Object { - "additionalProperties": false, - "properties": Object { - "echo": Object { - "type": "string", - }, - }, - "required": Array [ - "echo", - ], - "type": "object", + "$ref": "#/components/schemas/Echo", }, }, }, @@ -282,16 +293,7 @@ Object { "content": Object { "application/json": Object { "schema": Object { - "additionalProperties": false, - "properties": Object { - "echo": Object { - "type": "string", - }, - }, - "required": Array [ - "echo", - ], - "type": "object", + "$ref": "#/components/schemas/Echo", }, }, }, @@ -473,6 +475,27 @@ Object { ], "responses": Object { "204": Object { + "content": Object { + "application/json": Object { + "schema": Object { + "properties": Object { + "aHeader": Object { + "type": "boolean", + }, + "pathParam1": Object { + "type": "number", + }, + "pathParam2": Object { + "items": Object { + "type": "string", + }, + "type": "array", + }, + }, + "type": "object", + }, + }, + }, "description": "Delay expired", }, }, diff --git a/packages/whook-gcp-functions/package.json b/packages/whook-gcp-functions/package.json index 1095741e..f41cfde2 100644 --- a/packages/whook-gcp-functions/package.json +++ b/packages/whook-gcp-functions/package.json @@ -60,7 +60,7 @@ "@whook/whook": "^4.0.4", "ajv": "^6.12.2", "camelcase": "^6.0.0", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "cpr": "3.0.1", "knifecycle": "^9.1.1", "memfs": "3.2.0", diff --git a/packages/whook-graphql/package.json b/packages/whook-graphql/package.json index d3d66032..3fb49670 100644 --- a/packages/whook-graphql/package.json +++ b/packages/whook-graphql/package.json @@ -72,7 +72,7 @@ "@whook/whook": "^4.0.4", "apollo-server-core": "^2.14.1", "apollo-server-env": "^2.4.4", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "knifecycle": "^9.1.1", "openapi-types": "^1.3.5", "yhttperror": "^5.0.0" diff --git a/packages/whook-http-transaction/package.json b/packages/whook-http-transaction/package.json index f57410cf..def85aaa 100644 --- a/packages/whook-http-transaction/package.json +++ b/packages/whook-http-transaction/package.json @@ -55,7 +55,7 @@ }, "homepage": "https://github.com/nfroidure/whook", "dependencies": { - "common-services": "^7.1.4", + "common-services": "^7.1.5", "knifecycle": "^9.1.1", "ms": "^2.1.2", "openapi-types": "^1.3.5", diff --git a/packages/whook-method-override/package.json b/packages/whook-method-override/package.json index c40ac25d..b43ed6d8 100644 --- a/packages/whook-method-override/package.json +++ b/packages/whook-method-override/package.json @@ -55,7 +55,7 @@ "dependencies": { "@whook/http-transaction": "^4.0.4", "@whook/whook": "^4.0.4", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "knifecycle": "^9.1.1" }, "devDependencies": { diff --git a/packages/whook-oauth2/package.json b/packages/whook-oauth2/package.json index e821afbe..6936cbea 100644 --- a/packages/whook-oauth2/package.json +++ b/packages/whook-oauth2/package.json @@ -47,7 +47,7 @@ "@whook/authorization": "^4.0.4", "@whook/whook": "^4.0.4", "camelcase": "^6.0.0", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "knifecycle": "^9.1.1", "ms": "^2.1.2", "yerror": "^5.0.0" diff --git a/packages/whook/package.json b/packages/whook/package.json index c011ebbc..3252d7c6 100644 --- a/packages/whook/package.json +++ b/packages/whook/package.json @@ -103,7 +103,7 @@ "@whook/http-router": "^4.0.4", "@whook/http-server": "^4.0.4", "@whook/http-transaction": "^4.0.4", - "common-services": "^7.1.4", + "common-services": "^7.1.5", "debug": "^4.1.1", "dotenv": "^8.2.0", "internal-ip": "^6.0.0", From 16228174c687702ff132ea9a7689b29d6938aba2 Mon Sep 17 00:00:00 2001 From: Nicolas Froidure Date: Mon, 20 Jul 2020 15:27:21 +0200 Subject: [PATCH 2/3] refactor(watch): factorize the watch code into some commands Allows to generate types from commands, use `npm run watch` for the watch mode instead and adds some docs. --- .../__snapshots__/createWhook.test.ts.snap | 8 +- .../src/services/createWhook.test.ts | 6 ++ packages/whook-example/README.md | 11 ++- packages/whook-example/bin/dev.js | 4 +- packages/whook-example/bin/watch.js | 3 + packages/whook-example/package.json | 2 + .../src/__snapshots__/cli.test.ts.snap | 4 +- .../commands/generateOpenAPISchema.test.ts | 94 +++++++++++++++++++ .../src/commands/generateOpenAPISchema.ts | 66 +++++++++++++ .../src/commands/generateOpenAPITypes.test.ts | 86 +++++++++++++++++ .../src/commands/generateOpenAPITypes.ts | 53 +++++++++++ .../src/commands/printEnv.test.ts | 2 +- .../whook-example/src/{dev.ts => watch.ts} | 59 +++++++++--- packages/whook/src/index.ts | 1 - 14 files changed, 374 insertions(+), 25 deletions(-) create mode 100644 packages/whook-example/bin/watch.js create mode 100644 packages/whook-example/src/commands/generateOpenAPISchema.test.ts create mode 100644 packages/whook-example/src/commands/generateOpenAPISchema.ts create mode 100644 packages/whook-example/src/commands/generateOpenAPITypes.test.ts create mode 100644 packages/whook-example/src/commands/generateOpenAPITypes.ts rename packages/whook-example/src/{dev.ts => watch.ts} (55%) diff --git a/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap b/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap index 955453c2..f0154c13 100644 --- a/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap +++ b/packages/whook-create/src/services/__snapshots__/createWhook.test.ts.snap @@ -66,7 +66,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/watch\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -191,7 +191,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/watch\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -388,7 +388,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/watch\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", @@ -572,7 +572,7 @@ Wayne Campbell ], Array [ "/home/whoiam/projects/yolo/package.json", - "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", + "{\\"name\\":\\"super-project\\",\\"description\\":\\"A new Whook project\\",\\"version\\":\\"0.0.0\\",\\"license\\":\\"SEE LICENSE\\",\\"engines\\":{\\"node\\":\\">=10.19.0\\"},\\"main\\":\\"dist/index\\",\\"module\\":\\"dist/index.mjs\\",\\"types\\":\\"dist/index.d.ts\\",\\"private\\":true,\\"keywords\\":[\\"whook\\"],\\"author\\":{\\"name\\":\\"Wayne Campbell\\",\\"email\\":\\"wayne@warner.com\\"},\\"scripts\\":{\\"apitypes\\":\\"npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts\\",\\"build\\":\\"npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build\\",\\"compile\\":\\"rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs\\",\\"compile:cjs\\":\\"babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"compile:mjs\\":\\"babel --env-name=mjs --out-file-extension=.mjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src\\",\\"cover\\":\\"npm run jest -- --coverage\\",\\"debug\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} babel-node --extensions '.ts,.js' --inspect bin/dev\\",\\"dev\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/dev\\",\\"jest\\":\\"NODE_ENV=test jest\\",\\"lint\\":\\"eslint 'src/**/*.ts'\\",\\"prettier\\":\\"prettier --write 'src/**/*.ts'\\",\\"start\\":\\"NODE_ENV=\${NODE_ENV:-development} node bin/start\\",\\"test\\":\\"npm run jest\\",\\"types\\":\\"rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist\\",\\"watch\\":\\"NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/watch\\",\\"whook\\":\\"NODE_ENV=\${NODE_ENV:-development} whook\\",\\"whook-dev\\":\\"PROJECT_SRC=\\\\\\"$PWD/src\\\\\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js\\"},\\"files\\":[\\"bin\\",\\"dist\\",\\"src\\",\\"LICENSE\\",\\"README.md\\",\\"CHANGELOG.md\\"],\\"dependencies\\":{\\"@whook/authorization\\":\\"\\",\\"@whook/cli\\":\\"\\",\\"@whook/cors\\":\\"\\",\\"@whook/http-router\\":\\"\\",\\"@whook/http-transaction\\":\\"\\",\\"@whook/swagger-ui\\":\\"\\",\\"@whook/whook\\":\\"\\",\\"common-services\\":\\"^7.1.5\\",\\"http-auth-utils\\":\\"^2.5.0\\",\\"jwt-service\\":\\"^5.0.0\\",\\"knifecycle\\":\\"^9.1.1\\",\\"strict-qs\\":\\"^6.1.2\\",\\"yerror\\":\\"^5.0.0\\",\\"yhttperror\\":\\"^5.0.0\\"},\\"devDependencies\\":{\\"@babel/cli\\":\\"^7.8.4\\",\\"@babel/core\\":\\"^7.9.6\\",\\"@babel/node\\":\\"^7.2.2\\",\\"@babel/plugin-proposal-class-properties\\":\\"^7.8.3\\",\\"@babel/plugin-proposal-object-rest-spread\\":\\"^7.9.6\\",\\"@babel/plugin-syntax-dynamic-import\\":\\"^7.8.3\\",\\"@babel/plugin-syntax-import-meta\\":\\"^7.8.3\\",\\"@babel/preset-env\\":\\"^7.9.6\\",\\"@babel/preset-typescript\\":\\"^7.9.0\\",\\"@babel/register\\":\\"^7.9.0\\",\\"@types/jest\\":\\"^25.2.2\\",\\"@typescript-eslint/eslint-plugin\\":\\"^2.33.0\\",\\"@typescript-eslint/parser\\":\\"^2.33.0\\",\\"axios\\":\\"^0.19.2\\",\\"babel-eslint\\":\\"^10.1.0\\",\\"babel-plugin-knifecycle\\":\\"^1.2.0\\",\\"chokidar\\":\\"^3.4.1\\",\\"dtsgenerator\\":\\"^3.1.1\\",\\"eslint\\":\\"^7.0.0\\",\\"eslint-plugin-prettier\\":\\"^3.1.3\\",\\"jest\\":\\"^26.0.1\\",\\"openapi-schema-validator\\":\\"^3.0.3\\",\\"prettier\\":\\"^2.0.5\\",\\"rimraf\\":\\"^3.0.2\\",\\"typescript\\":\\"^3.9.2\\"},\\"eslintConfig\\":{\\"extends\\":\\"eslint:recommended\\",\\"parserOptions\\":{\\"ecmaVersion\\":2018,\\"sourceType\\":\\"module\\",\\"modules\\":true},\\"env\\":{\\"es6\\":true,\\"node\\":true,\\"jest\\":true,\\"mocha\\":true},\\"plugins\\":[\\"prettier\\"],\\"rules\\":{\\"prettier/prettier\\":\\"error\\"},\\"parser\\":\\"@typescript-eslint/parser\\",\\"ignorePatterns\\":[\\"*.d.ts\\"],\\"overrides\\":[{\\"files\\":[\\"*.ts\\"],\\"rules\\":{\\"no-unused-vars\\":[1,{\\"args\\":\\"none\\"}]}}]},\\"prettier\\":{\\"semi\\":true,\\"printWidth\\":80,\\"singleQuote\\":true,\\"trailingComma\\":\\"all\\",\\"proseWrap\\":\\"always\\"},\\"babel\\":{\\"presets\\":[\\"@babel/typescript\\",[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10.19.0\\"}}]],\\"plugins\\":[\\"@babel/proposal-class-properties\\",\\"@babel/plugin-proposal-object-rest-spread\\",\\"babel-plugin-knifecycle\\"],\\"env\\":{\\"cjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"10\\"},\\"modules\\":\\"commonjs\\"}]]},\\"mjs\\":{\\"presets\\":[[\\"@babel/env\\",{\\"targets\\":{\\"node\\":\\"12\\"},\\"modules\\":false}]]}},\\"sourceMaps\\":true},\\"jest\\":{\\"coverageReporters\\":[\\"lcov\\",\\"html\\"],\\"testPathIgnorePatterns\\":[\\"/node_modules/\\"],\\"roots\\":[\\"/src\\"],\\"testEnvironment\\":\\"node\\"}}", ], Array [ "/home/whoiam/projects/yolo/LICENSE", diff --git a/packages/whook-create/src/services/createWhook.test.ts b/packages/whook-create/src/services/createWhook.test.ts index 13b00086..612811a2 100644 --- a/packages/whook-create/src/services/createWhook.test.ts +++ b/packages/whook-create/src/services/createWhook.test.ts @@ -304,6 +304,7 @@ Mr Bean }, "private": true, "scripts": Object { + "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts", "build": "npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build", "compile": "rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs", "compile:cjs": "babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src", @@ -317,6 +318,7 @@ Mr Bean "start": "NODE_ENV=\${NODE_ENV:-development} node bin/start", "test": "npm run jest", "types": "rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist", + "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/watch", "whook": "NODE_ENV=\${NODE_ENV:-development} whook", "whook-dev": "PROJECT_SRC=\\"$PWD/src\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js", }, @@ -566,6 +568,7 @@ Mr Bean }, "private": true, "scripts": Object { + "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts", "build": "npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build", "compile": "rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs", "compile:cjs": "babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src", @@ -579,6 +582,7 @@ Mr Bean "start": "NODE_ENV=\${NODE_ENV:-development} node bin/start", "test": "npm run jest", "types": "rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist", + "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/watch", "whook": "NODE_ENV=\${NODE_ENV:-development} whook", "whook-dev": "PROJECT_SRC=\\"$PWD/src\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js", }, @@ -813,6 +817,7 @@ Mr Bean }, "private": true, "scripts": Object { + "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts", "build": "npm run compile && NODE_ENV=\${NODE_ENV:-development} node bin/build", "compile": "rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs", "compile:cjs": "babel --env-name=cjs --out-dir=dist --extensions '.ts,.js' --source-maps=true src", @@ -826,6 +831,7 @@ Mr Bean "start": "NODE_ENV=\${NODE_ENV:-development} node bin/start", "test": "npm run jest", "types": "rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist", + "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/watch", "whook": "NODE_ENV=\${NODE_ENV:-development} whook", "whook-dev": "PROJECT_SRC=\\"$PWD/src\\" NODE_ENV=\${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js", }, diff --git a/packages/whook-example/README.md b/packages/whook-example/README.md index dca4e184..263eb170 100644 --- a/packages/whook-example/README.md +++ b/packages/whook-example/README.md @@ -26,9 +26,13 @@ NODE_ENV=production npm start ## Dev -Start the server in development mode: +Start the server in development: ```sh +# Simple dev mode npm run dev + +# Watch mode +npm run watch ``` Create a new endpoint / service / provider or command: @@ -41,6 +45,11 @@ List available commands: npx whook ls ``` +Generate API types: +```sh +npm run apitypes +``` + ## Debug Execute a handler in isolation: ```sh diff --git a/packages/whook-example/bin/dev.js b/packages/whook-example/bin/dev.js index 9756618e..d2b0f5a6 100644 --- a/packages/whook-example/bin/dev.js +++ b/packages/whook-example/bin/dev.js @@ -1,3 +1,3 @@ -import { watchDevServer } from '../src/dev'; +const { runServer } = require('../src/index'); -watchDevServer(); +runServer(); diff --git a/packages/whook-example/bin/watch.js b/packages/whook-example/bin/watch.js new file mode 100644 index 00000000..102ab8ab --- /dev/null +++ b/packages/whook-example/bin/watch.js @@ -0,0 +1,3 @@ +import { watchDevServer } from '../src/watch'; + +watchDevServer(); diff --git a/packages/whook-example/package.json b/packages/whook-example/package.json index baf350c8..fbe724f2 100644 --- a/packages/whook-example/package.json +++ b/packages/whook-example/package.json @@ -42,6 +42,7 @@ } }, "scripts": { + "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts", "build": "npm run compile && NODE_ENV=${NODE_ENV:-development} node bin/build", "cli": "env NODE_ENV=${NODE_ENV:-cli}", "compile": "rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs", @@ -57,6 +58,7 @@ "start": "NODE_ENV=${NODE_ENV:-development} node bin/start", "test": "npm run jest", "types": "rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist", + "watch": "NODE_ENV=${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 babel-node --extensions '.ts,.js' bin/watch", "whook": "NODE_ENV=${NODE_ENV:-development} whook", "whook-dev": "PROJECT_SRC=\"$PWD/src\" NODE_ENV=${NODE_ENV:-development} babel-node --extensions '.ts,.js' -- node_modules/@whook/cli/bin/whook.js" }, diff --git a/packages/whook-example/src/__snapshots__/cli.test.ts.snap b/packages/whook-example/src/__snapshots__/cli.test.ts.snap index 8808f1a4..770083e4 100644 --- a/packages/whook-example/src/__snapshots__/cli.test.ts.snap +++ b/packages/whook-example/src/__snapshots__/cli.test.ts.snap @@ -25,7 +25,9 @@ Object { ", "stdout": " -# Provided by \\"@whook/example\\": 1 commands +# Provided by \\"@whook/example\\": 3 commands +- generateOpenAPISchema: Write openAPI schema to stdout +- generateOpenAPITypes: Write openAPI types to stdout - printEnv: A command printing every env values diff --git a/packages/whook-example/src/commands/generateOpenAPISchema.test.ts b/packages/whook-example/src/commands/generateOpenAPISchema.test.ts new file mode 100644 index 00000000..6b59165d --- /dev/null +++ b/packages/whook-example/src/commands/generateOpenAPISchema.test.ts @@ -0,0 +1,94 @@ +import initGenerateOpenAPISchema from './generateOpenAPISchema'; +import { PassThrough } from 'stream'; +import type { WhookCommandArgs } from '@whook/cli'; + +describe('generateOpenAPISchema', () => { + const getOpenAPI = jest.fn(); + const log = jest.fn(); + + beforeEach(() => { + getOpenAPI.mockReset(); + log.mockReset(); + }); + + it('should work', async () => { + getOpenAPI.mockResolvedValueOnce({ + status: 200, + body: { + openapi: '3.0.2', + info: { + version: '0.0.0', + title: 'api', + description: 'The API', + }, + }, + }); + + const outstream = new PassThrough(); + const outputPromise = new Promise((resolve, reject) => { + let buffer = Buffer.from(''); + outstream.on('data', (aBuffer) => { + buffer = Buffer.concat([buffer, aBuffer]); + }); + outstream.once('error', () => reject); + outstream.once('end', () => resolve(buffer.toString())); + }); + const generateOpenAPISchema = await initGenerateOpenAPISchema({ + log, + getOpenAPI, + outstream, + args: (Object.assign( + { + pretty: true, + }, + { + _: ['generateOpenAPISchema'], + }, + ) as unknown) as WhookCommandArgs, + }); + const result = await generateOpenAPISchema(); + + expect({ + result, + output: await outputPromise, + getOpenAPICalls: getOpenAPI.mock.calls, + logCalls: log.mock.calls.filter(([type]) => !type.endsWith('stack')), + }).toMatchInlineSnapshot( + {}, + ` + Object { + "getOpenAPICalls": Array [ + Array [ + Object { + "authenticated": true, + "mutedMethods": Array [ + "options", + ], + "mutedParameters": Array [], + }, + ], + ], + "logCalls": Array [ + Array [ + "warning", + "📥 - Retrieving schema...", + ], + Array [ + "warning", + "📇 - Writing Open API schema...", + ], + ], + "output": "{ + \\"openapi\\": \\"3.0.2\\", + \\"info\\": { + \\"version\\": \\"0.0.0\\", + \\"title\\": \\"api\\", + \\"description\\": \\"The API\\" + } + }", + "result": undefined, + } + `, + ); + }); +}); diff --git a/packages/whook-example/src/commands/generateOpenAPISchema.ts b/packages/whook-example/src/commands/generateOpenAPISchema.ts new file mode 100644 index 00000000..c065e289 --- /dev/null +++ b/packages/whook-example/src/commands/generateOpenAPISchema.ts @@ -0,0 +1,66 @@ +import { initGetOpenAPI } from '@whook/swagger-ui'; +import { readArgs } from '@whook/cli'; +import { autoService, extra } from 'knifecycle'; +import type { LogService } from 'common-services'; +import type { PromiseValue } from 'type-fest'; +import type { WhookCommandDefinition, WhookCommandArgs } from '@whook/cli'; + +export const definition: WhookCommandDefinition = { + description: 'Write openAPI schema to stdout', + example: `whook generateOpenAPISchema`, + arguments: { + type: 'object', + additionalProperties: false, + required: [], + properties: { + pretty: { + description: 'Option to prettify output', + type: 'boolean', + default: true, + }, + authenticated: { + description: 'Option to get the private routes too', + type: 'boolean', + default: true, + }, + }, + }, +}; + +export default extra(definition, autoService(initGenerateOpenAPISchema)); + +async function initGenerateOpenAPISchema({ + getOpenAPI, + outstream = process.stdout, + args, + log, +}: { + getOpenAPI: PromiseValue>; + outstream: NodeJS.WritableStream; + args: WhookCommandArgs; + log: LogService; +}): Promise<() => Promise> { + return async function generateOpenAPISchema() { + const { pretty, authenticated } = readArgs(definition.arguments, args) as { + pretty: boolean; + authenticated: boolean; + }; + + log('warning', '📥 - Retrieving schema...'); + const response = await getOpenAPI({ + authenticated, + mutedMethods: ['options'], + mutedParameters: [], + }); + log('warning', '📇 - Writing Open API schema...'); + + await new Promise((resolve, reject) => { + outstream.once('finish', resolve); + outstream.once('error', reject); + outstream.write( + JSON.stringify(response.body, null, pretty ? 2 : undefined), + ); + outstream.end(); + }); + }; +} diff --git a/packages/whook-example/src/commands/generateOpenAPITypes.test.ts b/packages/whook-example/src/commands/generateOpenAPITypes.test.ts new file mode 100644 index 00000000..4786472d --- /dev/null +++ b/packages/whook-example/src/commands/generateOpenAPITypes.test.ts @@ -0,0 +1,86 @@ +import initGenerateOpenAPITypes from './generateOpenAPITypes'; +import { PassThrough } from 'stream'; +import { initGetPingDefinition } from '@whook/whook'; +import type { WhookCommandArgs } from '@whook/cli'; +import type { OpenAPIV3 } from 'openapi-types'; + +describe('generateOpenAPITypes', () => { + const getOpenAPI = jest.fn(); + const log = jest.fn(); + const API: OpenAPIV3.Document = { + openapi: '3.0.2', + info: { + version: '1.0.0', + title: 'Sample OpenAPI', + description: 'A sample OpenAPI file for testing purpose.', + }, + paths: { + [initGetPingDefinition.path]: { + [initGetPingDefinition.method]: initGetPingDefinition.operation, + }, + }, + }; + + beforeEach(() => { + getOpenAPI.mockReset(); + log.mockReset(); + }); + + it('should work', async () => { + const instream = new PassThrough(); + const outstream = new PassThrough(); + const outputPromise = new Promise((resolve, reject) => { + let buffer = Buffer.from(''); + outstream.on('data', (aBuffer) => { + buffer = Buffer.concat([buffer, aBuffer]); + }); + outstream.once('error', () => reject); + outstream.once('end', () => resolve(buffer.toString())); + }); + const generateOpenAPITypes = await initGenerateOpenAPITypes({ + instream, + outstream, + log, + }); + + const resultPromise = generateOpenAPITypes(); + + instream.write(JSON.stringify(API)); + instream.end(); + + expect({ + result: await resultPromise, + output: await outputPromise, + getOpenAPICalls: getOpenAPI.mock.calls, + logCalls: log.mock.calls.filter(([type]) => !type.endsWith('stack')), + }).toMatchInlineSnapshot( + {}, + ` + Object { + "getOpenAPICalls": Array [], + "logCalls": Array [ + Array [ + "warning", + "📥 - Retrieving API schema...", + ], + Array [ + "warning", + "📇 - Writing types...", + ], + ], + "output": "declare namespace Paths { + namespace GetPing { + namespace Responses { + export interface $200 { + pong?: \\"pong\\"; + } + } + } + } + ", + "result": undefined, + } + `, + ); + }); +}); diff --git a/packages/whook-example/src/commands/generateOpenAPITypes.ts b/packages/whook-example/src/commands/generateOpenAPITypes.ts new file mode 100644 index 00000000..613502de --- /dev/null +++ b/packages/whook-example/src/commands/generateOpenAPITypes.ts @@ -0,0 +1,53 @@ +import { autoService, extra } from 'knifecycle'; +import dtsgenerator, { parseSchema } from 'dtsgenerator'; +import type { LogService } from 'common-services'; +import type { WhookCommandDefinition, WhookCommandArgs } from '@whook/cli'; + +export const definition: WhookCommandDefinition = { + description: 'Write openAPI types to stdout', + example: `whook generateOpenAPITypes`, + arguments: { + type: 'object', + additionalProperties: false, + required: [], + properties: {}, + }, +}; + +export default extra(definition, autoService(initGenerateOpenAPITypes)); + +async function initGenerateOpenAPITypes({ + instream = process.stdin, + outstream = process.stdout, + log, +}: { + instream: NodeJS.ReadableStream; + outstream: NodeJS.WritableStream; + log: LogService; +}): Promise<() => Promise> { + return async function generateOpenAPITypes() { + log('warning', '📥 - Retrieving API schema...'); + + const openAPI: string = await new Promise((resolve, reject) => { + let buffer = Buffer.from(''); + instream.on('data', (aBuffer) => { + buffer = Buffer.concat([buffer, aBuffer]); + }); + instream.once('error', () => reject); + instream.once('end', () => resolve(buffer.toString())); + }); + + const schema = parseSchema(JSON.parse(openAPI)); + const typesDefs = await dtsgenerator({ + contents: [schema], + }); + + log('warning', '📇 - Writing types...'); + await new Promise((resolve, reject) => { + outstream.once('finish', resolve); + outstream.once('error', reject); + outstream.write(typesDefs); + outstream.end(); + }); + }; +} diff --git a/packages/whook-example/src/commands/printEnv.test.ts b/packages/whook-example/src/commands/printEnv.test.ts index 7cfd7c54..01aeebc7 100644 --- a/packages/whook-example/src/commands/printEnv.test.ts +++ b/packages/whook-example/src/commands/printEnv.test.ts @@ -19,7 +19,7 @@ describe('printEnvCommand', () => { keysOnly: true, }, { - _: ['env'], + _: ['printEnv'], }, ) as unknown) as WhookCommandArgs, }); diff --git a/packages/whook-example/src/dev.ts b/packages/whook-example/src/watch.ts similarity index 55% rename from packages/whook-example/src/dev.ts rename to packages/whook-example/src/watch.ts index fd856aed..6db63869 100644 --- a/packages/whook-example/src/dev.ts +++ b/packages/whook-example/src/watch.ts @@ -1,13 +1,14 @@ import chokidar from 'chokidar'; -import dtsgenerator, { parseSchema } from 'dtsgenerator'; import path from 'path'; import crypto from 'crypto'; -import { writeFileSync } from 'fs'; -import type { Schema } from 'dtsgenerator'; +import { PassThrough } from 'stream'; +import { createWriteStream } from 'fs'; +import initGenerateOpenAPITypes from './commands/generateOpenAPITypes'; import type { Knifecycle } from 'knifecycle'; -import type { DelayService } from 'common-services'; +import type { DelayService, LogService } from 'common-services'; let $instance: Knifecycle; +let log: LogService; let delay: DelayService; let delayPromise: Promise; let hash: string; @@ -41,10 +42,7 @@ export async function watchDevServer() { export async function restartDevServer() { if ($instance) { - console.log( - 'info', - '➡️ Changes detected : Will restart the server soon...', - ); + log('warning', '➡️ - Changes detected : Will restart the server soon...'); await delayPromise; await $instance.destroy(); delayPromise = undefined; @@ -57,15 +55,24 @@ export async function restartDevServer() { $instance: _instance, delay: _delay, getOpenAPI, - } = await runServer(prepareEnvironment, prepareServer, [ + log: _log, + } = (await runServer(prepareEnvironment, prepareServer, [ 'PROJECT_SRC', '$instance', 'delay', 'getOpenAPI', - ]); + 'log', + ])) as { + PROJECT_SRC: string; + $instance: Knifecycle; + delay: DelayService; + getOpenAPI; + log: LogService; + }; $instance = _instance; delay = _delay; + log = _log; const response = await getOpenAPI({ authenticated: true, @@ -77,13 +84,35 @@ export async function restartDevServer() { if (hash !== newHash) { hash = newHash; - console.log('info', '🦄 - API Changed : Generating API types...'); + log('warning', '🦄 - API Changed : Generating API types...'); + + const instream = new PassThrough(); + const bridge = new PassThrough(); + const openAPITypesGenerationPromise = ( + await initGenerateOpenAPITypes({ + instream, + outstream: bridge, + log, + }) + )(); - const schema = await parseSchema(response.body); - const typesDefs = await dtsgenerator({ - contents: [schema], + const writeStream = createWriteStream( + path.join(PROJECT_SRC, 'openAPISchema.d.ts'), + ); + const writeStreamCompletionPromise = new Promise((resolve, reject) => { + writeStream.once('finish', resolve); + writeStream.once('error', reject); }); - writeFileSync(path.join(PROJECT_SRC, 'openAPISchema.d.ts'), typesDefs); + bridge.pipe(writeStream); + + instream.write(openAPIData); + instream.end(); + + await Promise.all([ + openAPITypesGenerationPromise, + writeStreamCompletionPromise, + ]); + log('warning', '🦄 - API types generated!'); } } diff --git a/packages/whook/src/index.ts b/packages/whook/src/index.ts index 8f81f879..6e4f90f4 100644 --- a/packages/whook/src/index.ts +++ b/packages/whook/src/index.ts @@ -99,7 +99,6 @@ import type { APMService, } from '@whook/http-transaction'; import { noop, identity, compose, pipe } from './libs/utils'; -import type { OpenAPIV3 } from 'openapi-types'; import type { BaseURLConfig, BaseURLEnv } from './services/BASE_URL'; export type { From 86025c757e7e0538036e98128fa76b3160773dc4 Mon Sep 17 00:00:00 2001 From: Nicolas Froidure Date: Thu, 23 Jul 2020 10:39:05 +0200 Subject: [PATCH 3/3] fix(watch): fix cache invalidation for deep dependencies --- packages/whook-example/package.json | 2 +- packages/whook-example/src/watch.ts | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/whook-example/package.json b/packages/whook-example/package.json index fbe724f2..7b0fd574 100644 --- a/packages/whook-example/package.json +++ b/packages/whook-example/package.json @@ -42,7 +42,7 @@ } }, "scripts": { - "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=false | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts", + "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts", "build": "npm run compile && NODE_ENV=${NODE_ENV:-development} node bin/build", "cli": "env NODE_ENV=${NODE_ENV:-cli}", "compile": "rimraf -f 'dist' && npm run compile:cjs && npm run compile:mjs", diff --git a/packages/whook-example/src/watch.ts b/packages/whook-example/src/watch.ts index 6db63869..c27f71c1 100644 --- a/packages/whook-example/src/watch.ts +++ b/packages/whook-example/src/watch.ts @@ -25,10 +25,10 @@ export async function watchDevServer() { if (filePath.match(/package.*\.json/)) { for (let key in require.cache) { - delete require.cache[key]; + uncache(key); } } else { - delete require.cache[absolutePath]; + uncache(absolutePath, true); } if (delay) { @@ -116,3 +116,21 @@ export async function restartDevServer() { log('warning', '🦄 - API types generated!'); } } + +function uncache(key: string, recursively = false) { + const module = require.cache[key]; + + if (!module) { + return; + } + + if (!key.endsWith('.node')) { + delete require.cache[key]; + } + + if (!recursively) { + return; + } + + uncache(module.parent.id); +}