Skip to content

feat: Implement Class-Based Help System (CLIHelp) and Core Refactoring #46

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 8 commits into from
May 9, 2025

Conversation

supitsdu
Copy link
Owner

@supitsdu supitsdu commented May 9, 2025

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 new CLIHelp class. It also includes updates to improve maintainability, extensibility, and test coverage. Below are the most important changes grouped by theme:

Help System Enhancements

  • Introduced the 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]
  • Added the createCLIHelp utility function to simplify the creation of CLIHelp instances with options for customizing names, descriptions, aliases, and trigger types (src/ui/help.ts, README.md, docs/core-concepts.md). [1] [2] [3]
  • Updated the 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

  • Refactored the CLI class to replace the old helpReporter and help flag system with the CLIHelp class, improving modularity and reducing boilerplate (src/createCLI.ts). [1] [2]
  • Introduced helper functions parseInputToTokens and processTokens to streamline token processing and improve readability of the CLI parsing logic (src/helpers/cli-helpers.ts).

Testing Improvements

  • Updated test cases to accommodate the new CLIHelp class, including mocking the createCLIHelp utility and testing the integration of CLIHelp instances (test/createCLI.test.ts). [1] [2] [3]

Version Update

  • Bumped the package version from 1.0.0-alpha.2 to 1.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.

@supitsdu supitsdu merged commit 18bcf64 into main May 9, 2025
1 check passed
@supitsdu supitsdu deleted the refact/help-sys-api branch May 9, 2025 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant