peachsim 0.1.2679 → 0.1.2680

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 (135) 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 +740 -162
  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 +2 -2
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-KT4EYLSJ.mjs → acorn-KFRNGPIS.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-BHQ3JLKY.mjs → chunk-2DSJ4Y2B.mjs} +4 -4
  28. package/dist-lib/esm-chunks/{chunk-FLEDVCBF.mjs → chunk-54DXR7XC.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-4MQNNSXS.mjs → chunk-5ZUDE2OE.mjs} +1 -1
  30. package/dist-lib/esm-chunks/{chunk-22IVJ37E.mjs → chunk-63IRSGUP.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-WSX6WDGU.mjs → chunk-6FMJ3RGV.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-HSSAEZKK.mjs → chunk-AKMQQCL4.mjs} +6 -6
  33. package/dist-lib/esm-chunks/{chunk-I77TXXX6.mjs → chunk-BRJ7ARFB.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-BMPYVWFP.mjs → chunk-BZZUMB6S.mjs} +8 -7
  35. package/dist-lib/esm-chunks/{chunk-TJ5Y26RK.mjs → chunk-D7K24QPS.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-YGGXAYBE.mjs → chunk-HTM32XYI.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-4QDKSAM6.mjs → chunk-I567ROA6.mjs} +16 -16
  38. package/dist-lib/esm-chunks/{chunk-7VK6K2OI.mjs → chunk-ISLJJHL6.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-JK6VGS54.mjs → chunk-MA526IJY.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-DPFS4TZQ.mjs → chunk-NDNSEMKC.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-WLJU7OX2.mjs → chunk-RXNQMOOQ.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-M4IBIRSF.mjs → chunk-S2R5CB3W.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-4X7TCSFW.mjs → chunk-SAKCEYPB.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-XA22MMUJ.mjs → chunk-SZLZ7MYO.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-4ZQP7VPQ.mjs → chunk-TTFIUXYS.mjs} +5 -5
  46. package/dist-lib/esm-chunks/{chunk-AIMGU6I4.mjs → chunk-UASVIFF4.mjs} +2 -2
  47. package/dist-lib/esm-chunks/{chunk-UOT25QCP.mjs → chunk-UTPHWDOY.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-FA5V3ZBF.mjs → chunk-X6TNJRLY.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-DGARJVZC.mjs → chunk-YIBGV5BP.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-4T5622XC.mjs → chunk-YOSTYBQ5.mjs} +3 -3
  51. package/dist-lib/esm-chunks/{metro-layout-parser-NZ5LDDDY.mjs → metro-layout-parser-6ETCKA7E.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-YUCWJYTO.mjs → swift-package-prebuilt-GTSH3CYC.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-AJD2DGDE.mjs → swift-sdk-app-module-PUPJSKNY.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-7SWUP4QR.mjs → swift-sdk-image-YPS6TJTZ.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-RISXYQ6A.mjs → swift-sdk-image-producer-5NMRH53W.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +5235 -923
  57. package/dist-lib/expo-swift-metadata.cjs +2 -2
  58. package/dist-lib/expo-swift-metadata.mjs +8 -8
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +97 -38
  61. package/dist-lib/host/fetch-proxy-handler.cjs +7 -7
  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 +75 -65
  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 +98 -38
  95. package/dist-lib/swift-compile.cjs +5 -4
  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/dist-types/packages/peach-engine/src/engine/native-image-pipeline.d.ts +3 -1
  123. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -1
  124. package/dist-types/packages/peach-engine/src/render-worker/webgpu-frame-transaction.d.ts +2 -1
  125. package/package.json +1 -1
  126. package/runtime-companion.json +1 -1
  127. package/src/expo-swift-bundle.ts +2 -7
  128. package/src/expo-swift-host.ts +20 -3
  129. package/src/expoSwiftContract.ts +9 -0
  130. package/src/native-bundles.ts +6 -0
  131. package/src/nitro-bundle.ts +5 -2
  132. package/src/swift-compile.ts +1 -1
  133. package/src/swift-host.ts +16 -0
  134. package/src/swift-sdk-surface.ts +3 -4
  135. package/src/turbo-source.ts +61 -43
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2679 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2680 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
 
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2679 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2680 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2679 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2680 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __commonJS = (cb, mod) => function __require() {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2679 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2680 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
 
4
4
  // ../../node_modules/valibot/dist/index.cjs
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2679 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2680 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2679 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2680 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2679 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2680 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,12 +1,12 @@
1
- /*! peach v0.1.2679 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2680 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  parse
4
- } from "./esm-chunks/chunk-DGARJVZC.mjs";
4
+ } from "./esm-chunks/chunk-YIBGV5BP.mjs";
5
5
  import {
6
6
  __privateAdd,
7
7
  __privateGet,
8
8
  __publicField
9
- } from "./esm-chunks/chunk-M4IBIRSF.mjs";
9
+ } from "./esm-chunks/chunk-S2R5CB3W.mjs";
10
10
 
11
11
  // src/worklet-kernel.ts
12
12
  var Unsupported = class extends Error {
@@ -364,7 +364,9 @@ export declare const enum ImageFrameOp {
364
364
  ReleaseSnapshot = 16,
365
365
  TrimSnapshots = 17,
366
366
  ReadSnapshot = 18,
367
- ForgetSnapshot = 19
367
+ ForgetSnapshot = 19,
368
+ PendingBitmaps = 20,
369
+ SettleBitmaps = 21
368
370
  }
369
371
  export declare function imageFrameState(op: ImageFrameOp, key: string, value: number, hasValue: boolean): number;
370
372
  export declare function imageFrameKeys(op: ImageFrameOp.Motions | ImageFrameOp.Channels | ImageFrameOp.TrimSnapshots, value?: number): string[];
@@ -9,7 +9,7 @@ import type { WebGpuReadbackKind } from './webgpu-readback-scheduler.d.ts';
9
9
  import type { WebGpuWireServer, WebGpuWireServerOptions } from './webgpu-wire-server.d.ts';
10
10
  export type CompositorGpuBackendKind = 'graphite' | 'ganesh';
11
11
  export type CompositorFrameKind = 'display' | 'capture' | 'auxiliary';
12
- export type GpuFrameSource = 'display-frame' | 'demand-frame' | 'forced-display' | 'step-frame' | 'capture-batch' | 'capture-single' | 'prewarm-initial' | 'ambient-glow-sample';
12
+ export type GpuFrameSource = 'display-frame' | 'demand-frame' | 'forced-display' | 'step-frame' | 'capture-batch' | 'capture-single' | 'prewarm-initial' | 'ambient-glow-sample' | 'live-bitmap-upload';
13
13
  export interface CompositorFrameOptions {
14
14
  readonly kind: CompositorFrameKind;
15
15
  readonly source: GpuFrameSource;
@@ -1,6 +1,6 @@
1
1
  import type { GraphiteDeviceContext, GraphiteOutstandingSubmissionPoll, GraphiteOwnedBuffer, GraphiteOwnedTexture, WebGpuErrorPort, WebGpuCommandEncoderPort, WebGpuExternalImageSourcePort, WebGpuExtent3DPort, WebGpuImageCopyBufferPort, WebGpuImageCopyTexturePort, WebGpuOrigin3DPort } from './canvaskit-webgpu.d.ts';
2
2
  export type WebGpuFrameTransactionKind = 'display' | 'capture' | 'auxiliary';
3
- export type WebGpuFrameTransactionSource = 'display-frame' | 'demand-frame' | 'forced-display' | 'step-frame' | 'capture-batch' | 'capture-single' | 'prewarm-initial' | 'ambient-glow-sample';
3
+ export type WebGpuFrameTransactionSource = 'display-frame' | 'demand-frame' | 'forced-display' | 'step-frame' | 'capture-batch' | 'capture-single' | 'prewarm-initial' | 'ambient-glow-sample' | 'live-bitmap-upload';
4
4
  export interface WebGpuFrameTransactionOptions {
5
5
  readonly kind: WebGpuFrameTransactionKind;
6
6
  readonly source: WebGpuFrameTransactionSource;
@@ -109,6 +109,7 @@ export interface WebGpuFrameTransactionSourceCounters {
109
109
  readonly captureSingle: number;
110
110
  readonly prewarmInitial: number;
111
111
  readonly ambientGlowSample: number;
112
+ readonly liveBitmapUpload: number;
112
113
  readonly unclassified: number;
113
114
  }
114
115
  export interface WebGpuFrameTransactionMeasurementCounters {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2679",
3
+ "version": "0.1.2680",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"6b305f7fe225bc6b6af5a54b82a2417ee532d3e755609f71fbde91dd4624a6d1","file":"node/cli-6b305f7fe225bc6b6af5a54b82a2417ee532d3e755609f71fbde91dd4624a6d1.cjs"}
1
+ {"abi":1,"sha256":"daf162d4a4e16da33424ba3f1895db477c3561a9d74f1f77b381d8f6af391475","file":"node/cli-daf162d4a4e16da33424ba3f1895db477c3561a9d74f1f77b381d8f6af391475.cjs"}
@@ -1,7 +1,7 @@
1
1
  // release publishers use the same app compiler as local launches, then carry
2
2
  // its immutable native assets beside the javascript bundle.
3
3
  import { compileExpoSwiftModules } from './expo-swift-host'
4
- import { swiftIcuBundleAsset } from './swift-icu'
4
+ import { compiledModuleAssets } from './nitro-bundle'
5
5
  import type {
6
6
  ExpoSwiftCompilationResult,
7
7
  ExpoSwiftPreparationOptions,
@@ -22,12 +22,7 @@ export async function buildExpoSwiftBundle(
22
22
  '',
23
23
  async (artifact, signal) => {
24
24
  signal.throwIfAborted()
25
- assets.push({
26
- path: `__peach/swift/${artifact.hash}.wasm`,
27
- bytes: artifact.bytes,
28
- contentType: 'application/wasm',
29
- })
30
- if ('gzip' in artifact.icu) assets.push(await swiftIcuBundleAsset(artifact.icu))
25
+ for (const asset of await compiledModuleAssets(artifact)) assets.push(asset)
31
26
  },
32
27
  { oneSDK },
33
28
  )
@@ -64,6 +64,7 @@ import {
64
64
  icuUrl,
65
65
  installedWorkspaceInput,
66
66
  withXcodeProject,
67
+ prepareSwiftSdkEntryAssets,
67
68
  projectFor,
68
69
  serveSwiftPackageAsset,
69
70
  sourceContentStamp,
@@ -655,6 +656,9 @@ function retarget(cached: PreparedEntry, base: string): ExpoSwiftCompilationResu
655
656
  for (const module of result.modules) {
656
657
  module.url = replaceBase(module.url, cached.base, base)
657
658
  module.icuUrl = replaceBase(module.icuUrl, cached.base, base)
659
+ if (module.sdkUrl) module.sdkUrl = replaceBase(module.sdkUrl, cached.base, base)
660
+ if (module.sdkBindingUrl)
661
+ module.sdkBindingUrl = replaceBase(module.sdkBindingUrl, cached.base, base)
658
662
  }
659
663
  return result
660
664
  }
@@ -790,10 +794,22 @@ function enrichInstalledUnits(
790
794
  map(file),
791
795
  ]),
792
796
  )
793
- // frameworks supplied by the runtime or the React Native provider still publish headers.
797
+ // frameworks supplied by the runtime or the React Native provider (and their
798
+ // transitive dependencies, such as ExpoModulesJSI under ExpoModulesCore) still
799
+ // publish headers even though their targets are not compiled into each unit.
800
+ const publishedFrameworkTargets = new Set<string>([...provided, ...reactTargets])
801
+ const frameworkQueue = [...publishedFrameworkTargets]
802
+ while (frameworkQueue.length > 0) {
803
+ const name = frameworkQueue.pop()!
804
+ for (const dependency of importedTargets.get(name) ?? []) {
805
+ if (publishedFrameworkTargets.has(dependency)) continue
806
+ publishedFrameworkTargets.add(dependency)
807
+ frameworkQueue.push(dependency)
808
+ }
809
+ }
794
810
  for (const target of input.nativeTargets ?? []) {
795
811
  const runtimeModule = provided.has(target.name)
796
- if (!runtimeModule && !reactTargets.has(target.name)) continue
812
+ if (!publishedFrameworkTargets.has(target.name)) continue
797
813
  const swift = runtimeModule ? swiftModuleInterface(moduleRoot, target.name) : null
798
814
  const refineClangTypes = clangTypeOwnership(moduleRoot, target.name)
799
815
  const interfaceName = `${target.name}-Swift.h`
@@ -2801,7 +2817,6 @@ async function compileExpoSwiftModulesTraced(
2801
2817
  linkedLibraries.set(name, library)
2802
2818
  }
2803
2819
  projectFor(packagePath).oneModule = false
2804
- projectFor(packagePath).standalone = true
2805
2820
  projectFor(packagePath).optimize = true
2806
2821
  projectFor(packagePath).staticClangTargets = provider?.staticClangTargets
2807
2822
  projectFor(packagePath).binaryModules = Object.fromEntries([
@@ -3211,10 +3226,12 @@ async function compileExpoSwiftModulesTraced(
3211
3226
  }
3212
3227
  if (artifact) {
3213
3228
  signal.throwIfAborted()
3229
+ const sdkAssets = await prepareSwiftSdkEntryAssets(base, artifact)
3214
3230
  await publishArtifact?.(artifact, signal)
3215
3231
  result.modules.push({
3216
3232
  namespaces: linked.map((unit) => unit.moduleId),
3217
3233
  url: `${base}/__peach/swift/${artifact.hash}.wasm`,
3234
+ ...sdkAssets,
3218
3235
  hash: artifact.hash,
3219
3236
  icuUrl: icuUrl(base, artifact),
3220
3237
  rootId: `${key}/Expo`,
@@ -58,6 +58,8 @@ export interface ExpoSwiftSourceUnit {
58
58
  export interface ExpoSwiftCompiledModule {
59
59
  namespaces: string[]
60
60
  url: string
61
+ sdkUrl?: string
62
+ sdkBindingUrl?: string
61
63
  hash: string
62
64
  icuUrl: string
63
65
  rootId: string
@@ -118,6 +120,13 @@ export function isExpoSwiftCompilationResult(
118
120
  artifact.namespaces.length === 0 ||
119
121
  !artifact.namespaces.every((namespace) => remaining.delete(namespace)) ||
120
122
  typeof artifact.url !== 'string' ||
123
+ !(
124
+ (artifact.sdkUrl === undefined && artifact.sdkBindingUrl === undefined) ||
125
+ (typeof artifact.sdkUrl === 'string' &&
126
+ artifact.sdkUrl.length > 0 &&
127
+ typeof artifact.sdkBindingUrl === 'string' &&
128
+ artifact.sdkBindingUrl.length > 0)
129
+ ) ||
121
130
  typeof artifact.hash !== 'string' ||
122
131
  typeof artifact.icuUrl !== 'string' ||
123
132
  typeof artifact.rootId !== 'string' ||
@@ -54,6 +54,8 @@ export async function buildIosSwiftBundles(
54
54
  url: linked.url,
55
55
  hash: linked.hash,
56
56
  icuUrl: linked.icuUrl,
57
+ ...(linked.sdkUrl ? { sdkUrl: linked.sdkUrl } : {}),
58
+ ...(linked.sdkBindingUrl ? { sdkBindingUrl: linked.sdkBindingUrl } : {}),
57
59
  rootId: `${linked.rootId.split('/')[0]}/OneSDK`,
58
60
  bundleFiles: linked.bundleFiles ?? {},
59
61
  modules: oneSDK.modules,
@@ -152,6 +154,10 @@ export function insertNativeBundleFooters(
152
154
  ...artifact,
153
155
  url: served(artifact.url),
154
156
  icuUrl: served(artifact.icuUrl),
157
+ ...(artifact.sdkUrl ? { sdkUrl: served(artifact.sdkUrl) } : {}),
158
+ ...(artifact.sdkBindingUrl
159
+ ? { sdkBindingUrl: served(artifact.sdkBindingUrl) }
160
+ : {}),
155
161
  })),
156
162
  }
157
163
  source = insertExpoSwiftFooter(source, metadata.expoSwift)
@@ -10,9 +10,9 @@ import { compileNitroModule } from './nitro-compile'
10
10
  import { swiftDistributionRoot } from './swift-distribution'
11
11
  import {
12
12
  icuUrl,
13
+ prepareSwiftSdkEntryAssets,
13
14
  swiftArtifactAssets,
14
15
  swiftArtifactIsAvailable,
15
- swiftSdkEntryAssets,
16
16
  type SwiftArtifact,
17
17
  } from './swift-host'
18
18
  import type { NitroBuildConfiguration, NitroCompiledModule } from './nitroContract'
@@ -107,7 +107,10 @@ export async function compileNitroApp(
107
107
  export async function compiledModuleAssets(
108
108
  artifact: SwiftArtifact,
109
109
  ): Promise<CompiledModuleAsset[]> {
110
- const assets = await swiftArtifactAssets(artifact, swiftSdkEntryAssets('', artifact))
110
+ const assets = await swiftArtifactAssets(
111
+ artifact,
112
+ await prepareSwiftSdkEntryAssets('', artifact),
113
+ )
111
114
  return [...assets].map(([address, asset]) => ({ path: address.slice(1), ...asset }))
112
115
  }
113
116
 
@@ -380,7 +380,7 @@ const SWIFTPM_NOISE =
380
380
  /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '--build-system native' has been deprecated)/
381
381
 
382
382
  function swiftCompilerJobs(): number {
383
- return Math.min(32, swiftBuildJobs(), Math.max(1, Math.floor(os.totalmem() / 2 ** 31)))
383
+ return Math.min(64, swiftBuildJobs(), Math.max(1, Math.floor(os.totalmem() / 2 ** 31)))
384
384
  }
385
385
 
386
386
  // swiftpm hashes the entire process environment into its build plan signature,
package/src/swift-host.ts CHANGED
@@ -4282,6 +4282,22 @@ export function swiftSdkEntryAssets(
4282
4282
  }
4283
4283
  }
4284
4284
 
4285
+ export async function prepareSwiftSdkEntryAssets(
4286
+ origin: string,
4287
+ image: SwiftArtifact,
4288
+ sdkDigest = image.sdk?.sha256,
4289
+ ) {
4290
+ if (image.sdk && !image.hostedSdk) {
4291
+ const published = publishedSwiftSdk(image.sdk.sha256)
4292
+ if (published?.dataPlan) {
4293
+ const { fetchSwiftSdkDataPlan } = await import('./swift-sdk-later-data')
4294
+ const plan = await fetchSwiftSdkDataPlan(published)
4295
+ if (plan) await splitSdkBinding(image.sdk, published.dataPlan, plan)
4296
+ }
4297
+ }
4298
+ return swiftSdkEntryAssets(origin, image, sdkDigest)
4299
+ }
4300
+
4285
4301
  // each app opened on an sdk image profiles its startup once; the split serves them all
4286
4302
  function swiftSdkStartup(
4287
4303
  sdk: SwiftSdkModuleAsset,
@@ -54,10 +54,9 @@ export function swiftBuildJobs(): number {
54
54
  process.env.TM_EXEC_ADMITTED === '1' && process.env.LINUX_BUILD_SCOPE
55
55
  ? Number(process.env.TM_EXEC_LINUX_MEMORY_MAX)
56
56
  : NaN
57
- const memoryJobs =
58
- Number.isSafeInteger(memory) && memory > 0
59
- ? Math.max(1, Math.floor(memory / (2 * 1024 ** 3)))
60
- : 8
57
+ const effectiveMemory =
58
+ Number.isSafeInteger(memory) && memory > 0 ? memory : os.totalmem()
59
+ const memoryJobs = Math.max(1, Math.floor(effectiveMemory / (2 * 1024 ** 3)))
61
60
  return Math.min(cores, memoryJobs)
62
61
  }
63
62
 
@@ -401,6 +401,22 @@ function walkFiles(root: string, base: string, into: Set<string>): void {
401
401
  }
402
402
 
403
403
  const podspecList = podspecAttribute
404
+ const reactNativePods = new Set([
405
+ 'React',
406
+ 'ReactCommon',
407
+ 'ReactCodegen',
408
+ 'ReactNativeDependencies',
409
+ 'hermes-engine',
410
+ 'FBLazyVector',
411
+ 'DoubleConversion',
412
+ 'glog',
413
+ 'boost',
414
+ 'fmt',
415
+ 'fast_float',
416
+ 'Yoga',
417
+ ])
418
+ const reactNativePod = (name: string) =>
419
+ reactNativePods.has(name) || name.startsWith('React-') || name.startsWith('RCT')
404
420
 
405
421
  /** the external pods a podspec depends on; "subspecs" holds every requested subspec path across its dependency lines, "" for the pod itself. */
406
422
  function podspecDependencies(
@@ -422,25 +438,7 @@ function podspecDependencies(
422
438
  )
423
439
  throw new Error(`${pod.file}: invalid requirements for ${name}`)
424
440
  const [root, ...subspec] = name.split('/')
425
- if (
426
- root === pod.name ||
427
- root === 'React' ||
428
- root === 'React-Core' ||
429
- root === 'ReactCommon' ||
430
- root === 'ReactCodegen' ||
431
- root === 'ReactNativeDependencies' ||
432
- root === 'hermes-engine' ||
433
- root!.startsWith('React-') ||
434
- root!.startsWith('RCT') ||
435
- root === 'FBLazyVector' ||
436
- root === 'DoubleConversion' ||
437
- root === 'glog' ||
438
- root === 'boost' ||
439
- root === 'fmt' ||
440
- root === 'fast_float' ||
441
- root === 'Yoga'
442
- )
443
- continue
441
+ if (root === pod.name || reactNativePod(root!)) continue
444
442
  // every declaration of a pod must hold: CocoaPods intersects their requirements
445
443
  const dep = deps.get(root!) ?? { name: root!, requirements: [], subspecs: [] }
446
444
  dep.requirements.push(...requirements)
@@ -1279,7 +1277,7 @@ export async function collectTurboSources(options: {
1279
1277
  ...folly.defines,
1280
1278
  ]
1281
1279
  const defines = [...baseDefines, 'RCT_NEW_ARCH_ENABLED=1', 'RCT_REMOVE_LEGACY_ARCH=1']
1282
- const target = (name: string, dependencies: string[]) => ({
1280
+ const target = (name: string, dependencies: string[], cxxDefines = defines) => ({
1283
1281
  name,
1284
1282
  path: targetPath(name),
1285
1283
  executable: false,
@@ -1290,7 +1288,7 @@ export async function collectTurboSources(options: {
1290
1288
  kind: 'target' as const,
1291
1289
  name: dependency,
1292
1290
  })),
1293
- cxxDefines: defines,
1291
+ cxxDefines,
1294
1292
  })
1295
1293
  const result: TurboSourceCollection = {
1296
1294
  coreMode: 'turbo-cxx',
@@ -1343,6 +1341,9 @@ export async function collectTurboSources(options: {
1343
1341
  installedPods: true,
1344
1342
  }).frameworks
1345
1343
  : []
1344
+ const installedByIdentity = new Map(
1345
+ installedTargets.map((target) => [target.targetIdentity, target]),
1346
+ )
1346
1347
  // a file the pod compiles with its own flags also keeps the pod's generated
1347
1348
  // prefix header, which imports UIKit for every unit as GCC_PREFIX_HEADER does.
1348
1349
  const fileFlags = new Map(
@@ -1552,6 +1553,22 @@ export async function collectTurboSources(options: {
1552
1553
  // header lookup takes regular files only, so <ios> passes over an ios directory
1553
1554
  const isHeaderFile = (file: string) =>
1554
1555
  fs.statSync(file, { throwIfNoEntry: false })?.isFile() ?? false
1556
+ const installedDependencyHeader = (from: Scan, root: string, relative: string) => {
1557
+ const provider = podHeaders.get(from.targetName)
1558
+ const providerFile = provider
1559
+ ? relativeInside(provider.root, path.join(root, relative))
1560
+ : null
1561
+ if (provider && providerFile !== null)
1562
+ return original(from.targetName, provider.label, provider.root, providerFile, false)
1563
+ // the workspace is a copy of the app. preserve the pod-relative identity
1564
+ // when a header arrives through a cocoapods search path or header map.
1565
+ for (const pod of installedHeaderPods) {
1566
+ const directory = relativeInside(options.appRoot, pod.root)
1567
+ const file = directory === null ? null : relativeInside(directory, relative)
1568
+ if (file !== null) return original(from.targetName, pod.name, pod.root, file, false)
1569
+ }
1570
+ return original(from.targetName, 'installed-dependency', root, relative, false)
1571
+ }
1555
1572
  const resolve = (from: Scan, include: string, quoted: boolean) => {
1556
1573
  if (quoted) {
1557
1574
  const relative = path.posix.normalize(
@@ -1732,19 +1749,7 @@ export async function collectTurboSources(options: {
1732
1749
  : (pod?.dependencyHeaderMaps.filter(({ flag }) => flag === '-I') ?? [])) {
1733
1750
  const relative = map.headers.get(include)
1734
1751
  if (relative === undefined) continue
1735
- // the workspace is a copy of the app. use the same pod-relative source
1736
- // identity as public-header lookup so pragma once sees one file.
1737
- const owner = installedHeaderPods.flatMap((candidate) => {
1738
- const root = relativeInside(options.appRoot, candidate.root)
1739
- const file = root === null ? null : relativeInside(root, relative)
1740
- return file === null ? [] : [{ pod: candidate, file }]
1741
- })[0]
1742
- alias(
1743
- own,
1744
- owner
1745
- ? original(from.targetName, owner.pod.name, owner.pod.root, owner.file, false)
1746
- : original(from.targetName, 'installed-dependency', map.root, relative, false),
1747
- )
1752
+ alias(own, installedDependencyHeader(from, map.root, relative))
1748
1753
  return
1749
1754
  }
1750
1755
  // preserve installed cross-pod search roots without copying every header
@@ -1756,10 +1761,7 @@ export async function collectTurboSources(options: {
1756
1761
  const relative = relativeInside(search.root, file)
1757
1762
  if (relative === null)
1758
1763
  throw new Error('installed dependency header escapes its workspace: ' + candidate)
1759
- alias(
1760
- own,
1761
- original(from.targetName, 'installed-dependency', search.root, relative, false),
1762
- )
1764
+ alias(own, installedDependencyHeader(from, search.root, relative))
1763
1765
  return
1764
1766
  }
1765
1767
  resolveDependency(include)
@@ -1898,16 +1900,18 @@ export async function collectTurboSources(options: {
1898
1900
  for (const provider of providers) {
1899
1901
  const targetName = providerTarget(provider.info.name)
1900
1902
  const label = provider.info.name
1901
- const providerTargetInput: SwiftPackageTarget = target(targetName, [
1902
- TURBO_CORE_TARGET,
1903
- ])
1903
+ const providerDefines = provider.paper ? baseDefines : defines
1904
+ const providerTargetInput: SwiftPackageTarget = target(
1905
+ targetName,
1906
+ [TURBO_CORE_TARGET],
1907
+ providerDefines,
1908
+ )
1904
1909
  result.targets.push(providerTargetInput)
1905
1910
  const pod = readPod(
1906
1911
  provider,
1907
1912
  options.appRoot,
1908
1913
  options.installedPods?.get(provider.name),
1909
1914
  )
1910
- if (provider.paper) providerTargetInput.cxxDefines = baseDefines
1911
1915
  if (pod.installed)
1912
1916
  providerTargetInput.clangSettings = [
1913
1917
  { tool: 'c', flags: pod.installed.preprocessorFlags.c },
@@ -2072,7 +2076,9 @@ export async function collectTurboSources(options: {
2072
2076
  files: string[]
2073
2077
  }[] = []
2074
2078
  const externalDefines: string[] = []
2075
- for (const dep of podspecDependencies(pod)) {
2079
+ const dependencies = podspecDependencies(pod)
2080
+ const seenDependencies = new Set([pod.name, ...dependencies.map(({ name }) => name)])
2081
+ for (const dep of dependencies) {
2076
2082
  const installed = installedHeaderPods.find(
2077
2083
  (candidate) => candidate.name === dep.name,
2078
2084
  )
@@ -2115,6 +2121,17 @@ export async function collectTurboSources(options: {
2115
2121
  if (!resolved) continue
2116
2122
  if (provider.reactModulesOnly && resolved.files.some((f) => f.endsWith('.swift')))
2117
2123
  continue
2124
+ for (const identity of installedTarget?.targetDependencies ?? []) {
2125
+ const dependency = installedByIdentity.get(identity)
2126
+ if (
2127
+ !dependency?.podRoot ||
2128
+ seenDependencies.has(dependency.name) ||
2129
+ reactNativePod(dependency.name)
2130
+ )
2131
+ continue
2132
+ seenDependencies.add(dependency.name)
2133
+ dependencies.push({ name: dependency.name, requirements: [], subspecs: [''] })
2134
+ }
2118
2135
  externalDefines.push(...resolved.defines)
2119
2136
  const mappings = installed ? podHeaderMappings(installed) : []
2120
2137
  const swiftFilesForDep: string[] = []
@@ -2200,6 +2217,7 @@ export async function collectTurboSources(options: {
2200
2217
  ...target(
2201
2218
  swiftModule,
2202
2219
  depSwiftPods.map((dep) => dep.moduleName),
2220
+ providerDefines,
2203
2221
  ),
2204
2222
  cxxInterop: true,
2205
2223
  })