Skip to content

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

Open
jason810496 wants to merge 5 commits into
apache:mainfrom
jason810496:feature/ts-sdk/typescript-api-docs
Open

Add TypeScript SDK API reference docs via sphinx-js#70812
jason810496 wants to merge 5 commits 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 thread ts-sdk/docs/sphinxJsConfig.mjs Outdated
@jason810496 jason810496 removed the backport-to-v3-3-test Backport to v3-3-test label Jul 31, 2026
@jason810496
jason810496 force-pushed the feature/ts-sdk/typescript-api-docs branch from 29a9a15 to bc59b65 Compare August 3, 2026 03:48
@jason810496
jason810496 marked this pull request as ready for review August 3, 2026 08:29
@jason810496
jason810496 requested a review from uranusjr August 3, 2026 08:29
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

uv.lock on main just moved via #71039 ("Record the relaxed types-paramiko bound in uv.lock"), commit 381339d and this PR currently conflicts.

Quickest fix:

git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-lease

Automated nudge — ignore if you're not ready to rebase. This comment is updated in place on future uv.lock bumps.

@jason810496
jason810496 marked this pull request as draft August 4, 2026 10:14
@jason810496
jason810496 force-pushed the feature/ts-sdk/typescript-api-docs branch from 0c39519 to 8c185dc Compare August 4, 2026 12:42
@jason810496
jason810496 marked this pull request as ready for review August 5, 2026 02:05
@jason810496
jason810496 force-pushed the feature/ts-sdk/typescript-api-docs branch 2 times, most recently from de67e1a to bfebf21 Compare August 5, 2026 06:40
@jason810496
jason810496 requested a review from guan404ming August 6, 2026 03:25
Wrapping the referenced identifier in backticks makes it render as an
inline literal and keeps sphinxcontrib-spelling from treating the
identifier as prose, so the build no longer fails on names like
getVariableOrThrow and the spelling wordlist stays clean.
Packages whose inventory cannot be fetched (typically brand-new docs
packages not yet published) are built first precisely so that their
objects.inv exists for every other package's intersphinx mapping. The
Sphinx spelling builder never writes objects.inv, so a spellcheck-only
pre-build left the inventory missing, every other package failed
inventory resolution, and the retry logic rebuilt the whole docs set in
up to three additional full passes - the --spellcheck-only CI job ran
2h27m while the equivalent --docs-only job finished in 32m.
"abortable" is not in the spellcheck dictionary and docs prose should
not need a wordlist entry for a phrasing that can simply be avoided.
publish-docs resolves every package's version up front via
get_package_version_possibly_from_stable_txt, which knew nothing about
ts-sdk, so the "Publish documentation and validate versions" CI job
failed with "Unsupported package: ts-sdk". Fall back to the version in
ts-sdk/package.json the same way task-sdk falls back to its source
version, matching what DocsPublisher already does.
@jason810496
jason810496 force-pushed the feature/ts-sdk/typescript-api-docs branch from bfebf21 to c42a3ef Compare August 6, 2026 03:26
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