Skip to content

Commit 871e88b

Browse files
authored
Merge pull request #5 from GSTJ/support-expo-50
feat: add expo 50 support
2 parents a06737a + ffaa282 commit 871e88b

12 files changed

Lines changed: 115 additions & 29 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
### @config-plugins/react-native-codepush 1.0.2
66

77
- Update interim README
8+
9+
### @config-plugins/react-native-codepush 1.0.5
10+
11+
- Expo SDK 50 support

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
Config plugin to auto-configure [`react-native-code-push`][lib] when the native code is generated (`npx expo prebuild`).
44

55
### ⚠️ Remove Expo updates completely ⚠️
6+
67
Before installing this package, you need completely remove Expo updates from your project:
8+
79
- Expo updates configurations
810
- Expo updates execution code in your app
911
- Expo updates package `npm uninstall -s expo-updates` or `yarn remove expo-updates`
1012
- Any other thing you have done with Expo updates
1113

1214
### Add the package to your npm dependencies
1315

14-
> Tested against Expo SDK 49
16+
> Tested against Expo SDK 50
1517
1618
```
1719
yarn add react-native-code-push react-native-code-push-plugin

build/android/buildscriptDependency.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/android/buildscriptDependency.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/android/mainApplicationDependency.js

Lines changed: 29 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/android/mainApplicationDependency.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/utils/addBelowAnchorIfNotFound.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/utils/addBelowAnchorIfNotFound.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-code-push-plugin",
3-
"version": "1.0.3",
3+
"version": "1.0.5",
44
"description": "Config plugin to auto configure react-native-code-push on prebuild",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",
@@ -29,10 +29,10 @@
2929
"expo"
3030
],
3131
"peerDependencies": {
32-
"expo": "^49"
32+
"expo": ">=49.0.0"
3333
},
3434
"devDependencies": {
35-
"expo": "^49",
35+
"expo": ">=49.0.0",
3636
"expo-module-scripts": "^3.0.3"
3737
},
3838
"upstreamPackage": "react-native-code-push"

src/android/buildscriptDependency.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ function applyImplementation(appBuildGradle: string) {
1212
return appBuildGradle;
1313
}
1414

15+
// The default on Expo 50
16+
const reactNative73Include = `apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");`;
17+
if (appBuildGradle.includes(reactNative73Include)) {
18+
return addBelowAnchorIfNotFound(
19+
appBuildGradle,
20+
reactNative73Include,
21+
codePushImplementation
22+
);
23+
}
24+
1525
// Seems to be the default on Expo 49
1626
const reactNative71Include = `apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");`;
1727
if (appBuildGradle.includes(reactNative71Include)) {

0 commit comments

Comments
 (0)