Commit Graph

14 Commits

Author SHA1 Message Date
Kazuki Yamada 96a6a7c804 perf(core): Cache empty directory paths to avoid redundant file search
When includeEmptyDirectories is enabled, buildOutputGeneratorContext
called searchFiles a second time just to obtain emptyDirPaths, despite
these already being computed during the initial file search in packager.

Changes:
- Capture emptyDirPaths from the initial searchFiles result in packager
  and thread them through the pipeline (packager → produceOutput →
  generateOutput/outputSplit → buildOutputGeneratorContext)
- Guard emptyDirPaths processing with includeEmptyDirectories check to
  skip unnecessary work when the feature is disabled
- Fix split output path which was not receiving emptyDirPaths despite
  the parameter being declared in produceOutput's signature
- Add tests for cache hit (searchFiles not called) and fallback paths

Local benchmark (repomix on itself, includeEmptyDirectories: true):
  main:   696.6ms ± 4.2ms
  branch: 637.1ms ± 2.6ms
  Improvement: ~60ms (~8.5%)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:03:49 +09:00
Kazuki Yamada f41b75c560 fix(test): fix lint errors and update test signatures for filePathsByRoot
- Remove unused imports (generateFileTree, treeToString) in fileTreeGenerate.test.ts
- Add filePathsByRoot parameter to generateOutput and produceOutput calls in tests
- Update expect assertions to include filePathsByRoot argument
2026-01-04 23:11:28 +09:00
Kazuki Yamada f87e00dbdf chore(lint): upgrade biome to v2.2.4 and fix all lint errors
Updated biome from v1.9.4 to v2.2.4 to take advantage of latest linting improvements.

- Upgraded @biomejs/biome from ^1.9.4 to ^2.2.4
- Updated biome.json configuration for v2 compatibility:
  - Changed schema to 2.2.4
  - Updated file includes/ignores syntax
  - Added Vue file overrides to disable noUnusedVariables/noUnusedImports
- Fixed all lint errors:
  - Added radix parameter to parseInt calls
  - Prefixed unused parameters with underscore
  - Removed unused imports
  - Fixed biome suppression comments
  - Removed !important from CSS
  - Added type ignores for Vue component definitions

All 325 files now pass lint with 0 warnings and 0 errors.
2025-09-21 13:39:43 +09:00
Kazuki Yamada 313e978e11 feat(core): add JSON output style support
Add comprehensive JSON output style with camelCase naming convention:
- JSON output generates machine-readable format using JSON.stringify()
- Always uses parsable style for valid JSON structure
- Parameter names follow camelCase convention (fileSummary, userProvidedHeader, etc.)
- Includes CLI option, config schema, and interactive prompt support
- Comprehensive test coverage for unit and integration tests
- Error handling with clear unsupported style messages

This enables easier programmatic consumption of Repomix output for AI systems and automated tools.
2025-09-14 14:50:38 +09:00
Kazuki Yamada b7fe6f25c5 fix(lint): resolve all oxlint warnings for code quality
- Remove unused imports across 67 files (RepomixConfigMerged, QueryCapture, etc.)
- Fix unused parameters by prefixing with underscore (_context, _index, etc.)
- Remove unused catch parameters using modern JavaScript syntax
- Fix require-yield warnings in generator functions
- Remove unused variables and interface declarations
- Add oxlint configuration to ignore integration test fixtures

Resolves 144 linting warnings while preserving all functionality.
All 743 tests continue to pass. Code quality significantly improved.
2025-08-24 18:25:08 +09:00
Kazuki Yamada 5b5ee862a0 feat(cli): Add --include-logs option for git commit history
This feature allows users to include git log information in the output to help AI understand development patterns and file change relationships.

Key changes:
- Added --include-logs and --include-logs-count CLI options
- Default to 50 commits, configurable via CLI and config file
- Includes commit date, message, and changed file paths (excludes commit hashes)
- Added security checks and metrics calculation for git logs
- Updated output templates to include git logs section
- Comprehensive test coverage and TypeScript fixes

Resolves user request for including git commit history to provide development context for AI analysis.
2025-08-22 14:09:58 +09:00
Kazuki Yamada fecebc2ca6 refactor(core): Update GitDiffResult imports and restructure git handling modules 2025-05-24 14:14:26 +09:00
Kazuki Yamada b13a21aebd refactor(core): Migrate GitDiffResult and related functions to gitHandle module 2025-05-24 13:59:32 +09:00
Kazuki Yamada 0be489dcbb refactor(core): Update git command imports and restructure gitHandle module 2025-05-24 13:37:57 +09:00
Kazuki Yamada 9538395cdf refactor(core): Move Git-related modules to dedicated core/git directory 2025-05-19 14:53:28 +00:00
Devin AI 48ec00c63a - Replace hardcoded config objects with createMockConfig utility
- Add proper typing to mock objects and functions
- Remove unnecessary type casting
- Add GitDiffResult type to git diff objects

Co-Authored-By: Kazuki Yamada <koukun0120@gmail.com>
2025-05-13 22:55:50 +09:00
Kazuki Yamada 464ccc582b feat(diff): Refactor CLI and output generation to support git diffs
- Updated CLI options to use `--include-diffs` instead of `--diffs`.
- Refactored `printSummary` to accept a `PackResult` object for better data handling.
- Introduced `getStagedDiff` function to retrieve staged changes from git.
- Created `getGitDiffs` function to encapsulate logic for fetching both worktree and staged diffs.
- Modified output generation functions to include git diffs in various formats (markdown, XML, plain text).
- Updated tests to reflect changes in CLI options and output generation logic, ensuring proper handling of git diffs.
- Removed deprecated `diffContent` from config schema and adjusted related logic.
2025-05-07 00:25:23 +09:00
pmdyy 412a94b9d9 fix(output): fix lints 2025-05-06 00:08:51 -06:00
pmdyy cdfa93c594 feat(output): Add git diff support with --diffs flag 2025-05-05 23:57:05 -06:00