@@ -294,7 +294,7 @@ const createMdx = async (file, component) => {
294
294
. map ( ( _type ) => `\`${ _type . trim ( ) } \`` )
295
295
. join ( ', ' )
296
296
297
- const id = `${ component . displayName . toLowerCase ( ) } -${ propName } `
297
+ const id = `${ component . displayName . toLowerCase ( ) } -${ propName . replaceAll ( / ( [ a - z ] ) ( [ A - Z ] ) / g , '$1-$2' ) . toLowerCase ( ) } `
298
298
const anchor = `<a href="#${ id } " aria-label="${ component . displayName } ${ displayName } permalink" className="anchor-link after">#</a>`
299
299
300
300
content += ` <tr id="${ id } ">\n`
@@ -340,22 +340,22 @@ const main = async () => {
340
340
try {
341
341
const files = await globby ( GLOB_PATTERNS , GLOBBY_OPTIONS )
342
342
343
- await Promise . all (
344
- files . map ( async ( file ) => {
345
- console . log ( `Processing file: ${ file } ` )
346
- let components
347
- try {
348
- components = parse ( file , DOCGEN_OPTIONS )
349
- } catch ( parseError ) {
350
- console . error ( `Failed to parse ${ file } :` , parseError )
351
- return
352
- }
343
+ for ( const file of files ) {
344
+ console . log ( `Processing file: ${ file } ` )
345
+ let components
346
+ try {
347
+ components = parse ( file , DOCGEN_OPTIONS )
348
+ } catch ( parseError ) {
349
+ console . error ( `Failed to parse ${ file } :` , parseError )
350
+ continue // Skip to the next file
351
+ }
353
352
354
- if ( components && components . length > 0 ) {
355
- await Promise . all ( components . map ( ( component ) => createMdx ( file , component ) ) )
353
+ if ( components && components . length > 0 ) {
354
+ for ( const component of components ) {
355
+ await createMdx ( file , component ) // Sequentially create MDX files
356
356
}
357
- } ) ,
358
- )
357
+ }
358
+ }
359
359
} catch ( error ) {
360
360
console . error ( 'An error occurred:' , error )
361
361
process . exit ( 1 )
0 commit comments