Skip to content

Commit

Permalink
fix typedoc setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls committed Sep 24, 2024
1 parent f91e32f commit c145027
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
33 changes: 11 additions & 22 deletions packages/thirdweb/scripts/typedoc.mjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
// @ts-check
import TypeDoc from "typedoc";

/**
*
* Generate a documentation JSON file for a project
* @param {{ entryPoints: string[]; exclude: string[]; }} options
*/
async function typedoc(options) {
const jsonOut = "typedoc/documentation.json";
const jsonOut = "typedoc/documentation.json";

const app = await TypeDoc.Application.bootstrapWithPlugins({
entryPoints: options.entryPoints,
excludeInternal: true,
exclude: options.exclude,
});

const project = await app.convert();
if (!project) {
throw new Error("Failed to create project");
}

await app.generateJson(project, jsonOut);
}

typedoc({
const app = await TypeDoc.Application.bootstrapWithPlugins({
entryPoints: ["src/exports/**/*.ts", "src/extensions/modules/**/index.ts"],
exclude: [
"src/exports/*.native.ts",
Expand All @@ -33,4 +13,13 @@ typedoc({
"src/**/*.test.tsx",
"src/**/*.bench.ts",
],
excludeInternal: true,
tsconfig: "tsconfig.typedoc.json",
});

const project = await app.convert();
if (!project) {
throw new Error("Failed to create project");
}

await app.generateJson(project, jsonOut);
16 changes: 16 additions & 0 deletions packages/thirdweb/tsconfig.typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "./tsconfig.base.json",
"include": ["src"],
"exclude": [
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/**/*.test-d.ts",
"src/**/*.bench.ts",
"src/**/*.macro.ts"
],
"compilerOptions": {
"moduleResolution": "NodeNext",
"sourceMap": true,
"rootDir": "./src"
}
}

0 comments on commit c145027

Please sign in to comment.