peachsim 0.1.1815 → 0.1.1817

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 (97) hide show
  1. package/cli/commands/package.ts +82 -31
  2. package/cli/outbound-endpoints.ts +1 -1
  3. package/cli/packaged-app-launcher.ts +6 -1
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/bundle-channel.cjs +4418 -5235
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/config.mjs +1 -1
  27. package/dist-lib/detox/index.cjs +12 -3
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +3932 -4526
  30. package/dist-lib/expo-swift-metadata.cjs +1 -1
  31. package/dist-lib/expo-swift-metadata.mjs +1 -1
  32. package/dist-lib/home-paths.cjs +1 -1
  33. package/dist-lib/host/bridge-host.cjs +3289 -4175
  34. package/dist-lib/host/fetch-proxy-handler.cjs +12 -3
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  38. package/dist-lib/host/websocket-proxy.cjs +1 -1
  39. package/dist-lib/index.cjs +13 -24
  40. package/dist-lib/jump-to-source-babel.cjs +1 -1
  41. package/dist-lib/jump-to-source-native.cjs +1 -1
  42. package/dist-lib/kotlin-host.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +13 -24
  50. package/dist-lib/native-app-identity-project.cjs +2 -22
  51. package/dist-lib/native-app-identity-project.mjs +2 -22
  52. package/dist-lib/native-app-identity.cjs +1 -1
  53. package/dist-lib/native-app-identity.mjs +1 -1
  54. package/dist-lib/native-firebase-metadata.cjs +1 -1
  55. package/dist-lib/native-firebase-metadata.mjs +1 -1
  56. package/dist-lib/pdfium-raster.cjs +1 -1
  57. package/dist-lib/pdfium-raster.mjs +1 -1
  58. package/dist-lib/plist.cjs +1 -1
  59. package/dist-lib/plist.mjs +1 -1
  60. package/dist-lib/profiles.cjs +1 -1
  61. package/dist-lib/public-brand.cjs +1 -1
  62. package/dist-lib/public-origins-lib-esm.json +24 -24
  63. package/dist-lib/public-origins-lib.json +74 -66
  64. package/dist-lib/react-native-host-modules.cjs +1 -1
  65. package/dist-lib/react-native-host-modules.mjs +1 -1
  66. package/dist-lib/reap-browser.cjs +1 -1
  67. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  68. package/dist-lib/sdk.cjs +1 -1
  69. package/dist-lib/sdk.mjs +1 -1
  70. package/dist-lib/skills.cjs +3793 -4671
  71. package/dist-lib/swift-compile.cjs +216 -242
  72. package/dist-lib/swift-compile.mjs +216 -242
  73. package/dist-lib/swift-package.cjs +1 -1
  74. package/dist-lib/swift-package.mjs +1 -1
  75. package/dist-lib/swift-submit.cjs +1 -1
  76. package/dist-lib/swift-submit.mjs +1 -1
  77. package/dist-lib/swift-toolchain.cjs +1 -1
  78. package/dist-lib/swift.cjs +1 -1
  79. package/dist-lib/vite-swift.cjs +251 -236
  80. package/dist-lib/vite.cjs +12 -3
  81. package/dist-lib/worklet-executable.cjs +1 -1
  82. package/dist-lib/worklet-executable.mjs +1 -1
  83. package/package.json +1 -1
  84. package/src/answeredNativePackages.ts +41 -0
  85. package/src/cli-runtime.ts +2 -9
  86. package/src/expo-discovery-cache.ts +2 -0
  87. package/src/expo-kotlin-host.ts +11 -9
  88. package/src/expo-swift-host.ts +10 -6
  89. package/src/nitro-bundle.ts +8 -6
  90. package/src/nitro-compiler-digest.ts +2 -4
  91. package/src/nitro-superset.lock.json +19 -251
  92. package/src/nitro-superset.ts +59 -63
  93. package/src/react-native-bridge-modules.ts +2 -4
  94. package/src/swift-compile.ts +258 -254
  95. package/src/swift-objc-standin.ts +10 -6
  96. package/src/swift-standins.ts +36 -12
  97. package/src/turbo-source.ts +2 -3
@@ -35,7 +35,7 @@ import {
35
35
  } from './swift-compile'
36
36
  import { emitCxxStandin } from './swift-cxx-standin'
37
37
  import {
38
- IOS_SDK_ID,
38
+ iosSdkId,
39
39
  WASI_EMULATION,
40
40
  WASI_EMULATION_FLAGS,
41
41
  moduleMapHeaders,
@@ -456,7 +456,11 @@ export function binaryHeaderSearchPaths(
456
456
  // the interface header's bytes change with the module, so the staged
457
457
  // directory names the declarations and imports it was cut by, and the
458
458
  // header is written into it on every call. framework identity is relative
459
- // to the artifact so the host's cache location never enters staged paths
459
+ // to the artifact so the host's cache location never enters staged paths.
460
+ // each staged tree is immutable and named by its bytes: clang units name it
461
+ // in their flags, so a stand-in revision that stages the same headers keeps
462
+ // a warm build root's objects, and a concurrent reader never sees a rewrite.
463
+ // a per-revision record finds the tree without restaging.
460
464
  const declaredDigest = createHash('sha256')
461
465
  for (const [framework, { declared: names, imports, sdkHeader }] of declared)
462
466
  declaredDigest
@@ -465,16 +469,16 @@ export function binaryHeaderSearchPaths(
465
469
  .update('\n')
466
470
  .update([...imports].sort().join('\0'))
467
471
  .update(sdkHeader ?? '')
468
- const search = path.join(
472
+ const staging = path.join(
469
473
  root,
470
- 'peach-binary-inputs',
471
- STANDIN_SOURCE_DIGEST.slice(0, 32),
474
+ 'peach-binary-trees',
472
475
  declared.size
473
476
  ? `${artifact.digest.slice(0, 32)}-${declaredDigest.digest('hex').slice(0, 16)}`
474
477
  : artifact.digest.slice(0, 32),
475
478
  )
476
- if (!fs.existsSync(search)) {
477
- const pending = `${search}.${process.pid}.tmp`
479
+ const revision = path.join(staging, 'revisions', STANDIN_SOURCE_DIGEST.slice(0, 32))
480
+ const stageTree = (): string => {
481
+ const pending = path.join(staging, `pending.${process.pid}`)
478
482
  fs.rmSync(pending, { recursive: true, force: true })
479
483
  for (const framework of frameworks) {
480
484
  const swift = declared.get(framework)
@@ -510,13 +514,31 @@ export function binaryHeaderSearchPaths(
510
514
  }
511
515
  : {}),
512
516
  })
517
+ const contents = createHash('sha256')
518
+ for (const relative of fs
519
+ .readdirSync(pending, { recursive: true, encoding: 'utf8' })
520
+ .sort()) {
521
+ const file = path.join(pending, relative)
522
+ contents.update(`${relative}\0`)
523
+ if (fs.statSync(file).isFile()) contents.update(fs.readFileSync(file))
524
+ }
525
+ const name = contents.digest('hex').slice(0, 32)
513
526
  try {
514
- fs.renameSync(pending, search)
527
+ fs.renameSync(pending, path.join(staging, name))
515
528
  } catch (error) {
516
529
  fs.rmSync(pending, { recursive: true, force: true })
517
- if (!fs.existsSync(search)) throw error
530
+ if (!fs.existsSync(path.join(staging, name))) throw error
518
531
  }
532
+ fs.mkdirSync(path.dirname(revision), { recursive: true })
533
+ const record = `${revision}.${process.pid}`
534
+ fs.writeFileSync(record, name)
535
+ fs.renameSync(record, revision)
536
+ return name
519
537
  }
538
+ const search = path.join(
539
+ staging,
540
+ fs.existsSync(revision) ? fs.readFileSync(revision, 'utf8') : stageTree(),
541
+ )
520
542
  for (const [framework, { header }] of declared) {
521
543
  if (header === null) continue
522
544
  const name = path.basename(framework, '.framework')
@@ -527,8 +549,10 @@ export function binaryHeaderSearchPaths(
527
549
  'Headers',
528
550
  `${name}-Swift.h`,
529
551
  )
530
- if (!fs.existsSync(staged) || fs.readFileSync(staged, 'utf8') !== header)
531
- fs.writeFileSync(staged, header)
552
+ if (!fs.existsSync(staged) || fs.readFileSync(staged, 'utf8') !== header) {
553
+ fs.writeFileSync(`${staged}.${process.pid}`, header)
554
+ fs.renameSync(`${staged}.${process.pid}`, staged)
555
+ }
532
556
  }
533
557
  return {
534
558
  frameworks: frameworks.length ? [path.join(search, 'frameworks')] : [],
@@ -2380,7 +2404,7 @@ export function standinGenerationInputs(
2380
2404
  sdk.wasmSdkChecksum,
2381
2405
  swiftModuleDigest(moduleRoot).toString('hex'),
2382
2406
  `sources/${digest}`,
2383
- `ios-sdk/${IOS_SDK_ID}`,
2407
+ `ios-sdk/${iosSdkId()}`,
2384
2408
  ]
2385
2409
  const modules = new Set(
2386
2410
  binaries.flatMap((binary) => {
@@ -12,7 +12,6 @@ import { createHash } from 'node:crypto'
12
12
  import fs from 'node:fs'
13
13
  import path from 'node:path'
14
14
  import { promisify } from 'node:util'
15
- import { PEACH_ANSWERED_NATIVE_PACKAGE_NAMES } from '../../peach-compat/src/generated/supported-native-packages'
16
15
  import { rnxHomeDir } from './home-paths'
17
16
 
18
17
  const execFileAsync = promisify(execFile)
@@ -24,6 +23,7 @@ function codegenSpecRoot(codegen: string): string {
24
23
  const nested = path.join(codegen, 'ReactCodegen')
25
24
  return fs.existsSync(nested) ? nested : codegen
26
25
  }
26
+ import { peachAnsweredNativePackages } from './answeredNativePackages'
27
27
  import {
28
28
  glogSources,
29
29
  nitroDependencyIncludes,
@@ -104,7 +104,6 @@ const CODEGEN_OBJC = /@generated by codegen project: GenerateModuleObjCpp\b/
104
104
  const UNIT = /\.(?:c|cc|cpp|cxx)$/
105
105
  const HEADER = /\.(?:h|hh|hpp|hxx|inl|ipp)$/
106
106
  const OBJC = /\.(?:m|mm)$/
107
- const answeredPackages: ReadonlySet<string> = new Set(PEACH_ANSWERED_NATIVE_PACKAGE_NAMES)
108
107
  // an Objective-C TurboModule: a class whose getTurboModule: returns the C++
109
108
  // object React Native's TurboModule manager installs
110
109
  const OBJC_TURBO =
@@ -886,7 +885,7 @@ export async function discoverTurboProviders(appRoot: string): Promise<TurboProv
886
885
  const providers: TurboProvider[] = []
887
886
  for (const { name, root, podspecPath } of await iosAutolinkedDependencies(appRoot)) {
888
887
  // a package peach-compat answers keeps its answer, Fabric views included.
889
- if (answeredPackages.has(name)) continue
888
+ if (peachAnsweredNativePackages().has(name)) continue
890
889
  // a pod can register Nitro objects and Fabric components independently.
891
890
  const fabric = fabricComponents(root)
892
891
  if (!podspecPath) continue