@@ -198,7 +198,19 @@ async function generateDocs(
198
198
`"mainEntryPointFilePath": "<projectFolder>/dist/esm/index.doc.d.ts"`
199
199
) ;
200
200
201
+ /**
202
+ * Exclude compat as this script is only for modular docgen.
203
+ */
204
+ const packageDirectories = (
205
+ await mapWorkspaceToPackages ( [ `${ projectRoot } /packages/*` ] )
206
+ ) . filter ( path => fs . existsSync ( path ) && ! path . includes ( '-compat' ) ) ;
207
+
201
208
try {
209
+ console . log ( `Deleting old temp directories in each package.` ) ;
210
+ for ( const dir of packageDirectories ) {
211
+ fs . rmSync ( join ( dir , 'temp' ) , { recursive : true , force : true } ) ;
212
+ }
213
+
202
214
fs . writeFileSync (
203
215
`${ projectRoot } /packages/auth/api-extractor.json` ,
204
216
authApiConfigModified
@@ -247,13 +259,9 @@ async function generateDocs(
247
259
248
260
fs . mkdirSync ( tmpDir ) ;
249
261
250
- // TODO: Throw error if path doesn't exist once all packages add markdown support.
251
- const apiJsonDirectories = (
252
- await mapWorkspaceToPackages ( [ `${ projectRoot } /packages/*` ] )
253
- )
254
- . map ( path => `${ path } /temp` )
262
+ const apiJsonDirectories = packageDirectories
263
+ . map ( path => join ( path , 'temp' ) )
255
264
. filter ( path => fs . existsSync ( path ) ) ;
256
-
257
265
for ( const dir of apiJsonDirectories ) {
258
266
const paths = await new Promise < string [ ] > ( resolve =>
259
267
glob ( `${ dir } /*.api.json` , ( err , paths ) => {
0 commit comments