Skip to content

Commit f23b33b

Browse files
SoliEstreclaude
andcommitted
docs: API 레퍼런스 TypeDoc 자동생성 전환 (수기 → 자동)
- packages/docs 에 typedoc + typedoc-plugin-markdown + typedoc-vitepress-theme devDep 추가 - typedoc.json 신설: entry=estreuv/src/index.js(JSDoc 소스), 마크다운을 api/ 로 생성 - excludeExternals 로 LitElement/DOM 상속 멤버 제외 (EstreUVElement 9499→461줄) - docs:api 스크립트 추가, prebuild 훅으로 빌드 시 자동 재생성 - .vitepress/config.js: 생성된 api/typedoc-sidebar.json 을 사이드바로 로드 (없을 때 폴백) - 수기 api/index.md 제거, 생성 산출물 api/ 는 .gitignore 처리 (types/ 와 동일 정책) - 검증: vitepress build 통과(데드링크 0), estreuv 테스트 39 passed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent aa43526 commit f23b33b

6 files changed

Lines changed: 287 additions & 68 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ packages/*/types/
1212
*.tsbuildinfo
1313
.vitepress/cache/
1414
.vitepress/dist/
15+
16+
# TypeDoc-generated API reference (regenerated by `npm run docs:api`, see packages/docs/typedoc.json)
17+
# The sidebar (api/typedoc-sidebar.json) lives inside this dir and is covered too.
18+
packages/docs/api/

package-lock.json

Lines changed: 234 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docs/.vitepress/config.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
import { defineConfig } from 'vitepress';
2+
import { createRequire } from 'node:module';
3+
4+
// TypeDoc (typedoc-vitepress-theme) writes the API sidebar to
5+
// `typedoc-sidebar.json` at build time. It is a generated artifact (gitignored),
6+
// so load it defensively: a fresh checkout has no file until `npm run docs:api`
7+
// runs (wired into `prebuild`). Fall back to a single link when absent.
8+
const require = createRequire(import.meta.url);
9+
let apiSidebar = [{ text: 'API reference', link: '/api/' }];
10+
try {
11+
apiSidebar = require('../api/typedoc-sidebar.json');
12+
} catch {
13+
// not generated yet — keep the fallback
14+
}
215

316
// EstreUV.js — standalone docs site. EstreUV-centric; references EstreUI
417
// where the pairing matters. (EstreUI has its own site; EstreUX covers both.)
@@ -76,9 +89,7 @@ export default defineConfig({
7689
items: [{ text: 'Pairing with EstreUI', link: '/guide/pairing' }],
7790
},
7891
],
79-
'/api/': [
80-
{ text: 'API reference', link: '/api/' },
81-
],
92+
'/api/': apiSidebar,
8293
},
8394

8495
socialLinks: [

0 commit comments

Comments
 (0)