From 5a844864a23413f6ae5e0678891190b5667bff78 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 15:51:57 -0700 Subject: [PATCH 01/13] fix(0.81): resolve macos platform config from cwd instead of ios path The `apple` platform package was being resolved via a two-step lookup: first resolving `cli-platform-ios` to a file path, then using that file path as the search root for `cli-platform-apple`. The `require.resolve` `paths` option expects directory paths, not file paths, causing silent resolution failures when `react-native-macos` is loaded as a dependency config (e.g. via `npm install `). Simplify to use the same `findCommunityPlatformPackage(spec)` pattern as `ios` and `android`, which defaults to `process.cwd()` as the search root. Since `cli-platform-apple` is a dependency of `cli-platform-ios` and gets hoisted by npm, it is directly resolvable from the project root. Fixes the "Invalid platform macos" error in the init integration test. Co-Authored-By: Claude Opus 4.6 --- packages/react-native/react-native.config.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/react-native/react-native.config.js b/packages/react-native/react-native.config.js index 4fc760e979c0..a34cefa6cf07 100644 --- a/packages/react-native/react-native.config.js +++ b/packages/react-native/react-native.config.js @@ -71,13 +71,8 @@ try { // [macOS let apple; try { - const iosPath = require.resolve('@react-native-community/cli-platform-ios', { - paths: [process.cwd()], - }); - // $FlowFixMe[untyped-import] apple = findCommunityPlatformPackage( '@react-native-community/cli-platform-apple', - iosPath, ); } catch { if (verbose) { From 2386cb907339868b7f518ee0dd33a1406edfc047 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 16:19:28 -0700 Subject: [PATCH 02/13] fix(0.81): fix "Invalid platform macos" in init integration test Two issues prevented the macos platform from being registered when the test project loads react-native-macos as a dependency: 1. `yarn build` rewrites package.json "exports" from ./src to ./dist for publishing. The dist/ files use ESM syntax that requires babel-register (only wired up in src/index.js). When the test project loads react-native-macos via symlink, require('@react-native/ community-cli-plugin') resolves to dist/index.js which fails to load, silently preventing the macos platform from being registered. Fix: restore src exports after yarn build in the CI workflow. 2. The cli-platform-apple resolution used a fragile two-step lookup (resolve cli-platform-ios file path, use as search root for cli-platform-apple). Simplify to use the same findCommunityPlatform- Package(spec) pattern as ios and android, which defaults to cwd. Co-Authored-By: Claude Opus 4.6 --- .../microsoft-test-react-native-macos-init.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index d16c97c42ffc..cdf44b904ff3 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -26,7 +26,17 @@ jobs: run: yarn install - name: Build community CLI plugin - run: yarn build + run: | + yarn build + # yarn build rewrites package.json "exports" from ./src to ./dist + # for publishing. The dist/ files use ESM syntax that requires + # babel-register (only wired up in src/index.js). When the test + # project loads react-native-macos as a dependency via symlink, + # require('@react-native/community-cli-plugin') resolves to + # dist/index.js which fails to load, silently preventing the + # macos platform from being registered. Restore src exports so + # the monorepo's babel-register entry point is used. + git checkout -- packages/*/package.json - name: Build react-native-macos-init working-directory: packages/react-native-macos-init From ae137796e8946ee2c287451987f4d19f00b6e49d Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 16:42:35 -0700 Subject: [PATCH 03/13] ci: add debug logging for macos platform config resolution Co-Authored-By: Claude Opus 4.6 --- .../microsoft-test-react-native-macos-init.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index cdf44b904ff3..447179c5cea5 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -70,6 +70,21 @@ jobs: node ${{ github.workspace }}/packages/react-native-macos-init/bin.js --verbose --overwrite --prerelease pod install --project-directory=macos + - name: Debug config + working-directory: ${{ runner.temp }}/testcli + run: | + set -eox pipefail + echo "=== node_modules/react-native-macos symlink ===" + ls -la node_modules/react-native-macos + echo "=== community-cli-plugin exports ===" + node -e "console.log(require('${{ github.workspace }}/packages/community-cli-plugin/package.json').exports)" + echo "=== community-cli-plugin resolve ===" + node -e "console.log(require.resolve('@react-native/community-cli-plugin', {paths: [require.resolve('react-native-macos')]}))" + echo "=== cli.js config platforms ===" + node node_modules/react-native-macos/cli.js config 2>&1 | node -e "const d=JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); console.log('platforms:', Object.keys(d.platforms))" + echo "=== direct config load ===" + node -e "process.chdir('${{ runner.temp }}/testcli'); const c = require('${{ github.workspace }}/packages/react-native/react-native.config.js'); console.log('platforms:', Object.keys(c.platforms))" + - name: Build macOS app working-directory: ${{ runner.temp }}/testcli run: | From 7185e9ad378588946b993e35d4c44358b01e8eae Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 17:18:01 -0700 Subject: [PATCH 04/13] fix(0.81): use --install-links to avoid module instance duplication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm install creates a symlink, causing Node to follow the real path back to the monorepo for module resolution. This means bundle.js loads @react-native/metro-config from the monorepo while the user's metro.config.js loads it from the test project's node_modules — two different instances. setFrameworkDefaults() (which registers the "macos" platform) targets the monorepo's instance, so the test project never sees it and xcodebuild fails with "Invalid platform macos". Using --install-links copies the package files instead, so all require() calls resolve from a single node_modules tree. Also removes debug steps that are no longer needed. Co-Authored-By: Claude Opus 4.6 --- ...microsoft-test-react-native-macos-init.yml | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index 447179c5cea5..952b91d2d68f 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -29,13 +29,8 @@ jobs: run: | yarn build # yarn build rewrites package.json "exports" from ./src to ./dist - # for publishing. The dist/ files use ESM syntax that requires - # babel-register (only wired up in src/index.js). When the test - # project loads react-native-macos as a dependency via symlink, - # require('@react-native/community-cli-plugin') resolves to - # dist/index.js which fails to load, silently preventing the - # macos platform from being registered. Restore src exports so - # the monorepo's babel-register entry point is used. + # for publishing. Restore the original exports so that any + # monorepo tooling that still runs from source continues to work. git checkout -- packages/*/package.json - name: Build react-native-macos-init @@ -61,7 +56,14 @@ jobs: working-directory: ${{ runner.temp }}/testcli run: | set -eox pipefail - npm install ${{ github.workspace }}/packages/react-native + # --install-links copies the package instead of symlinking it. + # Without this, Node follows the symlink's real path back to the + # monorepo for module resolution, causing bundle.js to load a + # different instance of @react-native/metro-config than the one + # the user's metro.config.js uses. The setFrameworkDefaults() + # call (which registers the "macos" platform) then targets the + # wrong instance, and xcodebuild fails with "Invalid platform". + npm install --install-links ${{ github.workspace }}/packages/react-native - name: Apply macOS template working-directory: ${{ runner.temp }}/testcli @@ -70,21 +72,6 @@ jobs: node ${{ github.workspace }}/packages/react-native-macos-init/bin.js --verbose --overwrite --prerelease pod install --project-directory=macos - - name: Debug config - working-directory: ${{ runner.temp }}/testcli - run: | - set -eox pipefail - echo "=== node_modules/react-native-macos symlink ===" - ls -la node_modules/react-native-macos - echo "=== community-cli-plugin exports ===" - node -e "console.log(require('${{ github.workspace }}/packages/community-cli-plugin/package.json').exports)" - echo "=== community-cli-plugin resolve ===" - node -e "console.log(require.resolve('@react-native/community-cli-plugin', {paths: [require.resolve('react-native-macos')]}))" - echo "=== cli.js config platforms ===" - node node_modules/react-native-macos/cli.js config 2>&1 | node -e "const d=JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); console.log('platforms:', Object.keys(d.platforms))" - echo "=== direct config load ===" - node -e "process.chdir('${{ runner.temp }}/testcli'); const c = require('${{ github.workspace }}/packages/react-native/react-native.config.js'); console.log('platforms:', Object.keys(c.platforms))" - - name: Build macOS app working-directory: ${{ runner.temp }}/testcli run: | From b901cecdb26bdc63641c4d6979ced2abe1d14843 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 19:05:37 -0700 Subject: [PATCH 05/13] fix(0.81): use yarn pack + yarn add to match normal install flow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace npm install --install-links with yarn pack + yarn add. npm install creates a symlink, and --install-links copies files but without pre-generated codegen headers. Both diverge from a normal user's install in ways that break the build: 1. Symlinks cause Node module instance duplication (bundle.js loads @react-native/metro-config from the monorepo while metro.config.js loads it from the test project — setFrameworkDefaults misses). 2. Missing React/FBReactNativeSpec/ headers (generated by prepack.js, shipped in published tarballs). Without them the codegen regenerates, but the upstream react-native's FBReactNativeSpec processes first, creating the directory — then the fork's version is skipped by shouldSkipGenerationForFBReactNativeSpec(), leaving headers without macOS-specific fields (critical, modal, defaultInputs). yarn pack runs the prepack script (generating the codegen headers) and produces a tarball identical to what npm publish would create. yarn add installs it as a regular package — no symlinks, correct headers, matching the normal user flow exactly. Co-Authored-By: Claude Opus 4.6 --- .../microsoft-test-react-native-macos-init.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index 952b91d2d68f..aaf4bb3d3699 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -56,14 +56,15 @@ jobs: working-directory: ${{ runner.temp }}/testcli run: | set -eox pipefail - # --install-links copies the package instead of symlinking it. - # Without this, Node follows the symlink's real path back to the - # monorepo for module resolution, causing bundle.js to load a - # different instance of @react-native/metro-config than the one - # the user's metro.config.js uses. The setFrameworkDefaults() - # call (which registers the "macos" platform) then targets the - # wrong instance, and xcodebuild fails with "Invalid platform". - npm install --install-links ${{ github.workspace }}/packages/react-native + # Pack the local package into a tarball first. This runs the + # "prepack" script which generates the FBReactNativeSpec codegen + # headers (React/FBReactNativeSpec/) that are shipped in published + # releases. Then install from the tarball so the test project + # matches a normal user's node_modules layout: no symlinks (which + # cause module instance duplication) and pre-generated codegen + # headers present (which the build relies on to skip regeneration). + yarn --cwd ${{ github.workspace }}/packages/react-native pack -o ${{ runner.temp }}/react-native-macos.tgz + yarn add ${{ runner.temp }}/react-native-macos.tgz - name: Apply macOS template working-directory: ${{ runner.temp }}/testcli From 4a28bb73dda025a06fa118ce1f75ec6493839e2d Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 19:18:35 -0700 Subject: [PATCH 06/13] fix(0.81): run yarn pack from monorepo root where Berry is active The previous commit used yarn --cwd from the testcli directory, but that invokes the global yarn 1.x which refuses to run due to the packageManager field. Split into two steps: yarn pack runs from the monorepo checkout (where Yarn Berry is active), then npm install installs the tarball in the test project. Co-Authored-By: Claude Opus 4.6 --- ...microsoft-test-react-native-macos-init.yml | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index aaf4bb3d3699..b721c6cf0363 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -52,19 +52,24 @@ jobs: npx --yes @react-native-community/cli init testcli --version ${{ steps.rn-version.outputs.version }} working-directory: ${{ runner.temp }} + - name: Pack local react-native-macos + working-directory: packages/react-native + run: | + set -eox pipefail + # Pack the local package into a tarball. This runs the "prepack" + # script which generates the FBReactNativeSpec codegen headers + # (React/FBReactNativeSpec/) that are shipped in published releases. + yarn pack -o ${{ runner.temp }}/react-native-macos.tgz + - name: Install local react-native-macos working-directory: ${{ runner.temp }}/testcli run: | set -eox pipefail - # Pack the local package into a tarball first. This runs the - # "prepack" script which generates the FBReactNativeSpec codegen - # headers (React/FBReactNativeSpec/) that are shipped in published - # releases. Then install from the tarball so the test project - # matches a normal user's node_modules layout: no symlinks (which - # cause module instance duplication) and pre-generated codegen - # headers present (which the build relies on to skip regeneration). - yarn --cwd ${{ github.workspace }}/packages/react-native pack -o ${{ runner.temp }}/react-native-macos.tgz - yarn add ${{ runner.temp }}/react-native-macos.tgz + # Install from the tarball so the test project matches a normal + # user's node_modules layout: no symlinks (which cause module + # instance duplication) and pre-generated codegen headers present + # (which the build relies on to skip regeneration). + npm install ${{ runner.temp }}/react-native-macos.tgz - name: Apply macOS template working-directory: ${{ runner.temp }}/testcli From dcdd387880a02b7fb52d9460eb55d5be9e91d996 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 20:32:56 -0700 Subject: [PATCH 07/13] fix: use glob patterns in package.json files array for yarn pack npm pack treats directory entries in "files" as recursive globs, but yarn pack does not. Use explicit glob patterns (e.g. "scripts/cocoapods/**" instead of "scripts/cocoapods") so both tools include the full directory contents. This is the same fix as facebook/react-native#56407. Co-Authored-By: Claude Opus 4.6 --- packages/react-native/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/package.json b/packages/react-native/package.json index a6d621593015..ee0a1c4f9a8d 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -111,8 +111,8 @@ "rn-get-polyfills.js", "scripts/replace-rncore-version.js", "scripts/bundle.js", - "scripts/cocoapods", - "scripts/codegen", + "scripts/cocoapods/**", + "scripts/codegen/**", "scripts/compose-source-maps.js", "scripts/find-node-for-xcode.sh", "scripts/generate-codegen-artifacts.js", @@ -135,7 +135,7 @@ "scripts/xcode/ccache.conf", "scripts/xcode/with-environment.sh", "sdks/.hermesversion", - "sdks/hermes-engine", + "sdks/hermes-engine/**", "sdks/hermesc", "settings.gradle.kts", "src", From a93cebd9dea7413d5797fc5c18f88a08677ff005 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 20:56:33 -0700 Subject: [PATCH 08/13] fix(0.81): restore execute permissions on shell scripts after yarn pack yarn pack strips execute permissions from files. Add chmod +x after npm install to restore permissions on shell scripts that xcodebuild invokes (react-native-xcode.sh, with-environment.sh, etc.). Co-Authored-By: Claude Opus 4.6 --- .github/workflows/microsoft-test-react-native-macos-init.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index b721c6cf0363..bce3133ff0af 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -70,6 +70,8 @@ jobs: # instance duplication) and pre-generated codegen headers present # (which the build relies on to skip regeneration). npm install ${{ runner.temp }}/react-native-macos.tgz + # yarn pack strips execute permissions from shell scripts + chmod +x node_modules/react-native-macos/scripts/*.sh node_modules/react-native-macos/scripts/xcode/*.sh - name: Apply macOS template working-directory: ${{ runner.temp }}/testcli From 7b24a1e4b87440e1620e80ff650f70bb98c9cede Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 20:58:26 -0700 Subject: [PATCH 09/13] fix(0.81): use npm pack instead of yarn pack to preserve permissions npm pack preserves file permissions from the filesystem, while yarn pack (Berry) normalizes them and strips execute bits. This removes the need for the chmod workaround. Co-Authored-By: Claude Opus 4.6 --- .../workflows/microsoft-test-react-native-macos-init.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index bce3133ff0af..d4f64ef18dae 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -59,7 +59,9 @@ jobs: # Pack the local package into a tarball. This runs the "prepack" # script which generates the FBReactNativeSpec codegen headers # (React/FBReactNativeSpec/) that are shipped in published releases. - yarn pack -o ${{ runner.temp }}/react-native-macos.tgz + # Use npm pack (not yarn pack) to preserve file permissions — yarn + # pack strips execute bits from shell scripts. + npm pack --pack-destination ${{ runner.temp }} - name: Install local react-native-macos working-directory: ${{ runner.temp }}/testcli @@ -69,9 +71,7 @@ jobs: # user's node_modules layout: no symlinks (which cause module # instance duplication) and pre-generated codegen headers present # (which the build relies on to skip regeneration). - npm install ${{ runner.temp }}/react-native-macos.tgz - # yarn pack strips execute permissions from shell scripts - chmod +x node_modules/react-native-macos/scripts/*.sh node_modules/react-native-macos/scripts/xcode/*.sh + npm install ${{ runner.temp }}/react-native-macos-*.tgz - name: Apply macOS template working-directory: ${{ runner.temp }}/testcli From 152702e71c905f94dcc7ace36b3756eaf3c8491c Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 21:00:08 -0700 Subject: [PATCH 10/13] fix(0.81): use yarn pack + chmod instead of npm pack Switch back to yarn pack (consistent with publish pipeline) and restore execute permissions on shell scripts with chmod +x after install. Co-Authored-By: Claude Opus 4.6 --- .../workflows/microsoft-test-react-native-macos-init.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index d4f64ef18dae..bce3133ff0af 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -59,9 +59,7 @@ jobs: # Pack the local package into a tarball. This runs the "prepack" # script which generates the FBReactNativeSpec codegen headers # (React/FBReactNativeSpec/) that are shipped in published releases. - # Use npm pack (not yarn pack) to preserve file permissions — yarn - # pack strips execute bits from shell scripts. - npm pack --pack-destination ${{ runner.temp }} + yarn pack -o ${{ runner.temp }}/react-native-macos.tgz - name: Install local react-native-macos working-directory: ${{ runner.temp }}/testcli @@ -71,7 +69,9 @@ jobs: # user's node_modules layout: no symlinks (which cause module # instance duplication) and pre-generated codegen headers present # (which the build relies on to skip regeneration). - npm install ${{ runner.temp }}/react-native-macos-*.tgz + npm install ${{ runner.temp }}/react-native-macos.tgz + # yarn pack strips execute permissions from shell scripts + chmod +x node_modules/react-native-macos/scripts/*.sh node_modules/react-native-macos/scripts/xcode/*.sh - name: Apply macOS template working-directory: ${{ runner.temp }}/testcli From 651e18be46a5f4f5954858b2b6e8e82d26b20259 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 21:31:00 -0700 Subject: [PATCH 11/13] fix(0.81): chmod +x all .sh files recursively under scripts/ The previous glob only matched scripts/*.sh and scripts/xcode/*.sh but missed scripts/react_native_pods_utils/script_phases.sh. Use find to recursively chmod all .sh files. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/microsoft-test-react-native-macos-init.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index bce3133ff0af..f2f9749f3005 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -71,7 +71,7 @@ jobs: # (which the build relies on to skip regeneration). npm install ${{ runner.temp }}/react-native-macos.tgz # yarn pack strips execute permissions from shell scripts - chmod +x node_modules/react-native-macos/scripts/*.sh node_modules/react-native-macos/scripts/xcode/*.sh + find node_modules/react-native-macos/scripts -name '*.sh' -exec chmod +x {} + - name: Apply macOS template working-directory: ${{ runner.temp }}/testcli From 2294d61aa392dab206e5fa2be5e4d3a26ec16fdd Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 21:52:48 -0700 Subject: [PATCH 12/13] fix(0.81): simplify workflow comments Co-Authored-By: Claude Opus 4.6 --- .../microsoft-test-react-native-macos-init.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index f2f9749f3005..4e81027a205a 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -28,9 +28,7 @@ jobs: - name: Build community CLI plugin run: | yarn build - # yarn build rewrites package.json "exports" from ./src to ./dist - # for publishing. Restore the original exports so that any - # monorepo tooling that still runs from source continues to work. + # yarn build rewrites package.json exports; restore them git checkout -- packages/*/package.json - name: Build react-native-macos-init @@ -56,21 +54,15 @@ jobs: working-directory: packages/react-native run: | set -eox pipefail - # Pack the local package into a tarball. This runs the "prepack" - # script which generates the FBReactNativeSpec codegen headers - # (React/FBReactNativeSpec/) that are shipped in published releases. + # Use a tarball instead of a direct path to avoid symlinks yarn pack -o ${{ runner.temp }}/react-native-macos.tgz - name: Install local react-native-macos working-directory: ${{ runner.temp }}/testcli run: | set -eox pipefail - # Install from the tarball so the test project matches a normal - # user's node_modules layout: no symlinks (which cause module - # instance duplication) and pre-generated codegen headers present - # (which the build relies on to skip regeneration). npm install ${{ runner.temp }}/react-native-macos.tgz - # yarn pack strips execute permissions from shell scripts + # yarn pack strips execute bits from shell scripts find node_modules/react-native-macos/scripts -name '*.sh' -exec chmod +x {} + - name: Apply macOS template From dde96e488fd24b8f11ff20aca661fe20c9741444 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Apr 2026 22:37:22 -0700 Subject: [PATCH 13/13] fix(0.81): note publishConfig.executableFiles alternative in comment Co-Authored-By: Claude Opus 4.6 --- .github/workflows/microsoft-test-react-native-macos-init.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index 4e81027a205a..cf5543cb372a 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -62,7 +62,8 @@ jobs: run: | set -eox pipefail npm install ${{ runner.temp }}/react-native-macos.tgz - # yarn pack strips execute bits from shell scripts + # yarn pack strips execute bits from shell scripts. + # publishConfig.executableFiles could fix this but doesn't support globs. find node_modules/react-native-macos/scripts -name '*.sh' -exec chmod +x {} + - name: Apply macOS template