From 19bcf8c2515a7cee47c535b129aa2c8f8f50ab09 Mon Sep 17 00:00:00 2001 From: Eli White Date: Thu, 9 Jan 2025 19:38:22 -0800 Subject: [PATCH] Include cxx modules in codegen schema (#48581) Summary: Previously the CXX only modules were not being inclued in the schema for these apps, and therefore weren't being caught by the compat check. Differential Revision: D68000360 --- .../src/cli/combine/combine-schemas-cli.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js b/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js index 3a36f6777dcdd0..ce8334b199f23f 100644 --- a/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js +++ b/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js @@ -71,11 +71,18 @@ for (const file of schemaFiles) { ); } - if ( - module.excludedPlatforms && - module.excludedPlatforms.indexOf(platform) >= 0 - ) { - continue; + const excludedPlatforms = module.excludedPlatforms?.map( + excludedPlatform => excludedPlatform.toLowerCase(), + ); + + if (excludedPlatforms != null) { + const cxxOnlyModule = + excludedPlatforms.includes('ios') && + excludedPlatforms.includes('android'); + + if (!cxxOnlyModule && excludedPlatforms.includes(platform)) { + continue; + } } modules[specName] = module;