Repository navigation
refactor(blog): remove test-only validateAuthorsMap() duplicate (AI-assisted) - #12770
Merged
Merged
Conversation
…isted) validateAuthorsMap() was an exact copy of validateAuthorsMapInput(), and only tests used it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
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.
Motivation
The blog plugin's
validateAuthorsMap(content)function inauthorsMap.tsis an exact copy ofvalidateAuthorsMapInput(content): sameAuthorsMapInputSchema.validate()call, same throw. Only the "authors socials" tests inauthorsMap.test.tscalled it. It was added in #10216.This PR deletes the duplicate and makes these tests call
validateAuthorsMapInput(), the function the plugin actually uses. The assertions don't change.It isn't public API: the plugin entry points (
src/index.ts,client,src/plugin-content-blog.d.ts) don't re-export it, and nothing in the monorepo imports it. It's only reachable through the./lib/*wildcard export, which is also why Knip's production mode (pnpm lint:knip:production) can't report it yet.Found during the dead-code sweep of #12751.
(AI-assisted)
Test Plan
pnpm test packages/docusaurus-plugin-content-blogpnpm typecheck:testspnpm lint:knipandpnpm lint:knip:productionTest links
Deploy preview: https://deploy-preview-12770--docusaurus-2.netlify.app/
Related issues/PRs
🤖 Generated with Claude Code
Summary by CodeRabbit
validateAuthorsMapfunction. Consumers that need to validate author-map content can usevalidateAuthorsMapInputinstead. This may require updates for projects that import the removed function.