refactor(core-utils): inline parse-author and drop dependency#4251
Open
MarshallOfSound wants to merge 3 commits intonextfrom
Open
refactor(core-utils): inline parse-author and drop dependency#4251MarshallOfSound wants to merge 3 commits intonextfrom
MarshallOfSound wants to merge 3 commits intonextfrom
Conversation
Ports parse-author@2.0.0 (and its author-regex dependency) verbatim into author-name.ts so we no longer need the npm package, removes the typings shim, and adds unit tests covering the parser. https://claude.ai/code/session_01NRnc7rtSszgHHv5XgXVyjm
c6a5e12 to
acc3eba
Compare
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.
Summarize your changes:
This PR inlines the
parse-authorpackage directly into the codebase, eliminating an external dependency. The implementation is based on the originalparse-authorandauthor-regexlibraries by Jon Schlinkert, with proper attribution included.Changes:
parseAuthor()function inpackages/utils/core-utils/src/author-name.tswith full support for parsing author strings in the format:Name <email> (url)parse-authordependency frompackages/utils/core-utils/package.jsonThe new implementation maintains backward compatibility with the existing
getNameFromAuthor()function while providing a more maintainable solution with no external dependencies.Test Plan:
Added 10 new unit tests in
packages/utils/core-utils/spec/author-name.spec.tsthat verify:All existing tests continue to pass.
https://preview.claude.ai/code/session_01NRnc7rtSszgHHv5XgXVyjm