peachsim 0.1.1845 → 0.1.1847

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 (91) hide show
  1. package/detox/index.ts +14 -4
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/attached-projects.cjs +1 -1
  5. package/dist-lib/auth/shared-session.cjs +1 -1
  6. package/dist-lib/backend-origin.cjs +1 -1
  7. package/dist-lib/beta.cjs +1 -1
  8. package/dist-lib/beta.mjs +1 -1
  9. package/dist-lib/bridge-constants.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.mjs +1 -1
  12. package/dist-lib/bridge-contract.cjs +1 -1
  13. package/dist-lib/bridge-contract.mjs +1 -1
  14. package/dist-lib/bundle-channel.cjs +139 -61
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +1 -1
  17. package/dist-lib/cloud-contract.cjs +1 -1
  18. package/dist-lib/cloud-contract.mjs +1 -1
  19. package/dist-lib/cloud-test-args.cjs +1 -1
  20. package/dist-lib/cloud-test-args.mjs +1 -1
  21. package/dist-lib/cloud.cjs +1 -1
  22. package/dist-lib/cloud.mjs +1 -1
  23. package/dist-lib/config.cjs +1 -1
  24. package/dist-lib/config.mjs +1 -1
  25. package/dist-lib/detox/index.cjs +14 -6
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/expo-swift-bundle.cjs +45 -23
  28. package/dist-lib/expo-swift-metadata.cjs +1 -1
  29. package/dist-lib/expo-swift-metadata.mjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +138 -60
  32. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  33. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  35. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  36. package/dist-lib/host/websocket-proxy.cjs +1 -1
  37. package/dist-lib/index.cjs +43 -19
  38. package/dist-lib/jump-to-source-babel.cjs +1 -1
  39. package/dist-lib/jump-to-source-native.cjs +1 -1
  40. package/dist-lib/kotlin-host.cjs +1 -1
  41. package/dist-lib/menu.cjs +1 -1
  42. package/dist-lib/menu.mjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  45. package/dist-lib/metro-production-bundle.cjs +1 -1
  46. package/dist-lib/metro-production-bundle.mjs +1 -1
  47. package/dist-lib/metro.cjs +43 -19
  48. package/dist-lib/native-app-identity-project.cjs +39 -15
  49. package/dist-lib/native-app-identity-project.mjs +39 -15
  50. package/dist-lib/native-app-identity.cjs +1 -1
  51. package/dist-lib/native-app-identity.mjs +1 -1
  52. package/dist-lib/native-firebase-metadata.cjs +1 -1
  53. package/dist-lib/native-firebase-metadata.mjs +1 -1
  54. package/dist-lib/pdfium-raster.cjs +1 -1
  55. package/dist-lib/pdfium-raster.mjs +1 -1
  56. package/dist-lib/plist.cjs +1 -1
  57. package/dist-lib/plist.mjs +1 -1
  58. package/dist-lib/profiles.cjs +1 -1
  59. package/dist-lib/public-brand.cjs +1 -1
  60. package/dist-lib/public-origins-lib-esm.json +24 -24
  61. package/dist-lib/public-origins-lib.json +53 -53
  62. package/dist-lib/react-native-host-modules.cjs +1 -1
  63. package/dist-lib/react-native-host-modules.mjs +1 -1
  64. package/dist-lib/reap-browser.cjs +1 -1
  65. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  66. package/dist-lib/sdk.cjs +1 -1
  67. package/dist-lib/sdk.mjs +1 -1
  68. package/dist-lib/skills.cjs +143 -65
  69. package/dist-lib/swift-compile.cjs +8 -3
  70. package/dist-lib/swift-compile.mjs +7 -3
  71. package/dist-lib/swift-package.cjs +1 -1
  72. package/dist-lib/swift-package.mjs +1 -1
  73. package/dist-lib/swift-submit.cjs +1 -1
  74. package/dist-lib/swift-submit.mjs +1 -1
  75. package/dist-lib/swift-toolchain.cjs +1 -1
  76. package/dist-lib/swift.cjs +1 -1
  77. package/dist-lib/vite-swift.cjs +28 -13
  78. package/dist-lib/vite.cjs +2 -2
  79. package/dist-lib/worklet-executable.cjs +1 -1
  80. package/dist-lib/worklet-executable.mjs +1 -1
  81. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +2 -1
  82. package/dist-types/packages/peach-engine/src/settings/duo-fold-bus.d.ts +3 -0
  83. package/package.json +1 -1
  84. package/runtime-companion.json +1 -1
  85. package/src/expo-swift-host.ts +35 -18
  86. package/src/native-firebase-config.ts +3 -3
  87. package/src/swift-compile.ts +11 -3
  88. package/src/swift-host.ts +5 -1
  89. package/src/turbo-codegen-intake.ts +41 -6
  90. package/src/turbo-source.ts +56 -24
  91. package/src/xcode-project.ts +51 -18
@@ -192,6 +192,8 @@ export interface XcodeAppTarget extends XcodeModuleTarget {
192
192
  localPackageDirs: string[]
193
193
  /** prebuilt frameworks and library module-map directories, at their declared paths. */
194
194
  binaryFrameworks: { name: string; path: string | null }[]
195
+ /** sdk frameworks the link names: OTHER_LDFLAGS -framework and sdk entries in frameworks phases. */
196
+ sdkFrameworks: string[]
195
197
  /** workspace pins, or local package locks when the workspace has no lock. */
196
198
  packageResolved: string[]
197
199
  /** every application target in the workspace, for a chooser. */
@@ -271,12 +273,13 @@ function readXcconfig(file: string, read: string[]): Record<string, string> {
271
273
  return settings
272
274
  }
273
275
 
274
- // one level's settings as xcode applies them: a key whose conditions all
275
- // match the build overrides the unconditional key; others never apply.
276
+ // one level's settings as xcode applies them: the unconditional keys, then
277
+ // the keys whose conditions all match the build, whose `$(inherited)` reads
278
+ // the unconditional key of the same level; others never apply.
276
279
  function applyConditions(
277
280
  raw: Record<string, string>,
278
281
  configuration: string,
279
- ): Record<string, string> {
282
+ ): [Record<string, string>, Record<string, string>] {
280
283
  const plain: Record<string, string> = {}
281
284
  const conditional: Record<string, string> = {}
282
285
  for (const [key, value] of Object.entries(raw)) {
@@ -301,7 +304,7 @@ function applyConditions(
301
304
  )
302
305
  if (matches) conditional[key.slice(0, bracket)] = value
303
306
  }
304
- return { ...plain, ...conditional }
307
+ return [plain, conditional]
305
308
  }
306
309
 
307
310
  // xcode's build setting operators, as measured against xcodebuild.
@@ -676,8 +679,8 @@ function targetSettings(
676
679
  const fromFile = baseFile ? readXcconfig(baseFile, read) : {}
677
680
  xcconfigs.push(...read)
678
681
  return [
679
- applyConditions(fromFile, name),
680
- applyConditions(
682
+ ...applyConditions(fromFile, name),
683
+ ...applyConditions(
681
684
  Object.fromEntries(
682
685
  Object.entries(own).flatMap(([key, value]) =>
683
686
  typeof value === 'string'
@@ -1538,7 +1541,7 @@ export class NativeAppTargetSelectionError extends Error {}
1538
1541
  export function selectIosAppTarget(
1539
1542
  projectRoot: string,
1540
1543
  iosTarget?: string,
1541
- ): { xcodeproj: string; target: string } | null {
1544
+ ): { xcodeproj: string; target: string; workspace: string | null } | null {
1542
1545
  // react native's own repo keeps its xcode project beside package.json
1543
1546
  const nested = path.join(projectRoot, 'ios')
1544
1547
  const iosRoot = fs.existsSync(nested) ? nested : projectRoot
@@ -1548,21 +1551,34 @@ export function selectIosAppTarget(
1548
1551
  entries.some((entry) => entry.isDirectory() && entry.name.endsWith('.xcodeproj'))
1549
1552
  ? entries
1550
1553
  .filter((entry) => entry.isDirectory() && entry.name.endsWith('.xcodeproj'))
1551
- .map((entry) => path.join(iosRoot, entry.name))
1554
+ .map((entry) => ({
1555
+ xcodeproj: path.join(iosRoot, entry.name),
1556
+ workspace: null,
1557
+ }))
1552
1558
  : entries
1553
1559
  .filter((entry) => entry.isDirectory() && entry.name.endsWith('.xcworkspace'))
1554
- .flatMap((entry) => workspaceReferences(path.join(iosRoot, entry.name)))
1560
+ .flatMap((entry): { xcodeproj: string; workspace: string | null }[] => {
1561
+ const workspace = path.join(iosRoot, entry.name)
1562
+ return workspaceReferences(workspace).map((xcodeproj) => ({
1563
+ xcodeproj,
1564
+ workspace,
1565
+ }))
1566
+ })
1555
1567
  .filter(
1556
- (xcodeproj) =>
1568
+ ({ xcodeproj }) =>
1557
1569
  xcodeproj.endsWith('.xcodeproj') &&
1558
1570
  !xcodeproj.split(path.sep).includes('Pods') &&
1559
1571
  fs.existsSync(xcodeproj),
1560
1572
  )
1561
1573
  .filter(
1562
- (xcodeproj) =>
1574
+ ({ xcodeproj }) =>
1563
1575
  listXcodeAppTargets(xcodeproj, { requireSources: false }).length > 0,
1564
1576
  )
1565
- ).map((xcodeproj) => ({ xcodeproj, name: path.basename(xcodeproj) }))
1577
+ ).map(({ xcodeproj, workspace }) => ({
1578
+ xcodeproj,
1579
+ workspace,
1580
+ name: path.basename(xcodeproj),
1581
+ }))
1566
1582
  if (projects.length === 0) return null
1567
1583
  if (projects.length > 1 && !iosTarget) {
1568
1584
  throw new NativeAppTargetSelectionError(
@@ -1610,7 +1626,7 @@ export function selectIosAppTarget(
1610
1626
  }
1611
1627
  if (!appTargets.includes(target))
1612
1628
  throw new Error(`native app identity has no application target ${target}`)
1613
- return { xcodeproj, target }
1629
+ return { xcodeproj, target, workspace: project.workspace }
1614
1630
  }
1615
1631
 
1616
1632
  // xcode keeps the pins in the workspace it opened: the named one, or the project's own
@@ -2672,7 +2688,14 @@ export function readXcodeAppTarget(
2672
2688
  const binaryFrameworks = new Map<string, string | null>()
2673
2689
  const searchedFrameworks = new Map<string, string>()
2674
2690
  const frameworkSearchDirectories = new Set<string>()
2691
+ const sdkFrameworks = new Set<string>()
2675
2692
  for (const { ref, settings } of builtTargets) {
2693
+ const ldflags = settingList(settings('OTHER_LDFLAGS'))
2694
+ ldflags.forEach((flag, index) => {
2695
+ const name = ldflags[index + 1]
2696
+ if ((flag === '-framework' || flag === '-weak_framework') && name)
2697
+ sdkFrameworks.add(name)
2698
+ })
2676
2699
  const absolute = (raw: string) =>
2677
2700
  path.resolve(ref.project.projectDir, expand(raw, settings))
2678
2701
  const requested = options.nativeModules
@@ -2820,14 +2843,19 @@ export function readXcodeAppTarget(
2820
2843
  const rawPath = str(file?.path) ?? ''
2821
2844
  const name = /([^/]+)\.(xc)?framework$/.exec(rawPath)?.[1]
2822
2845
  if (file?.isa !== 'PBXFileReference' || !name) continue
2846
+ // a path into the sdk's own frameworks folder is the sdk's own
2847
+ // however it is rooted: xcode links -framework <name> from the sdk
2848
+ // and a stale group-relative path to it contributes nothing.
2823
2849
  if (
2824
- tree === 'BUILT_PRODUCTS_DIR' ||
2825
2850
  tree === 'SDKROOT' ||
2851
+ /\/System\/Library\/Frameworks\/[^/]+$/.test(`/${rawPath}`)
2852
+ ) {
2853
+ sdkFrameworks.add(name)
2854
+ continue
2855
+ }
2856
+ if (
2857
+ tree === 'BUILT_PRODUCTS_DIR' ||
2826
2858
  tree === 'DEVELOPER_DIR' ||
2827
- // a path into the sdk's own frameworks folder is the sdk's own
2828
- // however it is rooted: xcode links -framework <name> from the sdk
2829
- // and a stale group-relative path to it contributes nothing.
2830
- /\/System\/Library\/Frameworks\/[^/]+$/.test(`/${rawPath}`) ||
2831
2859
  // a target in the workspace builds it, so it exists only after that build
2832
2860
  byProduct.has(path.basename(rawPath))
2833
2861
  )
@@ -2940,6 +2968,11 @@ export function readXcodeAppTarget(
2940
2968
  binaryFrameworks: [...binaryFrameworks]
2941
2969
  .map(([name, file]) => ({ name, path: file }))
2942
2970
  .sort((left, right) => left.name.localeCompare(right.name)),
2971
+ sdkFrameworks: [...sdkFrameworks]
2972
+ .filter(
2973
+ (name) => !binaryFrameworks.has(name) && !byProduct.has(`${name}.framework`),
2974
+ )
2975
+ .sort(),
2943
2976
  packageResolved,
2944
2977
  appTargets: appTargetNames,
2945
2978
  configuration,