refactor(devtools): modularize by package manager#21
Merged
Conversation
New structure:
src/modules/package-managers/
maven.sh - Maven cache cleanup
gradle.sh - Gradle cache cleanup (outdated + complete)
node.sh - Node.js caches (npm, yarn, pnpm) + NVM
python.sh - Python caches (pip, poetry)
sdkman.sh - SDKMAN temp files
devtools.sh now acts as orchestrator: sources all modules and exposes
devtools_clean() as the single entry point. External API unchanged.
Closes #9
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
Split
devtools.sh(598 lines) into isolated modules per package manager, following Single Responsibility Principle. Each module is independently sourceable and testable.devtools.shnow acts as a lightweight orchestrator.Changes
src/modules/package-managers/:maven.sh— Maven cache cleanupgradle.sh— Gradle cache cleanup (outdated versions + complete)node.sh— Node.js caches (npm, yarn, pnpm) + NVMpython.sh— Python caches (pip, poetry)sdkman.sh— SDKMAN temp filesdevtools.shreduced to orchestrator: sources all modules, exposesdevtools_clean()as the single entry pointget_npm_cache_info,get_yarn_cache_info,get_pnpm_cache_info,get_pip_cache_info,get_poetry_cache_info) and unused constantNODE_CACHE_SIZE_THRESHOLD_MBWhat stays the same
devtools_clean()) unchanged — no impact onbin/devsweepormenu.shTest results
All 126 tests passing (115 unit + 11 e2e), including all existing
devtools_test.shandanalyze_mode_test.shtests without modifications.Closes #9