Generate TypeDoc API Documentation from GitHub Source#1551
Generate TypeDoc API Documentation from GitHub Source#1551RaananW wants to merge 9 commits intoBabylonJS:masterfrom
Conversation
|
snapshot for this PR available at: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/DOCS/refs/pull/1551/merge |
There was a problem hiding this comment.
Pull request overview
This PR refactors the TypeDoc generation pipeline to build API docs from the real Babylon.js TypeScript sources (via a shallow/sparse git clone) instead of CDN .d.ts files, and adds a new context-aware search UI with build-generated per-module search indices.
Changes:
- Generate TypeDoc from cloned Babylon.js repo source and adjust routing/breadcrumb behavior for
/typedocroot. - Add
TypeDocSearchoverlay with global/module/member search behavior backed by per-module JSON indices generated at build time. - Update ignore rules and scripts (including a new
cleanscript) to support the new.tempand search-index outputs.
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
lib/buildUtils/typedoc.utils.ts |
Switch TypeDoc generation to a shallow/sparse clone of Babylon.js source; add per-module search-index generation; adjust breadcrumbs and lowercase-redirect logic. |
configuration/typedoc.config.ts |
Introduce typed configuration for packages, repo, and version resolution for TypeDoc generation. |
components/typedocSearch.component.tsx |
New search overlay component with context-aware behavior and keyboard navigation. |
pages/typedoc/[[...id]].tsx |
Optional catch-all route support for /typedoc, plus embedding the search overlay. |
pages/packages/viewer/[...id].tsx |
Update viewer TypeDoc generation call signature and embed the search overlay. |
pages/typedoc/apiPage.global.scss |
Restore “Defined in” source link visibility by showing .tsd-sources li. |
.gitignore |
Ignore generated per-module API search index output under public/api-search/. |
package.json |
Add clean script for removing .temp and .next. |
package-lock.json |
Lockfile updates due to dependency/tooling changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
snapshot for this PR available at: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/DOCS/refs/pull/1551/merge |
|
Note - this partly fixes the need for BabylonJS/Babylon.js#15094 |
|
snapshot for this PR available at: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/DOCS/refs/pull/1551/merge |
Overhauls the TypeDoc API documentation pipeline to generate docs directly from the actual Babylon.js TypeScript source files instead of CDN-hosted
.d.tsdeclaration files. This produces correct GitHub source links with accurate line numbers and proper module naming.Breaking Changes
This PR does not generate the typedoc from the BABYLON namespace, which means that old typedoc links are no longer valid! There is a redirect programmed when an old link is accessed.
Motivation
Previously, API docs were generated from
.d.tsfiles fetched from a CDN, which meant:packages_dev_core_srcinstead of@babylonjs/coreWhat Changed
Source-based Generation
BabylonJS/Babylon.jsat the published npm version tag, using sparse checkout to only fetch the needed package directories.tssource, enabling native git integration for correct GitHub links with accurate line numbers@moduleJSDoc tag injection into entry point files so TypeDoc names modules as@babylonjs/core,@babylonjs/loaders, etc. instead of internal monorepo pathsContext-aware Search
Per-module Search Indices
public/api-search/<prefix>/Routing & UX Fixes
pages/typedoc/[...id].tsx→pages/typedoc/[[...id]].tsx(optional catch-all) to fix 404 on/typedocrootdisplay: none)fsusageDependency Updates
Packages Covered
@babylonjs/corepackages/dev/core@babylonjs/loaderspackages/dev/loaders@babylonjs/serializerspackages/dev/serializers@babylonjs/guipackages/dev/gui@babylonjs/materialspackages/dev/materials@babylonjs/inspectorpackages/dev/inspector@babylonjs/viewerpackages/tools/viewerKey Files
configuration/typedoc.config.ts— Package configuration and interfaceslib/buildUtils/typedoc.utils.ts— Clone, generation, search index, breadcrumbs, page datacomponents/typedocSearch.component.tsx— Context-aware search React componentpages/typedoc/[[...id]].tsx— API doc page routepages/typedoc/apiPage.global.scss— TypeDoc styling overridesBuild Notes
.tssource across all packagespublic/api-search/directory is generated at build time and gitignorednpm run cleanremoves the.tempclone directory