Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: overhauling the help screen generator so it's consistent everywhere #397

Merged
merged 11 commits into from
Dec 2, 2021
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ updates:
prefix: chore(deps)
prefix-development: chore(deps-dev)
ignore:
# node-fetch is now an ESM package and can't be used here without a rewrite.
- dependency-name: node-fetch
# chalk is now an ESM package and can't be used here without a rewrite.
- dependency-name: chalk
versions:
- ">= 3"
- ">= 5"
# node-fetch is now an ESM package and can't be used here without a rewrite.
- dependency-name: table-layout
- dependency-name: node-fetch
versions:
- ">= 3"
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ jobs:

- name: Run tests
run: npm test
env:
# `chalk` has troubles with color detection while on CI.
# https://github.com/chalk/supports-color/issues/106
FORCE_COLOR: 1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `rdme` - ReadMe's CLI
# 📖 rdme

[![](https://d3vv6lp55qjaqc.cloudfront.net/items/1M3C3j0I0s0j3T362344/Untitled-2.png)](https://readme.com)

Expand Down
234 changes: 234 additions & 0 deletions __tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`cli --help should not surface args that are designated as hidden 1`] = `
"
Alias for \`rdme openapi\`. [deprecated]

Usage

rdme swagger [file] [options]

Options

--key string Project API key
--id string Unique identifier for your specification. Use this if you're resyncing an
existing specification
--version string Project version
-h, --help Display this usage guide

Related commands

$ rdme openapi Upload, or sync, your OpenAPI/Swagger file to ReadMe.
"
`;

exports[`cli --help should print help 1`] = `
"
📖 rdme

a utlity for interacting with ReadMe
.
.\\\\ /.
’ ‘ ‘ ‘
( nn\\\\ . . / )
(nnnnn,.MM. AM .nn.
.nnnndMM----_______--M.’’ /
|nnn/nnnnnnnnnnnnnnnnn\\\\’mmm/
/nnnn...nnnnnnnnnnn...mmmmm\\\\
/nn ‘qnnnP’ ‘mmm\\\\
/n’ .XXX. \\\\nnn/ .XX. \\\\mmb
An (XOXX) nnn (XOXX) mm\\\\
/nn ‘XXXX’.~”~. ‘XXX”’ .mmmb
dnnn. ( )n. .mmmmb
.nnnnnn....n.\\\\ ./nnnnnnnnnmmmmmm\\\\
(READnnnnnnnnnnn’Y’nnnnnnnnnnmmmmmmME)
REinnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmmAD/
/MEEnnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmm)E'.
READnnnnnnn*’ ‘*mmmmmmmm)MEE.
(READ|nnnn’ \\\\../ \\\\.../ ‘mmmmmM)EEE)
READ(nn*’ ‘mmm.MEEE)
‘READn’ \\\\._./ \\\\__./ \\\\.../ ‘MEE*’
* /*

Usage

rdme <command> [arguments]

Options

-h, --help Display this usage guide
-v, --version Show the current rdme version

Administration

$ rdme login Login to a ReadMe project.
$ rdme logout Logs the currently authenticated user out of ReadMe.
$ rdme whoami Displays the current user and project authenticated with ReadMe.

Upload OpenAPI/Swagger definitions

$ rdme openapi Upload, or sync, your OpenAPI/Swagger file to ReadMe.
$ rdme swagger Alias for \`rdme openapi\`. [deprecated]

Documentation

$ rdme docs Sync a folder of markdown files to your ReadMe project.
$ rdme docs:edit Edit a single file from your ReadMe project without saving locally.

Versions

$ rdme versions List versions available in your project or get a version by SemVer
(https://semver.org/).
$ rdme versions:create Create a new version for your project.
$ rdme versions:update Update an existing version for your project.
$ rdme versions:delete Delete a version associated with your ReadMe project.

Other useful commands

$ rdme oas Helpful OpenAPI generation tooling.
$ rdme open Open your current ReadMe project in the browser.

Run rdme help <command> for help with a specific command.

To get more help with ReadMe, checkout our docs at https://docs.readme.com.
"
`;

exports[`cli --help should print help for the \`-H\` alias 1`] = `
"
📖 rdme

a utlity for interacting with ReadMe
.
.\\\\ /.
’ ‘ ‘ ‘
( nn\\\\ . . / )
(nnnnn,.MM. AM .nn.
.nnnndMM----_______--M.’’ /
|nnn/nnnnnnnnnnnnnnnnn\\\\’mmm/
/nnnn...nnnnnnnnnnn...mmmmm\\\\
/nn ‘qnnnP’ ‘mmm\\\\
/n’ .XXX. \\\\nnn/ .XX. \\\\mmb
An (XOXX) nnn (XOXX) mm\\\\
/nn ‘XXXX’.~”~. ‘XXX”’ .mmmb
dnnn. ( )n. .mmmmb
.nnnnnn....n.\\\\ ./nnnnnnnnnmmmmmm\\\\
(READnnnnnnnnnnn’Y’nnnnnnnnnnmmmmmmME)
REinnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmmAD/
/MEEnnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmm)E'.
READnnnnnnn*’ ‘*mmmmmmmm)MEE.
(READ|nnnn’ \\\\../ \\\\.../ ‘mmmmmM)EEE)
READ(nn*’ ‘mmm.MEEE)
‘READn’ \\\\._./ \\\\__./ \\\\.../ ‘MEE*’
* /*

Usage

rdme <command> [arguments]

Options

-h, --help Display this usage guide
-v, --version Show the current rdme version

Administration

$ rdme login Login to a ReadMe project.
$ rdme logout Logs the currently authenticated user out of ReadMe.
$ rdme whoami Displays the current user and project authenticated with ReadMe.

Upload OpenAPI/Swagger definitions

$ rdme openapi Upload, or sync, your OpenAPI/Swagger file to ReadMe.
$ rdme swagger Alias for \`rdme openapi\`. [deprecated]

Documentation

$ rdme docs Sync a folder of markdown files to your ReadMe project.
$ rdme docs:edit Edit a single file from your ReadMe project without saving locally.

Versions

$ rdme versions List versions available in your project or get a version by SemVer
(https://semver.org/).
$ rdme versions:create Create a new version for your project.
$ rdme versions:update Update an existing version for your project.
$ rdme versions:delete Delete a version associated with your ReadMe project.

Other useful commands

$ rdme oas Helpful OpenAPI generation tooling.
$ rdme open Open your current ReadMe project in the browser.

Run rdme help <command> for help with a specific command.

To get more help with ReadMe, checkout our docs at https://docs.readme.com.
"
`;

exports[`cli --help should print usage for a given command 1`] = `
"
Alias for \`rdme openapi\`. [deprecated]

Usage

rdme swagger [file] [options]

Options

--key string Project API key
--id string Unique identifier for your specification. Use this if you're resyncing an
existing specification
--version string Project version
-h, --help Display this usage guide

Related commands

$ rdme openapi Upload, or sync, your OpenAPI/Swagger file to ReadMe.
"
`;

exports[`cli --help should print usage for a given command if supplied as \`help <command>\` 1`] = `
"
Alias for \`rdme openapi\`. [deprecated]

Usage

rdme swagger [file] [options]

Options

--key string Project API key
--id string Unique identifier for your specification. Use this if you're resyncing an
existing specification
--version string Project version
-h, --help Display this usage guide

Related commands

$ rdme openapi Upload, or sync, your OpenAPI/Swagger file to ReadMe.
"
`;

exports[`cli --help should show related commands for a subcommands help menu 1`] = `
"
List versions available in your project or get a version by SemVer (https://semver.org/).

Usage

rdme versions [options]

Options

--key string Project API key
--version string A specific project version to view
--raw Return raw output from the API instead of in a \\"pretty\\" format.
-h, --help Display this usage guide

Related commands

$ rdme versions:create Create a new version for your project.
$ rdme versions:update Update an existing version for your project.
$ rdme versions:delete Delete a version associated with your ReadMe project.
"
`;
2 changes: 1 addition & 1 deletion __tests__/cmds/logout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('rdme logout', () => {

return cmd.run({}).then(msg => {
expect(msg).toBe(
`You have logged out of Readme. Please use \`${config.cli} ${loginCmd.command}\` to login again.`
`You have logged out of ReadMe. Please use \`${config.cli} ${loginCmd.command}\` to login again.`
);
});
});
Expand Down
Loading