@@ -99,26 +99,29 @@ async function generateToc() {
99
99
) ;
100
100
}
101
101
}
102
- await spawn (
103
- 'yarn' ,
104
- [
105
- 'api-documenter-devsite' ,
106
- 'toc' ,
107
- '--input' ,
108
- 'temp' ,
109
- '-p' ,
110
- '/docs/reference/js' ,
111
- '-j'
112
- ] ,
113
- { stdio : 'inherit' }
114
- ) ;
115
- console . log ( `Restoring excluded packages' json files.` ) ;
116
- for ( const excludedPackage of EXCLUDED_PACKAGES ) {
117
- if ( fs . existsSync ( `${ projectRoot } /temp/${ excludedPackage } .skip` ) ) {
118
- fs . renameSync (
119
- `${ projectRoot } /temp/${ excludedPackage } .skip` ,
120
- `${ projectRoot } /temp/${ excludedPackage } .api.json`
121
- ) ;
102
+ try {
103
+ await spawn (
104
+ 'yarn' ,
105
+ [
106
+ 'api-documenter-devsite' ,
107
+ 'toc' ,
108
+ '--input' ,
109
+ 'temp' ,
110
+ '-p' ,
111
+ '/docs/reference/js' ,
112
+ '-j'
113
+ ] ,
114
+ { stdio : 'inherit' }
115
+ ) ;
116
+ } finally {
117
+ console . log ( `Restoring excluded packages' json files.` ) ;
118
+ for ( const excludedPackage of EXCLUDED_PACKAGES ) {
119
+ if ( fs . existsSync ( `${ projectRoot } /temp/${ excludedPackage } .skip` ) ) {
120
+ fs . renameSync (
121
+ `${ projectRoot } /temp/${ excludedPackage } .skip` ,
122
+ `${ projectRoot } /temp/${ excludedPackage } .api.json`
123
+ ) ;
124
+ }
122
125
}
123
126
}
124
127
}
@@ -131,6 +134,7 @@ async function generateDocs(
131
134
const outputFolder = forDevsite ? 'docs-devsite' : 'docs' ;
132
135
const command = forDevsite ? 'api-documenter-devsite' : 'api-documenter' ;
133
136
137
+ console . log ( `Temporarily modifying auth api-extractor.json for docgen.` ) ;
134
138
// Use a special d.ts file for auth for doc gen only.
135
139
const authApiConfigOriginal = fs . readFileSync (
136
140
`${ projectRoot } /packages/auth/api-extractor.json` ,
@@ -175,6 +179,7 @@ async function generateDocs(
175
179
) ;
176
180
}
177
181
} finally {
182
+ console . log ( `Restoring original auth api-extractor.json contents.` ) ;
178
183
// Restore original auth api-extractor.json contents.
179
184
fs . writeFileSync (
180
185
`${ projectRoot } /packages/auth/api-extractor.json` ,
0 commit comments