Improve migration/utils.js and index.js#34
Merged
Conversation
Enhanced migration/utils.js with: - Comprehensive JSDoc documentation with type definitions and examples - Input validation and error handling for all functions - Better null/undefined checks to prevent runtime errors - Improved code readability with early returns and clearer logic - Helper function to find actual element names (handles aliases) - More descriptive parameter documentation - Regex escaping in getCssRenameCheckRegex for special characters - Default parameters where appropriate - Better error messages with context Enhanced index.js with: - Extracted constants (CSS_IGNORE_FOLDERS, SALT_DS_PACKAGE_FILTER) - Added error handling for package upgrades and file operations - Improved code organization with section headers - Better documentation and comments - Clearer variable names and logic flow - Enhanced completion messages with better formatting All tests pass (53/53). No breaking changes.
8824293 to
6280706
Compare
- Added new log utilities (infoLog, errorLog, warnLog) to utils/log.js for consistent logging across the codebase - Replaced all direct console.log/error/warn calls in migration/utils.js with appropriate log utilities (warnLog, errorLog) - Replaced all direct console.log/error calls in index.js with appropriate log utilities (infoLog, errorLog) - Created utils/migration-helpers.js and moved applyMigrationIfInRange helper function from index.js for better code organization - Added comprehensive JSDoc documentation to the helper function Benefits: - Centralized logging control through utility functions - Consistent logging behavior across the codebase - Better separation of concerns with helper utilities - Easier to mock/test logging behavior in the future All 60 tests passing.
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.
Enhanced migration/utils.js with:
Enhanced index.js with:
All tests pass (53/53). No breaking changes.