@@ -8,16 +8,20 @@ const cwd = process.cwd();
88const readJson = ( path : string ) => readFile ( path , 'utf-8' ) . then ( x => JSON . parse ( x ) ) ;
99
1010export async function getPackageData ( workspace : 'core' | 'elements' | 'tools' ) {
11- const map = new Map < string , DocsPage > ( ) ;
12- const dirs = await readdir ( join ( cwd , workspace ) ) ;
13- await Promise . all ( dirs . map ( async dir => {
14- const packagePath = join ( cwd , workspace , dir ) ;
15- const packageJson = await readJson ( join ( packagePath , 'package.json' ) ) ;
16- const renderer = new DocsPage ( packageJson . name , packagePath ) ;
17- await renderer . init ( ) ;
18- map . set ( packageJson . name , renderer ) ;
19- map . set ( packageJson . name . replace ( '@patternfly/' , '' ) , renderer ) ;
20- renderer . manifest ?. getTagNames ( ) . forEach ( tagName => map . set ( tagName , renderer ) ) ;
21- } ) ) ;
22- return map ;
11+ try {
12+ const map = new Map < string , DocsPage > ( ) ;
13+ const dirs = await readdir ( join ( cwd , workspace ) ) ;
14+ await Promise . allSettled ( dirs . map ( async dir => {
15+ const packagePath = join ( cwd , workspace , dir ) ;
16+ const packageJson = await readJson ( join ( packagePath , 'package.json' ) ) ;
17+ const renderer = new DocsPage ( packageJson . name , packagePath ) ;
18+ await renderer . init ( ) ;
19+ map . set ( packageJson . name , renderer ) ;
20+ map . set ( packageJson . name . replace ( '@patternfly/' , '' ) , renderer ) ;
21+ renderer . manifest ?. getTagNames ( ) . forEach ( tagName => map . set ( tagName , renderer ) ) ;
22+ } ) ) ;
23+ return map ;
24+ } catch ( e ) {
25+ return new Map ( ) ;
26+ }
2327}
0 commit comments