refactor: modularize logging-utils.js (790 lines) into 5 modules#6
Merged
Conversation
- Refactored logging-utils.js (790 lines) into modular architecture - Created 5 modules: dependency-loader, config-manager, basic-logger, ui-components, formatter-utils - Maintained 100% backward compatibility with original API - All 97 tests pass, validation script confirms compatibility - Main file reduced from 790 to 150 lines (81% reduction) - Modules focused on single responsibilities for better maintainability - Follows established refactoring pattern from previous utility refactorings
- Refactored python-command-runner.js (780 lines) into modular architecture - Created 5 modules: python-initializer, python-project-analyzer, python-core-executor, python-command-executor, python-help-utils - Maintained 100% backward compatibility with original API - All 97 tests pass, validation script confirms compatibility - Main file reduced from 780 to 250 lines (68% reduction) - Modules focused on single responsibilities for better maintainability - Follows established refactoring pattern from previous command runners
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
scripts/lib/logging-utils.js(790 lines) into modular architectureChanges
logging-utils.jsreduced from 790 to 150 lines (81% reduction)dependency-loader.js- Optional dependency loading with fallbacks (chalk, boxen, ora, Table, ProgressBar)config-manager.js- Configuration, level management, initializationbasic-logger.js- Core logging methods (error, warn, info, debug, success)ui-components.js- UI components (spinner, progressBar, table, box, section, keyValue)formatter-utils.js- Formatting utilities (code, command, filePath, json, formatError, formatSuccessSummary, formatSecurityResults)Technical Details
validate-logging-utils.jswith 10 comprehensive testsBenefits
dependency-loadermodule can be reused elsewhereVerification
Related PRs