-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: bump react-native to 0.66 (#757)
- Loading branch information
Showing
3 changed files
with
692 additions
and
652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,54 @@ | ||
/** | ||
* This cli config is needed for the coexistance of react-native and other | ||
* out-of-tree implementations such react-native-macos. | ||
* The following issue is tracked by | ||
* https://github.com/react-native-community/discussions-and-proposals/issues/182 | ||
* | ||
* The work-around involves having a metro.config.js for each out-of-tree | ||
* platform, i.e. metro.config.js for react-native and | ||
* metro.config.macos.js for react-native-macos. | ||
* This react-native.config.js looks for a --use-react-native-macos | ||
* switch and when present pushes --config=metro.config.macos.js | ||
* and specifies reactNativePath: 'node_modules/react-native-macos'. | ||
* The metro.config.js has to blacklist 'node_modules/react-native-macos', | ||
* and conversely metro.config.macos.js has to blacklist 'node_modules/react-native'. | ||
*/ | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { | ||
androidManifestPath, | ||
iosProjectPath, | ||
windowsProjectPath, | ||
} = require('react-native-test-app'); | ||
|
||
const dependencies = { | ||
'@react-native-async-storage/async-storage': { | ||
root: __dirname, | ||
// rn-cli incorrectly resolves node_modules path for the following platforms | ||
platforms: { | ||
ios: null, | ||
macos: null, | ||
module.exports = { | ||
dependencies: { | ||
'@react-native-async-storage/async-storage': { | ||
root: __dirname, | ||
// rn-cli incorrectly resolves node_modules path for the following platforms | ||
platforms: { | ||
ios: null, | ||
macos: null, | ||
}, | ||
}, | ||
}, | ||
// Suppress warnings about bob not being a proper native module | ||
'@react-native-community/bob': { | ||
platforms: { | ||
android: null, | ||
ios: null, | ||
macos: null, | ||
windows: null, | ||
// Suppress warnings about bob not being a proper native module | ||
'@react-native-community/bob': { | ||
platforms: { | ||
android: null, | ||
ios: null, | ||
macos: null, | ||
windows: null, | ||
}, | ||
}, | ||
// We don't use Expo in our test apps | ||
expo: { | ||
platforms: { | ||
android: null, | ||
ios: null, | ||
macos: null, | ||
windows: null, | ||
}, | ||
}, | ||
}, | ||
// We don't use Expo in our test apps | ||
expo: { | ||
platforms: { | ||
android: null, | ||
ios: null, | ||
macos: null, | ||
windows: null, | ||
project: { | ||
android: { | ||
sourceDir: path.join('example', 'android'), | ||
manifestPath: androidManifestPath( | ||
path.join(__dirname, 'example', 'android') | ||
), | ||
}, | ||
ios: { | ||
project: iosProjectPath('example/ios'), | ||
}, | ||
windows: fs.existsSync('example/windows/AsyncStorageExample.sln') && { | ||
sourceDir: path.join('example', 'windows'), | ||
solutionFile: 'AsyncStorageExample.sln', | ||
project: windowsProjectPath(path.join(__dirname, 'example', 'windows')), | ||
}, | ||
}, | ||
}; | ||
|
||
if ( | ||
process.argv.includes('--use-react-native-windows') || | ||
process.argv.includes('autolink-windows') || | ||
process.argv.includes('run-windows') | ||
) { | ||
const sourceDir = path.join('example', 'windows'); | ||
module.exports = { | ||
dependencies, | ||
project: { | ||
// `@react-native-community/cli` mistakes | ||
// `windows/ReactNativeAsyncStorage.sln` and | ||
// `windows/ReactNativeAsyncStorage/ReactNativeAsyncStorage.vcxproj` for | ||
// being the main project files. We need to help it find the solution file | ||
// under `example/windows/` and the generated project files in | ||
// `node_modules/.generated/windows`. | ||
windows: { | ||
sourceDir, | ||
solutionFile: 'AsyncStorageExample.sln', | ||
project: { | ||
projectFile: path.relative( | ||
sourceDir, | ||
path.join( | ||
'node_modules', | ||
'.generated', | ||
'windows', | ||
'ReactTestApp', | ||
'ReactTestApp.vcxproj' | ||
) | ||
), | ||
}, | ||
}, | ||
}, | ||
reactNativePath: path.join('node_modules', 'react-native-windows'), | ||
}; | ||
} else { | ||
module.exports = { dependencies }; | ||
} |
Oops, something went wrong.