Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix generated documentation #3463

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 19 additions & 9 deletions src/generator/docs.ts
Expand Up @@ -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 = {
Expand Down Expand Up @@ -52,17 +53,26 @@ export async function main() {
await gfs.writeFile(indexPath, contents);
const q = new Q({concurrency: 50});
console.log(`Generating docs for ${dirs.length} APIs...`);
console.log('execpath:', process.execPath);
let i = 0;
const promises = dirs.map(dir => {
return q
.add(() =>
gfs.execa(process.execPath, [
'--max-old-space-size=8192',
'./node_modules/.bin/compodoc',
`src/apis/${dir}`,
'-d',
`./docs/${dir}`,
])
gfs.execa(
process.execPath,
[
'--max-old-space-size=8192',
path.join(rootPath, 'node_modules/.bin/compodoc'),
// Runs within declared cwd
'.',
'-d',
path.join(docsPath, dir),
],
{
// Compodoc expects to be run in same dir as package.json
cwd: path.join(srcPath, `apis/${dir}`),
}
)
)
.then(() => {
i++;
Expand Down