├── .ccache └── ccache.conf ├── .clang-format ├── .editorconfig ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ ├── feature_request.yml │ ├── new-major-version.md │ └── new_react-native_version.yml ├── actions │ ├── affected │ │ └── action.yml │ ├── cocoapods │ │ └── action.yml │ ├── gradle │ │ └── action.yml │ ├── init-test-app │ │ └── action.yml │ ├── setup-react-native │ │ └── action.yml │ ├── setup-toolchain │ │ └── action.yml │ └── yarn │ │ └── action.yml ├── dependabot.disabled.yml ├── eslint-stylish.json ├── ktlint.json ├── labeler.yml ├── minitest.json ├── prettierrc.json ├── pull_request_template.md ├── renovate.json ├── rubocop.json ├── swiftformat.json ├── swiftlint.json └── workflows │ ├── build.yml │ ├── codeql.yml │ └── rnx-build.yml ├── .gitignore ├── .npmrc ├── .rubocop.yml ├── .swiftformat ├── .swiftlint.yml ├── .vscode └── settings.json ├── .yarn ├── patches │ └── appium-npm-2.11.2-f39bb587af.patch ├── plugins │ ├── @yarnpkg │ │ └── plugin-compat.cjs │ ├── boost-workaround.cjs │ ├── clean.cjs │ ├── link-project.cjs │ ├── npm-workaround.cjs │ └── undo-bin-sorting.cjs └── releases │ └── yarn-4.6.0.cjs ├── .yarnrc.yml ├── Brewfile ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── ReactTestApp-DevSupport.podspec ├── SECURITY.md ├── android ├── android-manifest.js ├── app │ ├── build.gradle │ ├── lint.xml │ └── src │ │ ├── camera │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── camera │ │ │ ├── MainActivityExtensions.kt │ │ │ └── QRCodeScannerFragment.kt │ │ ├── devserverhelper-0.73 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── react │ │ │ └── DevServerHelperCompat.kt │ │ ├── devserverhelper-0.74 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── react │ │ │ └── DevServerHelperCompat.kt │ │ ├── devserverhelper-0.75 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── react │ │ │ └── DevServerHelperCompat.kt │ │ ├── devserverhelper-pre-0.73 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── react │ │ │ └── DevServerHelperCompat.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── reacttestapp │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── Session.kt │ │ │ │ ├── component │ │ │ │ ├── ComponentActivity.kt │ │ │ │ ├── ComponentBottomSheetDialogFragment.kt │ │ │ │ ├── ComponentListAdapter.kt │ │ │ │ └── ComponentViewModel.kt │ │ │ │ ├── manifest │ │ │ │ └── Manifest.kt │ │ │ │ └── react │ │ │ │ ├── AppRegistry.kt │ │ │ │ ├── ReactBundleNameProvider.kt │ │ │ │ └── TestAppReactNativeHost.kt │ │ ├── jni │ │ │ ├── AppRegistry.cpp │ │ │ ├── AppRegistry.h │ │ │ ├── AutolinkingCompat.h │ │ │ ├── CMakeLists.txt │ │ │ ├── ComponentsRegistry.cpp │ │ │ ├── ComponentsRegistry.h │ │ │ ├── OnLoad.cpp │ │ │ ├── TurboModuleManagerDelegate.cpp │ │ │ └── TurboModuleManagerDelegate.h │ │ ├── res-launcher │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ └── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ └── res │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── camera_view.xml │ │ │ └── recyclerview_item_component.xml │ │ │ ├── menu │ │ │ └── top_app_bar.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── new-arch-0.73 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ ├── compat │ │ │ └── ReactNativeHostCompat.kt │ │ │ ├── fabric │ │ │ └── ComponentsRegistry.kt │ │ │ └── turbomodule │ │ │ └── TurboModuleManagerDelegate.kt │ │ ├── new-arch │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ ├── compat │ │ │ └── ReactNativeHostCompat.kt │ │ │ ├── fabric │ │ │ └── ComponentsRegistry.kt │ │ │ └── turbomodule │ │ │ └── TurboModuleManagerDelegate.kt │ │ ├── no-camera │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── camera │ │ │ └── MainActivityExtensions.kt │ │ ├── old-arch │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── compat │ │ │ └── ReactNativeHostCompat.kt │ │ ├── reactactivitydelegate-0.72 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── component │ │ │ └── ComponentActivityDelegate.kt │ │ ├── reactactivitydelegate-0.74 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── component │ │ │ └── ComponentActivityDelegate.kt │ │ ├── reactactivitydelegate-0.75 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── component │ │ │ └── ComponentActivityDelegate.kt │ │ ├── reactactivitydelegate-pre-0.72 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── component │ │ │ └── ComponentActivityDelegate.kt │ │ ├── reactapplication-0.73 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── TestApp.kt │ │ ├── reactapplication-0.76 │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── reacttestapp │ │ │ └── TestApp.kt │ │ └── reactapplication-pre-0.73 │ │ └── java │ │ └── com │ │ └── microsoft │ │ └── reacttestapp │ │ └── TestApp.kt ├── autolink.gradle ├── autolink.mjs ├── config-plugins.gradle ├── dependencies.gradle ├── gradle-wrapper.js ├── gradle.properties ├── manifest.gradle ├── media-types.gradle ├── node.gradle ├── react-native.gradle ├── settings.gradle ├── support │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── microsoft │ │ └── reacttestapp │ │ └── support │ │ └── ReactTestAppLifecycleEvents.java └── utils.gradle ├── common ├── AppRegistry.cpp └── AppRegistry.h ├── docs ├── android.features.md ├── android.icons.md ├── android.metaData.md ├── android.package.md ├── android.permissions.md ├── android.signingConfigs.md ├── android.versionCode.md ├── bundleRoot.md ├── components.md ├── introduction.md ├── ios.buildNumber.md ├── ios.bundleIdentifier.md ├── ios.codeSignEntitlements.md ├── ios.codeSignIdentity.md ├── ios.developmentTeam.md ├── ios.icons.alternateIcons.md ├── ios.icons.md ├── ios.icons.primaryIcon.md ├── ios.metalAPIValidation.md ├── ios.privacyManifest.md ├── macos.applicationCategoryType.md ├── macos.humanReadableCopyright.md ├── resources.md ├── singleApp.md ├── version.md ├── windows.appxManifest.md ├── windows.certificateKeyFile.md ├── windows.certificatePassword.md └── windows.certificateThumbprint.md ├── eslint.config.js ├── example ├── .gitignore ├── .watchmanconfig ├── App.tsx ├── Example-Tests.podspec ├── android │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── dist │ └── .gitignore ├── index.ts ├── ios │ ├── ExampleTests │ │ └── DevSupportTests.m │ ├── Podfile │ └── Podfile.lock ├── macos │ ├── Podfile │ └── Podfile.lock ├── metro.config.js ├── package.json ├── react-native.config.js ├── test │ ├── config.test.mjs │ └── specs │ │ ├── app.spec.mjs │ │ └── wdio.config.mjs ├── tsconfig.json ├── visionos │ ├── Podfile │ └── Podfile.lock └── windows │ ├── .gitignore │ └── ReactAppTests │ ├── ReactAppTests.vcxproj │ ├── ReactAppTests.vcxproj.filters │ └── Tests.cpp ├── images ├── RNTA_full.png ├── RNTA_small.png └── header.jpg ├── ios ├── ReactTestApp.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── ReactTestApp.xcscheme ├── ReactTestApp │ ├── AppDelegate.swift │ ├── AppRegistryModule.h │ ├── AppRegistryModule.mm │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── ContentView.swift │ ├── Info.plist │ ├── Manifest.swift │ ├── Public │ │ ├── ReactTestApp-DevSupport-Bridging-Header.h │ │ └── ReactTestApp-DevSupport.h │ ├── QRCodeScannerViewController.swift │ ├── React+Compatibility.h │ ├── React+Compatibility.m │ ├── ReactInstance.swift │ ├── ReactTestApp-Bridging-Header.h │ ├── ReactTestApp-DevSupport.m │ ├── ReactTestApp.common.xcconfig │ ├── ReactTestApp.debug.xcconfig │ ├── ReactTestApp.release.xcconfig │ ├── SceneDelegate.swift │ ├── Session.swift │ ├── UIViewController+ReactTestApp.h │ └── UIViewController+ReactTestApp.m ├── ReactTestAppTests │ ├── Info.plist │ └── ReactTestAppTests.swift ├── ReactTestAppUITests │ ├── Info.plist │ └── ReactTestAppUITests.swift ├── app.mjs ├── assetsCatalog.mjs ├── entitlements.mjs ├── features.mjs ├── infoPlist.mjs ├── localizations.mjs ├── pod_helpers.rb ├── privacyManifest.mjs ├── test_app.rb ├── use_react_native-0.70.rb ├── use_react_native-0.71.rb ├── utils.mjs └── xcode.mjs ├── macos ├── Localizations │ └── en.lproj │ │ └── Main.strings ├── ReactTestApp.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── ReactTestApp.xcscheme ├── ReactTestApp │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Info.plist │ ├── ReactTestApp.common.xcconfig │ ├── ReactTestApp.debug.xcconfig │ ├── ReactTestApp.release.xcconfig │ └── ViewController.swift ├── ReactTestAppTests │ ├── Info.plist │ └── ReactTestAppTests.swift ├── ReactTestAppUITests │ ├── Info.plist │ └── ReactTestAppUITests.swift ├── Shared └── test_app.rb ├── nx.json ├── package.json ├── plugins ├── index.js ├── macos.js └── reanimated.js ├── react-native.config.js ├── schema.json ├── scripts ├── appConfig.mjs ├── apply-config-plugins.mjs ├── build │ ├── MSBuild.ps1 │ ├── VSTest.ps1 │ ├── affected.mts │ ├── clang-format-diff.sh │ ├── copy-yarnrc.mjs │ ├── install-test-template.sh │ └── xcodebuild.sh ├── config-plugins │ ├── ExpoConfigPlugins.mjs │ ├── apply.mjs │ ├── index.mjs │ ├── plugins │ │ ├── cocoaBaseMods.mjs │ │ ├── mod-compiler.mjs │ │ ├── withAndroidBaseMods.mjs │ │ ├── withInternal.mjs │ │ ├── withIosBaseMods.mjs │ │ └── withMacOsBaseMods.mjs │ ├── provider.mjs │ └── types.ts ├── configure-projects.js ├── configure.mjs ├── embed-manifest │ ├── cpp.mjs │ ├── kotlin.mjs │ ├── main.mjs │ ├── swift.mjs │ └── validate.mjs ├── eslint │ ├── no-process-exit.js │ └── plugin.js ├── helpers.js ├── init.mjs ├── internal │ ├── generate-manifest-docs.mts │ ├── generate-manifest.mts │ ├── generate-schema.mts │ ├── pack.mts │ ├── prepare-viewfinder.mts │ ├── release-notes.mts │ ├── set-react-version.mts │ └── test.mts ├── schema.mjs ├── template.mjs ├── testing │ ├── react-native.mts │ ├── test-apple.mts │ ├── test-e2e.mts │ └── test-matrix.mts ├── types.ts └── utils │ ├── colors.mjs │ ├── filesystem.mjs │ ├── npm.mjs │ └── parseargs.mjs ├── test-app.gradle ├── test ├── __fixtures__ │ ├── single_app_mode │ │ └── app.json │ ├── test_app │ │ └── node_modules │ │ │ ├── @react-native-community │ │ │ └── cli-platform-ios │ │ │ │ ├── native_modules.rb │ │ │ │ └── package.json │ │ │ └── react-native │ │ │ └── package.json │ ├── windows_test_app │ │ ├── Root.vcxproj │ │ ├── android │ │ │ └── Android.vcxproj │ │ ├── ios │ │ │ └── iOS.vcxproj │ │ ├── macos │ │ │ └── macOS.vcxproj │ │ ├── node_modules │ │ │ └── SomeProject.vcxproj │ │ └── windows │ │ │ ├── InvalidProject.vcxproj │ │ │ ├── Windows.vcxproj │ │ │ └── WithoutProjectName.vcxproj │ ├── with_platform_resources │ │ ├── app.json │ │ ├── ios │ │ │ └── .gitignore │ │ └── macos │ │ │ └── .gitignore │ ├── with_resources │ │ ├── app.json │ │ ├── ios │ │ │ └── .gitignore │ │ └── macos │ │ │ └── .gitignore │ ├── without_platform_resources │ │ ├── app.json │ │ ├── ios │ │ │ └── .gitignore │ │ └── macos │ │ │ └── .gitignore │ └── without_resources │ │ ├── app.json │ │ ├── ios │ │ └── .gitignore │ │ └── macos │ │ └── .gitignore ├── android │ ├── android-manifest.test.ts │ ├── autolink.test.ts │ ├── gradle-wrapper.test.ts │ ├── gradle.ts │ └── test-app-util.test.ts ├── configure-projects.test.ts ├── configure │ ├── console.test.ts │ ├── gatherConfig.test.ts │ ├── getAppName.test.ts │ ├── getConfig.test.ts │ ├── getPlatformPackage.test.ts │ ├── isDestructive.test.ts │ ├── join.test.ts │ ├── mergeConfig.test.ts │ ├── mockParams.ts │ ├── reactNativeConfig.test.ts │ ├── removeAllFiles.test.ts │ ├── updatePackageManifest.test.ts │ └── writeAllFiles.test.ts ├── embed-manifest │ ├── cpp.test.ts │ ├── fixtures.ts │ ├── kotlin.test.ts │ ├── swift.test.ts │ └── validate.test.ts ├── fs.mock.ts ├── helpers.test.ts ├── ios │ ├── app.test.ts │ ├── assetsCatalog.test.ts │ ├── entitlements.test.ts │ ├── features.test.ts │ ├── infoPlist.test.ts │ ├── localizations.test.ts │ ├── privacyManifest.test.ts │ └── xcode.test.ts ├── pack.test.ts ├── template.ts ├── test_pod_helpers.rb ├── test_test_app.rb └── windows │ ├── copyAndReplace.test.ts │ ├── findUserProjects.test.ts │ ├── generateSolution.test.ts │ ├── getBundleResources.test.ts │ ├── parseResources.test.ts │ └── replaceContent.test.ts ├── test_app.rb ├── tsconfig.cjs.json ├── tsconfig.json ├── visionos ├── ReactTestApp.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── ReactTestApp.xcscheme ├── ReactTestApp │ ├── Assets.xcassets │ │ ├── AppIcon.solidimagestack │ │ │ ├── Back.solidimagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── back.jpg │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── Front.solidimagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── front.png │ │ │ │ └── Contents.json │ │ │ └── Middle.solidimagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ ├── ReactTestApp.common.xcconfig │ ├── ReactTestApp.debug.xcconfig │ └── ReactTestApp.release.xcconfig ├── ReactTestAppTests │ ├── Info.plist │ └── ReactTestAppTests.swift ├── ReactTestAppUITests │ ├── Info.plist │ └── ReactTestAppUITests.swift ├── Shared └── test_app.rb ├── windows ├── .clang-format ├── .gitignore ├── ExperimentalFeatures.props ├── Shared │ ├── EmbedManifest.targets │ ├── JSValueWriterHelper.h │ ├── Manifest.h │ ├── ReactInstance.cpp │ ├── ReactInstance.h │ └── Session.h ├── UWP │ ├── App.cpp │ ├── App.h │ ├── App.idl │ ├── App.xaml │ ├── Assets │ │ ├── SplashScreen.scale-100.png │ │ ├── SplashScreen.scale-200.png │ │ ├── SplashScreen.scale-400.png │ │ ├── Square150x150Logo.scale-100.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square150x150Logo.scale-400.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-16.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-256.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-48.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ ├── Square44x44Logo.scale-100.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.scale-400.png │ │ ├── Square44x44Logo.targetsize-16.png │ │ ├── Square44x44Logo.targetsize-256.png │ │ ├── Square44x44Logo.targetsize-48.png │ │ ├── StoreLogo.scale-100.png │ │ ├── StoreLogo.scale-200.png │ │ ├── StoreLogo.scale-400.png │ │ └── Wide310x150Logo.scale-200.png │ ├── AutolinkedNativeModules.g.cpp │ ├── AutolinkedNativeModules.g.h │ ├── AutolinkedNativeModules.g.props │ ├── AutolinkedNativeModules.g.targets │ ├── MainPage.cpp │ ├── MainPage.h │ ├── MainPage.idl │ ├── MainPage.xaml │ ├── Package.appxmanifest │ ├── PropertySheet.props │ ├── ReactTestApp.vcxproj │ ├── ReactTestApp.vcxproj.filters │ ├── pch.cpp │ └── pch.h ├── Win32 │ ├── AutolinkedNativeModules.g.cpp │ ├── AutolinkedNativeModules.g.h │ ├── Images │ │ ├── SplashScreen.scale-100.png │ │ ├── SplashScreen.scale-200.png │ │ ├── SplashScreen.scale-400.png │ │ ├── Square150x150Logo.scale-100.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square150x150Logo.scale-400.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-16.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-256.png │ │ ├── Square44x44Logo.altform-lightunplated_targetsize-48.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ ├── Square44x44Logo.scale-100.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.scale-400.png │ │ ├── Square44x44Logo.targetsize-16.png │ │ ├── Square44x44Logo.targetsize-256.png │ │ ├── Square44x44Logo.targetsize-48.png │ │ ├── StoreLogo.scale-100.png │ │ ├── StoreLogo.scale-200.png │ │ ├── StoreLogo.scale-400.png │ │ └── Wide310x150Logo.scale-200.png │ ├── Main.cpp │ ├── Main.h │ ├── Main.ico │ ├── Main.rc │ ├── Main.small.ico │ ├── Package.appxmanifest │ ├── ReactApp.Package.wapproj │ ├── ReactApp.vcxproj │ ├── ReactApp.vcxproj.filters │ ├── pch.cpp │ ├── pch.h │ ├── resource.h │ └── targetver.h ├── project.mjs ├── test-app.mjs ├── uwp.mjs └── win32.mjs └── yarn.lock /.ccache/ccache.conf: -------------------------------------------------------------------------------- 1 | depend_mode = true 2 | direct_mode = true 3 | hard_link = true 4 | max_size = 1G 5 | run_second_cpp = true 6 | sloppiness = file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,modules,system_headers,time_macros 7 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | AccessModifierOffset: -4 3 | AllowShortFunctionsOnASingleLine: None 4 | AlwaysBreakBeforeMultilineStrings: true 5 | AlwaysBreakTemplateDeclarations: true 6 | BinPackArguments: false 7 | BinPackParameters: false 8 | BreakBeforeBraces: Linux 9 | ColumnLimit: 100 10 | Cpp11BracedListStyle: true 11 | IncludeBlocks: Regroup 12 | IncludeCategories: 13 | - Regex: '"pch\.h"' 14 | Priority: -1 15 | - Regex: '^' 18 | Priority: 2 19 | - Regex: '^<' 20 | Priority: 3 21 | - Regex: '.\*' 22 | Priority: 10 23 | IndentCaseLabels: true 24 | IndentWidth: 4 25 | NamespaceIndentation: All 26 | ObjCSpaceAfterProperty: true 27 | ObjCSpaceBeforeProtocolList: true 28 | PenaltyReturnTypeOnItsOwnLine: 100 29 | PointerAlignment: Right 30 | SpacesBeforeTrailingComments: 2 31 | SpacesInContainerLiterals: false 32 | TabWidth: 4 33 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [*.{js,json,podspec,rb,sh,ts,yml},Podfile] 10 | indent_size = 2 11 | 12 | [*.{gradle,h,kt,m,mm}] 13 | indent_size = 4 14 | 15 | [*.{h,m,md,mm}] 16 | max_line_length = 80 17 | guidelines = 80 18 | 19 | [*.{gradle,kt}] 20 | max_line_length = 100 21 | guidelines = 100 22 | 23 | [*.kt] 24 | ktlint_code_style = android_studio 25 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.bat text eol=crlf 3 | *.pbxproj -text 4 | *.sh text eol=lf 5 | /.yarn/releases/* binary 6 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @JasonVMo @tido64 2 | 3 | # Android 4 | *.gradle @JasonVMo @tido64 5 | android/ @JasonVMo @tido64 6 | 7 | # iOS 8 | *.podspec @JasonVMo @Saadnajmi @tido64 9 | *.rb @JasonVMo @Saadnajmi @tido64 10 | ios/ @JasonVMo @Saadnajmi @tido64 11 | 12 | # macOS 13 | macos/ @JasonVMo @Saadnajmi @tido64 14 | 15 | # visionOS 16 | visionOS/ @JasonVMo @Saadnajmi @tido64 17 | 18 | # Windows 19 | windows/ @acoates-ms @JasonVMo @tido64 20 | 21 | # Miscellaneous 22 | /CODE_OF_CONDUCT.md @microsoft/react-native-sdk-admins 23 | /LICENSE @microsoft/react-native-sdk-admins 24 | /SECURITY.md @microsoft/react-native-sdk-admins 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: "Feature request \U0001F4A1" 2 | description: Suggest an idea for this project 3 | labels: [enhancement] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this feature request! 9 | - type: textarea 10 | id: proposal 11 | attributes: 12 | label: Proposal 13 | description: Provide a clear and concise description of your motivation for this proposal (e.g. \"I'm always frustrated when…\"), and what you want to happen instead. 14 | validations: 15 | required: true 16 | - type: textarea 17 | id: alternatives 18 | attributes: 19 | label: Alternatives 20 | description: Provide a clear and concise description of any alternative solutions or features you've considered. 21 | validations: 22 | required: true 23 | - type: textarea 24 | id: implementation 25 | attributes: 26 | label: Implementation Details 27 | description: Provide a clear and concise description of how you think this could be implemented. 28 | validations: 29 | required: true 30 | - type: textarea 31 | id: additional 32 | attributes: 33 | label: Additional Context 34 | description: Add any other context or screenshots about the feature request here. 35 | - type: checkboxes 36 | id: terms 37 | attributes: 38 | label: Code of Conduct 39 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/microsoft/react-native-test-app/blob/trunk/CODE_OF_CONDUCT.md). 40 | options: 41 | - label: I agree to follow this project's Code of Conduct 42 | required: true 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new-major-version.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: New major release 3 | about: Umbrella issue for an upcoming major release (for maintainers only) 4 | title: Breaking changes in X.0 5 | --- 6 | 7 | PR: TBD 8 | Timeline: TBD 9 | 10 | ### Breaking changes 11 | 12 | - [ ] ... 13 | - [ ] .... 14 | 15 | ### Post-publish tasks 16 | 17 | - [ ] Create the `releases/X.x` branch 18 | - [ ] Create the `release-X.x` tag 19 | - [ ] Update [dependencies](https://github.com/microsoft/react-native-test-app/wiki#dependencies) 20 | - [ ] Update [Patches](https://github.com/microsoft/react-native-test-app/wiki/Patches) 21 | - [ ] [Announcements](https://github.com/microsoft/react-native-test-app/blob/trunk/CONTRIBUTING.md#release-announcements) 22 | -------------------------------------------------------------------------------- /.github/actions/affected/action.yml: -------------------------------------------------------------------------------- 1 | name: Affected Platforms 2 | description: Determines which platforms are affected by the current changes 3 | inputs: 4 | project-directory: 5 | description: The path to the root of the project directory 6 | required: true 7 | working-directory: 8 | description: The directory where commands are run 9 | required: true 10 | outputs: 11 | android: 12 | value: ${{ steps.affected.outputs.android }} 13 | ios: 14 | value: ${{ steps.affected.outputs.ios }} 15 | macos: 16 | value: ${{ steps.affected.outputs.macos }} 17 | visionos: 18 | value: ${{ steps.affected.outputs.visionos }} 19 | windows: 20 | value: ${{ steps.affected.outputs.windows }} 21 | runs: 22 | using: composite 23 | steps: 24 | - id: affected 25 | run: | 26 | affected="$(yarn show-affected origin/${{ github.base_ref }})" 27 | if [[ "$affected" = *"android"* ]]; then 28 | echo 'android=true' >> $GITHUB_OUTPUT 29 | fi 30 | if [[ "$affected" = *"ios"* ]]; then 31 | echo 'ios=true' >> $GITHUB_OUTPUT 32 | fi 33 | if [[ "$affected" = *"macos"* ]]; then 34 | echo 'macos=true' >> $GITHUB_OUTPUT 35 | fi 36 | if [[ "$affected" = *"visionos"* ]]; then 37 | echo 'visionos=true' >> $GITHUB_OUTPUT 38 | fi 39 | if [[ "$affected" = *"windows"* ]]; then 40 | echo 'windows=true' >> $GITHUB_OUTPUT 41 | fi 42 | echo $affected 43 | shell: bash 44 | -------------------------------------------------------------------------------- /.github/actions/cocoapods/action.yml: -------------------------------------------------------------------------------- 1 | name: CocoaPods 2 | description: Runs `pod install` and caches installed dependencies 3 | inputs: 4 | project-directory: 5 | description: The path to the root of the project directory 6 | required: true 7 | working-directory: 8 | description: The directory where commands are run 9 | required: true 10 | runs: 11 | using: composite 12 | steps: 13 | - name: Find `Podfile.lock` 14 | id: find-lockfile 15 | run: | 16 | podfile_lock="${{ inputs.working-directory }}/${{ inputs.project-directory }}/Podfile.lock" 17 | if [[ -f "$podfile_lock" ]]; then 18 | echo "path=$podfile_lock" >> $GITHUB_OUTPUT 19 | fi 20 | shell: bash 21 | - name: Cache /${{ inputs.working-directory }}/${{ inputs.project-directory }}/Pods 22 | if: ${{ steps.find-lockfile.outputs.path }} 23 | uses: actions/cache@v4 24 | with: 25 | path: ${{ inputs.working-directory }}/${{ inputs.project-directory }}/Pods 26 | key: ${{ runner.os }}-pods-${{ hashFiles(steps.find-lockfile.outputs.path) }} 27 | - name: Install Pods 28 | run: | 29 | pod install --project-directory=${{ inputs.project-directory }} 30 | shell: bash 31 | working-directory: ${{ inputs.working-directory }} 32 | -------------------------------------------------------------------------------- /.github/actions/gradle/action.yml: -------------------------------------------------------------------------------- 1 | name: Gradle Build 2 | description: Executes a Gradle build 3 | inputs: 4 | arguments: 5 | description: Gradle will execute a build with the provided arguments 6 | default: --no-daemon --parallel clean build check test 7 | project-root: 8 | description: The path to the root of the project 9 | required: true 10 | runs: 11 | using: composite 12 | steps: 13 | - name: Configure Gradle wrapper 14 | run: | 15 | node --eval "require('./android/gradle-wrapper.js').configureGradleWrapper('${{ inputs.project-root }}/android')" 16 | shell: bash 17 | - name: Build 18 | run: ./gradlew ${{ inputs.arguments }} 19 | shell: bash 20 | working-directory: ${{ inputs.project-root }}/android 21 | -------------------------------------------------------------------------------- /.github/actions/init-test-app/action.yml: -------------------------------------------------------------------------------- 1 | name: Create React Native Test App 2 | description: Initializes a new test app 3 | inputs: 4 | platform: 5 | description: The platform to create a test app for 6 | required: true 7 | runs: 8 | using: composite 9 | steps: 10 | - name: Install 11 | run: | 12 | scripts/build/install-test-template.sh ${{ inputs.platform }} 13 | shell: bash 14 | - name: Initialize a new app 15 | run: | 16 | if [[ ${{ inputs.platform }} == "all" ]]; then 17 | yarn init-test-app --destination test-app --name TestApp -p android -p ios -p macos -p visionos -p windows 18 | else 19 | yarn init-test-app --destination test-app --name TestApp --platform ${{ inputs.platform }} 20 | fi 21 | shell: bash 22 | working-directory: template-example 23 | -------------------------------------------------------------------------------- /.github/actions/setup-react-native/action.yml: -------------------------------------------------------------------------------- 1 | name: Setup React Native 2 | description: Set up a specific version of React Native 3 | inputs: 4 | version: 5 | description: The React Native version to set up 6 | required: true 7 | runs: 8 | using: composite 9 | steps: 10 | - name: Set up react-native@${{ inputs.version }} 11 | run: | 12 | rm example/ios/Podfile.lock 13 | rm example/macos/Podfile.lock 14 | rm example/visionos/Podfile.lock 15 | npm run set-react-version -- ${{ inputs.version }} 16 | shell: bash 17 | -------------------------------------------------------------------------------- /.github/actions/yarn/action.yml: -------------------------------------------------------------------------------- 1 | name: Yarn 2 | description: Runs `yarn install` 3 | inputs: 4 | immutable: 5 | description: Abort with an error exit code if the lockfile was to be modified 6 | default: true 7 | runs: 8 | using: composite 9 | steps: 10 | - name: Install npm dependencies 11 | if: ${{ inputs.immutable == 'true' }} 12 | run: yarn 13 | shell: bash 14 | - name: Install npm dependencies (ignore lockfile changes) 15 | if: ${{ inputs.immutable != 'true' }} 16 | run: yarn --no-immutable 17 | shell: bash 18 | -------------------------------------------------------------------------------- /.github/dependabot.disabled.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "bundler" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | versioning-strategy: "increase" 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | - package-ecosystem: "gradle" 13 | directory: "/android" 14 | schedule: 15 | interval: "weekly" 16 | - package-ecosystem: "npm" 17 | directory: "/" 18 | schedule: 19 | interval: "weekly" 20 | versioning-strategy: "lockfile-only" 21 | -------------------------------------------------------------------------------- /.github/eslint-stylish.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "eslint-stylish", 5 | "pattern": [ 6 | { 7 | "regexp": "^([^\\s].*)$", 8 | "file": 1 9 | }, 10 | { 11 | "regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*?)\\s\\s+(.*)$", 12 | "line": 1, 13 | "column": 2, 14 | "severity": 3, 15 | "code": 5, 16 | "message": 4, 17 | "loop": true 18 | } 19 | ] 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /.github/ktlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "ktlint", 5 | "pattern": [ 6 | { 7 | "regexp": "(.*?):(\\d+):(\\d+): (.*?) \\(([-\\w]+)\\)$", 8 | "file": 1, 9 | "line": 2, 10 | "column": 3, 11 | "code": 5, 12 | "message": 4 13 | } 14 | ] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.github/minitest.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "minitest", 5 | "pattern": [ 6 | { 7 | "regexp": "^.*?\\[(.*?):(\\d+)\\]:$", 8 | "file": 1, 9 | "line": 2 10 | }, 11 | { 12 | "regexp": "^\\s*((?:Expected|Actual).*)$", 13 | "message": 1, 14 | "loop": true 15 | } 16 | ] 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /.github/prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["prettier-plugin-organize-imports"], 3 | "trailingComma": "es5", 4 | "endOfLine": "auto", 5 | "overrides": [ 6 | { 7 | "files": ["*.md", "*.mdx"], 8 | "options": { 9 | "organizeImportsSkipDestructiveCodeActions": true, 10 | "proseWrap": "always" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | 12 | 13 | 19 | 20 | ### Platforms affected 21 | 22 | - [ ] Android 23 | - [ ] iOS 24 | - [ ] macOS 25 | - [ ] visionOS 26 | - [ ] Windows 27 | 28 | ### Test plan 29 | 30 | 40 | -------------------------------------------------------------------------------- /.github/rubocop.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "rubocop", 5 | "pattern": [ 6 | { 7 | "regexp": "^(.*?\\.rb):(\\d+):(\\d+):.*?:\\s*(.*?):\\s*(.*)$", 8 | "file": 1, 9 | "line": 2, 10 | "column": 3, 11 | "code": 4, 12 | "message": 5 13 | } 14 | ] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.github/swiftformat.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "swiftformat", 5 | "pattern": [ 6 | { 7 | "regexp": "react-native-test-app\\/(?!react-native-test-app)(.*):(\\d+):(\\d+): (\\w+): \\((.*?)\\) (.*?)$", 8 | "file": 1, 9 | "line": 2, 10 | "column": 3, 11 | "severity": 4, 12 | "code": 5, 13 | "message": 6 14 | } 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.github/swiftlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "swiftlint", 5 | "pattern": [ 6 | { 7 | "regexp": "react-native-test-app\\/(?!react-native-test-app)(.*):(\\d+):(\\d+): (\\w+): (.*)\\((\\w+)\\)$", 8 | "file": 1, 9 | "line": 2, 10 | "column": 3, 11 | "severity": 4, 12 | "code": 6, 13 | "message": 5 14 | } 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: CodeQL 2 | on: 3 | push: 4 | branches: 5 | - trunk 6 | - releases/* 7 | pull_request: 8 | branches: 9 | - trunk 10 | schedule: 11 | - cron: 0 4 * * 1 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | language: ["javascript", "ruby"] 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v4 27 | - name: Initialize CodeQL 28 | uses: github/codeql-action/init@v3 29 | with: 30 | languages: ${{ matrix.language }} 31 | - name: Autobuild 32 | uses: github/codeql-action/autobuild@v3 33 | - name: Perform CodeQL Analysis 34 | uses: github/codeql-action/analyze@v3 35 | with: 36 | category: "/language:${{matrix.language}}" 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.log 3 | *.tgz 4 | *.xcworkspace/ 5 | .DS_Store 6 | .android-test-* 7 | .ccache/* 8 | !.ccache/ccache.conf 9 | .cxx/ 10 | .gradle/ 11 | .idea/ 12 | .nx/cache 13 | .nx/workspace-data 14 | .vs/ 15 | .watchman-* 16 | .yarn/* 17 | !.yarn/patches/ 18 | !.yarn/plugins/ 19 | !.yarn/releases/ 20 | Pods/ 21 | android/**/build/ 22 | clang-format-diff.py 23 | coverage/ 24 | example/*/DerivedData/ 25 | example/*/build/ 26 | example/Screenshot-*.png 27 | local.properties 28 | msbuild.binlog 29 | node_modules/ 30 | !test/__fixtures__/**/node_modules/ 31 | package-lock.json 32 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 33 | template-example/ 34 | xcuserdata/ 35 | yarn-error.log* 36 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | loglevel=warn 2 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | plugins: 2 | - rubocop-minitest 3 | 4 | AllCops: 5 | NewCops: enable 6 | Exclude: 7 | - "**/Pods/**/*" 8 | - "**/build/generated/**/*" 9 | - "**/node_modules/**/*" 10 | - "vendor/bundle/**/*" 11 | TargetRubyVersion: 2.6 12 | 13 | Layout/LineLength: 14 | Max: 100 15 | 16 | Metrics/AbcSize: 17 | Enabled: false 18 | 19 | Metrics/BlockLength: 20 | Enabled: false 21 | 22 | Metrics/ClassLength: 23 | Enabled: false 24 | 25 | Metrics/MethodLength: 26 | Enabled: false 27 | 28 | Metrics/CyclomaticComplexity: 29 | AllowedMethods: 30 | - make_project! 31 | - react_native_pods 32 | - use_test_app_internal! 33 | 34 | Metrics/PerceivedComplexity: 35 | AllowedMethods: 36 | - make_project! 37 | - react_native_pods 38 | - use_test_app_internal! 39 | 40 | Naming/FileName: 41 | Exclude: 42 | - !ruby/regexp /-\d+\.\d+\.rb$/ 43 | - "**/*.podspec" 44 | 45 | Style/Documentation: 46 | Enabled: false 47 | 48 | Style/FrozenStringLiteralComment: 49 | Enabled: false 50 | 51 | Style/HashEachMethods: 52 | Enabled: true 53 | 54 | Style/HashSyntax: 55 | Enabled: false 56 | 57 | Style/HashTransformKeys: 58 | Enabled: true 59 | 60 | Style/HashTransformValues: 61 | Enabled: true 62 | 63 | Style/TrailingCommaInArrayLiteral: 64 | EnforcedStyleForMultiline: comma 65 | 66 | Style/TrailingCommaInHashLiteral: 67 | EnforcedStyleForMultiline: comma 68 | -------------------------------------------------------------------------------- /.swiftformat: -------------------------------------------------------------------------------- 1 | --swiftversion 5.10 2 | --ifdef no-indent 3 | --stripunusedargs closure-only 4 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - function_body_length 3 | - opening_brace # Conflicts with SwiftFormat 4 | - trailing_comma 5 | excluded: 6 | - example/*/Pods/ 7 | - example/node_modules/ 8 | - node_modules/ 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "files.associations": { 4 | "any": "cpp", 5 | "fstream": "cpp", 6 | "iostream": "cpp", 7 | "map": "cpp", 8 | "optional": "cpp", 9 | "string": "cpp", 10 | "vector": "cpp" 11 | }, 12 | "react-native-tools.projectRoot": "./example" 13 | } 14 | -------------------------------------------------------------------------------- /.yarn/patches/appium-npm-2.11.2-f39bb587af.patch: -------------------------------------------------------------------------------- 1 | diff --git a/build/lib/extension/manifest.js b/build/lib/extension/manifest.js 2 | index 5b650a6ff4dbe737ffdf8821e255e9e4e3d89da3..6179965231285c3ae1d3cddee0c45c57ab3fba03 100644 3 | --- a/build/lib/extension/manifest.js 4 | +++ b/build/lib/extension/manifest.js 5 | @@ -195,12 +195,14 @@ class Manifest { 6 | onMatch(path_1.default.join(__classPrivateFieldGet(this, _Manifest_appiumHome, "f"), 'package.json'), true), 7 | ]; 8 | // add dependencies to the queue 9 | - const filepaths = await support_1.fs.glob('node_modules/{*,@*/*}/package.json', { 10 | - cwd: __classPrivateFieldGet(this, _Manifest_appiumHome, "f"), 11 | - absolute: true, 12 | - }); 13 | - for (const filepath of filepaths) { 14 | - queue.push(onMatch(filepath)); 15 | + const appPkgPath = path_1.default.join(process.cwd(), 'package.json'); 16 | + const appPkg = JSON.parse(await support_1.fs.readFile(appPkgPath, 'utf8')); 17 | + for (const name of Object.keys(appPkg.devDependencies)) { 18 | + try { 19 | + queue.push(onMatch(require.resolve(name + "/package.json"))); 20 | + } catch (_) { 21 | + // Ignore packages that don't export `./package.json` 22 | + } 23 | } 24 | // wait for everything to finish 25 | await bluebird_1.default.all(queue); 26 | -------------------------------------------------------------------------------- /.yarn/plugins/@yarnpkg/plugin-compat.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "@yarnpkg/plugin-compat", 3 | factory: () => ({}), 4 | }; 5 | -------------------------------------------------------------------------------- /.yarn/plugins/clean.cjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | const { spawnSync } = require("node:child_process"); 3 | const fs = require("node:fs"); 4 | const path = require("node:path"); 5 | 6 | /** @type {{ name: string; factory: (require: NodeRequire) => unknown; }} */ 7 | module.exports = { 8 | name: "plugin-clean", 9 | factory: (require) => { 10 | // @ts-expect-error Yarn internal package 11 | const { BaseCommand } = require("@yarnpkg/cli"); 12 | 13 | class CleanCommand extends BaseCommand { 14 | static paths = [["clean"]]; 15 | 16 | async execute() { 17 | const projectRoot = path.dirname(path.dirname(__dirname)); 18 | 19 | // Remove the symlink first. On Windows, `git clean` resolves/traverses 20 | // the symlink, causing an infinite loop. 21 | const symlink = path.join( 22 | projectRoot, 23 | "example", 24 | "node_modules", 25 | "react-native-test-app" 26 | ); 27 | fs.rmSync(symlink, { force: true, maxRetries: 3, recursive: true }); 28 | 29 | spawnSync("git", ["clean", "-dfqx", "--exclude=.yarn/cache"], { 30 | cwd: projectRoot, 31 | stdio: "inherit", 32 | }); 33 | } 34 | } 35 | 36 | return { commands: [CleanCommand] }; 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | compressionLevel: 0 2 | enableGlobalCache: false 3 | enableScripts: false 4 | enableTelemetry: false 5 | logFilters: 6 | - code: YN0007 # X must be built because it never has been before or the last one failed 7 | level: discard 8 | - code: YN0008 # X must be rebuilt because its dependency tree changed 9 | level: discard 10 | - code: YN0013 # X can't be found in the cache and will be fetched from the remote registry 11 | level: discard 12 | - code: YN0069 # This rule seems redundant when applied on the original package 13 | level: error 14 | nodeLinker: node-modules 15 | npmRegistryServer: "https://registry.npmjs.org" 16 | packageExtensions: 17 | react-native-windows@*: 18 | peerDependenciesMeta: 19 | "@types/react": 20 | optional: true 21 | plugins: 22 | - path: .yarn/plugins/@yarnpkg/plugin-compat.cjs 23 | spec: "@yarnpkg/plugin-compat" 24 | - path: .yarn/plugins/clean.cjs 25 | - path: .yarn/plugins/link-project.cjs 26 | - path: .yarn/plugins/boost-workaround.cjs 27 | - path: .yarn/plugins/npm-workaround.cjs 28 | - path: .yarn/plugins/undo-bin-sorting.cjs 29 | tsEnableAutoTypes: false 30 | yarnPath: .yarn/releases/yarn-4.6.0.cjs 31 | -------------------------------------------------------------------------------- /Brewfile: -------------------------------------------------------------------------------- 1 | tap 'homebrew/cask-versions' 2 | brew 'clang-format' 3 | brew 'ktlint' 4 | brew 'n' 5 | brew 'swiftformat' 6 | brew 'swiftlint' 7 | brew 'xcbeautify' 8 | brew 'yarn' 9 | cask 'temurin11' 10 | cask 'temurin17' 11 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | - Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support) 11 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | gem 'minitest' 6 | gem 'rubocop', require: false 7 | gem 'rubocop-minitest' 8 | gem 'xcodeproj' 9 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.7) 5 | base64 6 | nkf 7 | rexml 8 | ast (2.4.3) 9 | atomos (0.1.3) 10 | base64 (0.2.0) 11 | claide (1.1.0) 12 | colored2 (3.1.2) 13 | json (2.11.3) 14 | language_server-protocol (3.17.0.4) 15 | lint_roller (1.1.0) 16 | minitest (5.25.5) 17 | nanaimo (0.4.0) 18 | nkf (0.2.0) 19 | parallel (1.27.0) 20 | parser (3.3.8.0) 21 | ast (~> 2.4.1) 22 | racc 23 | prism (1.4.0) 24 | racc (1.8.1) 25 | rainbow (3.1.1) 26 | regexp_parser (2.10.0) 27 | rexml (3.4.0) 28 | rubocop (1.75.5) 29 | json (~> 2.3) 30 | language_server-protocol (~> 3.17.0.2) 31 | lint_roller (~> 1.1.0) 32 | parallel (~> 1.10) 33 | parser (>= 3.3.0.2) 34 | rainbow (>= 2.2.2, < 4.0) 35 | regexp_parser (>= 2.9.3, < 3.0) 36 | rubocop-ast (>= 1.44.0, < 2.0) 37 | ruby-progressbar (~> 1.7) 38 | unicode-display_width (>= 2.4.0, < 4.0) 39 | rubocop-ast (1.44.1) 40 | parser (>= 3.3.7.2) 41 | prism (~> 1.4) 42 | rubocop-minitest (0.38.0) 43 | lint_roller (~> 1.1) 44 | rubocop (>= 1.75.0, < 2.0) 45 | rubocop-ast (>= 1.38.0, < 2.0) 46 | ruby-progressbar (1.13.0) 47 | unicode-display_width (2.6.0) 48 | xcodeproj (1.27.0) 49 | CFPropertyList (>= 2.3.3, < 4.0) 50 | atomos (~> 0.1.3) 51 | claide (>= 1.0.2, < 2.0) 52 | colored2 (~> 3.1) 53 | nanaimo (~> 0.4.0) 54 | rexml (>= 3.3.6, < 4.0) 55 | 56 | PLATFORMS 57 | arm64-darwin-23 58 | ruby 59 | 60 | DEPENDENCIES 61 | minitest 62 | rubocop 63 | rubocop-minitest 64 | xcodeproj 65 | 66 | BUNDLED WITH 67 | 2.6.8 68 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /android/app/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/devserverhelper-0.73/java/com/microsoft/reacttestapp/react/DevServerHelperCompat.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.react 2 | 3 | import android.content.Context 4 | import com.facebook.react.devsupport.DevServerHelper 5 | import com.facebook.react.devsupport.InspectorPackagerConnection.BundleStatus 6 | import com.facebook.react.modules.debug.interfaces.DeveloperSettings 7 | import com.facebook.react.packagerconnection.PackagerConnectionSettings 8 | 9 | fun createDevServerHelper(context: Context, developerSettings: DeveloperSettings): DevServerHelper = 10 | DevServerHelper( 11 | developerSettings, 12 | context.packageName, 13 | { BundleStatus() }, 14 | PackagerConnectionSettings(context) 15 | ) 16 | -------------------------------------------------------------------------------- /android/app/src/devserverhelper-0.74/java/com/microsoft/reacttestapp/react/DevServerHelperCompat.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.react 2 | 3 | import android.content.Context 4 | import com.facebook.react.devsupport.DevServerHelper 5 | import com.facebook.react.modules.debug.interfaces.DeveloperSettings 6 | import com.facebook.react.packagerconnection.PackagerConnectionSettings 7 | 8 | fun createDevServerHelper(context: Context, developerSettings: DeveloperSettings): DevServerHelper = 9 | DevServerHelper( 10 | developerSettings, 11 | context.packageName, 12 | PackagerConnectionSettings(context) 13 | ) 14 | -------------------------------------------------------------------------------- /android/app/src/devserverhelper-0.75/java/com/microsoft/reacttestapp/react/DevServerHelperCompat.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.react 2 | 3 | import android.content.Context 4 | import com.facebook.react.devsupport.DevServerHelper 5 | import com.facebook.react.modules.debug.interfaces.DeveloperSettings 6 | import com.facebook.react.packagerconnection.PackagerConnectionSettings 7 | 8 | fun createDevServerHelper(context: Context, developerSettings: DeveloperSettings): DevServerHelper = 9 | DevServerHelper( 10 | developerSettings, 11 | context, 12 | PackagerConnectionSettings(context) 13 | ) 14 | -------------------------------------------------------------------------------- /android/app/src/devserverhelper-pre-0.73/java/com/microsoft/reacttestapp/react/DevServerHelperCompat.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.react 2 | 3 | import android.content.Context 4 | import com.facebook.react.devsupport.DevInternalSettings 5 | import com.facebook.react.devsupport.DevServerHelper 6 | import com.facebook.react.devsupport.InspectorPackagerConnection.BundleStatus 7 | import com.facebook.react.modules.debug.interfaces.DeveloperSettings 8 | 9 | fun createDevServerHelper( 10 | context: Context, 11 | @Suppress("UNUSED_PARAMETER") developerSettings: DeveloperSettings 12 | ): DevServerHelper = DevServerHelper( 13 | DevInternalSettings(context) {}, 14 | context.packageName, 15 | { BundleStatus() } 16 | ) 17 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/microsoft/reacttestapp/component/ComponentViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.component 2 | 3 | import android.os.Bundle 4 | 5 | data class ComponentViewModel( 6 | val name: String, 7 | val displayName: String, 8 | val initialProperties: Bundle?, 9 | val presentationStyle: String? 10 | ) 11 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/microsoft/reacttestapp/manifest/Manifest.kt: -------------------------------------------------------------------------------- 1 | // This file was generated by generate-manifest.mts. 2 | // DO NOT MODIFY. ALL CHANGES WILL BE OVERWRITTEN. 3 | 4 | @file:Suppress("ktlint:standard:trailing-comma-on-declaration-site") 5 | 6 | package com.microsoft.reacttestapp.manifest 7 | 8 | import android.os.Bundle 9 | 10 | data class Component( 11 | val appKey: String, 12 | val displayName: String?, 13 | val initialProperties: Bundle?, 14 | val presentationStyle: String?, 15 | val slug: String?, 16 | ) 17 | 18 | data class Manifest( 19 | val name: String, 20 | val displayName: String, 21 | val version: String?, 22 | val bundleRoot: String?, 23 | val singleApp: String?, 24 | val components: List?, 25 | ) 26 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/microsoft/reacttestapp/react/AppRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.react 2 | 3 | import com.facebook.react.bridge.ReactApplicationContext 4 | import com.facebook.soloader.SoLoader 5 | 6 | /** 7 | * The corresponding C++ implementation is in `android/app/src/main/jni/AppRegistry.cpp` 8 | */ 9 | class AppRegistry { 10 | companion object { 11 | init { 12 | SoLoader.loadLibrary("reacttestapp_appmodules") 13 | } 14 | 15 | fun getAppKeys(context: ReactApplicationContext): Array { 16 | val jsContext = context.javaScriptContextHolder?.get() ?: return arrayOf() 17 | val appKeys = AppRegistry().getAppKeys(jsContext) ?: return arrayOf() 18 | return appKeys.filterIsInstance().toTypedArray() 19 | } 20 | } 21 | 22 | private external fun getAppKeys(jsiPtr: Long): Array? 23 | } 24 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/microsoft/reacttestapp/react/ReactBundleNameProvider.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.react 2 | 3 | import android.content.Context 4 | 5 | class ReactBundleNameProvider(private val context: Context, private val bundleRoot: String?) { 6 | val bundleName: String? by lazy { 7 | val possibleEntryFiles = getPossibleEntryFiles(bundleRoot) 8 | context.resources.assets.list("") 9 | ?.firstOrNull { possibleEntryFiles.contains(it) } 10 | } 11 | 12 | private fun getPossibleEntryFiles(bundleRoot: String?): List { 13 | val extensions = listOf( 14 | ".android.bundle", 15 | ".android.jsbundle", 16 | ".mobile.bundle", 17 | ".mobile.jsbundle", 18 | ".native.bundle", 19 | ".native.jsbundle", 20 | ".bundle", 21 | ".jsbundle" 22 | ) 23 | 24 | if (bundleRoot == null) { 25 | val candidates = mutableListOf() 26 | extensions.forEach { 27 | candidates.add("index$it") 28 | candidates.add("main$it") 29 | } 30 | return candidates 31 | } 32 | 33 | return extensions.map { bundleRoot + it } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /android/app/src/main/jni/AppRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "AppRegistry.h" 2 | 3 | #include "common/AppRegistry.h" 4 | 5 | extern "C" { 6 | 7 | JNIEXPORT jobjectArray JNICALL Java_com_microsoft_reacttestapp_react_AppRegistry_getAppKeys( 8 | JNIEnv *env, jclass clazz, jlong jsiPtr) 9 | { 10 | auto runtime = reinterpret_cast(jsiPtr); 11 | auto appKeys = ReactTestApp::GetAppKeys(*runtime); 12 | auto numKeys = static_cast(appKeys.size()); 13 | auto result = env->NewObjectArray(numKeys, env->FindClass("java/lang/String"), nullptr); 14 | for (int i = 0; i < numKeys; ++i) { 15 | env->SetObjectArrayElement(result, i, env->NewStringUTF(appKeys[i].c_str())); 16 | } 17 | return result; 18 | } 19 | 20 | } // extern "C" 21 | -------------------------------------------------------------------------------- /android/app/src/main/jni/AppRegistry.h: -------------------------------------------------------------------------------- 1 | #ifndef ANDROID_JNI_APPREGISTRY_ 2 | #define ANDROID_JNI_APPREGISTRY_ 3 | 4 | #include 5 | 6 | extern "C" { 7 | 8 | JNIEXPORT jobjectArray JNICALL Java_com_microsoft_reacttestapp_react_AppRegistry_getAppKeys( 9 | JNIEnv *env, jclass clazz, jlong jsiPtr); 10 | 11 | } // extern "C" 12 | 13 | #endif // ANDROID_JNI_APPREGISTRY_ 14 | -------------------------------------------------------------------------------- /android/app/src/main/jni/AutolinkingCompat.h: -------------------------------------------------------------------------------- 1 | #ifndef REACTAPP_JNI_AUTOLINKINGCOMPAT_H_ 2 | #define REACTAPP_JNI_AUTOLINKINGCOMPAT_H_ 3 | 4 | #if __has_include() // >= 0.75 5 | 6 | #include 7 | 8 | #define autolinking_ModuleProvider facebook::react::autolinking_ModuleProvider 9 | #define autolinking_cxxModuleProvider facebook::react::autolinking_cxxModuleProvider 10 | #define autolinking_registerProviders facebook::react::autolinking_registerProviders 11 | 12 | #else // < 0.75 13 | 14 | #include 15 | 16 | #define autolinking_ModuleProvider facebook::react::rncli_ModuleProvider 17 | #define autolinking_cxxModuleProvider facebook::react::rncli_cxxModuleProvider 18 | #define autolinking_registerProviders facebook::react::rncli_registerProviders 19 | 20 | #endif // __has_include() 21 | 22 | #endif // REACTAPP_JNI_AUTOLINKINGCOMPAT_H_ 23 | -------------------------------------------------------------------------------- /android/app/src/main/jni/ComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #ifndef REACTTESTAPP_JNI_COMPONENTSREGISTRY_H_ 2 | #define REACTTESTAPP_JNI_COMPONENTSREGISTRY_H_ 3 | 4 | #include 5 | 6 | #if __has_include() // >= 0.71 7 | #include 8 | #else // < 0.71 9 | #include 10 | #endif 11 | 12 | namespace ReactTestApp 13 | { 14 | class ComponentsRegistry : public facebook::jni::HybridClass 15 | { 16 | public: 17 | constexpr static auto kJavaDescriptor = 18 | "Lcom/microsoft/reacttestapp/fabric/ComponentsRegistry;"; 19 | 20 | static void registerNatives(); 21 | 22 | ComponentsRegistry(facebook::react::ComponentFactory *delegate); 23 | 24 | private: 25 | static facebook::jni::local_ref 26 | initHybrid(facebook::jni::alias_ref, facebook::react::ComponentFactory *delegate); 27 | }; 28 | } // namespace ReactTestApp 29 | 30 | #endif // REACTTESTAPP_JNI_COMPONENTSREGISTRY_H_ 31 | -------------------------------------------------------------------------------- /android/app/src/main/jni/TurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef REACTTESTAPP_JNI_TURBOMODULEMANAGERDELEGATE_H_ 2 | #define REACTTESTAPP_JNI_TURBOMODULEMANAGERDELEGATE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | 11 | namespace ReactTestApp 12 | { 13 | class TurboModuleManagerDelegate 14 | : public facebook::jni::HybridClass 16 | { 17 | using SharedCallInvoker = const std::shared_ptr &; 18 | using StringRef = const std::string &; 19 | 20 | public: 21 | static constexpr auto kJavaDescriptor = 22 | "Lcom/microsoft/reacttestapp/turbomodule/TurboModuleManagerDelegate;"; 23 | 24 | static void registerNatives(); 25 | 26 | std::shared_ptr 27 | getTurboModule(StringRef name, SharedCallInvoker jsInvoker) override; 28 | 29 | std::shared_ptr 30 | getTurboModule(StringRef name, // 31 | const facebook::react::JavaTurboModule::InitParams ¶ms) override; 32 | 33 | private: 34 | static facebook::jni::local_ref 35 | initHybrid(facebook::jni::alias_ref); 36 | 37 | /** 38 | * Test-only method. Allows user to verify whether a TurboModule can be 39 | * created by instances of this class. 40 | */ 41 | bool canCreateTurboModule(StringRef name); 42 | }; 43 | } // namespace ReactTestApp 44 | 45 | #endif // REACTTESTAPP_JNI_TURBOMODULEMANAGERDELEGATE_H_ 46 | -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res-launcher/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/android/app/src/main/res-launcher/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 18 | 19 | 20 | 21 | 29 | 30 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/camera_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/recyclerview_item_component.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /android/app/src/main/res/menu/top_app_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 14 | 20 | 25 | 31 | 32 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/app/src/new-arch-0.73/java/com/microsoft/reacttestapp/compat/ReactNativeHostCompat.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.compat 2 | 3 | import android.app.Application 4 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint 5 | import com.facebook.react.defaults.DefaultReactNativeHost 6 | import com.facebook.soloader.SoLoader 7 | import com.microsoft.reacttestapp.BuildConfig 8 | 9 | abstract class ReactNativeHostCompat(application: Application) : 10 | DefaultReactNativeHost(application) { 11 | 12 | companion object { 13 | init { 14 | try { 15 | DefaultNewArchitectureEntryPoint.load( 16 | turboModulesEnabled = BuildConfig.REACTAPP_USE_FABRIC, 17 | fabricEnabled = BuildConfig.REACTAPP_USE_FABRIC, 18 | bridgelessEnabled = BuildConfig.REACTAPP_USE_BRIDGELESS 19 | ) 20 | } catch (e: UnsatisfiedLinkError) { 21 | // Older versions of `DefaultNewArchitectureEntryPoint` is 22 | // hard coded to load `libappmodules.so` 23 | } 24 | SoLoader.loadLibrary("reacttestapp_appmodules") 25 | } 26 | } 27 | 28 | override val isNewArchEnabled: Boolean = BuildConfig.REACTAPP_USE_FABRIC 29 | override val isHermesEnabled: Boolean? = true 30 | } 31 | -------------------------------------------------------------------------------- /android/app/src/new-arch-0.73/java/com/microsoft/reacttestapp/fabric/ComponentsRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.fabric 2 | 3 | import com.facebook.jni.HybridData 4 | import com.facebook.proguard.annotations.DoNotStrip 5 | import com.facebook.react.fabric.ComponentFactory 6 | import com.facebook.soloader.SoLoader 7 | 8 | /** 9 | * The corresponding C++ implementation is in `android/app/src/main/jni/ComponentsRegistry.cpp` 10 | */ 11 | @DoNotStrip 12 | class ComponentsRegistry @DoNotStrip private constructor(componentFactory: ComponentFactory) { 13 | 14 | companion object { 15 | @DoNotStrip 16 | fun register(componentFactory: ComponentFactory): ComponentsRegistry = 17 | ComponentsRegistry(componentFactory) 18 | 19 | init { 20 | SoLoader.loadLibrary("fabricjni") 21 | SoLoader.loadLibrary("reacttestapp_appmodules") 22 | } 23 | } 24 | 25 | @DoNotStrip 26 | private val mHybridData: HybridData 27 | 28 | @DoNotStrip 29 | private external fun initHybrid(componentFactory: ComponentFactory): HybridData 30 | 31 | init { 32 | mHybridData = initHybrid(componentFactory) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/app/src/new-arch-0.73/java/com/microsoft/reacttestapp/turbomodule/TurboModuleManagerDelegate.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.turbomodule 2 | 3 | import com.facebook.jni.HybridData 4 | import com.facebook.react.ReactPackage 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate 6 | import com.facebook.react.bridge.ReactApplicationContext 7 | 8 | /** 9 | * These type aliases are here to prevent `@react-native-community/cli` from 10 | * marking them as native modules to autolink. 11 | * 12 | * See also `matchClassName` in 13 | * https://github.com/react-native-community/cli/blob/8.x/packages/platform-android/src/config/findPackageClassName.ts#L25 14 | */ 15 | typealias PackagesList = List 16 | typealias ReactTurboModuleManagerDelegate = ReactPackageTurboModuleManagerDelegate 17 | typealias ReactTurboModuleManagerDelegateBuilder = ReactPackageTurboModuleManagerDelegate.Builder 18 | 19 | /** 20 | * The corresponding C++ implementation is in `android/app/src/main/jni/TurboModuleManagerDelegate.cpp` 21 | */ 22 | class TurboModuleManagerDelegate protected constructor( 23 | reactApplicationContext: ReactApplicationContext?, 24 | packages: PackagesList? 25 | ) : ReactTurboModuleManagerDelegate(reactApplicationContext, packages) { 26 | 27 | external override fun initHybrid(): HybridData 28 | 29 | external fun canCreateTurboModule(moduleName: String?): Boolean 30 | 31 | class Builder : ReactTurboModuleManagerDelegateBuilder() { 32 | override fun build( 33 | context: ReactApplicationContext?, 34 | packages: PackagesList? 35 | ): TurboModuleManagerDelegate = TurboModuleManagerDelegate(context, packages) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /android/app/src/new-arch/java/com/microsoft/reacttestapp/compat/ReactNativeHostCompat.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.compat 2 | 3 | import android.app.Application 4 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint 5 | import com.facebook.react.defaults.DefaultReactNativeHost 6 | import com.facebook.soloader.SoLoader 7 | import com.microsoft.reacttestapp.BuildConfig 8 | 9 | abstract class ReactNativeHostCompat(application: Application) : 10 | DefaultReactNativeHost(application) { 11 | 12 | companion object { 13 | init { 14 | try { 15 | DefaultNewArchitectureEntryPoint.load( 16 | turboModulesEnabled = BuildConfig.REACTAPP_USE_FABRIC, 17 | fabricEnabled = BuildConfig.REACTAPP_USE_FABRIC 18 | ) 19 | } catch (e: UnsatisfiedLinkError) { 20 | // Older versions of `DefaultNewArchitectureEntryPoint` is 21 | // hard coded to load `libappmodules.so` 22 | } 23 | SoLoader.loadLibrary("reacttestapp_appmodules") 24 | } 25 | } 26 | 27 | override val isNewArchEnabled: Boolean = BuildConfig.REACTAPP_USE_FABRIC 28 | override val isHermesEnabled: Boolean? = true 29 | } 30 | -------------------------------------------------------------------------------- /android/app/src/new-arch/java/com/microsoft/reacttestapp/fabric/ComponentsRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.fabric 2 | 3 | import com.facebook.jni.HybridData 4 | import com.facebook.proguard.annotations.DoNotStrip 5 | import com.facebook.react.fabric.ComponentFactory 6 | import com.facebook.soloader.SoLoader 7 | 8 | /** 9 | * The corresponding C++ implementation is in `android/app/src/main/jni/ComponentsRegistry.cpp` 10 | */ 11 | @DoNotStrip 12 | class ComponentsRegistry @DoNotStrip private constructor(componentFactory: ComponentFactory) { 13 | 14 | companion object { 15 | @DoNotStrip 16 | fun register(componentFactory: ComponentFactory): ComponentsRegistry = 17 | ComponentsRegistry(componentFactory) 18 | 19 | init { 20 | SoLoader.loadLibrary("fabricjni") 21 | SoLoader.loadLibrary("reacttestapp_appmodules") 22 | } 23 | } 24 | 25 | @DoNotStrip 26 | private val mHybridData: HybridData 27 | 28 | @DoNotStrip 29 | private external fun initHybrid(componentFactory: ComponentFactory): HybridData 30 | 31 | init { 32 | mHybridData = initHybrid(componentFactory) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/app/src/new-arch/java/com/microsoft/reacttestapp/turbomodule/TurboModuleManagerDelegate.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.turbomodule 2 | 3 | import com.facebook.jni.HybridData 4 | import com.facebook.react.ReactPackage 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate 6 | import com.facebook.react.bridge.ReactApplicationContext 7 | 8 | /** 9 | * These type aliases are here to prevent `@react-native-community/cli` from 10 | * marking them as native modules to autolink. 11 | * 12 | * See also `matchClassName` in 13 | * https://github.com/react-native-community/cli/blob/8.x/packages/platform-android/src/config/findPackageClassName.ts#L25 14 | */ 15 | typealias PackagesList = List 16 | typealias ReactTurboModuleManagerDelegate = ReactPackageTurboModuleManagerDelegate 17 | typealias ReactTurboModuleManagerDelegateBuilder = ReactPackageTurboModuleManagerDelegate.Builder 18 | 19 | /** 20 | * The corresponding C++ implementation is in `android/app/src/main/jni/TurboModuleManagerDelegate.cpp` 21 | */ 22 | class TurboModuleManagerDelegate protected constructor( 23 | reactApplicationContext: ReactApplicationContext?, 24 | packages: PackagesList? 25 | ) : ReactTurboModuleManagerDelegate(reactApplicationContext, packages) { 26 | 27 | external override fun initHybrid(): HybridData 28 | 29 | external fun canCreateTurboModule(moduleName: String?): Boolean 30 | 31 | class Builder : ReactTurboModuleManagerDelegateBuilder() { 32 | override fun build( 33 | context: ReactApplicationContext?, 34 | packages: PackagesList? 35 | ): TurboModuleManagerDelegate = TurboModuleManagerDelegate(context, packages) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /android/app/src/no-camera/java/com/microsoft/reacttestapp/camera/MainActivityExtensions.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.camera 2 | 3 | import com.microsoft.reacttestapp.MainActivity 4 | 5 | fun MainActivity.canUseCamera() = false 6 | 7 | fun MainActivity.scanForQrCode() { 8 | // noop 9 | } 10 | -------------------------------------------------------------------------------- /android/app/src/old-arch/java/com/microsoft/reacttestapp/compat/ReactNativeHostCompat.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.compat 2 | 3 | typealias ReactNativeHostCompat = com.facebook.react.ReactNativeHost 4 | -------------------------------------------------------------------------------- /android/app/src/reactactivitydelegate-0.72/java/com/microsoft/reacttestapp/component/ComponentActivityDelegate.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.component 2 | 3 | import android.os.Bundle 4 | import com.facebook.react.ReactActivity 5 | import com.facebook.react.ReactActivityDelegate 6 | import com.facebook.react.ReactRootView 7 | import com.microsoft.reacttestapp.BuildConfig 8 | 9 | class ComponentActivityDelegate(activity: ReactActivity, mainComponentName: String?) : 10 | ReactActivityDelegate(activity, mainComponentName) { 11 | 12 | override fun getLaunchOptions(): Bundle? = plainActivity.intent.extras?.getBundle( 13 | ComponentActivity.COMPONENT_INITIAL_PROPERTIES 14 | ) 15 | 16 | override fun createRootView(): ReactRootView { 17 | val rootView = super.createRootView() 18 | rootView.setIsFabric(BuildConfig.REACTAPP_USE_FABRIC) 19 | return rootView 20 | } 21 | 22 | override fun createRootView(bundle: Bundle?): ReactRootView { 23 | val rootView = super.createRootView(bundle) 24 | rootView.setIsFabric(BuildConfig.REACTAPP_USE_FABRIC) 25 | return rootView 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/app/src/reactactivitydelegate-0.74/java/com/microsoft/reacttestapp/component/ComponentActivityDelegate.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.component 2 | 3 | import android.os.Bundle 4 | import com.facebook.react.ReactActivity 5 | import com.facebook.react.ReactActivityDelegate 6 | import com.facebook.react.ReactRootView 7 | import com.microsoft.reacttestapp.BuildConfig 8 | 9 | class ComponentActivityDelegate(activity: ReactActivity, mainComponentName: String?) : 10 | ReactActivityDelegate(activity, mainComponentName) { 11 | 12 | override fun getLaunchOptions(): Bundle? = plainActivity.intent.extras?.getBundle( 13 | ComponentActivity.COMPONENT_INITIAL_PROPERTIES 14 | ) 15 | 16 | override fun isFabricEnabled(): Boolean = BuildConfig.REACTAPP_USE_FABRIC 17 | 18 | override fun createRootView(): ReactRootView = 19 | ReactRootView(context).apply { setIsFabric(BuildConfig.REACTAPP_USE_FABRIC) } 20 | 21 | override fun createRootView(bundle: Bundle?): ReactRootView = 22 | ReactRootView(context).apply { setIsFabric(BuildConfig.REACTAPP_USE_FABRIC) } 23 | } 24 | -------------------------------------------------------------------------------- /android/app/src/reactactivitydelegate-0.75/java/com/microsoft/reacttestapp/component/ComponentActivityDelegate.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.component 2 | 3 | import android.os.Bundle 4 | import com.facebook.react.ReactActivity 5 | import com.facebook.react.ReactActivityDelegate 6 | import com.microsoft.reacttestapp.BuildConfig 7 | 8 | class ComponentActivityDelegate(activity: ReactActivity, mainComponentName: String?) : 9 | ReactActivityDelegate(activity, mainComponentName) { 10 | 11 | override fun getLaunchOptions(): Bundle? = plainActivity.intent.extras?.getBundle( 12 | ComponentActivity.COMPONENT_INITIAL_PROPERTIES 13 | ) 14 | 15 | override fun isFabricEnabled(): Boolean = BuildConfig.REACTAPP_USE_FABRIC 16 | } 17 | -------------------------------------------------------------------------------- /android/app/src/reactactivitydelegate-pre-0.72/java/com/microsoft/reacttestapp/component/ComponentActivityDelegate.kt: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.component 2 | 3 | import android.os.Bundle 4 | import com.facebook.react.ReactActivity 5 | import com.facebook.react.ReactActivityDelegate 6 | import com.facebook.react.ReactRootView 7 | import com.microsoft.reacttestapp.BuildConfig 8 | 9 | class ComponentActivityDelegate(activity: ReactActivity, mainComponentName: String?) : 10 | ReactActivityDelegate(activity, mainComponentName) { 11 | 12 | override fun getLaunchOptions(): Bundle? = plainActivity.intent.extras?.getBundle( 13 | ComponentActivity.COMPONENT_INITIAL_PROPERTIES 14 | ) 15 | 16 | override fun createRootView(): ReactRootView { 17 | val rootView = super.createRootView() 18 | rootView.setIsFabric(BuildConfig.REACTAPP_USE_FABRIC) 19 | return rootView 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /android/autolink.gradle: -------------------------------------------------------------------------------- 1 | import groovy.json.JsonSlurper 2 | 3 | ext.rnta_autolink_gradle = true 4 | 5 | ext.autolinkModules = { File projectRoot, File output, String testAppDir -> 6 | String[] autolink = ["node", "${testAppDir}/android/autolink.mjs", projectRoot.toString(), output.toString()] 7 | def stderr = new StringBuffer() 8 | def proc = Runtime.runtime.exec(autolink, null, projectRoot) 9 | proc.waitForProcessOutput(null, stderr) 10 | if (proc.exitValue() != 0) { 11 | throw new RuntimeException("Failed to autolink:\n${stderr}") 12 | } 13 | 14 | return new JsonSlurper().parseText(output.text) 15 | } 16 | 17 | ext.autolinkingInfo = { File buildDir -> 18 | def autolinking = file("${buildDir}/generated/rnta/autolinking.json") 19 | return new JsonSlurper().parseText(autolinking.text) 20 | } 21 | -------------------------------------------------------------------------------- /android/config-plugins.gradle: -------------------------------------------------------------------------------- 1 | ext.rnta_config_plugins_gradle = true 2 | 3 | if (!hasProperty("rnta_node_gradle")) { 4 | apply(from: "${buildscript.sourceFile.getParent()}/node.gradle") 5 | } 6 | 7 | ext.applyConfigPlugins = { File rootDir, String testAppDir -> 8 | if (!findNodeModulesPath("@expo/config-plugins", rootDir)) { 9 | return 10 | } 11 | 12 | String[] patch = ["node", "${testAppDir}/scripts/apply-config-plugins.mjs", "--android"] 13 | def stderr = new StringBuffer() 14 | def proc = Runtime.runtime.exec(patch, null, rootDir) 15 | proc.waitForProcessOutput(null, stderr) 16 | if (proc.exitValue() != 0) { 17 | throw new RuntimeException("Failed to apply config plugins:\n${stderr}") 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /android/media-types.gradle: -------------------------------------------------------------------------------- 1 | ext.rnta_media_types_gradle = true 2 | 3 | ext.isFontFile = { File file -> 4 | // https://github.com/facebook/react-native/blob/3dfedbc1aec18a4255e126fde96d5dc7b1271ea7/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/assets/ReactFontManager.java#L28 5 | return [".otf", ".ttf"].any { file.name.endsWith(it) } 6 | } 7 | 8 | ext.isMediaFile = { File file -> 9 | // https://developer.android.com/media/platform/supported-formats 10 | return [ 11 | ".3gp", 12 | ".aac", 13 | ".amr", 14 | ".flac", 15 | ".imy", 16 | ".m4a", 17 | ".mid", 18 | ".mkv", 19 | ".mp3", 20 | ".mp4", 21 | ".mxmf", 22 | ".ogg", 23 | ".ota", 24 | ".rtttl", 25 | ".rtx", 26 | ".ts", 27 | ".wav", 28 | ".webm", 29 | ".xmf", 30 | ].any { file.name.endsWith(it) } 31 | } 32 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | mavenCentral() 5 | google() 6 | } 7 | } 8 | 9 | rootProject.name = "react-test-app" 10 | include ":app", ":support" 11 | -------------------------------------------------------------------------------- /android/support/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | } 4 | 5 | repositories { 6 | mavenCentral() 7 | google() 8 | } 9 | 10 | android { 11 | namespace "com.microsoft.reacttestapp.support" 12 | 13 | def androidDir = "${buildscript.sourceFile.getParent()}/../" 14 | apply(from: "${androidDir}/dependencies.gradle") 15 | 16 | compileSdkVersion project.ext.compileSdkVersion 17 | 18 | defaultConfig { 19 | minSdkVersion project.ext.minSdkVersion 20 | targetSdkVersion project.ext.targetSdkVersion 21 | versionCode getVersionCode() 22 | versionName getVersionName() 23 | } 24 | 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_1_8 27 | targetCompatibility JavaVersion.VERSION_1_8 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /android/support/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /android/support/src/main/java/com/microsoft/reacttestapp/support/ReactTestAppLifecycleEvents.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.reacttestapp.support; 2 | 3 | public interface ReactTestAppLifecycleEvents { 4 | void onTestAppInitialized(); 5 | void onTestAppWillInitializeReactNative(); 6 | void onTestAppDidInitializeReactNative(); 7 | } 8 | -------------------------------------------------------------------------------- /common/AppRegistry.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_APPREGISTRY_ 2 | #define COMMON_APPREGISTRY_ 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook::jsi 8 | { 9 | class Runtime; 10 | } 11 | 12 | namespace ReactTestApp 13 | { 14 | /** 15 | * Returns app keys registered in `AppRegistry`. 16 | */ 17 | std::vector GetAppKeys(facebook::jsi::Runtime &runtime); 18 | } // namespace ReactTestApp 19 | 20 | #endif // COMMON_APPREGISTRY_ 21 | -------------------------------------------------------------------------------- /docs/android.features.md: -------------------------------------------------------------------------------- 1 | Declares hardware or software features that is used by the application. 2 | 3 | Equivalent to 4 | [``](https://developer.android.com/guide/topics/manifest/uses-feature-element). 5 | 6 | Example: 7 | 8 | ```xml 9 | 10 | 12 | ``` 13 | 14 | becomes 15 | 16 | ```json 17 | { 18 | "android": { 19 | "features": [ 20 | { 21 | "android:name": "android.hardware.camera.any" 22 | }, 23 | { 24 | "android:glEsVersion": "0x00030002", 25 | "android:required": "true" 26 | } 27 | ] 28 | } 29 | } 30 | ``` 31 | 32 |
33 | History 34 | 35 | - [[3.8.0](https://github.com/microsoft/react-native-test-app/releases/tag/3.8.0)] 36 | Added 37 | 38 |
39 | -------------------------------------------------------------------------------- /docs/android.icons.md: -------------------------------------------------------------------------------- 1 | Path to resources folder containing launcher icons for the app. 2 | 3 | If you're configuring icons for the first time, set this property to the path 4 | where you want to store your icons, then use 5 | [Image Asset Studio](https://developer.android.com/studio/write/image-asset-studio#access) 6 | to generate the assets. 7 | 8 | You can read more about Android adaptive icons in the 9 | [Android documentation](https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive). 10 | 11 |
12 | History 13 | 14 | - [[1.6.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.6.0)] 15 | Added 16 | 17 |
18 | -------------------------------------------------------------------------------- /docs/android.metaData.md: -------------------------------------------------------------------------------- 1 | A name-value pair for an item of additional, arbitrary data that can be supplied to the application. 2 | 3 | Equivalent to 4 | [``](https://developer.android.com/guide/topics/manifest/meta-data-element). 5 | 6 | Example: 7 | 8 | ```xml 9 | 10 | 13 | 14 | ``` 15 | 16 | becomes 17 | 18 | ```json 19 | { 20 | "android": { 21 | "metaData": [ 22 | { 23 | "android:name": "com.google.android.gms.wallet.api.enabled", 24 | "android:value": "true" 25 | } 26 | ] 27 | } 28 | } 29 | ``` 30 | 31 |
32 | History 33 | 34 | - [[4.2.0](https://github.com/microsoft/react-native-test-app/releases/tag/4.2.0)] 35 | Added 36 | 37 |
38 | -------------------------------------------------------------------------------- /docs/android.package.md: -------------------------------------------------------------------------------- 1 | Use this property to set the 2 | application 3 | ID of the APK. The value is set to `applicationId` in `build.gradle`. 4 | 5 |
6 | History 7 | 8 | - [[0.1.25](https://github.com/microsoft/react-native-test-app/releases/tag/0.1.25)] 9 | Added 10 | 11 |
12 | -------------------------------------------------------------------------------- /docs/android.permissions.md: -------------------------------------------------------------------------------- 1 | Specifies system permissions that the user must grant for the app to operate 2 | correctly. 3 | 4 | Equivalent to 5 | [``](https://developer.android.com/guide/topics/manifest/uses-permission-element). 6 | 7 | Example: 8 | 9 | ```xml 10 | 13 | ``` 14 | 15 | becomes 16 | 17 | ```json 18 | { 19 | "android": { 20 | "permissions": [ 21 | { 22 | "android:name": "android.permission.WRITE_EXTERNAL_STORAGE", 23 | "android:maxSdkVersion": "18" 24 | } 25 | ] 26 | } 27 | } 28 | ``` 29 | 30 |
31 | History 32 | 33 | - [[3.8.0](https://github.com/microsoft/react-native-test-app/releases/tag/3.8.0)] 34 | Added 35 | 36 |
37 | -------------------------------------------------------------------------------- /docs/android.signingConfigs.md: -------------------------------------------------------------------------------- 1 | Use this to set the 2 | signing 3 | configurations for the app. 4 | 5 | The JSON schema follows the Gradle DSL very closely. Below is what one would add 6 | for the debug and release flavors: 7 | 8 | ```javascript 9 | { 10 | "android": { 11 | "signingConfigs": { 12 | "debug": { // optional 13 | "keyAlias": "androiddebugkey", // defaults to "androiddebugkey" 14 | "keyPassword": "android", // defaults to "android 15 | "storeFile": "debug.keystore", // required 16 | "storePassword": "android" // defaults to "android 17 | }, 18 | "release": { // optional 19 | "keyAlias": "androiddebugkey", // defaults to "androiddebugkey" 20 | "keyPassword": "android", // defaults to "android 21 | "storeFile": "release.keystore", // required 22 | "storePassword": "android" // defaults to "android 23 | } 24 | } 25 | } 26 | } 27 | ``` 28 | 29 |
30 | History 31 | 32 | - [[0.11.0](https://github.com/microsoft/react-native-test-app/releases/tag/0.11.0)] 33 | Added 34 | 35 |
36 | -------------------------------------------------------------------------------- /docs/android.versionCode.md: -------------------------------------------------------------------------------- 1 | A positive integer used as an internal version number. Google uses this number 2 | to determine whether one version is more recent than another. See 3 | [Version your app](https://developer.android.com/studio/publish/versioning#appversioning) 4 | for more on how it is used and how it differs from [`version`](#version). 5 | 6 |
7 | History 8 | 9 | - [[1.4.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.4.0)] 10 | Added 11 | 12 |
13 | -------------------------------------------------------------------------------- /docs/bundleRoot.md: -------------------------------------------------------------------------------- 1 | Specifies the root of the bundle file name. E.g., if the bundle file is 2 | `index.[platform].bundle`, `index` is the bundle root. 3 | 4 | Defaults to `index` and `main`. 5 | 6 | When set, the test app will look for the following files on startup: 7 | 8 | - `myRoot.[platform].jsbundle` 9 | - `myRoot.[platform].bundle` 10 | - `myRoot.native.jsbundle` 11 | - `myRoot.native.bundle` 12 | - `myRoot.jsbundle` 13 | - `myRoot.bundle` 14 | 15 |
16 | History 17 | 18 | - [[0.9.0](https://github.com/microsoft/react-native-test-app/releases/tag/0.9.0)] 19 | Added 20 | 21 |
22 | -------------------------------------------------------------------------------- /docs/introduction.md: -------------------------------------------------------------------------------- 1 | We use `app.json` to configure what gets bundled with the app and declare all 2 | the entry points on the home screen. The manifest must be bundled together with 3 | all your JS assets. It is usually found in `res/raw/` in the APK, and in 4 | `assets/` in the `.app` bundle. 5 | 6 | Example `app.json` file: 7 | 8 | ```json 9 | { 10 | "name": "Example", 11 | "displayName": "Example", 12 | "bundleRoot": "main", 13 | "components": [ 14 | { 15 | "appKey": "Example", 16 | "displayName": "App" 17 | } 18 | ], 19 | "resources": { 20 | "android": [ 21 | "dist/res", 22 | "dist/main.android.jsbundle" 23 | ], 24 | "ios": [ 25 | "dist/assets", 26 | "dist/main.ios.jsbundle" 27 | ], 28 | "macos": [ 29 | "dist/assets", 30 | "dist/main.macos.jsbundle" 31 | ], 32 | "windows": [ 33 | "dist/assets", 34 | "dist/main.windows.bundle" 35 | ] 36 | }, 37 | "android": { 38 | "package": "com.react.reacttestapp" 39 | }, 40 | "ios": { 41 | "bundleIdentifier": "com.react.ReactTestApp" 42 | }, 43 | "macos": { 44 | "bundleIdentifier": "com.react.ReactTestApp" 45 | }, 46 | "windows": { 47 | "appxManifest": "windows/Package.appxmanifest" 48 | } 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /docs/ios.buildNumber.md: -------------------------------------------------------------------------------- 1 | Similar to [`version`](#version), but is not shown to users. This is a required 2 | key for App Store. 3 | 4 | The equivalent key in `Info.plist` is 5 | [`CFBundleVersion`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion). 6 | 7 |
8 | History 9 | 10 | - [[1.4.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.4.0)] 11 | Added 12 | 13 |
14 | -------------------------------------------------------------------------------- /docs/ios.bundleIdentifier.md: -------------------------------------------------------------------------------- 1 | Use this property to set the bundle identifier of the final app bundle. This is 2 | the same as setting `PRODUCT_BUNDLE_IDENTIFIER` in Xcode. 3 | 4 |
5 | History 6 | 7 | - [[0.9.7](https://github.com/microsoft/react-native-test-app/releases/tag/0.9.7)] 8 | Added 9 | 10 |
11 | -------------------------------------------------------------------------------- /docs/ios.codeSignEntitlements.md: -------------------------------------------------------------------------------- 1 | Declare entitlements for capabilities used by the app. 2 | 3 | Example: 4 | 5 | ```json 6 | { 7 | "ios": { 8 | "codeSignEntitlements": { 9 | "com.apple.developer.game-center": true 10 | } 11 | } 12 | } 13 | ``` 14 | 15 | For more details, read Apple's documentation on 16 | [Entitlements](https://developer.apple.com/documentation/bundleresources/entitlements). 17 | 18 | Alternatively, specify a path to a custom `.entitlements` file. The path should 19 | be relative to `app.json`. This is equivalent to setting 20 | `CODE_SIGN_ENTITLEMENTS` in Xcode. 21 | 22 |
23 | History 24 | 25 | - [[3.7.0](https://github.com/microsoft/react-native-test-app/releases/tag/3.7.0)] 26 | Declare entitlements in app manifest 27 | - [[0.9.7](https://github.com/microsoft/react-native-test-app/releases/tag/0.9.7)] 28 | Added 29 | 30 |
31 | -------------------------------------------------------------------------------- /docs/ios.codeSignIdentity.md: -------------------------------------------------------------------------------- 1 | Sets the 2 | code 3 | signing identity to use when signing code. 4 | 5 | This is the same as setting `CODE_SIGN_IDENTITY` in Xcode. 6 | 7 |
8 | History 9 | 10 | - [[0.9.7](https://github.com/microsoft/react-native-test-app/releases/tag/0.9.7)] 11 | Added 12 | 13 |
14 | -------------------------------------------------------------------------------- /docs/ios.developmentTeam.md: -------------------------------------------------------------------------------- 1 | Sets the 2 | development 3 | team that the app should be assigned to. 4 | 5 | This is the same as setting `DEVELOPMENT_TEAM` in Xcode. 6 | 7 |
8 | History 9 | 10 | - [[0.9.7](https://github.com/microsoft/react-native-test-app/releases/tag/0.9.7)] 11 | Added 12 | 13 |
14 | -------------------------------------------------------------------------------- /docs/ios.icons.alternateIcons.md: -------------------------------------------------------------------------------- 1 | List of alternate icons for the Home screen and Settings app. 2 | 3 | The equivalent key in `Info.plist` is 4 | [`CFBundleAlternateIcons`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleicons/cfbundlealternateicons). 5 | -------------------------------------------------------------------------------- /docs/ios.icons.md: -------------------------------------------------------------------------------- 1 | Information about all of the icons used by the app. 2 | 3 | Icons for all sizes and scales are generated for you so long as you provide PNGs 4 | measuring 1024x1024 pixels here. 5 | 6 | You can read more about app icons in the 7 | [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons). 8 | 9 | The equivalent key in `Info.plist` is 10 | [`CFBundleIcons`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleicons). 11 | 12 |
13 | History 14 | 15 | - [[1.6.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.6.0)] 16 | Added 17 | 18 |
19 | -------------------------------------------------------------------------------- /docs/ios.icons.primaryIcon.md: -------------------------------------------------------------------------------- 1 | The primary icon for the Home screen and Settings app, among others. 2 | 3 | The equivalent key in `Info.plist` is 4 | [`CFBundlePrimaryIcon`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleicons/cfbundleprimaryicon). 5 | -------------------------------------------------------------------------------- /docs/ios.metalAPIValidation.md: -------------------------------------------------------------------------------- 1 | The API Validation layer checks for code that calls the Metal API incorrectly, 2 | including errors in creating resources, encoding Metal commands, and performing 3 | other common tasks. 4 | 5 | > [!NOTE] 6 | > 7 | > The API validation layer has a small, but measureable, impact on CPU 8 | > performance. 9 | 10 | For more details, read Apple's documentation on 11 | [Validating your app’s Metal API usage](https://developer.apple.com/documentation/xcode/validating-your-apps-metal-api-usage/). 12 | 13 |
14 | History 15 | 16 | - [[4.1.0](https://github.com/microsoft/react-native-test-app/releases/tag/4.1.0)] 17 | Added 18 | 19 |
20 | -------------------------------------------------------------------------------- /docs/ios.privacyManifest.md: -------------------------------------------------------------------------------- 1 | The privacy manifest is a property list that records the information regarding 2 | the types of data collected and the required reasons APIs your app or 3 | third-party SDK use. 4 | 5 | - The types of data collected by your app or third-party SDK must be provided on 6 | all platforms. 7 | - The required reasons APIs your app or third-party SDK uses must be provided on 8 | iOS, iPadOS, tvOS, visionOS, and watchOS. 9 | 10 | By default, a `PrivacyInfo.xcprivacy` is always generated with the following 11 | values: 12 | 13 | 14 | ```json 15 | { 16 | "NSPrivacyTracking": false, 17 | "NSPrivacyTrackingDomains": [], 18 | "NSPrivacyCollectedDataTypes": [], 19 | "NSPrivacyAccessedAPITypes": [ 20 | { 21 | "NSPrivacyAccessedAPIType": 22 | "NSPrivacyAccessedAPICategoryFileTimestamp", 23 | "NSPrivacyAccessedAPITypeReasons": ["C617.1"] 24 | }, 25 | { 26 | "NSPrivacyAccessedAPIType": 27 | "NSPrivacyAccessedAPICategorySystemBootTime", 28 | "NSPrivacyAccessedAPITypeReasons": ["35F9.1"] 29 | }, 30 | { 31 | "NSPrivacyAccessedAPIType": 32 | "NSPrivacyAccessedAPICategoryUserDefaults", 33 | "NSPrivacyAccessedAPITypeReasons": ["CA92.1"] 34 | } 35 | ] 36 | } 37 | ``` 38 | 39 | 40 | For more details, read Apple's documentation on 41 | [Privacy manifest files](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files). 42 | 43 |
44 | History 45 | 46 | - [[3.6.0](https://github.com/microsoft/react-native-test-app/releases/tag/3.6.0)] 47 | Added 48 | 49 |
50 | -------------------------------------------------------------------------------- /docs/macos.applicationCategoryType.md: -------------------------------------------------------------------------------- 1 | The category that best describes the app for the App Store. 2 | 3 | The equivalent key in `Info.plist` is 4 | [`LSApplicationCategoryType`](https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype). 5 | 6 |
7 | History 8 | 9 | - [[3.5.13](https://github.com/microsoft/react-native-test-app/releases/tag/3.5.13)] 10 | Added 11 | 12 |
13 | -------------------------------------------------------------------------------- /docs/macos.humanReadableCopyright.md: -------------------------------------------------------------------------------- 1 | A human-readable copyright notice for the bundle. 2 | 3 | The equivalent key in `Info.plist` is 4 | [`NSHumanReadableCopyright`](https://developer.apple.com/documentation/bundleresources/information_property_list/nshumanreadablecopyright). 5 | 6 |
7 | History 8 | 9 | - [[3.5.13](https://github.com/microsoft/react-native-test-app/releases/tag/3.5.13)] 10 | Added 11 | 12 |
13 | -------------------------------------------------------------------------------- /docs/resources.md: -------------------------------------------------------------------------------- 1 | Here you should declare all resources that should be bundled with the app. The 2 | property can be a list of paths to resources: 3 | 4 | ```javascript 5 | "resources": [ 6 | "dist/assets", 7 | "dist/main.jsbundle" 8 | ] 9 | ``` 10 | 11 | Or you can declare platform specific resources using platform names as key: 12 | 13 | ```javascript 14 | "resources": { 15 | "android": [ 16 | "dist/res", 17 | "dist/main.android.jsbundle" 18 | ], 19 | "ios": [ 20 | "dist/assets", 21 | "dist/main.ios.jsbundle" 22 | ], 23 | "macos": [ 24 | "dist/assets", 25 | "dist/main.macos.jsbundle" 26 | ], 27 | "windows": [ 28 | "dist/assets", 29 | "dist/main.windows.bundle" 30 | ] 31 | } 32 | ``` 33 | 34 | A path must be relative to the path of `app.json`, and can point to both a file 35 | or a directory. 36 | -------------------------------------------------------------------------------- /docs/singleApp.md: -------------------------------------------------------------------------------- 1 | In single-app mode, the component with the specified slug gets launched 2 | automatically, essentially behaving as a normal app. 3 | 4 | Defaults to multi-app mode. 5 | 6 | For more details, see [its dedicated page](Single-app-Mode). 7 | 8 |
9 | History 10 | 11 | - [[1.3.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.3.0)] 12 | Added 13 | 14 |
15 | -------------------------------------------------------------------------------- /docs/version.md: -------------------------------------------------------------------------------- 1 | The app version shown to users. The required format is three period-separated 2 | integers, such as 1.3.11. 3 | 4 | - **Android**: Equivalent to setting 5 | [`versionName`](https://developer.android.com/studio/publish/versioning#appversioning). 6 | - **iOS**: This is the same as setting 7 | [`CFBundleShortVersionString`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring) 8 | in `Info.plist`. 9 | - **macOS**: This is the same as setting 10 | [`CFBundleShortVersionString`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring) 11 | in `Info.plist`. 12 | - **Windows**: Please see [`windows.appxmanifest`](#windows.appxmanifest) for 13 | how to use a custom 14 | [app package manifest](https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/appx-package-manifest) 15 | instead. 16 | 17 |
18 | History 19 | 20 | - [[1.4.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.4.0)] 21 | Added 22 | 23 |
24 | -------------------------------------------------------------------------------- /docs/windows.appxManifest.md: -------------------------------------------------------------------------------- 1 | Sets the path to your 2 | app 3 | package manifest. If none is set, a default manifest will be provided. 4 | Changes to this property will not be automatically be picked up; you need to 5 | re-run `npx install-windows-test-app` to update the solution. 6 | 7 |
8 | History 9 | 10 | - [[0.5.5](https://github.com/microsoft/react-native-test-app/releases/tag/0.5.5)] 11 | Added 12 | 13 |
14 | -------------------------------------------------------------------------------- /docs/windows.certificateKeyFile.md: -------------------------------------------------------------------------------- 1 | The path to the certificate to use. If specified, it will also enable package 2 | signing. Changes to this property will not be automatically be picked up; you 3 | need to re-run `npx install-windows-test-app` to update the solution. 4 | 5 |
6 | History 7 | 8 | - [1.1.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.1.0)] 9 | Added 10 | 11 |
12 | -------------------------------------------------------------------------------- /docs/windows.certificatePassword.md: -------------------------------------------------------------------------------- 1 | The password for the private key in the certificate. Leave unset if no password. 2 | Changes to this property will not be automatically be picked up; you need to 3 | re-run `npx install-windows-test-app` to update the solution. 4 | 5 |
6 | History 7 | 8 | - [1.1.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.1.0)] 9 | Added 10 | 11 |
12 | -------------------------------------------------------------------------------- /docs/windows.certificateThumbprint.md: -------------------------------------------------------------------------------- 1 | This value must match the thumbprint in the signing certificate, or be unset. 2 | Changes to this property will not be automatically be picked up; you need to 3 | re-run `npx install-windows-test-app` to update the solution. 4 | 5 |
6 | History 7 | 8 | - [1.1.0](https://github.com/microsoft/react-native-test-app/releases/tag/1.1.0)] 9 | Added 10 | 11 |
12 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | *.binlog 2 | *.hprof 3 | *.xcworkspace/ 4 | *.zip 5 | .DS_Store 6 | .bundle/* 7 | !.bundle/config 8 | .gradle/ 9 | .idea/ 10 | .vs/ 11 | .xcode.env 12 | Pods/ 13 | build/ 14 | dist/* 15 | !dist/.gitignore 16 | local.properties 17 | msbuild.binlog 18 | node_modules/ 19 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /example/Example-Tests.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | package = JSON.parse(File.read(File.join('..', 'package.json'))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = File.basename(__FILE__, '.podspec') 7 | s.version = package['version'] 8 | s.author = { package['author']['name'] => package['author']['email'] } 9 | s.license = package['license'] 10 | s.homepage = package['homepage'] 11 | s.source = { :git => package['repository']['url'] } 12 | s.summary = 'Example tests' 13 | 14 | s.ios.deployment_target = '15.1' 15 | s.osx.deployment_target = '12.0' 16 | s.visionos.deployment_target = '1.0' 17 | 18 | s.dependency 'React' 19 | s.dependency 'ReactTestApp-DevSupport' 20 | 21 | s.framework = 'XCTest' 22 | s.user_target_xcconfig = { 'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES' => '$(inherited)' } 23 | 24 | s.source_files = 'ios/ExampleTests/**/*.{m,swift}' 25 | end 26 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | apply(from: { 3 | def searchDir = rootDir.toPath() 4 | do { 5 | def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle") 6 | if (p.toFile().exists()) { 7 | return p.toRealPath().toString() 8 | } 9 | } while (searchDir = searchDir.getParent()) 10 | throw new GradleException("Could not find `react-native-test-app`"); 11 | }()) 12 | 13 | repositories { 14 | mavenCentral() 15 | google() 16 | } 17 | 18 | dependencies { 19 | getReactNativeDependencies().each { dependency -> 20 | classpath(dependency) 21 | } 22 | } 23 | } 24 | 25 | allprojects { 26 | repositories { 27 | { 28 | def searchDir = rootDir.toPath() 29 | do { 30 | def p = searchDir.resolve("node_modules/react-native/android") 31 | if (p.toFile().exists()) { 32 | maven { 33 | url(p.toRealPath().toString()) 34 | } 35 | break 36 | } 37 | } while (searchDir = searchDir.getParent()) 38 | // As of 0.80, React Native is no longer installed from npm 39 | }() 40 | mavenCentral() 41 | google() 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | mavenCentral() 5 | google() 6 | } 7 | } 8 | 9 | rootProject.name = "example" 10 | 11 | apply(from: { 12 | def searchDir = rootDir.toPath() 13 | do { 14 | def p = searchDir.resolve("node_modules/react-native-test-app/test-app.gradle") 15 | if (p.toFile().exists()) { 16 | return p.toRealPath().toString() 17 | } 18 | } while (searchDir = searchDir.getParent()) 19 | throw new GradleException("Could not find `react-native-test-app`"); 20 | }()) 21 | applyTestAppSettings(settings) 22 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/microsoft/react-native-test-app/trunk/schema.json", 3 | "name": "Example", 4 | "displayName": "Example", 5 | "components": [ 6 | { 7 | "appKey": "Example", 8 | "displayName": "App" 9 | }, 10 | { 11 | "appKey": "Example", 12 | "displayName": "App (modal)", 13 | "presentationStyle": "modal" 14 | } 15 | ], 16 | "resources": { 17 | "android": [ 18 | "dist/res", 19 | "dist/main.android.jsbundle" 20 | ], 21 | "ios": [ 22 | "dist/assets", 23 | "dist/main.ios.jsbundle" 24 | ], 25 | "macos": [ 26 | "dist/assets", 27 | "dist/main.macos.jsbundle" 28 | ], 29 | "visionos": [ 30 | "dist/assets", 31 | "dist/main.visionos.jsbundle" 32 | ], 33 | "windows": [ 34 | "dist/assets", 35 | "dist/main.windows.bundle" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: (() => { 3 | try { 4 | return [require.resolve("@react-native/babel-preset")]; 5 | } catch (_) { 6 | return ["module:metro-react-native-babel-preset"]; 7 | } 8 | })(), 9 | plugins: [[require("@rnx-kit/polyfills")]], 10 | }; 11 | -------------------------------------------------------------------------------- /example/dist/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/example/dist/.gitignore -------------------------------------------------------------------------------- /example/index.ts: -------------------------------------------------------------------------------- 1 | // @react-native-webapis 2 | import { AppRegistry } from "react-native"; 3 | import { App } from "./App"; 4 | import { name as appName } from "./app.json"; 5 | 6 | AppRegistry.registerComponent(appName, () => App); 7 | -------------------------------------------------------------------------------- /example/ios/ExampleTests/DevSupportTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import 4 | 5 | @interface DevSupportTests : XCTestCase 6 | @end 7 | 8 | @implementation DevSupportTests 9 | 10 | - (void)testDevSupportIsLinked 11 | { 12 | XCTAssertNotNil(ReactAppDidFinishLaunchingNotification); 13 | XCTAssertNotNil(ReactAppWillInitializeReactNativeNotification); 14 | XCTAssertNotNil(ReactAppDidInitializeReactNativeNotification); 15 | XCTAssertNotNil(ReactAppRuntimeReadyNotification); 16 | XCTAssertNotNil(ReactAppDidRegisterAppsNotification); 17 | XCTAssertNotNil(ReactAppSceneDidOpenURLNotification); 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | ws_dir = Pathname.new(__dir__) 2 | ws_dir = ws_dir.parent until 3 | File.exist?("#{ws_dir}/node_modules/react-native-test-app/test_app.rb") || 4 | ws_dir.expand_path.to_s == '/' 5 | require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb" 6 | 7 | workspace 'Example.xcworkspace' 8 | 9 | options = { 10 | :fabric_enabled => false, 11 | :hermes_enabled => false, 12 | } 13 | 14 | use_test_app! options do |target| 15 | target.tests do 16 | pod 'Example-Tests', :path => '..' 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /example/macos/Podfile: -------------------------------------------------------------------------------- 1 | ws_dir = Pathname.new(__dir__) 2 | ws_dir = ws_dir.parent until 3 | File.exist?("#{ws_dir}/node_modules/react-native-test-app/macos/test_app.rb") || 4 | ws_dir.expand_path.to_s == '/' 5 | require "#{ws_dir}/node_modules/react-native-test-app/macos/test_app.rb" 6 | 7 | workspace 'Example.xcworkspace' 8 | 9 | use_test_app! :hermes_enabled => false do |target| 10 | target.tests do 11 | pod 'Example-Tests', :path => '..' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const { makeMetroConfig } = require("@rnx-kit/metro-config"); 2 | module.exports = makeMetroConfig({ 3 | transformer: { 4 | getTransformOptions: async () => ({ 5 | transform: { 6 | experimentalImportSupport: false, 7 | inlineRequires: false, 8 | }, 9 | }), 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /example/react-native.config.js: -------------------------------------------------------------------------------- 1 | const project = (() => { 2 | try { 3 | const { configureProjects } = require("react-native-test-app"); 4 | return configureProjects({ 5 | android: { 6 | sourceDir: "android", 7 | }, 8 | ios: { 9 | sourceDir: "ios", 10 | }, 11 | windows: { 12 | sourceDir: "windows", 13 | solutionFile: "windows/Example.sln", 14 | }, 15 | }); 16 | } catch (_) { 17 | return undefined; 18 | } 19 | })(); 20 | 21 | module.exports = { 22 | ...(project ? { project } : undefined), 23 | }; 24 | -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@rnx-kit/tsconfig/tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "react-native", 5 | "noEmit": true, 6 | "lib": ["ES2021", "DOM"] 7 | }, 8 | "include": [ 9 | "App.tsx", 10 | "index.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /example/visionos/Podfile: -------------------------------------------------------------------------------- 1 | ws_dir = Pathname.new(__dir__) 2 | ws_dir = ws_dir.parent until 3 | File.exist?("#{ws_dir}/node_modules/react-native-test-app/visionos/test_app.rb") || 4 | ws_dir.expand_path.to_s == '/' 5 | require "#{ws_dir}/node_modules/react-native-test-app/visionos/test_app.rb" 6 | 7 | workspace 'Example.xcworkspace' 8 | 9 | options = { 10 | :fabric_enabled => false, 11 | :hermes_enabled => false, 12 | } 13 | 14 | use_test_app! options do |target| 15 | target.tests do 16 | pod 'Example-Tests', :path => '..' 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | 3 | # User-specific files 4 | *.suo 5 | *.user 6 | *.sln.docstates 7 | 8 | # Build results 9 | ARM64/ 10 | AppPackages/ 11 | [Bb]in/ 12 | [Dd]ebug/ 13 | [Dd]ebugPublic/ 14 | [Oo]bj/ 15 | [Rr]elease/ 16 | [Rr]eleases/ 17 | bld/ 18 | build/ 19 | x64/ 20 | x86/ 21 | 22 | # NuGet Packages Directory 23 | packages/ 24 | 25 | **/Generated Files/** 26 | *.binlog 27 | *.hprof 28 | *.sln 29 | ExperimentalFeatures.props 30 | NuGet.Config 31 | dist/ 32 | msbuild.binlog 33 | node_modules/ 34 | -------------------------------------------------------------------------------- /example/windows/ReactAppTests/ReactAppTests.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;json 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /example/windows/ReactAppTests/Tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace Microsoft::VisualStudio::CppUnitTestFramework; 4 | 5 | // disable clang-format because it doesn't handle macros very well 6 | // clang-format off 7 | namespace ReactApp::Tests 8 | { 9 | TEST_CLASS(Tests) 10 | { 11 | public: 12 | TEST_METHOD(Test) 13 | { 14 | Assert::IsTrue(true); 15 | } 16 | }; 17 | } // namespace ReactApp::Tests 18 | // clang-format on 19 | -------------------------------------------------------------------------------- /images/RNTA_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/images/RNTA_full.png -------------------------------------------------------------------------------- /images/RNTA_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/images/RNTA_small.png -------------------------------------------------------------------------------- /images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/images/header.jpg -------------------------------------------------------------------------------- /ios/ReactTestApp/AppRegistryModule.h: -------------------------------------------------------------------------------- 1 | #import 2 | -------------------------------------------------------------------------------- /ios/ReactTestApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios/ReactTestApp/Manifest.swift: -------------------------------------------------------------------------------- 1 | // This file was generated by generate-manifest.mts. 2 | // DO NOT MODIFY. ALL CHANGES WILL BE OVERWRITTEN. 3 | 4 | struct Component { 5 | let appKey: String 6 | let displayName: String? 7 | let initialProperties: [String: Any]? 8 | let presentationStyle: String? 9 | let slug: String? 10 | } 11 | 12 | struct Manifest { 13 | let name: String 14 | let displayName: String 15 | let version: String? 16 | let bundleRoot: String? 17 | let singleApp: String? 18 | let components: [Component]? 19 | } 20 | 21 | extension Component { 22 | init(appKey: String) { 23 | self.init( 24 | appKey: appKey, 25 | displayName: nil, 26 | initialProperties: nil, 27 | presentationStyle: nil, 28 | slug: nil 29 | ) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ios/ReactTestApp/Public/ReactTestApp-DevSupport-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "ReactTestApp-DevSupport.h" 2 | -------------------------------------------------------------------------------- /ios/ReactTestApp/Public/ReactTestApp-DevSupport.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | NS_ASSUME_NONNULL_BEGIN 4 | 5 | OBJC_EXTERN NSNotificationName const ReactAppDidFinishLaunchingNotification; 6 | 7 | OBJC_EXTERN NSNotificationName const ReactAppWillInitializeReactNativeNotification; 8 | OBJC_EXTERN NSNotificationName const ReactAppDidInitializeReactNativeNotification; 9 | 10 | OBJC_EXTERN NSNotificationName const ReactAppRuntimeReadyNotification; 11 | OBJC_EXTERN NSNotificationName const ReactAppDidRegisterAppsNotification; 12 | 13 | OBJC_EXTERN NSNotificationName const ReactAppSceneDidOpenURLNotification; 14 | 15 | OBJC_EXTERN NSNotificationName const ReactTestAppDidInitializeNotification 16 | __deprecated_msg("Use 'ReactAppDidFinishLaunchingNotification' instead"); 17 | OBJC_EXTERN NSNotificationName const ReactTestAppWillInitializeReactNativeNotification 18 | __deprecated_msg("Use 'ReactAppWillInitializeReactNativeNotification' instead"); 19 | OBJC_EXTERN NSNotificationName const ReactTestAppDidInitializeReactNativeNotification 20 | __deprecated_msg("Use 'ReactAppDidInitializeReactNativeNotification' instead"); 21 | OBJC_EXTERN NSNotificationName const ReactTestAppDidRegisterAppsNotification 22 | __deprecated_msg("Use 'ReactAppDidRegisterAppsNotification' instead"); 23 | OBJC_EXTERN NSNotificationName const ReactTestAppSceneDidOpenURLNotification 24 | __deprecated_msg("Use 'ReactAppSceneDidOpenURLNotification' instead"); 25 | 26 | OBJC_EXTERN NSNotificationName const ReactInstanceDidLoadBundle; 27 | 28 | OBJC_EXTERN void RTAPostDidRegisterAppsNotification(NSValue *runtime); 29 | OBJC_EXTERN void RTAPostDidRegisterAppsNotificationWithBridge(id bridge); 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /ios/ReactTestApp/React+Compatibility.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | NS_ASSUME_NONNULL_BEGIN 4 | 5 | NSURL *RTADefaultJSBundleURL(); 6 | 7 | void RTADisableRemoteDebugging(); 8 | 9 | IMP RTASwizzleSelector(Class class, SEL originalSelector, SEL swizzledSelector); 10 | 11 | NS_ASSUME_NONNULL_END 12 | -------------------------------------------------------------------------------- /ios/ReactTestApp/ReactTestApp-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #pragma clang diagnostic push 2 | #pragma clang diagnostic ignored "-Wnullability-completeness" 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #pragma clang diagnostic pop 16 | 17 | #import "React+Compatibility.h" 18 | #import "UIViewController+ReactTestApp.h" 19 | -------------------------------------------------------------------------------- /ios/ReactTestApp/ReactTestApp-DevSupport.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | NSNotificationName const ReactAppDidFinishLaunchingNotification = 4 | @"ReactAppDidFinishLaunchNotification"; 5 | 6 | NSNotificationName const ReactAppWillInitializeReactNativeNotification = 7 | @"ReactAppWillInitializeReactNativeNotification"; 8 | NSNotificationName const ReactAppDidInitializeReactNativeNotification = 9 | @"ReactAppDidInitializeReactNativeNotification"; 10 | 11 | NSNotificationName const ReactAppRuntimeReadyNotification = @"ReactAppRuntimeReadyNotification"; 12 | NSNotificationName const ReactAppDidRegisterAppsNotification = 13 | @"ReactAppDidRegisterAppsNotification"; 14 | 15 | NSNotificationName const ReactAppSceneDidOpenURLNotification = 16 | @"ReactAppSceneDidOpenURLNotification"; 17 | 18 | NSNotificationName const ReactTestAppDidInitializeNotification = 19 | ReactAppDidFinishLaunchingNotification; 20 | NSNotificationName const ReactTestAppWillInitializeReactNativeNotification = 21 | ReactAppWillInitializeReactNativeNotification; 22 | NSNotificationName const ReactTestAppDidInitializeReactNativeNotification = 23 | ReactAppDidInitializeReactNativeNotification; 24 | NSNotificationName const ReactTestAppDidRegisterAppsNotification = 25 | ReactAppDidRegisterAppsNotification; 26 | NSNotificationName const ReactTestAppSceneDidOpenURLNotification = 27 | ReactAppSceneDidOpenURLNotification; 28 | 29 | // https://github.com/facebook/react-native/blob/v0.73.4/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm#L448 30 | NSNotificationName const ReactInstanceDidLoadBundle = @"RCTInstanceDidLoadBundle"; 31 | -------------------------------------------------------------------------------- /ios/ReactTestApp/ReactTestApp.common.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_SEARCH_USER_PATHS = NO 2 | CLANG_ANALYZER_NONNULL = YES 3 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE 4 | CLANG_CXX_LANGUAGE_STANDARD = c++20 5 | CLANG_CXX_LIBRARY = libc++ 6 | CLANG_ENABLE_MODULES = YES 7 | CLANG_ENABLE_OBJC_ARC = YES 8 | CLANG_ENABLE_OBJC_WEAK = YES 9 | COPY_PHASE_STRIP = NO 10 | ENABLE_STRICT_OBJC_MSGSEND = YES 11 | ENABLE_USER_SCRIPT_SANDBOXING = NO 12 | GCC_C_LANGUAGE_STANDARD = gnu11 13 | GCC_NO_COMMON_BLOCKS = YES 14 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 15 | IPHONEOS_DEPLOYMENT_TARGET = 15.1 16 | MTL_FAST_MATH = YES 17 | OTHER_CFLAGS = $(inherited) -fstack-protector-strong 18 | OTHER_LDFLAGS = $(inherited) -fstack-protector-strong 19 | SDKROOT = iphoneos 20 | SWIFT_TREAT_WARNINGS_AS_ERRORS = YES 21 | WARNING_CFLAGS = -Wall 22 | -------------------------------------------------------------------------------- /ios/ReactTestApp/ReactTestApp.debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ReactTestApp.common.xcconfig" 2 | 3 | CLANG_ADDRESS_SANITIZER[sdk=*simulator*] = YES 4 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER[sdk=*simulator*] = YES 5 | DEBUG_INFORMATION_FORMAT = dwarf 6 | ENABLE_TESTABILITY = YES 7 | GCC_DYNAMIC_NO_PIC = NO 8 | GCC_OPTIMIZATION_LEVEL = 0 9 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) 10 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE 11 | ONLY_ACTIVE_ARCH = YES 12 | OTHER_CFLAGS[sdk=*simulator*] = $(inherited) -fsanitize=bounds 13 | OTHER_LDFLAGS[sdk=*simulator*] = $(inherited) -fsanitize=bounds 14 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG 15 | SWIFT_OPTIMIZATION_LEVEL = -Onone 16 | -------------------------------------------------------------------------------- /ios/ReactTestApp/ReactTestApp.release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ReactTestApp.common.xcconfig" 2 | 3 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 4 | ENABLE_NS_ASSERTIONS = NO 5 | MTL_ENABLE_DEBUG_INFO = NO 6 | SWIFT_COMPILATION_MODE = wholemodule 7 | SWIFT_OPTIMIZATION_LEVEL = -O 8 | VALIDATE_PRODUCT = YES 9 | -------------------------------------------------------------------------------- /ios/ReactTestApp/UIViewController+ReactTestApp.h: -------------------------------------------------------------------------------- 1 | #if __has_include() 2 | #import 3 | #define RTAViewController UIViewController 4 | #else 5 | #import 6 | #define RTAViewController NSViewController 7 | #endif 8 | 9 | @class ReactNativeHost; 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | RTAViewController *_Nullable RTAViewControllerFromString(NSString *name, ReactNativeHost *host); 14 | 15 | NS_ASSUME_NONNULL_END 16 | -------------------------------------------------------------------------------- /ios/ReactTestApp/UIViewController+ReactTestApp.m: -------------------------------------------------------------------------------- 1 | // Disable clang-format because it gets confused when there's a "+" in the 2 | // filename. 3 | // clang-format off 4 | #import "UIViewController+ReactTestApp.h" 5 | // clang-format on 6 | 7 | #import 8 | 9 | @protocol RTAViewController 10 | - (instancetype)initWithBridge:(RCTBridge *)bridge; 11 | - (instancetype)initWithHost:(ReactNativeHost *)host; 12 | @end 13 | 14 | RTAViewController *RTAViewControllerFromString(NSString *name, ReactNativeHost *host) 15 | { 16 | Class viewController = NSClassFromString(name); 17 | if ([viewController instancesRespondToSelector:@selector(initWithHost:)]) { 18 | return [[viewController alloc] initWithHost:host]; 19 | } 20 | 21 | if ([viewController instancesRespondToSelector:@selector(initWithBridge:)]) { 22 | return [[viewController alloc] initWithBridge:host.bridge]; 23 | } 24 | 25 | return nil; 26 | } 27 | -------------------------------------------------------------------------------- /ios/ReactTestAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ios/ReactTestAppTests/ReactTestAppTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class ReactTestAppTests: XCTestCase { 4 | // Stub to make tests compile 5 | } 6 | -------------------------------------------------------------------------------- /ios/ReactTestAppUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ios/ReactTestAppUITests/ReactTestAppUITests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class ReactTestAppUITests: XCTestCase { 4 | // Stub to make tests compile 5 | } 6 | -------------------------------------------------------------------------------- /ios/use_react_native-0.70.rb: -------------------------------------------------------------------------------- 1 | require 'open3' 2 | 3 | require_relative('pod_helpers') 4 | 5 | def include_react_native!(options) 6 | react_native, project_root = options.values_at(:path, :rta_project_root) 7 | 8 | require_relative(File.join(project_root, react_native, 'scripts', 'react_native_pods')) 9 | 10 | use_react_native!( 11 | path: react_native, 12 | production: options.key?(:production) ? options[:production] : ENV['PRODUCTION'] == '1', 13 | hermes_enabled: use_hermes?(options), 14 | app_path: options[:app_path] || '..', 15 | config_file_dir: options[:config_file_dir] || '' 16 | ) 17 | 18 | # If we're using react-native@main, we'll also need to prepare 19 | # `react-native-codegen`. 20 | codegen = File.join(project_root, react_native, 'packages', 'react-native-codegen') 21 | Open3.popen3('node scripts/build.js', :chdir => codegen) if File.directory?(codegen) 22 | 23 | lambda { |installer| 24 | react_native_post_install(installer, react_native) 25 | if defined?(__apply_Xcode_12_5_M1_post_install_workaround) 26 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 27 | end 28 | } 29 | end 30 | -------------------------------------------------------------------------------- /ios/use_react_native-0.71.rb: -------------------------------------------------------------------------------- 1 | require 'open3' 2 | 3 | require_relative('pod_helpers') 4 | 5 | def include_react_native!(options) 6 | react_native, project_root, version = options.values_at(:path, :rta_project_root, :version) 7 | 8 | require_relative(File.join(project_root, react_native, 'scripts', 'react_native_pods')) 9 | 10 | use_new_architecture!(options, version) 11 | use_react_native!( 12 | path: react_native, 13 | fabric_enabled: options[:fabric_enabled] == true, 14 | new_arch_enabled: options[:new_arch_enabled] == true, 15 | production: options.key?(:production) ? options[:production] : ENV['PRODUCTION'] == '1', 16 | hermes_enabled: use_hermes?(options), 17 | app_path: options[:app_path] || '..', 18 | config_file_dir: options[:config_file_dir] || '' 19 | ) 20 | 21 | # If we're using react-native@main, we'll also need to prepare 22 | # `react-native-codegen`. 23 | codegen = File.join(project_root, react_native, 'packages', 'react-native-codegen') 24 | Open3.popen3('node scripts/build.js', :chdir => codegen) if File.directory?(codegen) 25 | 26 | lambda { |installer| 27 | react_native_post_install(installer, react_native) 28 | if defined?(__apply_Xcode_12_5_M1_post_install_workaround) 29 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 30 | end 31 | } 32 | end 33 | -------------------------------------------------------------------------------- /macos/Localizations/en.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | /* Class = "NSMenuItem"; title = "ReactTestApp"; ObjectID = "1Xt-HY-uBw"; */ 2 | "1Xt-HY-uBw.title" = "ReactTestApp"; 3 | 4 | /* Class = "NSMenuItem"; title = "Quit ReactTestApp"; ObjectID = "4sb-4s-VLi"; */ 5 | "4sb-4s-VLi.title" = "Quit ReactTestApp"; 6 | 7 | /* Class = "NSMenuItem"; title = "About ReactTestApp"; ObjectID = "5kV-Vb-QxS"; */ 8 | "5kV-Vb-QxS.title" = "About ReactTestApp"; 9 | 10 | /* Class = "NSMenuItem"; title = "ReactTestApp Help"; ObjectID = "FKE-Sm-Kum"; */ 11 | "FKE-Sm-Kum.title" = "ReactTestApp Help"; 12 | 13 | /* Class = "NSMenuItem"; title = "Hide ReactTestApp"; ObjectID = "Olw-nP-bQN"; */ 14 | "Olw-nP-bQN.title" = "Hide ReactTestApp"; 15 | 16 | /* Class = "NSMenu"; title = "ReactTestApp"; ObjectID = "uQy-DD-JDr"; */ 17 | "uQy-DD-JDr.title" = "ReactTestApp"; 18 | -------------------------------------------------------------------------------- /macos/ReactTestApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "scale" : "1x", 6 | "size" : "16x16" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "1x", 16 | "size" : "32x32" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "2x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "1x", 26 | "size" : "128x128" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "2x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "1x", 36 | "size" : "256x256" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "2x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "1x", 46 | "size" : "512x512" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "2x", 51 | "size" : "512x512" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /macos/ReactTestApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /macos/ReactTestApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | $(PRODUCT_DISPLAY_NAME) 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_DISPLAY_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | $(PRODUCT_VERSION) 21 | CFBundleVersion 22 | $(PRODUCT_BUILD_NUMBER) 23 | LSApplicationCategoryType 24 | public.app-category.developer-tools 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSAppTransportSecurity 28 | 29 | NSAllowsLocalNetworking 30 | 31 | 32 | NSHumanReadableCopyright 33 | Copyright © 2020 Microsoft. All rights reserved. 34 | NSMainStoryboardFile 35 | Main 36 | NSPrincipalClass 37 | NSApplication 38 | NSSupportsAutomaticTermination 39 | 40 | NSSupportsSuddenTermination 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /macos/ReactTestApp/ReactTestApp.common.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_SEARCH_USER_PATHS = NO 2 | CLANG_ANALYZER_NONNULL = YES 3 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE 4 | CLANG_CXX_LANGUAGE_STANDARD = c++20 5 | CLANG_CXX_LIBRARY = libc++ 6 | CLANG_ENABLE_MODULES = YES 7 | CLANG_ENABLE_OBJC_ARC = YES 8 | CLANG_ENABLE_OBJC_WEAK = YES 9 | COPY_PHASE_STRIP = NO 10 | ENABLE_STRICT_OBJC_MSGSEND = YES 11 | ENABLE_USER_SCRIPT_SANDBOXING = NO 12 | GCC_C_LANGUAGE_STANDARD = gnu11 13 | GCC_NO_COMMON_BLOCKS = YES 14 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 15 | MACOSX_DEPLOYMENT_TARGET = 12.0 16 | MTL_FAST_MATH = YES 17 | OTHER_CFLAGS = $(inherited) -fstack-protector-strong 18 | OTHER_LDFLAGS = $(inherited) -fstack-protector-strong 19 | SDKROOT = macosx 20 | SWIFT_TREAT_WARNINGS_AS_ERRORS = YES 21 | WARNING_CFLAGS = -Wall -Wno-error=undef-prefix 22 | -------------------------------------------------------------------------------- /macos/ReactTestApp/ReactTestApp.debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ReactTestApp.common.xcconfig" 2 | 3 | CLANG_ADDRESS_SANITIZER = YES 4 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER = YES 5 | DEBUG_INFORMATION_FORMAT = dwarf 6 | ENABLE_TESTABILITY = YES 7 | GCC_DYNAMIC_NO_PIC = NO 8 | GCC_OPTIMIZATION_LEVEL = 0 9 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) 10 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE 11 | ONLY_ACTIVE_ARCH = YES 12 | OTHER_CFLAGS = $(inherited) -fsanitize=bounds 13 | OTHER_LDFLAGS = $(inherited) -fsanitize=bounds 14 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG 15 | SWIFT_OPTIMIZATION_LEVEL = -Onone 16 | -------------------------------------------------------------------------------- /macos/ReactTestApp/ReactTestApp.release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ReactTestApp.common.xcconfig" 2 | 3 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 4 | ENABLE_NS_ASSERTIONS = NO 5 | MTL_ENABLE_DEBUG_INFO = NO 6 | SWIFT_COMPILATION_MODE = wholemodule 7 | SWIFT_OPTIMIZATION_LEVEL = -O 8 | -------------------------------------------------------------------------------- /macos/ReactTestAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /macos/ReactTestAppTests/ReactTestAppTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class ReactTestAppTests: XCTestCase { 4 | // Stub to make tests compile 5 | } 6 | -------------------------------------------------------------------------------- /macos/ReactTestAppUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /macos/ReactTestAppUITests/ReactTestAppUITests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class ReactTestAppUITests: XCTestCase { 4 | // Stub to make tests compile 5 | } 6 | -------------------------------------------------------------------------------- /macos/Shared: -------------------------------------------------------------------------------- 1 | ../ios/ReactTestApp -------------------------------------------------------------------------------- /macos/test_app.rb: -------------------------------------------------------------------------------- 1 | require_relative('../ios/test_app') 2 | 3 | def use_test_app!(options = {}, &block) 4 | use_test_app_internal!(:macos, options, &block) 5 | end 6 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/nx/schemas/nx-schema.json", 3 | "defaultBase": "trunk", 4 | "release": { 5 | "projects": ["react-native-test-app"], 6 | "projectsRelationship": "independent", 7 | "changelog": { 8 | "workspaceChangelog": false, 9 | "projectChangelogs": { 10 | "createRelease": "github", 11 | "file": false, 12 | "renderOptions": { 13 | "authors": false, 14 | "applyUsernameToAuthors": false 15 | } 16 | } 17 | }, 18 | "version": { 19 | "conventionalCommits": true, 20 | "versionActionsOptions": { 21 | "skipLockFileUpdate": true 22 | } 23 | }, 24 | "releaseTagPattern": "{version}", 25 | "git": { 26 | "commit": false 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /plugins/index.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | const { withMod } = require("@expo/config-plugins"); 3 | 4 | /** @import { ExportedConfig, Mod } from "@expo/config-plugins"; */ 5 | 6 | /** 7 | * Provides the `ReactNativeHost` file for modification. 8 | * @param {ExportedConfig} config Exported config 9 | * @param {Mod} action Method to run on the mod when the config is compiled 10 | * @returns {ExportedConfig} Modified config 11 | */ 12 | function withReactNativeHost(config, action) { 13 | return withMod(config, { 14 | platform: "ios", 15 | mod: "reactNativeHost", 16 | action, 17 | }); 18 | } 19 | 20 | /** 21 | * Provides the `SceneDelegate` file for modification. 22 | * @param {ExportedConfig} config Exported config 23 | * @param {Mod} action Method to run on the mod when the config is compiled 24 | * @returns {ExportedConfig} Modified config 25 | */ 26 | function withSceneDelegate(config, action) { 27 | return withMod(config, { 28 | platform: "ios", 29 | mod: "sceneDelegate", 30 | action, 31 | }); 32 | } 33 | 34 | exports.macos = require("./macos"); 35 | exports.withReactNativeHost = withReactNativeHost; 36 | exports.withSceneDelegate = withSceneDelegate; 37 | -------------------------------------------------------------------------------- /react-native.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | dependency: { 3 | platforms: { 4 | windows: null, 5 | }, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/appConfig.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import * as nodefs from "node:fs"; 3 | import { findFile, readJSONFile } from "./helpers.js"; 4 | 5 | /** @import { JSONObject } from "../scripts/types.js"; */ 6 | 7 | const SOURCE_KEY = Symbol.for("source"); 8 | 9 | /** 10 | * @param {string} projectRoot 11 | * @returns {JSONObject} 12 | */ 13 | export function loadAppConfig(projectRoot, fs = nodefs) { 14 | const configFile = findFile("app.json", projectRoot, fs); 15 | 16 | /** @type {JSONObject} */ 17 | const appConfig = configFile ? readJSONFile(configFile, fs) : {}; 18 | appConfig[SOURCE_KEY] = configFile || projectRoot; 19 | 20 | return appConfig; 21 | } 22 | 23 | /** 24 | * @param {JSONObject} appConfig 25 | * @returns {string} 26 | */ 27 | export function sourceForAppConfig(appConfig) { 28 | const source = appConfig[SOURCE_KEY]; 29 | if (typeof source !== "string") { 30 | throw new Error("Source for app config should've been set"); 31 | } 32 | return source; 33 | } 34 | -------------------------------------------------------------------------------- /scripts/build/MSBuild.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [Parameter(Mandatory, Position=0)] 3 | [String] 4 | $ProjectFile, 5 | 6 | [String] 7 | $Configuration="Debug", 8 | 9 | [String] 10 | $Platform="x64", 11 | 12 | [String] 13 | $Target="Rebuild" 14 | ) 15 | 16 | MSBuild ` 17 | -maxCpuCount ` 18 | -property:Configuration=$Configuration ` 19 | -property:Platform=$Platform ` 20 | -property:UseBundle=false ` 21 | -target:$Target ` 22 | $ProjectFile 23 | -------------------------------------------------------------------------------- /scripts/build/VSTest.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = "Stop" 2 | 3 | $path = vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.Web -requiresAny -property installationPath 4 | $path = join-path $path "Common7\IDE\CommonExtensions\Microsoft\TestWindow\VSTest.Console.exe" 5 | & $path $args 6 | -------------------------------------------------------------------------------- /scripts/build/clang-format-diff.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -z $DEBUG ]]; then 5 | brew install clang-format 6 | curl --silent --show-error --remote-name https://raw.githubusercontent.com/llvm/llvm-project/release/18.x/clang/tools/clang-format/clang-format-diff.py 7 | fi 8 | git diff --unified=0 --no-color @^ \ 9 | | python clang-format-diff.py -p1 -regex '.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hh|hpp|m|mm|inc)' -sort-includes \ 10 | | npx suggestion-bot 11 | -------------------------------------------------------------------------------- /scripts/build/copy-yarnrc.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import yaml from "js-yaml"; 3 | import * as fs from "node:fs"; 4 | import * as path from "node:path"; 5 | 6 | /** 7 | * Copies specified `.yarnrc.yaml`. 8 | * @param {string} src 9 | * @param {string} dst 10 | */ 11 | function main(src, dst) { 12 | [src, dst].forEach((str) => { 13 | if (!str || typeof str !== "string") { 14 | throw new Error(`Invalid argument: ${str}`); 15 | } 16 | }); 17 | 18 | const yml = fs.readFileSync(src, { encoding: "utf-8" }); 19 | const rc = /** @type {Record} */ (yaml.load(yml)); 20 | 21 | rc["nmHoistingLimits"] = undefined; 22 | rc["plugins"] = undefined; 23 | 24 | if (rc.yarnPath) { 25 | rc["yarnPath"] = path.join(path.dirname(src), rc.yarnPath); 26 | } 27 | 28 | fs.writeFileSync(dst, yaml.dump(rc)); 29 | } 30 | 31 | const { [2]: source, [3]: destination = ".yarnrc.yml" } = process.argv; 32 | main(source, destination); 33 | -------------------------------------------------------------------------------- /scripts/config-plugins/ExpoConfigPlugins.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | // '@expo/config-plugins' is a CommonJS module, which may not support all 4 | // module.exports as named exports. CommonJS modules can always be imported via 5 | // the default export. 6 | import ExpoConfigPlugins from "@expo/config-plugins"; 7 | 8 | const { BaseMods, evalModsAsync, withPlugins } = ExpoConfigPlugins; 9 | 10 | export { BaseMods, evalModsAsync, withPlugins }; 11 | -------------------------------------------------------------------------------- /scripts/config-plugins/apply.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import * as fs from "node:fs"; 3 | import { withPlugins } from "./ExpoConfigPlugins.mjs"; 4 | import { compileModsAsync } from "./plugins/mod-compiler.mjs"; 5 | import { withInternal } from "./plugins/withInternal.mjs"; 6 | 7 | /** 8 | * Applies config plugins. 9 | * @param {import("./types.js").ProjectInfo} projectInfo 10 | * @returns {Promise> | undefined>} 11 | */ 12 | export async function applyConfigPlugins({ appJsonPath, ...info }) { 13 | if (!appJsonPath) { 14 | return; 15 | } 16 | 17 | const content = fs.readFileSync(appJsonPath, { encoding: "utf-8" }); 18 | const { plugins, ...config } = JSON.parse(content); 19 | if (!Array.isArray(plugins) || plugins.length === 0) { 20 | return; 21 | } 22 | 23 | return compileModsAsync( 24 | withPlugins(withInternal(config, info), plugins), 25 | info 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /scripts/config-plugins/index.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { getAndroidModFileProviders } from "./plugins/withAndroidBaseMods.mjs"; 3 | import { getIosModFileProviders } from "./plugins/withIosBaseMods.mjs"; 4 | import { getMacOsModFileProviders } from "./plugins/withMacOsBaseMods.mjs"; 5 | 6 | export { applyConfigPlugins } from "./apply.mjs"; 7 | export { 8 | compileModsAsync, 9 | withDefaultBaseMods, 10 | } from "./plugins/mod-compiler.mjs"; 11 | export { withInternal } from "./plugins/withInternal.mjs"; 12 | 13 | export const BaseMods = { 14 | getAndroidModFileProviders, 15 | getIosModFileProviders, 16 | getMacOsModFileProviders, 17 | }; 18 | -------------------------------------------------------------------------------- /scripts/config-plugins/plugins/mod-compiler.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { BaseMods, evalModsAsync } from "../ExpoConfigPlugins.mjs"; 3 | import { getAndroidModFileProviders } from "./withAndroidBaseMods.mjs"; 4 | import { getIosModFileProviders } from "./withIosBaseMods.mjs"; 5 | import { getMacOsModFileProviders } from "./withMacOsBaseMods.mjs"; 6 | 7 | /** @type {import("@expo/config-plugins").withDefaultBaseMods} */ 8 | export const withDefaultBaseMods = (config, props) => { 9 | config = BaseMods.withIosBaseMods(config, { 10 | ...props, 11 | providers: getIosModFileProviders(), 12 | }); 13 | config = BaseMods.withAndroidBaseMods(config, { 14 | ...props, 15 | providers: getAndroidModFileProviders(), 16 | }); 17 | config = BaseMods.withGeneratedBaseMods(config, { 18 | ...props, 19 | // @ts-expect-error `macos` is not assignable to type `android | ios` 20 | platform: "macos", 21 | providers: getMacOsModFileProviders(), 22 | }); 23 | return config; 24 | }; 25 | 26 | /** @type {import("@expo/config-plugins").compileModsAsync} */ 27 | export const compileModsAsync = (config, props) => { 28 | if (props.introspect === true) { 29 | console.warn("`introspect` is not supported by react-native-test-app"); 30 | } 31 | 32 | config = withDefaultBaseMods(config); 33 | return evalModsAsync(config, props); 34 | }; 35 | -------------------------------------------------------------------------------- /scripts/config-plugins/plugins/withInternal.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | /** 3 | * @import { ConfigPlugin } from "@expo/config-plugins"; 4 | * @import { ProjectInfo } from "../types.js"; 5 | * @typedef {Omit} Internals 6 | */ 7 | 8 | /** @type {ConfigPlugin} */ 9 | export const withInternal = (config, internals) => { 10 | config._internal = { 11 | isDebug: false, 12 | ...config._internal, 13 | ...internals, 14 | }; 15 | return config; 16 | }; 17 | -------------------------------------------------------------------------------- /scripts/config-plugins/plugins/withIosBaseMods.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { BaseMods } from "../ExpoConfigPlugins.mjs"; 3 | import { makeFilePathModifier } from "../provider.mjs"; 4 | import { createModFileProviders } from "./cocoaBaseMods.mjs"; 5 | 6 | const modifyFilePath = makeFilePathModifier("node_modules/.generated/ios"); 7 | const defaultProviders = createModFileProviders(modifyFilePath); 8 | 9 | // `react-native-test-app` files 10 | defaultProviders["sceneDelegate"] = modifyFilePath( 11 | BaseMods.getIosModFileProviders().appDelegate, 12 | "ReactTestApp/SceneDelegate.swift" 13 | ); 14 | 15 | export function getIosModFileProviders() { 16 | return defaultProviders; 17 | } 18 | -------------------------------------------------------------------------------- /scripts/config-plugins/plugins/withMacOsBaseMods.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { makeFilePathModifier } from "../provider.mjs"; 3 | import { createModFileProviders } from "./cocoaBaseMods.mjs"; 4 | 5 | const modifyFilePath = makeFilePathModifier("node_modules/.generated/macos"); 6 | const defaultProviders = createModFileProviders(modifyFilePath); 7 | 8 | export function getMacOsModFileProviders() { 9 | return defaultProviders; 10 | } 11 | -------------------------------------------------------------------------------- /scripts/config-plugins/provider.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import * as path from "node:path"; 3 | import { findFile } from "../helpers.js"; 4 | import { BaseMods } from "./ExpoConfigPlugins.mjs"; 5 | 6 | /** 7 | * @template {import("@expo/json-file").JSONObject} T 8 | * @param {T} [defaultRead={}] 9 | */ 10 | // @ts-expect-error Type '{}' is not assignable to type 'T' 11 | export function makeNullProvider(defaultRead = {}) { 12 | return BaseMods.provider({ 13 | getFilePath: () => "", 14 | read: () => Promise.resolve(defaultRead), 15 | write: () => Promise.resolve(), 16 | }); 17 | } 18 | 19 | /** 20 | * Creates a mod modifier that just changes `getFilePath()`. 21 | * @param {string} actualProjectDir 22 | * @returns {import("./types.js").CustomModProvider} 23 | */ 24 | export function makeFilePathModifier(actualProjectDir) { 25 | return function (original, file) { 26 | return BaseMods.provider({ 27 | ...original, 28 | getFilePath: async ({ modRequest: { projectRoot } }) => { 29 | const name = path.posix.join(actualProjectDir, file); 30 | const result = findFile(name, projectRoot); 31 | return result || name; 32 | }, 33 | }); 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /scripts/config-plugins/types.ts: -------------------------------------------------------------------------------- 1 | import type { BaseMods, ModPlatform } from "@expo/config-plugins"; 2 | import type { 3 | BaseModProviderMethods, 4 | ForwardedBaseModOptions, 5 | } from "@expo/config-plugins/build/plugins/createBaseMod"; 6 | 7 | export type CustomModProvider = < 8 | ModType, 9 | Props extends ForwardedBaseModOptions, 10 | >( 11 | original: BaseModProviderMethods, 12 | file: string 13 | ) => BaseModProviderMethods; 14 | 15 | export type IosModFileProviders = ReturnType< 16 | typeof BaseMods.getIosModFileProviders 17 | > & 18 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 19 | Record>; 20 | 21 | export type ProjectInfo = { 22 | projectRoot: string; 23 | platforms: ModPlatform[]; 24 | packageJsonPath: string; 25 | appJsonPath: string; 26 | }; 27 | -------------------------------------------------------------------------------- /scripts/embed-manifest/main.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { createHash } from "node:crypto"; 3 | import * as nodefs from "node:fs"; 4 | import { findFile } from "../helpers.js"; 5 | import { validate } from "./validate.mjs"; 6 | 7 | /** 8 | * @param {(json: Record, checksum: string, fs?: typeof nodefs) => string} generate 9 | * @param {string} projectRoot 10 | * @returns {number} 11 | */ 12 | export function main(generate, projectRoot = process.cwd(), fs = nodefs) { 13 | const manifestPath = findFile("app.json", projectRoot, fs); 14 | const manifest = validate(manifestPath, fs); 15 | if (typeof manifest === "number") { 16 | return manifest; 17 | } 18 | 19 | const checksum = createHash("sha256") 20 | .update(JSON.stringify(manifest)) 21 | .digest("hex"); 22 | const provider = generate(manifest, checksum, fs); 23 | if (!provider) { 24 | return 1; 25 | } 26 | 27 | console.log(provider); 28 | return 0; 29 | } 30 | 31 | /** 32 | * @param {string} message 33 | */ 34 | export function warn(message) { 35 | console.warn("//", message); 36 | } 37 | -------------------------------------------------------------------------------- /scripts/embed-manifest/validate.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import Ajv from "ajv"; 3 | import * as nodefs from "node:fs"; 4 | import { readJSONFile } from "../helpers.js"; 5 | import { generateSchema } from "../schema.mjs"; 6 | 7 | const APP_JSON = "app.json"; 8 | 9 | const BUILD_PROPS = [ 10 | "$schema", 11 | "android", 12 | "ios", 13 | "macos", 14 | "windows", 15 | "plugins", 16 | "resources", 17 | ]; 18 | 19 | function makeValidator() { 20 | return new Ajv({ allErrors: true }) 21 | .addKeyword({ keyword: "exclude-from-codegen" }) 22 | .addKeyword({ keyword: "markdownDescription" }); 23 | } 24 | 25 | /** 26 | * @param {import("node:fs").PathLike | undefined} manifestPath 27 | * @returns {Record | number} 28 | */ 29 | export function validate(manifestPath, fs = nodefs) { 30 | if (!manifestPath) { 31 | console.error( 32 | `Failed to find '${APP_JSON}'. Please make sure you're in the right directory.` 33 | ); 34 | return 1; 35 | } 36 | 37 | const manifest = readJSONFile(manifestPath, fs); 38 | const validator = makeValidator(); 39 | if (!validator.validate(generateSchema(), manifest)) { 40 | console.error( 41 | `${manifestPath}: error: ${APP_JSON} is not a valid app manifest` 42 | ); 43 | const errors = validator.errors; 44 | if (errors) { 45 | errors.map(({ instancePath, message }) => 46 | console.error( 47 | `${manifestPath}: error: ${instancePath || ""} ${message}` 48 | ) 49 | ); 50 | } 51 | return 1000 + (errors?.length ?? 0); 52 | } 53 | 54 | for (const key of BUILD_PROPS) { 55 | delete manifest[key]; 56 | } 57 | 58 | return manifest; 59 | } 60 | -------------------------------------------------------------------------------- /scripts/eslint/plugin.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | "no-process-exit": require("./no-process-exit"), 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /scripts/internal/pack.mts: -------------------------------------------------------------------------------- 1 | import * as fs from "node:fs"; 2 | import * as path from "node:path"; 3 | 4 | const files = ["example/.gitignore", "example/windows/.gitignore"]; 5 | 6 | /** 7 | * Renames `.dotfile` to `_dotfile`. 8 | */ 9 | function renameDotFile(p: string): string { 10 | return path.join(path.dirname(p), "_" + path.basename(p).substring(1)); 11 | } 12 | 13 | /** 14 | * `npm install` seems to be renaming `.gitignore` files to `.npmignore`. 15 | * This breaks our templates (see 16 | * https://github.com/microsoft/react-native-test-app/issues/1228). As a 17 | * workaround, we'll rename the files ourselves, from `.gitignore` to 18 | * `_gitignore`, to avoid any further attempts to mutate the package. 19 | */ 20 | const { [2]: script } = process.argv; 21 | switch (script) { 22 | case "pre": { 23 | for (const f of files) { 24 | fs.renameSync(f, renameDotFile(f)); 25 | } 26 | break; 27 | } 28 | 29 | case "post": { 30 | for (const f of files) { 31 | fs.renameSync(renameDotFile(f), f); 32 | } 33 | break; 34 | } 35 | 36 | default: 37 | throw new Error(`No such script: ${script}`); 38 | } 39 | -------------------------------------------------------------------------------- /scripts/internal/test.mts: -------------------------------------------------------------------------------- 1 | import { spawnSync } from "node:child_process"; 2 | 3 | type Language = "ruby" | "typescript"; 4 | 5 | function getTarget(files: string[]): Language | undefined { 6 | if (files.some((file) => file.endsWith(".rb"))) { 7 | return "ruby"; 8 | } else if (files.some((file) => file.endsWith(".ts"))) { 9 | return "typescript"; 10 | } else { 11 | return undefined; 12 | } 13 | } 14 | 15 | function testWith(command: string, args: string[]): void { 16 | const result = spawnSync(command, args, { stdio: "inherit" }); 17 | process.exitCode = result.status ?? 1; 18 | } 19 | 20 | const input = process.argv.slice(2); 21 | switch (getTarget(input)) { 22 | case "ruby": 23 | testWith("bundle", ["exec", "ruby", "-Ilib:test", ...input]); 24 | break; 25 | case "typescript": 26 | testWith(process.argv0, [ 27 | "--experimental-transform-types", 28 | "--no-warnings", 29 | "--test", 30 | "--experimental-test-coverage", 31 | ...input, 32 | ]); 33 | break; 34 | default: 35 | console.error(`Unable to determine test target: [${input}]`); 36 | process.exitCode = 1; 37 | break; 38 | } 39 | -------------------------------------------------------------------------------- /scripts/utils/colors.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { WriteStream } from "node:tty"; 3 | 4 | const hasColors = 5 | WriteStream.prototype.hasColors() && process.env["NODE_ENV"] !== "test"; 6 | 7 | /** @type {(start: number, end: number) => (s: string) => string} */ 8 | const color = hasColors 9 | ? (start, end) => (s) => "\u001B[" + start + "m" + s + "\u001B[" + end + "m" 10 | : () => (s) => s; 11 | 12 | export const bold = color(1, 22); 13 | export const dim = color(2, 22); 14 | export const red = color(31, 39); 15 | export const green = color(32, 39); 16 | export const yellow = color(33, 39); 17 | export const cyan = color(36, 39); 18 | -------------------------------------------------------------------------------- /scripts/utils/filesystem.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import * as nodefs from "node:fs"; 3 | 4 | const CP_R_OPTIONS = { force: true, recursive: true }; 5 | const MKDIR_P_OPTIONS = { recursive: true, mode: 0o755 }; 6 | const RM_R_OPTIONS = { force: true, maxRetries: 3, recursive: true }; 7 | 8 | /** 9 | * @param {string} source 10 | * @param {string} destination 11 | */ 12 | export function cp_r(source, destination, fs = nodefs) { 13 | fs.cpSync(source, destination, CP_R_OPTIONS); 14 | } 15 | 16 | /** 17 | * @param {string} p 18 | */ 19 | export function mkdir_p(p, fs = nodefs) { 20 | fs.mkdirSync(p, MKDIR_P_OPTIONS); 21 | } 22 | 23 | /** 24 | * @param {string} p 25 | */ 26 | export function rm_r(p, fs = nodefs) { 27 | fs.rmSync(p, RM_R_OPTIONS); 28 | } 29 | 30 | /** 31 | * @param {string} path 32 | * @param {unknown} obj 33 | */ 34 | export function writeJSONFile(path, obj, fs = nodefs) { 35 | const fd = fs.openSync(path, "w", 0o644); 36 | fs.writeSync(fd, JSON.stringify(obj, undefined, 2)); 37 | fs.writeSync(fd, "\n"); 38 | fs.closeSync(fd); 39 | } 40 | -------------------------------------------------------------------------------- /test/__fixtures__/single_app_mode/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TestFixture", 3 | "displayName": "Test Fixture", 4 | "version": "1.0.0", 5 | "singleApp": "test-fixture" 6 | } 7 | -------------------------------------------------------------------------------- /test/__fixtures__/test_app/node_modules/@react-native-community/cli-platform-ios/native_modules.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/test/__fixtures__/test_app/node_modules/@react-native-community/cli-platform-ios/native_modules.rb -------------------------------------------------------------------------------- /test/__fixtures__/test_app/node_modules/@react-native-community/cli-platform-ios/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@react-native-community/cli-platform-ios", 3 | "version": "4.10.1", 4 | "license": "MIT", 5 | "main": "build/index.js" 6 | } 7 | -------------------------------------------------------------------------------- /test/__fixtures__/test_app/node_modules/react-native/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native", 3 | "version": "1000.0.0", 4 | "description": "A framework for building native apps using React", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git@github.com:facebook/react-native.git" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/__fixtures__/windows_test_app/Root.vcxproj: -------------------------------------------------------------------------------- 1 | {00000000-0000-0000-0000-000000000000} 2 | -------------------------------------------------------------------------------- /test/__fixtures__/windows_test_app/android/Android.vcxproj: -------------------------------------------------------------------------------- 1 | {00000000-0000-0000-0000-000000000000} 2 | -------------------------------------------------------------------------------- /test/__fixtures__/windows_test_app/ios/iOS.vcxproj: -------------------------------------------------------------------------------- 1 | {00000000-0000-0000-0000-000000000000} 2 | -------------------------------------------------------------------------------- /test/__fixtures__/windows_test_app/macos/macOS.vcxproj: -------------------------------------------------------------------------------- 1 | {00000000-0000-0000-0000-000000000000} 2 | -------------------------------------------------------------------------------- /test/__fixtures__/windows_test_app/node_modules/SomeProject.vcxproj: -------------------------------------------------------------------------------- 1 | {00000000-0000-0000-0000-000000000000} 2 | -------------------------------------------------------------------------------- /test/__fixtures__/windows_test_app/windows/InvalidProject.vcxproj: -------------------------------------------------------------------------------- 1 | ReactTestApp 2 | -------------------------------------------------------------------------------- /test/__fixtures__/windows_test_app/windows/Windows.vcxproj: -------------------------------------------------------------------------------- 1 | {00000000-0000-0000-0000-000000000000} 2 | ReactTestApp 3 | -------------------------------------------------------------------------------- /test/__fixtures__/windows_test_app/windows/WithoutProjectName.vcxproj: -------------------------------------------------------------------------------- 1 | {00000000-0000-0000-0000-000000000000} 2 | -------------------------------------------------------------------------------- /test/__fixtures__/with_platform_resources/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TestFixture", 3 | "displayName": "TestFixture", 4 | "components": [ 5 | { 6 | "appKey": "TestFixture", 7 | "displayName": "Test" 8 | } 9 | ], 10 | "resources": { 11 | "ios": ["dist-ios/assets", "dist-ios/main.jsbundle"], 12 | "macos": ["dist-macos/assets", "dist-macos/main.jsbundle"] 13 | }, 14 | "ios": { 15 | "bundleIdentifier": "bundleIdentifier-ios", 16 | "codeSignEntitlements": "codeSignEntitlements-ios", 17 | "codeSignIdentity": "codeSignIdentity-ios", 18 | "developmentTeam": "developmentTeam-ios", 19 | "reactNativePath": "reactNativePath-ios" 20 | }, 21 | "macos": { 22 | "bundleIdentifier": "bundleIdentifier-macos", 23 | "codeSignEntitlements": "codeSignEntitlements-macos", 24 | "codeSignIdentity": "codeSignIdentity-macos", 25 | "developmentTeam": "developmentTeam-macos", 26 | "reactNativePath": "reactNativePath-macos" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/__fixtures__/with_platform_resources/ios/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/__fixtures__/with_platform_resources/macos/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/__fixtures__/with_resources/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TestFixture", 3 | "displayName": "Test Fixture", 4 | "components": [ 5 | { 6 | "appKey": "TestFixture", 7 | "displayName": "Test" 8 | } 9 | ], 10 | "resources": ["dist/assets", "dist/main.jsbundle"] 11 | } 12 | -------------------------------------------------------------------------------- /test/__fixtures__/with_resources/ios/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/__fixtures__/with_resources/macos/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/__fixtures__/without_platform_resources/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TestFixture", 3 | "displayName": "TestFixture", 4 | "components": [ 5 | { 6 | "appKey": "TestFixture", 7 | "displayName": "Test" 8 | } 9 | ], 10 | "resources": {}, 11 | "ios": {}, 12 | "macos": {} 13 | } 14 | -------------------------------------------------------------------------------- /test/__fixtures__/without_platform_resources/ios/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/__fixtures__/without_platform_resources/macos/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/__fixtures__/without_resources/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TestFixture", 3 | "displayName": "TestFixture", 4 | "components": [ 5 | { 6 | "appKey": "TestFixture", 7 | "displayName": "Test" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/__fixtures__/without_resources/ios/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/__fixtures__/without_resources/macos/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /test/configure/console.test.ts: -------------------------------------------------------------------------------- 1 | import { equal } from "node:assert/strict"; 2 | import { describe, it } from "node:test"; 3 | import { error, warn } from "../../scripts/configure.mjs"; 4 | 5 | describe("console", () => { 6 | it("error() is just a fancy console.error()", (t) => { 7 | const errorMock = t.mock.method(console, "error", () => null); 8 | const warnMock = t.mock.method(console, "warn", () => null); 9 | 10 | error("These tests are seriously lacking Arnold."); 11 | equal(errorMock.mock.calls.length, 1); 12 | equal(warnMock.mock.calls.length, 0); 13 | }); 14 | 15 | it("warn() is just a fancy console.warn()", (t) => { 16 | const errorMock = t.mock.method(console, "error", () => null); 17 | const warnMock = t.mock.method(console, "warn", () => null); 18 | 19 | warn("These tests are lacking Arnold."); 20 | equal(errorMock.mock.calls.length, 0); 21 | equal(warnMock.mock.calls.length, 1); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /test/configure/getAppName.test.ts: -------------------------------------------------------------------------------- 1 | import { equal } from "node:assert/strict"; 2 | import { afterEach, describe, it } from "node:test"; 3 | import { getAppName as getAppNameActual } from "../../scripts/configure.mjs"; 4 | import { fs, setMockFiles } from "../fs.mock.ts"; 5 | 6 | describe("getAppName()", () => { 7 | const getAppName: typeof getAppNameActual = (p) => getAppNameActual(p, fs); 8 | 9 | afterEach(() => setMockFiles()); 10 | 11 | it("retrieves name from the app manifest", (t) => { 12 | const warnMock = t.mock.method(console, "warn", () => null); 13 | setMockFiles({ "app.json": `{ "name": "Example" }` }); 14 | 15 | equal(getAppName("."), "Example"); 16 | equal(warnMock.mock.calls.length, 0); 17 | }); 18 | 19 | it("falls back to 'ReactTestApp' if `name` is missing or empty", (t) => { 20 | const warnMock = t.mock.method(console, "warn", () => null); 21 | setMockFiles({ "app.json": "{}" }); 22 | 23 | equal(getAppName("."), "ReactTestApp"); 24 | equal(warnMock.mock.calls.length, 1); 25 | 26 | setMockFiles({ "app.json": `{ name: "" }` }); 27 | 28 | equal(getAppName("."), "ReactTestApp"); 29 | equal(warnMock.mock.calls.length, 2); 30 | }); 31 | 32 | it("falls back to 'ReactTestApp' if the app manifest is missing", (t) => { 33 | const warnMock = t.mock.method(console, "warn", () => null); 34 | 35 | equal(getAppName("."), "ReactTestApp"); 36 | equal(warnMock.mock.calls.length, 1); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /test/configure/getPlatformPackage.test.ts: -------------------------------------------------------------------------------- 1 | import { deepEqual, equal, throws } from "node:assert/strict"; 2 | import { describe, it } from "node:test"; 3 | import { getPlatformPackage } from "../../scripts/configure.mjs"; 4 | 5 | describe("getPlatformPackage()", () => { 6 | const name = "react-native-macos"; 7 | 8 | it("returns dependency when target version is inside range", (t) => { 9 | const warnMock = t.mock.method(console, "warn", () => null); 10 | 11 | for (const targetVersion of ["0.0.0-canary", "^0.0.0-canary"]) { 12 | const pkg = getPlatformPackage("macos", targetVersion); 13 | deepEqual(pkg, { [name]: "^0.0.0" }); 14 | } 15 | 16 | for (const targetVersion of ["0.73", "0.73.2", "^0.73", "^0.73.2"]) { 17 | const pkg = getPlatformPackage("macos", targetVersion); 18 | deepEqual(pkg, { [name]: "^0.73.0" }); 19 | } 20 | 21 | equal(warnMock.mock.calls.length, 0); 22 | }); 23 | 24 | it("returns `undefined` when target version is outside range", (t) => { 25 | const warnMock = t.mock.method(console, "warn", () => null); 26 | 27 | const versions = ["0.59", "9999.0"]; 28 | for (const targetVersion of versions) { 29 | const pkg = getPlatformPackage("macos", targetVersion); 30 | equal(pkg, undefined); 31 | } 32 | 33 | equal(warnMock.mock.calls.length, versions.length); 34 | }); 35 | 36 | it("throws if target version is invalid", () => { 37 | // @ts-expect-error intentional use of empty string to elicit an exception 38 | throws(() => getPlatformPackage("", "version")); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /test/configure/join.test.ts: -------------------------------------------------------------------------------- 1 | import { equal } from "node:assert/strict"; 2 | import { describe, it } from "node:test"; 3 | import { join } from "../../scripts/template.mjs"; 4 | 5 | describe("join()", () => { 6 | it("joins lines", () => { 7 | equal(join(""), ""); 8 | equal(join("a", "b"), "a\nb"); 9 | equal(join("a", "", "b"), "a\n\nb"); 10 | equal(join("a", "", "b", ""), "a\n\nb\n"); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /test/configure/mockParams.ts: -------------------------------------------------------------------------------- 1 | /* node:coverage disable */ 2 | import type { ConfigureParams } from "../../scripts/types.ts"; 3 | 4 | /** 5 | * Returns mock parameters. 6 | */ 7 | export function mockParams( 8 | overrides?: Partial 9 | ): ConfigureParams { 10 | return { 11 | name: "Test", 12 | packagePath: "test", 13 | testAppPath: ".", 14 | targetVersion: "0.76.8", 15 | platforms: ["android", "ios", "macos", "windows"], 16 | force: false, 17 | init: false, 18 | ...overrides, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /test/configure/reactNativeConfig.test.ts: -------------------------------------------------------------------------------- 1 | import { equal, ok } from "node:assert/strict"; 2 | import { describe, it } from "node:test"; 3 | import { reactNativeConfig as reactNativeConfigActual } from "../../scripts/configure.mjs"; 4 | import type { ConfigureParams } from "../../scripts/types.ts"; 5 | import { mockParams } from "./mockParams.ts"; 6 | 7 | describe("reactNativeConfig()", () => { 8 | const reactNativeConfig = (params: ConfigureParams): string => { 9 | const config = reactNativeConfigActual(params); 10 | if (typeof config !== "string") { 11 | throw new Error("Expected a string"); 12 | } 13 | return config; 14 | }; 15 | 16 | it("returns generic config for all platforms", () => { 17 | const genericConfig = reactNativeConfig(mockParams()); 18 | ok(genericConfig.includes("android: {")); 19 | ok(genericConfig.includes("ios: {")); 20 | ok(genericConfig.includes("windows: {")); 21 | 22 | const withSinglePlatform = mockParams({ platforms: ["ios"] }); 23 | equal(reactNativeConfig(withSinglePlatform), genericConfig); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /test/configure/removeAllFiles.test.ts: -------------------------------------------------------------------------------- 1 | import { ok } from "node:assert/strict"; 2 | import { after, beforeEach, describe, it } from "node:test"; 3 | import { removeAllFiles as removeAllFilesActual } from "../../scripts/configure.mjs"; 4 | import { fs, setMockFiles } from "../fs.mock.ts"; 5 | 6 | describe("removeAllFiles()", () => { 7 | const removeAllFiles: typeof removeAllFilesActual = (files, destination) => 8 | removeAllFilesActual(files, destination, fs.promises); 9 | 10 | beforeEach(() => { 11 | setMockFiles({ 12 | "babel.config.js": "module.exports = {};", 13 | "metro.config.js": "module.exports = {};", 14 | }); 15 | }); 16 | 17 | after(() => setMockFiles()); 18 | 19 | it("removes all specified files", async () => { 20 | ok(fs.existsSync("babel.config.js")); 21 | ok(fs.existsSync("metro.config.js")); 22 | 23 | await removeAllFiles(["babel.config.js", "metro.config.js"], "."); 24 | 25 | ok(!fs.existsSync("babel.config.js")); 26 | ok(!fs.existsSync("metro.config.js")); 27 | }); 28 | 29 | it("ignores non-existent files", async () => { 30 | ok(fs.existsSync("babel.config.js")); 31 | ok(fs.existsSync("metro.config.js")); 32 | 33 | await removeAllFiles(["babel.config.js", "react-native.config.js"], "."); 34 | 35 | ok(!fs.existsSync("babel.config.js")); 36 | ok(fs.existsSync("metro.config.js")); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /test/fs.mock.ts: -------------------------------------------------------------------------------- 1 | /* node:coverage disable */ 2 | import type { DirectoryJSON } from "memfs"; 3 | import { fs as memfs, vol } from "memfs"; 4 | import * as path from "node:path"; 5 | import { mkdir_p, rm_r } from "../scripts/utils/filesystem.mjs"; 6 | 7 | export const fs = memfs as unknown as typeof import("node:fs"); 8 | 9 | // Add simple `cpSync` implementation until memfs implements it 10 | fs.cpSync = 11 | fs.cpSync ?? 12 | ((src: string, dst: string, options) => { 13 | const srcStat = fs.statSync(src); 14 | if (!srcStat.isDirectory()) { 15 | return fs.copyFileSync(src, dst); 16 | } 17 | 18 | rm_r(dst, fs); 19 | mkdir_p(dst, fs); 20 | 21 | for (const filename of fs.readdirSync(src)) { 22 | const p = path.join(src, filename); 23 | const finalDst = path.join(dst, filename); 24 | 25 | const pStat = fs.statSync(p); 26 | if (pStat.isDirectory()) { 27 | fs.cpSync(p, finalDst, options); 28 | } else { 29 | fs.copyFileSync(p, finalDst); 30 | } 31 | } 32 | }); 33 | 34 | export function setMockFiles(files: DirectoryJSON = {}) { 35 | vol.reset(); 36 | vol.fromJSON(files); 37 | } 38 | 39 | export function toJSON(): DirectoryJSON { 40 | return vol.toJSON(); 41 | } 42 | -------------------------------------------------------------------------------- /test/template.ts: -------------------------------------------------------------------------------- 1 | import * as path from "node:path"; 2 | import { findNearest } from "../scripts/helpers.js"; 3 | 4 | const templateDir = findNearest( 5 | "node_modules/@react-native-community/template" 6 | ); 7 | 8 | if (!templateDir) { 9 | throw new Error("Cannot find module '@react-native-community/template'"); 10 | } 11 | 12 | export const templatePath = path 13 | .join(templateDir, "template") 14 | .replaceAll("\\", "/"); 15 | -------------------------------------------------------------------------------- /test/test_pod_helpers.rb: -------------------------------------------------------------------------------- 1 | require('minitest/autorun') 2 | 3 | require_relative('../ios/pod_helpers') 4 | 5 | class TestPodHelpers < Minitest::Test 6 | def test_assert_version 7 | ['1.12.999', '1.15.0', '1.15.1'].each do |version| 8 | assert_raises(RuntimeError) do 9 | assert_version(version) 10 | end 11 | end 12 | 13 | assert_silent do 14 | ['1.13.0', '1.14.0', '1.15.2'].each do |version| 15 | assert_version(version) 16 | end 17 | end 18 | end 19 | 20 | def test_use_hermes? 21 | refute(use_hermes?({ use_hermes: false })) 22 | assert(use_hermes?({ use_hermes: true })) 23 | refute(ENV.fetch('RCT_BUILD_HERMES_FROM_SOURCE', nil)) 24 | 25 | assert(use_hermes?({ use_hermes: 'from-source' })) 26 | assert_equal('true', ENV.fetch('RCT_BUILD_HERMES_FROM_SOURCE')) 27 | end 28 | 29 | def test_v 30 | assert_equal(0, v(0, 0, 0)) 31 | assert_equal(0, v(0, 0, 0)) 32 | assert_equal(1, v(0, 0, 1)) 33 | assert_equal(1_000, v(0, 1, 0)) 34 | assert_equal(1_001, v(0, 1, 1)) 35 | assert_equal(1_000_000, v(1, 0, 0)) 36 | assert_equal(1_000_001, v(1, 0, 1)) 37 | assert_equal(1_001_000, v(1, 1, 0)) 38 | assert_equal(1_001_001, v(1, 1, 1)) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /test/windows/generateSolution.test.ts: -------------------------------------------------------------------------------- 1 | import { equal } from "node:assert/strict"; 2 | import * as path from "node:path"; 3 | import { afterEach, beforeEach, describe, it } from "node:test"; 4 | import { generateSolution as generateSolutionActual } from "../../windows/test-app.mjs"; 5 | import { fs, setMockFiles } from "../fs.mock.ts"; 6 | 7 | describe("generateSolution()", () => { 8 | const generateSolution: typeof generateSolutionActual = (d, cfg) => 9 | generateSolutionActual(d, cfg, fs); 10 | 11 | const cwd = process.cwd(); 12 | 13 | const options = { 14 | autolink: false, 15 | useHermes: false, 16 | useNuGet: false, 17 | }; 18 | 19 | const testManifest = `{ name: "react-native-test-app", version: "0.0.1-dev" }`; 20 | 21 | beforeEach(() => { 22 | process.chdir(path.dirname(cwd)); 23 | }); 24 | 25 | afterEach(() => { 26 | setMockFiles(); 27 | process.chdir(cwd); 28 | }); 29 | 30 | it("exits if destination path is missing/invalid", async () => { 31 | equal( 32 | await generateSolution("", options), 33 | "Missing or invalid destination path" 34 | ); 35 | }); 36 | 37 | it("exits if 'package.json' folder cannot be found", async () => { 38 | equal( 39 | await generateSolution("test", options), 40 | "Could not find 'package.json'" 41 | ); 42 | }); 43 | 44 | it("exits if 'react-native-windows' folder cannot be found", async () => { 45 | setMockFiles({ 46 | [path.resolve("", "package.json")]: testManifest, 47 | [path.resolve("", "node_modules", ".bin")]: "directory", 48 | }); 49 | 50 | equal( 51 | await generateSolution("test", options), 52 | "Could not find 'react-native-windows'" 53 | ); 54 | }); 55 | }); 56 | -------------------------------------------------------------------------------- /test/windows/replaceContent.test.ts: -------------------------------------------------------------------------------- 1 | import { equal } from "node:assert/strict"; 2 | import { describe, it } from "node:test"; 3 | import { replaceContent } from "../../windows/test-app.mjs"; 4 | 5 | describe("replaceContent()", () => { 6 | it("returns same string with no replacements", () => { 7 | // @ts-expect-error intentional use of `undefined` 8 | equal(replaceContent(undefined, {}), undefined); 9 | equal(replaceContent("", {}), ""); 10 | equal(replaceContent("content", {}), "content"); 11 | }); 12 | 13 | it("replaces content only if patterns match", () => { 14 | equal( 15 | replaceContent("|$(ReactNativeModulePath)|", { 16 | "\\$\\(ReactNativeModulePath\\)": "Arnold", 17 | "\\$\\(ReactTestAppProjectPath\\)": "Schwarzenegger", 18 | }), 19 | "|Arnold|" 20 | ); 21 | }); 22 | 23 | it("replaces all occurrences of given pattern", () => { 24 | equal( 25 | replaceContent( 26 | "|$(ReactNativeModulePath)|$(ReactNativeModulePath)|$(ReactNativeModulePath)|", 27 | { "\\$\\(ReactNativeModulePath\\)": "Arnold" } 28 | ), 29 | "|Arnold|Arnold|Arnold|" 30 | ); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /test_app.rb: -------------------------------------------------------------------------------- 1 | require_relative('ios/test_app') 2 | 3 | def use_test_app!(options = {}, &block) 4 | use_test_app_internal!(:ios, options, &block) 5 | end 6 | -------------------------------------------------------------------------------- /tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@rnx-kit/tsconfig/tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true 5 | }, 6 | "include": [ 7 | "plugins/**/*.js", 8 | "react-native.config.js", 9 | "scripts/**/*.js" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@rnx-kit/tsconfig/tsconfig.esm.json", 3 | "compilerOptions": { 4 | "target": "ES2022", 5 | "module": "ES2022", 6 | "allowImportingTsExtensions": true, 7 | "moduleResolution": "Node", 8 | "noEmit": true, 9 | "lib": ["ES2022", "DOM"] 10 | }, 11 | "include": [ 12 | "**/*.mjs", 13 | "**/*.mts", 14 | "**/*.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "back.jpg", 5 | "idiom" : "vision", 6 | "scale" : "2x" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/back.jpg -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | }, 6 | "layers" : [ 7 | { 8 | "filename" : "Front.solidimagestacklayer" 9 | }, 10 | { 11 | "filename" : "Middle.solidimagestacklayer" 12 | }, 13 | { 14 | "filename" : "Back.solidimagestacklayer" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "front.png", 5 | "idiom" : "vision", 6 | "scale" : "2x" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/front.png -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "vision", 5 | "scale" : "2x" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/ReactTestApp.common.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_SEARCH_USER_PATHS = NO 2 | CLANG_ANALYZER_NONNULL = YES 3 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE 4 | CLANG_CXX_LANGUAGE_STANDARD = c++20 5 | CLANG_CXX_LIBRARY = libc++ 6 | CLANG_ENABLE_MODULES = YES 7 | CLANG_ENABLE_OBJC_ARC = YES 8 | CLANG_ENABLE_OBJC_WEAK = YES 9 | COPY_PHASE_STRIP = NO 10 | ENABLE_STRICT_OBJC_MSGSEND = YES 11 | ENABLE_USER_SCRIPT_SANDBOXING = NO 12 | GCC_C_LANGUAGE_STANDARD = gnu11 13 | GCC_NO_COMMON_BLOCKS = YES 14 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 15 | XROS_DEPLOYMENT_TARGET = 1.0 16 | MTL_FAST_MATH = YES 17 | OTHER_CFLAGS = $(inherited) -fstack-protector-strong 18 | OTHER_LDFLAGS = $(inherited) -fstack-protector-strong 19 | SDKROOT = iphoneos 20 | SWIFT_TREAT_WARNINGS_AS_ERRORS = YES 21 | WARNING_CFLAGS = -Wall 22 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/ReactTestApp.debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ReactTestApp.common.xcconfig" 2 | 3 | CLANG_ADDRESS_SANITIZER[sdk=*simulator*] = YES 4 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER[sdk=*simulator*] = YES 5 | DEBUG_INFORMATION_FORMAT = dwarf 6 | ENABLE_TESTABILITY = YES 7 | GCC_DYNAMIC_NO_PIC = NO 8 | GCC_OPTIMIZATION_LEVEL = 0 9 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) 10 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE 11 | ONLY_ACTIVE_ARCH = YES 12 | OTHER_CFLAGS[sdk=*simulator*] = $(inherited) -fsanitize=bounds 13 | OTHER_LDFLAGS[sdk=*simulator*] = $(inherited) -fsanitize=bounds 14 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG 15 | SWIFT_OPTIMIZATION_LEVEL = -Onone 16 | -------------------------------------------------------------------------------- /visionos/ReactTestApp/ReactTestApp.release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ReactTestApp.common.xcconfig" 2 | 3 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 4 | ENABLE_NS_ASSERTIONS = NO 5 | MTL_ENABLE_DEBUG_INFO = NO 6 | SWIFT_COMPILATION_MODE = wholemodule 7 | SWIFT_OPTIMIZATION_LEVEL = -O 8 | VALIDATE_PRODUCT = YES 9 | -------------------------------------------------------------------------------- /visionos/ReactTestAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /visionos/ReactTestAppTests/ReactTestAppTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class ReactTestAppTests: XCTestCase { 4 | // Stub to make tests compile 5 | } 6 | -------------------------------------------------------------------------------- /visionos/ReactTestAppUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /visionos/ReactTestAppUITests/ReactTestAppUITests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class ReactTestAppUITests: XCTestCase { 4 | // Stub to make tests compile 5 | } 6 | -------------------------------------------------------------------------------- /visionos/Shared: -------------------------------------------------------------------------------- 1 | ../ios/ReactTestApp -------------------------------------------------------------------------------- /visionos/test_app.rb: -------------------------------------------------------------------------------- 1 | require_relative('../ios/test_app') 2 | 3 | def use_test_app!(options = {}, &block) 4 | use_test_app_internal!(:visionos, options, &block) 5 | end 6 | -------------------------------------------------------------------------------- /windows/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | AccessModifierOffset: -4 3 | AllowShortFunctionsOnASingleLine: None 4 | AlwaysBreakBeforeMultilineStrings: true 5 | AlwaysBreakTemplateDeclarations: true 6 | BinPackArguments: false 7 | BinPackParameters: false 8 | BreakBeforeBraces: Linux 9 | ColumnLimit: 100 10 | Cpp11BracedListStyle: true 11 | IncludeBlocks: Regroup 12 | IncludeCategories: 13 | - Regex: '"pch\.h"' 14 | Priority: -1 15 | - Regex: '^' 18 | Priority: 2 19 | - Regex: '^<' 20 | Priority: 3 21 | - Regex: '.\*' 22 | Priority: 10 23 | IndentCaseLabels: true 24 | IndentWidth: 4 25 | NamespaceIndentation: All 26 | ObjCSpaceAfterProperty: true 27 | ObjCSpaceBeforeProtocolList: true 28 | PenaltyReturnTypeOnItsOwnLine: 100 29 | PointerAlignment: Right 30 | SpacesBeforeTrailingComments: 2 31 | SpacesInContainerLiterals: false 32 | TabWidth: 4 33 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | 3 | # User-specific files 4 | *.suo 5 | *.user 6 | *.sln.docstates 7 | 8 | # Build results 9 | ARM64/ 10 | AppPackages/ 11 | [Bb]in/ 12 | [Dd]ebug/ 13 | [Dd]ebugPublic/ 14 | [Oo]bj/ 15 | [Rr]elease/ 16 | [Rr]eleases/ 17 | bld/ 18 | build/ 19 | x64/ 20 | x86/ 21 | 22 | # NuGet Packages Directory 23 | packages/ 24 | 25 | **/Generated Files/** 26 | -------------------------------------------------------------------------------- /windows/ExperimentalFeatures.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | false 10 | false 11 | 12 | 17 | true 18 | 19 | 25 | false 26 | 27 | 34 | false 35 | 36 | true 37 | 38 | 39 | -------------------------------------------------------------------------------- /windows/Shared/EmbedManifest.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-test-app\package.json'))\node_modules\react-native-test-app\scripts\embed-manifest\cpp.mjs 5 | $([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'app.json')) 6 | $(MSBuildProjectDirectory)\..\..\Manifest.g.cpp 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /windows/Shared/Manifest.h: -------------------------------------------------------------------------------- 1 | // This file was generated by generate-manifest.mts. 2 | // DO NOT MODIFY. ALL CHANGES WILL BE OVERWRITTEN. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace ReactApp 13 | { 14 | using JSONObject = std::map; 15 | 16 | struct Component { 17 | std::string_view appKey; 18 | std::optional displayName; 19 | std::optional initialProperties; 20 | std::optional presentationStyle; 21 | std::optional slug; 22 | }; 23 | 24 | struct Manifest { 25 | std::string_view name; 26 | std::string_view displayName; 27 | std::optional version; 28 | std::optional bundleRoot; 29 | std::optional singleApp; 30 | std::optional> components; 31 | }; 32 | 33 | Manifest GetManifest(); 34 | std::string_view GetManifestChecksum(); 35 | 36 | } // namespace ReactApp 37 | -------------------------------------------------------------------------------- /windows/UWP/App.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "App.xaml.g.h" 4 | 5 | namespace winrt::ReactTestApp::implementation 6 | { 7 | struct App : AppT { 8 | App(); 9 | 10 | void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &); 11 | void OnSuspending(IInspectable const &, 12 | Windows::ApplicationModel::SuspendingEventArgs const &); 13 | void OnNavigationFailed(IInspectable const &, 14 | Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const &); 15 | 16 | private: 17 | void NavigateToFirstPage( 18 | Windows::UI::Xaml::Controls::Frame &rootFrame, 19 | Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &e); 20 | }; 21 | } // namespace winrt::ReactTestApp::implementation 22 | -------------------------------------------------------------------------------- /windows/UWP/App.idl: -------------------------------------------------------------------------------- 1 | namespace ReactTestApp 2 | { 3 | } 4 | -------------------------------------------------------------------------------- /windows/UWP/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /windows/UWP/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /windows/UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /windows/UWP/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /windows/UWP/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /windows/UWP/Assets/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /windows/UWP/Assets/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /windows/UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/UWP/AutolinkedNativeModules.g.cpp: -------------------------------------------------------------------------------- 1 | // AutolinkedNativeModules.g.cpp contents generated by "react-native autolink-windows" 2 | // clang-format off 3 | #include "pch.h" 4 | #include "AutolinkedNativeModules.g.h" 5 | 6 | namespace winrt::Microsoft::ReactNative 7 | { 8 | 9 | void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector const& packageProviders) 10 | { 11 | UNREFERENCED_PARAMETER(packageProviders); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /windows/UWP/AutolinkedNativeModules.g.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace winrt::Microsoft::ReactNative 7 | { 8 | void RegisterAutolinkedNativeModulePackages( 9 | winrt::Windows::Foundation::Collections::IVector const &); 10 | } 11 | -------------------------------------------------------------------------------- /windows/UWP/AutolinkedNativeModules.g.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /windows/UWP/AutolinkedNativeModules.g.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /windows/UWP/MainPage.idl: -------------------------------------------------------------------------------- 1 | namespace ReactTestApp 2 | { 3 | [default_interface] runtimeclass MainPage : Windows.UI.Xaml.Controls.Page 4 | { 5 | MainPage(); 6 | } 7 | } // namespace ReactTestApp 8 | -------------------------------------------------------------------------------- /windows/UWP/PropertySheet.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /windows/UWP/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /windows/UWP/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define NOMINMAX 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #if __has_include() 13 | #include 14 | #endif 15 | #if __has_include() 16 | #include 17 | #endif 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | -------------------------------------------------------------------------------- /windows/Win32/AutolinkedNativeModules.g.cpp: -------------------------------------------------------------------------------- 1 | // AutolinkedNativeModules.g.cpp contents generated by "react-native autolink-windows" 2 | // clang-format off 3 | #include "pch.h" 4 | #include "AutolinkedNativeModules.g.h"{{ &autolinkCppIncludes }} 5 | 6 | namespace winrt::Microsoft::ReactNative 7 | { 8 | 9 | void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector const& packageProviders) 10 | { {{ &autolinkCppPackageProviders }} 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /windows/Win32/AutolinkedNativeModules.g.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace winrt::Microsoft::ReactNative 7 | { 8 | void RegisterAutolinkedNativeModulePackages( 9 | winrt::Windows::Foundation::Collections::IVector const &); 10 | } 11 | -------------------------------------------------------------------------------- /windows/Win32/Images/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /windows/Win32/Images/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /windows/Win32/Images/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /windows/Win32/Images/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /windows/Win32/Images/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /windows/Win32/Images/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /windows/Win32/Images/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /windows/Win32/Images/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Images/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/Win32/Main.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | -------------------------------------------------------------------------------- /windows/Win32/Main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Main.ico -------------------------------------------------------------------------------- /windows/Win32/Main.small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/react-native-test-app/fae2614566cee46d501be652e079eaa044784954/windows/Win32/Main.small.ico -------------------------------------------------------------------------------- /windows/Win32/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /windows/Win32/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "targetver.h" 4 | 5 | #define NOMINMAX 1 6 | #define WIN32_LEAN_AND_MEAN 1 7 | #define WINRT_LEAN_AND_MEAN 1 8 | 9 | // Windows Header Files 10 | #include 11 | #undef GetCurrentTime 12 | #include 13 | #include 14 | 15 | // WinRT Header Files 16 | // clang-format off 17 | #include 18 | // clang-format on 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | // C RunTime Header Files 31 | #include 32 | #include 33 | #include 34 | #include 35 | -------------------------------------------------------------------------------- /windows/Win32/resource.h: -------------------------------------------------------------------------------- 1 | #define IDI_ICON1 1008 2 | // Next default values for new objects 3 | // 4 | #ifdef APSTUDIO_INVOKED 5 | #ifndef APSTUDIO_READONLY_SYMBOLS 6 | 7 | #define _APS_NO_MFC 130 8 | #define _APS_NEXT_RESOURCE_VALUE 129 9 | #define _APS_NEXT_COMMAND_VALUE 32771 10 | #define _APS_NEXT_CONTROL_VALUE 1000 11 | #define _APS_NEXT_SYMED_VALUE 110 12 | 13 | #endif // APSTUDIO_READONLY_SYMBOLS 14 | #endif // _APS_NO_MFC 15 | -------------------------------------------------------------------------------- /windows/Win32/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /windows/win32.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import * as path from "node:path"; 3 | import { importTargets } from "./project.mjs"; 4 | 5 | /** @type {import("../scripts/types.js").MSBuildProjectConfigurator} */ 6 | export function configureForWin32({ 7 | bundle, 8 | nugetDependencies, 9 | versionNumber, 10 | }) { 11 | return { 12 | projDir: "Win32", 13 | projectFileName: "ReactApp.vcxproj", 14 | projectFiles: [ 15 | ["AutolinkedNativeModules.g.cpp"], 16 | ["Images"], 17 | ["Main.ico"], 18 | ["Main.rc"], 19 | ["Main.small.ico"], 20 | ["Package.appxmanifest"], 21 | ["ReactApp.Package.wapproj"], 22 | [ 23 | "ReactApp.vcxproj", 24 | { 25 | "REACT_NATIVE_VERSION=1000000000;": `REACT_NATIVE_VERSION=${versionNumber};`, 26 | "": bundle.assetItems, 27 | "": 28 | importTargets(nugetDependencies), 29 | ...(typeof bundle.singleApp === "string" 30 | ? { "ENABLE_SINGLE_APP_MODE=0;": "ENABLE_SINGLE_APP_MODE=1;" } 31 | : undefined), 32 | }, 33 | ], 34 | [ 35 | "ReactApp.vcxproj.filters", 36 | { 37 | "": bundle.assetItemFilters, 38 | "": bundle.assetFilters, 39 | }, 40 | ], 41 | ["resource.h"], 42 | ], 43 | solutionTemplatePath: path.join( 44 | "templates", 45 | "cpp-app", 46 | "windows", 47 | "MyApp.sln" 48 | ), 49 | }; 50 | } 51 | --------------------------------------------------------------------------------