Skip to content

Add TypeScript SDK API reference docs via sphinx-js - #70812

Draft
jason810496 wants to merge 1 commit into
apache:mainfrom
jason810496:feature/ts-sdk/typescript-api-docs
Draft

Add TypeScript SDK API reference docs via sphinx-js#70812
jason810496 wants to merge 1 commit into
apache:mainfrom
jason810496:feature/ts-sdk/typescript-api-docs

Conversation

@jason810496

Copy link
Copy Markdown
Member
  • next: automate the docs publish process for TS-SDK API referecnce.

Why

The upcoming TS-SDK package has a public API that is annotated with JSDoc/TSDoc but has no rendered API reference. This adds one, built with pyodide/sphinx-js (TypeDoc-backed) and wired into the existing build-docs and publish-docs pipelines next to task-sdk.

How

  • New ts-sdk/docs/ Sphinx tree that mirrors task-sdk/docs/, swapping autoapi for sphinx-js since the source is TypeScript.
  • A single root entry point (src/index.ts) is fed to TypeDoc, so its reachability analysis documents exactly the public surface and excludes the generated/internal modules.
  • The TypeDoc toolchain is isolated in ts-sdk/docs/package.json + package-lock.json and pinned deliberately:
    • sphinx-js 5.0.3 needs TypeDoc 0.25 (its plugin breaks on TypeDoc 0.28's internal API).
    • TypeDoc 0.25 ships TypeScript 5.4, which rejects the SDK's es2023 target, so ts-sdk/docs/tsconfig.json is a standalone config forcing es2022 for the parse-only pass.
  • ts-sdk/docs/sphinxJsConfig.mjs flattens TSDoc {@link} inline tags to plain text, which sphinx-js cannot otherwise render.
  • AirflowDocsBuilder installs the pinned toolchain with npm ci (reproducible) on demand before the sphinx run, so build-docs ts-sdk works wherever Node is available (already present in the docs CI image). A failed install returns a DocBuildError for that package rather than aborting the whole run.
  • Adding sphinx-js pulls parsimonious and requires cattrs < 25, so uv.lock downgrades cattrs 26.1.0 to 24.1.3 (sphinx-js declares cattrs as a dependency).

Verification

Screenshot 2026-07-31 at 2 22 40 PM Screenshot 2026-07-31 at 2 22 52 PM

Notes for reviewers

  • The TypeDoc 0.25 pin is a version cap forced by sphinx-js 5.0.3. Per the repo convention for capped dependencies, this warrants a GitHub tracking issue (to bump TypeDoc/TypeScript once sphinx-js supports TypeDoc 0.28).
  • Another direction is we could use TypeDoc only without sphinx extension like Java-SDK did.

Was generative AI tooling used to co-author this PR?

Comment on lines +38 to +39
if (part.kind !== "text" && part.kind !== "code") {
parts[i] = { kind: "text", text: part.text ?? "" };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (part.kind !== "text" && part.kind !== "code") {
parts[i] = { kind: "text", text: part.text ?? "" };
if (part.kind !== "text" && part.kind !== "code") {
parts[i] = { kind: "code", text: "`" + (part.text ?? "") + "`" };
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets emit a markdown-style code part instead, so identifiers render as literals, skip the spellchecker, and cover it without wordlist churn

The spellcheck failure on getVariableOrThrow comes from this flatten turning {@link getVariableOrThrow} tags into plain text that `sphinxcontrib-spelling reads as prose...

@jason810496 jason810496 removed the backport-to-v3-3-test Backport to v3-3-test label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants