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: experiment with a decorator to hide commands from the help screen #574

Merged
merged 7 commits into from
Aug 20, 2022

Conversation

erunion
Copy link
Member

@erunion erunion commented Aug 19, 2022

🧰 Changes

This adds a new @isHidden decorator that when applied to a command class will hide it from all --help screens. This decorator is being applied to the inactive oas and deprecated swagger commands.

🧬 QA & Testing

  • Running npm run debug -- --help you shouldn't see oas or swagger anywhere.
  • Running npm run debug -- openapi --help you shouldn't see swagger in the "Related commands" section.

Run npm run build and then do the same checks against ./bin/rdme and you should see the same.

@erunion erunion added the enhancement New feature or request label Aug 19, 2022
Copy link
Member

@kanadgupta kanadgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is absolutely wild. wanna add this to the oas command as well?

@erunion
Copy link
Member Author

erunion commented Aug 19, 2022

Running into all sorts of issues with the hidden prop not being picked up in tests. Will keep this draft open until I have time to dig into it.

@erunion erunion marked this pull request as ready for review August 19, 2022 23:59
@erunion erunion requested a review from kanadgupta August 19, 2022 23:59
@erunion erunion added the command:other Issues pertaining to miscellaneous commands (e.g. `open`, `logout`) or requests for new commands label Aug 20, 2022
Copy link
Member

@kanadgupta kanadgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -10,6 +10,7 @@ export function getCategories(): Record<
name: string;
description: string;
position: number;
hidden: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really do have so many stupid little moving parts in these command helper functions. thank god for TS

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly blown away by how much the rewrite has been helping us this past week

@erunion erunion merged commit 486a8b0 into main Aug 20, 2022
@erunion erunion deleted the feat/decorator-experimentation branch August 20, 2022 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command:other Issues pertaining to miscellaneous commands (e.g. `open`, `logout`) or requests for new commands enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants