expo-modules-autolinking 56.0.4 → 56.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 56.0.5 — 2026-05-13
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
[iOS] Added fallback to source for missing framework slice. ([#45664](https://github.com/expo/expo/pull/45664) by [@chrfalch](https://github.com/chrfalch))
|
|
18
|
+
|
|
13
19
|
## 56.0.4 — 2026-05-11
|
|
14
20
|
|
|
15
21
|
_This version does not introduce any user-facing changes._
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-modules-autolinking",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.5",
|
|
4
4
|
"description": "Scripts that autolink Expo modules.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"chalk": "^4.1.0",
|
|
50
50
|
"commander": "^7.2.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "40f0a6f6711d93762e0506b37e6e077e4bd9a541",
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "expo-module build",
|
|
55
55
|
"clean": "expo-module clean",
|
|
@@ -22,16 +22,18 @@ module Expo
|
|
|
22
22
|
|
|
23
23
|
validate_target_definition()
|
|
24
24
|
|
|
25
|
-
# Clear stale CocoaPods download cache for precompiled pods.
|
|
26
|
-
Expo::PrecompiledModules.clear_cocoapods_cache
|
|
27
|
-
|
|
28
25
|
resolve_result = resolve()
|
|
29
26
|
|
|
30
27
|
Expo::PackagesConfig.instance.coreFeatures = resolve_result['coreFeatures']
|
|
31
28
|
|
|
32
|
-
# Pass buildFromSource configuration to PrecompiledModules
|
|
33
29
|
configuration = resolve_result['configuration'] || {}
|
|
34
|
-
Expo::PrecompiledModules.
|
|
30
|
+
Expo::PrecompiledModules.configure(
|
|
31
|
+
target_platform: @target_definition.platform,
|
|
32
|
+
build_from_source: configuration['buildFromSource'] || []
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# Clear stale CocoaPods download cache for precompiled pods.
|
|
36
|
+
Expo::PrecompiledModules.clear_cocoapods_cache
|
|
35
37
|
|
|
36
38
|
@packages = resolve_result['modules'].map { |json_package| Package.new(json_package) }
|
|
37
39
|
@extraPods = resolve_result['extraDependencies']
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
require 'fileutils'
|
|
30
30
|
require 'json'
|
|
31
31
|
require 'net/http'
|
|
32
|
+
require 'open3'
|
|
32
33
|
require 'set'
|
|
34
|
+
require 'tempfile'
|
|
33
35
|
require 'uri'
|
|
34
36
|
|
|
35
37
|
module Expo
|
|
@@ -76,6 +78,8 @@ module Expo
|
|
|
76
78
|
@framework_owner_map = nil # Hash: framework_name -> owning_pod_name
|
|
77
79
|
@failed_remote_downloads = Set.new
|
|
78
80
|
@warned_no_prebuilt_react = false
|
|
81
|
+
@target_platform = nil
|
|
82
|
+
@xcframework_slice_cache = nil
|
|
79
83
|
|
|
80
84
|
class << self
|
|
81
85
|
# Returns the build flavor (debug/release) for precompiled modules.
|
|
@@ -113,13 +117,26 @@ module Expo
|
|
|
113
117
|
false
|
|
114
118
|
end
|
|
115
119
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
def configure(target_platform: nil, build_from_source: nil)
|
|
121
|
+
self.target_platform = target_platform unless target_platform.nil?
|
|
122
|
+
self.build_from_source = build_from_source unless build_from_source.nil?
|
|
123
|
+
end
|
|
124
|
+
|
|
119
125
|
def build_from_source=(patterns)
|
|
120
126
|
@build_from_source_patterns = (patterns || []).map { |p| Regexp.new("^#{p}$") }
|
|
121
127
|
end
|
|
122
128
|
|
|
129
|
+
def target_platform=(platform)
|
|
130
|
+
normalized = normalize_xcframework_platform(platform)
|
|
131
|
+
return if @target_platform == normalized
|
|
132
|
+
|
|
133
|
+
@target_platform = normalized
|
|
134
|
+
@all_bundled_frameworks = nil
|
|
135
|
+
@claimed_vendored_frameworks = nil
|
|
136
|
+
@framework_owner_map = nil
|
|
137
|
+
@xcframework_slice_cache = nil
|
|
138
|
+
end
|
|
139
|
+
|
|
123
140
|
# Checks if a pod is configured to be built from source via buildFromSource.
|
|
124
141
|
# Matches against both the pod name and the npm package name.
|
|
125
142
|
def build_from_source?(pod_name)
|
|
@@ -1785,6 +1802,7 @@ module Expo
|
|
|
1785
1802
|
product_name = pod_info[:product_name] || pod_name
|
|
1786
1803
|
tarball = resolve_prebuilt_tarball(pod_info, product_name, build_flavor, pod_name)
|
|
1787
1804
|
return { available: false, reason: :missing_tarball, path: tarball } unless File.exist?(tarball)
|
|
1805
|
+
return { available: false, reason: :missing_platform_slice, path: tarball } unless xcframework_supports_target_platform?(tarball)
|
|
1788
1806
|
|
|
1789
1807
|
{ available: true, resolved: [pod_info, product_name, tarball] }
|
|
1790
1808
|
end
|
|
@@ -1842,6 +1860,74 @@ module Expo
|
|
|
1842
1860
|
remote_tarball
|
|
1843
1861
|
end
|
|
1844
1862
|
|
|
1863
|
+
def normalize_xcframework_platform(platform)
|
|
1864
|
+
name = platform.respond_to?(:name) ? platform.name : platform
|
|
1865
|
+
name = name.string_name if name.respond_to?(:string_name)
|
|
1866
|
+
normalized = name.to_s.downcase
|
|
1867
|
+
normalized == 'osx' ? 'macos' : normalized
|
|
1868
|
+
end
|
|
1869
|
+
|
|
1870
|
+
def xcframework_supports_target_platform?(path)
|
|
1871
|
+
return true unless @target_platform
|
|
1872
|
+
|
|
1873
|
+
@xcframework_slice_cache ||= {}
|
|
1874
|
+
cache_key = [path, @target_platform]
|
|
1875
|
+
return @xcframework_slice_cache[cache_key] if @xcframework_slice_cache.key?(cache_key)
|
|
1876
|
+
|
|
1877
|
+
@xcframework_slice_cache[cache_key] = begin
|
|
1878
|
+
info_plists = File.directory?(path) ? [read_plist(File.join(path, 'Info.plist'))] : read_xcframework_info_plists_from_tarball(path)
|
|
1879
|
+
info_plists.any? && info_plists.all? { |info_plist| info_plist_supports_target_platform?(info_plist) }
|
|
1880
|
+
end
|
|
1881
|
+
end
|
|
1882
|
+
|
|
1883
|
+
def info_plist_supports_target_platform?(info_plist)
|
|
1884
|
+
return false unless info_plist
|
|
1885
|
+
|
|
1886
|
+
available_libraries = info_plist['AvailableLibraries']
|
|
1887
|
+
return false unless available_libraries.is_a?(Array)
|
|
1888
|
+
|
|
1889
|
+
available_libraries.any? do |library|
|
|
1890
|
+
normalize_xcframework_platform(library['SupportedPlatform']) == @target_platform
|
|
1891
|
+
end
|
|
1892
|
+
end
|
|
1893
|
+
|
|
1894
|
+
def read_xcframework_info_plists_from_tarball(tarball)
|
|
1895
|
+
entries_output, status = Open3.capture2e('tar', 'tzf', tarball)
|
|
1896
|
+
unless status.success?
|
|
1897
|
+
Pod::UI.warn "[Expo-precompiled] Failed to inspect #{File.basename(tarball)}: #{entries_output.strip}"
|
|
1898
|
+
return []
|
|
1899
|
+
end
|
|
1900
|
+
|
|
1901
|
+
entries = entries_output.lines.map(&:strip)
|
|
1902
|
+
plist_entries = entries.select { |entry| entry.end_with?('.xcframework/Info.plist') }
|
|
1903
|
+
Pod::UI.warn "[Expo-precompiled] No XCFramework Info.plist found in #{File.basename(tarball)}" if plist_entries.empty?
|
|
1904
|
+
|
|
1905
|
+
plist_entries.filter_map do |entry|
|
|
1906
|
+
plist_data, plist_status = Open3.capture2e('tar', 'xOzf', tarball, entry)
|
|
1907
|
+
unless plist_status.success?
|
|
1908
|
+
Pod::UI.warn "[Expo-precompiled] Failed to extract #{entry} from #{File.basename(tarball)}: #{plist_data.strip}"
|
|
1909
|
+
next
|
|
1910
|
+
end
|
|
1911
|
+
|
|
1912
|
+
Tempfile.create(['expo-xcframework-info', '.plist']) do |file|
|
|
1913
|
+
file.binmode
|
|
1914
|
+
file.write(plist_data)
|
|
1915
|
+
file.flush
|
|
1916
|
+
read_plist(file.path)
|
|
1917
|
+
end
|
|
1918
|
+
end
|
|
1919
|
+
rescue StandardError => e
|
|
1920
|
+
Pod::UI.warn "[Expo-precompiled] Failed to inspect #{File.basename(tarball)}: #{e.message}"
|
|
1921
|
+
[]
|
|
1922
|
+
end
|
|
1923
|
+
|
|
1924
|
+
def read_plist(path)
|
|
1925
|
+
Xcodeproj::Plist.read_from_path(path)
|
|
1926
|
+
rescue StandardError => e
|
|
1927
|
+
Pod::UI.warn "[Expo-precompiled] Failed to read #{File.basename(path)}: #{e.message}"
|
|
1928
|
+
nil
|
|
1929
|
+
end
|
|
1930
|
+
|
|
1845
1931
|
def failed_remote_downloads
|
|
1846
1932
|
@failed_remote_downloads ||= Set.new
|
|
1847
1933
|
end
|
|
@@ -2120,6 +2206,8 @@ module Expo
|
|
|
2120
2206
|
'prebuilt config not found'
|
|
2121
2207
|
when :missing_tarball
|
|
2122
2208
|
'prebuilt tarball not found'
|
|
2209
|
+
when :missing_platform_slice
|
|
2210
|
+
"prebuilt xcframework does not contain a slice for #{@target_platform}"
|
|
2123
2211
|
when :dependency_unavailable
|
|
2124
2212
|
reason = format_prebuilt_unavailable_reason(reason: info[:dependency_reason], path: info[:dependency_path])
|
|
2125
2213
|
"dependency #{info[:dependency]} is not using prebuilt: #{reason}"
|