Skip to content

Commit f64ec86

Browse files
committed
fix(docs): leave every internal entry point out of the API reference
Main added ./internal/http-data, which the generator only skipped by exact name for ./internal/config, so it would have gained a public API page. Every ./internal/* export is now skipped, and the spec checks that no internal page is generated.
1 parent 43a34b3 commit f64ec86

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/docs/api-reference.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('API reference', () => {
2424
const entries = readApiEntries(repoRoot);
2525
const hub = entries.find((entry) => entry.slug === 'hub');
2626
expect(hub?.symbols.map((s) => s.name)).toContain('initPangularHub');
27-
expect(entries.some((entry) => entry.slug === 'internal-config')).toBe(false);
27+
expect(entries.some((entry) => entry.slug.startsWith('internal-'))).toBe(false);
2828
}, 60_000);
2929

3030
it('shows inferred return types and symbols re-exported from a dependency', () => {

‎apps/docs/api-reference.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {Node, Project, ts, type JSDoc} from 'ts-morph';
1717
export const API_DIR = 'src/content/api';
1818

1919
/** Entry points that are not part of the public API. */
20-
const SKIPPED_EXPORTS = new Set(['./package.json', './internal/config', '.']);
20+
const SKIPPED_EXPORTS = new Set(['./package.json', '.']);
2121

2222
type Kind = 'class' | 'interface' | 'function' | 'const' | 'type' | 'enum';
2323

@@ -112,7 +112,8 @@ export function readApiEntries(repoRoot: string): ApiEntry[] {
112112
});
113113
const entries: ApiEntry[] = [];
114114
for (const [key, target] of Object.entries(pkg.exports)) {
115-
if (SKIPPED_EXPORTS.has(key)) continue;
115+
// `./internal/*` entries serve the panel and the extension, not apps.
116+
if (SKIPPED_EXPORTS.has(key) || key.startsWith('./internal/')) continue;
116117
const rel = typeof target === 'string' ? target : (target.import ?? target.default);
117118
if (!rel?.endsWith('.ts')) continue;
118119
const sourceFile = project.addSourceFileAtPath(join(pkgDir, rel));

0 commit comments

Comments
 (0)