@@ -21,49 +21,45 @@ docVersions = renderMultiVersion
21
21
? versions . params . previousVersions . concat ( versions . params . currentVersion )
22
22
: [ versions . params . currentVersion ] ;
23
23
24
- const apiDocRenders = [ ] ;
24
+ Promise . all (
25
+ docVersions . map ( async ( version ) => {
26
+ // We don't add a version-postfix directory name for "current" version, since local website builds want to use the
27
+ // locally generated API doc models when present.
28
+ const versionPostfix = version === versions . params . currentVersion ? "" : `-${ version } ` ;
25
29
26
- docVersions . forEach ( ( version ) => {
27
- // We don't add a version-postfix directory name for "current" version, since local website builds want to use the
28
- // locally generated API doc models when present.
29
- const versionPostfix = version === versions . params . currentVersion ? "" : `-${ version } ` ;
30
+ const apiReportsDirectoryPath = path . resolve (
31
+ __dirname ,
32
+ ".." ,
33
+ ".." ,
34
+ `_api-extractor-temp${ versionPostfix } ` ,
35
+ "doc-models" ,
36
+ ) ;
30
37
31
- const apiReportsDirectoryPath = path . resolve (
32
- __dirname ,
33
- ".." ,
34
- ".." ,
35
- `_api-extractor-temp${ versionPostfix } ` ,
36
- "doc-models" ,
37
- ) ;
38
+ // TODO: remove check for 2.0 and just set apiDocsDirectoryPath to include version.
39
+ // currently publishing to base apis directory until 2.0 release
40
+ const apiDocsDirectoryPath = renderMultiVersion
41
+ ? path . resolve ( __dirname , ".." , "content" , "docs" , "api" , version )
42
+ : path . resolve ( __dirname , ".." , "content" , "docs" , "api" ) ;
38
43
39
- // TODO: remove check for 2.0 and just set apiDocsDirectoryPath to include version.
40
- // currently publishing to base apis directory until 2.0 release
41
- const apiDocsDirectoryPath = renderMultiVersion
42
- ? path . resolve ( __dirname , ".." , "content" , "docs" , "api" , version )
43
- : path . resolve ( __dirname , ".." , "content" , "docs" , "api" ) ;
44
+ // TODO: remove check for 2.0 and just set uriDirectoryPath to include version.
45
+ // currently publishing to base apis directory until 2.0 release
46
+ const uriRootDirectoryPath = renderMultiVersion ? `/docs/api/${ version } ` : `/docs/api` ;
44
47
45
- // TODO: remove check for 2.0 and just set uriDirectoryPath to include version.
46
- // currently publishing to base apis directory until 2.0 release
47
- const uriRootDirectoryPath = renderMultiVersion ? `/docs/api/${ version } ` : `/docs/api` ;
48
-
49
- apiDocRenders . push (
50
- renderApiDocumentation (
48
+ await renderApiDocumentation (
51
49
apiReportsDirectoryPath ,
52
50
apiDocsDirectoryPath ,
53
51
uriRootDirectoryPath ,
54
52
version ,
55
- ) . then ( ( ) => {
56
- console . log ( chalk . green ( `(${ version } ) API docs written!` ) ) ;
57
- } ) ,
58
- ) ;
59
- } ) ;
53
+ ) ;
60
54
61
- Promise . all ( apiDocRenders ) . then (
55
+ console . log ( chalk . green ( `(${ version } ) API docs written!` ) ) ;
56
+ } ) ,
57
+ ) . then (
62
58
( ) => {
63
59
console . log ( chalk . green ( "All API docs written!" ) ) ;
64
60
process . exit ( 0 ) ;
65
61
} ,
66
- ( error ) => {
62
+ ( ) => {
67
63
process . exit ( 1 ) ;
68
64
} ,
69
65
) ;
0 commit comments