peachsim 0.1.1815 → 0.1.1818

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 (147) 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 +1 -1
  5. package/cli/commands/maestro-compare.ts +7 -0
  6. package/cli/commands/package.ts +87 -31
  7. package/cli/commands/screenshot-mode.ts +2 -1
  8. package/cli/commands/shell-boolean-mode.ts +7 -3
  9. package/cli/commands/shell-url.ts +4 -0
  10. package/cli/commands/show-touches-mode.ts +2 -1
  11. package/cli/commands/test.ts +3 -2
  12. package/cli/commands/three-mode.ts +2 -1
  13. package/cli/outbound-endpoints.ts +1 -1
  14. package/cli/packaged-app-launcher.ts +6 -1
  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 +5728 -7551
  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 +13 -4
  39. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  40. package/dist-lib/expo-swift-bundle.cjs +5234 -5704
  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 +4913 -6811
  45. package/dist-lib/host/fetch-proxy-handler.cjs +13 -4
  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 +40 -30
  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 +39 -29
  61. package/dist-lib/native-app-identity-project.cjs +31 -26
  62. package/dist-lib/native-app-identity-project.mjs +295 -279
  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 +121 -93
  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 +2 -2
  80. package/dist-lib/sdk.mjs +2 -2
  81. package/dist-lib/skills.cjs +64622 -66476
  82. package/dist-lib/swift-compile.cjs +328 -265
  83. package/dist-lib/swift-compile.mjs +335 -270
  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 +2405 -2262
  91. package/dist-lib/vite.cjs +13 -4
  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/render-worker/compositor-protocol.d.ts +5 -0
  95. package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +41 -0
  96. package/dist-types/packages/peach-engine/src/render-worker/mapServicesContract.d.ts +45 -0
  97. package/package.json +2 -1
  98. package/runtime-companion.json +1 -1
  99. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +1 -1
  100. package/sdk/ios/usr/include/module.modulemap +3 -0
  101. package/sdk/ios/usr/include/notify.modulemap +9 -0
  102. package/sdk/ios/usr/lib/swift/Darwin.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  103. package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
  104. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -1
  105. package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  106. package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +21 -0
  107. package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +6 -1
  108. package/sdk/ios/wasm/include/__header_time.h +4 -0
  109. package/sdk/ios/wasm/include/pthread.h +2 -0
  110. package/sdk/ios/wasm/include/sys/mman.h +1 -1
  111. package/sdk/ios/wasm/include/sys/resource.h +31 -0
  112. package/sdk/ios/wasm/include/unistd.h +4 -0
  113. package/src/answeredNativePackages.ts +43 -0
  114. package/src/cli-runtime.ts +2 -9
  115. package/src/expo-discovery-cache.ts +71 -52
  116. package/src/expo-kotlin-host.ts +11 -9
  117. package/src/expo-swift-host.ts +55 -13
  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-bundle.ts +8 -6
  122. package/src/nitro-compile.ts +45 -16
  123. package/src/nitro-compiler-digest.ts +2 -4
  124. package/src/nitro-superset.lock.json +19 -251
  125. package/src/nitro-superset.ts +63 -68
  126. package/src/plist-bytes.ts +9 -0
  127. package/src/portable-expo-workspace.ts +4 -3
  128. package/src/react-native-bridge-modules.ts +13 -19
  129. package/src/swift-compile.ts +379 -269
  130. package/src/swift-cxx-reachable.ts +13 -0
  131. package/src/swift-distribution.ts +3 -4
  132. package/src/swift-host.ts +5 -3
  133. package/src/swift-installed-targets.ts +32 -14
  134. package/src/swift-native-pin.ts +45 -0
  135. package/src/swift-objc-compile.ts +23 -1
  136. package/src/swift-objc-standin.ts +14 -7
  137. package/src/swift-package-manifest.ts +2 -2
  138. package/src/swift-root-lock.ts +4 -3
  139. package/src/swift-standins.ts +41 -38
  140. package/src/swift-toolchain.ts +69 -12
  141. package/src/swift-wasm-prune.ts +1 -0
  142. package/src/swift-xcframework.ts +23 -12
  143. package/src/swiftContract.ts +2 -0
  144. package/src/swiftNativePinContract.ts +68 -0
  145. package/src/turbo-bundle.ts +14 -6
  146. package/src/turbo-compile.ts +76 -11
  147. package/src/turbo-source.ts +93 -18
@@ -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
@@ -1,8 +1,8 @@
1
1
  import fs from 'node:fs'
2
2
  import path from 'node:path'
3
- import { PEACH_ANSWERED_NATIVE_PACKAGE_NAMES } from '../../peach-compat/src/generated/supported-native-packages'
4
3
  import { loadRNXAppConfig } from '../cli/app-config'
5
4
  import { resolveAppProject } from '../cli/app-project'
5
+ import { peachAnsweredNativePackages } from './answeredNativePackages'
6
6
  import { isLoopbackHost } from './backend-origin'
7
7
  import { prepareNativeAppRoot } from './expo-native-workspace'
8
8
  import { readIosAppTarget } from './native-app-identity-project'
@@ -28,18 +28,19 @@ export interface NitroBundle {
28
28
  assets: CompiledModuleAsset[]
29
29
  }
30
30
 
31
- const answeredPackages: ReadonlySet<string> = new Set(PEACH_ANSWERED_NATIVE_PACKAGE_NAMES)
32
-
33
31
  // the installed iOS Nitro providers an app compiles and the HybridObject names
34
32
  // its config answers, or null when none has an original constructor left. a
35
33
  // provider Peach answers itself (a seam resolves before the original
36
34
  // registration) is not compiled. a HybridObject the app's config answers, a
37
35
  // view or an unsupported or file-answered name, registers no original
38
36
  // constructor; a provider left with none is not compiled.
39
- export async function selectCompiledNitroProviders(appRoot: string) {
37
+ export async function selectCompiledNitroProviders(
38
+ appRoot: string,
39
+ answered = peachAnsweredNativePackages(),
40
+ ) {
40
41
  const config = await loadRNXAppConfig(resolveAppProject(appRoot))
41
42
  const providers = selectNitroProviders(await discoverNitroProviders(appRoot)).filter(
42
- ({ provider }) => !answeredPackages.has(provider.name),
43
+ ({ provider }) => !answered.has(provider.name),
43
44
  )
44
45
  const registered = new Set(
45
46
  providers.flatMap(({ config }) => config.classes.map(({ name }) => name)),
@@ -73,9 +74,10 @@ export async function compileNitroApp(
73
74
  moduleRoot?: string,
74
75
  shared = true,
75
76
  iosTarget?: string,
77
+ answered?: ReadonlySet<string>,
76
78
  ): Promise<{ metadata: NitroCompiledModule; artifact: SwiftArtifact | null } | null> {
77
79
  appRoot = fs.realpathSync(appRoot)
78
- const selection = await selectCompiledNitroProviders(appRoot)
80
+ const selection = await selectCompiledNitroProviders(appRoot, answered)
79
81
  if (!selection) return null
80
82
  const { packageRoots, answers } = selection
81
83
  let projectRoot = readIosAppTarget(appRoot, iosTarget)
@@ -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
  ? {
@@ -4,10 +4,8 @@ import path from 'node:path'
4
4
  import { swiftCompilerSourceDigest } from './swift-compiler-digest'
5
5
 
6
6
  // the sources that turn providers into the executable. a change to any of them
7
- // moves the key, so the lock is regenerated and republished with it
8
- // (scripts/check/nitro-superset-lock.ts rejects a stale lock before main).
9
- // this module imports only digest code, so the lander can run a candidate
10
- // tree's own copy to address that tree's lock (scripts/lib/land-nitro-lock.ts).
7
+ // moves the shared executable's key (nitro-superset.ts), which main's
8
+ // nitro-superset workflow then publishes.
11
9
  export const COMPILER_SOURCES = [
12
10
  'nitro-source.ts',
13
11
  'nitro-compile.ts',