1
1
/* eslint-disable @typescript-eslint/no-var-requires */
2
+
3
+ //TODO:
4
+ console . warn (
5
+ 'Currently there are two tag-names missing or faulty: "ui5-notification-overflow-action" and "ui5-timeline-item"\n These have to be adjusted manually!\n'
6
+ ) ;
7
+
2
8
const mainWebComponentsSpec = require ( '@ui5/webcomponents/dist/api.json' ) ;
3
9
const fioriWebComponentsSpec = require ( '@ui5/webcomponents-fiori/dist/api.json' ) ;
4
10
const dedent = require ( 'dedent' ) ;
@@ -401,9 +407,9 @@ const createWebComponentWrapper = (
401
407
[${ regularProps . map ( ( v ) => `'${ v } '` ) . join ( ', ' ) } ],
402
408
[${ booleanProps . map ( ( v ) => `'${ v } '` ) . join ( ', ' ) } ],
403
409
[${ slotProps
404
- . filter ( ( name ) => name !== 'children' )
405
- . map ( ( v ) => `'${ v } '` )
406
- . join ( ', ' ) } ],
410
+ . filter ( ( name ) => name !== 'children' )
411
+ . map ( ( v ) => `'${ v } '` )
412
+ . join ( ', ' ) } ],
407
413
[${ eventProps . map ( ( v ) => `'${ v } '` ) . join ( ', ' ) } ]
408
414
);
409
415
@@ -650,6 +656,9 @@ resolvedWebComponents.forEach((componentSpec) => {
650
656
property . name = 'children' ;
651
657
}
652
658
const propDescription = ( ) => {
659
+ if ( ! componentSpec . tagname ) {
660
+ return property . description || '' ;
661
+ }
653
662
let formattedDescription = ( property . description || '' )
654
663
. replace ( / \n \n < b r > < b r > / g, '<br/><br/>\n *\n * ' )
655
664
. replace ( / \n \n / g, '<br/><br/>\n *\n * ' )
@@ -664,7 +673,6 @@ resolvedWebComponents.forEach((componentSpec) => {
664
673
if ( extendedDescription ) {
665
674
return replaceTagNameWithModuleName ( `${ formattedDescription } ${ extendedDescription } ` ) ;
666
675
}
667
-
668
676
return replaceTagNameWithModuleName ( formattedDescription ) ;
669
677
} ;
670
678
@@ -712,14 +720,15 @@ resolvedWebComponents.forEach((componentSpec) => {
712
720
description = description . replace ( `<h3 class="comment-api-title">Overview</h3>` , '' ) ;
713
721
//strip ES6 Module import
714
722
description = description . slice ( 0 , description . indexOf ( `<h3>ES6 Module Import</h3>` ) ) ;
723
+ if ( ! componentSpec . tagname ) {
724
+ return description . split ( / (? = < h 3 > ) / , 2 ) ;
725
+ }
715
726
//replace tag-name with module-name
716
727
description = description . replace ( new RegExp ( componentSpec . tagname , 'g' ) , `${ componentSpec . module } ` ) ;
717
728
//replace other ui5 tag-names
718
729
description = replaceTagNameWithModuleName ( description ) ;
719
730
//split string by main description and rest
720
- const descriptionArray = description . split ( / (? = < h 3 > ) / , 2 ) ;
721
-
722
- return descriptionArray ;
731
+ return description . split ( / (? = < h 3 > ) / , 2 ) ;
723
732
} ;
724
733
725
734
const [ mainDescription , description = '' ] = formatDescription ( ) ;
0 commit comments