-
Notifications
You must be signed in to change notification settings - Fork 30
feat: use custom help classes #62
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
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
6e05b0e
Add HelpBase abstract class
chadian 4b90ef1
Add tests for topic output
chadian 4a1bcff
Add topics tests
chadian eb70682
Move render and config setup to HelpBase
chadian ac48362
Move the constructor opts to the base class
chadian 276d255
Add more tests
chadian 6cfa8a9
Clean up
chadian 52ee8f4
Restructure command tests
chadian 44edacc
Add command description template test
chadian e60f40b
Add command usage tests
chadian 55446cd
Add tests for template support in root descriptions
chadian dbef558
Export abstract HelpBase
chadian 7211fd9
Reduce HelpBase to the currently use public interface
chadian 1c94978
Add command method to BaseHelp, used by dev-cl to generate README
chadian fadb41c
Fix HelpOptions typing
chadian ce9ba9a
Refactor Help class to have easier extension methods
chadian a82331e
Add test to track showHelp routing
chadian 7729357
Refactor showHelp to return after specific cases
chadian 6c05385
Add getCommandHelpForReadme as preferred method for readme command he…
chadian 0be84da
Move getHelpPlugin into @oclif/plugin-help
chadian 9a2dd54
Use getHelpPlugin for internal help command
chadian 25b6da8
Use helpClass instead of helpPlugin
chadian 6633fe3
Bump @oclif/config
chadian c413d15
Fix tests
chadian bd804fa
Add additional unit tests to cover getHelpClass loading cases
chadian 9abfa55
Fix extract helper function names
chadian 717968c
Ensure @oclif/config 1.15.1 is used
chadian 8d94e15
Remove the readme-related methods
chadian f9d80ec
Rename to format* for the formatting methods
chadian 7b730aa
Change up tests to use the format methods
chadian 5bfa829
Fix variable naming
chadian 9aaa951
Add disclaimer on test help class included in src
chadian 8d8b50f
Add subtopic and topic command lists for a topic
chadian bad6397
Add topic/command split to root help
chadian 965cc76
Fix eslint jsdoc
chadian a71b774
Add back deprecated command in case non-pinned dev-cli uses the plugi…
chadian c7563b7
Bump dependencies
chadian f7d1991
Rename mocks to fixtures
chadian c520661
Make opts and config protected
chadian 9dcf818
Add tests around listed split topic and command help
chadian eef3ca3
Remove categorizeTopicsAndCommands in favor of a correct _topics prop…
chadian 41198f2
Small method naming tweaks
chadian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // `getHelpClass` tests require an oclif project for testing so | ||
| // it is re-using the setup here to be able to do a lookup for | ||
| // this sample help class file in tests, although it is not needed | ||
| // for @oclif/plugin-help itself. | ||
|
|
||
| import {HelpBase} from '.' | ||
|
|
||
| export default class extends HelpBase { | ||
| showHelp() { | ||
| console.log('help') | ||
| } | ||
|
|
||
| showCommandHelp() { | ||
| console.log('command help') | ||
| } | ||
|
|
||
| getCommandHelpForReadme() { | ||
| return 'help for readme' | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.