Ignore generated docs

This commit is contained in:
Max Lynch 2021-09-24 14:36:54 -05:00
parent 3c35fa6df0
commit d542cab7a4
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ node_modules/
aot/ aot/
scripts/ionic-native-bower scripts/ionic-native-bower
scripts/docs-json/*.json scripts/docs-json/*.json
scripts/docs-json/typedoc-docs
dist/ dist/
src/@ionic-native/plugins/**/ngx src/@ionic-native/plugins/**/ngx
*.d.ts *.d.ts

View File

@ -20,6 +20,7 @@ interface Plugin {
} }
const rootDir = resolve(__dirname, '../..'); const rootDir = resolve(__dirname, '../..');
const typedocDocsTmp = resolve(__dirname, 'typedoc-docs');
const typedocTmp = resolve(__dirname, 'typedoc.tmp.json'); const typedocTmp = resolve(__dirname, 'typedoc.tmp.json');
const pluginsDir = resolve(rootDir, 'src/@ionic-native/plugins'); const pluginsDir = resolve(rootDir, 'src/@ionic-native/plugins');
const typedoc = new Application(); const typedoc = new Application();
@ -42,7 +43,7 @@ async function run(pluginsDir: string) {
} }
} }
async function generateTypedoc(root: string, outputPath = typedocTmp) { async function generateTypedoc(root: string, outputPath = typedocTmp, outputDocsPath = typedocDocsTmp) {
const pluginDirs = await fs.readdir(root); const pluginDirs = await fs.readdir(root);
const paths = pluginDirs.map(dir => resolve(root, dir, 'index.ts')); const paths = pluginDirs.map(dir => resolve(root, dir, 'index.ts'));
typedoc.bootstrap({ typedoc.bootstrap({
@ -55,6 +56,7 @@ async function generateTypedoc(root: string, outputPath = typedocTmp) {
}); });
const project = typedoc.converter.convert(typedoc.getEntryPoints() ?? []); const project = typedoc.converter.convert(typedoc.getEntryPoints() ?? []);
await typedoc.generateDocs(project, outputDocsPath);
await typedoc.generateJson(project, outputPath); await typedoc.generateJson(project, outputPath);
return fs.readJson(outputPath); return fs.readJson(outputPath);