Skip to content

refactor(core-utils): inline parse-author and drop dependency#4251

Open
MarshallOfSound wants to merge 3 commits intonextfrom
claude/inline-parse-author-sj5qG
Open

refactor(core-utils): inline parse-author and drop dependency#4251
MarshallOfSound wants to merge 3 commits intonextfrom
claude/inline-parse-author-sj5qG

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

This PR inlines the parse-author package directly into the codebase, eliminating an external dependency. The implementation is based on the original parse-author and author-regex libraries by Jon Schlinkert, with proper attribution included.

Changes:

  • Implemented parseAuthor() function in packages/utils/core-utils/src/author-name.ts with full support for parsing author strings in the format: Name <email> (url)
  • Added comprehensive unit tests covering all parsing scenarios: name only, name with email, name with email and url, name with url, email only, url only, empty strings, and error handling
  • Removed the parse-author dependency from packages/utils/core-utils/package.json
  • Removed the TypeScript type definition file for the external package

The 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.ts that verify:

  • Correct parsing of all author string formats
  • Proper handling of edge cases (empty strings, whitespace)
  • Type validation (throws TypeError for non-string input)

All existing tests continue to pass.

https://preview.claude.ai/code/session_01NRnc7rtSszgHHv5XgXVyjm

@MarshallOfSound MarshallOfSound requested a review from a team as a code owner May 7, 2026 18:30
@github-actions github-actions Bot added the next label May 7, 2026
@MarshallOfSound MarshallOfSound enabled auto-merge (squash) May 7, 2026 18:32
@erickzhao erickzhao changed the title Inline parse-author dependency to remove external package refactor: inline parse-author dependency to remove external package May 7, 2026
@MarshallOfSound MarshallOfSound changed the title refactor: inline parse-author dependency to remove external package refactor(core-utils): inline parse-author and drop dependency May 7, 2026
claude added 2 commits May 7, 2026 18:47
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
@MarshallOfSound MarshallOfSound force-pushed the claude/inline-parse-author-sj5qG branch from c6a5e12 to acc3eba Compare May 7, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants