Commit 4a29cef
fix: expose react-native-macos cli commands (#2529)
The `yarn start` command in `packages/rn-tester` was failing because the
binary name in the `react-native` package didn't match the package name
`react-native-macos`.
## Problem
- Running `yarn start` in `packages/rn-tester` resulted in "command not
found: react-native-macos"
- Users had to use `npx react-native-macos start` as a workaround
- The issue was that the `bin` field in
`packages/react-native/package.json` defined the binary as
`"react-native"` instead of `"react-native-macos"`
## Solution
1. **Updated binary name**: Changed the `bin` field in
`packages/react-native/package.json` from `"react-native": "cli.js"` to
`"react-native-macos": "cli.js"` to match the package name
2. **Fixed script paths**: Updated the `start` and `android` scripts in
`packages/rn-tester/package.json` to use the correct relative path to
the binary: `../../node_modules/.bin/react-native-macos`
## Testing
- ✅ `yarn start` now works from `packages/rn-tester` directory
- ✅ `yarn start` works from root directory (delegates to rn-tester)
- ✅ `npx react-native-macos start` continues to work as before
- ✅ Test scripts in `scripts/objc-test.sh` continue to work (they use
`yarn start` from rn-tester context)
Both the standard React Native workflow (`yarn start`) and the existing
workaround (`npx react-native-macos start`) now function correctly.
Fixes #2528.
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> -
`https://api.github.com/repos/react-native-community/rn-diff-purge/tags`
> - Triggering command: `node
/home/REDACTED/work/react-native-macos/react-native-macos/node_modules/.bin/react-native
start ` (http block)
> - Triggering command: `node ../../node_modules/.bin/react-native-macos
start ` (http block)
> - Triggering command: `/usr/local/bin/node
../../node_modules/.bin/react-native-macos start ` (http block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to my [firewall allow
list](https://gh.io/copilot/firewall-config)
>
> </details>
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to
start the survey.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Saadnajmi <[email protected]>1 parent 2ed575c commit 4a29cef
File tree
3 files changed
+6
-2
lines changed- packages
- react-native
- rn-tester
3 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2960 | 2960 | | |
2961 | 2961 | | |
2962 | 2962 | | |
| 2963 | + | |
2963 | 2964 | | |
2964 | 2965 | | |
2965 | 2966 | | |
| |||
10673 | 10674 | | |
10674 | 10675 | | |
10675 | 10676 | | |
| 10677 | + | |
10676 | 10678 | | |
10677 | 10679 | | |
10678 | 10680 | | |
| |||
0 commit comments