Skip to content

Commit a7d5e3a

Browse files
committed
fix(docs): do not serialize path metadata
1 parent abe4ac3 commit a7d5e3a

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

src/compiler/docs/generate-json-docs.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
import * as d from '../../declarations';
22

33
export async function generateJsonDocs(compilerCtx: d.CompilerCtx, jsonOutputs: d.OutputTargetDocsJson[], docsData: d.JsonDocs) {
4-
const jsonContent = JSON.stringify(docsData, null, 2);
4+
const json = {
5+
...docsData,
6+
components: docsData.components.map(cmp => ({
7+
tag: cmp.tag,
8+
readme: cmp.readme,
9+
docs: cmp.docs,
10+
usage: cmp.usage,
11+
props: cmp.props,
12+
methods: cmp.methods,
13+
events: cmp.events,
14+
styles: cmp.styles,
15+
}))
16+
};
17+
const jsonContent = JSON.stringify(json, null, 2);
518
await Promise.all(jsonOutputs.map(async jsonOutput => {
619
await compilerCtx.fs.writeFile(jsonOutput.file, jsonContent);
720
}));

src/declarations/docs.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export interface JsonDocs {
1212

1313

1414
export interface JsonDocsComponent {
15-
dirPath: string;
16-
fileName: string;
17-
filePath: string;
18-
readmePath: string;
19-
usagesDir: string;
15+
dirPath?: string;
16+
fileName?: string;
17+
filePath?: string;
18+
readmePath?: string;
19+
usagesDir?: string;
2020

2121
tag: string;
2222
readme: string;

0 commit comments

Comments
 (0)