From 29e25804905ef1d28994b0ff8214487bb6406e29 Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Thu, 19 Nov 2026 22:19:27 +0400 Subject: [PATCH 1/2] fix(sync): the React Native package's native module reaches the mirror under the target's names Its Kotlin, Gradle, Android XML, Swift, Objective-C and podspec files get the replacements of the mirrored native SDKs it builds against, the Kotlin package codegen takes from package.json follows the Kotlin sources, and paths that carry the brand are renamed: CocoaPods, codegen and Kotlin find those files by name. The validation also fails on a path left unconverted. --- .../workflows/reusable-rn-synchronization.yml | 78 ++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-rn-synchronization.yml b/.github/workflows/reusable-rn-synchronization.yml index 5d106f4c..743eecee 100644 --- a/.github/workflows/reusable-rn-synchronization.yml +++ b/.github/workflows/reusable-rn-synchronization.yml @@ -94,6 +94,8 @@ jobs: --exclude '.github' \ --exclude 'README.md' \ + # codegenConfig names the Kotlin package of the native module: it gets + # the lowercase rule of the Android sources below. - name: Apply changes to package.json if: env.path_changes != '0' working-directory: repo2 @@ -102,7 +104,8 @@ jobs: -e 's|rees46/react-native|personaclick/rn|g' \ -e 's|Rees46/react-native|PersonaClick/rn|g' \ -e 's/REES46/PersonaClick/g' \ - -e 's/Rees46/PersonaClick/g' {} + + -e 's/Rees46/PersonaClick/g' \ + -e 's/rees46/personaclick/g' {} + - name: Apply changes to JavaScript and TypeScript files if: env.path_changes != '0' @@ -150,6 +153,74 @@ jobs: -e 's/Rees46/PersonaClick/g' \ -e 's/rees46/personaclick/g' {} + + # The native module builds against the mirrored native SDKs, so its + # sources get the rules each of those mirrors is made with. They differ + # in lowercase: the Android mirror keeps it all lowercase (its JitPack + # coordinates, the module's Kotlin package), the iOS one camel case. + - name: Apply changes to Android sources + if: env.path_changes != '0' + working-directory: repo2 + run: | + find . -type f \( \ + -name '*.kt' -o \ + -name '*.kts' -o \ + -name '*.java' -o \ + -name '*.gradle' -o \ + -name '*.properties' -o \ + -name '*.xml' -o \ + -name '*.pro' \ + \) -exec sed -i \ + -e 's|https://api.rees46.ru/|https://api.personaclick.com/|g' \ + -e 's/REES46/PersonaClick/g' \ + -e 's/Rees46/PersonaClick/g' \ + -e 's/rees46/personaclick/g' {} + + + # The iOS mirror's module and facade type get the same name, so a type + # reached through the module's name (Module.Type) does not compile + # there: the sources reach it through the facade type or unqualified. + # The podspec points at the target and names the package as + # package.json does. + - name: Apply changes to iOS sources + if: env.path_changes != '0' + working-directory: repo2 + env: + TARGET_REPOSITORY: ${{ inputs.targetRepository }} + run: | + find . -type f \( \ + -name '*.swift' -o \ + -name '*.h' -o \ + -name '*.m' -o \ + -name '*.mm' -o \ + -name '*.podspec' \ + \) -exec sed -i \ + -e "s|/$GITHUB_REPOSITORY|/$TARGET_REPOSITORY|g" \ + -e 's|rees46/react-native|personaclick/rn|g' \ + -e 's|https://api.rees46.ru/|https://api.personaclick.com/|g' \ + -e 's/REES46/PersonaClick/g' \ + -e 's/Rees46/PersonaClick/g' \ + -e 's/rees46/personaClick/g' {} + + + # Names follow the contents: CocoaPods finds a pod by the podspec named + # after it, codegen names the module's spec after its file, and Kotlin + # sources sit in their package's directories. File by file, so a + # directory the target already has takes them in. + - name: Rename paths + if: env.path_changes != '0' + working-directory: repo2 + run: | + find . -path ./.git -prune -o -type f \( \ + -path '*REES46*' -o \ + -path '*Rees46*' -o \ + -path '*rees46*' \ + \) -print | while IFS= read -r source; do + target="$(printf '%s' "$source" | sed \ + -e 's/REES46/PersonaClick/g' \ + -e 's/Rees46/PersonaClick/g' \ + -e 's/rees46/personaclick/g')" + mkdir -p "$(dirname "$target")" + mv -f "$source" "$target" + done + # The source keeps one lockfile for the whole monorepo, the target has # its own. Without this a new dependency leaves the target's lockfile # behind and its `yarn install --immutable` check fails. The yarn the @@ -173,6 +244,11 @@ jobs: echo "Found unconverted REES46 references in synced repository" exit 1 fi + if find . -path ./.git -prune -o -type f -print | + grep -E 'REES46|Rees46|rees46'; then + echo "Found unconverted names among synced paths" + exit 1 + fi - name: Set branch name if: env.path_changes != '0' From 194ae467bd46bb3aba26691e90b0c3cf95d963cd Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Fri, 20 Nov 2026 10:27:42 +0400 Subject: [PATCH 2/2] fix(sync): the React Native mirror loses the files the source dropped and its podspec names the target's release tag The sync deletes what the source no longer has and keeps the target's own files, its CI, readme, ignore file and yarn setup, as the other mirrors' syncs keep their ignored paths. The podspec's source tag takes the target's form: the version after a v. --- .../workflows/reusable-rn-synchronization.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reusable-rn-synchronization.yml b/.github/workflows/reusable-rn-synchronization.yml index 743eecee..e1c61beb 100644 --- a/.github/workflows/reusable-rn-synchronization.yml +++ b/.github/workflows/reusable-rn-synchronization.yml @@ -85,14 +85,21 @@ jobs: token: ${{ steps.appToken.outputs.token }} path: repo2 + # --delete drops what the source no longer has. The excluded paths are + # the target's own (its CI, readme, ignore file and yarn setup): they + # are neither copied nor deleted. - name: Sync files to remote repository if changes if: env.path_changes != '0' run: | - rsync -av --progress \ + rsync -av --progress --delete \ ${{ inputs.changeLookUpPath }}/ repo2/ \ --exclude '.git' \ --exclude '.github' \ --exclude 'README.md' \ + --exclude '/.gitignore' \ + --exclude '/.yarn' \ + --exclude '/.yarnrc.yml' \ + --exclude '/yarn.lock' \ # codegenConfig names the Kotlin package of the native module: it gets # the lowercase rule of the Android sources below. @@ -178,8 +185,8 @@ jobs: # The iOS mirror's module and facade type get the same name, so a type # reached through the module's name (Module.Type) does not compile # there: the sources reach it through the facade type or unqualified. - # The podspec points at the target and names the package as - # package.json does. + # The podspec points at the target and at its release tag, which is the + # version after a v there. - name: Apply changes to iOS sources if: env.path_changes != '0' working-directory: repo2 @@ -194,7 +201,7 @@ jobs: -name '*.podspec' \ \) -exec sed -i \ -e "s|/$GITHUB_REPOSITORY|/$TARGET_REPOSITORY|g" \ - -e 's|rees46/react-native|personaclick/rn|g' \ + -e 's|@rees46/react-native-sdk@|v|g' \ -e 's|https://api.rees46.ru/|https://api.personaclick.com/|g' \ -e 's/REES46/PersonaClick/g' \ -e 's/Rees46/PersonaClick/g' \ @@ -203,7 +210,7 @@ jobs: # Names follow the contents: CocoaPods finds a pod by the podspec named # after it, codegen names the module's spec after its file, and Kotlin # sources sit in their package's directories. File by file, so a - # directory the target already has takes them in. + # renamed directory merges into one of the same name. - name: Rename paths if: env.path_changes != '0' working-directory: repo2