Skip to content

Commit 37deb11

Browse files
committed
Scaffold new CLI
1 parent b388981 commit 37deb11

File tree

3 files changed

+125
-1
lines changed

3 files changed

+125
-1
lines changed

genReadme.new.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
const yargs = require("yargs/yargs");
4+
const { hideBin } = require("yargs/helpers");
5+
const { usage } = require("yargs");
6+
7+
const readmePath = path.resolve(__dirname, "./README.md");
8+
9+
function main(argv) {
10+
console.log(argv);
11+
}
12+
13+
yargs(hideBin(process.argv))
14+
.command({
15+
command: "$0",
16+
describe: "Generate the README.md from docs/ folder",
17+
handler: main,
18+
builder: (yargs) => {
19+
return yargs.option("check", {
20+
type: "boolean",
21+
description:
22+
"Exits with 1 if the current README.md is out-of-date and should be regenerated.",
23+
});
24+
},
25+
})
26+
.usage("node $0 [args]")
27+
.help()
28+
.strict()
29+
.parse();

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"dependencies": {
3030
"@octokit/rest": "^16.43.1",
3131
"front-matter": "^4.0.2",
32-
"markdown-toc": "^1.2.0"
32+
"markdown-toc": "^1.2.0",
33+
"yargs": "^17.5.1"
3334
},
3435
"devDependencies": {
3536
"husky": "^4.2.5",

yarn.lock

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,25 @@ ansi-red@^0.1.1:
154154
dependencies:
155155
ansi-wrap "0.1.0"
156156

157+
ansi-regex@^5.0.1:
158+
version "5.0.1"
159+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
160+
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
161+
157162
ansi-styles@^3.2.1:
158163
version "3.2.1"
159164
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
160165
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
161166
dependencies:
162167
color-convert "^1.9.0"
163168

169+
ansi-styles@^4.0.0:
170+
version "4.3.0"
171+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
172+
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
173+
dependencies:
174+
color-convert "^2.0.1"
175+
164176
ansi-styles@^4.1.0:
165177
version "4.2.1"
166178
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359"
@@ -271,6 +283,15 @@ ci-info@^2.0.0:
271283
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
272284
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
273285

286+
cliui@^7.0.2:
287+
version "7.0.4"
288+
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
289+
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
290+
dependencies:
291+
string-width "^4.2.0"
292+
strip-ansi "^6.0.0"
293+
wrap-ansi "^7.0.0"
294+
274295
coffee-script@^1.12.4:
275296
version "1.12.7"
276297
resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.12.7.tgz#c05dae0cb79591d05b3070a8433a98c9a89ccc53"
@@ -373,6 +394,11 @@ diacritics-map@^0.1.0:
373394
resolved "https://registry.yarnpkg.com/diacritics-map/-/diacritics-map-0.1.0.tgz#6dfc0ff9d01000a2edf2865371cac316e94977af"
374395
integrity sha1-bfwP+dAQAKLt8oZTccrDFulJd68=
375396

397+
emoji-regex@^8.0.0:
398+
version "8.0.0"
399+
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
400+
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
401+
376402
end-of-stream@^1.1.0:
377403
version "1.4.4"
378404
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
@@ -387,6 +413,11 @@ error-ex@^1.3.1:
387413
dependencies:
388414
is-arrayish "^0.2.1"
389415

416+
escalade@^3.1.1:
417+
version "3.1.1"
418+
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
419+
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
420+
390421
escape-string-regexp@^1.0.5:
391422
version "1.0.5"
392423
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
@@ -477,6 +508,11 @@ front-matter@^4.0.2:
477508
dependencies:
478509
js-yaml "^3.13.1"
479510

511+
get-caller-file@^2.0.5:
512+
version "2.0.5"
513+
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
514+
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
515+
480516
get-stream@^4.0.0:
481517
version "4.1.0"
482518
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
@@ -582,6 +618,11 @@ is-extendable@^1.0.1:
582618
dependencies:
583619
is-plain-object "^2.0.4"
584620

621+
is-fullwidth-code-point@^3.0.0:
622+
version "3.0.0"
623+
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
624+
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
625+
585626
is-number@^2.1.0:
586627
version "2.1.0"
587628
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
@@ -1031,6 +1072,11 @@ repeat-string@^1.5.2, repeat-string@^1.6.1:
10311072
resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
10321073
integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc=
10331074

1075+
require-directory@^2.1.1:
1076+
version "2.1.1"
1077+
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
1078+
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
1079+
10341080
resolve-from@^4.0.0:
10351081
version "4.0.0"
10361082
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
@@ -1107,13 +1153,29 @@ sprintf-js@~1.0.2:
11071153
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
11081154
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
11091155

1156+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1157+
version "4.2.3"
1158+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
1159+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
1160+
dependencies:
1161+
emoji-regex "^8.0.0"
1162+
is-fullwidth-code-point "^3.0.0"
1163+
strip-ansi "^6.0.1"
1164+
11101165
string_decoder@~1.1.1:
11111166
version "1.1.1"
11121167
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
11131168
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
11141169
dependencies:
11151170
safe-buffer "~5.1.0"
11161171

1172+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
1173+
version "6.0.1"
1174+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
1175+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
1176+
dependencies:
1177+
ansi-regex "^5.0.1"
1178+
11171179
strip-color@^0.1.0:
11181180
version "0.1.0"
11191181
resolved "https://registry.yarnpkg.com/strip-color/-/strip-color-0.1.0.tgz#106f65d3d3e6a2d9401cac0eb0ce8b8a702b4f7b"
@@ -1213,6 +1275,15 @@ windows-release@^3.1.0:
12131275
dependencies:
12141276
execa "^1.0.0"
12151277

1278+
wrap-ansi@^7.0.0:
1279+
version "7.0.0"
1280+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
1281+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
1282+
dependencies:
1283+
ansi-styles "^4.0.0"
1284+
string-width "^4.1.0"
1285+
strip-ansi "^6.0.0"
1286+
12161287
wrappy@1:
12171288
version "1.0.2"
12181289
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@@ -1223,9 +1294,32 @@ xtend@~4.0.1:
12231294
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
12241295
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
12251296

1297+
y18n@^5.0.5:
1298+
version "5.0.8"
1299+
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
1300+
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
1301+
12261302
yaml@^1.7.2:
12271303
version "1.8.3"
12281304
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.8.3.tgz#2f420fca58b68ce3a332d0ca64be1d191dd3f87a"
12291305
integrity sha512-X/v7VDnK+sxbQ2Imq4Jt2PRUsRsP7UcpSl3Llg6+NRRqWLIvxkMFYtH1FmvwNGYRKKPa+EPA4qDBlI9WVG1UKw==
12301306
dependencies:
12311307
"@babel/runtime" "^7.8.7"
1308+
1309+
yargs-parser@^21.0.0:
1310+
version "21.0.1"
1311+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35"
1312+
integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==
1313+
1314+
yargs@^17.5.1:
1315+
version "17.5.1"
1316+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e"
1317+
integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==
1318+
dependencies:
1319+
cliui "^7.0.2"
1320+
escalade "^3.1.1"
1321+
get-caller-file "^2.0.5"
1322+
require-directory "^2.1.1"
1323+
string-width "^4.2.3"
1324+
y18n "^5.0.5"
1325+
yargs-parser "^21.0.0"

0 commit comments

Comments
 (0)