Generate TypeDoc API Documentation from GitHub Source#1551
Draft
RaananW wants to merge 8 commits intoBabylonJS:masterfrom
Draft
Generate TypeDoc API Documentation from GitHub Source#1551RaananW wants to merge 8 commits intoBabylonJS:masterfrom
RaananW wants to merge 8 commits intoBabylonJS:masterfrom
Conversation
|
snapshot for this PR available at: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/DOCS/refs/pull/1551/merge |
Contributor
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!
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