Skip to content
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

fix: fix @react-native-community/cli-platform-* packages not being found in monorepos #47308

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tido64
Copy link
Collaborator

@tido64 tido64 commented Oct 30, 2024

Summary:

Fix @react-native-community/cli-platform-* packages not being found in monorepos.

Note that we are making the assumption that process.cwd() returns the project root. This is the same assumption that @react-native-community/cli makes. Specifically, findProjectRoot() has an optional argument that defaults to process.cwd():

As far as I can see, the project root argument is only ever used in tests.

Changelog:

[GENERAL] [FIXED] - Fix @react-native-community/cli-platform-* packages not being found in monorepos

Test Plan:

  1. Clone/check out this branch: chore: bump react-native to 0.76 microsoft/rnx-kit#3409
  2. Cherry-pick fix: fix @react-native-community/cli not being found in monorepos #47304
  3. Cherry-pick fix: fix @react-native-community/cli-platform-* packages not being found in monorepos #47308
  4. Run react-native config inside packages/test-app
  5. Verify that projects is populated

Before:

  "healthChecks": [],
  "platforms": {},
  "assets": [],
  "project": {}
}

After:

  "healthChecks": [],
  "platforms": {
    "ios": {},
    "android": {}
  },
  "assets": [],
  "project": {
    "ios": {
      "sourceDir": "/~/packages/test-app/ios",
      "xcodeProject": {
        "name": "SampleCrossApp.xcworkspace",
        "path": ".",
        "isWorkspace": true
      },
      "automaticPodsInstallation": false,
      "assets": []
    },
    "android": {
      "sourceDir": "/~/packages/test-app/android",
      "appName": "app",
      "packageName": "com.msft.identity.client.sample.local",
      "applicationId": "com.msft.identity.client.sample.local",
      "mainActivity": "com.microsoft.reacttestapp.MainActivity",
      "assets": []
    }
  }
}

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Microsoft Partner: Microsoft Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Oct 30, 2024
@tido64 tido64 changed the title fix: fix @react-native-community/cli-platform-* packages not being found in pnpm setups fix: fix @react-native-community/cli-platform-* packages not being found in monorepos Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Microsoft Partner: Microsoft Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants