@@ -6,6 +6,7 @@ import { generateSchemaDetails } from "./helpers/generateSchemaDetails.js";
6
6
import { writeIndexFile } from "./helpers/writeIndexFile.js" ;
7
7
import { writeSchemaFile } from "./helpers/writeSchemaFile.js" ;
8
8
import { ContractSchemaType , SchemaDetails } from "./types.js" ;
9
+ import { generateNewestContractVersionDocs } from "./helpers/generateNewestContractVersionDocs.js" ;
9
10
10
11
//Note: contract file name must include term 'Contract' to be parsed
11
12
const getContractFileNames = async (
@@ -41,31 +42,6 @@ const getRecordOfNewestContractVersions = (
41
42
return newestContractVersions ;
42
43
} ;
43
44
44
- const writeNewestContractVersionDocs = async (
45
- newestContractVersions : Record <
46
- string ,
47
- { detailVersion : number ; schema : ContractSchemaType }
48
- > ,
49
- pathToDocumentationFolder : string
50
- ) => {
51
- for ( const detailType in newestContractVersions ) {
52
- const detailVersion = newestContractVersions [ detailType ] . detailVersion ;
53
- const pathToContractDocumentationFolder = path . join (
54
- `${ pathToDocumentationFolder } /${ detailType } `
55
- ) ;
56
- await writeIndexFile (
57
- pathToContractDocumentationFolder ,
58
- detailType ,
59
- detailVersion
60
- ) ;
61
-
62
- await writeSchemaFile (
63
- pathToContractDocumentationFolder ,
64
- newestContractVersions [ detailType ] . schema
65
- ) ;
66
- }
67
- } ;
68
-
69
45
export const generateDocumentation = async (
70
46
pathToContractsFolder : string ,
71
47
pathToDocumentationFolder : string
@@ -104,7 +80,7 @@ export const generateDocumentation = async (
104
80
console . log ( newestContractVersions ) ;
105
81
}
106
82
107
- writeNewestContractVersionDocs (
83
+ generateNewestContractVersionDocs (
108
84
newestContractVersions ,
109
85
pathToDocumentationFolder
110
86
) ;
0 commit comments