diff --git a/.github/workflows/microsoft-test-react-native-macos-init.yml b/.github/workflows/microsoft-test-react-native-macos-init.yml index d16c97c42ffc..cf5543cb372a 100644 --- a/.github/workflows/microsoft-test-react-native-macos-init.yml +++ b/.github/workflows/microsoft-test-react-native-macos-init.yml @@ -26,7 +26,10 @@ jobs: run: yarn install - name: Build community CLI plugin - run: yarn build + run: | + yarn build + # yarn build rewrites package.json exports; restore them + git checkout -- packages/*/package.json - name: Build react-native-macos-init working-directory: packages/react-native-macos-init @@ -47,11 +50,21 @@ 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 + # 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 - npm install ${{ github.workspace }}/packages/react-native + npm install ${{ runner.temp }}/react-native-macos.tgz + # 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 working-directory: ${{ runner.temp }}/testcli 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", 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) {