From c9feef27e875b2a0ec75647af2c28b3050ec3dd9 Mon Sep 17 00:00:00 2001 From: mvrty <57954078+mvrty@users.noreply.github.com> Date: Wed, 3 Jun 2026 20:08:25 +0200 Subject: [PATCH] fix(ios): namespace podspec Ruby helpers to avoid reanimated collision Top-level find_config in cocoapods_utils.rb shadows react-native-reanimated's identically named helper during pod install, leaving REACT_NATIVE_MINOR_VERSION empty in the generated xcconfig. Co-authored-by: Cursor --- FastSquircle.podspec | 2 +- scripts/cocoapods_utils.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FastSquircle.podspec b/FastSquircle.podspec index fa937f9..24c96ac 100644 --- a/FastSquircle.podspec +++ b/FastSquircle.podspec @@ -3,7 +3,7 @@ require_relative './scripts/cocoapods_utils' package = JSON.parse(File.read(File.join(__dir__, "package.json"))) -$config = find_config() +$config = fast_squircle_find_config() version_flags = "-DREACT_NATIVE_MINOR_VERSION=#{$config[:react_native_minor_version]}" Pod::Spec.new do |s| diff --git a/scripts/cocoapods_utils.rb b/scripts/cocoapods_utils.rb index 16b6a73..f0f1d10 100644 --- a/scripts/cocoapods_utils.rb +++ b/scripts/cocoapods_utils.rb @@ -1,4 +1,4 @@ -def try_to_parse_react_native_package_json(node_modules_dir) +def fast_squircle_try_to_parse_react_native_package_json(node_modules_dir) react_native_package_json_path = File.join(node_modules_dir, 'react-native/package.json') if !File.exist?(react_native_package_json_path) return nil @@ -6,19 +6,19 @@ def try_to_parse_react_native_package_json(node_modules_dir) return JSON.parse(File.read(react_native_package_json_path)) end -def find_config() +def fast_squircle_find_config() result = { :react_native_version => nil, :react_native_minor_version => nil, } react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..') - react_native_json = try_to_parse_react_native_package_json(react_native_node_modules_dir) + react_native_json = fast_squircle_try_to_parse_react_native_package_json(react_native_node_modules_dir) if react_native_json == nil # user configuration, just in case node_modules_dir = ENV["REACT_NATIVE_NODE_MODULES_DIR"] - react_native_json = try_to_parse_react_native_package_json(node_modules_dir) + react_native_json = fast_squircle_try_to_parse_react_native_package_json(node_modules_dir) end if react_native_json == nil