refactor: split src/handlers/bash.ts into focused modules#179
Merged
Conversation
bash.ts was 699 lines with four functions over 50 lines. Extracted into: - bash-shared.ts — extractStdout/Stderr/Command helpers + four constants - bash-git.ts — gitDiffHandler, gitLogHandler, gitStatusHandler - bash-test.ts — testRunnerHandler - bash-docker.ts — dockerPsHandler bash.ts now holds terraformPlanHandler, packageInstallHandler, buildToolHandler, ghHandler, and the getBashHandler dispatcher (~300 lines). All exports remain on bash.ts via re-exports so no import sites changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bash.tswas 699 lines with four handlers over 50 lines; extracted into four focused modulesbash-shared.ts—extractStdout,extractStderr,extractCommand, and the fourMAX_*constantsbash-git.ts—gitDiffHandler,gitLogHandler,gitStatusHandlerbash-test.ts—testRunnerHandlerbash-docker.ts—dockerPsHandlerbash.tsretainsterraformPlanHandler,packageInstallHandler,buildToolHandler,ghHandler, and thegetBashHandlerdispatcher (~300 lines); all original exports re-exported so no import sites changedCloses #177
Test plan
bun run typecheck— clean, no errorsbun test tests/handlers.test.ts— 211 pass, 0 failbun test(full suite) — 693 tests, 0 fail