Commit Graph

3 Commits

Author SHA1 Message Date
Kazuki Yamada 3e70628307 refactor(core): Separate lightweight transforms from worker processing
Extract lightweight file transforms (truncateBase64, removeEmptyLines,
trim, showLineNumbers) into applyLightweightTransforms() on the main
thread, keeping only heavy operations (removeComments, compress) in
worker processContent(). This eliminates dual management of the same
logic across worker and main thread paths.

Also pre-compile base64 regex patterns at module level to avoid
re-creation per file call.

Action: split processContent into heavy (worker) and lightweight (main thread) phases
Action: extract applyLightweightTransforms() as single source of truth for lightweight ops
Action: hoist regex patterns in truncateBase64.ts to module scope with lastIndex reset
Why: lightweight transforms were duplicated in both processFilesMainThread and processContent
Why: regex re-compilation per file added unnecessary overhead for large repos

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:24:32 +09:00
Kazuki Yamada 53ae395280 test(cli): Fix logger mock path in clipboard test 2025-04-20 18:38:05 +09:00
Kazuki Yamada 36af779b55 test(core): Add test coverage for fileProcessContent 2025-04-20 18:07:40 +09:00