Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from juliusmarminge/main
Browse files Browse the repository at this point in the history
fix: patch rn to make EAS build
  • Loading branch information
perkinsjr authored Jan 17, 2023
2 parents 624f203 + 0faaf20 commit e5c563f
Show file tree
Hide file tree
Showing 4 changed files with 464 additions and 669 deletions.
8 changes: 4 additions & 4 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"@trpc/client": "^10.1.0",
"@trpc/react-query": "^10.1.0",
"@trpc/server": "^10.1.0",
"expo": "~47.0.6",
"expo": "~47.0.12",
"expo-auth-session": "^3.7.3",
"expo-random": "^13.0.0",
"expo-secure-store": "^12.0.0",
"expo-status-bar": "~1.4.2",
"nativewind": "^2.0.11",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.71.0-rc.0",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-native": "0.70.5",
"react-native-safe-area-context": "4.4.1",
"react-native-web": "~0.18.10"
},
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"db-push": "turbo db-push",
"dev": "turbo dev --parallel",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"lint": "turbo lint && manypkg check",
"lint": "turbo lint",
"FIXME:lint": "turbo lint && manypkg check",
"type-check": "turbo type-check"
},
"dependencies": {
Expand All @@ -22,5 +23,10 @@
"prettier-plugin-tailwindcss": "^0.1.13",
"turbo": "^1.5.5",
"typescript": "^4.9.3"
},
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
50 changes: 50 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/scripts/react_native_pods_utils/script_phases.sh b/scripts/react_native_pods_utils/script_phases.sh
index 6c41ce1cbaa2b09d7b59b191b1edfb0c3fb41ea7..25bfcd11d6b88525d589c80ee08c9a8c8ba66d16 100755
--- a/scripts/react_native_pods_utils/script_phases.sh
+++ b/scripts/react_native_pods_utils/script_phases.sh
@@ -13,8 +13,6 @@ GENERATED_SCHEMA_FILE="$GENERATED_SRCS_DIR/schema.json"

cd "$RCT_SCRIPT_RN_DIR"

-CODEGEN_REPO_PATH="$RCT_SCRIPT_RN_DIR/packages/react-native-codegen"
-CODEGEN_NPM_PATH="$RCT_SCRIPT_RN_DIR/../react-native-codegen"
CODEGEN_CLI_PATH=""

error () {
@@ -23,14 +21,12 @@ error () {
exit 1
}

-# Determine path to react-native-codegen
-if [ -d "$CODEGEN_REPO_PATH" ]; then
- CODEGEN_CLI_PATH=$(cd "$CODEGEN_REPO_PATH" && pwd)
-elif [ -d "$CODEGEN_NPM_PATH" ]; then
- CODEGEN_CLI_PATH=$(cd "$CODEGEN_NPM_PATH" && pwd)
-else
- error "error: Could not determine react-native-codegen location in $CODEGEN_REPO_PATH or $CODEGEN_NPM_PATH. Try running 'yarn install' or 'npm install' in your project root."
-fi
+find_codegen () {
+ CODEGEN_CLI_PATH=$("$NODE_BINARY" --print "require('path').dirname(require.resolve('react-native-codegen/package.json'))")
+ if ! [ -d "$CODEGEN_CLI_PATH" ]; then
+ error "error: Could not determine react-native-codegen location, using node module resolution. Try running 'yarn install' or 'npm install' in your project root."
+ fi
+}

find_node () {
NODE_BINARY="${NODE_BINARY:-$(command -v node || true)}"
@@ -116,6 +112,7 @@ moveOutputs () {
withCodgenDiscovery () {
setup_dirs
find_node
+ find_codegen
generateArtifacts
moveOutputs
}
@@ -123,6 +120,7 @@ withCodgenDiscovery () {
noCodegenDiscovery () {
setup_dirs
find_node
+ find_codegen
generateCodegenSchemaFromJavaScript
generateCodegenArtifactsFromSchema
moveOutputs
Loading

0 comments on commit e5c563f

Please sign in to comment.