Skip to content

[Codegen] Hidden folder detection skips all files when workspace path contains hidden directory (e.g. ~/.jenkins/) #55243

Description

@dinisnunes1

Description

Summary

The codegen's findFilesWithExtension() function incorrectly skips all .mm files when the project workspace is located under a hidden directory (e.g., ~/.jenkins/, ~/.buildkite/, ~/.circleci/). This causes third-party Fabric components to not be registered in RCTThirdPartyComponentsProvider.mm.

Affected Versions

  • React Native 0.79.x (confirmed)
  • React Native 0.81.x (confirmed - code moved to generateRCTThirdPartyComponents.js)

Root Cause

In generate-artifacts-executor.js, the hidden folder check uses:

if (absolutePath.includes(`${path.sep}.`) && !absolutePath.includes(`${path.sep}.pnpm`)) {                                                                                                                                             
  return null;                                                                                                                                                                                                                         
}

This checks if /. appears anywhere in the entire path, not just the current filename. When the workspace is under ~/.jenkins/workspace/..., every file path contains /.jenkins, triggering the exclusion.

Suggested Fix

Change the check to examine only the current file/folder name:

if (file.startsWith('.') && file !== '.pnpm') {                                                                                                                                                                                        
    return null;                                                                                                                                                                                                                         
  }

This correctly skips hidden folders like .git while allowing files under workspace paths like ~/.jenkins/.

Steps to reproduce

  1. Set up a React Native project with New Architecture enabled
  2. Add a third-party Fabric component (e.g., @shopify/flash-list)
  3. Build from a workspace under a hidden directory (e.g., ~/.jenkins/workspace/project/)
  4. Run pod install and check the generated RCTThirdPartyComponentsProvider.mm

Expected: File contains component mappings (e.g., AutoLayoutView, CellContainer)
Actual: File contains no third-party component mappings

React Native Version

0.79.4

Affected Platforms

Runtime - iOS

Areas

Codegen

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.7.2
  CPU: (12) arm64 Apple M2 Pro
  Memory: 11.61 GB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.17.0
    path: /Users/administrator/.nodenv/versions/22.17.0/bin/node
  Yarn:
    version: 1.22.22
    path: /Users/administrator/.nodenv/versions/22.17.0/bin/yarn
  npm:
    version: 10.9.2
    path: /Users/administrator/.nodenv/versions/22.17.0/bin/npm
  Watchman:
    version: 2025.04.14.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.1
      - iOS 26.1
      - macOS 26.1
      - tvOS 26.1
      - visionOS 26.1
      - watchOS 26.1
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11255304
  Xcode:
    version: 26.1.1/17B100
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.4.3
    path: /Users/administrator/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 18.0.1
    wanted: 18.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.4
    wanted: 0.79.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

## No Match found when crawling [Codegen]

[36m�[1m[Codegen]�[0m Generated artifact: /Users/administrator/.jenkins/workspace/Builds/Custom_Build/ios/build/generated/ios/RCTThirdPartyComponentsProvider.h�[0m
�[36m�[1m[Codegen]�[0m Generating RCTThirdPartyComponentsProvider.mm�[0m
�[36m�[1m[Codegen]�[0m Crawling @braze/react-native-sdk library for components�[0m
�[36m�[1m[Codegen]�[0m Crawling @react-native-picker/picker library for components�[0m
�[36m�[1m[Codegen]�[0m Crawling @sentry/react-native library for components�[0m
�[36m�[1m[Codegen]�[0m Crawling @shopify/flash-list library for components�[0m
�[36m�[1m[Codegen]�[0m Crawling lottie-react-native library for components�[0m
�[36m�[1m[Codegen]�[0m Crawling react-native-webview library for components�[0m
�[36m�[1m[Codegen]�[0m Generated artifact: /Users/administrator/.jenkins/workspace/Builds/Custom_Build/ios/build/generated/ios/RCTThirdPartyComponentsProvider.mm�[0m

MANDATORY Reproducer

N/A (it's a build issue and using the template will use Github Actions and will not reproduce the issue - it happen only on CI tools with their default installation path at ~/.jenkins or ~/.buildkite or ~/.circleci)

Screenshots and Videos

Example of the codegen crawling failing due to the .jenkins absolute path

Image

Expected codegen crawling matches (working with the suggested fix)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: FixedA PR that fixes this issue has been merged.Type: New ArchitectureIssues and PRs related to new architecture (Fabric/Turbo Modules)Type: Unsupported VersionIssues reported to a version of React Native that is no longer supported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions