Skip to content

Commit c5f188d

Browse files
authored
chore: update react-native.config.js to accommodate newer versions (#915)
Update `react-native.config.js` to accommodate newer `@react-native-community/cli` versions.
1 parent a9e9f48 commit c5f188d

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

example/ios/Podfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
require_relative '../../node_modules/react-native-test-app/test_app.rb'
1+
require_relative '../../node_modules/react-native-test-app/test_app'
22

33
workspace 'AsyncStorageExample.xcworkspace'
44

55
use_flipper! false
6-
use_test_app! do |target|
6+
7+
options = {
8+
:fabric_enabled => false,
9+
:hermes_enabled => false,
10+
:turbomodule_enabled => false,
11+
}
12+
13+
use_test_app! options do |target|
714
target.app do
815
pod 'RNCAsyncStorage', :path => '../..'
916
pod 'AsyncStorageExample', :path => '..'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"react-native": "^0.68.0",
9090
"react-native-builder-bob": "^0.18.0",
9191
"react-native-macos": "^0.68.0",
92-
"react-native-test-app": "^2.3.4",
92+
"react-native-test-app": "^2.3.10",
9393
"react-native-web": "^0.17.0",
9494
"react-native-windows": "^0.68.0",
9595
"react-test-renderer": "17.0.2",

react-native.config.js

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
const project = (() => {
2-
const fs = require('fs');
32
const path = require('path');
43
try {
5-
const {
6-
androidManifestPath,
7-
iosProjectPath,
8-
windowsProjectPath,
9-
} = require('react-native-test-app');
10-
return {
4+
const { configureProjects } = require('react-native-test-app');
5+
return configureProjects({
116
android: {
127
sourceDir: path.join('example', 'android'),
13-
manifestPath: androidManifestPath(
14-
path.join(__dirname, 'example', 'android')
15-
),
168
},
179
ios: {
18-
project: iosProjectPath('example/ios'),
10+
sourceDir: 'example/ios',
1911
},
20-
windows: fs.existsSync('example/windows/AsyncStorageExample.sln') && {
12+
windows: {
2113
sourceDir: path.join('example', 'windows'),
22-
solutionFile: 'AsyncStorageExample.sln',
23-
project: windowsProjectPath(path.join(__dirname, 'example', 'windows')),
14+
solutionFile: path.join(
15+
'example',
16+
'windows',
17+
'AsyncStorageExample.sln'
18+
),
2419
},
25-
};
20+
});
2621
} catch (_) {
2722
return undefined;
2823
}
@@ -38,17 +33,17 @@ module.exports = {
3833
macos: null,
3934
},
4035
},
41-
// Suppress warnings about bob not being a proper native module
42-
'@react-native-community/bob': {
36+
// We don't use Expo in our test apps
37+
expo: {
4338
platforms: {
4439
android: null,
4540
ios: null,
4641
macos: null,
4742
windows: null,
4843
},
4944
},
50-
// We don't use Expo in our test apps
51-
expo: {
45+
// Suppress warnings about bob not being a proper native module
46+
'react-native-builder-bob': {
5247
platforms: {
5348
android: null,
5449
ios: null,

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9851,10 +9851,10 @@ react-native-macos@^0.68.0:
98519851
whatwg-fetch "^3.0.0"
98529852
ws "^6.1.4"
98539853

9854-
react-native-test-app@^2.3.4:
9855-
version "2.3.4"
9856-
resolved "https://registry.yarnpkg.com/react-native-test-app/-/react-native-test-app-2.3.4.tgz#4628b5487a3daa5b0ac510f19e2fa4f324928dc8"
9857-
integrity sha512-YWjo5bU8oXYiTldHBIW1Nruf8OaRi2jnfg2Mgffr6gQqRqLcC0G18qC/qiIy3vhsVPKPXAFgTd7W/p0fzPdaeQ==
9854+
react-native-test-app@^2.3.10:
9855+
version "2.3.10"
9856+
resolved "https://registry.yarnpkg.com/react-native-test-app/-/react-native-test-app-2.3.10.tgz#e0f2e6ff97dde0261461f221a5113701d22fdef3"
9857+
integrity sha512-N5ctzl5qnPfVnySDo356Ej2zI7zutHnrtwjO5wGHpdCeLygzqx+CcX/mWurtH3fo4242nTvnr4KXDpgtuqiuxQ==
98589858
dependencies:
98599859
ajv "^8.0.0"
98609860
chalk "^4.1.0"

0 commit comments

Comments
 (0)