Fix API docs generation issue

This commit is contained in:
Vanilagy
2026-07-01 11:25:24 +02:00
parent 6c6687dfaf
commit a9441aa9a9
2 changed files with 18 additions and 1 deletions
+7
View File
@@ -31,3 +31,10 @@ jobs:
- name: Run build
run: npm run build
- name: Generate API docs
run: npm run docs:generate
# We do this because we want to surface doc-building errors early
- name: Build docs
run: vitepress build docs
+11 -1
View File
@@ -134,8 +134,18 @@ const generateDocs = (entryFiles: string[], apiConfigFile: string, dry = false)
if (aliasedDeclaration) {
const sourceFile = aliasedDeclaration.getSourceFile();
const moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile);
if (moduleSymbol) {
// If the aliased declaration lives in a module we've already visited (e.g. a
// same-file `export type { Foo }` re-export of a local declaration), recursing
// won't reach it, so add the alias symbol directly. Otherwise follow the reexport.
if (moduleSymbol && !visited.has(moduleSymbol)) {
symbols.push(...getAllExportedSymbols(moduleSymbol, visited));
} else {
// Push the aliased symbol (not the alias) so downstream sees the real
// declaration and its JSDoc rather than the empty ExportSpecifier.
const hasPublicTag = ts.getJSDocTags(aliasedDeclaration).some(tag => tag.tagName.text === 'public');
if (hasPublicTag) {
symbols.push(aliasedSymbol);
}
}
}
}