Skip to content

Commit

Permalink
cooy over /api.ts files as /index.ts so that we get nicer API docs paths
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Oct 8, 2024
1 parent 7d41b1e commit 58ee0c1
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tools/build_api_docs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,26 @@ async function produceDocs(packageDir, outputDirectory) {

const readmePath = packageDir + "/README.md";

// copy the /api.ts files to /index.ts so that we get nicer paths
const files = [
packageDir + "/src/engine/api.ts",
packageDir + "/src/engine-components/api.ts",
packageDir + "/src/engine-components-experimental/api.ts",
packageDir + "/src/engine-schemes/api.ts",
]

for (const file of files) {
const indexFile = file.replace(/\/([^/]+)\.ts$/, "/index.ts");
fs.copyFileSync(file, indexFile);
}

const app = await TypeDoc.Application.bootstrapWithPlugins({
lang: "en",
entryPoints: [
packageDir + "/src/engine/api.ts",
packageDir + "/src/engine-components/api.ts",
packageDir + "/src/engine-components-experimental/api.ts",
packageDir + "/src/engine-schemes/api.ts",
packageDir + "/src/engine",
packageDir + "/src/engine-components",
packageDir + "/src/engine-components-experimental",
packageDir + "/src/engine-schemes",
packageDir + "/src/needle-engine.ts",
],
tsconfig: "./tools/api-plugins/tsconfig.json",
Expand Down

0 comments on commit 58ee0c1

Please sign in to comment.