From dd3f2343d533c8f311b1196e3214ad9f6797cde6 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 30 Oct 2024 19:12:15 +0000 Subject: [PATCH] chore: remove compodoc and replace with jsdoc --- .jsdoc.js | 2 +- package.json | 4 ++-- src/generator/docs.ts | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.jsdoc.js b/.jsdoc.js index 6f9d0019df..bb6e766f69 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -43,4 +43,4 @@ module.exports = { markdown: { idInHeadings: true, }, -}; +}; \ No newline at end of file diff --git a/package.json b/package.json index eff5733388..90852ff62c 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", @@ -79,10 +79,10 @@ "execa": "^5.0.0", "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", - "js-green-licenses": "^4.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 fd72500b8b..234ab3e2c3 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 = { @@ -53,14 +54,14 @@ export async function main() { const q = new Q({concurrency: 50}); console.log(`Generating docs for ${dirs.length} APIs...`); let i = 0; - const promises = dirs.map(dir => { + const promises = dirs.map(async dir => { return q .add(() => gfs.execa(process.execPath, [ '--max-old-space-size=8192', './node_modules/.bin/jsdoc', '-c', - `.jsdoc.js`, + '.jsdoc.js', ]) ) .then(() => {