Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

docs(site): TypeScript API reference generated from the SDK barrels (TypeDoc)

yhh8851d3da46e6
diff --git a/docs/SITE.md b/docs/SITE.md
index eaeaffc92..122974ad7 100644
--- a/docs/SITE.md
+++ b/docs/SITE.md
@@ -1,8 +1,10 @@
# Building the Estella Docs Site
The published documentation site ([estellaengine.com/docs](https://estellaengine.com/docs))
-is built with **Astro Starlight** (guides) and **Doxygen** (C++ API reference),
-merged into a single static bundle.
+is built with **Astro Starlight** (guides), **TypeDoc** (TypeScript API reference,
+generated at build time from the SDK's public barrels via `starlight-typedoc` —
+the pages land in `docs/astro/src/content/docs/api-ts/`, which is gitignored) and
+**Doxygen** (C++ API reference), merged into a single static bundle.
The Starlight site lives in `docs/astro/` and the landing page in `docs/landing/`.
The Doxygen API version (`PROJECT_NUMBER`) is injected at build time from
diff --git a/docs/astro/.gitignore b/docs/astro/.gitignore
new file mode 100644
index 000000000..9d80ecd28
--- /dev/null
+++ b/docs/astro/.gitignore
@@ -0,0 +1,2 @@
+# Generated at build time by starlight-typedoc from the SDK public barrels.
+src/content/docs/api-ts/
diff --git a/docs/astro/astro.config.mjs b/docs/astro/astro.config.mjs
index 238f1527d..617fda4ed 100644
--- a/docs/astro/astro.config.mjs
+++ b/docs/astro/astro.config.mjs
@@ -1,6 +1,7 @@
// @ts-check
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
+import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc';
// The site is deployed under estellaengine.com/docs (docs.yml merges this build
// into docs/dist/docs/), so everything is served from the /docs base path.
@@ -18,6 +19,26 @@ export default defineConfig({
root: { label: 'English', lang: 'en' },
'zh-cn': { label: '简体中文', lang: 'zh-CN' },
},
+ plugins: [
+ // TS API reference GENERATED from the SDK's public barrels — the same
+ // source the npm package ships, so the reference cannot drift from the
+ // code (the guides stay hand-written; this is the exhaustive surface).
+ starlightTypeDoc({
+ entryPoints: [
+ '../../sdk/src/index.ts',
+ '../../sdk/src/physics/index.ts',
+ '../../sdk/src/spine/index.ts',
+ ],
+ tsconfig: '../../sdk/tsconfig.json',
+ output: 'api-ts',
+ sidebar: { label: 'TypeScript API', collapsed: true },
+ typeDoc: {
+ excludePrivate: true,
+ excludeInternal: true,
+ excludeExternals: true,
+ },
+ }),
+ ],
social: [
{ icon: 'github', label: 'GitHub', href: 'https://github.com/esengine/estella' },
{ icon: 'discord', label: 'Discord', href: 'https://discord.gg/sAX6PXZ9' },
@@ -100,6 +121,7 @@ export default defineConfig({
label: 'Reference',
translations: { 'zh-CN': '参考' },
items: [
+ typeDocSidebarGroup,
{ label: 'C++ API (Doxygen)', link: '/docs/api/html/', attrs: { target: '_blank' } },
{ label: 'Architecture', link: 'https://github.com/esengine/estella/blob/master/docs/ARCHITECTURE.md' },
],
diff --git a/docs/astro/package.json b/docs/astro/package.json
index cb785a495..2d1eec035 100644
--- a/docs/astro/package.json
+++ b/docs/astro/package.json
@@ -13,6 +13,9 @@
"dependencies": {
"@astrojs/starlight": "^0.41.1",
"astro": "^7.0.4",
- "sharp": "^0.35.2"
+ "sharp": "^0.35.2",
+ "starlight-typedoc": "^0.23.0",
+ "typedoc": "^0.28.20",
+ "typedoc-plugin-markdown": "^4.12.0"
}
}