@@ -52,8 +52,23 @@ function generateRCTThirdPartyComponents(libraries, outputDir) {
52
52
53
53
const librariesToCrawl = { } ;
54
54
55
+ // Using new API explicitly or not using any config field to define components.
56
+ const componentLibrariesUsingNewApi = [ ] ;
57
+ const componentLibrariesUsingOldApi = [ ] ;
58
+
59
+ for ( const library of componentLibraries ) {
60
+ if (
61
+ library . config . ios ?. components ||
62
+ ! library . config . ios ?. componentProvider
63
+ ) {
64
+ componentLibrariesUsingNewApi . push ( library ) ;
65
+ } else {
66
+ componentLibrariesUsingOldApi . push ( library ) ;
67
+ }
68
+ }
69
+
55
70
// Old API
56
- componentLibraries . forEach ( library => {
71
+ componentLibrariesUsingOldApi . forEach ( library => {
57
72
const { config, libraryPath} = library ;
58
73
const libraryName = JSON . parse (
59
74
fs . readFileSync ( path . join ( libraryPath , 'package.json' ) ) ,
@@ -62,9 +77,6 @@ function generateRCTThirdPartyComponents(libraries, outputDir) {
62
77
librariesToCrawl [ libraryName ] = library ;
63
78
64
79
const componentsProvider = config . ios ?. componentProvider ;
65
- if ( ! componentsProvider ) {
66
- return ;
67
- }
68
80
69
81
delete librariesToCrawl [ libraryName ] ;
70
82
componentsInLibraries [ libraryName ] =
@@ -79,7 +91,7 @@ function generateRCTThirdPartyComponents(libraries, outputDir) {
79
91
} ) ;
80
92
81
93
// New API
82
- const iosAnnotations = parseiOSAnnotations ( componentLibraries ) ;
94
+ const iosAnnotations = parseiOSAnnotations ( componentLibrariesUsingNewApi ) ;
83
95
for ( const [ libraryName , annotationMap ] of Object . entries ( iosAnnotations ) ) {
84
96
const { library, components} = annotationMap ;
85
97
librariesToCrawl [ libraryName ] = library ;
0 commit comments