feat: Implement Class-Based Help System (CLIHelp
) and Core Refactoring
#46
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.
This pull request introduces a significant overhaul of the help system in the
Climonad
CLI framework, transitioning from a flag-based help configuration to a class-based approach using the newCLIHelp
class. It also includes updates to improve maintainability, extensibility, and test coverage. Below are the most important changes grouped by theme:Help System Enhancements
CLIHelp
class to encapsulate help functionality, allowing for more structured and customizable help behavior. The class supports both flag-based (--help
) and command-based (help
) triggers (src/ui/help.ts
,README.md
,docs/help-system.md
,docs/core-concepts.md
). [1] [2] [3]createCLIHelp
utility function to simplify the creation ofCLIHelp
instances with options for customizing names, descriptions, aliases, and trigger types (src/ui/help.ts
,README.md
,docs/core-concepts.md
). [1] [2] [3]README.md
and documentation to reflect the new class-based approach and provide examples for creating and integrating custom help reporters (README.md
,docs/core-concepts.md
,docs/help-system.md
). [1] [2] [3]Core Refactoring
CLI
class to replace the oldhelpReporter
andhelp
flag system with theCLIHelp
class, improving modularity and reducing boilerplate (src/createCLI.ts
). [1] [2]parseInputToTokens
andprocessTokens
to streamline token processing and improve readability of theCLI
parsing logic (src/helpers/cli-helpers.ts
).Testing Improvements
CLIHelp
class, including mocking thecreateCLIHelp
utility and testing the integration ofCLIHelp
instances (test/createCLI.test.ts
). [1] [2] [3]Version Update
1.0.0-alpha.2
to1.0.0-alpha.3
to reflect the significant changes and enhancements (package.json
).These changes collectively improve the flexibility, maintainability, and user experience of the help system in the
Climonad
framework.