Repository navigation
Autogenerate TypeScript SDK method reference #1392
Description
Parent
- TypeScript SDK for mecatl (browser + Node) #761
- Prototype @stacklok/mecatl-sdk TypeScript SDK #821 M4 documentation and public-surface gates
- Document TypeScript SDK workflows under Building #1391 task-oriented SDK documentation
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 inuser-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:docsto regenerate the committed SDK reference. - Add
sdk:docs:checkto generate in a temporary directory and fail when the
committed output differs. - Bind
sdk:docsinto the roottask docsworkflow alongside
docs:configrefanddocs:check. - Run
sdk:docs:checkin CI so stale output fails without silently modifying the
checkout. - Keep
task site:buildas the rendered-link and Docusaurus compatibility gate.
Acceptance criteria
- Every exported public method, function, class, interface, option, and error in
.and./nodeis 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. -
./genis excluded and linked to the canonical gRPC/protobuf reference. - Re-running
task sdk:docsis deterministic and leaves a clean worktree. -
task sdk:docs:checkdetects stale or missing generated output. - Root
task docsrefreshes the SDK reference before running documentation
checks. - CI runs the non-mutating freshness check.
-
task sdk:api:check,task docs, andtask site:buildpass.
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.
Activity