peachsim 0.1.1843 → 0.1.1845

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 (90) hide show
  1. package/cli/commands/shell-url.ts +1 -1
  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 +65 -29
  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 +1 -1
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/expo-swift-bundle.cjs +45 -19
  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 +69 -30
  32. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  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 +207 -12
  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 +207 -12
  48. package/dist-lib/native-app-identity-project.cjs +10 -5
  49. package/dist-lib/native-app-identity-project.mjs +10 -5
  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 +269 -48
  69. package/dist-lib/swift-compile.cjs +1 -1
  70. package/dist-lib/swift-compile.mjs +1 -1
  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 +11 -3
  78. package/dist-lib/vite.cjs +1 -1
  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/engine/node.d.ts +6 -0
  82. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
  83. package/dist-types/packages/peach-engine/src/engine/text-line-break.d.ts +1 -1
  84. package/package.json +1 -1
  85. package/src/expo-swift-host.ts +36 -12
  86. package/src/expoSwiftContract.ts +1 -0
  87. package/src/native-firebase-config.ts +268 -9
  88. package/src/nitro-dependencies.ts +14 -0
  89. package/src/turbo-source.ts +12 -3
  90. package/src/xcode-project.ts +23 -5
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (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 __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-compile.ts
4
4
  import {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (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.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function swiftManifestSettings(target) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (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.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (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 __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (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.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (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 __create = Object.create;
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
39
39
  var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
40
40
  var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
41
41
  "<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
42
- define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "08583ee03b92e00f3f331e52fb480ef81c9fd7e668d796a5afcfa07978bcaf03", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "26f8d4a25d1af9917f0005153c73c9cefa4f6681c9d56c6333b8096190db0431", "swift-package.ts": "e224b5e20ed3a86df1c62d6429e88234ed65317ce32c61c1b6b02aaee173d64f", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "a90155695844684e625ab83687161104f028ef34030715a40042a4407b77fca0", "home-paths.ts": "744d0e29fcc4baae6748161da45dd75e357348703331dad685c74ec813abcc83", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "76e78ea9974671ff3b7e7a5d65e508306d8eadeb6b6bf859bd2ccc03f4ef6e72", "xcode-target-members.ts": "75a23a5fc54cc6f5e952d545f2f0f86241ff36525ab4e568c172e83c3bfb9da4", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
42
+ define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "08583ee03b92e00f3f331e52fb480ef81c9fd7e668d796a5afcfa07978bcaf03", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "26f8d4a25d1af9917f0005153c73c9cefa4f6681c9d56c6333b8096190db0431", "swift-package.ts": "e224b5e20ed3a86df1c62d6429e88234ed65317ce32c61c1b6b02aaee173d64f", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "a90155695844684e625ab83687161104f028ef34030715a40042a4407b77fca0", "home-paths.ts": "744d0e29fcc4baae6748161da45dd75e357348703331dad685c74ec813abcc83", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "1594a888c8d4d1f26bb06e522ccbdeecf314934063ac635eedd6f4938e0684fd", "xcode-target-members.ts": "75a23a5fc54cc6f5e952d545f2f0f86241ff36525ab4e568c172e83c3bfb9da4", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
43
43
  }
44
44
  });
45
45
 
@@ -24334,6 +24334,14 @@ var RN_FMT_11_DEPENDENCIES = [
24334
24334
  sourceDirectories: ["include/fmt", "src"]
24335
24335
  }
24336
24336
  ];
24337
+ var RN_FAST_FLOAT_6_DEPENDENCIES = RN_FMT_11_DEPENDENCIES.map(
24338
+ (dependency) => dependency.name === "fast_float" ? {
24339
+ ...dependency,
24340
+ url: "https://github.com/fastfloat/fast_float/archive/v6.1.4.tar.gz",
24341
+ sha256: "12cb6d250824160ca16bcb9d51f0ca7693d0d10cb444f34f1093bc02acfce704",
24342
+ prefix: "fast_float-6.1.4"
24343
+ } : dependency
24344
+ );
24337
24345
  var RN_FMT_12_DEPENDENCIES = [
24338
24346
  ...RN_SHARED_DEPENDENCIES,
24339
24347
  {
@@ -24864,7 +24872,7 @@ function standinSourceDigest(srcDir = __sootsim_import_meta_dirname) {
24864
24872
  }
24865
24873
  return hash.digest("hex");
24866
24874
  }
24867
- var STANDIN_SOURCE_DIGEST = true ? "f226ff0c87dc258ea1d8fd5e4e0efe377627c915c39dfa5f9655aad885782a3b" : standinSourceDigest();
24875
+ var STANDIN_SOURCE_DIGEST = true ? "1fd57281ceaf1317ebbd3df4334dd41fce5931f51ce3a48d3b2870e4e9670d8c" : standinSourceDigest();
24868
24876
 
24869
24877
  // src/swift-standins.ts
24870
24878
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (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 __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (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.1843 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1845 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
@@ -321,6 +321,12 @@ export declare class SootSimNode {
321
321
  private _flushLayoutOrDefer;
322
322
  _hasComputedLayout(): boolean;
323
323
  measure(callback: (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void): void;
324
+ windowFrame(): {
325
+ x: number;
326
+ y: number;
327
+ width: number;
328
+ height: number;
329
+ };
324
330
  measureInWindow(callback: (x: number, y: number, width: number, height: number) => void): void;
325
331
  measureLayout(relativeToNativeNode: SootSimNode | HTMLElement, onSuccess: (left: number, top: number, width: number, height: number) => void, onFail?: () => void): void;
326
332
  unstable_getBoundingClientRect(): {
@@ -364,6 +364,7 @@ export declare class SceneTable {
364
364
  width: number;
365
365
  height: number;
366
366
  }): DamageRect | null;
367
+ clipToOverflowAncestors(slot: number, rect: DamageRect | null): DamageRect | null;
367
368
  addDriveDamage(before: DamageRect | null, after?: DamageRect | null): void;
368
369
  takeDriveDamage(): DamageRect | null;
369
370
  seedPresentationStyle(slot: number, style: SootSimStyle, program: SceneLaneProgram, resolve: (value: unknown) => unknown): void;
@@ -12,7 +12,7 @@ export declare function readTextHyphenation(style: {
12
12
  }): TextHyphenation | undefined;
13
13
  export declare function textHyphenationKey(hyphenation: TextHyphenation | undefined): string;
14
14
  export declare function installEnglishHyphenation(create: () => Hyphenator): void;
15
- export declare function hyphenateParagraph(text: string, para: Paragraph, width: number, hyphenation: TextHyphenation | undefined, pushOut: boolean, build: (text: string) => Paragraph): {
15
+ export declare function hyphenateParagraph(text: string, para: Paragraph, width: number, hyphenation: TextHyphenation | undefined, pushOut: boolean, build: (text: string) => Paragraph, rewritePushOut?: boolean): {
16
16
  text: string;
17
17
  para: Paragraph;
18
18
  layoutWidth: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.1843",
3
+ "version": "0.1.1845",
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",
@@ -418,12 +418,13 @@ async function discoveryKey(
418
418
  root: string,
419
419
  installedWorkspace: string | undefined,
420
420
  prepareNative: boolean,
421
+ iosTarget: string | undefined,
421
422
  ): Promise<string> {
422
423
  const [config, expoConfig] = await Promise.all([
423
424
  loadRNXAppConfig(resolveAppProject(root)),
424
425
  readExpoConfigAsync(root),
425
426
  ])
426
- return `${fs.realpathSync(root)}\0${installedWorkspace ?? ''}\0${prepareNative ? '1' : '0'}\0${JSON.stringify(config)}\0${JSON.stringify(expoConfig)}`
427
+ return `${fs.realpathSync(root)}\0${installedWorkspace ?? ''}\0${iosTarget ?? ''}\0${prepareNative ? '1' : '0'}\0${JSON.stringify(config)}\0${JSON.stringify(expoConfig)}`
427
428
  }
428
429
 
429
430
  function cloneNativeTarget(target: SwiftNativeTarget): SwiftNativeTarget {
@@ -881,6 +882,7 @@ export async function collectExpoSwiftSources(
881
882
  signal?: AbortSignal,
882
883
  installedWorkspace?: string,
883
884
  prepareNative = false,
885
+ iosTarget?: string,
884
886
  ): Promise<ExpoSwiftSourceUnit[] | null> {
885
887
  if (traceStore.getStore())
886
888
  return collectExpoSwiftSourcesUncached(
@@ -888,10 +890,11 @@ export async function collectExpoSwiftSources(
888
890
  signal,
889
891
  installedWorkspace,
890
892
  prepareNative,
893
+ iosTarget,
891
894
  )
892
895
  signal?.throwIfAborted()
893
896
  installSwiftInputTrace()
894
- const key = await discoveryKey(appRoot, installedWorkspace, prepareNative)
897
+ const key = await discoveryKey(appRoot, installedWorkspace, prepareNative, iosTarget)
895
898
  const cached = discoveryCache.get(key)
896
899
  if (cached && (await witnessMatches(cached.witness))) {
897
900
  signal?.throwIfAborted()
@@ -899,7 +902,13 @@ export async function collectExpoSwiftSources(
899
902
  }
900
903
  const witness: Witness = { marks: new Map(), tainted: false }
901
904
  const units = await traceStore.run(witness, () =>
902
- collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspace, prepareNative),
905
+ collectExpoSwiftSourcesUncached(
906
+ appRoot,
907
+ signal,
908
+ installedWorkspace,
909
+ prepareNative,
910
+ iosTarget,
911
+ ),
903
912
  )
904
913
  if (witness.marks.size > 0 && (await witnessMatches(witness)))
905
914
  discoveryCache.set(key, { witness, units: cloneUnits(units) })
@@ -911,6 +920,7 @@ async function collectExpoSwiftSourcesUncached(
911
920
  signal?: AbortSignal,
912
921
  installedWorkspace?: string,
913
922
  prepareNative = false,
923
+ iosTarget?: string,
914
924
  ): Promise<ExpoSwiftSourceUnit[] | null> {
915
925
  const started = performance.now()
916
926
  const report = (message: string) =>
@@ -1028,12 +1038,13 @@ async function collectExpoSwiftSourcesUncached(
1028
1038
  const module = await resolveSwiftModule({ signal })
1029
1039
  moduleRoot = module.root
1030
1040
  provided = new Set(swiftPeachModules(module.root))
1031
- await prepareXcodeSwiftPackages(installedWorkspace, undefined, undefined, signal)
1041
+ await prepareXcodeSwiftPackages(installedWorkspace, iosTarget, undefined, signal)
1032
1042
  moduleRoot = module.root
1033
1043
  provided = new Set(swiftPeachModules(module.root))
1034
1044
  const snapshot = await withXcodeProject(
1035
1045
  installedWorkspace,
1036
1046
  {
1047
+ target: iosTarget,
1037
1048
  configuration: 'Debug',
1038
1049
  interfaceRoot: module.root,
1039
1050
  moduleRoot: module.root,
@@ -1164,8 +1175,14 @@ async function collectExpoSwiftSourcesUncached(
1164
1175
  )
1165
1176
  continue
1166
1177
  }
1167
- const prepared = await prepareExpoNativeWorkspace(appRoot, signal)
1168
- return collectExpoSwiftSources(prepared.app, signal, prepared.workspace)
1178
+ const prepared = await prepareExpoNativeWorkspace(appRoot, signal, iosTarget)
1179
+ return collectExpoSwiftSources(
1180
+ prepared.app,
1181
+ signal,
1182
+ prepared.workspace,
1183
+ false,
1184
+ iosTarget,
1185
+ )
1169
1186
  }
1170
1187
  const declarations: {
1171
1188
  reference: string
@@ -1455,11 +1472,13 @@ async function collectExpoSwiftSourcesUncached(
1455
1472
  })
1456
1473
  const cached = readExpoDiscovery(discovery.key)
1457
1474
  if (cached !== undefined) return cached
1458
- const prepared = await prepareExpoNativeWorkspace(appRoot, signal)
1475
+ const prepared = await prepareExpoNativeWorkspace(appRoot, signal, iosTarget)
1459
1476
  const discovered = await collectExpoSwiftSources(
1460
1477
  prepared.app,
1461
1478
  signal,
1462
1479
  prepared.workspace,
1480
+ false,
1481
+ iosTarget,
1463
1482
  )
1464
1483
  const stored = writeExpoDiscovery({
1465
1484
  key: discovery.key,
@@ -1808,7 +1827,7 @@ export async function compileExpoSwiftModules(
1808
1827
  installSwiftInputTrace()
1809
1828
  let key: string
1810
1829
  try {
1811
- key = await discoveryKey(root, options.installedWorkspace, true)
1830
+ key = await discoveryKey(root, options.installedWorkspace, true, options.iosTarget)
1812
1831
  } catch {
1813
1832
  return compileExpoSwiftModulesTraced(root, base, publishArtifact, options)
1814
1833
  }
@@ -1854,6 +1873,7 @@ async function compileExpoSwiftModulesTraced(
1854
1873
  signal,
1855
1874
  options.installedWorkspace,
1856
1875
  nativeWorkspaceAvailable(),
1876
+ options.iosTarget,
1857
1877
  )
1858
1878
  signal.throwIfAborted()
1859
1879
  // reading the app's xcode project resolves remote swift packages with the
@@ -1878,12 +1898,13 @@ async function compileExpoSwiftModulesTraced(
1878
1898
  if (bridge && bridge.installedNamespaces.length > 0) {
1879
1899
  const workspace =
1880
1900
  options.installedWorkspace ??
1881
- (await prepareExpoNativeWorkspace(root, signal)).workspace
1901
+ (await prepareExpoNativeWorkspace(root, signal, options.iosTarget)).workspace
1882
1902
  const module = await resolveSwiftModule({ signal })
1883
- await prepareXcodeSwiftPackages(workspace, undefined, undefined, signal)
1903
+ await prepareXcodeSwiftPackages(workspace, options.iosTarget, undefined, signal)
1884
1904
  await withXcodeProject(
1885
1905
  workspace,
1886
1906
  {
1907
+ target: options.iosTarget,
1887
1908
  configuration: 'Debug',
1888
1909
  interfaceRoot: module.root,
1889
1910
  nativeModules: bridge.installedNamespaces,
@@ -2452,7 +2473,8 @@ export async function handleExpoSwiftRequest(
2452
2473
  res.end('Expo Swift request has no host')
2453
2474
  return true
2454
2475
  }
2455
- const flightKey = `${host}\0${key}`
2476
+ const iosTarget = url.searchParams.get('iosTarget') ?? undefined
2477
+ const flightKey = `${host}\0${key}\0${iosTarget ?? ''}`
2456
2478
  const prepared = openPreparations.take(
2457
2479
  flightKey,
2458
2480
  url.searchParams.get(NATIVE_PREPARED_QUERY_PARAM),
@@ -2467,7 +2489,9 @@ export async function handleExpoSwiftRequest(
2467
2489
  }
2468
2490
  let pending = compiling.get(flightKey)
2469
2491
  if (!pending) {
2470
- pending = compileExpoSwiftModules(key, `http://${host}`).finally(() => {
2492
+ pending = compileExpoSwiftModules(key, `http://${host}`, undefined, {
2493
+ iosTarget,
2494
+ }).finally(() => {
2471
2495
  compiling.delete(flightKey)
2472
2496
  })
2473
2497
  compiling.set(flightKey, pending)
@@ -11,6 +11,7 @@ import type {
11
11
  export interface ExpoSwiftPreparationOptions {
12
12
  signal?: AbortSignal
13
13
  installedWorkspace?: string
14
+ iosTarget?: string
14
15
  }
15
16
 
16
17
  export interface ExpoSwiftSourceUnit {
@@ -131,11 +131,46 @@ export async function readExpoConfigAsync(
131
131
 
132
132
  // a launch method may guard configure() with the safe-configure idiom: an
133
133
  // `if` whose comma-separated clauses read the bundled GoogleService-Info.plist
134
- // and test its API_KEY prefix. every clause is evaluated against the plist the
135
- // target ships, so the answer is the one native launch reaches. any other
136
- // condition cannot be proven and stays refused.
137
- function evaluateFirebaseGuard(header: string, resources: string[]): boolean | null {
138
- const condition = header.replace(/^\s*if\b/, '').replace(/\{\s*$/, '')
134
+ // and test its API_KEY prefix, or call a helper of the app's own source (a
135
+ // Swift function or an Objective-C class method of the app or a framework it
136
+ // builds) whose body does the same, to a small fixed depth. every clause is
137
+ // evaluated against the plist the target ships, so the answer is the one native
138
+ // launch reaches. any other condition cannot be proven and stays refused.
139
+ const HELPER_DEPTH = 3
140
+
141
+ interface GuardScope {
142
+ resources: string[]
143
+ sources: readonly string[]
144
+ }
145
+
146
+ // comments blanked, string contents kept, offsets unchanged.
147
+ const stripComments = (raw: string) =>
148
+ raw.replace(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"(?:\\.|[^"\\])*"/g, (token) =>
149
+ token.startsWith('"') ? token : token.replace(/[^\n]/g, ' '),
150
+ )
151
+
152
+ // top-level statements of a function body: each ends at a `;` or at the brace
153
+ // that closes a block, both outside nested brackets.
154
+ function splitStatements(raw: string) {
155
+ const clean = stripComments(raw)
156
+ const blank = blankSwiftObjcLiterals(raw)
157
+ const statements: string[] = []
158
+ let depth = 0
159
+ let start = 0
160
+ for (let index = 0; index < blank.length; index++) {
161
+ const char = blank[index]
162
+ if (char === '{' || char === '(' || char === '[') depth += 1
163
+ if (char === '}' || char === ')' || char === ']') depth -= 1
164
+ if ((char === ';' && depth === 0) || (char === '}' && depth === 0)) {
165
+ statements.push(clean.slice(start, index + (char === '}' ? 1 : 0)).trim())
166
+ start = index + 1
167
+ }
168
+ }
169
+ statements.push(clean.slice(start).trim())
170
+ return statements.filter(Boolean)
171
+ }
172
+
173
+ function splitClauses(condition: string) {
139
174
  const clauses: string[] = []
140
175
  let depth = 0
141
176
  let start = 0
@@ -152,11 +187,218 @@ function evaluateFirebaseGuard(header: string, resources: string[]): boolean | n
152
187
  }
153
188
  }
154
189
  clauses.push(condition.slice(start).trim())
155
- const sources = resources.filter(
190
+ return clauses
191
+ }
192
+
193
+ // the body of the one function a call names in the app's own sources, or null
194
+ // when it is absent, ambiguous or takes an argument other than Bundle.main.
195
+ function findHelper(
196
+ type: string | undefined,
197
+ name: string,
198
+ label: string | undefined,
199
+ sources: readonly string[],
200
+ ) {
201
+ const found: {
202
+ body: string
203
+ language: 'swift' | 'objc'
204
+ parameter: string | null
205
+ constants: Map<string, string>
206
+ }[] = []
207
+ for (const file of sources) {
208
+ const raw = fs.readFileSync(file, 'utf8')
209
+ const blank = blankSwiftObjcLiterals(raw)
210
+ if (file.endsWith('.swift') && label === undefined) {
211
+ const owners = type
212
+ ? [
213
+ ...blank.matchAll(
214
+ new RegExp(`\\b(?:enum|struct|class|extension)\\s+${type}\\b[^{]*\\{`, 'g'),
215
+ ),
216
+ ].flatMap((match) => {
217
+ const owner = braceBlock(blank, match.index + match[0].length - 1)
218
+ return owner
219
+ ? [{ text: owner.body, offset: match.index + match[0].length }]
220
+ : []
221
+ })
222
+ : [{ text: blank, offset: 0 }]
223
+ for (const owner of owners) {
224
+ const declaration = new RegExp(
225
+ `${type ? '\\b(?:static|class)\\s+' : ''}func\\s+${name}\\s*\\(\\s*\\)\\s*->\\s*Bool\\s*\\{`,
226
+ ).exec(owner.text)
227
+ const block = declaration
228
+ ? braceBlock(
229
+ blank,
230
+ owner.offset + declaration.index + declaration[0].length - 1,
231
+ )
232
+ : null
233
+ if (block)
234
+ found.push({
235
+ body: raw.slice(
236
+ owner.offset + declaration!.index + declaration![0].length,
237
+ block.end - 1,
238
+ ),
239
+ language: 'swift',
240
+ parameter: null,
241
+ constants: new Map(),
242
+ })
243
+ }
244
+ }
245
+ if (/\.mm?$/.test(file) && type) {
246
+ const implementation = new RegExp(`@implementation\\s+${type}\\b`).exec(blank)
247
+ const end = implementation ? blank.indexOf('@end', implementation.index) : -1
248
+ if (!implementation || end < 0) continue
249
+ const suffix =
250
+ label === undefined ? '' : `${label[0]!.toUpperCase()}${label.slice(1)}\\w*`
251
+ const declaration = new RegExp(
252
+ label === undefined
253
+ ? `^\\s*\\+\\s*\\(\\s*BOOL\\s*\\)\\s*${name}\\s*\\{`
254
+ : `^\\s*\\+\\s*\\(\\s*BOOL\\s*\\)\\s*${name}${suffix}\\s*:\\s*\\(\\s*NSBundle\\s*\\*\\s*\\)\\s*(\\w+)\\s*\\{`,
255
+ 'm',
256
+ ).exec(blank.slice(implementation.index, end))
257
+ if (!declaration) continue
258
+ const open = implementation.index + declaration.index + declaration[0].length - 1
259
+ const block = braceBlock(blank, open)
260
+ if (!block) continue
261
+ const constants = new Map<string, string>()
262
+ for (const constant of stripComments(raw).matchAll(
263
+ /\bNSString\s*\*\s*const\s+(\w+)\s*=\s*@"([^"]*)"\s*;/g,
264
+ ))
265
+ constants.set(constant[1]!, constant[2]!)
266
+ found.push({
267
+ body: raw.slice(open + 1, block.end - 1),
268
+ language: 'objc',
269
+ parameter: declaration[1] ?? null,
270
+ constants,
271
+ })
272
+ }
273
+ }
274
+ return found.length === 1 ? found[0]! : null
275
+ }
276
+
277
+ // whether a call in a clause or return holds. true, false or null (unprovable).
278
+ function evaluateHelperCall(
279
+ expression: string,
280
+ scope: GuardScope,
281
+ depth: number,
282
+ ): boolean | null {
283
+ if (depth >= HELPER_DEPTH) return null
284
+ const call =
285
+ /^(?:self\s*\.\s*)?(?:([A-Z]\w*)\s*\.\s*)?(\w+)\s*\(\s*(?:(\w+)\s*:\s*Bundle\.main)?\s*\)$/.exec(
286
+ expression,
287
+ )
288
+ if (!call) return null
289
+ const helper = findHelper(call[1], call[2]!, call[3], scope.sources)
290
+ if (!helper) return null
291
+ return helper.language === 'swift'
292
+ ? evaluateSwiftBody(helper.body, scope, depth + 1)
293
+ : evaluateObjcBody(helper.body, helper.parameter, helper.constants, scope)
294
+ }
295
+
296
+ function evaluateSwiftBody(
297
+ body: string,
298
+ scope: GuardScope,
299
+ depth: number,
300
+ ): boolean | null {
301
+ const bound = new Map<string, unknown>()
302
+ for (const statement of splitStatements(body)) {
303
+ const result = /^return\s+([\s\S]+)$/.exec(statement)
304
+ if (result) return evaluateClauses([result[1]!.trim()], scope, bound, depth)
305
+ const branch =
306
+ /^(if|guard)\b([\s\S]*?)(?:\belse\b)?\s*\{\s*return\s+(true|false)\s*\}$/.exec(
307
+ statement,
308
+ )
309
+ if (!branch) return null
310
+ const holds = evaluateClauses(splitClauses(branch[2]!), scope, bound, depth)
311
+ if (holds === null) return null
312
+ if (holds === (branch[1] === 'if')) return branch[3] === 'true'
313
+ }
314
+ return null
315
+ }
316
+
317
+ // the sequential core of a class method that tests the main bundle's plist:
318
+ // bundle path, resource lookup, dictionary read and string tests, each
319
+ // followed by an early return.
320
+ function evaluateObjcBody(
321
+ body: string,
322
+ bundle: string | null,
323
+ constants: Map<string, string>,
324
+ scope: GuardScope,
325
+ ): boolean | null {
326
+ const plists = scope.resources.filter(
327
+ (file) => path.basename(file) === 'GoogleService-Info.plist',
328
+ )
329
+ const variables = new Map<string, unknown>()
330
+ const literal = (text: string) => {
331
+ const quoted = /^@"([^"]*)"$/.exec(text.trim())
332
+ return quoted ? quoted[1] : constants.get(text.trim())
333
+ }
334
+ const truthy = (name: string) => {
335
+ const value = variables.get(name)
336
+ return typeof value === 'string' ? value.length > 0 : value !== undefined
337
+ }
338
+ for (const statement of splitStatements(body)) {
339
+ if (/^return\s+YES$/.test(statement)) return true
340
+ if (/^return\s+NO$/.test(statement)) return false
341
+ const early =
342
+ /^if\s*\(\s*(!?)\s*(\w+)(\.length)?\s*\)\s*\{?\s*return\s+(YES|NO)\s*;?\s*\}?$/.exec(
343
+ statement,
344
+ )
345
+ if (early) {
346
+ if (!variables.has(early[2]!)) return null
347
+ if ((early[1] === '!') === !truthy(early[2]!)) return early[4] === 'YES'
348
+ continue
349
+ }
350
+ const declaration = /^(?:NSString|NSDictionary)\s*\*\s*(\w+)\s*=\s*([\s\S]+)$/.exec(
351
+ statement,
352
+ )
353
+ if (!declaration) return null
354
+ const name = declaration[1]!
355
+ const value = declaration[2]!
356
+ const bundlePath = new RegExp(`^${bundle}\\.bundlePath$`).exec(value.trim())
357
+ const resource = new RegExp(
358
+ `^\\[\\s*${bundle}\\s+pathForResource:\\s*([^\\s]+)\\s+ofType:\\s*([^\\s\\]]+)\\s*\\]$`,
359
+ ).exec(value.trim())
360
+ const dictionary =
361
+ /^\[\s*NSDictionary\s+dictionaryWithContentsOfFile:\s*(\w+)\s*\]$/.exec(
362
+ value.trim(),
363
+ )
364
+ const entry = /^(\w+)\s*\[\s*([^\]\s]+)\s*\]$/.exec(value.trim())
365
+ if (bundle && bundlePath) variables.set(name, 'main bundle')
366
+ else if (bundle && resource) {
367
+ if (
368
+ literal(resource[1]!) !== 'GoogleService-Info' ||
369
+ literal(resource[2]!) !== 'plist'
370
+ )
371
+ return null
372
+ variables.set(name, plists.length === 1 ? plists[0] : undefined)
373
+ } else if (dictionary && variables.has(dictionary[1]!)) {
374
+ const file = variables.get(dictionary[1]!)
375
+ const parsed =
376
+ typeof file === 'string'
377
+ ? parsePlistSource(fs.readFileSync(file, 'utf8'))
378
+ : undefined
379
+ variables.set(name, isRecord(parsed) ? parsed : undefined)
380
+ } else if (entry && variables.has(entry[1]!)) {
381
+ const key = literal(entry[2]!)
382
+ const source = variables.get(entry[1]!)
383
+ if (key === undefined) return null
384
+ variables.set(name, isRecord(source) ? source[key] : undefined)
385
+ } else return null
386
+ }
387
+ return null
388
+ }
389
+
390
+ function evaluateClauses(
391
+ clauses: string[],
392
+ scope: GuardScope,
393
+ bound: Map<string, unknown>,
394
+ depth: number,
395
+ ): boolean | null {
396
+ const sources = scope.resources.filter(
156
397
  (file) => path.basename(file) === 'GoogleService-Info.plist',
157
398
  )
158
- const bound = new Map<string, unknown>()
159
399
  for (const clause of clauses) {
400
+ if (clause === 'true') continue
401
+ if (clause === 'false') return false
160
402
  if (/^FirebaseApp\s*\.\s*app\s*\(\s*\)\s*==\s*nil$/.test(clause)) continue
161
403
  const resource =
162
404
  /^let\s+(\w+)\s*=\s*Bundle\.main\.path\s*\(\s*forResource:\s*"GoogleService-Info"\s*,\s*ofType:\s*"plist"\s*\)$/.exec(
@@ -193,11 +435,19 @@ function evaluateFirebaseGuard(header: string, resources: string[]): boolean | n
193
435
  if (!subject.startsWith(prefix[2])) return false
194
436
  continue
195
437
  }
196
- return null
438
+ const negated = clause.startsWith('!')
439
+ const called = evaluateHelperCall(clause.replace(/^!\s*/, ''), scope, depth)
440
+ if (called === null) return null
441
+ if (called === negated) return false
197
442
  }
198
443
  return true
199
444
  }
200
445
 
446
+ function evaluateFirebaseGuard(header: string, scope: GuardScope): boolean | null {
447
+ const condition = header.replace(/^\s*if\b/, '').replace(/\{\s*$/, '')
448
+ return evaluateClauses(splitClauses(condition), scope, new Map(), 0)
449
+ }
450
+
201
451
  // native source with comments and string contents blanked in place, so brace
202
452
  // and keyword scans see only code and offsets still index the raw text.
203
453
  function blankSwiftObjcLiterals(raw: string) {
@@ -370,7 +620,16 @@ function readTargetGoogleServicesFile(
370
620
  if (nesting === 0) topLevelBefore += token
371
621
  if (token === '}') nesting -= 1
372
622
  }
373
- const guarded = guard === null ? true : evaluateFirebaseGuard(guard, app.resources)
623
+ const guarded =
624
+ guard === null
625
+ ? true
626
+ : evaluateFirebaseGuard(guard, {
627
+ resources: app.resources,
628
+ sources: [
629
+ ...app.allSources,
630
+ ...app.frameworks.flatMap((framework) => framework.allSources),
631
+ ],
632
+ })
374
633
  if (
375
634
  guarded === null ||
376
635
  depth !== 1 ||