peachsim 0.1.2129 → 0.1.2155

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 (146) hide show
  1. package/README.md +1 -1
  2. package/cli/app-fonts.ts +1 -1
  3. package/cli/app-stubs.ts +1 -1
  4. package/cli/cli-release-origin.ts +1 -0
  5. package/cli/cli-update.ts +1 -1
  6. package/cli/cloud-box-artifact.ts +1 -1
  7. package/cli/cloud-test-tunnel.ts +1 -1
  8. package/cli/commands/compat.ts +1 -1
  9. package/cli/commands/control.ts +2 -0
  10. package/cli/commands/coverage.ts +1 -1
  11. package/cli/commands/flow.ts +8 -1
  12. package/cli/commands/inspect/core.ts +25 -4
  13. package/cli/commands/package.ts +21 -12
  14. package/cli/commands/shell-url.ts +8 -3
  15. package/cli/commands/upgrade.ts +1 -1
  16. package/cli/drivers/linux-browser-libs.ts +1 -1
  17. package/cli/outbound-endpoints.ts +4 -0
  18. package/cli/remote-project-bundle.ts +2 -2
  19. package/detox/index.ts +12 -5
  20. package/dist-lib/agent-daemon-client.cjs +1 -1
  21. package/dist-lib/agent-events.cjs +1 -1
  22. package/dist-lib/attached-projects.cjs +1 -1
  23. package/dist-lib/auth/shared-session.cjs +1 -1
  24. package/dist-lib/backend-origin.cjs +1 -1
  25. package/dist-lib/beta.cjs +1 -1
  26. package/dist-lib/beta.mjs +1 -1
  27. package/dist-lib/bridge-constants.cjs +1 -1
  28. package/dist-lib/bridge-contract-input.cjs +1 -1
  29. package/dist-lib/bridge-contract-input.mjs +1 -1
  30. package/dist-lib/bridge-contract.cjs +1 -1
  31. package/dist-lib/bridge-contract.mjs +1 -1
  32. package/dist-lib/bundle-channel.cjs +1795 -1801
  33. package/dist-lib/capture-contract.cjs +1 -1
  34. package/dist-lib/capture-contract.mjs +1 -1
  35. package/dist-lib/cloud-contract.cjs +1 -1
  36. package/dist-lib/cloud-contract.mjs +1 -1
  37. package/dist-lib/cloud-test-args.cjs +1 -1
  38. package/dist-lib/cloud-test-args.mjs +1 -1
  39. package/dist-lib/cloud.cjs +1 -1
  40. package/dist-lib/cloud.mjs +1 -1
  41. package/dist-lib/config.cjs +2 -2
  42. package/dist-lib/config.mjs +2 -2
  43. package/dist-lib/detox/index.cjs +31 -8
  44. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  45. package/dist-lib/expo-swift-bundle.cjs +41 -33
  46. package/dist-lib/expo-swift-metadata.cjs +10 -2
  47. package/dist-lib/expo-swift-metadata.mjs +9 -2
  48. package/dist-lib/home-paths.cjs +1 -1
  49. package/dist-lib/host/bridge-host.cjs +276 -243
  50. package/dist-lib/host/fetch-proxy-handler.cjs +459 -484
  51. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  52. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  53. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  54. package/dist-lib/host/websocket-proxy.cjs +1 -1
  55. package/dist-lib/index.cjs +266 -266
  56. package/dist-lib/jump-to-source-babel.cjs +1 -1
  57. package/dist-lib/jump-to-source-native.cjs +1 -1
  58. package/dist-lib/kotlin-host.cjs +1 -1
  59. package/dist-lib/menu.cjs +1 -1
  60. package/dist-lib/menu.mjs +1 -1
  61. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  62. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  63. package/dist-lib/metro-production-bundle.cjs +2 -2
  64. package/dist-lib/metro-production-bundle.mjs +2 -2
  65. package/dist-lib/metro.cjs +320 -336
  66. package/dist-lib/native-app-identity-project.cjs +134 -159
  67. package/dist-lib/native-app-identity-project.mjs +428 -459
  68. package/dist-lib/native-app-identity.cjs +18 -18
  69. package/dist-lib/native-app-identity.mjs +18 -18
  70. package/dist-lib/native-firebase-metadata.cjs +2 -2
  71. package/dist-lib/native-firebase-metadata.mjs +2 -2
  72. package/dist-lib/pdfium-raster.cjs +1 -1
  73. package/dist-lib/pdfium-raster.mjs +1 -1
  74. package/dist-lib/plist.cjs +1 -1
  75. package/dist-lib/plist.mjs +1 -1
  76. package/dist-lib/profiles.cjs +1 -1
  77. package/dist-lib/public-brand.cjs +1 -1
  78. package/dist-lib/public-origins-lib-esm.json +32 -36
  79. package/dist-lib/public-origins-lib.json +135 -161
  80. package/dist-lib/react-native-host-modules.cjs +1 -1
  81. package/dist-lib/react-native-host-modules.mjs +1 -1
  82. package/dist-lib/reap-browser.cjs +1 -1
  83. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  84. package/dist-lib/sdk.cjs +20 -2
  85. package/dist-lib/sdk.mjs +20 -2
  86. package/dist-lib/skills.cjs +587 -531
  87. package/dist-lib/swift-compile.cjs +23 -8
  88. package/dist-lib/swift-compile.mjs +23 -8
  89. package/dist-lib/swift-package.cjs +1 -1
  90. package/dist-lib/swift-package.mjs +1 -1
  91. package/dist-lib/swift-submit.cjs +1 -1
  92. package/dist-lib/swift-submit.mjs +1 -1
  93. package/dist-lib/swift-toolchain.cjs +1 -1
  94. package/dist-lib/swift.cjs +1 -1
  95. package/dist-lib/vite-swift.cjs +41 -39
  96. package/dist-lib/vite.cjs +745 -768
  97. package/dist-lib/worklet-executable.cjs +1 -1
  98. package/dist-lib/worklet-executable.mjs +1 -1
  99. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +1 -1
  100. package/dist-types/packages/peach-engine/src/engine/secureItemHostContract.d.ts +1 -1
  101. package/dist-types/packages/peach-engine/src/render-worker/expo-widgets-activityContract.d.ts +1 -1
  102. package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +2 -0
  103. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +1 -1
  104. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +1 -1
  105. package/dist-types/packages/peach-engine/src/render-worker/one-native-contentContract.d.ts +1 -1
  106. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +2 -2
  107. package/dist-types/packages/peach-engine/src/render-worker/worklet-serialize.d.ts +1 -1
  108. package/dist-types/packages/peach-engine/src/render-worker/worklet-wire.d.ts +1 -1
  109. package/dist-types/packages/peach-globals/src/globalsContract.d.ts +1 -1
  110. package/dist-types/packages/peach-globals/src/package-versions.d.ts +16 -0
  111. package/package.json +1 -1
  112. package/runtime-companion.json +1 -1
  113. package/src/androidAutolinkingContract.ts +1 -1
  114. package/src/androidRootModuleContract.ts +1 -1
  115. package/src/bundle-channel.mjs +1 -1
  116. package/src/config.ts +1 -1
  117. package/src/configured-bundle-producer.ts +1 -1
  118. package/src/expo-swift-host.ts +34 -4
  119. package/src/expoKotlinContract.ts +4 -1
  120. package/src/expoSwiftContract.ts +18 -4
  121. package/src/guest-bundle.ts +1 -1
  122. package/src/host/dev-server-package-versions.ts +1 -1
  123. package/src/host/fetch-proxy-handler.ts +1 -1
  124. package/src/installed-native-build-options.ts +2 -2
  125. package/src/installed-package-versions.ts +7 -7
  126. package/src/metro-plugin.ts +1 -1
  127. package/src/metro-production-bundle.ts +1 -1
  128. package/src/native-app-identity.ts +1 -1
  129. package/src/native-firebase-metadata.ts +1 -1
  130. package/src/nitro-adapter.lock.json +244 -244
  131. package/src/nitro-superset.lock.json +4 -4
  132. package/src/nitroContract.ts +1 -1
  133. package/src/oneSdkContract.ts +1 -1
  134. package/src/react-native-coverage/capability-reference-resolution.ts +4 -4
  135. package/src/storageSnapshotContract.ts +2 -2
  136. package/src/swift-compile.ts +24 -7
  137. package/src/swift-coverage/source.ts +1 -1
  138. package/src/swift-distribution.lock.json +8 -8
  139. package/src/turbo-runtime.lock.json +18 -18
  140. package/src/vite-plugin-one.ts +4 -4
  141. package/src/vite-plugin.ts +6 -6
  142. package/src/bundleGlobalFooter.ts +0 -137
  143. package/src/packageVersionsContract.ts +0 -131
  144. /package/dist-types/packages/{peach-compat/src/stubs → peach-engine/src/guest}/native-evaluation-lease.d.ts +0 -0
  145. /package/dist-types/packages/{peach-compat → peach-globals}/src/secure-item-store.d.ts +0 -0
  146. /package/dist-types/packages/{peach-compat/src/stubs → peach-kit/src}/ring-mode-state.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (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,4 +1,4 @@
1
- /*! peach v0.1.2129 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2155 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
@@ -1,4 +1,4 @@
1
- import type { NativeEvaluationLease } from '../native-evaluation-lease.d.ts';
1
+ import type { NativeEvaluationLease } from '../../../../peach-engine/src/guest/native-evaluation-lease.d.ts';
2
2
  export type NativeCookie = {
3
3
  name: string;
4
4
  value: string;
@@ -1,4 +1,4 @@
1
- import { type SecureItemNamespace, type SecureItemRecord } from '../../../peach-compat/src/secure-item-store.d.ts';
1
+ import { type SecureItemNamespace, type SecureItemRecord } from '../../../peach-globals/src/secure-item-store.d.ts';
2
2
  export type SecureItemHostOperation = {
3
3
  type: 'read';
4
4
  namespace: SecureItemNamespace;
@@ -1,5 +1,5 @@
1
+ import type { ShellNativeEvaluationOwner } from '../guest/native-evaluation-lease.d.ts';
1
2
  import type { ExpoWidgetExtension } from './expo-widgetContract.d.ts';
2
- import type { ShellNativeEvaluationOwner } from '../../../peach-compat/src/stubs/native-evaluation-lease.d.ts';
3
3
  export interface ExpoWidgetsActivity {
4
4
  readonly id: string;
5
5
  readonly name: string;
@@ -41,6 +41,8 @@ export type MapMarker = {
41
41
  color?: string;
42
42
  style?: 'apple-balloon' | 'annotation-disc';
43
43
  selected?: boolean;
44
+ detail?: boolean;
45
+ clusteringIdentifier?: string;
44
46
  title?: string;
45
47
  diameter?: number;
46
48
  };
@@ -1,10 +1,10 @@
1
+ import { type PackageVersions } from '../../../peach-globals/src/package-versions.d.ts';
1
2
  import { type PeachBundleConfig } from '../../../../../src/config.ts';
2
3
  import { type NativeFirebaseConfig } from '../../../../../src/native-firebase-metadata.ts';
3
4
  import { type ExpoKotlinCompilationResult } from '../../../../../src/expoKotlinContract.ts';
4
5
  import { type ExpoSwiftCompilationResult } from '../../../../../src/expoSwiftContract.ts';
5
6
  import { type NitroCompiledModule, type TurboCompiledModule } from '../../../../../src/nitroContract.ts';
6
7
  import { type OneSDKCompilation } from '../../../../../src/oneSdkContract.ts';
7
- import { type PackageVersions } from '../../../../../src/packageVersionsContract.ts';
8
8
  import { type AppCatalog } from '../engine/app-catalog-wire.d.ts';
9
9
  import { type RolldownModulePreparation } from '../rolldown-production-module.d.ts';
10
10
  import type { MetroModuleIdentity } from '../metro-identity-contract.d.ts';
@@ -661,7 +661,7 @@ type NativeUIRequestBody = import('../capture/nativeScreenCaptureContract.d.ts')
661
661
  requestId: number;
662
662
  spec: AlertSpec;
663
663
  traitScheme?: 'light' | 'dark' | null;
664
- owner?: import('../../../peach-compat/src/stubs/native-evaluation-lease.d.ts').ShellNativeEvaluationOwner;
664
+ owner?: import('../guest/native-evaluation-lease.d.ts').ShellNativeEvaluationOwner;
665
665
  } | {
666
666
  kind: 'alert.dismiss';
667
667
  requestId: number;
@@ -1,4 +1,4 @@
1
- import type { ShellNativeEvaluationOwner } from '../../../peach-compat/src/stubs/native-evaluation-lease.d.ts';
1
+ import type { ShellNativeEvaluationOwner } from '../guest/native-evaluation-lease.d.ts';
2
2
  export interface OneWidgetData {
3
3
  readonly title: string;
4
4
  readonly value: string;
@@ -144,7 +144,7 @@ export type HostToWorker = {
144
144
  duoFold: DuoFoldWireState;
145
145
  bodyPose: InterfacePose;
146
146
  reactNativeConfiguration: ReactNativeConfigurationSnapshot;
147
- ringMode: import('../../../peach-compat/src/stubs/ring-mode-state.d.ts').RingMode | null;
147
+ ringMode: import('../../../peach-kit/src/ring-mode-state.d.ts').RingMode | null;
148
148
  nativeResourcesPort: MessagePort;
149
149
  canvasKitWasmModule?: WebAssembly.Module;
150
150
  engineBase: string;
@@ -156,7 +156,7 @@ export type HostToWorker = {
156
156
  storageScopeUrl?: string;
157
157
  securityGroupCarry?: readonly import('../../../sootsim-swift/src/securityHostContract.d.ts').SwiftSecurityGroupSnapshot[];
158
158
  simScopeId?: string;
159
- secureItemDeviceDomain: import('../../../peach-compat/src/secure-item-store.d.ts').SecureItemDeviceDomain;
159
+ secureItemDeviceDomain: import('../../../peach-globals/src/secure-item-store.d.ts').SecureItemDeviceDomain;
160
160
  appLoad: AppLoadRequest;
161
161
  rolldownInventory?: import('../rolldown-bundle-inventory.d.ts').RolldownInventoryReceipt;
162
162
  localStorageEntries?: Array<[string, string]>;
@@ -1,8 +1,8 @@
1
1
  import { NativeDynamicSynchronizableStorage, type SynchronizableArenaKey } from './native-dynamic-synchronizable.d.ts';
2
2
  import { type ReanimatedAnimationKind } from './reanimated-readiness.d.ts';
3
3
  import { type ClosureSpec, type NativeSerializableValueSpec, type ValueSpec, type WorkletBundleModule, type WorkletFunctionSpec, type WorkletViewRef } from './worklet-wire.d.ts';
4
+ import type { NativeEvaluationLease } from '../guest/native-evaluation-lease.d.ts';
4
5
  import type { WorkletRuntime } from './worklet-runtime.d.ts';
5
- import type { NativeEvaluationLease } from '../../../peach-compat/src/stubs/native-evaluation-lease.d.ts';
6
6
  import type { ReanimatedAnimationProfile } from '../../../peach-globals/src/profilerContract.d.ts';
7
7
  export declare const OBJECT_ID_BASE = 4294967296;
8
8
  export type WorkletClosure = Record<string, unknown> | unknown[];
@@ -3,11 +3,11 @@ import { type NativeCSSEvent } from './reanimated-css-contract.d.ts';
3
3
  import { type ReanimatedAnimationKind, type SharedValuePlayback } from './reanimated-readiness.d.ts';
4
4
  import { type WorkletPeerEpoch } from './worklet-sab.d.ts';
5
5
  import type { NativeRenderer } from '../../../../../src/config.ts';
6
- import type { WorkletsStaticFlags } from '../../../../../src/packageVersionsContract.ts';
7
6
  import type { DemoBundleMode } from '../demo/demo-bundle-platform.d.ts';
8
7
  import type { AnimatedDrivenStyleLease, AnimatedDrivenStyleRetirement } from '../engine/animated-driven-style.d.ts';
9
8
  import type { SyncReplyBuffer } from './nativeSyncReplyContract.d.ts';
10
9
  import type { WorkletThreadIdentity } from './workletThreadIdentityContract.d.ts';
10
+ import type { WorkletsStaticFlags } from '../../../peach-globals/src/package-versions.d.ts';
11
11
  import type { ReanimatedAnimationProfile } from '../../../peach-globals/src/profilerContract.d.ts';
12
12
  export type WorkletBuiltinName = string;
13
13
  export interface WorkletViewOwner {
@@ -452,7 +452,7 @@ export interface SootSimDirectGlobals {
452
452
  __sootsimCliVersion: string;
453
453
  __peachDesktopHostInstalled: boolean;
454
454
  __peachWorkerHost: {
455
- pullSurface?: (source: HTMLCanvasElement, kx?: number, ky?: number) => Promise<void>;
455
+ pullSurface?: (source: HTMLCanvasElement, kx?: number, ky?: number) => Promise<HTMLCanvasElement | null>;
456
456
  };
457
457
  }
458
458
 
@@ -0,0 +1,16 @@
1
+ import type { NativeBuildOptions } from './index.d.ts';
2
+ export type PackageVersions = Record<string, string>;
3
+ export declare const NATIVE_BUILD_OPTIONS_KEY = "@peach/native-build-options";
4
+ export declare function readNativeBuildOptions(versions: PackageVersions | null): NativeBuildOptions;
5
+ export declare const PACKAGE_VERSIONS_HEADER = "X-Peach-Package-Versions";
6
+ export declare function readPackageVersions(value: unknown): PackageVersions;
7
+ export declare function readPackageVersionsFooter(source: string): PackageVersions | null;
8
+ export declare function insertPackageVersionsFooter(source: string, versions: PackageVersions): string;
9
+ export declare function detachPackageVersionsFooter(source: string): {
10
+ source: string;
11
+ versions: PackageVersions | null;
12
+ };
13
+ export declare const WORKLETS_STATIC_FLAGS_KEY = "react-native-worklets/staticFlags.json";
14
+ export type WorkletsStaticFlags = Readonly<Record<string, boolean>>;
15
+ export declare function resolveWorkletsStaticFlags(defaults: unknown, appManifest: unknown): string;
16
+ export declare function readWorkletsStaticFlags(versions: PackageVersions | null): WorkletsStaticFlags | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2129",
3
+ "version": "0.1.2155",
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":"f7706b4e73d50be69c751cedbeb231d7415918cc515ce5c6ba6594c1fb6fb915","file":"node/cli-f7706b4e73d50be69c751cedbeb231d7415918cc515ce5c6ba6594c1fb6fb915.cjs"}
1
+ {"abi":1,"sha256":"9b370a218cb12559cba2bb30e1e33d168ccd0f310e473c5428133b85938be20a","file":"node/cli-9b370a218cb12559cba2bb30e1e33d168ccd0f310e473c5428133b85938be20a.cjs"}
@@ -2,7 +2,7 @@ import {
2
2
  detachBundleGlobalFooter,
3
3
  insertBundleGlobalFooter,
4
4
  readBundleGlobalFooter,
5
- } from './bundleGlobalFooter'
5
+ } from '@peach/globals/bundle-global-footer'
6
6
 
7
7
  const FOOTER = '__peachAndroidAutolinkedPackages'
8
8
 
@@ -2,7 +2,7 @@ import {
2
2
  detachBundleGlobalFooter,
3
3
  insertBundleGlobalFooter,
4
4
  readBundleGlobalFooter,
5
- } from './bundleGlobalFooter'
5
+ } from '@peach/globals/bundle-global-footer'
6
6
 
7
7
  // the component the Android launcher activity starts react native with. it
8
8
  // travels apart from the native app identity: an unbuilt app has no merged
@@ -14,7 +14,7 @@ import { nodeHttpFetch } from './node-http-fetch'
14
14
  import {
15
15
  detachPackageVersionsFooter,
16
16
  insertPackageVersionsFooter,
17
- } from './packageVersionsContract'
17
+ } from '@peach/globals/package-versions'
18
18
  import { terminateProcessGroup } from './process-group'
19
19
  import { discoverAppCatalog } from '../cli/app-catalog'
20
20
  import { captureStagedHostFiles } from './host/staged-host-files'
package/src/config.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  // export default defineConfig({ modules: { ... }, env: { ... } })
6
6
 
7
7
  import { isValidRuntimeVersion } from '@contrast/runtime-delivery/version'
8
- import { findBundleFooter } from './bundleGlobalFooter'
8
+ import { findBundleFooter } from '@peach/globals/bundle-global-footer'
9
9
  import { isRecord } from './is-record'
10
10
  import { isNativeViewSource, type NativeViewSource } from './nativeViewSourceContract'
11
11
  export type { NativeViewSource } from './nativeViewSourceContract'
@@ -2,11 +2,11 @@
2
2
  // the generated prefix runs as ordinary bundle code in browser and workerd tenants.
3
3
  import fs from 'node:fs'
4
4
  import path from 'node:path'
5
+ import { findBundleFooter } from '@peach/globals/bundle-global-footer'
5
6
  import { transform } from 'sucrase'
6
7
  import { minify } from 'terser'
7
8
  import { splitExportDeclarators } from '../../contrast-bundler/src/dependencies'
8
9
  import { compileReplacementModule } from '../../contrast-bundler/src/replacementModule'
9
- import { findBundleFooter } from './bundleGlobalFooter'
10
10
  import {
11
11
  collectConfiguredFileModules,
12
12
  createPeachBundleConfigFooter,
@@ -95,6 +95,7 @@ import type { PeachConfig } from './config'
95
95
  import type {
96
96
  ExpoSwiftSourceUnit,
97
97
  ExpoSwiftCompilationResult,
98
+ ExpoSwiftDiscoveryResult,
98
99
  ExpoSwiftPreparationOptions,
99
100
  } from './expoSwiftContract'
100
101
  import type { NativeAppIdentity } from './native-app-identity'
@@ -1007,6 +1008,7 @@ export async function collectExpoSwiftSources(
1007
1008
  installedWorkspace?: string,
1008
1009
  prepareNative = false,
1009
1010
  iosTarget?: string,
1011
+ metadataOnly = false,
1010
1012
  ): Promise<ExpoSwiftSourceUnit[] | null> {
1011
1013
  if (traceStore.getStore())
1012
1014
  return collectExpoSwiftSourcesUncached(
@@ -1015,10 +1017,11 @@ export async function collectExpoSwiftSources(
1015
1017
  installedWorkspace,
1016
1018
  prepareNative,
1017
1019
  iosTarget,
1020
+ metadataOnly,
1018
1021
  )
1019
1022
  signal?.throwIfAborted()
1020
1023
  installSwiftInputTrace()
1021
- const key = await discoveryKey(appRoot, installedWorkspace, prepareNative, iosTarget)
1024
+ const key = `${await discoveryKey(appRoot, installedWorkspace, prepareNative, iosTarget)}\0${metadataOnly}`
1022
1025
  const cached = discoveryCache.get(key)
1023
1026
  if (cached && (await witnessMatches(cached.witness))) {
1024
1027
  signal?.throwIfAborted()
@@ -1032,6 +1035,7 @@ export async function collectExpoSwiftSources(
1032
1035
  installedWorkspace,
1033
1036
  prepareNative,
1034
1037
  iosTarget,
1038
+ metadataOnly,
1035
1039
  ),
1036
1040
  )
1037
1041
  if (witness.marks.size > 0 && (await witnessMatches(witness)))
@@ -1045,6 +1049,7 @@ async function collectExpoSwiftSourcesUncached(
1045
1049
  installedWorkspace?: string,
1046
1050
  prepareNative = false,
1047
1051
  iosTarget?: string,
1052
+ metadataOnly = false,
1048
1053
  ): Promise<ExpoSwiftSourceUnit[] | null> {
1049
1054
  const started = performance.now()
1050
1055
  const report = (message: string) =>
@@ -1236,7 +1241,7 @@ async function collectExpoSwiftSourcesUncached(
1236
1241
  peachAnsweredNativePackages().has(packageName)
1237
1242
  if (answered) {
1238
1243
  answeredInstalled = true
1239
- if (installed || prepareNative) {
1244
+ if (installed || prepareNative || metadataOnly) {
1240
1245
  processed.add(packageName)
1241
1246
  continue
1242
1247
  }
@@ -1292,7 +1297,7 @@ async function collectExpoSwiftSourcesUncached(
1292
1297
  subscriberNames.length === 0 &&
1293
1298
  handlerNames.length === 0)
1294
1299
  if (dependencyOnly) {
1295
- if (installed || prepareNative || !Array.isArray(namespaces)) {
1300
+ if (installed || prepareNative || metadataOnly || !Array.isArray(namespaces)) {
1296
1301
  processed.add(packageName)
1297
1302
  continue
1298
1303
  }
@@ -1543,7 +1548,7 @@ async function collectExpoSwiftSourcesUncached(
1543
1548
  walkFrameworks(canonical)
1544
1549
  // this path compiles Swift alone; the report names the cause when a
1545
1550
  // Swift file then fails on the pod's own Objective-C or C types.
1546
- if (nativeSources.size > 0 && !prepareNative)
1551
+ if (nativeSources.size > 0 && !prepareNative && !metadataOnly)
1547
1552
  report(
1548
1553
  `${packageName}: ${namespace} has Objective-C or C sources (${[...nativeSources].sort()[0]}), which compile only from a CocoaPods workspace a Mac prepares; compiling its Swift alone`,
1549
1554
  )
@@ -1780,6 +1785,7 @@ async function collectExpoSwiftSourcesUncached(
1780
1785
  }
1781
1786
  // an app whose installed modules a seam answers still links native modules.
1782
1787
  if (units.length === 0) return answeredInstalled ? [] : null
1788
+ if (metadataOnly) return units
1783
1789
  if (installed)
1784
1790
  enrichInstalledUnits(
1785
1791
  units,
@@ -2904,6 +2910,30 @@ export async function handleExpoSwiftRequest(
2904
2910
  return true
2905
2911
  }
2906
2912
  const iosTarget = url.searchParams.get('iosTarget') ?? undefined
2913
+ if (url.searchParams.get('discover') === '1') {
2914
+ try {
2915
+ const units = await collectExpoSwiftSources(
2916
+ key,
2917
+ undefined,
2918
+ undefined,
2919
+ false,
2920
+ iosTarget,
2921
+ true,
2922
+ )
2923
+ const metadata: ExpoSwiftDiscoveryResult | null = units && {
2924
+ namespaces: units.map((unit) => unit.moduleId),
2925
+ }
2926
+ res.writeHead(200, {
2927
+ 'Content-Type': 'application/json',
2928
+ 'Cache-Control': 'no-store',
2929
+ })
2930
+ res.end(JSON.stringify(metadata))
2931
+ } catch (error) {
2932
+ res.writeHead(500, { 'Content-Type': 'text/plain' })
2933
+ res.end(error instanceof Error ? error.message : String(error))
2934
+ }
2935
+ return true
2936
+ }
2907
2937
  const flightKey = `${host}\0${key}\0${iosTarget ?? ''}`
2908
2938
  const prepared = openPreparations.take(
2909
2939
  flightKey,
@@ -1,4 +1,7 @@
1
- import { insertBundleGlobalFooter, readBundleGlobalFooter } from './bundleGlobalFooter'
1
+ import {
2
+ insertBundleGlobalFooter,
3
+ readBundleGlobalFooter,
4
+ } from '@peach/globals/bundle-global-footer'
2
5
  import { isRecord } from './is-record'
3
6
 
4
7
  // what the dev server answers for an app's local Expo Kotlin modules on an
@@ -1,4 +1,7 @@
1
- import { insertBundleGlobalFooter, readBundleGlobalFooter } from './bundleGlobalFooter'
1
+ import {
2
+ insertBundleGlobalFooter,
3
+ readBundleGlobalFooter,
4
+ } from '@peach/globals/bundle-global-footer'
2
5
  import { isRecord } from './is-record'
3
6
  import { isNativeAppIdentity, type NativeAppIdentity } from './native-app-identity'
4
7
  import { isSwiftResourcePath } from './swiftContract'
@@ -7,6 +10,7 @@ import type {
7
10
  SwiftHeaderAliases,
8
11
  SwiftResourceBundle,
9
12
  } from './swiftContract'
13
+ import type { ExpoSwiftFailure } from '@peach/globals/guest-modules/expo-swift-failure'
10
14
 
11
15
  export interface ExpoSwiftPreparationOptions {
12
16
  signal?: AbortSignal
@@ -51,19 +55,29 @@ export interface ExpoSwiftCompiledModule {
51
55
  bundleFiles?: Record<string, string>
52
56
  }
53
57
 
54
- export interface ExpoSwiftCompilationResult {
55
- nativeAppIdentity?: NativeAppIdentity
58
+ export interface ExpoSwiftDiscoveryResult {
56
59
  namespaces: string[]
60
+ }
61
+
62
+ export interface ExpoSwiftCompilationResult extends ExpoSwiftDiscoveryResult {
63
+ nativeAppIdentity?: NativeAppIdentity
57
64
  // the namespaces that are legacy bridge modules rather than Expo modules
58
65
  bridgeModules?: string[]
59
66
  modules: ExpoSwiftCompiledModule[]
60
- failures: { namespace: string; diagnostic: string }[]
67
+ failures: ExpoSwiftFailure[]
61
68
  }
62
69
 
63
70
  function strings(value: unknown): value is string[] {
64
71
  return Array.isArray(value) && value.every((item) => typeof item === 'string')
65
72
  }
66
73
 
74
+ export function readExpoSwiftDiscovery(value: unknown): ExpoSwiftDiscoveryResult | null {
75
+ if (value === null) return null
76
+ if (!isRecord(value) || !strings(value.namespaces))
77
+ throw new Error('invalid Expo Swift discovery metadata')
78
+ return { namespaces: value.namespaces }
79
+ }
80
+
67
81
  export function isExpoSwiftCompilationResult(
68
82
  value: unknown,
69
83
  ): value is ExpoSwiftCompilationResult {
@@ -1,3 +1,4 @@
1
+ import { insertPackageVersionsFooter } from '@peach/globals/package-versions'
1
2
  // the built-in guests use the existing Metro runtime and host module seam.
2
3
  // the author supplies Swift or Kotlin; an entry carries no engine or compiler
3
4
  // code, only the registration of the host module's root.
@@ -7,7 +8,6 @@ import {
7
8
  RNX_METRO_MODULE_IDENTITY_VERSION,
8
9
  } from './metro-production-bundle'
9
10
  import { METRO_REQUIRE_POLYFILL } from './metro-runtime-source'
10
- import { insertPackageVersionsFooter } from './packageVersionsContract'
11
11
 
12
12
  export function swiftGuestBundle(packageName: string): string {
13
13
  return guestBundle(
@@ -4,7 +4,7 @@ import { prebuiltExpoPods } from '../expo-pod-prebuilt'
4
4
  import { readInstalledNativePackageVersionsAsync } from '../installed-package-versions.ts'
5
5
  import { resolveMetroProjectRoot } from '../metro-project-root.ts'
6
6
  import type { ExpoSwiftCompilationResult } from '../expoSwiftContract'
7
- import type { PackageVersions } from '../packageVersionsContract'
7
+ import type { PackageVersions } from '@peach/globals/package-versions'
8
8
 
9
9
  // a plain Metro or Expo dev server records no installed versions in its
10
10
  // bundle. the bridge serving that bundle reads them from the project the
@@ -28,12 +28,12 @@ import http, { type IncomingMessage, type ServerResponse } from 'http'
28
28
  import https from 'https'
29
29
  import { Http2ServerRequest, type Http2ServerResponse } from 'node:http2'
30
30
  import { finished, pipeline } from 'stream/promises'
31
+ import { PACKAGE_VERSIONS_HEADER } from '@peach/globals/package-versions'
31
32
  import {
32
33
  isLoopbackHost,
33
34
  isTrustedBridgeRequest,
34
35
  normalizeHostname,
35
36
  } from '../backend-origin.ts'
36
- import { PACKAGE_VERSIONS_HEADER } from '../packageVersionsContract'
37
37
  import { readDevServerPackageVersions } from './dev-server-package-versions.ts'
38
38
  import {
39
39
  buildFetchProxyUpstreamHeaders,
@@ -1,8 +1,8 @@
1
1
  import fs from 'node:fs'
2
2
  import path from 'node:path'
3
- import { resolveCompatVersionRange } from '@peach/compat/version-range'
4
- import type { PackageVersions } from './packageVersionsContract'
3
+ import { resolveCompatVersionRange } from '@peach/globals/guest-modules/version-range'
5
4
  import type { NativeBuildOptions } from '@peach/globals'
5
+ import type { PackageVersions } from '@peach/globals/package-versions'
6
6
 
7
7
  const RIVE_PACKAGE = '@rive-app/react-native'
8
8
  const RIVE_05 = ['>=0.5.0 <0.6.0']
@@ -9,19 +9,19 @@
9
9
 
10
10
  import fs from 'fs'
11
11
  import path from 'path'
12
- import { LAZY_STUB_PATTERNS } from '@peach/compat/lazy-stub-patterns'
13
12
  import { NATIVE_RUNTIME_PACKAGE_NAMES } from '@peach/compat/native-package-names'
14
- import { COMPAT_STUBS } from '@peach/compat/stub-manifest'
15
- import {
16
- readInstalledNativeBuildOptions,
17
- readInstalledNativeBuildOptionsAsync,
18
- } from './installed-native-build-options'
13
+ import { LAZY_STUB_PATTERNS } from '@peach/globals/guest-modules/lazy-stub-patterns'
14
+ import { COMPAT_STUBS } from '@peach/globals/guest-modules/stub-manifest'
19
15
  import {
20
16
  NATIVE_BUILD_OPTIONS_KEY,
21
17
  resolveWorkletsStaticFlags,
22
18
  WORKLETS_STATIC_FLAGS_KEY,
23
19
  type PackageVersions,
24
- } from './packageVersionsContract'
20
+ } from '@peach/globals/package-versions'
21
+ import {
22
+ readInstalledNativeBuildOptions,
23
+ readInstalledNativeBuildOptionsAsync,
24
+ } from './installed-native-build-options'
25
25
  import { extractPackageFromPath } from './stub-pattern-matcher.ts'
26
26
 
27
27
  type InstalledPackage = { root: string; manifest: object }
@@ -12,6 +12,7 @@ import fs from 'fs'
12
12
  import { createRequire } from 'module'
13
13
  import { randomUUID } from 'node:crypto'
14
14
  import path from 'path'
15
+ import { insertPackageVersionsFooter } from '@peach/globals/package-versions'
15
16
  import { resolveAppProject } from '../cli/app-project'
16
17
  import { collectAndroidAutolinkedPackages } from './android-autolinking'
17
18
  import { readAndroidLauncherRootModuleName } from './android-root-module'
@@ -41,7 +42,6 @@ import {
41
42
  insertNativeFirebaseFooter,
42
43
  readNativeFirebaseMetadata,
43
44
  } from './native-firebase-metadata'
44
- import { insertPackageVersionsFooter } from './packageVersionsContract'
45
45
  import { parsePlistSource } from './plist'
46
46
  import {
47
47
  isRootRuntimeAssetPath,
@@ -1,4 +1,4 @@
1
- import { findBundleFooter } from './bundleGlobalFooter'
1
+ import { findBundleFooter } from '@peach/globals/bundle-global-footer'
2
2
  import type { CallExpression, Expression } from 'acorn'
3
3
 
4
4
  const RNXSIM_METRO_MODULE_PATHS_PREFIX = 'globalThis.__sootsimModulePaths='
@@ -8,8 +8,8 @@
8
8
  // unchanged. tenant boot validates both before evaluation and clears the realm
9
9
  // store when neither carries identity.
10
10
 
11
+ import { findBundleFooter } from '@peach/globals/bundle-global-footer'
11
12
  import { nativeAppIdentityFromAndroidManifest } from './android-app-identity'
12
- import { findBundleFooter } from './bundleGlobalFooter'
13
13
  import { isRecord } from './is-record'
14
14
  import {
15
15
  resolveNativeAppIconArtwork,
@@ -1,6 +1,6 @@
1
1
  // native Firebase options travel before the Metro module identity footer.
2
2
  // the guest SDK snapshots these constants before its first getApp call.
3
- import { findBundleFooter } from './bundleGlobalFooter'
3
+ import { findBundleFooter } from '@peach/globals/bundle-global-footer'
4
4
 
5
5
  export interface NativeFirebaseOptions {
6
6
  apiKey: string