Skip to content

Commit 0757e0a

Browse files
authored
fix: Exports missing ErrorCodes types (#45)
* refact: restructure CLI and command handling, introduce error handling and flag helpers * refact: enhance Scope class with token-based management and improved lookup efficiency * refact: enhance Parser and Scope classes with improved type definitions and parsing logic * refact: rename methods for clarity and improve token handling in Parser class * refact: rename parse method in Parser class for clarity and update exports in main module * refactor: restructure CLI framework by removing legacy components and introducing a new core structure - Deleted outdated classes and files related to CLI error handling, event management, and argument parsing. - Introduced new core components: CLIRegistry, CLIParser, and CLITokens for improved command and flag management. - Implemented a new CLI class to handle command-line interface operations, including parsing and executing commands. - Added a comprehensive error handling system with customizable error messages. - Created a help system to provide usage information for commands and flags. - Updated type definitions for better clarity and maintainability. - Removed helper functions for command and flag creation in favor of a more unified approach. * test: comprehensive tests for CLI new functionality and error handling - Implement tests for createCLI function, validating CLI creation with various options. - Add tests for CLI class methods including parse and run, ensuring correct behavior for different input scenarios. - Introduce tests for CLIErrorHandler and CLIError, verifying error creation and message handling. - Create tests for default error messages, ensuring accurate responses for various error conditions. - Add tests for CLINode, covering command and flag registration, as well as preset handling. - Implement tests for CLI help functionality, validating command and flag extraction from the registry. - Introduce tests for CLI preset functions, ensuring correct parsing and validation of input values. * docs: update contributing guide and README for clarity; remove outdated API references * chore: update ESLint configuration for improved TypeScript support and add test-specific rules; modify Rollup input path and include test files in tsconfig * chore: update version and description in package.json for initial alpha release * feat: enhance exports in index.ts by adding CLIOptions, HelpReporter, and error handling components * feat: add showHelp property to CLI class and update error handling types for consistency * fix: update type reference in CLIErrorHandler tests from ErrorArgsMap to ErrorCodes for accuracy * fix: update coverage exclude patterns to include examples directory * test: update help request fixture to include value property for command * feat: add CLIEntryPreset and createPreset to exports for enhanced functionality * docs: update README for clarity and improved structure, enhancing user guidance and setup instructions * docs: add comprehensive help system documentation to enhance user guidance and customization options * docs: add core concepts documentation to explain Climonad.js architecture and usage * docs: add error handling documentation to improve user experience and customization guidance * chore: update version to 1.0.0-alpha.1 and enhance description for clarity * fix: correct input paths in rollup configuration and update TypeScript include settings * chore: Remove the bench script from package.json * chore: update vitest and coverage-v8 dependencies to version 3.1.2 * fix: add ErrorCodes export to error handling in index.ts * fix: update version to 1.0.0-alpha.2 in package.json and package-lock.json
1 parent 4e653f1 commit 0757e0a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "climonad",
3-
"version": "1.0.0-alpha.1",
3+
"version": "1.0.0-alpha.2",
44
"description": "A zero-dependency CLI framework with monadic principles for creating type-safe, composable command-line interfaces with minimal boilerplate",
55
"main": "./dist/main.cjs",
66
"type": "module",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export { cmd, num, bool, str, createPreset } from "./nodes"
1414
export { CLIHelpConstructor, HelpReporter } from "./ui"
1515

1616
// Error handling
17-
export { CLIErrorHandler, CLIError, DefaultMessages } from "./errors"
17+
export { CLIErrorHandler, CLIError, DefaultMessages, ErrorCodes } from "./errors"

0 commit comments

Comments
 (0)