peachsim 0.1.2668 → 0.1.2669

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 (128) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +119 -66
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-UHHE4662.mjs → acorn-Y2ITHAGD.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-SGQN2ESY.mjs → chunk-4S7ECHE6.mjs} +1 -1
  28. package/dist-lib/esm-chunks/{chunk-TO6W2LFW.mjs → chunk-4W7RCQWJ.mjs} +6 -6
  29. package/dist-lib/esm-chunks/{chunk-O5EBV7NR.mjs → chunk-7ETYLWJJ.mjs} +1 -1
  30. package/dist-lib/esm-chunks/{chunk-X55GJ6Q5.mjs → chunk-AFSFMJA7.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-T2MNJVWI.mjs → chunk-AX6M4YRZ.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-DKLWBMN6.mjs → chunk-B5WRW52W.mjs} +2 -2
  33. package/dist-lib/esm-chunks/{chunk-JKLYVOQX.mjs → chunk-B6X5HYFY.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-TSG3DMFL.mjs → chunk-GXUOR7YU.mjs} +4 -4
  35. package/dist-lib/esm-chunks/{chunk-4KMGZQLM.mjs → chunk-HIMY4MTQ.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-GI63XXZ7.mjs → chunk-HW24JXXU.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-DCGTSDTX.mjs → chunk-LEXTFQ2S.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-KEAW2RUW.mjs → chunk-LSDUP5I2.mjs} +3 -3
  39. package/dist-lib/esm-chunks/{chunk-LCZABYLN.mjs → chunk-LYLYHVST.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-WRD6OVWF.mjs → chunk-N2C5JS22.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-7A2S2ZI6.mjs → chunk-NB762DTK.mjs} +6 -6
  42. package/dist-lib/esm-chunks/{chunk-TOFNJQXJ.mjs → chunk-NEGUR24D.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-SM34FRTK.mjs → chunk-NZ3KVB7N.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-YK23SCED.mjs → chunk-OG5WWF6M.mjs} +5 -5
  45. package/dist-lib/esm-chunks/{chunk-6HKX2IZR.mjs → chunk-Q34ZCWHC.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-ID2XTVCL.mjs → chunk-QF5PBPBI.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-4O3DPVLW.mjs → chunk-RSMSSTAS.mjs} +17 -16
  48. package/dist-lib/esm-chunks/{chunk-MMDS6THB.mjs → chunk-UPMM3HMR.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-T2IOAV34.mjs → chunk-XBCYEXXL.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-UPZ4SND5.mjs → chunk-YTLFSE7V.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-7RPAPPQA.mjs → metro-layout-parser-5LPEMNZ7.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-6GAGGF6N.mjs → swift-package-prebuilt-WBV6QKTU.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-OJFU37BE.mjs → swift-sdk-app-module-UKNPNJ5G.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-TBNA3KMG.mjs → swift-sdk-image-5WMX2RSY.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-WK7Z76QM.mjs → swift-sdk-image-producer-72GQDJX2.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +1884 -1831
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +2094 -2041
  61. package/dist-lib/host/fetch-proxy-handler.cjs +435 -433
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +85 -85
  87. package/dist-lib/public-origins-lib.json +88 -88
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +2059 -2006
  95. package/dist-lib/swift-compile.cjs +4 -3
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/package.json +1 -1
  123. package/src/core-data-model.ts +5 -1
  124. package/src/expo-native-workspace.ts +45 -16
  125. package/src/podspec-cocoapods.ts +39 -0
  126. package/src/podspec-ruby.ts +1 -1
  127. package/src/swift-wasm-prune.ts +3 -2
  128. package/src/turbo-source.ts +53 -68
@@ -171,17 +171,6 @@ export function registersReactModule(source: string): boolean {
171
171
  return OBJC_BRIDGE.test(stripped) && !/-Swift\.h\b/.test(stripped)
172
172
  }
173
173
 
174
- function fabricComponents(root: string): boolean {
175
- // an app-local Expo module has no manifest, so no codegen config
176
- const manifestPath = path.join(root, 'package.json')
177
- if (!fs.existsSync(manifestPath)) return false
178
- const manifest: unknown = JSON.parse(fs.readFileSync(manifestPath, 'utf8'))
179
- if (!object(manifest) || !object(manifest.codegenConfig)) return false
180
- // codegen's third-party component generator excludes only module libraries;
181
- // component classes may come from ios.components or native annotations.
182
- return manifest.codegenConfig.type !== 'modules'
183
- }
184
-
185
174
  // the TurboModule core every module pod links (ReactCommon/turbomodule/core
186
175
  // and the pods it depends on), and the header search roots CocoaPods exposes
187
176
  // for them: jsi, ReactCommon's header_dir, callinvoker, perflogger.
@@ -304,6 +293,22 @@ function packageManifest(root: string): Record<string, unknown> | null {
304
293
  return value
305
294
  }
306
295
 
296
+ function packageCodegenLibraries(root: string) {
297
+ const config = packageManifest(root)?.codegenConfig
298
+ if (!object(config)) return []
299
+ const libraries = config.libraries ?? [config]
300
+ if (!Array.isArray(libraries))
301
+ throw new Error(`${root}: invalid codegenConfig.libraries`)
302
+ return libraries.map((library: unknown) => {
303
+ if (!object(library)) throw new Error(`${root}: invalid codegen library`)
304
+ const components = library.type !== 'modules'
305
+ if (library.includesGeneratedCode === true) return { spec: null, components }
306
+ if (typeof library.name !== 'string' || library.name === '')
307
+ throw new Error(`${root}: codegen library has no name`)
308
+ return { spec: library.name, components }
309
+ })
310
+ }
311
+
307
312
  function packageInfo(root: string): TurboPackage {
308
313
  root = fs.realpathSync(root)
309
314
  const value = packageManifest(root)
@@ -978,8 +983,8 @@ export async function turboProviderCandidates(
978
983
  // a package peach-compat answers keeps its answer, Fabric views included.
979
984
  if (answered.has(name)) continue
980
985
  // a pod can register Nitro objects and Fabric components independently.
981
- const fabric = fabricComponents(root)
982
986
  if (!podspecPath) continue
987
+ const fabric = packageCodegenLibraries(root).some((library) => library.components)
983
988
  candidates.push({
984
989
  provider: { name, root, podspecPath },
985
990
  fabric,
@@ -1122,7 +1127,11 @@ export async function collectTurboSources(options: {
1122
1127
  if (reactNative.name !== 'react-native')
1123
1128
  throw new Error(`${options.reactNativeRoot} is not react-native`)
1124
1129
  const rawProviders = options.providers
1125
- .map((provider) => ({ ...provider, info: packageInfo(provider.root) }))
1130
+ .map((provider) => ({
1131
+ ...provider,
1132
+ info: packageInfo(provider.root),
1133
+ libraries: packageCodegenLibraries(provider.root),
1134
+ }))
1126
1135
  .sort((a, b) => a.info.name.localeCompare(b.info.name))
1127
1136
  const installedHeaderPods = (
1128
1137
  options.reactNativeProvider || options.reactNativeCore
@@ -1159,23 +1168,11 @@ export async function collectTurboSources(options: {
1159
1168
  }
1160
1169
  const providers: ((typeof rawProviders)[number] & { providerFabric: boolean })[] = []
1161
1170
  for (const provider of rawProviders) {
1162
- if (!fabricComponents(provider.root)) {
1171
+ const componentLibraries = provider.libraries.filter((library) => library.components)
1172
+ if (componentLibraries.length === 0) {
1163
1173
  providers.push({ ...provider, providerFabric: false })
1164
1174
  continue
1165
1175
  }
1166
- const manifest = packageManifest(provider.root)
1167
- const codegenConfig =
1168
- manifest && object(manifest.codegenConfig) ? manifest.codegenConfig : null
1169
- const spec =
1170
- codegenConfig && codegenConfig.includesGeneratedCode !== true
1171
- ? codegenConfig.name
1172
- : null
1173
- if (
1174
- codegenConfig &&
1175
- codegenConfig.includesGeneratedCode !== true &&
1176
- typeof spec !== 'string'
1177
- )
1178
- throw new Error(`${provider.info.name}: codegenConfig has no name`)
1179
1176
  const cg = await loadCodegen()
1180
1177
  const pod = readPod(
1181
1178
  provider,
@@ -1183,14 +1180,22 @@ export async function collectTurboSources(options: {
1183
1180
  options.installedPods?.get(provider.name),
1184
1181
  )
1185
1182
  const allPodFiles = podFiles(pod)
1186
- let providerFabric =
1183
+ const providerFabric =
1187
1184
  cg.thirdPartyComponentOwners.has(provider.info.name) ||
1188
- cg.thirdPartyComponentOwners.has(provider.name)
1189
- if (!providerFabric) {
1190
- if (typeof spec === 'string') {
1185
+ cg.thirdPartyComponentOwners.has(provider.name) ||
1186
+ componentLibraries.some(({ spec }) => {
1187
+ if (spec === null)
1188
+ return allPodFiles.some(
1189
+ (file) =>
1190
+ file.includes('react/renderer/components/') ||
1191
+ (OBJC.test(file) &&
1192
+ /\bRCTComponentViewProtocol\b/.test(
1193
+ fs.readFileSync(path.join(pod.root, file), 'utf8'),
1194
+ )),
1195
+ )
1191
1196
  const shadowNodesFile = `react/renderer/components/${spec}/ShadowNodes.cpp`
1192
1197
  const descriptorsFile = `react/renderer/components/${spec}/ComponentDescriptors.cpp`
1193
- providerFabric =
1198
+ return (
1194
1199
  (cg.owned.has(shadowNodesFile) &&
1195
1200
  definedFacebookReactComponentNames(
1196
1201
  fs.readFileSync(path.join(cg.generated, shadowNodesFile), 'utf8'),
@@ -1201,17 +1206,8 @@ export async function collectTurboSources(options: {
1201
1206
  fs.readFileSync(path.join(cg.generated, descriptorsFile), 'utf8'),
1202
1207
  ),
1203
1208
  ))
1204
- } else {
1205
- providerFabric = allPodFiles.some(
1206
- (file) =>
1207
- file.includes('react/renderer/components/') ||
1208
- (OBJC.test(file) &&
1209
- /\bRCTComponentViewProtocol\b/.test(
1210
- fs.readFileSync(path.join(pod.root, file), 'utf8'),
1211
- )),
1212
1209
  )
1213
- }
1214
- }
1210
+ })
1215
1211
  if (!providerFabric) {
1216
1212
  const filteredFiles = allPodFiles.filter((file) => {
1217
1213
  if (!provider.reactModulesOnly || HEADER.test(file)) return true
@@ -1228,14 +1224,9 @@ export async function collectTurboSources(options: {
1228
1224
  providers.push({ ...provider, providerFabric })
1229
1225
  }
1230
1226
  const installedCodegenNames = new Set(
1231
- installedHeaderPods.flatMap((pod) => {
1232
- const manifest = packageManifest(pod.packageRoot)
1233
- if (!manifest || !object(manifest.codegenConfig)) return []
1234
- const config = manifest.codegenConfig
1235
- return typeof config.name === 'string' && config.includesGeneratedCode !== true
1236
- ? [config.name]
1237
- : []
1238
- }),
1227
+ installedHeaderPods.flatMap((pod) =>
1228
+ packageCodegenLibraries(pod.packageRoot).flatMap(({ spec }) => spec ?? []),
1229
+ ),
1239
1230
  )
1240
1231
  const installedHeaders = new Map<
1241
1232
  string,
@@ -1963,9 +1954,6 @@ export async function collectTurboSources(options: {
1963
1954
  }
1964
1955
  for (const [name, relative] of pod.installed?.mappedHeaders ?? [])
1965
1956
  header([name], { label, root, relative })
1966
- const manifest = packageManifest(provider.root)
1967
- const codegenConfig =
1968
- manifest && object(manifest.codegenConfig) ? manifest.codegenConfig : null
1969
1957
  const sources: string[] = []
1970
1958
  const codegenObjCSources: string[] = []
1971
1959
  const swiftSources: string[] = []
@@ -2214,15 +2202,9 @@ export async function collectTurboSources(options: {
2214
2202
  )
2215
2203
  throw new Error(`${label}: its pod sources register no TurboModule`)
2216
2204
  objc ||= providerObjC
2217
- if (codegenConfig && codegenConfig.includesGeneratedCode !== true) {
2218
- if (typeof codegenConfig.name !== 'string')
2219
- throw new Error(`${label}: codegenConfig has no name`)
2220
- codegen ??= (await runInstalledTurboCodegen(options.appRoot, options.codegenDir))
2221
- .generatedRoot
2222
- const generated = codegenSpecRoot(codegen)
2223
- const owned = new Set<string>()
2224
- walkFiles(generated, '', owned)
2225
- const spec = codegenConfig.name
2205
+ const specs = provider.libraries.flatMap(({ spec }) => spec ?? [])
2206
+ if (specs.length > 0) {
2207
+ const { generated, owned } = await loadCodegen()
2226
2208
  let definedComponentNames: Set<string> | undefined
2227
2209
  const getDefinedComponentNames = () => {
2228
2210
  if (definedComponentNames) return definedComponentNames
@@ -2240,12 +2222,15 @@ export async function collectTurboSources(options: {
2240
2222
  }
2241
2223
  for (const file of [...owned].sort()) {
2242
2224
  const base = path.posix.basename(file)
2243
- // the Objective-C spec classes only an Objective-C module reaches
2244
- const objcSpec = providerObjC && file.startsWith(`${spec}/`)
2245
- // the Fabric component sources, named by the path codegen gives them
2246
- const component =
2247
- provider.providerFabric && file.startsWith(`react/renderer/components/${spec}/`)
2248
- if (!base.startsWith(`${spec}JSI`) && !objcSpec && !component) continue
2225
+ const spec = specs.find(
2226
+ (name) =>
2227
+ base.startsWith(`${name}JSI`) ||
2228
+ (providerObjC && file.startsWith(`${name}/`)) ||
2229
+ (provider.providerFabric &&
2230
+ file.startsWith(`react/renderer/components/${name}/`)),
2231
+ )
2232
+ if (!spec) continue
2233
+ const component = file.startsWith(`react/renderer/components/${spec}/`)
2249
2234
  // CocoaPods searches a pod's own mapped headers before ReactCodegen.
2250
2235
  if (component && HEADER.test(base) && headers.has(file)) continue
2251
2236
  if (HEADER.test(base))