@@ -8,7 +8,7 @@ import { writeSchemaFile } from "./helpers/writeSchemaFile.js";
8
8
9
9
//Note: contract file name must include term 'Contract' to be parsed
10
10
const getContractFileNames = async (
11
- pathToContracts : string ,
11
+ pathToContracts : string
12
12
) : Promise < string [ ] > => {
13
13
const files = await readdir ( pathToContracts ) ;
14
14
@@ -17,34 +17,29 @@ const getContractFileNames = async (
17
17
18
18
export const generateDocumentation = async (
19
19
pathToContractsFolder : string ,
20
- pathToDocumentationFolder : string ,
20
+ pathToDocumentationFolder : string
21
21
) : Promise < void > => {
22
22
const contractFileNames = await getContractFileNames ( pathToContractsFolder ) ;
23
23
24
24
for ( const contractFileName of contractFileNames ) {
25
25
const { detailType, detailVersion, schema } = generateSchemaDetails (
26
26
pathToContractsFolder ,
27
- contractFileName ,
27
+ contractFileName
28
28
) ;
29
29
30
30
const pathToContractDocumentationFolder = path . join (
31
- `${ pathToDocumentationFolder } /${ detailType } /versioned/${ detailVersion } ` ,
31
+ `${ pathToDocumentationFolder } /${ detailType } /versioned/${ detailVersion } `
32
32
) ;
33
33
34
34
mkdirSync ( pathToContractDocumentationFolder , { recursive : true } ) ;
35
35
36
36
await writeIndexFile (
37
37
pathToContractDocumentationFolder ,
38
38
detailType ,
39
- detailVersion ,
39
+ detailVersion
40
40
) ;
41
41
42
- await writeSchemaFile ( pathToContractDocumentationFolder , {
43
- detailType,
44
- detailVersion,
45
- schema,
46
- } ) ;
47
-
42
+ await writeSchemaFile ( pathToContractDocumentationFolder , schema ) ;
48
43
console . log ( `Created docs for ${ contractFileName } ` ) ;
49
44
}
50
45
} ;
0 commit comments