From ca2b0938ef739eaf91ddef9dffd6d6c7a5fbee4f Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Thu, 22 Jan 2026 21:03:20 +0000 Subject: [PATCH 1/6] fix: fix `@react-native-community/cli-platform-apple` not being resolved correctly (#2820) ## Summary: `@react-native-community/cli-platform-apple` is not correctly resolved in pnpm setups: ``` % DEBUG=react-native yarn build:macos /~/packages/app/example/node_modules/react-native-macos/react-native.config.js: @react-native-community/cli-platform-apple not found, the react-native.config.js may be unusable. info Bundling macos... error Invalid platform "macos" selected. info Available platforms are: "android", "ios", "windows". If you are trying to bundle for an out-of-tree platform, it may not be installed. ``` ## Test Plan: n/a --- packages/react-native/react-native.config.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/react-native/react-native.config.js b/packages/react-native/react-native.config.js index 46579f1475b48b..4fc760e979c04d 100644 --- a/packages/react-native/react-native.config.js +++ b/packages/react-native/react-native.config.js @@ -71,8 +71,14 @@ try { // [macOS let apple; try { + const iosPath = require.resolve('@react-native-community/cli-platform-ios', { + paths: [process.cwd()], + }); // $FlowFixMe[untyped-import] - apple = require('@react-native-community/cli-platform-apple'); + apple = findCommunityPlatformPackage( + '@react-native-community/cli-platform-apple', + iosPath, + ); } catch { if (verbose) { console.warn( @@ -156,7 +162,7 @@ if (android != null) { // [macOS config.commands.push(...macosCommands); -if (apple != null) { +if (apple) { config.platforms.macos = { linkConfig: () => { return { From be52b83e4f8f942fc1970960f4ae44f036ae2ab2 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Thu, 22 Jan 2026 20:08:33 +0000 Subject: [PATCH 2/6] fix(cli): fix undeclared `chalk` dependency (#2819) ## Summary: macOS bundling fails because it tries to import `chalk` but does not declare it. ``` /~/packages/app/example/node_modules/react-native-macos/react-native.config.js: node:internal/modules/cjs/loader:1421 const err = new Error(message); ^ Error: Cannot find module 'chalk' Require stack: - /~/node_modules/.store/react-native-macos-virtual-89732d1908/package/local-cli/runMacOS/runMacOS.js - /~/node_modules/.store/react-native-macos-virtual-89732d1908/package/react-native.config.js at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15) at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19) at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22) at Module._load (node:internal/modules/cjs/loader:1227:37) at TracingChannel.traceSync (node:diagnostics_channel:328:14) at wrapModuleLoad (node:internal/modules/cjs/loader:245:24) at Module.require (node:internal/modules/cjs/loader:1504:12) at require (node:internal/modules/helpers:152:16) at Object. (/~/node_modules/.store/react-native-macos-virtual-89732d1908/package/local-cli/runMacOS/runMacOS.js:38:15) at Module._compile (node:internal/modules/cjs/loader:1761:14) { code: 'MODULE_NOT_FOUND', requireStack: [ '/~/node_modules/.store/react-native-macos-virtual-89732d1908/package/local-cli/runMacOS/runMacOS.js', '/~/node_modules/.store/react-native-macos-virtual-89732d1908/package/react-native.config.js' ] } ``` Instead of adding `chalk` as a dependency (and introducing a diff), we inline the functions we use. ## Test Plan: n/a --- .../local-cli/runMacOS/runMacOS.js | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/react-native/local-cli/runMacOS/runMacOS.js b/packages/react-native/local-cli/runMacOS/runMacOS.js index e171d776937f63..9fad4f6555c681 100644 --- a/packages/react-native/local-cli/runMacOS/runMacOS.js +++ b/packages/react-native/local-cli/runMacOS/runMacOS.js @@ -35,12 +35,27 @@ * }} ProjectConfig */ -const chalk = require('chalk'); -const child_process = require('child_process'); -const path = require('path'); +const child_process = require('node:child_process'); +const path = require('node:path'); -const {logger, CLIError, getDefaultUserTerminal} = (() => { - const cli = require.resolve('@react-native-community/cli/package.json'); +const colors = (() => { + const {WriteStream} = require('node:tty'); + if (WriteStream.prototype.hasColors() && + !process.env.NODE_TEST_CONTEXT && + process.env.NODE_ENV !== 'test' + ) { + return { + bold: (s) => '\u001B[1m' + s + '\u001B[22m', + dim: (s) => '\u001B[2m' + s + '\u001B[22m', + } + } + + const passthrough = (s) => s; + return { bold: passthrough, dim: passthrough }; +})(); + +const {logger, CLIError, getDefaultUserTerminal} = ((projectRoot = process.cwd()) => { + const cli = require.resolve('@react-native-community/cli/package.json', {paths: [projectRoot]}); const options = {paths: [path.dirname(cli)]}; const tools = require.resolve('@react-native-community/cli-tools', options); return require(tools); @@ -92,7 +107,7 @@ function parseArgs(ctx, args) { logger.info( `Found Xcode ${ xcodeProject.isWorkspace ? 'workspace' : 'project' - } "${chalk.bold(xcodeProject.name)}"`, + } "${colors.bold(xcodeProject.name)}"`, ); return {sourceDir, xcodeProject, scheme}; @@ -146,7 +161,7 @@ async function run(sourceDir, xcodeProject, scheme, args) { .trim(); logger.info( - `Launching app "${chalk.bold(bundleID)}" from "${chalk.bold(appPath)}"`, + `Launching app "${colors.bold(bundleID)}" from "${colors.bold(appPath)}"`, ); child_process.exec( @@ -179,7 +194,7 @@ function buildProject(sourceDir, xcodeProject, scheme, args) { scheme, ]; logger.info( - `Building ${chalk.dim( + `Building ${colors.dim( `(using "xcodebuild ${xcodebuildArgs.join(' ')}")`, )}`, ); From fcf4a0e580f40d63721a505d70b7d2fc8e5cd68a Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 22 Jan 2026 13:06:36 -0800 Subject: [PATCH 3/6] version plan --- .nx/version-plans/version-plan-1769115988858.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .nx/version-plans/version-plan-1769115988858.md diff --git a/.nx/version-plans/version-plan-1769115988858.md b/.nx/version-plans/version-plan-1769115988858.md new file mode 100644 index 00000000000000..6c450ac23e99a4 --- /dev/null +++ b/.nx/version-plans/version-plan-1769115988858.md @@ -0,0 +1,5 @@ +--- +__default__: patch +--- + +Release 0.81.1 From 0371e410630ff0c9051e746986416aceac1142ba Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 22 Jan 2026 13:39:52 -0800 Subject: [PATCH 4/6] fix: set codegenConfig key to macos --- packages/react-native/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 666825082cd283..3a9b3bdf568f3c 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -205,7 +205,7 @@ { "name": "FBReactNativeSpec", "type": "all", - "ios": { + "macos": { "modules": { "AccessibilityManager": { "unstableRequiresMainQueueSetup": true From 49b342f9635b08602a4b3842effbeda11f5d09fd Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 22 Jan 2026 13:50:58 -0800 Subject: [PATCH 5/6] `yarn constraints --fix` --- package.json | 2 +- packages/nx-release-version/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0f05e8a14be9dc..95f5467c89a6e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-macos/monorepo", - "version": "0.81.0-rc0", + "version": "0.81.0", "license": "MIT", "packageManager": "yarn@4.12.0", "scripts": { diff --git a/packages/nx-release-version/package.json b/packages/nx-release-version/package.json index 314c8388a7d598..45119c8897da99 100644 --- a/packages/nx-release-version/package.json +++ b/packages/nx-release-version/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-macos/nx-release-version", - "version": "0.81.0-rc0", + "version": "0.81.0", "description": "Nx Release Version Actions for React Native macOS", "homepage": "https://github.com/microsoft/react-native-macos/tree/HEAD/packages/nx-release-version#readme", "license": "MIT", From 6999f79737c551aa7649d9f1733d70a6a39ac89f Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 22 Jan 2026 13:51:27 -0800 Subject: [PATCH 6/6] `yarn test -u` --- .../generate-artifacts-executor-test.js.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-native/scripts/codegen/__tests__/__snapshots__/generate-artifacts-executor-test.js.snap b/packages/react-native/scripts/codegen/__tests__/__snapshots__/generate-artifacts-executor-test.js.snap index 72417e5e0f655d..5d6fce2dac5fe8 100644 --- a/packages/react-native/scripts/codegen/__tests__/__snapshots__/generate-artifacts-executor-test.js.snap +++ b/packages/react-native/scripts/codegen/__tests__/__snapshots__/generate-artifacts-executor-test.js.snap @@ -361,7 +361,7 @@ exports[`execute test-app "ReactAppDependencyProvider.podspec" should match snap # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -version = \\"0.81.0-rc0\\" +version = \\"0.81.0\\" source = { :git => 'https://github.com/facebook/react-native.git' } if version == '1000.0.0' # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. @@ -399,7 +399,7 @@ exports[`execute test-app "ReactCodegen.podspec" should match snapshot 1`] = ` # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -version = \\"0.81.0-rc0\\" +version = \\"0.81.0\\" source = { :git => 'https://github.com/facebook/react-native.git' } if version == '1000.0.0' # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. @@ -840,7 +840,7 @@ exports[`execute test-app-legacy "ReactAppDependencyProvider.podspec" should mat # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -version = \\"0.81.0-rc0\\" +version = \\"0.81.0\\" source = { :git => 'https://github.com/facebook/react-native.git' } if version == '1000.0.0' # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. @@ -878,7 +878,7 @@ exports[`execute test-app-legacy "ReactCodegen.podspec" should match snapshot 1` # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -version = \\"0.81.0-rc0\\" +version = \\"0.81.0\\" source = { :git => 'https://github.com/facebook/react-native.git' } if version == '1000.0.0' # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.