diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 311e216..f37b9f5 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -112,5 +112,10 @@ jobs: - name: Create Secrets.xcconfig run: echo MAPS_API_KEY="API_KEY" >> example/ios/Secrets.xcconfig + - name: Install iOS Simulator runtime + run: | + sudo xcodebuild -runFirstLaunch + sudo xcodebuild -downloadPlatform iOS + - name: Build example for iOS run: yarn build:ios diff --git a/README.md b/README.md index 7c67466..0dcf8f9 100644 --- a/README.md +++ b/README.md @@ -25,47 +25,14 @@ Add this to your Podfile only for bare React Native apps. ```ruby post_install do |installer| react_native_post_install( - installer, - config[:reactNativePath], - :mac_catalyst_enabled => false, - ) - # Force iOS 16+ to avoid deployment target warnings - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0' - end - end - - # --- SVGKit Patch --- - require 'fileutils' - svgkit_path = File.join(installer.sandbox.pod_dir('SVGKit'), 'Source') - - # node fix - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "Node.h"', '#import "SVGKit/Node.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - # puts "Patched Node import in: #{file}" - end - - # import CSSValue.h - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "CSSValue.h"', '#import "SVGKit/CSSValue.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - # puts "Patched CSSValue import in: #{file}" - end - - # import SVGLength.h - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "SVGLength.h"', '#import "SVGKit/SVGLength.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - # puts "Patched SVGLength import in: #{file}" - end + installer, + config[:reactNativePath], + :mac_catalyst_enabled => false, + # :ccache_enabled => true + ) + + require_relative '../node_modules/react-native-google-maps-plus/scripts/svgkit_patch' + apply_svgkit_patch(installer) end ``` diff --git a/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt b/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt index 6081c00..3114ba6 100644 --- a/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +++ b/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt @@ -345,7 +345,14 @@ class GoogleMapsViewImpl( var userInterfaceStyle: Int? = null set(value) { field = value - onUi { googleMap?.mapColorScheme = value ?: MapColorScheme.FOLLOW_SYSTEM } + onUi { + try { + // / not supported when liteMode enabled on latest renderer + googleMap?.mapColorScheme = value ?: MapColorScheme.FOLLOW_SYSTEM + } catch (_: UnsupportedOperationException) { + // / ignore + } + } } var mapZoomConfig: RNMapZoomConfig? = null diff --git a/example/ios/GoogleMapsPlusExample.xcodeproj/project.pbxproj b/example/ios/GoogleMapsPlusExample.xcodeproj/project.pbxproj index 64e6606..482ad22 100644 --- a/example/ios/GoogleMapsPlusExample.xcodeproj/project.pbxproj +++ b/example/ios/GoogleMapsPlusExample.xcodeproj/project.pbxproj @@ -12,26 +12,26 @@ 1C2CD62E2E2A54A300F92915 /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1C2CD62C2E2A54A300F92915 /* Release.xcconfig */; }; 1CFDC6AB2E6CA193005652FB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1CFDC6A32E6CA144005652FB /* InfoPlist.strings */; }; 1CFDC6AC2E6CA193005652FB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1CFDC6A62E6CA144005652FB /* InfoPlist.strings */; }; + 2B37C898F2A1AAA9486D9912 /* Pods_GoogleMapsPlusExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5EA1D48E107416ADB6C60F35 /* Pods_GoogleMapsPlusExample.framework */; }; 50142BCB3C4DD87E00709364 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - 89A7882DE3880107EB2CBBE5 /* Pods_GoogleMapsPlusExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F220CF45106F6693F3EE2E0 /* Pods_GoogleMapsPlusExample.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 0F220CF45106F6693F3EE2E0 /* Pods_GoogleMapsPlusExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GoogleMapsPlusExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07F961A680F5B00A75B9A /* GoogleMapsPlusExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GoogleMapsPlusExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = GoogleMapsPlusExample/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = GoogleMapsPlusExample/Info.plist; sourceTree = ""; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = GoogleMapsPlusExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 15FC9D1ABAC4D1322D65610A /* Pods-GoogleMapsPlusExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsPlusExample.debug.xcconfig"; path = "Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample.debug.xcconfig"; sourceTree = ""; }; 1C2CD62B2E2A54A300F92915 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = GoogleMapsPlusExample/Debug.xcconfig; sourceTree = ""; }; 1C2CD62C2E2A54A300F92915 /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = GoogleMapsPlusExample/Release.xcconfig; sourceTree = ""; }; 1CFDC6A32E6CA144005652FB /* InfoPlist.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = InfoPlist.strings; sourceTree = ""; }; 1CFDC6A62E6CA144005652FB /* InfoPlist.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = InfoPlist.strings; sourceTree = ""; }; + 5EA1D48E107416ADB6C60F35 /* Pods_GoogleMapsPlusExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GoogleMapsPlusExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = GoogleMapsPlusExample/AppDelegate.swift; sourceTree = ""; }; - 784D90989C3F0C69A83034D7 /* Pods-GoogleMapsPlusExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsPlusExample.debug.xcconfig"; path = "Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample.debug.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = GoogleMapsPlusExample/LaunchScreen.storyboard; sourceTree = ""; }; - CE69916FEF4DE92FC3CC2A4C /* Pods-GoogleMapsPlusExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsPlusExample.release.xcconfig"; path = "Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample.release.xcconfig"; sourceTree = ""; }; + 9B44C46EC9F8E58D8B6DDD10 /* Pods-GoogleMapsPlusExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsPlusExample.release.xcconfig"; path = "Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -40,7 +40,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 89A7882DE3880107EB2CBBE5 /* Pods_GoogleMapsPlusExample.framework in Frameworks */, + 2B37C898F2A1AAA9486D9912 /* Pods_GoogleMapsPlusExample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -85,7 +85,7 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 0F220CF45106F6693F3EE2E0 /* Pods_GoogleMapsPlusExample.framework */, + 5EA1D48E107416ADB6C60F35 /* Pods_GoogleMapsPlusExample.framework */, ); name = Frameworks; sourceTree = ""; @@ -122,8 +122,8 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 784D90989C3F0C69A83034D7 /* Pods-GoogleMapsPlusExample.debug.xcconfig */, - CE69916FEF4DE92FC3CC2A4C /* Pods-GoogleMapsPlusExample.release.xcconfig */, + 15FC9D1ABAC4D1322D65610A /* Pods-GoogleMapsPlusExample.debug.xcconfig */, + 9B44C46EC9F8E58D8B6DDD10 /* Pods-GoogleMapsPlusExample.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -135,13 +135,13 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "GoogleMapsPlusExample" */; buildPhases = ( - 4E15D3C08A668E0F5197AB1A /* [CP] Check Pods Manifest.lock */, + A824DF843ACA8BC144DEDA05 /* [CP] Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - A4CAAB1E58D131C3CE20A532 /* [CP] Embed Pods Frameworks */, - 5AC776E708BE569B105221C3 /* [CP] Copy Pods Resources */, + 357474998C3CCFA5FBC8D97B /* [CP] Embed Pods Frameworks */, + DBF885C9135E7CF4993E741D /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -218,7 +218,24 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 4E15D3C08A668E0F5197AB1A /* [CP] Check Pods Manifest.lock */ = { + 357474998C3CCFA5FBC8D97B /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + A824DF843ACA8BC144DEDA05 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -240,7 +257,7 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 5AC776E708BE569B105221C3 /* [CP] Copy Pods Resources */ = { + DBF885C9135E7CF4993E741D /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -257,23 +274,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - A4CAAB1E58D131C3CE20A532 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GoogleMapsPlusExample/Pods-GoogleMapsPlusExample-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/example/ios/GoogleMapsPlusExample/Info.plist b/example/ios/GoogleMapsPlusExample/Info.plist index f528e9c..efdafe4 100644 --- a/example/ios/GoogleMapsPlusExample/Info.plist +++ b/example/ios/GoogleMapsPlusExample/Info.plist @@ -36,7 +36,7 @@ NSLocationWhenInUseUsageDescription - + This app needs access to your location to show your current position on the map. RCTNewArchEnabled UILaunchStoryboardName diff --git a/example/ios/Podfile b/example/ios/Podfile index e535fec..c126450 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -28,41 +28,8 @@ target 'GoogleMapsPlusExample' do :mac_catalyst_enabled => false, # :ccache_enabled => true ) - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0' - end - end - # --- SVGKit Patch --- - require 'fileutils' - svgkit_path = File.join(installer.sandbox.pod_dir('SVGKit'), 'Source') - - # node fix - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "Node.h"', '#import "SVGKit/Node.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - # puts "Patched Node import in: #{file}" - end - - # import CSSValue.h - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "CSSValue.h"', '#import "SVGKit/CSSValue.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - # puts "Patched CSSValue import in: #{file}" - end - - # import SVGLength.h - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "SVGLength.h"', '#import "SVGKit/SVGLength.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - # puts "Patched SVGLength import in: #{file}" - end + require_relative '../../scripts/svgkit_patch' + apply_svgkit_patch(installer) end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 1db83e4..d7e88d9 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2504,7 +2504,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNGoogleMapsPlus (1.6.2): + - RNGoogleMapsPlus (1.8.6): - boost - DoubleConversion - fast_float @@ -3120,7 +3120,7 @@ SPEC CHECKSUMS: ReactCodegen: 0bce2d209e2e802589f4c5ff76d21618200e74cb ReactCommon: 801eff8cb9c940c04d3a89ce399c343ee3eff654 RNGestureHandler: 67501c6d447027581aa1d8e5a7a3ea5a7f0a89ff - RNGoogleMapsPlus: 2e51359c4ec90a88a315950cfd8d055c1615d7df + RNGoogleMapsPlus: d94844f2d397099f2153d5f9a29e96f70f547bde RNReanimated: 8f0185df21f0dea34ee8c9611ba88c17a290ed9a RNScreens: 98771ad898d1c0528fc8139606bbacf5a2e9d237 RNWorklets: ab618bf7d1c7fd2cb793b9f0f39c3e29274b3ebf @@ -3128,6 +3128,6 @@ SPEC CHECKSUMS: SVGKit: 1ad7513f8c74d9652f94ed64ddecda1a23864dea Yoga: 526f25666395d30c297d53154398ffd249eaf9e1 -PODFILE CHECKSUM: 18d25340bc263a2eab86e2d8e5cfd9ad55ef6458 +PODFILE CHECKSUM: 53fea21acf44c419ecb277b368cb4c1e34124dfb COCOAPODS: 1.15.2 diff --git a/example/package.json b/example/package.json index 243fd1e..933e994 100644 --- a/example/package.json +++ b/example/package.json @@ -8,7 +8,7 @@ "start": "watchman watch-del-all && react-native start", "ios:pods": "rm -f ios/Podfile.lock && rm -rf ios/Pods && cd ios && bundle install && bundle exec pod install --repo-update", "build:android": "react-native build-android", - "build:ios": "react-native build-ios --mode Debug --extra-params 'CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=\"\" EXPANDED_CODE_SIGN_IDENTITY=\"\" DEVELOPMENT_TEAM=\"\" COCOAPODS_PARALLEL_CODE_SIGN=false'" + "build:ios": "react-native build-ios --mode Debug --extra-params 'CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO'" }, "dependencies": { "@react-navigation/native": "7.1.19", diff --git a/expoConfig/src/ios/withIosGoogleMapsPlus.ts b/expoConfig/src/ios/withIosGoogleMapsPlus.ts index 0fb169e..3d1f4ec 100644 --- a/expoConfig/src/ios/withIosGoogleMapsPlus.ts +++ b/expoConfig/src/ios/withIosGoogleMapsPlus.ts @@ -39,41 +39,9 @@ const withIosGoogleMapsPlus: ConfigPlugin = ( }).contents; } - const patchSnippet = ` - # Force iOS 16+ to avoid deployment target warnings - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0' - end - end - - # --- SVGKit Patch --- - require 'fileutils' - svgkit_path = File.join(installer.sandbox.pod_dir('SVGKit'), 'Source') - - # --- Patch Node.h imports --- - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "Node.h"', '#import "SVGKit/Node.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - end - - # --- Patch CSSValue.h imports --- - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "CSSValue.h"', '#import "SVGKit/CSSValue.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - end - - # --- Patch SVGLength.h imports --- - Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file| - FileUtils.chmod("u+w", file) - text = File.read(file) - new_contents = text.gsub('#import "SVGLength.h"', '#import "SVGKit/SVGLength.h"') - File.open(file, 'w') { |f| f.write(new_contents) } - end + const podFilePatch = ` + require_relative '../node_modules/react-native-google-maps-plus/scripts/svgkit_patch' + apply_svgkit_patch(installer) `; if (src.includes('post_install do |installer|')) { @@ -81,11 +49,11 @@ const withIosGoogleMapsPlus: ConfigPlugin = ( /post_install do \|installer\|([\s\S]*?)end/, (match, inner) => { if (inner.includes('SVGKit Patch')) return match; // idempotent - return `post_install do |installer|${inner}\n${patchSnippet}\nend`; + return `post_install do |installer|${inner}\n${podFilePatch}\nend`; } ); } else { - src += `\npost_install do |installer|\n${patchSnippet}\nend\n`; + src += `\npost_install do |installer|\n${podFilePatch}\nend\n`; } conf.modResults.contents = src; diff --git a/package.json b/package.json index b882365..84b6bcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-google-maps-plus", - "version": "1.6.2", + "version": "1.8.6", "description": "React Native wrapper for Android & iOS Google Maps SDK", "main": "./lib/module/index.js", "module": "./lib/module/index.js", @@ -63,6 +63,7 @@ "ios/**/*.swift", "app.plugin.js", "*.podspec", + "scripts", "README.md" ], "workspaces": [ @@ -88,6 +89,7 @@ "@react-native/babel-preset": "0.82.1", "@react-native/eslint-config": "0.82.1", "@semantic-release/changelog": "6.0.3", + "@semantic-release/exec": "7.1.0", "@semantic-release/git": "10.0.1", "@semantic-release/npm": "13.1.1", "@types/jest": "30.0.0", @@ -101,12 +103,12 @@ "eslint-plugin-prettier": "5.5.4", "jest": "30.2.0", "lefthook": "2.0.2", - "nitrogen": "0.31.4", + "nitrogen": "0.31.5", "prettier": "3.6.2", "react": "19.1.1", "react-native": "0.82.1", "react-native-builder-bob": "0.40.14", - "react-native-nitro-modules": "0.31.4", + "react-native-nitro-modules": "0.31.5", "semantic-release": "25.0.1", "typescript": "5.9.3" }, diff --git a/release.config.cjs b/release.config.cjs index 14e6e3a..cfeeab1 100644 --- a/release.config.cjs +++ b/release.config.cjs @@ -21,6 +21,22 @@ const gitPlugin = isDev }, ]; +const execPlugin = isDev + ? false + : [ + '@semantic-release/exec', + { + successCmd: ` + VERSION=\${nextRelease.version} + IFS='.' read -r major minor patch <<<"$VERSION" + NEXT_MINOR=$((minor + 1)) + DEV_TAG="v\${major}.\${NEXT_MINOR}.0-dev.0" + git tag "$DEV_TAG" + git push origin "$DEV_TAG" + `, + }, + ]; + const sortMap = Object.fromEntries( rules.map((rule, index) => [rule.title, index]) ); @@ -82,5 +98,6 @@ module.exports = { }, ], ...(gitPlugin ? [gitPlugin] : []), + ...(execPlugin ? [execPlugin] : []), ], }; diff --git a/scripts/svgkit_patch.rb b/scripts/svgkit_patch.rb new file mode 100644 index 0000000..67a6377 --- /dev/null +++ b/scripts/svgkit_patch.rb @@ -0,0 +1,41 @@ +def apply_svgkit_patch(installer) + svgkit_path = File.join(installer.sandbox.root, "SVGKit", "Source") + return unless Dir.exist?(svgkit_path) + + package = JSON.parse(File.read(File.join(__dir__, "..", "package.json"))) + package_name = package["name"] + + puts "[#{package_name}] Applying SVGKit patch..." + + files = Dir.glob(File.join(svgkit_path, "**/*.{h,m}")) + + replacements = { + '#import "Node.h"' => '#import "SVGKit/Node.h"', + '#import "CSSValue.h"' => '#import "SVGKit/CSSValue.h"', + '#import "SVGLength.h"' => '#import "SVGKit/SVGLength.h"' + } + + count = 0 + + files.each do |file| + text = File.read(file) + new_text = text.dup + + replacements.each do |original, patched| + new_text.gsub!(original, patched) + end + + next if new_text == text + + File.write(file, new_text) + count += 1 + end + + if count > 0 + puts "[#{package_name}] SVGKit patch applied (#{count} files modified)" + else + puts "[#{package_name}] SVGKit was already patched or no matches" + end + + +end diff --git a/yarn.lock b/yarn.lock index 2154515..3cee9ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3554,6 +3554,22 @@ __metadata: languageName: node linkType: hard +"@semantic-release/exec@npm:7.1.0": + version: 7.1.0 + resolution: "@semantic-release/exec@npm:7.1.0" + dependencies: + "@semantic-release/error": ^4.0.0 + aggregate-error: ^3.0.0 + debug: ^4.0.0 + execa: ^9.0.0 + lodash-es: ^4.17.21 + parse-json: ^8.0.0 + peerDependencies: + semantic-release: ">=24.1.0" + checksum: 26b7dc072a39406ac6d08177206f1f4c3bf92bbc77685a9dc4589a04b1379794692aadc22828adc4230e056f2068ffc46f0f8726e2638e015db219bf40a965a3 + languageName: node + linkType: hard + "@semantic-release/git@npm:10.0.1": version: 10.0.1 resolution: "@semantic-release/git@npm:10.0.1" @@ -3573,8 +3589,8 @@ __metadata: linkType: hard "@semantic-release/github@npm:^12.0.0": - version: 12.0.1 - resolution: "@semantic-release/github@npm:12.0.1" + version: 12.0.2 + resolution: "@semantic-release/github@npm:12.0.2" dependencies: "@octokit/core": ^7.0.0 "@octokit/plugin-paginate-rest": ^14.0.0 @@ -3591,10 +3607,11 @@ __metadata: mime: ^4.0.0 p-filter: ^4.0.0 tinyglobby: ^0.2.14 + undici: ^7.0.0 url-join: ^5.0.0 peerDependencies: semantic-release: ">=24.1.0" - checksum: 01675a05e2fb32e30d07ac29e40d64107c53ef9d5469dda782523c0abe6349b2464483d9304adbfc266eff72ae7f44aeac43e6e1c346f8ccca29b7837bbbad39 + checksum: f4f18a5eed7f01f441bd29cb171aac2d93d8d4d8c5941bf486df1a2d28f0aa9ccbd4d13984405b1dcc245580615176518e05a3fccca201a6f77c6930d57c6eaa languageName: node linkType: hard @@ -4914,11 +4931,11 @@ __metadata: linkType: hard "baseline-browser-mapping@npm:^2.8.19": - version: 2.8.24 - resolution: "baseline-browser-mapping@npm:2.8.24" + version: 2.8.25 + resolution: "baseline-browser-mapping@npm:2.8.25" bin: baseline-browser-mapping: dist/cli.js - checksum: 426df57ec914b3934e8d5ee294e84a8dfc0430acfda075cc2f6e321018ed9f8ebc4d416457c434da41c15d36ab2077fadad32f8b92a3266f1d59daa4278e8874 + checksum: d11bdd2cce30ad96d65f6fdf92cf485152beaf7b1dfc81ad028a94022d702b439dee942984f62c2328c0b6ff468629eb42c2e62ad0ab7d8586b33837b738e560 languageName: node linkType: hard @@ -5181,9 +5198,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001751": - version: 1.0.30001753 - resolution: "caniuse-lite@npm:1.0.30001753" - checksum: d38b17895a99bf1ba9f1a8076233e3d4a606cd0121ccdb381ea94c651aaea0e1587ba3922b11dde4eb153b6741ac3e129fc670df0a7251987ed8619f09059b8a + version: 1.0.30001754 + resolution: "caniuse-lite@npm:1.0.30001754" + checksum: f5a956d820c6a4de16d0c22eb6bbbbaec346f502f324523311bbbfe4dd8ed0d69ae6034dd96a2f901156f3e4571606670be01f74c8234ac56ea7820383b6aca0 languageName: node linkType: hard @@ -5288,9 +5305,9 @@ __metadata: linkType: hard "cjs-module-lexer@npm:^2.1.0": - version: 2.1.0 - resolution: "cjs-module-lexer@npm:2.1.0" - checksum: beeece5cfc4fd77f5c41c30c3942f6219be5bf9f323148a5e52a87414bf35017e2a0aec5d8e25e694af26f05ff833515ccae6dbe1316e4cd44b4c38f11ba949e + version: 2.1.1 + resolution: "cjs-module-lexer@npm:2.1.1" + checksum: d87f106cfe40b751060fc7e4a59c5aa893054ea14377c33aab1b09c9c2b353106ac44519f2911eeafceef08da9e4b87185a92a1f7d15992c1e7fa73a0bab8e55 languageName: node linkType: hard @@ -6084,9 +6101,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.5.238": - version: 1.5.245 - resolution: "electron-to-chromium@npm:1.5.245" - checksum: 6262655d0dec8663df58056559a8f1f47648657debf0c868e49d8e3b5f866318c4a9105261272a5aaa529fc6140f4401e0e2c5fadbd24ed50cf9b5cd7e961bfc + version: 1.5.249 + resolution: "electron-to-chromium@npm:1.5.249" + checksum: 495a8bf12a3c7bad017f0082b9581ae3a0b6cbe860cc8b89f749aa0ff9f22fd95af765b8e891507c101f5a6d56c404a4e94c4cafd9db0a2784f769fdf0184037 languageName: node linkType: hard @@ -7971,9 +7988,9 @@ __metadata: linkType: hard "ip-address@npm:^10.0.1": - version: 10.0.1 - resolution: "ip-address@npm:10.0.1" - checksum: 525d5391cfd31a91f80f5857e98487aeaa8474e860a6725a0b6461ac8e436c7f8c869774dece391c8f8e7486306a34a4d1c094778c4c583a3f1f2cd905e5ed50 + version: 10.1.0 + resolution: "ip-address@npm:10.1.0" + checksum: 76b1abcdf52a32e2e05ca1f202f3a8ab8547e5651a9233781b330271bd7f1a741067748d71c4cbb9d9906d9f1fa69e7ddc8b4a11130db4534fdab0e908c84e0d languageName: node linkType: hard @@ -10541,18 +10558,18 @@ __metadata: languageName: node linkType: hard -"nitrogen@npm:0.31.4": - version: 0.31.4 - resolution: "nitrogen@npm:0.31.4" +"nitrogen@npm:0.31.5": + version: 0.31.5 + resolution: "nitrogen@npm:0.31.5" dependencies: chalk: ^5.3.0 - react-native-nitro-modules: ^0.31.4 + react-native-nitro-modules: ^0.31.5 ts-morph: ^27.0.0 yargs: ^18.0.0 zod: ^4.0.5 bin: nitrogen: lib/index.js - checksum: 566abe01767d03860834b7b95093f1de5d7d7e010a556508e727afafc7476765d146452047adeee3aeaa5b0d361c504762695d8d3d6386e77f0091ff53e00d9c + checksum: defb6948f1f5727ae4e6412870226fb52a2b6ebe96fe5501a4093c5c513d55c465ae20f066c914d8540125818d55ab03b156b4e085213667724425b730c11ab3 languageName: node linkType: hard @@ -11417,12 +11434,12 @@ __metadata: linkType: hard "path-scurry@npm:^2.0.0": - version: 2.0.0 - resolution: "path-scurry@npm:2.0.0" + version: 2.0.1 + resolution: "path-scurry@npm:2.0.1" dependencies: lru-cache: ^11.0.0 minipass: ^7.1.2 - checksum: 9953ce3857f7e0796b187a7066eede63864b7e1dfc14bf0484249801a5ab9afb90d9a58fc533ebb1b552d23767df8aa6a2c6c62caf3f8a65f6ce336a97bbb484 + checksum: a022c6c38fed836079d03f96540eafd4cd989acf287b99613c82300107f366e889513ad8b671a2039a9d251122621f9c6fa649f0bd4d50acf95a6943a6692dbf languageName: node linkType: hard @@ -11942,6 +11959,7 @@ __metadata: "@react-native/babel-preset": 0.82.1 "@react-native/eslint-config": 0.82.1 "@semantic-release/changelog": 6.0.3 + "@semantic-release/exec": 7.1.0 "@semantic-release/git": 10.0.1 "@semantic-release/npm": 13.1.1 "@types/jest": 30.0.0 @@ -11955,12 +11973,12 @@ __metadata: eslint-plugin-prettier: 5.5.4 jest: 30.2.0 lefthook: 2.0.2 - nitrogen: 0.31.4 + nitrogen: 0.31.5 prettier: 3.6.2 react: 19.1.1 react-native: 0.82.1 react-native-builder-bob: 0.40.14 - react-native-nitro-modules: 0.31.4 + react-native-nitro-modules: 0.31.5 semantic-release: 25.0.1 typescript: 5.9.3 peerDependencies: @@ -12014,13 +12032,13 @@ __metadata: languageName: node linkType: hard -"react-native-nitro-modules@npm:0.31.4, react-native-nitro-modules@npm:^0.31.4": - version: 0.31.4 - resolution: "react-native-nitro-modules@npm:0.31.4" +"react-native-nitro-modules@npm:0.31.5, react-native-nitro-modules@npm:^0.31.5": + version: 0.31.5 + resolution: "react-native-nitro-modules@npm:0.31.5" peerDependencies: react: "*" react-native: "*" - checksum: 9d251ec788eafb5c66033a1f376e2a8f9dfc8962a22e8511f6451bc50bf324549fd4e5113ee5bed59a993c0afc3288e8722d854239a33c00faae26848a211fde + checksum: 957c1c264d5a7bb791ca7aa0c97b577c0ba60bb5765f4bf6fdf64a6f414d33702d94909823b33a4fc1b01f3d51175669c779212e645c21ccd204197ea66ed701 languageName: node linkType: hard @@ -13433,8 +13451,8 @@ __metadata: linkType: hard "terser@npm:^5.15.0": - version: 5.44.0 - resolution: "terser@npm:5.44.0" + version: 5.44.1 + resolution: "terser@npm:5.44.1" dependencies: "@jridgewell/source-map": ^0.3.3 acorn: ^8.15.0 @@ -13442,7 +13460,7 @@ __metadata: source-map-support: ~0.5.20 bin: terser: bin/terser - checksum: 4e1868d9662ea280dad7b49cfe61b7693187be2b529b31b1f86782db00833c03ba05f2b82fc513d928e937260f2a5fbf42a93724e86eaf55f069288f934ccdb3 + checksum: 1113c5711bb53127f9886e3c906fde8a93a665b532db9c7e36ff7bf287e032ed48ea0e5a3a1a27f6a27c3c0f934e47e7590fcd15c76b7b7bd44ad751b8a9ede4 languageName: node linkType: hard @@ -13805,6 +13823,13 @@ __metadata: languageName: node linkType: hard +"undici@npm:^7.0.0": + version: 7.16.0 + resolution: "undici@npm:7.16.0" + checksum: dca60e323e44c2d408e0d1f5eb540632ad4e75631d5b6fcd7791876bab54e0e263a66e5606eaa717d436b2db5988c2f4af912dfa221ce53e3fc7fcb7d224c9cd + languageName: node + linkType: hard + "unicode-canonical-property-names-ecmascript@npm:^2.0.0": version: 2.0.1 resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.1"