diff --git a/.jsdoc.js b/.jsdoc.js index 8fa631f6dea..bb6e766f69a 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -27,7 +27,7 @@ module.exports = { plugins: ['plugins/markdown', 'jsdoc-region-tag'], source: { excludePattern: '(^|\\/|\\\\)[._]', - include: ['src'], + include: ['build/src'], includePattern: '\\.js$', }, templates: { @@ -43,4 +43,4 @@ module.exports = { markdown: { idInHeadings: true, }, -}; +}; \ No newline at end of file diff --git a/package.json b/package.json index 37e42d7ed39..90852ff62c5 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "prepare": "npm run compile", "test": "c8 mocha build/test", "predocs": "npm run build-tools", - "docs": "node build/src/generator/docs", + "docs": "npm run compile && node build/src/generator/docs", "predocs2": "npm run compile", "docs-extract": "node --max-old-space-size=8192 ./node_modules/@microsoft/api-extractor/bin/api-extractor run --local --verbose", "docs-md": "node --max-old-space-size=8192 ./node_modules/@microsoft/api-documenter/bin/api-documenter markdown --input-folder build/docs --output-folder docs", @@ -59,7 +59,6 @@ "googleapis-common": "^7.0.0" }, "devDependencies": { - "@compodoc/compodoc": "1.1.23", "@types/execa": "^2.0.0", "@types/mocha": "^9.0.0", "@types/mv": "^2.1.0", @@ -81,6 +80,9 @@ "gaxios": "^6.0.3", "gts": "^5.0.0", "js-green-licenses": "^4.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", "linkinator": "^4.0.0", "mocha": "^9.2.2", "mv": "^2.1.1", diff --git a/src/generator/docs.ts b/src/generator/docs.ts index 85f2211ca67..d3ce59987b1 100644 --- a/src/generator/docs.ts +++ b/src/generator/docs.ts @@ -19,10 +19,11 @@ import * as path from 'path'; import {promisify} from 'util'; import Q from 'p-queue'; -const srcPath = path.join(__dirname, '../../../src'); +const rootPath = path.join(__dirname, '../../..'); +const srcPath = path.join(rootPath, 'src'); const apiPath = path.join(srcPath, 'apis'); const templatePath = path.join(srcPath, 'generator/templates/index.html.njk'); -const docsPath = path.join(__dirname, '../../../docs'); +const docsPath = path.join(rootPath, 'docs'); const indexPath = path.join(docsPath, 'index.html'); export const gfs = { @@ -58,10 +59,9 @@ export async function main() { .add(() => gfs.execa(process.execPath, [ '--max-old-space-size=8192', - './node_modules/.bin/compodoc', - `src/apis/${dir}`, - '-d', - `./docs/${dir}`, + './node_modules/.bin/jsdoc', + '-c', + '.jsdoc.js', ]) ) .then(() => {