From a82c278a64d012283fe5567e0fd52942997e2e36 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 30 Mar 2023 17:48:20 -0700 Subject: [PATCH 01/37] chore: try tweaking dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 79dcb6218..65159463d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] +ENTRYPOINT ["sh", "-c", "/exe/rdme", "$INPUT_RDME"] From 31a276b0df7aad718273879d507033e9196bcad0 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 30 Mar 2023 17:49:11 -0700 Subject: [PATCH 02/37] chore: try adding quotes around filename --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bdeeef1c..d5d3935aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: - name: Run `openapi:validate` command uses: ./rdme-repo/ with: - rdme: openapi:validate oas-examples-repo/3.1/json/petstore.json + rdme: openapi:validate "oas-examples-repo/3.1/json/petstore.json" # Docs: https://rdme-test.readme.io - name: Run `openapi` command From 66747e1f599718f68492a4878bdf2f86a2376c5c Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 30 Mar 2023 18:08:32 -0700 Subject: [PATCH 03/37] Revert "chore: try tweaking dockerfile" This reverts commit a82c278a64d012283fe5567e0fd52942997e2e36. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 65159463d..79dcb6218 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme", "$INPUT_RDME"] +ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] From d02180917a5a3b8e2184828ce9c7c79995a059cf Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 30 Mar 2023 18:11:02 -0700 Subject: [PATCH 04/37] chore: try downgrading CLI usage --- package-lock.json | 371 +++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 216 insertions(+), 157 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50f95bd5b..77169fdef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "chalk": "^4.1.2", "ci-info": "^3.6.1", "command-line-args": "^5.2.0", - "command-line-usage": "^7.0.1", + "command-line-usage": "^6.1.3", "config": "^3.1.0", "configstore": "^5.0.0", "debug": "^4.3.3", @@ -78,26 +78,6 @@ "node": ">=14" } }, - "node_modules/@75lb/deep-merge": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", - "integrity": "sha512-xvgv6pkMGBA6GwdyJbNAnDmfAIR/DfWhrj9jgWh3TY7gRm3KO46x/GPjRg6wJ0nOepwqrNxFfojebh0Df4h4Tw==", - "dependencies": { - "lodash.assignwith": "^4.2.0", - "typical": "^7.1.1" - }, - "engines": { - "node": ">=12.17" - } - }, - "node_modules/@75lb/deep-merge/node_modules/typical": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", - "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", - "engines": { - "node": ">=12.17" - } - }, "node_modules/@actions/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", @@ -3038,20 +3018,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chalk-template": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", - "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", - "dependencies": { - "chalk": "^4.1.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/chalk-template?sponsor=1" - } - }, "node_modules/char-regex": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", @@ -3222,33 +3188,97 @@ } }, "node_modules/command-line-usage": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.1.tgz", - "integrity": "sha512-NCyznE//MuTjwi3y84QVUGEOT+P5oto1e1Pk/jFPVdPPfsG03qpTIl3yw6etR+v73d0lXsoojRpvbru2sqePxQ==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", "dependencies": { - "array-back": "^6.2.2", - "chalk-template": "^0.4.0", - "table-layout": "^3.0.0", - "typical": "^7.1.1" + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" }, "engines": { - "node": ">=12.20.0" + "node": ">=8.0.0" + } + }, + "node_modules/command-line-usage/node_modules/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==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, "node_modules/command-line-usage/node_modules/array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/command-line-usage/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/command-line-usage/node_modules/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==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/command-line-usage/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/command-line-usage/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/command-line-usage/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { - "node": ">=12.17" + "node": ">=4" + } + }, + "node_modules/command-line-usage/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, "node_modules/command-line-usage/node_modules/typical": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", - "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", "engines": { - "node": ">=12.17" + "node": ">=8" } }, "node_modules/comment-parser": { @@ -7111,11 +7141,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.assignwith": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", - "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==" - }, "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -8473,6 +8498,14 @@ "node": ">=8" } }, + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "engines": { + "node": ">=6" + } + }, "node_modules/reftools": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", @@ -9043,14 +9076,6 @@ "node": ">= 0.4" } }, - "node_modules/stream-read-all": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/stream-read-all/-/stream-read-all-3.0.1.tgz", - "integrity": "sha512-EWZT9XOceBPlVJRrYcykW8jyRSZYbkb/0ZK36uLEmoWVO5gxBOnntNTseNzfREsqxqdfEGQrD8SXQ3QWbBmq8A==", - "engines": { - "node": ">=10" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -9296,39 +9321,33 @@ } }, "node_modules/table-layout": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz", - "integrity": "sha512-rpyNZYRw+/C+dYkcQ3Pr+rLxW4CfHpXjPDnG7lYhdRoUcZTUt+KEsX+94RGp/aVp/MQU35JCITv2T/beY4m+hw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", "dependencies": { - "@75lb/deep-merge": "^1.1.1", - "array-back": "^6.2.2", - "command-line-args": "^5.2.1", - "command-line-usage": "^7.0.0", - "stream-read-all": "^3.0.1", - "typical": "^7.1.1", - "wordwrapjs": "^5.1.0" - }, - "bin": { - "table-layout": "bin/cli.js" + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" }, "engines": { - "node": ">=12.17" + "node": ">=8.0.0" } }, "node_modules/table-layout/node_modules/array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", "engines": { - "node": ">=12.17" + "node": ">=8" } }, "node_modules/table-layout/node_modules/typical": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", - "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", "engines": { - "node": ">=12.17" + "node": ">=8" } }, "node_modules/tapable": { @@ -10014,11 +10033,23 @@ } }, "node_modules/wordwrapjs": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz", - "integrity": "sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/wordwrapjs/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", "engines": { - "node": ">=12.17" + "node": ">=8" } }, "node_modules/wrap-ansi": { @@ -10148,22 +10179,6 @@ } }, "dependencies": { - "@75lb/deep-merge": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", - "integrity": "sha512-xvgv6pkMGBA6GwdyJbNAnDmfAIR/DfWhrj9jgWh3TY7gRm3KO46x/GPjRg6wJ0nOepwqrNxFfojebh0Df4h4Tw==", - "requires": { - "lodash.assignwith": "^4.2.0", - "typical": "^7.1.1" - }, - "dependencies": { - "typical": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", - "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==" - } - } - }, "@actions/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", @@ -12410,14 +12425,6 @@ "supports-color": "^7.1.0" } }, - "chalk-template": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", - "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", - "requires": { - "chalk": "^4.1.2" - } - }, "char-regex": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", @@ -12535,25 +12542,74 @@ } }, "command-line-usage": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.1.tgz", - "integrity": "sha512-NCyznE//MuTjwi3y84QVUGEOT+P5oto1e1Pk/jFPVdPPfsG03qpTIl3yw6etR+v73d0lXsoojRpvbru2sqePxQ==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", "requires": { - "array-back": "^6.2.2", - "chalk-template": "^0.4.0", - "table-layout": "^3.0.0", - "typical": "^7.1.1" + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.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==", + "requires": { + "color-convert": "^1.9.0" + } + }, "array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.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==", + "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": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } }, "typical": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", - "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" } } }, @@ -15395,11 +15451,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "lodash.assignwith": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", - "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==" - }, "lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -16413,6 +16464,11 @@ "strip-indent": "^3.0.0" } }, + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==" + }, "reftools": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", @@ -16838,11 +16894,6 @@ "internal-slot": "^1.0.4" } }, - "stream-read-all": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/stream-read-all/-/stream-read-all-3.0.1.tgz", - "integrity": "sha512-EWZT9XOceBPlVJRrYcykW8jyRSZYbkb/0ZK36uLEmoWVO5gxBOnntNTseNzfREsqxqdfEGQrD8SXQ3QWbBmq8A==" - }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -17022,28 +17073,25 @@ } }, "table-layout": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz", - "integrity": "sha512-rpyNZYRw+/C+dYkcQ3Pr+rLxW4CfHpXjPDnG7lYhdRoUcZTUt+KEsX+94RGp/aVp/MQU35JCITv2T/beY4m+hw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", "requires": { - "@75lb/deep-merge": "^1.1.1", - "array-back": "^6.2.2", - "command-line-args": "^5.2.1", - "command-line-usage": "^7.0.0", - "stream-read-all": "^3.0.1", - "typical": "^7.1.1", - "wordwrapjs": "^5.1.0" + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" }, "dependencies": { "array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==" }, "typical": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", - "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" } } }, @@ -17564,9 +17612,20 @@ "dev": true }, "wordwrapjs": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz", - "integrity": "sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "requires": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "dependencies": { + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" + } + } }, "wrap-ansi": { "version": "7.0.0", diff --git a/package.json b/package.json index 845790254..3f6e1c254 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "chalk": "^4.1.2", "ci-info": "^3.6.1", "command-line-args": "^5.2.0", - "command-line-usage": "^7.0.1", + "command-line-usage": "^6.1.3", "config": "^3.1.0", "configstore": "^5.0.0", "debug": "^4.3.3", From b5650d9f46777d42bccabf4c24eb0d784e9f54ec Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 31 Mar 2023 10:37:37 -0700 Subject: [PATCH 05/37] chore: try an entrypoint file approach --- Dockerfile | 6 +++--- bin/docker/entrypoint.sh | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100755 bin/docker/entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 79dcb6218..266c6337f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM node:16-alpine as builder COPY . /rdme -RUN cd /rdme && npm ci && npm run build && npx pkg@5 . --target host --out-path exe +RUN cd /rdme && npm ci && npm run build && npx pkg@5 . --target host --out-path bin/docker FROM alpine:3.14 -COPY --from=builder /rdme/exe /exe +COPY --from=builder /rdme/bin/docker /app -ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] +ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/bin/docker/entrypoint.sh b/bin/docker/entrypoint.sh new file mode 100755 index 000000000..5e48d2122 --- /dev/null +++ b/bin/docker/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -e +./rdme $INPUT_RDME From 1c4b5625665d26ce8d28ad2ab02cb18afb24a0bf Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 31 Mar 2023 13:05:23 -0700 Subject: [PATCH 06/37] revert: rebump cliUsage --- package-lock.json | 371 +++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 157 insertions(+), 216 deletions(-) diff --git a/package-lock.json b/package-lock.json index 77169fdef..50f95bd5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "chalk": "^4.1.2", "ci-info": "^3.6.1", "command-line-args": "^5.2.0", - "command-line-usage": "^6.1.3", + "command-line-usage": "^7.0.1", "config": "^3.1.0", "configstore": "^5.0.0", "debug": "^4.3.3", @@ -78,6 +78,26 @@ "node": ">=14" } }, + "node_modules/@75lb/deep-merge": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", + "integrity": "sha512-xvgv6pkMGBA6GwdyJbNAnDmfAIR/DfWhrj9jgWh3TY7gRm3KO46x/GPjRg6wJ0nOepwqrNxFfojebh0Df4h4Tw==", + "dependencies": { + "lodash.assignwith": "^4.2.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/@75lb/deep-merge/node_modules/typical": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", + "engines": { + "node": ">=12.17" + } + }, "node_modules/@actions/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", @@ -3018,6 +3038,20 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chalk-template": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", + "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", + "dependencies": { + "chalk": "^4.1.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, "node_modules/char-regex": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", @@ -3188,97 +3222,33 @@ } }, "node_modules/command-line-usage": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", - "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", - "dependencies": { - "array-back": "^4.0.2", - "chalk": "^2.4.2", - "table-layout": "^1.0.2", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/command-line-usage/node_modules/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": "7.0.1", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.1.tgz", + "integrity": "sha512-NCyznE//MuTjwi3y84QVUGEOT+P5oto1e1Pk/jFPVdPPfsG03qpTIl3yw6etR+v73d0lXsoojRpvbru2sqePxQ==", "dependencies": { - "color-convert": "^1.9.0" + "array-back": "^6.2.2", + "chalk-template": "^0.4.0", + "table-layout": "^3.0.0", + "typical": "^7.1.1" }, "engines": { - "node": ">=4" + "node": ">=12.20.0" } }, "node_modules/command-line-usage/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/command-line-usage/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/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==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/command-line-usage/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/command-line-usage/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/command-line-usage/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", "engines": { - "node": ">=4" + "node": ">=12.17" } }, "node_modules/command-line-usage/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", "engines": { - "node": ">=8" + "node": ">=12.17" } }, "node_modules/comment-parser": { @@ -7141,6 +7111,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.assignwith": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", + "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==" + }, "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -8498,14 +8473,6 @@ "node": ">=8" } }, - "node_modules/reduce-flatten": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", - "engines": { - "node": ">=6" - } - }, "node_modules/reftools": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", @@ -9076,6 +9043,14 @@ "node": ">= 0.4" } }, + "node_modules/stream-read-all": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/stream-read-all/-/stream-read-all-3.0.1.tgz", + "integrity": "sha512-EWZT9XOceBPlVJRrYcykW8jyRSZYbkb/0ZK36uLEmoWVO5gxBOnntNTseNzfREsqxqdfEGQrD8SXQ3QWbBmq8A==", + "engines": { + "node": ">=10" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -9321,33 +9296,39 @@ } }, "node_modules/table-layout": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", - "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz", + "integrity": "sha512-rpyNZYRw+/C+dYkcQ3Pr+rLxW4CfHpXjPDnG7lYhdRoUcZTUt+KEsX+94RGp/aVp/MQU35JCITv2T/beY4m+hw==", "dependencies": { - "array-back": "^4.0.1", - "deep-extend": "~0.6.0", - "typical": "^5.2.0", - "wordwrapjs": "^4.0.0" + "@75lb/deep-merge": "^1.1.1", + "array-back": "^6.2.2", + "command-line-args": "^5.2.1", + "command-line-usage": "^7.0.0", + "stream-read-all": "^3.0.1", + "typical": "^7.1.1", + "wordwrapjs": "^5.1.0" + }, + "bin": { + "table-layout": "bin/cli.js" }, "engines": { - "node": ">=8.0.0" + "node": ">=12.17" } }, "node_modules/table-layout/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", "engines": { - "node": ">=8" + "node": ">=12.17" } }, "node_modules/table-layout/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", "engines": { - "node": ">=8" + "node": ">=12.17" } }, "node_modules/tapable": { @@ -10033,23 +10014,11 @@ } }, "node_modules/wordwrapjs": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", - "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", - "dependencies": { - "reduce-flatten": "^2.0.0", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/wordwrapjs/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz", + "integrity": "sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==", "engines": { - "node": ">=8" + "node": ">=12.17" } }, "node_modules/wrap-ansi": { @@ -10179,6 +10148,22 @@ } }, "dependencies": { + "@75lb/deep-merge": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", + "integrity": "sha512-xvgv6pkMGBA6GwdyJbNAnDmfAIR/DfWhrj9jgWh3TY7gRm3KO46x/GPjRg6wJ0nOepwqrNxFfojebh0Df4h4Tw==", + "requires": { + "lodash.assignwith": "^4.2.0", + "typical": "^7.1.1" + }, + "dependencies": { + "typical": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==" + } + } + }, "@actions/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", @@ -12425,6 +12410,14 @@ "supports-color": "^7.1.0" } }, + "chalk-template": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", + "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", + "requires": { + "chalk": "^4.1.2" + } + }, "char-regex": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", @@ -12542,74 +12535,25 @@ } }, "command-line-usage": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", - "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.1.tgz", + "integrity": "sha512-NCyznE//MuTjwi3y84QVUGEOT+P5oto1e1Pk/jFPVdPPfsG03qpTIl3yw6etR+v73d0lXsoojRpvbru2sqePxQ==", "requires": { - "array-back": "^4.0.2", - "chalk": "^2.4.2", - "table-layout": "^1.0.2", - "typical": "^5.2.0" + "array-back": "^6.2.2", + "chalk-template": "^0.4.0", + "table-layout": "^3.0.0", + "typical": "^7.1.1" }, "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==", - "requires": { - "color-convert": "^1.9.0" - } - }, "array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==" - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.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==", - "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": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==" }, "typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==" } } }, @@ -15451,6 +15395,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash.assignwith": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", + "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==" + }, "lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -16464,11 +16413,6 @@ "strip-indent": "^3.0.0" } }, - "reduce-flatten": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==" - }, "reftools": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", @@ -16894,6 +16838,11 @@ "internal-slot": "^1.0.4" } }, + "stream-read-all": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/stream-read-all/-/stream-read-all-3.0.1.tgz", + "integrity": "sha512-EWZT9XOceBPlVJRrYcykW8jyRSZYbkb/0ZK36uLEmoWVO5gxBOnntNTseNzfREsqxqdfEGQrD8SXQ3QWbBmq8A==" + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -17073,25 +17022,28 @@ } }, "table-layout": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", - "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz", + "integrity": "sha512-rpyNZYRw+/C+dYkcQ3Pr+rLxW4CfHpXjPDnG7lYhdRoUcZTUt+KEsX+94RGp/aVp/MQU35JCITv2T/beY4m+hw==", "requires": { - "array-back": "^4.0.1", - "deep-extend": "~0.6.0", - "typical": "^5.2.0", - "wordwrapjs": "^4.0.0" + "@75lb/deep-merge": "^1.1.1", + "array-back": "^6.2.2", + "command-line-args": "^5.2.1", + "command-line-usage": "^7.0.0", + "stream-read-all": "^3.0.1", + "typical": "^7.1.1", + "wordwrapjs": "^5.1.0" }, "dependencies": { "array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==" + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==" }, "typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", + "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==" } } }, @@ -17612,20 +17564,9 @@ "dev": true }, "wordwrapjs": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", - "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", - "requires": { - "reduce-flatten": "^2.0.0", - "typical": "^5.2.0" - }, - "dependencies": { - "typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" - } - } + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz", + "integrity": "sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==" }, "wrap-ansi": { "version": "7.0.0", diff --git a/package.json b/package.json index 3f6e1c254..845790254 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "chalk": "^4.1.2", "ci-info": "^3.6.1", "command-line-args": "^5.2.0", - "command-line-usage": "^6.1.3", + "command-line-usage": "^7.0.1", "config": "^3.1.0", "configstore": "^5.0.0", "debug": "^4.3.3", From 7ad95689037a8d58bc3d7efd0e398e82d2d6912a Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 31 Mar 2023 13:44:01 -0700 Subject: [PATCH 07/37] fix: try this --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 266c6337f..2f3e88a7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ RUN cd /rdme && npm ci && npm run build && npx pkg@5 . --target host --out-path FROM alpine:3.14 -COPY --from=builder /rdme/bin/docker /app +COPY --from=builder /rdme/bin/docker/rdme /app/rdme +COPY --from=builder /rdme/bin/docker/entrypoint.sh /app/entrypoint.sh ENTRYPOINT ["/app/entrypoint.sh"] From 0f8f05fb47a95ef5059c0284418a45b756a5dbba Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 3 Apr 2023 13:25:25 -0500 Subject: [PATCH 08/37] chore: try this --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2f3e88a7a..9ff84c6c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,6 @@ RUN cd /rdme && npm ci && npm run build && npx pkg@5 . --target host --out-path FROM alpine:3.14 -COPY --from=builder /rdme/bin/docker/rdme /app/rdme -COPY --from=builder /rdme/bin/docker/entrypoint.sh /app/entrypoint.sh +COPY --from=builder /rdme/bin/docker . -ENTRYPOINT ["/app/entrypoint.sh"] +ENTRYPOINT ["entrypoint.sh"] From 6cd38a2152235232f01b528503deb07ecb048db7 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 3 Apr 2023 16:13:53 -0500 Subject: [PATCH 09/37] fix: get entrypoint working --- Dockerfile | 2 +- bin/docker/entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9ff84c6c1..65f566166 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/bin/docker . -ENTRYPOINT ["entrypoint.sh"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/bin/docker/entrypoint.sh b/bin/docker/entrypoint.sh index 5e48d2122..6fbeb3f27 100755 --- a/bin/docker/entrypoint.sh +++ b/bin/docker/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e ./rdme $INPUT_RDME From 7f8d7fa2ce3049112111aa0a731e94f7cf7e91e2 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 3 Apr 2023 16:33:15 -0500 Subject: [PATCH 10/37] chore(temp): try building and pushing --- .github/workflows/ci.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5d3935aa..1d16a46cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,13 +63,21 @@ jobs: replace: "image: 'Dockerfile'" include: rdme-repo/action.yml + - name: build docker image + run: docker build --platform linux/amd64 --tag ghcr.io/readmeio/rdme:kanad-dev . + working-directory: ./rdme-repo/ + + - name: push docker image + run: docker push ghcr.io/readmeio/rdme:kanad-dev + working-directory: ./rdme-repo/ + - name: Run `openapi:validate` command uses: ./rdme-repo/ with: rdme: openapi:validate "oas-examples-repo/3.1/json/petstore.json" - # Docs: https://rdme-test.readme.io - - name: Run `openapi` command - uses: ./rdme-repo/ - with: - rdme: openapi oas-examples-repo/3.1/json/petstore.json --key=${{ secrets.RDME_TEST_PROJECT_API_KEY }} --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }} + # # Docs: https://rdme-test.readme.io + # - name: Run `openapi` command + # uses: ./rdme-repo/ + # with: + # rdme: openapi oas-examples-repo/3.1/json/petstore.json --key=${{ secrets.RDME_TEST_PROJECT_API_KEY }} --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }} From c3ebc04e21465652a9ed2cd30c84643d11ad1a0f Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 3 Apr 2023 16:36:15 -0500 Subject: [PATCH 11/37] chore: login oops --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d16a46cc..818a8dd85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,13 @@ jobs: replace: "image: 'Dockerfile'" include: rdme-repo/action.yml + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: build docker image run: docker build --platform linux/amd64 --tag ghcr.io/readmeio/rdme:kanad-dev . working-directory: ./rdme-repo/ From b6db9dca27d6bdbb85974e356c6531d157e2f7d1 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 3 Apr 2023 16:41:06 -0500 Subject: [PATCH 12/37] revert: remove build push, add entrypoint debug --- .github/workflows/ci.yml | 15 --------------- bin/docker/entrypoint.sh | 2 ++ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 818a8dd85..22bbab0f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,21 +63,6 @@ jobs: replace: "image: 'Dockerfile'" include: rdme-repo/action.yml - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: build docker image - run: docker build --platform linux/amd64 --tag ghcr.io/readmeio/rdme:kanad-dev . - working-directory: ./rdme-repo/ - - - name: push docker image - run: docker push ghcr.io/readmeio/rdme:kanad-dev - working-directory: ./rdme-repo/ - - name: Run `openapi:validate` command uses: ./rdme-repo/ with: diff --git a/bin/docker/entrypoint.sh b/bin/docker/entrypoint.sh index 6fbeb3f27..4309fa998 100755 --- a/bin/docker/entrypoint.sh +++ b/bin/docker/entrypoint.sh @@ -1,4 +1,6 @@ #!/bin/sh set -e +pwd +ls -l ./rdme $INPUT_RDME From 8c47d18f0fafb3fd73c6c38c3dfc9864b7878559 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 3 Apr 2023 16:54:25 -0500 Subject: [PATCH 13/37] revert: uncommnet --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22bbab0f6..d5d3935aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,8 +68,8 @@ jobs: with: rdme: openapi:validate "oas-examples-repo/3.1/json/petstore.json" - # # Docs: https://rdme-test.readme.io - # - name: Run `openapi` command - # uses: ./rdme-repo/ - # with: - # rdme: openapi oas-examples-repo/3.1/json/petstore.json --key=${{ secrets.RDME_TEST_PROJECT_API_KEY }} --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }} + # Docs: https://rdme-test.readme.io + - name: Run `openapi` command + uses: ./rdme-repo/ + with: + rdme: openapi oas-examples-repo/3.1/json/petstore.json --key=${{ secrets.RDME_TEST_PROJECT_API_KEY }} --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }} From 9708f156e3089d1a9069397ed1be4fd9ed040c05 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 3 Apr 2023 16:57:25 -0500 Subject: [PATCH 14/37] chore: try this (sigh) --- Dockerfile | 6 +++--- action.yml | 2 ++ bin/docker/entrypoint.sh | 6 ------ 3 files changed, 5 insertions(+), 9 deletions(-) delete mode 100755 bin/docker/entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 65f566166..e5861619d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM node:16-alpine as builder COPY . /rdme -RUN cd /rdme && npm ci && npm run build && npx pkg@5 . --target host --out-path bin/docker +RUN cd /rdme && npm ci && npm run build && npx pkg@5 . --target host --out-path exe FROM alpine:3.14 -COPY --from=builder /rdme/bin/docker . +COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["/entrypoint.sh"] +ENTRYPOINT ["sh", "-c", "/exe/rdme $1"] diff --git a/action.yml b/action.yml index a86ca4d8f..9d6f5c57d 100644 --- a/action.yml +++ b/action.yml @@ -14,3 +14,5 @@ outputs: runs: using: docker image: docker://ghcr.io/readmeio/rdme:8.6.0 + args: + - ${{ inputs.rdme }} diff --git a/bin/docker/entrypoint.sh b/bin/docker/entrypoint.sh deleted file mode 100755 index 4309fa998..000000000 --- a/bin/docker/entrypoint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -e -pwd -ls -l -./rdme $INPUT_RDME From cec6fb61c4d3b5ae9af3a1a658c9a116bd5d54f9 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 08:11:51 -0500 Subject: [PATCH 15/37] chore: reset --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e5861619d..79dcb6218 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme $1"] +ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] From 5cbe62df89eda86883e0cd1be2c98049ee81b771 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 08:13:06 -0500 Subject: [PATCH 16/37] chore: remove args oops --- action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/action.yml b/action.yml index 9d6f5c57d..a86ca4d8f 100644 --- a/action.yml +++ b/action.yml @@ -14,5 +14,3 @@ outputs: runs: using: docker image: docker://ghcr.io/readmeio/rdme:8.6.0 - args: - - ${{ inputs.rdme }} From f900a398ab1cc9d2ac63e026060928837670bd46 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 08:13:34 -0500 Subject: [PATCH 17/37] chore: try this see this: https://stackoverflow.com/a/13802438 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 79dcb6218..f7d0e22ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] +ENTRYPOINT ["sh", "-c", "/exe/rdme -- $INPUT_RDME"] From 58ab9cd57dd8e5025fe79338ed556eb56b9a71e7 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 09:49:33 -0500 Subject: [PATCH 18/37] Revert "chore: try this" This reverts commit f900a398ab1cc9d2ac63e026060928837670bd46. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f7d0e22ae..79dcb6218 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme -- $INPUT_RDME"] +ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] From 6138dc7db36a0c66e2320b5c5e7eae1f1b3c816b Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 10:29:46 -0500 Subject: [PATCH 19/37] chore: try single quotes if this works i'm gonna scream --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 79dcb6218..e39bdfbca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] +ENTRYPOINT ["sh", "-c", '/exe/rdme $INPUT_RDME'] From 544981a9e6dd96577d639d4ef0096e56bd5f574b Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 10:39:19 -0500 Subject: [PATCH 20/37] Revert "chore: try single quotes" This reverts commit 6138dc7db36a0c66e2320b5c5e7eae1f1b3c816b. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e39bdfbca..79dcb6218 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", '/exe/rdme $INPUT_RDME'] +ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] From ef6a8d6af9f9e19ab52db099d6d8912b239199be Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 11:07:55 -0500 Subject: [PATCH 21/37] chore: try using curly braces --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 79dcb6218..b34ed7793 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] +ENTRYPOINT ["sh", "-c", "/exe/rdme ${INPUT_RDME}"] From d27bb7b1747ff56d6744c11a25e95e6fc9e574a4 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 11:11:38 -0500 Subject: [PATCH 22/37] chore: try this --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b34ed7793..d8d0423d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme ${INPUT_RDME}"] +ENTRYPOINT ["sh", "-c", "/exe/rdme '${INPUT_RDME}'"] From 518567b66df767644a73cae44f65febbe142647a Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 12:46:03 -0500 Subject: [PATCH 23/37] chore: wait what about this --- Dockerfile | 2 +- action.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d8d0423d8..b7f8d5b75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["sh", "-c", "/exe/rdme '${INPUT_RDME}'"] +ENTRYPOINT ["/exe/rdme"] diff --git a/action.yml b/action.yml index a86ca4d8f..9715af45e 100644 --- a/action.yml +++ b/action.yml @@ -13,4 +13,6 @@ outputs: description: The rdme command result output runs: using: docker - image: docker://ghcr.io/readmeio/rdme:8.6.0 + image: Dockerfile + args: + - ${{ inputs.rdme }} From 8d811968c747c4873de2cccebce2acb2dde92afb Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 13:00:15 -0500 Subject: [PATCH 24/37] chore: debug --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index 44d9bdc43..b55e2f020 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,6 +45,10 @@ export default function rdme(processArgv: NodeJS.Process['argv']) { { name: 'command', type: String, defaultOption: true }, ]; + console.log('processArgv:', processArgv); + + console.log('process.env:', process.env); + const argv = cliArgs(mainArgs, { partial: true, argv: processArgv }); const cmd = argv.command || false; From 360b2fefe183997b151635ac6bddcca6ae7ea71b Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 14:12:05 -0500 Subject: [PATCH 25/37] chore: revert --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 9715af45e..9d6f5c57d 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,6 @@ outputs: description: The rdme command result output runs: using: docker - image: Dockerfile + image: docker://ghcr.io/readmeio/rdme:8.6.0 args: - ${{ inputs.rdme }} From cbeb32ccb339d4cbb9dfcd0796a7bd67d64df4c2 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 14:12:29 -0500 Subject: [PATCH 26/37] fix: will this work? --- src/index.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index b55e2f020..cf6c98092 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,13 +27,14 @@ import createGHA from './lib/createGHA'; import type Command from './lib/baseCommand'; import type { CommandOptions } from './lib/baseCommand'; import getCurrentConfig from './lib/getCurrentConfig'; +import { isGHA } from './lib/isCI'; /** * @param {Array} processArgv - An array of arguments from the current process. Can be used to mock * fake CLI calls. * @return {Promise} */ -export default function rdme(processArgv: NodeJS.Process['argv']) { +export default function rdme(rawProcessArgv: NodeJS.Process['argv']) { const mainArgs = [ { name: 'help', alias: 'h', type: Boolean, description: 'Display this usage guide' }, { @@ -45,9 +46,17 @@ export default function rdme(processArgv: NodeJS.Process['argv']) { { name: 'command', type: String, defaultOption: true }, ]; - console.log('processArgv:', processArgv); + let processArgv = rawProcessArgv; - console.log('process.env:', process.env); + if (isGHA() && rawProcessArgv.length === 1 && rawProcessArgv?.[0]?.split(' ')?.length > 1) { + processArgv = rawProcessArgv[0].split(' ').map(arg => { + try { + return JSON.parse(arg); + } catch (e) { + return arg; + } + }); + } const argv = cliArgs(mainArgs, { partial: true, argv: processArgv }); const cmd = argv.command || false; From bf113794a48876af833a400970271562bd6c4d70 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 14:18:03 -0500 Subject: [PATCH 27/37] ci: add a dedicated filename test --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5d3935aa..0c5fa7d39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,6 +64,11 @@ jobs: include: rdme-repo/action.yml - name: Run `openapi:validate` command + uses: ./rdme-repo/ + with: + rdme: openapi:validate oas-examples-repo/3.1/json/petstore.json + + - name: Run `openapi:validate` with filename in quotes uses: ./rdme-repo/ with: rdme: openapi:validate "oas-examples-repo/3.1/json/petstore.json" From ac5cacc354cb9011d1146ed082de5888c360a224 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 14:31:07 -0500 Subject: [PATCH 28/37] ci: add another test --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c5fa7d39..0bb04c793 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,3 +78,8 @@ jobs: uses: ./rdme-repo/ with: rdme: openapi oas-examples-repo/3.1/json/petstore.json --key=${{ secrets.RDME_TEST_PROJECT_API_KEY }} --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }} + + - name: Run `openapi` command with weird arg syntax + uses: ./rdme-repo/ + with: + rdme: openapi "oas-examples-repo/3.1/json/petstore.json" --key "${{ secrets.RDME_TEST_PROJECT_API_KEY }}" --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }} From 282bb560ce4d3f42def24b3c96f13eb9643eb177 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 16:04:44 -0500 Subject: [PATCH 29/37] test: add tests --- __tests__/index.test.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/__tests__/index.test.ts b/__tests__/index.test.ts index 85164f951..3d535dc08 100644 --- a/__tests__/index.test.ts +++ b/__tests__/index.test.ts @@ -6,6 +6,7 @@ import conf from '../src/lib/configstore'; import getAPIMock from './helpers/get-api-mock'; import { after, before } from './helpers/get-gha-setup'; +import { after as afterGHAEnv, before as beforeGHAEnv } from './helpers/setup-gha-env'; describe('cli', () => { it('command not found', () => { @@ -36,6 +37,32 @@ describe('cli', () => { }); }); + describe('args parsing in GitHub Actions runners', () => { + beforeEach(beforeGHAEnv); + + afterEach(afterGHAEnv); + + it('should return version from package.json for help command (standard argv)', () => { + return expect(cli(['help', '--version'])).resolves.toBe(pkgVersion); + }); + + it('should return version from package.json for help command (single string argv)', () => { + return expect(cli(['help --version'])).resolves.toBe(pkgVersion); + }); + + it('should validate file (standard argv)', () => { + return expect( + cli(['openapi:validate', '__tests__/__fixtures__/petstore-simple-weird-version.json']) + ).resolves.toBe('__tests__/__fixtures__/petstore-simple-weird-version.json is a valid OpenAPI API definition!'); + }); + + it('should validate file (single string with file name in quotes)', () => { + return expect( + cli(['openapi:validate "__tests__/__fixtures__/petstore-simple-weird-version.json"']) + ).resolves.toBe('__tests__/__fixtures__/petstore-simple-weird-version.json is a valid OpenAPI API definition!'); + }); + }); + describe('--help', () => { it('should print help', () => { return expect(cli(['--help'])).resolves.toContain('a utility for interacting with ReadMe'); From a91163c39784def1bd747ada05970fc6822ab1d5 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 16:04:55 -0500 Subject: [PATCH 30/37] docs: add descriptive comments --- src/index.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index cf6c98092..45d18e9b7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,8 +48,28 @@ export default function rdme(rawProcessArgv: NodeJS.Process['argv']) { let processArgv = rawProcessArgv; - if (isGHA() && rawProcessArgv.length === 1 && rawProcessArgv?.[0]?.split(' ')?.length > 1) { + /** + * We have a weird edge case with our Docker image version of `rdme` where GitHub Actions + * will pass all of the `rdme` arguments as a single string with escaped quotes, + * as opposed to the usual array of strings that we typically expect with `process.argv`. + * + * For example, say the user sends us `rdme openapi "petstore.json"`. Instead of `process.argv` being this: + * ['openapi', 'petstore.json'] + * + * GitHub Actions will send us this: + * ['openapi "petstore.json"'] + * + * This logic will ensure that we can handle both types of arguments safely. + */ + if ( + isGHA() && + rawProcessArgv.length === 1 && + // If `process.argv`'s only entry contains spaces, it's likely + // this weird case that we should parse out properly. + rawProcessArgv?.[0]?.split(' ')?.length > 1 + ) { processArgv = rawProcessArgv[0].split(' ').map(arg => { + // This `JSON.parse` will ensure that we're handling escaped quotation marks properly. try { return JSON.parse(arg); } catch (e) { From 76ee1c7ba9d4d42a693a3ad21b98202df0bb9528 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 17:50:20 -0500 Subject: [PATCH 31/37] refactor: safer deterministic way to indicate GHA args --- __tests__/index.test.ts | 9 ++------- action.yml | 1 + src/index.ts | 20 +++++++++----------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/__tests__/index.test.ts b/__tests__/index.test.ts index 3d535dc08..69637a996 100644 --- a/__tests__/index.test.ts +++ b/__tests__/index.test.ts @@ -6,7 +6,6 @@ import conf from '../src/lib/configstore'; import getAPIMock from './helpers/get-api-mock'; import { after, before } from './helpers/get-gha-setup'; -import { after as afterGHAEnv, before as beforeGHAEnv } from './helpers/setup-gha-env'; describe('cli', () => { it('command not found', () => { @@ -38,16 +37,12 @@ describe('cli', () => { }); describe('args parsing in GitHub Actions runners', () => { - beforeEach(beforeGHAEnv); - - afterEach(afterGHAEnv); - it('should return version from package.json for help command (standard argv)', () => { return expect(cli(['help', '--version'])).resolves.toBe(pkgVersion); }); it('should return version from package.json for help command (single string argv)', () => { - return expect(cli(['help --version'])).resolves.toBe(pkgVersion); + return expect(cli(['docker-gha', 'help --version'])).resolves.toBe(pkgVersion); }); it('should validate file (standard argv)', () => { @@ -58,7 +53,7 @@ describe('cli', () => { it('should validate file (single string with file name in quotes)', () => { return expect( - cli(['openapi:validate "__tests__/__fixtures__/petstore-simple-weird-version.json"']) + cli(['docker-gha', 'openapi:validate "__tests__/__fixtures__/petstore-simple-weird-version.json"']) ).resolves.toBe('__tests__/__fixtures__/petstore-simple-weird-version.json is a valid OpenAPI API definition!'); }); }); diff --git a/action.yml b/action.yml index 9d6f5c57d..1e2bcd8cf 100644 --- a/action.yml +++ b/action.yml @@ -15,4 +15,5 @@ runs: using: docker image: docker://ghcr.io/readmeio/rdme:8.6.0 args: + - docker-gha - ${{ inputs.rdme }} diff --git a/src/index.ts b/src/index.ts index 45d18e9b7..242aa0e28 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,22 +53,20 @@ export default function rdme(rawProcessArgv: NodeJS.Process['argv']) { * will pass all of the `rdme` arguments as a single string with escaped quotes, * as opposed to the usual array of strings that we typically expect with `process.argv`. * - * For example, say the user sends us `rdme openapi "petstore.json"`. Instead of `process.argv` being this: + * For example, say the user sends us `rdme openapi "petstore.json"`. + * Instead of `process.argv` being this (i.e., when running the command via CLI): * ['openapi', 'petstore.json'] * - * GitHub Actions will send us this: + * The GitHub Actions runner will send this to the `rdme` Docker image: * ['openapi "petstore.json"'] * - * This logic will ensure that we can handle both types of arguments safely. + * To distinguish these, we have a hidden `docker-gha` argument which we check for to indicate + * when arguments are coming from the GitHub Actions runner. + * This logic checks for that `docker-gha` argument and parses the second string + * into the arguments array that `command-line-args` is expecting. */ - if ( - isGHA() && - rawProcessArgv.length === 1 && - // If `process.argv`'s only entry contains spaces, it's likely - // this weird case that we should parse out properly. - rawProcessArgv?.[0]?.split(' ')?.length > 1 - ) { - processArgv = rawProcessArgv[0].split(' ').map(arg => { + if (rawProcessArgv.length === 2 && rawProcessArgv[0] === 'docker-gha') { + processArgv = rawProcessArgv[1].split(' ').map(arg => { // This `JSON.parse` will ensure that we're handling escaped quotation marks properly. try { return JSON.parse(arg); From 440495b9fe3bdbc7b20fbfe319d38cf1457f7b3a Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 17:52:48 -0500 Subject: [PATCH 32/37] chore: lint --- src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 242aa0e28..01558c595 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,7 +27,6 @@ import createGHA from './lib/createGHA'; import type Command from './lib/baseCommand'; import type { CommandOptions } from './lib/baseCommand'; import getCurrentConfig from './lib/getCurrentConfig'; -import { isGHA } from './lib/isCI'; /** * @param {Array} processArgv - An array of arguments from the current process. Can be used to mock From ae006db8d2b2d97ce8f30925dea1f7634cb52389 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 23:01:27 -0500 Subject: [PATCH 33/37] fix: use string-argv instead --- package-lock.json | 14 ++++++++++++++ package.json | 1 + src/index.ts | 10 ++-------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd75ed557..0370633df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "prompts": "^2.4.2", "semver": "^7.0.0", "simple-git": "^3.13.0", + "string-argv": "^0.3.1", "table": "^6.8.1", "tmp-promise": "^3.0.2", "update-notifier-cjs": "^5.1.5", @@ -9066,6 +9067,14 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -16858,6 +16867,11 @@ "safe-buffer": "~5.2.0" } }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==" + }, "string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", diff --git a/package.json b/package.json index 04d90e642..264f53d42 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "prompts": "^2.4.2", "semver": "^7.0.0", "simple-git": "^3.13.0", + "string-argv": "^0.3.1", "table": "^6.8.1", "tmp-promise": "^3.0.2", "update-notifier-cjs": "^5.1.5", diff --git a/src/index.ts b/src/index.ts index 01558c595..c445c4800 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import path from 'path'; import chalk from 'chalk'; import cliArgs from 'command-line-args'; +import parseArgsStringToArgv from 'string-argv'; // We have to do this otherwise `require('config')` loads // from the cwd where the user is running `rdme` which @@ -65,14 +66,7 @@ export default function rdme(rawProcessArgv: NodeJS.Process['argv']) { * into the arguments array that `command-line-args` is expecting. */ if (rawProcessArgv.length === 2 && rawProcessArgv[0] === 'docker-gha') { - processArgv = rawProcessArgv[1].split(' ').map(arg => { - // This `JSON.parse` will ensure that we're handling escaped quotation marks properly. - try { - return JSON.parse(arg); - } catch (e) { - return arg; - } - }); + processArgv = parseArgsStringToArgv(rawProcessArgv[1]); } const argv = cliArgs(mainArgs, { partial: true, argv: processArgv }); From 073ac68db3e03d04dc271c923cacc41e22aa722c Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 23:02:05 -0500 Subject: [PATCH 34/37] test: add another test case ... also rename a test --- __tests__/index.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/__tests__/index.test.ts b/__tests__/index.test.ts index 69637a996..a65b9735c 100644 --- a/__tests__/index.test.ts +++ b/__tests__/index.test.ts @@ -51,11 +51,17 @@ describe('cli', () => { ).resolves.toBe('__tests__/__fixtures__/petstore-simple-weird-version.json is a valid OpenAPI API definition!'); }); - it('should validate file (single string with file name in quotes)', () => { + it('should validate file (single string with file path in quotes)', () => { return expect( cli(['docker-gha', 'openapi:validate "__tests__/__fixtures__/petstore-simple-weird-version.json"']) ).resolves.toBe('__tests__/__fixtures__/petstore-simple-weird-version.json is a valid OpenAPI API definition!'); }); + + it('should attempt to validate file (single string with file path with spaces)', () => { + return expect(cli(['docker-gha', 'openapi:validate "a non-existent directory/petstore.json"'])).rejects.toThrow( + "ENOENT: no such file or directory, open 'a non-existent directory/petstore.json" + ); + }); }); describe('--help', () => { From 054643fb96b6700322ee368a5954c349d5c910b4 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 4 Apr 2023 23:30:56 -0500 Subject: [PATCH 35/37] test: remove redundant tests, clean up names --- __tests__/index.test.ts | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/__tests__/index.test.ts b/__tests__/index.test.ts index a65b9735c..2c8d984a6 100644 --- a/__tests__/index.test.ts +++ b/__tests__/index.test.ts @@ -36,28 +36,18 @@ describe('cli', () => { }); }); - describe('args parsing in GitHub Actions runners', () => { - it('should return version from package.json for help command (standard argv)', () => { - return expect(cli(['help', '--version'])).resolves.toBe(pkgVersion); - }); - - it('should return version from package.json for help command (single string argv)', () => { + describe('single arg string from GitHub Actions runner', () => { + it('should return version from package.json for help command', () => { return expect(cli(['docker-gha', 'help --version'])).resolves.toBe(pkgVersion); }); - it('should validate file (standard argv)', () => { - return expect( - cli(['openapi:validate', '__tests__/__fixtures__/petstore-simple-weird-version.json']) - ).resolves.toBe('__tests__/__fixtures__/petstore-simple-weird-version.json is a valid OpenAPI API definition!'); - }); - - it('should validate file (single string with file path in quotes)', () => { + it('should validate file (file path in quotes)', () => { return expect( cli(['docker-gha', 'openapi:validate "__tests__/__fixtures__/petstore-simple-weird-version.json"']) ).resolves.toBe('__tests__/__fixtures__/petstore-simple-weird-version.json is a valid OpenAPI API definition!'); }); - it('should attempt to validate file (single string with file path with spaces)', () => { + it('should attempt to validate file (file path contains spaces)', () => { return expect(cli(['docker-gha', 'openapi:validate "a non-existent directory/petstore.json"'])).rejects.toThrow( "ENOENT: no such file or directory, open 'a non-existent directory/petstore.json" ); From 9fa7b48577c5b4599fdd15ed3056a6e5e890f568 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Wed, 5 Apr 2023 10:59:52 -0500 Subject: [PATCH 36/37] chore: add some debug statements --- .DS_Store | Bin 0 -> 8196 bytes src/index.ts | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1d6d2ae08c93ad32acf921083ae62ac48b678dc7 GIT binary patch literal 8196 zcmeHMU2GIp6h3EK*qJGnDgB}B2pMU@UkjE3El`#1A3p*C+3gPnTxWL%m@u6wJG0wX zLaZ8J1b-4^d=h`6kCGUpiAD^(5q;8BlovIc_@WO6ebnf=_s)V{Xrj?5(YeXJXU@6j z%$;-YcjoM!1pw?VTI&It0YIkCs8&P6EgG9={iY^Gk_1sCdw?Q@U_uUDuy4|i1#tx8 z2*eSHBM?U*j==2@0jk-o$#c|wF&mF@1mXz%FC)O-4+eEcQxTmOl)pM?;70(W)gG=u(*s7P7#%TCnA5z$)QP4dIxVO$2NdRj(aIQ|P>`=qb_Q1m zObHr~aRlNB+#CURcCVq+`Xu%Itn+)2n+V2puAd`~cXQ*e6NK&US5T^|o;N>{P!ctX zBkAM*L^?FXV$f?A4lyp{`);m$ZRUm?dm^hf^!Z+BI-XtN299Nu%Hd(hv;2u(zvx*3 zw@r%)MUj=Pw&c{Qu8yuYV{PZg4X4|TQ(HRP+l-A{I!>Qf!zKD?O-IdCqs5M8u*2ez*YW{|f% z%khp4PB>P0e7NKUPR_M6o;hYKb(m3RYMT}}FG=dUP`F`GRvjtkoRdW-oYGoknXj=- zH`K!xJ=0#_VyjrP_BP#zR&UV_{Sce!E7&wzk-#Vw<{7&77c}R)~=588w{rT6L&vX%FkLAY<+ z_SjQh7IOnMHyRu_3--PV0$cP@yGY7+jO5H{z;Z&LPf|ek8oGXv-LA*7xEsw)i)-}* zdPdehk!f=rujCNGY10MH<(AYMu|GVrEva_FDOA3ez&a{cJK->;(l|`PS$Gl7!5i=n zT!N3_W4H=mz?bkfd;{OZHTW5;u@)DihIN?4mADGmU@LCK6!u^*?#BK20H!g6M=*zZ zwDBnVSi}-e;uJoHPvRMT3ZKRo@MU}jU&Gh&JYK*L@FHHq5AjpHf}i16cnyEVpYRtc zA<2>=Et2Y`MyW|!Ev=C@NSmb|@#s=HcSdIePwFLpj#mTaPV{P!PTnealG}IeyghQ~ z>H?lEi|QL1m$j@~+tJybx{fLV!!q)Ik7o|zSYYo=d2}PQM5YZA z`t3=XL0C&f+IKCN3H{o!&+i*5p4A+c)7oxCobFhG6?GdI4)h71_6F69TaR^?J6clhw1X zj=xyXD%`Syyqlx4dkc>%;xRjr098WJ%+CJiE-0&xWXLlMC0{&YX9_T^s! zmA*+NFsMI7oi(O6EhsmkfvGS#KaLZ<{)Zu58_`@UqSJ!X47Gp!LqJ^r?LY9dHLm}E L|9SSds{g+MpmD); literal 0 HcmV?d00001 diff --git a/src/index.ts b/src/index.ts index c445c4800..0c94ca714 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,6 +48,8 @@ export default function rdme(rawProcessArgv: NodeJS.Process['argv']) { let processArgv = rawProcessArgv; + debug(`raw process.argv: ${JSON.stringify(rawProcessArgv)}`); + /** * We have a weird edge case with our Docker image version of `rdme` where GitHub Actions * will pass all of the `rdme` arguments as a single string with escaped quotes, @@ -67,6 +69,7 @@ export default function rdme(rawProcessArgv: NodeJS.Process['argv']) { */ if (rawProcessArgv.length === 2 && rawProcessArgv[0] === 'docker-gha') { processArgv = parseArgsStringToArgv(rawProcessArgv[1]); + debug(`parsing arg string into argv: ${JSON.stringify(processArgv)}`); } const argv = cliArgs(mainArgs, { partial: true, argv: processArgv }); From d6c3f2f5f6b42f87a25ac1cedac85d366528d9a2 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Wed, 5 Apr 2023 11:05:40 -0500 Subject: [PATCH 37/37] revert: delete .DS_Store --- .DS_Store | Bin 8196 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 1d6d2ae08c93ad32acf921083ae62ac48b678dc7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMU2GIp6h3EK*qJGnDgB}B2pMU@UkjE3El`#1A3p*C+3gPnTxWL%m@u6wJG0wX zLaZ8J1b-4^d=h`6kCGUpiAD^(5q;8BlovIc_@WO6ebnf=_s)V{Xrj?5(YeXJXU@6j z%$;-YcjoM!1pw?VTI&It0YIkCs8&P6EgG9={iY^Gk_1sCdw?Q@U_uUDuy4|i1#tx8 z2*eSHBM?U*j==2@0jk-o$#c|wF&mF@1mXz%FC)O-4+eEcQxTmOl)pM?;70(W)gG=u(*s7P7#%TCnA5z$)QP4dIxVO$2NdRj(aIQ|P>`=qb_Q1m zObHr~aRlNB+#CURcCVq+`Xu%Itn+)2n+V2puAd`~cXQ*e6NK&US5T^|o;N>{P!ctX zBkAM*L^?FXV$f?A4lyp{`);m$ZRUm?dm^hf^!Z+BI-XtN299Nu%Hd(hv;2u(zvx*3 zw@r%)MUj=Pw&c{Qu8yuYV{PZg4X4|TQ(HRP+l-A{I!>Qf!zKD?O-IdCqs5M8u*2ez*YW{|f% z%khp4PB>P0e7NKUPR_M6o;hYKb(m3RYMT}}FG=dUP`F`GRvjtkoRdW-oYGoknXj=- zH`K!xJ=0#_VyjrP_BP#zR&UV_{Sce!E7&wzk-#Vw<{7&77c}R)~=588w{rT6L&vX%FkLAY<+ z_SjQh7IOnMHyRu_3--PV0$cP@yGY7+jO5H{z;Z&LPf|ek8oGXv-LA*7xEsw)i)-}* zdPdehk!f=rujCNGY10MH<(AYMu|GVrEva_FDOA3ez&a{cJK->;(l|`PS$Gl7!5i=n zT!N3_W4H=mz?bkfd;{OZHTW5;u@)DihIN?4mADGmU@LCK6!u^*?#BK20H!g6M=*zZ zwDBnVSi}-e;uJoHPvRMT3ZKRo@MU}jU&Gh&JYK*L@FHHq5AjpHf}i16cnyEVpYRtc zA<2>=Et2Y`MyW|!Ev=C@NSmb|@#s=HcSdIePwFLpj#mTaPV{P!PTnealG}IeyghQ~ z>H?lEi|QL1m$j@~+tJybx{fLV!!q)Ik7o|zSYYo=d2}PQM5YZA z`t3=XL0C&f+IKCN3H{o!&+i*5p4A+c)7oxCobFhG6?GdI4)h71_6F69TaR^?J6clhw1X zj=xyXD%`Syyqlx4dkc>%;xRjr098WJ%+CJiE-0&xWXLlMC0{&YX9_T^s! zmA*+NFsMI7oi(O6EhsmkfvGS#KaLZ<{)Zu58_`@UqSJ!X47Gp!LqJ^r?LY9dHLm}E L|9SSds{g+MpmD);