peachsim 0.1.1817 → 0.1.1821

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.
Files changed (144) hide show
  1. package/cli/commands/agent-indicator-mode.ts +2 -1
  2. package/cli/commands/coverage-swift.ts +4 -3
  3. package/cli/commands/flow.ts +7 -0
  4. package/cli/commands/inspect/core.ts +14 -4
  5. package/cli/commands/inspect/wait-selector.ts +9 -1
  6. package/cli/commands/maestro-compare.ts +7 -0
  7. package/cli/commands/package.ts +5 -0
  8. package/cli/commands/screenshot-mode.ts +2 -1
  9. package/cli/commands/shell-boolean-mode.ts +7 -3
  10. package/cli/commands/shell-url.ts +4 -0
  11. package/cli/commands/show-touches-mode.ts +2 -1
  12. package/cli/commands/test.ts +3 -2
  13. package/cli/commands/three-mode.ts +2 -1
  14. package/cli/outbound-endpoints.ts +5 -0
  15. package/dist-lib/agent-daemon-client.cjs +1 -1
  16. package/dist-lib/agent-events.cjs +1 -1
  17. package/dist-lib/attached-projects.cjs +1 -1
  18. package/dist-lib/auth/shared-session.cjs +1 -1
  19. package/dist-lib/backend-origin.cjs +1 -1
  20. package/dist-lib/beta.cjs +1 -1
  21. package/dist-lib/beta.mjs +1 -1
  22. package/dist-lib/bridge-constants.cjs +1 -1
  23. package/dist-lib/bridge-contract-input.cjs +1 -1
  24. package/dist-lib/bridge-contract-input.mjs +1 -1
  25. package/dist-lib/bridge-contract.cjs +1 -1
  26. package/dist-lib/bridge-contract.mjs +1 -1
  27. package/dist-lib/bundle-channel.cjs +2842 -3830
  28. package/dist-lib/capture-contract.cjs +1 -1
  29. package/dist-lib/capture-contract.mjs +1 -1
  30. package/dist-lib/cloud-contract.cjs +1 -1
  31. package/dist-lib/cloud-contract.mjs +1 -1
  32. package/dist-lib/cloud-test-args.cjs +1 -1
  33. package/dist-lib/cloud-test-args.mjs +1 -1
  34. package/dist-lib/cloud.cjs +1 -1
  35. package/dist-lib/cloud.mjs +1 -1
  36. package/dist-lib/config.cjs +1 -1
  37. package/dist-lib/config.mjs +1 -1
  38. package/dist-lib/detox/index.cjs +2 -2
  39. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  40. package/dist-lib/expo-swift-bundle.cjs +1722 -1580
  41. package/dist-lib/expo-swift-metadata.cjs +1 -1
  42. package/dist-lib/expo-swift-metadata.mjs +1 -1
  43. package/dist-lib/home-paths.cjs +1 -1
  44. package/dist-lib/host/bridge-host.cjs +2800 -3794
  45. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  46. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  47. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  48. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  49. package/dist-lib/host/websocket-proxy.cjs +1 -1
  50. package/dist-lib/index.cjs +32 -11
  51. package/dist-lib/jump-to-source-babel.cjs +1 -1
  52. package/dist-lib/jump-to-source-native.cjs +1 -1
  53. package/dist-lib/kotlin-host.cjs +1 -1
  54. package/dist-lib/menu.cjs +1 -1
  55. package/dist-lib/menu.mjs +1 -1
  56. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  57. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  58. package/dist-lib/metro-production-bundle.cjs +1 -1
  59. package/dist-lib/metro-production-bundle.mjs +1 -1
  60. package/dist-lib/metro.cjs +28 -7
  61. package/dist-lib/native-app-identity-project.cjs +31 -6
  62. package/dist-lib/native-app-identity-project.mjs +295 -259
  63. package/dist-lib/native-app-identity.cjs +1 -1
  64. package/dist-lib/native-app-identity.mjs +1 -1
  65. package/dist-lib/native-firebase-metadata.cjs +1 -1
  66. package/dist-lib/native-firebase-metadata.mjs +1 -1
  67. package/dist-lib/pdfium-raster.cjs +1 -1
  68. package/dist-lib/pdfium-raster.mjs +1 -1
  69. package/dist-lib/plist.cjs +1 -1
  70. package/dist-lib/plist.mjs +1 -1
  71. package/dist-lib/profiles.cjs +1 -1
  72. package/dist-lib/public-brand.cjs +1 -1
  73. package/dist-lib/public-origins-lib-esm.json +29 -24
  74. package/dist-lib/public-origins-lib.json +100 -80
  75. package/dist-lib/react-native-host-modules.cjs +1 -1
  76. package/dist-lib/react-native-host-modules.mjs +1 -1
  77. package/dist-lib/reap-browser.cjs +1 -1
  78. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  79. package/dist-lib/sdk.cjs +8 -6
  80. package/dist-lib/sdk.mjs +8 -6
  81. package/dist-lib/skills.cjs +3192 -4150
  82. package/dist-lib/swift-compile.cjs +136 -29
  83. package/dist-lib/swift-compile.mjs +143 -34
  84. package/dist-lib/swift-package.cjs +1 -1
  85. package/dist-lib/swift-package.mjs +1 -1
  86. package/dist-lib/swift-submit.cjs +1 -1
  87. package/dist-lib/swift-submit.mjs +1 -1
  88. package/dist-lib/swift-toolchain.cjs +52 -6
  89. package/dist-lib/swift.cjs +1 -1
  90. package/dist-lib/vite-swift.cjs +2206 -2060
  91. package/dist-lib/vite.cjs +2 -2
  92. package/dist-lib/worklet-executable.cjs +1 -1
  93. package/dist-lib/worklet-executable.mjs +1 -1
  94. package/dist-types/packages/peach-engine/src/ios/photoLibraryContract.d.ts +1 -1
  95. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +5 -0
  96. package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +41 -0
  97. package/dist-types/packages/peach-engine/src/render-worker/mapServicesContract.d.ts +45 -0
  98. package/package.json +2 -1
  99. package/runtime-companion.json +1 -1
  100. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +1 -1
  101. package/sdk/ios/usr/include/module.modulemap +3 -0
  102. package/sdk/ios/usr/include/notify.modulemap +9 -0
  103. package/sdk/ios/usr/lib/swift/Darwin.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  104. package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
  105. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -1
  106. package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  107. package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +21 -0
  108. package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +6 -1
  109. package/sdk/ios/wasm/include/__header_time.h +4 -0
  110. package/sdk/ios/wasm/include/pthread.h +2 -0
  111. package/sdk/ios/wasm/include/sys/mman.h +1 -1
  112. package/sdk/ios/wasm/include/sys/resource.h +31 -0
  113. package/sdk/ios/wasm/include/unistd.h +4 -0
  114. package/src/answeredNativePackages.ts +11 -9
  115. package/src/expo-discovery-cache.ts +69 -52
  116. package/src/expo-native-workspace.ts +3 -1
  117. package/src/expo-swift-host.ts +45 -7
  118. package/src/installed-native-libraries.ts +103 -20
  119. package/src/native-static-libraries.ts +69 -33
  120. package/src/nitro-adapter.ts +0 -9
  121. package/src/nitro-compile.ts +45 -16
  122. package/src/nitro-superset.ts +4 -5
  123. package/src/plist-bytes.ts +9 -0
  124. package/src/portable-expo-workspace.ts +4 -3
  125. package/src/react-native-bridge-modules.ts +11 -15
  126. package/src/swift-compile.ts +146 -18
  127. package/src/swift-cxx-reachable.ts +13 -0
  128. package/src/swift-distribution.ts +3 -4
  129. package/src/swift-host.ts +5 -3
  130. package/src/swift-installed-targets.ts +32 -14
  131. package/src/swift-native-pin.ts +45 -0
  132. package/src/swift-objc-compile.ts +23 -1
  133. package/src/swift-objc-standin.ts +4 -1
  134. package/src/swift-package-manifest.ts +2 -2
  135. package/src/swift-root-lock.ts +4 -3
  136. package/src/swift-standins.ts +5 -26
  137. package/src/swift-toolchain.ts +69 -12
  138. package/src/swift-wasm-prune.ts +1 -0
  139. package/src/swift-xcframework.ts +23 -12
  140. package/src/swiftContract.ts +2 -0
  141. package/src/swiftNativePinContract.ts +68 -0
  142. package/src/turbo-bundle.ts +14 -6
  143. package/src/turbo-compile.ts +76 -11
  144. package/src/turbo-source.ts +91 -15
@@ -8,6 +8,29 @@ import { cacheDir as peachCacheDir } from './home-paths'
8
8
  import { fetchNativeEntry, nativeEntryKey } from './native-prebuilt'
9
9
  import { swiftDistributionAt } from './swift-compile'
10
10
  import { swiftModuleToolchain } from './swift-distribution'
11
+ import { simulatorNativeLibrary } from './swift-xcframework'
12
+
13
+ // nonmodular frameworks expose C++ declarations through header search paths.
14
+ // their implementations still link when no Swift import names the framework.
15
+ export function nonmodularFrameworkLibraries(
16
+ directories: readonly string[],
17
+ moduleRoot: string,
18
+ ): string[] {
19
+ return [
20
+ ...new Set(
21
+ directories.flatMap((directory) => {
22
+ const native = simulatorNativeLibrary(directory)
23
+ if (native?.kind !== 'framework') return []
24
+ if (
25
+ fs.existsSync(path.join(path.dirname(native.file), 'Modules/module.modulemap'))
26
+ )
27
+ return []
28
+ const recipe = nativeStaticLibraryRecipe(fs.readFileSync(native.file))
29
+ return recipe ? [nativeStaticLibrary(native.file, recipe, moduleRoot)] : []
30
+ }),
31
+ ),
32
+ ]
33
+ }
11
34
 
12
35
  export const NATIVE_STATIC_LIBRARY_RECIPES = [
13
36
  {
@@ -48,118 +71,131 @@ export const NATIVE_STATIC_LIBRARY_RECIPES = [
48
71
  recipe: '59ee230bd8bfde478605817c852c47e76f0c18d88d615bcc0a496b4accd69adf',
49
72
  archive: 'libratex_ffi.a',
50
73
  },
51
- // react-native-skia 2.14.0 (apple-ios 154.0.0), then 3.8.0 (157): installed apps pin either.
52
74
  {
53
75
  name: 'skia',
54
76
  nativeSha256: '5312f2b194b1f6b6721388028bf919e56400278245b039f47136aa98f0582333',
55
77
  upstream: '9f9e6beb751091ef69163d2b4fdcd1e711b594ac',
56
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
78
+ recipe: '92d34cbb85796cedeb2e83f4c52ec47b349a92c5e66ecbbb328b76caa9921998',
57
79
  archive: 'libskia.a',
58
80
  },
59
81
  {
60
82
  name: 'skia_svg',
61
83
  nativeSha256: '77adc498cff85db7850fb713c306681c6337f9b4ec42991b3764c8f3eff9d8d0',
62
84
  upstream: '9f9e6beb751091ef69163d2b4fdcd1e711b594ac',
63
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
85
+ recipe: '92d34cbb85796cedeb2e83f4c52ec47b349a92c5e66ecbbb328b76caa9921998',
64
86
  archive: 'libsvg.a',
65
87
  },
66
88
  {
67
89
  name: 'skia_skshaper',
68
90
  nativeSha256: '830bcf260bd24fd79ee5d323e26ec667638795e3a0e555f1093371b8342c345c',
69
91
  upstream: '9f9e6beb751091ef69163d2b4fdcd1e711b594ac',
70
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
92
+ recipe: '92d34cbb85796cedeb2e83f4c52ec47b349a92c5e66ecbbb328b76caa9921998',
71
93
  archive: 'libskshaper.a',
72
94
  },
73
95
  {
74
96
  name: 'skia_skparagraph',
75
97
  nativeSha256: '26afd4e5b11d46b0820a2cd7fd9918eb5a041946e1a1c0d4b91a5d54877e9dda',
76
98
  upstream: '9f9e6beb751091ef69163d2b4fdcd1e711b594ac',
77
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
99
+ recipe: '92d34cbb85796cedeb2e83f4c52ec47b349a92c5e66ecbbb328b76caa9921998',
78
100
  archive: 'libskparagraph.a',
79
101
  },
80
102
  {
81
103
  name: 'skia_skunicode_core',
82
104
  nativeSha256: '629f58c4e81157d42e353b2b255bebb2fd94d1f31d8f8157e982fa4367710526',
83
105
  upstream: '9f9e6beb751091ef69163d2b4fdcd1e711b594ac',
84
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
106
+ recipe: '92d34cbb85796cedeb2e83f4c52ec47b349a92c5e66ecbbb328b76caa9921998',
85
107
  archive: 'libskunicode_core.a',
86
108
  },
87
109
  {
88
110
  name: 'skia_skunicode_libgrapheme',
89
111
  nativeSha256: '047bd82306ba688453a3ff9dc02e203cdf16f2084551cca54f5d2b099baf1895',
90
112
  upstream: '9f9e6beb751091ef69163d2b4fdcd1e711b594ac',
91
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
113
+ recipe: '92d34cbb85796cedeb2e83f4c52ec47b349a92c5e66ecbbb328b76caa9921998',
92
114
  archive: 'libskunicode_libgrapheme.a',
93
115
  },
94
116
  {
95
117
  name: 'skia_skottie',
96
118
  nativeSha256: '75c0dfd82a256e761cddc45475b8109ed8c9a442767cf3a8bf8720eef0dd4af7',
97
119
  upstream: '9f9e6beb751091ef69163d2b4fdcd1e711b594ac',
98
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
120
+ recipe: '92d34cbb85796cedeb2e83f4c52ec47b349a92c5e66ecbbb328b76caa9921998',
99
121
  archive: 'libskottie.a',
100
122
  },
101
123
  {
102
124
  name: 'skia_sksg',
103
125
  nativeSha256: 'df9652a46505d3c5c74d55b52295ef39218d2b5856e074117461fa2348312c8d',
104
126
  upstream: '9f9e6beb751091ef69163d2b4fdcd1e711b594ac',
105
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
127
+ recipe: '92d34cbb85796cedeb2e83f4c52ec47b349a92c5e66ecbbb328b76caa9921998',
106
128
  archive: 'libsksg.a',
107
129
  },
108
130
  {
109
131
  name: 'skia',
110
132
  nativeSha256: 'c9b007c4da16f66d84b2f108af719b424ef91ee0759e58df0b76930bc6f82e31',
111
133
  upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
112
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
134
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
113
135
  archive: 'libskia.a',
114
136
  },
115
137
  {
116
- name: 'skia_svg',
117
- nativeSha256: '159705737769610b60216b114a28ba833840aa1df7833424df99edec4405b86f',
118
- upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
119
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
120
- archive: 'libsvg.a',
121
- },
122
- {
123
- name: 'skia_skshaper',
124
- nativeSha256: '934f3dbf3f38bca87b463b664a17c1588840f86ec89cf6961fb2a89b6336b35b',
138
+ name: 'skia_skottie',
139
+ nativeSha256: '52ea2e046f45f51df6027d783e923864e8c4ef94a1fe4fc5971e436574d8ae57',
125
140
  upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
126
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
127
- archive: 'libskshaper.a',
141
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
142
+ archive: 'libskottie.a',
128
143
  },
129
144
  {
130
145
  name: 'skia_skparagraph',
131
146
  nativeSha256: '29a48349fc9b75c252b22fc6ca5ade90636900f82beec58780f03fd66ab345b3',
132
147
  upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
133
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
148
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
134
149
  archive: 'libskparagraph.a',
135
150
  },
151
+ {
152
+ name: 'skia_sksg',
153
+ nativeSha256: '541a74d8f83dc411efe8eeac377486a5054fab4c7710afe406a20a27efe8f627',
154
+ upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
155
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
156
+ archive: 'libsksg.a',
157
+ },
158
+ {
159
+ name: 'skia_skshaper',
160
+ nativeSha256: '934f3dbf3f38bca87b463b664a17c1588840f86ec89cf6961fb2a89b6336b35b',
161
+ upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
162
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
163
+ archive: 'libskshaper.a',
164
+ },
136
165
  {
137
166
  name: 'skia_skunicode_core',
138
167
  nativeSha256: '096e5139c4de528dbba5a9605895f4c725853e48225503bdfa9c1d70241e5f58',
139
168
  upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
140
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
169
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
141
170
  archive: 'libskunicode_core.a',
142
171
  },
143
172
  {
144
173
  name: 'skia_skunicode_libgrapheme',
145
174
  nativeSha256: 'd1ec3c2d5ad6889eb4fbf4a6bab74f39946739501d40de903f7d8cb2181ac37d',
146
175
  upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
147
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
176
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
148
177
  archive: 'libskunicode_libgrapheme.a',
149
178
  },
150
179
  {
151
- name: 'skia_skottie',
152
- nativeSha256: '52ea2e046f45f51df6027d783e923864e8c4ef94a1fe4fc5971e436574d8ae57',
180
+ name: 'skia_svg',
181
+ nativeSha256: '159705737769610b60216b114a28ba833840aa1df7833424df99edec4405b86f',
153
182
  upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
154
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
155
- archive: 'libskottie.a',
183
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
184
+ archive: 'libsvg.a',
156
185
  },
157
186
  {
158
- name: 'skia_sksg',
159
- nativeSha256: '541a74d8f83dc411efe8eeac377486a5054fab4c7710afe406a20a27efe8f627',
160
- upstream: 'b94213a11b3a2edadfae89f0c57a7f4ab72772c9',
161
- recipe: 'a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205',
162
- archive: 'libsksg.a',
187
+ name: 'webgpu_dawn',
188
+ nativeSha256: '781f701e5dfdcf73a6cbc1e2f0ab93dd1c98201073f6fd49cb4cdfd92ae64058',
189
+ upstream: 'ada567700e13aecf7989d78b21f7d330b522ea80',
190
+ recipe: 'b8672031cf923619809b990af05bde7dd99a773b1fa482cfc982c97b99440f65',
191
+ archive: 'libwebgpu_dawn.a',
192
+ },
193
+ {
194
+ name: 'webgpu_dawn',
195
+ nativeSha256: '95078993275bccc969b1dfa1ad0934cbacc05ae59e8aa2a6cc46ce93e97d4f69',
196
+ upstream: '3d786993a7ded64c4ebb4884b9b079db9ad0e580',
197
+ recipe: 'd9d74f464fb442b247446999019ed42f334ef703c425ebe63a8933b906e6ac9c',
198
+ archive: 'libwebgpu_dawn.a',
163
199
  },
164
200
  ]
165
201
 
@@ -9,7 +9,6 @@ import fs from 'node:fs'
9
9
  import path from 'node:path'
10
10
  import { installVerifiedTarball } from '@contrast/runtime-delivery'
11
11
  import { rnxHomeDir } from './home-paths'
12
- import nitroLockJson from './nitro-adapter.lock.json' with { type: 'json' }
13
12
  import {
14
13
  ADAPTER_FAMILIES,
15
14
  ADAPTER_MANIFEST,
@@ -17,7 +16,6 @@ import {
17
16
  adapterPin,
18
17
  digest,
19
18
  headerDigests,
20
- parseAdapterLock,
21
19
  parseAdapterManifest,
22
20
  publishedHeaderDigests,
23
21
  verifyInstalledAdapter,
@@ -31,13 +29,6 @@ import { NITRO_GUEST_PLATFORM } from './nitroContract'
31
29
  import { swiftDistributionAt, swiftModuleSdk, WASM_TRIPLE } from './swift-compile'
32
30
  import { swiftEndpoint } from './swift-distribution'
33
31
  import { privateSwiftDistributionRoot, sourceSwiftCheckout } from './swift-toolchain'
34
- import turboLockJson from './turbo-runtime.lock.json' with { type: 'json' }
35
-
36
- /** the verified archives this build ships, the only locks normal compiles use. */
37
- export const committedAdapterLocks: Record<AdapterFamily, AdapterLock> = {
38
- nitro: parseAdapterLock('nitro', nitroLockJson),
39
- turbo: parseAdapterLock('turbo', turboLockJson),
40
- }
41
32
 
42
33
  export interface AdapterArchive {
43
34
  manifest: AdapterManifest
@@ -4,11 +4,8 @@ import os from 'node:os'
4
4
  import path from 'node:path'
5
5
  import { installedNativeLibraries } from './installed-native-libraries'
6
6
  import { readIosAppTarget } from './native-app-identity-project'
7
- import {
8
- committedAdapterLocks,
9
- resolveAdapterArchive,
10
- type AdapterArchive,
11
- } from './nitro-adapter'
7
+ import { combineNativeStaticLibraries } from './native-static-libraries'
8
+ import { resolveAdapterArchive, type AdapterArchive } from './nitro-adapter'
12
9
  import {
13
10
  collectNitroSources,
14
11
  NITRO_VIEWS_TARGET,
@@ -34,13 +31,13 @@ import {
34
31
  prepareXcodeSwiftPackages,
35
32
  } from './swift-host'
36
33
  import { applyInstalledSwiftTargets } from './swift-installed-targets'
34
+ import { swiftNativePin } from './swift-native-pin'
37
35
  import {
38
36
  manifestCalls,
39
37
  swiftManifestCxxLanguageStandard,
40
38
  swiftManifestTargets,
41
39
  swiftManifestSettings,
42
40
  clangSettingEntries,
43
- swiftNativeSupportFiles,
44
41
  } from './swift-package'
45
42
  import { projectSourceKey } from './swift-source-file'
46
43
  import { appPodfileLock, collectSwiftSourcePods } from './swift-source-pods'
@@ -373,6 +370,22 @@ export async function compileNitroModule(
373
370
  },
374
371
  async (root) => {
375
372
  const snapshot = await installedWorkspaceInput(root, 'main.swift')
373
+ // react's registration and turbomodule implementations belong to its
374
+ // runtime, while this executable owns the selected Nitro providers.
375
+ const swiftFiles = Object.keys(snapshot.input.files).filter((file) =>
376
+ file.endsWith('.swift'),
377
+ )
378
+ const mixedTargets = new Set([
379
+ ...collection.targets.map(({ name }) => name),
380
+ ...swiftManifestTargets(snapshot.input.files['Package.swift']!)
381
+ .filter((target) =>
382
+ swiftFiles.some((file) => file.startsWith(`${target.path}/`)),
383
+ )
384
+ .map(({ name }) => name),
385
+ ])
386
+ snapshot.input.nativeTargets = snapshot.input.nativeTargets?.filter(({ name }) =>
387
+ mixedTargets.has(name),
388
+ )
376
389
  Object.assign(
377
390
  collection.aliases,
378
391
  applyInstalledSwiftTargets(
@@ -416,17 +429,18 @@ export async function compileNitroModule(
416
429
  throw new Error(
417
430
  `Nitro compilation needs the app's Xcode project to declare an iOS deployment target: ${options.projectRoot}`,
418
431
  )
432
+ const adapter = await resolveAdapterArchive(
433
+ 'nitro',
434
+ {
435
+ nitroModules: collection.nitro.root,
436
+ reactNative: collection.reactNative.root,
437
+ },
438
+ options.moduleRoot,
439
+ swiftNativePin().adapters.nitro,
440
+ )
419
441
  const input = collectNitroCompileInput(
420
442
  collection,
421
- await resolveAdapterArchive(
422
- 'nitro',
423
- {
424
- nitroModules: collection.nitro.root,
425
- reactNative: collection.reactNative.root,
426
- },
427
- options.moduleRoot,
428
- committedAdapterLocks.nitro,
429
- ),
443
+ adapter,
430
444
  dependencies,
431
445
  iosDeploymentTarget,
432
446
  options.configuration,
@@ -452,6 +466,20 @@ export async function compileNitroModule(
452
466
  // the same module directory, so processes compiling the module share one
453
467
  // warm build root without overwriting each other's staged sources.
454
468
  const packagePath = path.join(os.tmpdir(), 'peach-nitro-swift', key, `p${process.pid}`)
469
+ const sharedLibrary = [...nativeLibraries.values()].find(
470
+ (pod) => pod.sharedLibrary,
471
+ )?.sharedLibrary
472
+ if (sharedLibrary) {
473
+ fs.mkdirSync(packagePath, { recursive: true })
474
+ const core = path.join(packagePath, 'adapter.a')
475
+ fs.writeFileSync(core, Buffer.from(adapter.base64, 'base64'))
476
+ input.libraries ??= {}
477
+ input.libraries.NitroCore = fs
478
+ .readFileSync(
479
+ combineNativeStaticLibraries([core, sharedLibrary], options.moduleRoot),
480
+ )
481
+ .toString('base64')
482
+ }
455
483
  syncSwiftTree(
456
484
  packagePath,
457
485
  new Map(
@@ -467,7 +495,8 @@ export async function compileNitroModule(
467
495
  project.lazyDistribution = input.lazyDistribution
468
496
  project.nativeTargets = input.nativeTargets
469
497
  project.headerAliases = input.headerAliases
470
- project.nativeFiles = swiftNativeSupportFiles(input.files, collection.targets)
498
+ // retain the workspace's explicit membership through the package snapshot.
499
+ project.nativeFiles = input.files
471
500
  project.resourceBundles = input.resourceBundles
472
501
  project.bundleFiles = input.resources
473
502
  ? {
@@ -18,7 +18,6 @@ import {
18
18
  nativeEntryKey,
19
19
  nativeEntryPrefix,
20
20
  } from './native-prebuilt'
21
- import { committedAdapterLocks } from './nitro-adapter'
22
21
  import { nitroCompilerSourceDigest } from './nitro-compiler-digest'
23
22
  import supersetLockJson from './nitro-superset.lock.json' with { type: 'json' }
24
23
  import {
@@ -26,8 +25,7 @@ import {
26
25
  type NitroBuildConfiguration,
27
26
  type NitroCompiledModule,
28
27
  } from './nitroContract'
29
- import { parseSwiftDistributionLock } from './swift-distribution-contract'
30
- import swiftLockJson from './swift-distribution.lock.json' with { type: 'json' }
28
+ import { swiftNativePin } from './swift-native-pin'
31
29
  import { STANDIN_SOURCE_DIGEST } from './swift-standin-digest'
32
30
 
33
31
  export const NITRO_SUPERSET_ENTRY_NAME = 'superset'
@@ -66,12 +64,13 @@ export function nitroSupersetInputs(options: {
66
64
  providers: readonly { name: string; root: string }[]
67
65
  }): Record<string, string> {
68
66
  const resolve = createRequire(join(options.appRoot, 'package.json')).resolve
67
+ const pin = swiftNativePin()
69
68
  const inputs: Record<string, string> = {
70
69
  configuration: options.configuration,
71
70
  'ios-deployment-target': options.iosDeploymentTarget,
72
71
  'react-native': packageVersion(dirname(resolve('react-native/package.json'))),
73
- 'swift-distribution': parseSwiftDistributionLock(swiftLockJson).id,
74
- 'nitro-runtime': JSON.stringify(committedAdapterLocks.nitro),
72
+ 'swift-distribution': pin.distribution.id,
73
+ 'nitro-runtime': JSON.stringify(pin.adapters.nitro),
75
74
  }
76
75
  const nitroModules = dirname(resolve('react-native-nitro-modules/package.json'))
77
76
  for (const { name, root } of [
@@ -0,0 +1,9 @@
1
+ import binaryPlist from 'bplist-parser'
2
+ import { parsePlistSource } from './plist'
3
+
4
+ export function parsePlistBytes(source: Uint8Array): unknown {
5
+ const bytes = Buffer.from(source)
6
+ return bytes.subarray(0, 8).toString('ascii') === 'bplist00'
7
+ ? binaryPlist.parseBuffer<unknown>(bytes)[0]
8
+ : parsePlistSource(bytes.toString('utf8'))
9
+ }
@@ -6,7 +6,7 @@ import { readExpoConfigAsync } from './native-firebase-config'
6
6
  import { portableInterfaceHash, readPortableExpoManifest } from './portable-expo-contract'
7
7
  import { preparedNativeInventory } from './prepared-native-inventory'
8
8
  import { registerPreparedXcodePhases } from './prepared-xcode-phases'
9
- import lock from './swift-distribution.lock.json' with { type: 'json' }
9
+ import { swiftNativePin } from './swift-native-pin'
10
10
 
11
11
  function stable(value: unknown, app: string): string {
12
12
  if (typeof value === 'string') return JSON.stringify(value.split(app).join('$APP'))
@@ -61,9 +61,10 @@ export async function portableExpoWorkspace(
61
61
  )
62
62
  continue
63
63
  }
64
- if (value.swiftDistribution !== lock.id) {
64
+ const { id } = swiftNativePin().distribution
65
+ if (value.swiftDistribution !== id) {
65
66
  mismatches.push(
66
- `${name}: Swift distribution ${lock.id} differs from ${value.swiftDistribution}`,
67
+ `${name}: Swift distribution ${id} differs from ${value.swiftDistribution}`,
67
68
  )
68
69
  continue
69
70
  }
@@ -476,15 +476,17 @@ export function collectBridgeModuleSources(
476
476
  if (bridgingHeader && target.objc && app) {
477
477
  nativeInputs ??= xcodeObjCInputs(app, [], null, undefined, projectRoot)
478
478
  const native = target.objc
479
+ // an installed package a monorepo hoists above the project keeps its
480
+ // absolute path under one reserved prefix.
479
481
  const key = (file: string) => {
480
482
  const relative = path.relative(projectRoot, file)
481
- if (
483
+ const outside =
482
484
  relative === '..' ||
483
485
  relative.startsWith(`..${path.sep}`) ||
484
486
  path.isAbsolute(relative)
485
- )
486
- throw new Error(`Xcode native input outside ${projectRoot}: ${file}`)
487
- return path.posix.join('__peach_xcode', relative.split(path.sep).join('/'))
487
+ return outside
488
+ ? path.posix.join('__peach_xcode/__outside', file.split(path.sep).join('/'))
489
+ : path.posix.join('__peach_xcode', relative.split(path.sep).join('/'))
488
490
  }
489
491
  const headerFiles = [...nativeInputs.sources].filter(([file]) =>
490
492
  /\.(?:h|hh|hpp|hxx|pch|inc|inl|modulemap)$/.test(file),
@@ -493,17 +495,11 @@ export function collectBridgeModuleSources(
493
495
  headerFiles.map(([file, bytes]) => [key(file), bytes.toString('utf8')]),
494
496
  )
495
497
  const directories = (files: string[]) =>
496
- files.flatMap((file) => {
497
- const relative = path.relative(projectRoot, file)
498
- if (
499
- relative !== '..' &&
500
- !relative.startsWith(`..${path.sep}`) &&
501
- !path.isAbsolute(relative)
502
- )
503
- return [key(file)]
504
- if (!fs.existsSync(file)) return []
505
- throw new Error(`Xcode native search path outside ${projectRoot}: ${file}`)
506
- })
498
+ files.flatMap((file) =>
499
+ key(file).startsWith('__peach_xcode/__outside/') && !fs.existsSync(file)
500
+ ? []
501
+ : [key(file)],
502
+ )
507
503
  const nativePath = (file: string) => {
508
504
  const absolute = path.resolve(app.rootDir, file)
509
505
  return absolute === '/usr/include' || absolute.startsWith('/usr/include/')