diff --git a/package-lock.json b/package-lock.json index 3e6cc8e..fe7a0ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,8 @@ "globals": "^17.6.0", "husky": "^9.1.7", "lint-staged": "^17.0.5", - "prettier": "^3.8.3" + "prettier": "^3.8.3", + "typedoc-plugin-missing-exports": "^4.1.3" } }, "node_modules/@actions/core": { @@ -2605,18 +2606,6 @@ "hast-util-to-html": "^9.0.5" } }, - "node_modules/@shikijs/engine-javascript": { - "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.23.0.tgz", - "integrity": "sha512-aHt9eiGFobmWR5uqJUViySI1bHMqrAgamWE1TYSUoftkAeCCAiGawPMwM+VCadylQtF4V3VNOZ5LmfItH5f3yA==", - "extraneous": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "3.23.0", - "@shikijs/vscode-textmate": "^10.0.2", - "oniguruma-to-es": "^4.3.4" - } - }, "node_modules/@shikijs/engine-oniguruma": { "version": "3.23.0", "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz", @@ -8074,6 +8063,16 @@ "typedoc": "0.28.x" } }, + "node_modules/typedoc-plugin-missing-exports": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-4.1.3.tgz", + "integrity": "sha512-tgrlnwzXbqMP2/3BaZk0atddPsD7UnpCoeQ0cUCtk624gODT1bLYOLBEJLXQyVmbnP8HZCMhHpRiR+rxSdZqhg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "typedoc": "^0.28.1" + } + }, "node_modules/typescript": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", diff --git a/package.json b/package.json index 6b69897..0363fbf 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "globals": "^17.6.0", "husky": "^9.1.7", "lint-staged": "^17.0.5", - "prettier": "^3.8.3" + "prettier": "^3.8.3", + "typedoc-plugin-missing-exports": "^4.1.3" } } diff --git a/plugins/processor/index.mjs b/plugins/processor/index.mjs index eacf6b1..840e8f7 100644 --- a/plugins/processor/index.mjs +++ b/plugins/processor/index.mjs @@ -6,6 +6,7 @@ import { applySourceMetadata } from './source.mjs'; import { DocKitRouter } from './router.mjs'; import { sidebar } from './site.mjs'; import { createTypeMap } from './typeMap.mjs'; +import { categoryForReflection } from '../shared/categories.mjs'; /** * @param {import('typedoc-plugin-markdown').MarkdownApplication} app @@ -40,6 +41,35 @@ export function load(app) { applySourceMetadata(context.project); }); + app.converter.on(Converter.EVENT_RESOLVE_END, context => { + const project = context.project; + + const internalModules = project.children?.filter( + c => c.name === '' + ); + if (internalModules) { + internalModules.forEach(internalModule => { + const importantTypes = []; + const noiseTypes = []; + + if (internalModule.children) { + internalModule.children.forEach(child => { + if (categoryForReflection(child)) { + importantTypes.push(child); + } else { + noiseTypes.push(child); + } + }); + } + + noiseTypes.forEach(noise => project.removeReflection(noise)); + internalModule.children = importantTypes; + + project.mergeReflections(internalModule, project); + }); + } + }); + app.renderer.on(Renderer.EVENT_END, () => { // doc-kit resolves custom type annotations from this map while generating // HTML, so use the final router URLs instead of recomputing paths here. diff --git a/scripts/markdown.mjs b/scripts/markdown.mjs index 6a09489..f0450fd 100644 --- a/scripts/markdown.mjs +++ b/scripts/markdown.mjs @@ -9,6 +9,7 @@ const app = await Application.bootstrapWithPlugins({ // Plugins plugin: [ 'typedoc-plugin-markdown', + 'typedoc-plugin-missing-exports', './plugins/processor/index.mjs', './plugins/theme/index.mjs', ], @@ -28,6 +29,7 @@ const app = await Application.bootstrapWithPlugins({ modulesFileName: 'index', entryFileName: 'index', tsconfig: 'tsconfig.json', + excludeExternals: true, }); const project = await app.convert();