Skip to content

Commit 04215ac

Browse files
authored
feat: generate API reference docs with typedoc (#270)
auto generate markdown API reference docs from JSDoc comments using typedoc to have an embedded docs inside node_modules. This allows AI agent skills to point to `node_modules/axiom/dist/docs/ ` for a version matched API reference <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this only changes the build pipeline and dev dependencies to generate packaged docs, without touching runtime/library logic. > > **Overview** > **Adds auto-generated API reference docs to the `axiom` package build.** The `packages/ai` `build` script now runs `typedoc` to emit markdown docs into `dist/docs`. > > Introduces `typedoc.json` to define the public entry points to document and configures markdown output (no readme, excludes private/internal/external symbols). Adds `typedoc` + `typedoc-plugin-markdown` dev dependencies and updates `pnpm-lock.yaml` accordingly. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1772b5a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 56bd7bf commit 04215ac

File tree

3 files changed

+193
-23
lines changed

3 files changed

+193
-23
lines changed

packages/ai/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"scripts": {
1212
"dev": "tsup --watch",
13-
"build": "tsup && chmod +x dist/bin.js && pnpm check:vitest-entrypoints",
13+
"build": "tsup && chmod +x dist/bin.js && typedoc && pnpm check:vitest-entrypoints",
1414
"check:vitest-entrypoints": "node ./scripts/check-vitest-entrypoints.mjs",
1515
"format": "prettier --write .",
1616
"format:check": "prettier --check .",
@@ -126,6 +126,8 @@
126126
"prettier": "catalog:",
127127
"tinyrainbow": "^2.0.0",
128128
"tsup": "catalog:",
129+
"typedoc": "^0.28.17",
130+
"typedoc-plugin-markdown": "^4.10.0",
129131
"typescript": "catalog:",
130132
"vitest": "catalog:",
131133
"zod": "catalog:"

packages/ai/typedoc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://typedoc.org/schema.json",
3+
"entryPoints": [
4+
"src/index.ts",
5+
"src/evals.ts",
6+
"src/evals/scorers.ts",
7+
"src/evals/aggregations.ts",
8+
"src/evals/online.ts",
9+
"src/config.ts",
10+
"src/feedback.ts"
11+
],
12+
"tsconfig": "tsconfig.build.json",
13+
"plugin": ["typedoc-plugin-markdown"],
14+
"out": "dist/docs",
15+
"readme": "none",
16+
"disableSources": true,
17+
"excludePrivate": true,
18+
"excludeInternal": true,
19+
"excludeExternals": true,
20+
"hideGenerator": true,
21+
"includeVersion": true
22+
}

0 commit comments

Comments
 (0)