1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-10 17:04:36 +00:00

fix: typedoc configuration fixed

This commit is contained in:
2022-03-02 00:16:30 +05:00
parent 1ee07eeecf
commit e317393132
4 changed files with 78 additions and 446 deletions

30
createTSDocs.js Normal file
View File

@@ -0,0 +1,30 @@
const td = require('typedoc')
const ts = require('typescript')
const typedocJson = require('./typedoc.json')
async function createTSDocs() {
if (!typedocJson.entryPoints?.length)
throw new Error('entryPoints option is missing in typedoc configuration.')
if (!typedocJson.out)
throw new Error('out option is missing in typedoc configuration.')
const app = new td.Application()
app.options.addReader(new td.TSConfigReader())
app.bootstrap({
...typedocJson,
tsconfig: 'tsconfig.json'
})
const project = app.converter.convert(app.getEntryPoints() ?? [])
if (project) {
await app.generateDocs(project, typedocJson.out)
} else {
throw new Error('Error creating the TS docs.')
}
}
createTSDocs()