add typedoc

This commit is contained in:
Philipp Kühn
2020-08-17 19:08:32 +02:00
parent 3d385dbcdf
commit f1936e629a
3 changed files with 134 additions and 2 deletions

View File

@@ -1,7 +1,45 @@
const path = require('path')
const globby = require('globby')
const TypeDoc = require('typedoc')
module.exports = function (api) {
// api.loadSource(({ addCollection }) => {
// const appCollection = addCollection({ typeName: 'Package' })
// globby.sync('../packages/*', { onlyDirectories: true })
// .map(name => name.replace('../packages/', ''))
// .filter(name => name.startsWith('core'))
// .forEach(name => {
// const app = new TypeDoc.Application()
// app.options.addReader(new TypeDoc.TSConfigReader())
// app.options.addReader(new TypeDoc.TypeDocReader())
// app.bootstrap({
// ignoreCompilerErrors: true,
// experimentalDecorators: true,
// excludeExternals: true,
// excludeNotExported: true,
// excludeProtected: true,
// excludePrivate: true,
// // excludeNotDocumented: true,
// exclude: [
// "**/*.test.ts",
// "**/__tests__/*",
// "**/__mocks__/*"
// ],
// })
// const project = app.convert(app.expandInputFiles([`../packages/${name}`]))
// if (project) {
// app.generateJson(project, `api/${name}.json`)
// const json = app.serializer.projectToObject(project)
// appCollection.addNode(json)
// }
// })
// })
api.chainWebpack(config => {
config.resolve.extensions
.add('.ts')