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

fix: improve inline documentation #172

Merged
merged 3 commits into from
Aug 20, 2024
Merged

fix: improve inline documentation #172

merged 3 commits into from
Aug 20, 2024

Conversation

pottekkat
Copy link
Contributor

@pottekkat pottekkat commented Aug 19, 2024

Description

Makes improvements to the inline documentation of subcommands so that they are consistent.

I will also be improving the examples shown to cover typical use cases and making some other UX improvements. I realized it might take some time and become a bigger PR so this is a small PR to make some initial changes.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible

@pottekkat pottekkat requested review from bzp2010 and kayx23 August 19, 2024 16:28
Comment on lines 13 to 16
constructor(name: string, summary?: string, description?: string) {
super(name);

if (summary) this.summary(summary);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This adds a summary for describing the subcommand in the global help while preserving the longer description for the subcommand-specific help.

Copy link
Collaborator

@bzp2010 bzp2010 left a comment

Choose a reason for hiding this comment

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

There are some indentation issues, and I recommend you install the Prettier plugin for VSCode, which will format any changes you make following the code formatting configuration in our repository.

image

Please turn on the Format on Save option for the VSCode project workspace, or use the Format Document command manually.

apps/cli/src/command/convert.command.ts Outdated Show resolved Hide resolved
apps/cli/src/command/convert.command.ts Outdated Show resolved Hide resolved
apps/cli/src/command/diff.command.ts Outdated Show resolved Hide resolved
apps/cli/src/command/dump.command.ts Outdated Show resolved Hide resolved
apps/cli/src/command/index.ts Show resolved Hide resolved
apps/cli/src/command/lint.command.ts Outdated Show resolved Hide resolved
@pottekkat pottekkat requested a review from bzp2010 August 20, 2024 11:06
Copy link
Collaborator

@bzp2010 bzp2010 left a comment

Choose a reason for hiding this comment

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

I have no problem with correctness on TypeScript.
The changes on the inline docs look good to me, but still need to be checked by other reviewers.

@@ -158,14 +158,16 @@ export const DiffResourceTask = (

export const DiffCommand = new BackendCommand<DiffOptions>(
'diff',
'Show the difference between local and backend configurations',
'show differences between the local and the backend configurations',
'Compare the configuration in the specified file(s) with the backend configuration',
Copy link
Contributor

@kayx23 kayx23 Aug 20, 2024

Choose a reason for hiding this comment

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

Only curious to know why the first sentence needs to be lower cased

I noticed all similar instances are changed to lower case

Copy link
Contributor Author

@pottekkat pottekkat Aug 20, 2024

Choose a reason for hiding this comment

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

By default the library we use, commander, uses lower case when showing the summary of a command/flag, like the in-built help command/version flag.

I just followed the convention.

The alternative was to use custom help and version commands which seemed unnecessary.

I also don't have strong opinions on choosing one over the other.

@pottekkat pottekkat merged commit 63d4323 into main Aug 20, 2024
6 checks passed
@pottekkat pottekkat deleted the fix/improve-ux/1 branch August 20, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants