Commit Graph

10 Commits

Author SHA1 Message Date
Kazuki Yamada
ea1cc485c2 chore(config): disable organizeImports for src/index.ts
Added override configuration to disable Biome's organizeImports feature
specifically for src/index.ts to allow manual import order management
while keeping automatic import organization enabled for other files.
2025-09-21 13:54:12 +09:00
Kazuki Yamada
2132f3a11d fix(cli): improve token count threshold validation and code quality
- Add explicit radix 10 to Number.parseInt() for consistent parsing
- Add validation to throw error for non-numeric string inputs
- Export TreeNode interface to eliminate code duplication
- Remove unused rootDirs parameter from test helper
- Remove unused isLast parameter from displayNode function
- Simplify token count threshold handling in reporter

These changes address review feedback to improve robustness and maintainability.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 20:38:02 +09:00
Kazuki Yamada
2e584c1436 refactor(cli): rename cliPrint to cliReport and reorganize reporting functions
- Rename cliPrint.ts to cliReport.ts with all functions changed from print* to report*
- Move printResults from defaultAction to cliReport as reportResults for better organization
- Move reportTokenCountTree to cli/reporters/tokenCountTreeReporter.ts for cleaner separation
- Move test-only functions (buildTokenCountStructure, convertToOutput) from core module to test files
- Update all imports and test files to reflect new naming conventions
- Maintain all functionality while improving code organization and module cohesion

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 16:26:30 +09:00
Kazuki Yamada
eabbfa098b refactor(cli): reorganize CLI options and move tokenCountTree to cliPrint
Major restructuring of CLI options and tokenCountTree functionality:

CLI Options:
- Reorganized options into logical groups: "CLI Input/Output Options", "Repomix Output Options", and "File Selection Options"
- Moved --verbose, --quiet, --stdout, --stdin, --copy, --token-count-tree, --top-files-len to CLI I/O group
- Renamed --summarize-token-counts to --token-count-tree for clarity
- Updated README.md documentation to reflect new option organization

TokenCountTree Refactoring:
- Moved tokenCountTree functionality from saveTokenCounts.ts to cliPrint.ts as printTokenCountTree
- Deleted saveTokenCounts.ts (no longer needed)
- Removed handleTokenCountTree function from defaultAction.ts
- Integrated printTokenCountTree into printResults workflow for consistency
- Updated threshold calculation to be handled within printTokenCountTree

Configuration:
- Added tokenCountTree option to config schema with default value false
- Changed schema from z.union([z.boolean(), z.string()]) to z.union([z.boolean(), z.number()])
- CLI now converts string thresholds to numbers during buildCliConfig

Optimizations:
- Modified calculateMetrics to calculate all file tokens when tokenCountTree is enabled
- Prevents double token calculation for better performance

Display:
- Changed emoji from 📊 to 🔢 for Token Count Tree
- Updated title from "Token Count Summary" to "Token Count Tree"

Tests:
- Renamed and updated test files to match new structure
- Updated tests to work with new printTokenCountTree function signature
- All tests pass with new implementation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 15:53:28 +09:00
Gudbergur Erlendsson
602086e661 Add parameter --summarize-token-counts 2025-08-03 14:41:59 +09:00
Kazuki Yamada
3c158810c3 refactor(core): Move TokenCounter to metrics directory
- Move TokenCounter class and tests to metrics directory

- Update import paths in related files

- Improve organization of token counting related code
2025-04-20 16:01:19 +09:00
Viktor Szépe
3ff6202404 Fix EC violations 2025-04-19 20:27:03 +00:00
Kazuki Yamada
76904c9476 feat(website): Add configurable token count encoding and change default to o200k_base 2025-01-05 22:18:46 +09:00
Kazuki Yamada
e34a8dabd2 test(core): improve test coverage for core components 2024-11-21 18:18:52 +09:00
Kazuki Yamada
487287c22c refactor: refine directory structure and files 2024-10-08 01:17:05 +09:00