From 99f36c765d41522d4ce07f52aa54f9a053473e09 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Wed, 8 Feb 2023 13:09:28 +0100 Subject: [PATCH] chore: update `react-native.config.js` to accommodate newer versions --- example/ios/Podfile | 11 +++++++++-- package.json | 2 +- react-native.config.js | 33 ++++++++++++++------------------- yarn.lock | 8 ++++---- 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/example/ios/Podfile b/example/ios/Podfile index 940eff53..fe276956 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,9 +1,16 @@ -require_relative '../../node_modules/react-native-test-app/test_app.rb' +require_relative '../../node_modules/react-native-test-app/test_app' workspace 'AsyncStorageExample.xcworkspace' use_flipper! false -use_test_app! do |target| + +options = { + :fabric_enabled => false, + :hermes_enabled => false, + :turbomodule_enabled => false, +} + +use_test_app! options do |target| target.app do pod 'RNCAsyncStorage', :path => '../..' pod 'AsyncStorageExample', :path => '..' diff --git a/package.json b/package.json index 3791b9f2..a840f7bd 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "react-native": "^0.68.0", "react-native-builder-bob": "^0.18.0", "react-native-macos": "^0.68.0", - "react-native-test-app": "^2.3.4", + "react-native-test-app": "^2.3.10", "react-native-web": "^0.17.0", "react-native-windows": "^0.68.0", "react-test-renderer": "17.0.2", diff --git a/react-native.config.js b/react-native.config.js index 28f10f0d..be37067c 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -1,28 +1,23 @@ const project = (() => { - const fs = require('fs'); const path = require('path'); try { - const { - androidManifestPath, - iosProjectPath, - windowsProjectPath, - } = require('react-native-test-app'); - return { + const { configureProjects } = require('react-native-test-app'); + return configureProjects({ android: { sourceDir: path.join('example', 'android'), - manifestPath: androidManifestPath( - path.join(__dirname, 'example', 'android') - ), }, ios: { - project: iosProjectPath('example/ios'), + sourceDir: 'example/ios', }, - windows: fs.existsSync('example/windows/AsyncStorageExample.sln') && { + windows: { sourceDir: path.join('example', 'windows'), - solutionFile: 'AsyncStorageExample.sln', - project: windowsProjectPath(path.join(__dirname, 'example', 'windows')), + solutionFile: path.join( + 'example', + 'windows', + 'AsyncStorageExample.sln' + ), }, - }; + }); } catch (_) { return undefined; } @@ -38,8 +33,8 @@ module.exports = { macos: null, }, }, - // Suppress warnings about bob not being a proper native module - '@react-native-community/bob': { + // We don't use Expo in our test apps + expo: { platforms: { android: null, ios: null, @@ -47,8 +42,8 @@ module.exports = { windows: null, }, }, - // We don't use Expo in our test apps - expo: { + // Suppress warnings about bob not being a proper native module + 'react-native-builder-bob': { platforms: { android: null, ios: null, diff --git a/yarn.lock b/yarn.lock index 6c70b300..4f769080 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9851,10 +9851,10 @@ react-native-macos@^0.68.0: whatwg-fetch "^3.0.0" ws "^6.1.4" -react-native-test-app@^2.3.4: - version "2.3.4" - resolved "https://registry.yarnpkg.com/react-native-test-app/-/react-native-test-app-2.3.4.tgz#4628b5487a3daa5b0ac510f19e2fa4f324928dc8" - integrity sha512-YWjo5bU8oXYiTldHBIW1Nruf8OaRi2jnfg2Mgffr6gQqRqLcC0G18qC/qiIy3vhsVPKPXAFgTd7W/p0fzPdaeQ== +react-native-test-app@^2.3.10: + version "2.3.10" + resolved "https://registry.yarnpkg.com/react-native-test-app/-/react-native-test-app-2.3.10.tgz#e0f2e6ff97dde0261461f221a5113701d22fdef3" + integrity sha512-N5ctzl5qnPfVnySDo356Ej2zI7zutHnrtwjO5wGHpdCeLygzqx+CcX/mWurtH3fo4242nTvnr4KXDpgtuqiuxQ== dependencies: ajv "^8.0.0" chalk "^4.1.0"