@@ -78,7 +78,15 @@ export class ApiDocLoader {
7878 const llmsFile = join ( versionDir , 'llms-full.txt' ) ;
7979 if ( ! existsSync ( llmsFile ) ) continue ;
8080
81- const content = readFileSync ( llmsFile , 'utf-8' ) ;
81+ let content : string ;
82+ try {
83+ content = readFileSync ( llmsFile , 'utf-8' ) ;
84+ } catch ( err ) {
85+ throw new ApiDocsInitializationError (
86+ `Failed to read ${ llmsFile } : ${ err instanceof Error ? err . message : String ( err ) } ` ,
87+ { cause : err }
88+ ) ;
89+ }
8290
8391 // Split on "### [ComponentName](url)" headings
8492 // Each chunk starts with the heading line and contains the member list
@@ -136,11 +144,11 @@ export class ApiDocLoader {
136144 const heading = chunk . split ( '\n' ) [ 0 ] ;
137145 if ( / e n u m / i. test ( heading ) ) return 'enum' ;
138146 if ( platform === 'blazor' ) {
139- if ( / ^ # # # \[ I g b \w + E v e n t A r g s \] / m . test ( chunk ) ) return 'interface' ;
140- if ( / ^ # # # \[ I g b \w + O p t i o n s \] / m . test ( chunk ) ) return 'interface' ;
147+ if ( / ^ # # # \[ I g b \w + E v e n t A r g s \] / . test ( heading ) ) return 'interface' ;
148+ if ( / ^ # # # \[ I g b \w + O p t i o n s \] / . test ( heading ) ) return 'interface' ;
141149 }
142150 if ( platform === 'webcomponents' ) {
143- if ( / ^ # # # \[ I g c \w + E v e n t A r g s \] / m . test ( chunk ) ) return 'interface' ;
151+ if ( / ^ # # # \[ I g c \w + E v e n t A r g s \] / . test ( heading ) ) return 'interface' ;
144152 if ( / i n t e r f a c e / i. test ( heading ) ) return 'interface' ;
145153 }
146154 if ( platform === 'react' ) {
@@ -149,7 +157,7 @@ export class ApiDocLoader {
149157 if ( platform === 'angular' ) {
150158 // Angular interfaces conventionally start with I + uppercase (e.g., IGridState, IScrollStrategy)
151159 // while class names starting with Igx have a lowercase g (e.g., IgxGridComponent)
152- if ( / ^ # # # \[ I [ A - Z ] / . test ( chunk ) ) return 'interface' ;
160+ if ( / ^ # # # \[ I [ A - Z ] / . test ( heading ) ) return 'interface' ;
153161 }
154162 return 'class' ;
155163 }
0 commit comments