Skip to content

Commit b6fc6ca

Browse files
authored
chore: migrate build/run commands to @rnx-kit/cli (#2266)
1 parent f647894 commit b6fc6ca

File tree

5 files changed

+594
-32
lines changed

5 files changed

+594
-32
lines changed

example/package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
6-
"android": "react-native run-android --no-packager",
7-
"build:android": "react-native bundle --entry-file index.ts --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
8-
"build:ios": "react-native bundle --entry-file index.ts --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist",
9-
"build:macos": "react-native bundle --entry-file index.ts --platform macos --dev true --bundle-output dist/main.macos.jsbundle --assets-dest dist",
10-
"build:visionos": "react-native bundle --entry-file index.ts --platform ios --dev true --bundle-output dist/main.visionos.jsbundle --assets-dest dist",
11-
"build:windows": "react-native bundle --entry-file index.ts --platform windows --dev true --bundle-output dist/main.windows.bundle --assets-dest dist",
12-
"ci:windows": "react-native run-windows --logging --no-packager --no-launch --no-deploy --msbuildprops UseBundle=false --no-telemetry",
6+
"android": "rnx-cli run --platform android",
7+
"build:android": "rnx-cli bundle --platform android",
8+
"build:ios": "rnx-cli bundle --platform ios",
9+
"build:macos": "rnx-cli bundle --platform macos",
10+
"build:visionos": "rnx-cli bundle --platform ios",
11+
"build:windows": "rnx-cli bundle --platform windows",
12+
"ci:windows": "rnx-cli run-windows --logging --no-packager --no-launch --no-deploy --msbuildprops UseBundle=false --no-telemetry",
1313
"clean": "yarn workspace react-native-test-app clean",
14-
"ios": "react-native run-ios --no-packager",
15-
"macos": "react-native run-macos --no-packager --scheme Example",
14+
"ios": "rnx-cli run --platform ios",
15+
"macos": "rnx-cli run --platform macos",
1616
"set-react-version": "yarn workspace react-native-test-app set-react-version",
17-
"start": "react-native start",
18-
"visionos": "react-native run-visionos --no-packager",
19-
"windows": "react-native run-windows --no-packager"
17+
"start": "rnx-cli start",
18+
"visionos": "rnx-cli run --platform visionos",
19+
"windows": "rnx-cli run-windows --no-packager"
2020
},
2121
"dependencies": {
2222
"@callstack/react-native-visionos": "^0.77.0",
@@ -32,6 +32,7 @@
3232
"@react-native-community/cli": "^15.0.1",
3333
"@react-native/babel-preset": "^0.77.0",
3434
"@react-native/metro-config": "^0.77.0",
35+
"@rnx-kit/cli": "^0.18.6",
3536
"@rnx-kit/metro-config": "^2.0.0",
3637
"@rnx-kit/polyfills": "^0.2.0",
3738
"@rnx-kit/tsconfig": "^2.0.0",

example/test/specs/wdio.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,6 @@ export const config = {
156156
};
157157

158158
export function iosSimulatorName() {
159-
const [deviceName, platformVersion] = findLatestIPhoneSimulator();
160-
return `${deviceName} (${platformVersion})`;
159+
const [deviceName] = findLatestIPhoneSimulator();
160+
return deviceName;
161161
}

scripts/testing/react-native.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ function runAndroid() {
1919
// a device, we can assume that it has successfully created a config and
2020
// determined that there is an Android project that can be built and launched.
2121
const success = /No Android device or emulator connected/;
22-
run(success, "android", "--deviceId", DEVICE_ID, "--no-packager");
22+
run(success, "android", "--deviceId", DEVICE_ID);
2323
}
2424

2525
function runIOS() {
2626
// If `@react-native-community/cli` reaches the point where it is looking for
2727
// a device, we can assume that it has successfully created a config and
2828
// determined that there is an iOS project that can be built and launched.
2929
const success = new RegExp(`Could not find .*: "${DEVICE_ID}"`);
30-
run(success, "ios", "--device", DEVICE_ID, "--no-packager");
30+
run(success, "ios", "--device", DEVICE_ID);
3131
}
3232

3333
function runMacOS() {

scripts/testing/test-matrix.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ function buildAndRun(platform: TargetPlatform) {
193193
switch (platform) {
194194
case "ios": {
195195
const simulator = getIOSSimulatorName();
196-
$(PACKAGE_MANAGER, platform, "--simulator", simulator, "--no-packager");
196+
$(PACKAGE_MANAGER, platform, "--device", simulator);
197197
break;
198198
}
199199
default: {
200-
$(PACKAGE_MANAGER, platform, "--no-packager");
200+
$(PACKAGE_MANAGER, platform);
201201
break;
202202
}
203203
}

0 commit comments

Comments
 (0)