Skip to content

Commit

Permalink
feat: update typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN committed Aug 28, 2024
1 parent 417f1d2 commit 28da5e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"ts-plugin-type-coverage": "^2.29.2",
"tslib": "2.4.0",
"type-coverage": "^2.29.1",
"typedoc": "^0.24.8",
"typedoc": "^0.26.6",
"typescript": "^4.8.4"
},
"devDependencies": {
Expand Down
21 changes: 11 additions & 10 deletions src/doc/doc.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import { join } from 'path'
import { Application, TSConfigReader, TypeDocReader } from 'typedoc'
import { Application, OptionDefaults, TSConfigReader, TypeDocReader } from 'typedoc'

import { SOURCE_FOLDER } from '../consts'

export async function doc(entries?: string[]) {
const root = process.cwd()
const outputDir = join(root, 'docs')
const app = new Application()

app.options.addReader(new TSConfigReader())
app.options.addReader(new TypeDocReader())

const entryPoints = (entries || [join(SOURCE_FOLDER, 'index.ts')]).map(entry => join(root, entry))

app.bootstrap({
const app = await Application.bootstrap({
excludeNotDocumented: true,
excludePrivate: true,
excludeExternals: true,
blockTags: [
...OptionDefaults.blockTags,
'@priority',
'@emits',
'@listens',
'@constructor'
],
entryPoints
})
}, [new TSConfigReader(), new TypeDocReader()])

const project = app.convert()
const project = await app.convert()

if (!project) throw new Error('Failed to generate docs')

Expand Down

0 comments on commit 28da5e0

Please sign in to comment.