Skip to content

Improve migration/utils.js and index.js#34

Merged
origami-z merged 4 commits intomainfrom
claude/improve-migration-utils-WhTVz
Jan 24, 2026
Merged

Improve migration/utils.js and index.js#34
origami-z merged 4 commits intomainfrom
claude/improve-migration-utils-WhTVz

Conversation

@origami-z
Copy link
Owner

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.

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.
@origami-z origami-z force-pushed the claude/improve-migration-utils-WhTVz branch from 8824293 to 6280706 Compare January 24, 2026 10:17
- 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.
Copy link
Owner Author

@origami-z origami-z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@origami-z origami-z merged commit 96639f5 into main Jan 24, 2026
1 check passed
@origami-z origami-z deleted the claude/improve-migration-utils-WhTVz branch January 24, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants