From 91d034533e9f52232b351bb88b2ae7b48704e68f Mon Sep 17 00:00:00 2001 From: Kirill Novikov Date: Wed, 12 Mar 2025 11:55:00 -0700 Subject: [PATCH] Allow the .pnpm folder to be discovered during code generation (#49983) Summary: This PR (https://github.com/facebook/react-native/pull/48182) introduced skipping hidden folders during Codegen generation. However, when using pnpm, all files are stored in the `.pnpm` folder (see explanation here: https://pnpm.io/symlinked-node-modules-structure). As a result, some libraries that support the new architecture but lack the `ios.codegenConfig.componentProvider` field - like [FlashList](https://github.com/Shopify/flash-list/blob/main/package.json) - will be skipped during Codegen generation. This PR explicitly includes `.pnpm` to prevent this issue. ## Changelog: [iOS][Fixed] - Check .pnpm folder when looking for third-party components. Pull Request resolved: https://github.com/facebook/react-native/pull/49983 Test Plan: Tested on: RN 0.78.0 PNPM: 10 Flashlist: 1.7.3 Reviewed By: cipolleschi Differential Revision: D71047936 Pulled By: cortinico fbshipit-source-id: fa9caab23dea8c92ef5f23c997812d348eb19e08 --- .../scripts/codegen/generate-artifacts-executor.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor.js b/packages/react-native/scripts/codegen/generate-artifacts-executor.js index 482436f3a1a..de9ca6ae020 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor.js @@ -833,8 +833,11 @@ function findFilesWithExtension(filePath, extension) { return null; } - // Skip hidden folders, that starts with `.` - if (absolutePath.includes(`${path.sep}.`)) { + // Skip hidden folders, that starts with `.` but allow `.pnpm` + if ( + absolutePath.includes(`${path.sep}.`) && + !absolutePath.includes(`${path.sep}.pnpm`) + ) { return null; }