Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ jobs:
run: npx react-native bundle --entry-file index.js --platform macos --dev false --minify false --bundle-output dist/main.macos.jsbundle --assets-dest dist/res
working-directory: apps/macos-test-app
- name: Build test app
run: xcodebuild archive -workspace MacOSTestApp.xcworkspace -configuration Release -scheme MacOSTestApp-macOS -destination generic/platform="macOS" -archivePath ./build/macos-test-app.xcarchive | xcbeautify
# pipefail so an xcodebuild failure is not masked by xcbeautify's exit code
run: set -o pipefail && xcodebuild archive -workspace MacOSTestApp.xcworkspace -configuration Release -scheme MacOSTestApp-macOS -destination generic/platform="macOS" -archivePath ./build/macos-test-app.xcarchive | xcbeautify
working-directory: apps/macos-test-app/macos
- name: Run test app
run: npx mocha-remote --exit-on-error -- macos/build/macos-test-app.xcarchive/Products/Applications/MacOSTestApp.app/Contents/MacOS/MacOSTestApp
Expand Down
9 changes: 9 additions & 0 deletions apps/test-app/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ if (config.projectRoot.endsWith("macos-test-app")) {
// duplicate react-native version and pollution of the package lock.
const path = require("node:path");
config.watchFolders.push(path.resolve(__dirname, "../.."));

// Resolve workspace packages (and the specifiers the babel plugin rewrites
// their `*.node` requires to) from this app's own node_modules, independent of
// the root package manager's hoisting layout.
config.resolver = config.resolver || {};
config.resolver.nodeModulesPaths = [
...(config.resolver.nodeModulesPaths || []),
path.resolve(__dirname, "node_modules"),
];
}

module.exports = config;
8 changes: 6 additions & 2 deletions scripts/init-macos-test-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import fs from "node:fs";
import path from "node:path";
import { readPackage } from "read-pkg";

const REACT_NATIVE_VERSION = "0.81.5";
const REACT_NATIVE_MACOS_VERSION = "0.81.1";
// react-native-macos peer-pins an exact react-native core version
// (react-native-macos 0.81.8 -> react-native 0.81.6); keep these two in lockstep.
const REACT_NATIVE_VERSION = "0.81.6";
const REACT_NATIVE_MACOS_VERSION = "0.81.8";
const REACT_VERSION = "^19.1.4";

const ROOT_PATH = path.join(import.meta.dirname, "..");
Expand Down Expand Up @@ -88,6 +90,8 @@ async function patchPackageJson() {

const transferredDependencies = new Set([
"@rnx-kit/metro-config",
// Needed by mocha-remote-server at runtime (not hoisted for this standalone app).
"mocha",
"mocha-remote-cli",
"mocha-remote-react-native",
]);
Expand Down
Loading