Skip to content

Commit

Permalink
[core] Generate list of all exports (#2801)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle authored Oct 28, 2021
1 parent c7c80bc commit 2aa2bcf
Show file tree
Hide file tree
Showing 2 changed files with 410 additions and 3 deletions.
17 changes: 14 additions & 3 deletions docs/scripts/buildApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ async function run(argv: { outputDirectory?: string }) {
// if (isExported) {
// componentsToGenerateDocs.push(component.filename);
// }
// });
// })!;

const apisToGenerate = [
'GridApi',
Expand Down Expand Up @@ -830,10 +830,21 @@ async function run(argv: { outputDirectory?: string }) {
exclude: ['**/*.test.ts'],
tsconfig: 'packages/grid/data-grid/tsconfig.json',
});
const project = app.convert();
const project = app.convert()!;

const exports = (project.children ?? []).map((child) => ({
name: child.name,
kind: child?.kindString,
}));

writePrettifiedFile(
path.resolve(workspaceRoot, 'scripts/exportsSnapshot.json'),
JSON.stringify(exports),
prettierConfigPath,
);

apisToGenerate.forEach((apiName) => {
const reflection = project!.findReflectionByName(apiName);
const reflection = project.findReflectionByName(apiName);
if (!reflection || !(reflection instanceof TypeDoc.DeclarationReflection)) {
throw new Error(`Could not find reflection for "${apiName}".`);
}
Expand Down
Loading

0 comments on commit 2aa2bcf

Please sign in to comment.