Skip to content

Autogenerate TypeScript SDK method reference #1392

Closed

Description

@samuv

Parent

Problem

The committed API Extractor reports protect the TypeScript SDK's public surface,
but they are review artifacts rather than reader-facing method reference. Their
document model is disabled, and many public declarations do not yet carry enough
TSDoc to produce useful reference pages.

Hand-maintained method signatures would duplicate the declarations and drift as the
SDK evolves. The documentation site needs reference generated from the same
published declarations that API Extractor already checks.

Scope

Generate reader-facing method reference for:

  • @stacklok/mecatl-sdk; and
  • @stacklok/mecatl-sdk/node.

Do not generate symbol pages for @stacklok/mecatl-sdk/gen. That entry point is
protobuf-generated and should link to the existing protocol reference.

The generator must consume the built public declarations and their TSDoc. API
Extractor's document model plus API Documenter is the preferred implementation
because API Extractor already defines the compatibility boundary. First verify that
it represents the /node subpath without ambiguous or duplicated canonical pages.
If it cannot, use TypeDoc over the same built declaration entry points while keeping
API Extractor as the public-surface compatibility gate.

Documentation requirements

  • Add complete TSDoc for the generated public surface, including summaries,
    parameters, return values, lifecycle constraints, and thrown typed errors where
    applicable.
  • Generate deterministic Docusaurus-compatible Markdown under
    user-docs/reference/typescript-sdk-api/.
  • Add a hand-written reference landing page that explains the entry points and
    routes readers to the generated symbols, the task-oriented guides, and the
    protocol reference.
  • Mark generated files clearly and document their owning source and regeneration
    command in user-docs/_README.md.
  • Do not copy generated signatures into the task-oriented pages from Document TypeScript SDK workflows under Building #1391.

Task integration

  • Add sdk:docs to regenerate the committed SDK reference.
  • Add sdk:docs:check to generate in a temporary directory and fail when the
    committed output differs.
  • Bind sdk:docs into the root task docs workflow alongside
    docs:configref and docs:check.
  • Run sdk:docs:check in CI so stale output fails without silently modifying the
    checkout.
  • Keep task site:build as the rendered-link and Docusaurus compatibility gate.

Acceptance criteria

  • Every exported public method, function, class, interface, option, and error in
    . and ./node is reachable from the generated reference.
  • Included public declarations have useful TSDoc; the check fails when required
    documentation is absent.
  • The generated output distinguishes the transport-neutral and Node/Bun entry
    points without creating competing canonical pages for shared symbols.
  • ./gen is excluded and linked to the canonical gRPC/protobuf reference.
  • Re-running task sdk:docs is deterministic and leaves a clean worktree.
  • task sdk:docs:check detects stale or missing generated output.
  • Root task docs refreshes the SDK reference before running documentation
    checks.
  • CI runs the non-mutating freshness check.
  • task sdk:api:check, task docs, and task site:build pass.

Out of scope

  • Replacing API Extractor as the SDK compatibility gate.
  • Generating tutorials or task-oriented prose.
  • Publishing the generated protobuf-es declaration tree as a second API reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions