Skip to content

build: Use node resolver to find react native package directory #735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

morganick
Copy link
Contributor

@morganick morganick commented Sep 6, 2024

Overview

Monorepos are configured and structured on what works best for the project. Since this can vary from project to project, having a dynamic way to find dependencies will make this work for more projects. Currently, the repo only supports certain configurations of Monorepo structures. This PR adopts a similar approach as Expo to locate the react native package within the project. Expo usage for reference

This PR also falls back to the original functionality if the package cannot be resolved by node.

Test Plan

  1. yarn
  2. yarn start
  3. yarn start:android
  4. Put in a println statement to see what $reactNativePackage.parentFile is on the next build to see it working.
  5. yarn start:android

@morganick morganick marked this pull request as ready for review September 6, 2024 20:17
Copy link
Contributor

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough - thanks for the PR, and for making sure it is backwards compatible
seems to work well enough locally in my non-monorepo default case

@mikehardy mikehardy merged commit ef79980 into react-native-netinfo:master Sep 12, 2024
github-actions bot pushed a commit that referenced this pull request Sep 12, 2024
# [11.4.0](v11.3.3...v11.4.0) (2024-09-12)

### Features

* **android:** use node resolver to find react native package in monorepos ([#735](#735)) ([ef79980](ef79980))
@matt-oakes
Copy link
Collaborator

🎉 This PR is included in version 11.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@morganick morganick deleted the use-node-resolver-for-react-native-location branch September 12, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy