-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update React Native minimum version supported, fix test app autolinki…
…ng (#235) * Update minimum * Remove extra package.json * Update react-native.config.js Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> * Update react-native.config.js Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> * Fix typo --------- Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
118 additions
and
1,377 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,25 +1,21 @@ | ||
/** | ||
* Metro configuration for React Native | ||
* /~https://github.com/facebook/react-native | ||
* | ||
* @format | ||
*/ | ||
const blacklist = require('metro-config/src/defaults/blacklist'); | ||
const path = require('path'); | ||
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); | ||
|
||
module.exports = { | ||
const { makeMetroConfig } = require("@rnx-kit/metro-config"); | ||
module.exports = mergeConfig(getDefaultConfig(__dirname), makeMetroConfig({ | ||
projectRoot: path.join(__dirname, 'example'), | ||
watchFolders: [__dirname], | ||
resolver: { | ||
blacklistRE: blacklist([ | ||
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip | ||
// /~https://github.com/dotnet/msbuild/issues/5383 | ||
/.*\.ProjectImports\.zip/, | ||
]), | ||
extraNodeModules: { | ||
'@react-native-clipboard/clipboard': __dirname, | ||
}, | ||
}, | ||
transformer: { | ||
getTransformOptions: async () => ({ | ||
transform: { | ||
experimentalImportSupport: false, | ||
inlineRequires: true, | ||
inlineRequires: false, | ||
}, | ||
}), | ||
}, | ||
}; | ||
})); |
This file was deleted.
Oops, something went wrong.
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,47 +1,46 @@ | ||
/** | ||
* 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 project = (() => { | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
try { | ||
const { configureProjects } = require('react-native-test-app'); | ||
|
||
const macSwitch = '--use-react-native-macos'; | ||
const windowsSwitch = '--use-react-native-windows'; | ||
return configureProjects({ | ||
android: { | ||
sourceDir: path.join('example', 'android'), | ||
}, | ||
ios: { | ||
sourceDir: 'example/ios', | ||
}, | ||
windows: { | ||
sourceDir: path.join('example', 'windows'), | ||
solutionFile: path.join('example', 'windows', 'Example.sln'), | ||
}, | ||
}); | ||
} catch (e) { | ||
return undefined; | ||
} | ||
})(); | ||
|
||
if (process.argv.includes(macSwitch)) { | ||
process.argv = process.argv.filter((arg) => arg !== macSwitch); | ||
process.argv.push('--config=metro.config.macos.js'); | ||
module.exports = { | ||
reactNativePath: 'node_modules/react-native-macos', | ||
}; | ||
} else if (process.argv.includes(windowsSwitch)) { | ||
process.argv = process.argv.filter((arg) => arg !== windowsSwitch); | ||
process.argv.push('--config=metro.config.windows.js'); | ||
module.exports = { | ||
reactNativePath: 'node_modules/react-native-windows', | ||
}; | ||
} else { | ||
module.exports = { | ||
project: { | ||
android: {sourceDir: './example/android'}, | ||
ios: {project: './example/ios/example.xcworkspace'}, | ||
module.exports = { | ||
dependencies: { | ||
// Help rn-cli find and autolink this library | ||
'@react-native-clipboard/clipboard': { | ||
root: __dirname, | ||
}, | ||
}, | ||
dependency: { | ||
platforms: { | ||
windows: { | ||
sourceDir: './example/windows', | ||
solutionFile: 'ClipboardExample.sln', | ||
project: { | ||
projectFile: 'ClipboardExample/ClipboardExample.vcxproj', | ||
}, | ||
sourceDir: 'windows', | ||
solutionFile: 'windows.sln', | ||
projects: [ | ||
{ | ||
projectFile: 'Clipboard/Clipboard.vcxproj', | ||
directDependency: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
}; | ||
} | ||
}, | ||
...(project ? { project } : undefined), | ||
}; |
Oops, something went wrong.