fix: [Codegen] log supported apple platforms if there are any (#42819)

Summary:
This PR adds check if there are any supported platforms to log.

For built-in modules this was logging empty line (as some of them doesn't contain podspecs):

![CleanShot 2024-02-02 at 15 54 42@2x](https://github.com/facebook/react-native/assets/52801365/c7e36052-9c48-4e00-a539-6ee5d528bbee)

## Changelog:

[GENERAL] [FIXED] - Log Codegen supported platforms if any are available

Pull Request resolved: https://github.com/facebook/react-native/pull/42819

Test Plan: Run Codegen and check if it prints empty `Supported Apple platforms`

Reviewed By: cortinico

Differential Revision: D53566301

Pulled By: cipolleschi

fbshipit-source-id: 3f6b6d3b44da1ab7174432a5fac7f7d3fde11103
This commit is contained in:
Oskar Kwaśniewski
2024-02-08 09:52:55 -08:00
committed by Facebook GitHub Bot
parent 527d1931b1
commit 2ca7bec0c2
@@ -193,12 +193,18 @@ function extractSupportedApplePlatforms(dependency, dependencyPath) {
{},
);
console.log(
`[Codegen] Supported Apple platforms: ${Object.keys(supportedPlatformsMap)
.filter(key => supportedPlatformsMap[key])
.join(', ')} for ${dependency}`,
const supportedPlatformsList = Object.keys(supportedPlatformsMap).filter(
key => supportedPlatformsMap[key],
);
if (supportedPlatformsList.length > 0) {
console.log(
`[Codegen] Supported Apple platforms: ${supportedPlatformsList.join(
', ',
)} for ${dependency}`,
);
}
return supportedPlatformsMap;
}