refactor: Reorganize utilities into 'utils' directory and separate concerns #52
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.
Overview
This pull request refactors the utility modules to enhance code organization, readability, and maintainability. The changes involve moving and separating utility functions into specific files within a new
utils
directory, updating import paths, and adjusting relevant code to align with these structural changes.Changes Made
Move utility modules to
utils
directory:utils
directory to improve code organization.utils.js
was moved toutils/index.js
.url-utils.js
was moved toutils/url-utils.js
.yt-urlfmt.js
was moved toutils/yt-urlfmt.js
.Separate type and logger utilities:
utils/type-utils.js
to house type checking and utility functions.utils/logger.js
to manage logging functionalities.logger
object toLogger
while keeping the old name (logger
) as an alias for backward compatibility.Logger
object:log
as an alias forLogger
.logger
retained as a backward compatibility reference.Correct import path for
utils
module:utils
directory.Update
@module
tag description in documentation:@module
JSDoc tags in affected files to reflect the new paths and module structure accurately.Correct the
ROOTDIR
path inutils
module:ROOTDIR
constant to ensure it correctly points to the project’s root directory after the module reorganization.Correct import paths in test files:
utils
module, ensuring all tests reference the new directory structure.Impact
logger
naming convention to avoid breaking changes.Summary
This refactoring effort significantly improves the project’s structure by organizing utility functions into a
utils
directory. The changes maintain backward compatibility where necessary, correct paths across the codebase, and update documentation to align with the new structure, resulting in a more maintainable and readable codebase.