mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
typedoc fixes
This commit is contained in:
parent
6d6fce2b95
commit
25ac01e97d
@ -17,7 +17,7 @@ const files = ['./src/lib.ts']
|
||||
// specifically point to tsconfig, otherwise TypeDoc fails
|
||||
const config = typescript.findConfigFile('./tsconfig.js', typescript.sys.fileExists)
|
||||
|
||||
const generateJson = () => {
|
||||
const generateJson = async () => {
|
||||
const spinnerTypedoc = ora('Generating TypeDoc json...').start()
|
||||
|
||||
// Setup our TypeDoc app
|
||||
@ -26,31 +26,32 @@ const generateJson = () => {
|
||||
app.options.addReader(new TypeDoc.TypeDocReader())
|
||||
|
||||
app.bootstrap({
|
||||
tsconfig: config
|
||||
tsconfig: config,
|
||||
entryPoints: files
|
||||
})
|
||||
|
||||
const src = app.expandInputFiles(files)
|
||||
const project = app.convert(src)
|
||||
|
||||
// Generate the JSON file
|
||||
app.generateJson(project, outPath)
|
||||
await app.generateJson(project, outPath)
|
||||
|
||||
// Parse and modify json output
|
||||
const jsonOrig = JSON.parse(fs.readFileSync(outPath, 'utf8'))
|
||||
const jsonOrig = await JSON.parse(fs.readFileSync(outPath, 'utf8'))
|
||||
|
||||
const jsonFinal = {
|
||||
info: {
|
||||
title: 'Ocean.js',
|
||||
description,
|
||||
version,
|
||||
sourceUrl: 'https://github.com/oceanprotocol/ocean-lib-js/blob/master/'
|
||||
sourceUrl: 'https://github.com/oceanprotocol/ocean.js/blob/main/'
|
||||
},
|
||||
...jsonOrig
|
||||
}
|
||||
|
||||
fs.writeFileSync(outPath, JSON.stringify(jsonFinal, null, 4))
|
||||
fs.writeFileSync(outPath, JSON.stringify(jsonFinal, null, 2))
|
||||
|
||||
spinnerTypedoc.succeed('Generated TypeDoc json.')
|
||||
}
|
||||
|
||||
generateJson()
|
||||
generateJson().catch(console.error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user