peachsim 0.1.2257 → 0.1.2259

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 (89) 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 +1 -1
  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 +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +32 -17
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +10 -6
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +32 -17
  31. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +3 -3
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +3 -3
  47. package/dist-lib/native-app-identity-project.cjs +1 -1
  48. package/dist-lib/native-app-identity-project.mjs +1 -1
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +34 -19
  68. package/dist-lib/swift-compile.cjs +1 -1
  69. package/dist-lib/swift-compile.mjs +1 -1
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +7 -3
  77. package/dist-lib/vite.cjs +3 -3
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/dist-types/packages/peach-engine/src/engine/node.d.ts +0 -6
  81. package/java-platform/licenses/openjdk.txt +8 -0
  82. package/kotlin/sdk.tar.gz +0 -0
  83. package/package.json +1 -1
  84. package/src/expo-native-workspace.ts +4 -1
  85. package/src/native-package-slice-build.ts +386 -0
  86. package/src/native-package-slice.ts +36 -11
  87. package/src/nitro-compile.ts +37 -13
  88. package/src/swift-distribution.ts +7 -2
  89. package/src/turbo-compile.ts +22 -7
@@ -276,14 +276,21 @@ function unresolvedFrameworkIncludes(files: Record<string, string>): string[] {
276
276
  return [...names].sort()
277
277
  }
278
278
 
279
- export async function compileNitroModule(
280
- options: NitroSourceOptions & {
281
- moduleRoot: string
282
- projectRoot: string
283
- iosTarget?: string
284
- configuration: NitroBuildConfiguration
285
- },
286
- ): Promise<{ artifact: SwiftArtifact; collection: NitroSourceCollection }> {
279
+ export type CompileNitroModuleOptions = NitroSourceOptions & {
280
+ moduleRoot: string
281
+ projectRoot: string
282
+ iosTarget?: string
283
+ configuration: NitroBuildConfiguration
284
+ }
285
+
286
+ /** prepares the SwiftPM package input and source collection for Nitro compilation. */
287
+ export async function prepareNitroCompileInput(
288
+ options: CompileNitroModuleOptions & { iosDeploymentTargetFallback?: string },
289
+ ): Promise<{
290
+ input: SwiftCompileInput
291
+ collection: NitroSourceCollection
292
+ packagePath: string
293
+ }> {
287
294
  const ndebug = options.configuration === 'Release' ? ['-DNDEBUG'] : []
288
295
  await prepareNitroSourceDependencies(options)
289
296
  const workspace = installedXcodeWorkspace(options.projectRoot)
@@ -406,6 +413,17 @@ export async function compileNitroModule(
406
413
  ndebug,
407
414
  ),
408
415
  )
416
+ // nitro views headers need the Fabric renderer, which Peach does not build, and only
417
+ // that renderer reads them; the installed umbrella must not import them.
418
+ const views = new Set(
419
+ fs.readdirSync(path.join(collection.nitro.root, 'cpp/views')),
420
+ )
421
+ for (const [file, source] of Object.entries(collection.files))
422
+ if (file.endsWith('/NitroModules-umbrella.h'))
423
+ collection.files[file] = source.replace(
424
+ /^#import "([^"]+)"\n/gm,
425
+ (line, header: string) => (views.has(header) ? '' : line),
426
+ )
409
427
  },
410
428
  )
411
429
  }
@@ -450,11 +468,10 @@ export async function compileNitroModule(
450
468
  }
451
469
  }
452
470
  }
453
- // the compiled sources target the app's own declared iOS minimum
454
- const iosDeploymentTarget = readIosAppTarget(
455
- options.projectRoot,
456
- options.iosTarget,
457
- )?.iosDeploymentTarget
471
+ // the compiled sources target the app's own declared iOS minimum, or fallback when building standalone slices
472
+ const iosDeploymentTarget =
473
+ readIosAppTarget(options.projectRoot, options.iosTarget)?.iosDeploymentTarget ??
474
+ options.iosDeploymentTargetFallback
458
475
  if (!iosDeploymentTarget)
459
476
  throw new Error(
460
477
  `Nitro compilation needs the app's Xcode project to declare an iOS deployment target: ${options.projectRoot}`,
@@ -510,6 +527,13 @@ export async function compileNitroModule(
510
527
  )
511
528
  .toString('base64')
512
529
  }
530
+ return { input, collection, packagePath }
531
+ }
532
+
533
+ export async function compileNitroModule(
534
+ options: CompileNitroModuleOptions,
535
+ ): Promise<{ artifact: SwiftArtifact; collection: NitroSourceCollection }> {
536
+ const { input, collection, packagePath } = await prepareNitroCompileInput(options)
513
537
  syncSwiftTree(
514
538
  packagePath,
515
539
  new Map(
@@ -3,7 +3,7 @@
3
3
  // packages/sootsim-swift; an installed peach downloads the prebuilt
4
4
  // distribution from PEACH_SWIFT_ENDPOINT, or the public default when it is
5
5
  // unset, verifies it against the lock this build carries, and unpacks it under
6
- // the peach home
6
+ // the swift cache
7
7
  // (docs/peach/swift/distribution.md). no path here asks Contrast to compile.
8
8
  import fs from 'node:fs'
9
9
  import os from 'node:os'
@@ -28,6 +28,7 @@ import {
28
28
  swiftCompiler,
29
29
  swiftCompilerAsync,
30
30
  swiftCompilerInstallSteps,
31
+ swiftCacheDir,
31
32
  sourceSwiftCheckout,
32
33
  setSwiftLinuxLibraryPath,
33
34
  swiftHostCompilerArchive,
@@ -124,7 +125,11 @@ export async function swiftDistributionRoot(signal?: AbortSignal): Promise<strin
124
125
  // the archive is useless without its compiler, so the toolchain installs
125
126
  // or fails before the download
126
127
  await installSwiftToolchain(lock.release, lock, signal)
127
- const dir = path.join(rnxHomeDir(), 'swift', `${lock.id}-${host}`)
128
+ const dir = path.join(
129
+ swiftCacheDir(),
130
+ 'swift-distributions',
131
+ `${lock.id}-${host}-${lock.hosts[host].sha256}`,
132
+ )
128
133
  let pending = installs.get(dir)
129
134
  if (pending?.controller.signal.aborted) pending = undefined
130
135
  if (!pending) {
@@ -204,7 +204,7 @@ export function collectTurboCompileInput(
204
204
  }
205
205
  }
206
206
 
207
- export async function compileTurboModule(options: {
207
+ export interface CompileTurboModuleOptions {
208
208
  appRoot: string
209
209
  reactNativeRoot: string
210
210
  providers: TurboProvider[]
@@ -217,7 +217,16 @@ export async function compileTurboModule(options: {
217
217
  ) => Promise<void>
218
218
  /** the installed workspace's pods; without them the podspecs' literal source membership applies. */
219
219
  installedPods?: ReadonlyMap<string, TurboInstalledPod>
220
- }): Promise<{ artifact: SwiftArtifact; collection: TurboSourceCollection }> {
220
+ }
221
+
222
+ /** prepares the SwiftPM package input and source collection for TurboModule compilation. */
223
+ export async function prepareTurboCompileInput(
224
+ options: CompileTurboModuleOptions & { iosDeploymentTargetFallback?: string },
225
+ ): Promise<{
226
+ input: SwiftCompileInput
227
+ collection: TurboSourceCollection
228
+ scratch: string
229
+ }> {
221
230
  await prepareTurboSourceDependencies(options.reactNativeRoot)
222
231
  const key = createHash('sha256')
223
232
  .update(options.providers.map(({ root }) => fs.realpathSync(root)).join('\0'))
@@ -405,11 +414,10 @@ export async function compileTurboModule(options: {
405
414
  (await installedWorkspaceInput(root, 'main.swift', options.moduleRoot)).input,
406
415
  )
407
416
  }
408
- // the compiled sources target the app's own declared iOS minimum
409
- const iosDeploymentTarget = readIosAppTarget(
410
- options.projectRoot,
411
- options.iosTarget,
412
- )?.iosDeploymentTarget
417
+ // the compiled sources target the app's own declared iOS minimum, or fallback when building standalone slices
418
+ const iosDeploymentTarget =
419
+ readIosAppTarget(options.projectRoot, options.iosTarget)?.iosDeploymentTarget ??
420
+ options.iosDeploymentTargetFallback
413
421
  if (!iosDeploymentTarget)
414
422
  throw new Error(
415
423
  `TurboModule compilation needs the app's Xcode project to declare an iOS deployment target: ${options.projectRoot}`,
@@ -436,6 +444,13 @@ export async function compileTurboModule(options: {
436
444
  iosDeploymentTarget,
437
445
  dependencies,
438
446
  )
447
+ return { input, collection, scratch }
448
+ }
449
+
450
+ export async function compileTurboModule(
451
+ options: CompileTurboModuleOptions,
452
+ ): Promise<{ artifact: SwiftArtifact; collection: TurboSourceCollection }> {
453
+ const { input, collection, scratch } = await prepareTurboCompileInput(options)
439
454
  const packagePath = path.join(scratch, 'package')
440
455
  syncSwiftTree(
441
456
  packagePath,