@@ -65,6 +65,7 @@ const PREFERRED_PARAMS = [
6565
6666let authApiReportOriginal : string ;
6767let authApiConfigOriginal : string ;
68+ let appPkgOriginal : string ;
6869
6970yargs
7071 . command (
@@ -119,6 +120,14 @@ function cleanup() {
119120 authApiReportOriginal
120121 ) ;
121122 }
123+ // Restore original app/package.json
124+ if ( authApiConfigOriginal ) {
125+ console . log ( `Restoring original app/package.json contents.` ) ;
126+ fs . writeFileSync (
127+ `${ projectRoot } /packages/app/package.json` ,
128+ appPkgOriginal
129+ ) ;
130+ }
122131 for ( const excludedPackage of EXCLUDED_PACKAGES ) {
123132 if ( fs . existsSync ( `${ projectRoot } /temp/${ excludedPackage } .skip` ) ) {
124133 console . log (
@@ -198,11 +207,26 @@ async function generateDocs(
198207 `"mainEntryPointFilePath": "<projectFolder>/dist/esm2017/index.doc.d.ts"`
199208 ) ;
200209
210+ console . log ( `Temporarily modifying packages/app/package.json for docgen.` ) ;
211+ // Remove typesVersions restriction just for docgen
212+ appPkgOriginal = fs . readFileSync (
213+ `${ projectRoot } /packages/app/package.json` ,
214+ 'utf8'
215+ ) ;
216+ const appPkgModified = appPkgOriginal . replace (
217+ `./dist/typescript-not-supported.d.ts` ,
218+ `./dist/app/src/index.d.ts`
219+ ) ;
220+
201221 try {
202222 fs . writeFileSync (
203223 `${ projectRoot } /packages/auth/api-extractor.json` ,
204224 authApiConfigModified
205225 ) ;
226+ fs . writeFileSync (
227+ `${ projectRoot } /packages/app/package.json` ,
228+ appPkgModified
229+ ) ;
206230
207231 if ( skipBuild ) {
208232 await spawn ( 'yarn' , [ 'api-report' ] , {
0 commit comments