Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating RNTester to Packages Directory #29567

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"**/__mocks__/**/*.js",
"**/__tests__/**/*.js",
"jest/**/*.js",
"RNTester/**/*.js",
"packages/rn-tester/**/*.js",
],
"globals": {
// Expose some Jest globals for test helpers
Expand Down
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ project.xcworkspace

# Gradle
/build/
/RNTester/android/app/build/
/RNTester/android/app/gradle/
/RNTester/android/app/gradlew
/RNTester/android/app/gradlew.bat
/packages/rn-tester/android/app/build/
/packages/rn-tester/android/app/gradle/
/packages/rn-tester/android/app/gradlew
/packages/rn-tester/android/app/gradlew.bat
/ReactAndroid/build/
/ReactAndroid/gradle/
/ReactAndroid/gradlew
Expand Down Expand Up @@ -75,7 +75,8 @@ package-lock.json

# ReactCommon subdir shouldn't have Xcode project
/ReactCommon/**/*.xcodeproj
RNTester/build
/packages/rn-tester/build
/packages/rn-tester/android/app/build/*

# Libs that shouldn't have Xcode project
/Libraries/FBLazyVector/**/*.xcodeproj
Expand All @@ -87,11 +88,11 @@ RNTester/build
# CocoaPods
/template/ios/Pods/
/template/ios/Podfile.lock
/RNTester/Gemfile.lock
/packages/rn-tester/Gemfile.lock

# Ignore RNTester specific Pods, but keep the __offline_mirrors__ here.
RNTester/Pods/*
!RNTester/Pods/__offline_mirrors
/packages/rn-tester/Pods/*
!/packages/rn-tester/Pods/__offline_mirrors

# react-native-codegen
/packages/react-native-codegen/lib
Expand Down
4 changes: 2 additions & 2 deletions bots/report-bundle-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function getFileSize(path) {
*/
function android_getApkSize(engine, arch) {
return getFileSize(
`RNTester/android/app/build/outputs/apk/${engine}/release/app-${engine}-${arch}-release.apk`,
`packages/rn-tester/android/app/build/outputs/apk/${engine}/release/app-${engine}-${arch}-release.apk`,
);
}

Expand Down Expand Up @@ -171,7 +171,7 @@ function report(target) {
reportSizeStats(
{
'ios-universal': getFileSize(
'RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/RNTester',
'packages/rn-tester/build/Build/Products/Release-iphonesimulator/RNTester.app/RNTester',
),
},
'\\| ios \\| - \\| universal \\|',
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
'/node_modules/',
'<rootDir>/template',
'Libraries/Renderer',
'RNTester/e2e',
'packages/rn-tester/e2e',
],
transformIgnorePatterns: ['node_modules/(?!@react-native/)'],
haste: {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"test-android-unit": "yarn run docker-build-android && yarn run test-android-run-unit",
"test-android-e2e": "yarn run docker-build-android && yarn run test-android-run-e2e",
"build-ios-e2e": "detox build -c ios.sim.release",
"test-ios-e2e": "detox test -c ios.sim.release RNTester/e2e",
"test-ios-e2e": "detox test -c ios.sim.release packages/rn-tester/e2e",
"test-ios": "./scripts/objc-test.sh test"
},
"peerDependencies": {
Expand Down Expand Up @@ -157,36 +157,36 @@
},
"detox": {
"test-runner": "jest",
"runner-config": "RNTester/e2e/config.json",
"runner-config": "packages/rn-tester/e2e/config.json",
"specs": "",
"configurations": {
"android.emu.release": {
"binaryPath": "RNTester/android/app/build/outputs/apk/hermes/release/app-hermes-x86-release.apk",
"testBinaryPath": "RNTester/android/app/build/outputs/apk/androidTest/hermes/release/app-hermes-release-androidTest.apk",
"build": "./gradlew RNTester:android:app:assembleRelease RNTester:android:app:assembleAndroidTest -DtestBuildType=release",
"binaryPath": "packages/rn-tester/android/app/build/outputs/apk/hermes/release/app-hermes-x86-release.apk",
"testBinaryPath": "packages/rn-tester/android/app/build/outputs/apk/androidTest/hermes/release/app-hermes-release-androidTest.apk",
"build": "./gradlew :packages:rn-tester:android:app:assembleRelease RNTester:android:app:assembleAndroidTest -DtestBuildType=release",
"type": "android.emulator",
"device": {
"avdName": "Nexus_6_API_29"
}
},
"android.emu.debug": {
"binaryPath": "RNTester/android/app/build/outputs/apk/hermes/debug/app-hermes-x86-debug.apk",
"testBinaryPath": "RNTester/android/app/build/outputs/apk/androidTest/hermes/debug/app-hermes-debug-androidTest.apk",
"build": "./gradlew RNTester:android:app:assembleDebug RNTester:android:app:assembleAndroidTest -DtestBuildType=debug",
"binaryPath": "packages/rn-tester/android/app/build/outputs/apk/hermes/debug/app-hermes-x86-debug.apk",
"testBinaryPath": "packages/rn-tester/android/app/build/outputs/apk/androidTest/hermes/debug/app-hermes-debug-androidTest.apk",
"build": "./gradlew :packages:RNTester:android:app:assembleDebug RNTester:android:app:assembleAndroidTest -DtestBuildType=debug",
"type": "android.emulator",
"device": {
"avdName": "Nexus_6_API_29"
}
},
"ios.sim.release": {
"binaryPath": "RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/",
"build": "xcodebuild -workspace RNTester/RNTesterPods.xcworkspace -scheme RNTester -configuration Release -sdk iphonesimulator -derivedDataPath RNTester/build -UseModernBuildSystem=NO -quiet",
"binaryPath": "packages/rn-tester/build/Build/Products/Release-iphonesimulator/RNTester.app/",
"build": "xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme RNTester -configuration Release -sdk iphonesimulator -derivedDataPath packages/rn-tester/build -UseModernBuildSystem=NO -quiet",
"type": "ios.simulator",
"name": "iPhone 8"
},
"ios.sim.debug": {
"binaryPath": "RNTester/build/Build/Products/Debug-iphonesimulator/RNTester.app/",
"build": "xcodebuild -workspace RNTester/RNTesterPods.xcworkspace -scheme RNTester -configuration Debug -sdk iphonesimulator -derivedDataPath RNTester/build -UseModernBuildSystem=NO -quiet",
"binaryPath": "packages/rn-tester/build/Build/Products/Debug-iphonesimulator/RNTester.app/",
"build": "xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme RNTester -configuration Debug -sdk iphonesimulator -derivedDataPath packages/rn-tester/build -UseModernBuildSystem=NO -quiet",
"type": "ios.simulator",
"name": "iPhone 8"
}
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 7 additions & 6 deletions RNTester/Podfile → packages/rn-tester/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../scripts/react_native_pods'
require_relative '../../scripts/react_native_pods'

source 'https://cdn.cocoapods.org/'
platform :ios, '10.0'
Expand All @@ -12,12 +12,13 @@ def pods()
project 'RNTesterPods.xcodeproj'

# Enable TurboModule
use_react_native!(path: "..")
pod 'ReactCommon/turbomodule/samples', :path => '../ReactCommon'
prefix_path = "../.."
use_react_native!(path:prefix_path)
pod 'ReactCommon/turbomodule/samples', :path => "#{prefix_path}/ReactCommon"

# Additional Pods which aren't included in the default Podfile
pod 'React-RCTPushNotification', :path => '../Libraries/PushNotificationIOS'
pod 'Yoga',:path => '../ReactCommon/yoga', :modular_headers => true
pod 'React-RCTPushNotification', :path => "#{prefix_path}/Libraries/PushNotificationIOS"
pod 'Yoga',:path => "#{prefix_path}/ReactCommon/yoga", :modular_headers => true
# Additional Pods which are classed as unstable
#
# To use fabric: add `fabric_enabled` option to the use_react_native method above, like below
Expand Down Expand Up @@ -56,7 +57,7 @@ def frameworks_pre_install(installer)
end

def codegen_pre_install(installer)
system("../scripts/generate-native-modules-specs.sh")
system("../../scripts/generate-native-modules-specs.sh")
end

pre_install do |installer|
Expand Down
128 changes: 64 additions & 64 deletions RNTester/Podfile.lock → packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ PODS:
- Yoga (~> 1.14)

DEPENDENCIES:
- DoubleConversion (from `../third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../Libraries/FBReactNativeSpec`)
- DoubleConversion (from `../../third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../../Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../../Libraries/FBReactNativeSpec`)
- Flipper (~> 0.41.1)
- Flipper-DoubleConversion (= 1.1.7)
- Flipper-Folly (~> 2.2)
Expand All @@ -376,36 +376,36 @@ DEPENDENCIES:
- FlipperKit/FlipperKitReactPlugin (~> 0.41.1)
- FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.41.1)
- FlipperKit/SKIOSNetworkPlugin (~> 0.41.1)
- Folly (from `../third-party-podspecs/Folly.podspec`)
- glog (from `../third-party-podspecs/glog.podspec`)
- RCTRequired (from `../Libraries/RCTRequired`)
- RCTTypeSafety (from `../Libraries/TypeSafety`)
- React (from `../`)
- React-callinvoker (from `../ReactCommon/callinvoker`)
- React-Core (from `../`)
- React-Core/DevSupport (from `../`)
- React-Core/RCTWebSocket (from `../`)
- React-CoreModules (from `../React/CoreModules`)
- React-cxxreact (from `../ReactCommon/cxxreact`)
- React-jsi (from `../ReactCommon/jsi`)
- React-jsiexecutor (from `../ReactCommon/jsiexecutor`)
- React-jsinspector (from `../ReactCommon/jsinspector`)
- React-perflogger (from `../ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../Libraries/NativeAnimation`)
- React-RCTBlob (from `../Libraries/Blob`)
- React-RCTImage (from `../Libraries/Image`)
- React-RCTLinking (from `../Libraries/LinkingIOS`)
- React-RCTNetwork (from `../Libraries/Network`)
- React-RCTPushNotification (from `../Libraries/PushNotificationIOS`)
- React-RCTSettings (from `../Libraries/Settings`)
- Folly (from `../../third-party-podspecs/Folly.podspec`)
- glog (from `../../third-party-podspecs/glog.podspec`)
- RCTRequired (from `../../Libraries/RCTRequired`)
- RCTTypeSafety (from `../../Libraries/TypeSafety`)
- React (from `../../`)
- React-callinvoker (from `../../ReactCommon/callinvoker`)
- React-Core (from `../../`)
- React-Core/DevSupport (from `../../`)
- React-Core/RCTWebSocket (from `../../`)
- React-CoreModules (from `../../React/CoreModules`)
- React-cxxreact (from `../../ReactCommon/cxxreact`)
- React-jsi (from `../../ReactCommon/jsi`)
- React-jsiexecutor (from `../../ReactCommon/jsiexecutor`)
- React-jsinspector (from `../../ReactCommon/jsinspector`)
- React-perflogger (from `../../ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../../Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../../Libraries/NativeAnimation`)
- React-RCTBlob (from `../../Libraries/Blob`)
- React-RCTImage (from `../../Libraries/Image`)
- React-RCTLinking (from `../../Libraries/LinkingIOS`)
- React-RCTNetwork (from `../../Libraries/Network`)
- React-RCTPushNotification (from `../../Libraries/PushNotificationIOS`)
- React-RCTSettings (from `../../Libraries/Settings`)
- React-RCTTest (from `./RCTTest`)
- React-RCTText (from `../Libraries/Text`)
- React-RCTVibration (from `../Libraries/Vibration`)
- React-runtimeexecutor (from `../ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../ReactCommon`)
- ReactCommon/turbomodule/samples (from `../ReactCommon`)
- Yoga (from `../ReactCommon/yoga`)
- React-RCTText (from `../../Libraries/Text`)
- React-RCTVibration (from `../../Libraries/Vibration`)
- React-runtimeexecutor (from `../../ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../../ReactCommon`)
- ReactCommon/turbomodule/samples (from `../../ReactCommon`)
- Yoga (from `../../ReactCommon/yoga`)

SPEC REPOS:
trunk:
Expand All @@ -424,73 +424,73 @@ SPEC REPOS:

EXTERNAL SOURCES:
DoubleConversion:
:podspec: "../third-party-podspecs/DoubleConversion.podspec"
:podspec: "../../third-party-podspecs/DoubleConversion.podspec"
FBLazyVector:
:path: "../Libraries/FBLazyVector"
:path: "../../Libraries/FBLazyVector"
FBReactNativeSpec:
:path: "../Libraries/FBReactNativeSpec"
:path: "../../Libraries/FBReactNativeSpec"
Folly:
:podspec: "../third-party-podspecs/Folly.podspec"
:podspec: "../../third-party-podspecs/Folly.podspec"
glog:
:podspec: "../third-party-podspecs/glog.podspec"
:podspec: "../../third-party-podspecs/glog.podspec"
RCTRequired:
:path: "../Libraries/RCTRequired"
:path: "../../Libraries/RCTRequired"
RCTTypeSafety:
:path: "../Libraries/TypeSafety"
:path: "../../Libraries/TypeSafety"
React:
:path: "../"
:path: "../../"
React-callinvoker:
:path: "../ReactCommon/callinvoker"
:path: "../../ReactCommon/callinvoker"
React-Core:
:path: "../"
:path: "../../"
React-CoreModules:
:path: "../React/CoreModules"
:path: "../../React/CoreModules"
React-cxxreact:
:path: "../ReactCommon/cxxreact"
:path: "../../ReactCommon/cxxreact"
React-jsi:
:path: "../ReactCommon/jsi"
:path: "../../ReactCommon/jsi"
React-jsiexecutor:
:path: "../ReactCommon/jsiexecutor"
:path: "../../ReactCommon/jsiexecutor"
React-jsinspector:
:path: "../ReactCommon/jsinspector"
:path: "../../ReactCommon/jsinspector"
React-perflogger:
:path: "../ReactCommon/reactperflogger"
:path: "../../ReactCommon/reactperflogger"
React-RCTActionSheet:
:path: "../Libraries/ActionSheetIOS"
:path: "../../Libraries/ActionSheetIOS"
React-RCTAnimation:
:path: "../Libraries/NativeAnimation"
:path: "../../Libraries/NativeAnimation"
React-RCTBlob:
:path: "../Libraries/Blob"
:path: "../../Libraries/Blob"
React-RCTImage:
:path: "../Libraries/Image"
:path: "../../Libraries/Image"
React-RCTLinking:
:path: "../Libraries/LinkingIOS"
:path: "../../Libraries/LinkingIOS"
React-RCTNetwork:
:path: "../Libraries/Network"
:path: "../../Libraries/Network"
React-RCTPushNotification:
:path: "../Libraries/PushNotificationIOS"
:path: "../../Libraries/PushNotificationIOS"
React-RCTSettings:
:path: "../Libraries/Settings"
:path: "../../Libraries/Settings"
React-RCTTest:
:path: "./RCTTest"
React-RCTText:
:path: "../Libraries/Text"
:path: "../../Libraries/Text"
React-RCTVibration:
:path: "../Libraries/Vibration"
:path: "../../Libraries/Vibration"
React-runtimeexecutor:
:path: "../ReactCommon/runtimeexecutor"
:path: "../../ReactCommon/runtimeexecutor"
ReactCommon:
:path: "../ReactCommon"
:path: "../../ReactCommon"
Yoga:
:path: "../ReactCommon/yoga"
:path: "../../ReactCommon/yoga"

SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 8ea0285646adaf7fa725c20ed737c49ee5ea680a
FBReactNativeSpec: e8f07c749b9cf184c819f5a8ca44b91ab61fca12
FBLazyVector: 4f846f6dbe3e8641eed90bc8c08c6e45ffbd6f9e
FBReactNativeSpec: 015ce97eac985833c513751e41d44ee887767169
Flipper: 33585e2d9810fe5528346be33bcf71b37bb7ae13
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3
Expand Down Expand Up @@ -528,6 +528,6 @@ SPEC CHECKSUMS:
Yoga: f7fa200d8c49f97b54c9421079e781fb900b5cae
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: b81a6d17037664baa1b98b1c4ff2ec7b04aa928d
PODFILE CHECKSUM: 3045d3456f0f2268f15db9a527839e6a19e6071c

COCOAPODS: 1.8.4
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

require "json"

package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
version = package['version']

source = { :git => 'https://github.com/facebook/react-native.git' }
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWith
- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge
{
NSString *bundlePrefix = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"RN_BUNDLE_PREFIX"];
NSString *bundleRoot = [NSString stringWithFormat:@"%@RNTester/js/RNTesterApp.ios", bundlePrefix];
NSString *bundleRoot = [NSString stringWithFormat:@"%@packages/rn-tester/js/RNTesterApp.ios", bundlePrefix];
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:bundleRoot
fallbackResource:nil];
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../../scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../../scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
showEnvVarsInLog = 0;
};
64C8C8D2305EEDFDE304A0E6 /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -586,7 +586,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n\"$SRCROOT/../scripts/react-native-xcode.sh\" RNTester/js/RNTesterApp.ios.js\n";
shellScript = "export NODE_BINARY=node\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n";
};
C1C7A9D58CE1D09515F20577 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
File renamed without changes.
Loading