Overall refactor to file structures and types, functions, constants usage#28
Merged
suhdonghwi merged 27 commits intomainfrom Nov 7, 2025
Merged
Overall refactor to file structures and types, functions, constants usage#28suhdonghwi merged 27 commits intomainfrom
suhdonghwi merged 27 commits intomainfrom
Conversation
parksb
reviewed
Nov 7, 2025
Member
There was a problem hiding this comment.
What do you think about organizing the files by key feature rather than by individual functions? We could split them into four modules:
- configuration: Reading and parsing yarnrc file, resolving catalog descriptors
- inheritance: Resolving inheritance chains, validating inheritance structures
- default: fallbackDefaultAliasGroup, getDefaultAliasGroups, ...
- validation: getGroupValidationLevel, getValidationLevel, ...
We could place these at the same level (it looks like yarn core typically uses a utils directory for this) and have index.ts reference them. This structure might make the code easier to maintain going forward.
Collaborator
Author
There was a problem hiding this comment.
That's a great idea. The only issue is that some functions (e.g. resolveInheritedRange, getValidationLevel) are methods of CatalogConfigurationReader. I'll consider separating those functions so that the Reader class focuses solely on configuration reading.
Collaborator
Author
There was a problem hiding this comment.
I have made changes:
- Now
CatalogConfigurationReaderonly includes config reading, caching, config object validation feature - Created
utils/directory withdefault.ts,validation.ts,resolution.ts,functions.tsdefault.ts: Fallback to default alias groupvalidation.ts: Validate if catalog dependencies are using catalog protocols (if possible)resolution.ts: Resolve catalog dependency & Find all alias groups that contain specific dependencyfuntions.ts: General utility functions
added 10 commits
November 7, 2025 12:08
parksb
approved these changes
Nov 7, 2025
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.
Key changes
src/index.ts, extracted utility functions into dedicated files.get-catalog-protocol-usability.ts.configuration.tsinto multiple files for better separation of concerns.src/constants.tsandsrc/types.ts.findAllAccessibleGroupsand replaced withfindDependency.getCatalogDependenciesWithoutProtocol->getUnusedCatalogDependencies)Minor changes
typecheckscript..prettierrcfor consistent formatting.Descriptortypes instead of raw string types when possible.Test result