Skip to content

docs(seo-graph-core): clarify buildPiece takes no IdFactory#52

Open
schlessera wants to merge 1 commit into
jdevalk:mainfrom
schlessera:docs/seo-graph-core-buildpiece-no-idfactory
Open

docs(seo-graph-core): clarify buildPiece takes no IdFactory#52
schlessera wants to merge 1 commit into
jdevalk:mainfrom
schlessera:docs/seo-graph-core-buildpiece-no-idfactory

Conversation

@schlessera

Copy link
Copy Markdown

What

The Piece builders section of packages/seo-graph-core/README.md opens with:

All builders take an input object and the IdFactory, and return a plain object with @type and @id.

That's accurate for the seven dedicated builders, but not for buildPiece.

Evidence (current src/pieces/)

(input, ids: IdFactory):

  • buildWebSite, buildWebPage, buildArticle, buildBreadcrumbList, buildImageObject, buildVideoObject, buildSiteNavigationElement

Single-arg:

  • buildPiece(raw: Record<string, unknown>)src/pieces/custom.ts. The caller passes @id/@type inline in the object. AGENTS.md already states this ("the generic buildPiece builder takes only the input object"); the core README didn't.

Change

One sentence — note the buildPiece exception so readers don't pass a second IdFactory argument that doesn't exist.

Docs-only; no changeset.

The Piece builders section opened with "All builders take an input
object and the IdFactory". That holds for the seven dedicated builders
(buildWebSite, buildWebPage, buildArticle, buildBreadcrumbList,
buildImageObject, buildVideoObject, buildSiteNavigationElement — all
`(input, ids)`), but not for buildPiece, whose signature is single-arg
`buildPiece(raw)`: the caller passes `@id`/`@type` inline. Call out the
exception so readers don't pass a second argument that doesn't exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant