From 88276c51ad9f8a470d6dada54ddc142101cd6502 Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Mon, 22 Jul 2024 03:19:39 -0700 Subject: [PATCH] Restore CLI_PATH variable in react-native-xcode script (#45560) Summary: When changing the `react-native-xcode.sh` logic to use the helloworld cli on https://github.com/facebook/react-native/pull/44721, the `CLI_PATH` env var was removed along with `BUNDLE_COMMAND`. Both of these values were used by Expo to override the default CLI and use our custom bundling command. https://github.com/expo/expo/blob/10e302ee13add0e24a08c7ee792c2da50ace95a6/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj#L215C4-L215C15 This restores the `CLI_PATH` variable and set the default value as `"$REACT_NATIVE_DIR/scripts/bundle.js"`, along with the `BUNDLE_COMMAND` variable. With this Expo and other frameworks can keep the ability to easily replace the internal CLI ## Changelog: [INTERNAL] [CHANGED] - Restore CLI_PATH variable in react-native-xcode script Pull Request resolved: https://github.com/facebook/react-native/pull/45560 Test Plan: Project compiles correctly on iOS Reviewed By: robhogan Differential Revision: D60035338 Pulled By: blakef fbshipit-source-id: 26583d11d9f573f7cfa405b68e0cc3304c3601df --- packages/react-native/scripts/react-native-xcode.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/scripts/react-native-xcode.sh b/packages/react-native/scripts/react-native-xcode.sh index 08862821daa2e2..345603cc7dca91 100755 --- a/packages/react-native/scripts/react-native-xcode.sh +++ b/packages/react-native/scripts/react-native-xcode.sh @@ -90,7 +90,7 @@ fi [ -z "$NODE_ARGS" ] && export NODE_ARGS="" -[ -z "$BUNDLE_COMMAND" ] && BUNDLE_COMMAND="bundle" +[ -z "$CLI_PATH" ] && CLI_PATH="$REACT_NATIVE_DIR/scripts/bundle.js" [ -z "$COMPOSE_SOURCEMAP_PATH" ] && COMPOSE_SOURCEMAP_PATH="$REACT_NATIVE_DIR/scripts/compose-source-maps.js" @@ -147,7 +147,7 @@ else fi # shellcheck disable=SC2086 -"$NODE_BINARY" $NODE_ARGS "$REACT_NATIVE_DIR/scripts/bundle.js" \ +"$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \ $CONFIG_ARG \ --config-cmd "$CONFIG" \ --entry-file "$ENTRY_FILE" \