@@ -129,37 +129,37 @@ export default class Docs {
129129 if ( this . location !== "/" ) {
130130
131131 // default readme
132- fileTree . add ( {
132+ fileTree . add ( new File ( {
133133 "path" : "README.md" ,
134134 "sources" : await ejs . renderFile ( readmeTmpl , options ) ,
135- } ) ;
135+ } ) ) ;
136136 }
137137 else {
138138
139139 // copy root readme
140140 if ( await pathExists ( this . #package. root + "/README.md" ) ) {
141- fileTree . add ( {
141+ fileTree . add ( new File ( {
142142 "path" : "README.md" ,
143143 "sources" : fs . readFileSync ( this . #package. root + "/README.md" ) ,
144- } ) ;
144+ } ) ) ;
145145 }
146146
147147 // default readme
148148 else {
149- fileTree . add ( {
149+ fileTree . add ( new File ( {
150150 "path" : "README.md" ,
151151 "sources" : await ejs . renderFile ( readmeTmpl , options ) ,
152- } ) ;
152+ } ) ) ;
153153 }
154154 }
155155 }
156156
157157 // generate default sidebar
158158 if ( ! ( await pathExists ( this . locationPath + "/_sidebar.md" ) ) ) {
159- fileTree . add ( {
159+ fileTree . add ( new File ( {
160160 "path" : "_sidebar.md" ,
161161 "sources" : await ejs . renderFile ( utils . resolve ( "#resources/templates/docs/_sidebar.md" , import . meta. url ) , options ) ,
162- } ) ;
162+ } ) ) ;
163163 }
164164
165165 await fileTree . write ( this . locationPath ) ;
@@ -230,10 +230,10 @@ export default class Docs {
230230
231231 // lint
232232 if ( lint ) {
233- for ( const file of fileTree ) {
233+ for ( const path of fileTree . keys ( ) ) {
234234 const res = await lintFile (
235235 new File ( {
236- "path" : this . locationPath + "/" + file . path ,
236+ "path" : this . locationPath + "/" + path ,
237237 } ) ,
238238 {
239239 "write" : true ,
@@ -257,10 +257,10 @@ export default class Docs {
257257
258258 // TODO: replace relative urls
259259
260- fileTree . add ( {
260+ fileTree . add ( new File ( {
261261 "path" : "README.md" ,
262262 "sources" : await ejs . renderFile ( template , options ) ,
263- } ) ;
263+ } ) ) ;
264264
265265 await fileTree . write ( this . #package. root ) ;
266266 }
0 commit comments