peachsim 0.1.1469 → 0.1.1481

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 (102) hide show
  1. package/cli/commands/control.ts +68 -42
  2. package/cli/commands/detox.ts +15 -10
  3. package/cli/commands/flow.ts +1 -2
  4. package/cli/commands/inspect/settling.ts +5 -1
  5. package/cli/commands/setup.ts +20 -13
  6. package/cli/commands/test.ts +2 -1
  7. package/cli/dev-build-freshness.ts +14 -14
  8. package/cli/drivers/playwright-sim-host.ts +7 -2
  9. package/cli/drivers/playwright.ts +6 -6
  10. package/cli/outbound-endpoints.ts +80 -6
  11. package/detox/index.ts +27 -14
  12. package/detox/matchers.ts +17 -6
  13. package/dist-lib/agent-daemon-client.cjs +1 -1
  14. package/dist-lib/agent-events.cjs +1 -1
  15. package/dist-lib/attached-projects.cjs +1 -1
  16. package/dist-lib/auth/shared-session.cjs +1 -1
  17. package/dist-lib/backend-origin.cjs +1 -1
  18. package/dist-lib/beta.cjs +1 -1
  19. package/dist-lib/beta.mjs +1 -1
  20. package/dist-lib/bridge-constants.cjs +1 -1
  21. package/dist-lib/bridge-contract-input.cjs +1 -1
  22. package/dist-lib/bridge-contract-input.mjs +1 -1
  23. package/dist-lib/bridge-contract.cjs +1 -1
  24. package/dist-lib/bridge-contract.mjs +1 -1
  25. package/dist-lib/bundle-channel.cjs +54 -15
  26. package/dist-lib/capture-contract.cjs +1 -1
  27. package/dist-lib/capture-contract.mjs +1 -1
  28. package/dist-lib/cloud-contract.cjs +1 -1
  29. package/dist-lib/cloud-contract.mjs +1 -1
  30. package/dist-lib/cloud-test-args.cjs +1 -1
  31. package/dist-lib/cloud-test-args.mjs +1 -1
  32. package/dist-lib/cloud.cjs +1 -1
  33. package/dist-lib/cloud.mjs +1 -1
  34. package/dist-lib/config.cjs +19 -3
  35. package/dist-lib/config.mjs +19 -3
  36. package/dist-lib/detox/index.cjs +125 -52
  37. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  38. package/dist-lib/expo-swift-bundle.cjs +30 -9
  39. package/dist-lib/expo-swift-metadata.cjs +18 -6
  40. package/dist-lib/expo-swift-metadata.mjs +18 -6
  41. package/dist-lib/home-paths.cjs +1 -1
  42. package/dist-lib/host/bridge-host.cjs +621 -390
  43. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  44. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  45. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  46. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  47. package/dist-lib/host/websocket-proxy.cjs +1 -1
  48. package/dist-lib/index.cjs +46 -19
  49. package/dist-lib/jump-to-source-babel.cjs +1 -1
  50. package/dist-lib/jump-to-source-native.cjs +1 -1
  51. package/dist-lib/kotlin-host.cjs +1 -1
  52. package/dist-lib/menu.cjs +1 -1
  53. package/dist-lib/menu.mjs +1 -1
  54. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  55. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  56. package/dist-lib/metro-production-bundle.cjs +24 -6
  57. package/dist-lib/metro-production-bundle.mjs +22 -6
  58. package/dist-lib/metro.cjs +41 -18
  59. package/dist-lib/native-app-identity-project.cjs +1 -1
  60. package/dist-lib/native-app-identity-project.mjs +1 -1
  61. package/dist-lib/native-app-identity.cjs +19 -5
  62. package/dist-lib/native-app-identity.mjs +19 -5
  63. package/dist-lib/native-firebase-metadata.cjs +22 -7
  64. package/dist-lib/native-firebase-metadata.mjs +20 -7
  65. package/dist-lib/plist.cjs +1 -1
  66. package/dist-lib/plist.mjs +1 -1
  67. package/dist-lib/profiles.cjs +1 -1
  68. package/dist-lib/public-brand.cjs +1 -1
  69. package/dist-lib/react-native-host-modules.cjs +3 -1
  70. package/dist-lib/react-native-host-modules.mjs +3 -1
  71. package/dist-lib/scripts/dev-server-scanner.cjs +404 -279
  72. package/dist-lib/sdk.cjs +6 -2
  73. package/dist-lib/sdk.mjs +6 -2
  74. package/dist-lib/skills.cjs +757 -531
  75. package/dist-lib/swift-compile.cjs +7 -2
  76. package/dist-lib/swift-compile.mjs +7 -2
  77. package/dist-lib/swift-package.cjs +1 -1
  78. package/dist-lib/swift-package.mjs +1 -1
  79. package/dist-lib/swift-submit.cjs +1 -1
  80. package/dist-lib/swift-submit.mjs +1 -1
  81. package/dist-lib/swift-toolchain.cjs +1 -1
  82. package/dist-lib/swift.cjs +1 -1
  83. package/dist-lib/vite-swift.cjs +7 -2
  84. package/dist-lib/vite.cjs +1 -1
  85. package/dist-lib/worklet-executable.cjs +27 -7
  86. package/dist-lib/worklet-executable.mjs +27 -7
  87. package/package.json +1 -1
  88. package/scripts/dev-server-scanner.ts +493 -188
  89. package/src/admitted-mac-build.ts +12 -0
  90. package/src/bridge-constants.ts +5 -3
  91. package/src/bundleGlobalFooter.ts +26 -3
  92. package/src/config.ts +3 -2
  93. package/src/configured-bundle-producer.ts +2 -1
  94. package/src/expo-swift-host.ts +33 -7
  95. package/src/host/bridge-host.ts +34 -6
  96. package/src/metro-production-bundle.ts +11 -4
  97. package/src/native-app-identity.ts +3 -2
  98. package/src/native-firebase-metadata.ts +5 -3
  99. package/src/react-native-host-modules.ts +2 -0
  100. package/src/swift-compile.ts +5 -4
  101. package/src/worker-system-chunks.ts +61 -58
  102. package/src/worklet-executable.ts +38 -6
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/host/fetch-proxy-overrides.ts
4
4
  var FETCH_PROXY_NATIVE_USER_AGENT_HEADER = "x-sootsim-native-user-agent";
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -59,6 +59,27 @@ var init_is_record = __esm({
59
59
  }
60
60
  });
61
61
 
62
+ // src/bundleGlobalFooter.ts
63
+ function findBundleFooter(source, prefix2) {
64
+ let end = source.length;
65
+ while (end > 0) {
66
+ const newline = source.lastIndexOf("\n", end - 1);
67
+ if (newline < 0) return -1;
68
+ const line = newline + 1;
69
+ if (source.startsWith(prefix2, line)) return newline;
70
+ if (line !== end && !source.startsWith("globalThis.", line) && !source.startsWith("//", line)) {
71
+ return -1;
72
+ }
73
+ end = newline;
74
+ }
75
+ return -1;
76
+ }
77
+ var init_bundleGlobalFooter = __esm({
78
+ "src/bundleGlobalFooter.ts"() {
79
+ "use strict";
80
+ }
81
+ });
82
+
62
83
  // src/public-brand.ts
63
84
  var name, peachPublicBrand, rnxPublicBrand;
64
85
  var init_public_brand = __esm({
@@ -2029,7 +2050,7 @@ function readPeachBundleConfig(value) {
2029
2050
  return { config: value.config, runtimePackages: [...value.runtimePackages] };
2030
2051
  }
2031
2052
  function readPeachBundleConfigFooter(source) {
2032
- const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
2053
+ const start = findBundleFooter(source, BUNDLE_CONFIG_PREFIX);
2033
2054
  if (start < 0) return null;
2034
2055
  const end = source.indexOf("\n", start + 1);
2035
2056
  const line = source.slice(start + 1, end < 0 ? void 0 : end);
@@ -2047,7 +2068,7 @@ function createPeachBundleConfigFooter(config) {
2047
2068
  function detachPeachBundleConfigFooter(source) {
2048
2069
  const configuredBundle = readPeachBundleConfigFooter(source);
2049
2070
  if (!configuredBundle) return { source, configuredBundle };
2050
- const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
2071
+ const start = findBundleFooter(source, BUNDLE_CONFIG_PREFIX);
2051
2072
  const end = source.indexOf("\n", start + 1);
2052
2073
  return {
2053
2074
  source: source.slice(0, start) + source.slice(end < 0 ? source.length : end),
@@ -2117,6 +2138,7 @@ var init_config = __esm({
2117
2138
  "src/config.ts"() {
2118
2139
  "use strict";
2119
2140
  init_version();
2141
+ init_bundleGlobalFooter();
2120
2142
  init_is_record();
2121
2143
  PEACH_CONFIG_QUERY_PARAM = "peachConfig";
2122
2144
  BUNDLE_CONFIG_PREFIX = "globalThis.__peachBundleConfig=";
@@ -2253,7 +2275,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
2253
2275
  config: packagedConfig,
2254
2276
  runtimePackages: [...neededPackages].sort()
2255
2277
  });
2256
- const identityStart = source.lastIndexOf("\nglobalThis.__sootsimModulePaths=");
2278
+ const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
2257
2279
  return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
2258
2280
  }
2259
2281
  var import_node_fs12, import_node_path14, import_sucrase, import_terser;
@@ -2265,6 +2287,7 @@ var init_configured_bundle_producer = __esm({
2265
2287
  import_sucrase = require("sucrase");
2266
2288
  import_terser = require("terser");
2267
2289
  init_replacementModule();
2290
+ init_bundleGlobalFooter();
2268
2291
  init_config();
2269
2292
  init_replacement_module_handler();
2270
2293
  }
@@ -2394,16 +2417,17 @@ function rnxCloudScopesAllowCommand(scopes, type) {
2394
2417
  init_is_record();
2395
2418
 
2396
2419
  // src/metro-production-bundle.ts
2420
+ init_bundleGlobalFooter();
2397
2421
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
2398
2422
  var RNX_METRO_MODULE_IDENTITY_VERSION = 2;
2399
2423
  var RNXSIM_METRO_SOURCE_MAP_COMMENT = "//# sourceMappingURL=";
2400
2424
  function detachRNXMetroSourceMapUrl(bundleText) {
2401
2425
  const trimmedEnd = bundleText.trimEnd();
2402
- const commentStart = trimmedEnd.lastIndexOf(`
2403
- ${RNXSIM_METRO_SOURCE_MAP_COMMENT}`);
2404
- if (commentStart < 0) return { source: bundleText, sourceMappingUrl: null };
2426
+ const commentStart = trimmedEnd.lastIndexOf("\n");
2427
+ if (commentStart < 0 || !trimmedEnd.startsWith(RNXSIM_METRO_SOURCE_MAP_COMMENT, commentStart + 1)) {
2428
+ return { source: bundleText, sourceMappingUrl: null };
2429
+ }
2405
2430
  const url = trimmedEnd.slice(commentStart + 1 + RNXSIM_METRO_SOURCE_MAP_COMMENT.length);
2406
- if (url.includes("\n")) return { source: bundleText, sourceMappingUrl: null };
2407
2431
  return { source: trimmedEnd.slice(0, commentStart), sourceMappingUrl: url };
2408
2432
  }
2409
2433
  function createRNXMetroModuleIdentityFooter(identity) {
@@ -7140,7 +7164,11 @@ async function waitForSootsimIdle({
7140
7164
  for (const n of hierarchy) {
7141
7165
  const layout = n && n.layout
7142
7166
  if (layout && layout.width > 0) {
7143
- const abs = (n && (n.absolute || n.absolutePosition)) || layout
7167
+ // painted bounds catch a scroll fling. background playback
7168
+ // keeps a view's painted bounds moving forever, so it and its
7169
+ // subtree count by their own layout; the rest of the screen
7170
+ // still catches the fling.
7171
+ const abs = n.backgroundPlayback ? layout : n.absolute || n.absolutePosition || layout
7144
7172
  nodes.push(Math.round(abs.x) + ',' + Math.round(abs.y) + ',' + Math.round(layout.width))
7145
7173
  }
7146
7174
  notePreviewProgress(
@@ -9430,6 +9458,9 @@ var import_path4 = __toESM(require("path"), 1);
9430
9458
  init_app_project();
9431
9459
  init_replacement_module_handler();
9432
9460
 
9461
+ // src/native-app-identity.ts
9462
+ init_bundleGlobalFooter();
9463
+
9433
9464
  // src/openstep-plist.ts
9434
9465
  var isDict = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
9435
9466
  var str = (value) => typeof value === "string" ? value : void 0;
@@ -9542,15 +9573,13 @@ function createNativeAppIdentityFooter(identity) {
9542
9573
  ${NATIVE_APP_IDENTITY_PREFIX}${payload};`;
9543
9574
  }
9544
9575
  function nativeAppIdentityFooterStart(source) {
9545
- return source.lastIndexOf(`
9546
- ${NATIVE_APP_IDENTITY_PREFIX}`);
9576
+ return findBundleFooter(source, NATIVE_APP_IDENTITY_PREFIX);
9547
9577
  }
9548
9578
  function insertNativeAppIdentityFooter(source, identity) {
9549
9579
  const existing = nativeAppIdentityFooterStart(source);
9550
9580
  const existingEnd = existing < 0 ? -1 : source.includes("\n", existing + 1) ? source.indexOf("\n", existing + 1) : -1;
9551
9581
  const withoutExisting = existing < 0 ? source : source.slice(0, existing) + source.slice(existingEnd < 0 ? source.length : existingEnd);
9552
- const moduleFooter = withoutExisting.lastIndexOf(`
9553
- ${METRO_MODULE_PATHS_PREFIX}`);
9582
+ const moduleFooter = findBundleFooter(withoutExisting, METRO_MODULE_PATHS_PREFIX);
9554
9583
  const footer = createNativeAppIdentityFooter(identity);
9555
9584
  if (moduleFooter < 0) return withoutExisting + footer;
9556
9585
  return withoutExisting.slice(0, moduleFooter) + footer + withoutExisting.slice(moduleFooter);
@@ -11245,6 +11274,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
11245
11274
  }
11246
11275
 
11247
11276
  // src/native-firebase-metadata.ts
11277
+ init_bundleGlobalFooter();
11248
11278
  var PREFIX = "globalThis.__peachNativeFirebaseConfig=";
11249
11279
  var MODULE_PREFIX = "globalThis.__sootsimModulePaths=";
11250
11280
  var PLATFORMS = ["ios", "android"];
@@ -11294,8 +11324,7 @@ function createNativeFirebaseFooter(config) {
11294
11324
  ${PREFIX}${json};`;
11295
11325
  }
11296
11326
  function readNativeFirebaseFooter(source) {
11297
- const start = source.lastIndexOf(`
11298
- ${PREFIX}`);
11327
+ const start = findBundleFooter(source, PREFIX);
11299
11328
  if (start < 0) return null;
11300
11329
  const lineEnd = source.indexOf("\n", start + 1);
11301
11330
  const line = source.slice(start + 1, lineEnd < 0 ? void 0 : lineEnd);
@@ -11308,16 +11337,14 @@ ${PREFIX}`);
11308
11337
  function detachNativeFirebaseFooter(source) {
11309
11338
  const config = readNativeFirebaseFooter(source);
11310
11339
  if (config === null) return { source, config };
11311
- const start = source.lastIndexOf(`
11312
- ${PREFIX}`);
11340
+ const start = findBundleFooter(source, PREFIX);
11313
11341
  const lineEnd = source.indexOf("\n", start + 1);
11314
11342
  const end = lineEnd < 0 ? source.length : lineEnd;
11315
11343
  return { source: source.slice(0, start) + source.slice(end), config };
11316
11344
  }
11317
11345
  function insertNativeFirebaseFooter(source, config) {
11318
11346
  const detached = detachNativeFirebaseFooter(source).source;
11319
- const start = detached.lastIndexOf(`
11320
- ${MODULE_PREFIX}`);
11347
+ const start = findBundleFooter(detached, MODULE_PREFIX);
11321
11348
  const footer = createNativeFirebaseFooter(config);
11322
11349
  return start < 0 ? detached + footer : detached.slice(0, start) + footer + detached.slice(start);
11323
11350
  }
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
package/dist-lib/menu.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/menu.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/public-brand.ts
4
4
  var name = "Peach";
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (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.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -34,6 +34,24 @@ __export(metro_production_bundle_exports, {
34
34
  validateRNXMetroModulePaths: () => validateRNXMetroModulePaths
35
35
  });
36
36
  module.exports = __toCommonJS(metro_production_bundle_exports);
37
+
38
+ // src/bundleGlobalFooter.ts
39
+ function findBundleFooter(source, prefix) {
40
+ let end = source.length;
41
+ while (end > 0) {
42
+ const newline = source.lastIndexOf("\n", end - 1);
43
+ if (newline < 0) return -1;
44
+ const line = newline + 1;
45
+ if (source.startsWith(prefix, line)) return newline;
46
+ if (line !== end && !source.startsWith("globalThis.", line) && !source.startsWith("//", line)) {
47
+ return -1;
48
+ }
49
+ end = newline;
50
+ }
51
+ return -1;
52
+ }
53
+
54
+ // src/metro-production-bundle.ts
37
55
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
38
56
  var RNX_METRO_MODULE_IDENTITY_VERSION = 2;
39
57
  function toPeachProductionBundleUrl(bundleUrl) {
@@ -55,11 +73,11 @@ function toPeachDevelopmentBundleUrl(bundleUrl) {
55
73
  var RNXSIM_METRO_SOURCE_MAP_COMMENT = "//# sourceMappingURL=";
56
74
  function detachRNXMetroSourceMapUrl(bundleText) {
57
75
  const trimmedEnd = bundleText.trimEnd();
58
- const commentStart = trimmedEnd.lastIndexOf(`
59
- ${RNXSIM_METRO_SOURCE_MAP_COMMENT}`);
60
- if (commentStart < 0) return { source: bundleText, sourceMappingUrl: null };
76
+ const commentStart = trimmedEnd.lastIndexOf("\n");
77
+ if (commentStart < 0 || !trimmedEnd.startsWith(RNXSIM_METRO_SOURCE_MAP_COMMENT, commentStart + 1)) {
78
+ return { source: bundleText, sourceMappingUrl: null };
79
+ }
61
80
  const url = trimmedEnd.slice(commentStart + 1 + RNXSIM_METRO_SOURCE_MAP_COMMENT.length);
62
- if (url.includes("\n")) return { source: bundleText, sourceMappingUrl: null };
63
81
  return { source: trimmedEnd.slice(0, commentStart), sourceMappingUrl: url };
64
82
  }
65
83
  function createRNXMetroModuleIdentityFooter(identity) {
@@ -78,7 +96,7 @@ function readRNXMetroModuleIdentity(bundleText) {
78
96
  const withoutMap = detached.source;
79
97
  const footerPrefix = `
80
98
  ${RNXSIM_METRO_MODULE_PATHS_PREFIX}`;
81
- const footerStart = withoutMap.lastIndexOf(footerPrefix);
99
+ const footerStart = findBundleFooter(withoutMap, RNXSIM_METRO_MODULE_PATHS_PREFIX);
82
100
  if (footerStart < 0) return null;
83
101
  if (!withoutMap.endsWith(";")) {
84
102
  throw new Error("Metro module identity footer is truncated");
@@ -1,4 +1,20 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
+
3
+ // src/bundleGlobalFooter.ts
4
+ function findBundleFooter(source, prefix) {
5
+ let end = source.length;
6
+ while (end > 0) {
7
+ const newline = source.lastIndexOf("\n", end - 1);
8
+ if (newline < 0) return -1;
9
+ const line = newline + 1;
10
+ if (source.startsWith(prefix, line)) return newline;
11
+ if (line !== end && !source.startsWith("globalThis.", line) && !source.startsWith("//", line)) {
12
+ return -1;
13
+ }
14
+ end = newline;
15
+ }
16
+ return -1;
17
+ }
2
18
 
3
19
  // src/metro-production-bundle.ts
4
20
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
@@ -22,11 +38,11 @@ function toPeachDevelopmentBundleUrl(bundleUrl) {
22
38
  var RNXSIM_METRO_SOURCE_MAP_COMMENT = "//# sourceMappingURL=";
23
39
  function detachRNXMetroSourceMapUrl(bundleText) {
24
40
  const trimmedEnd = bundleText.trimEnd();
25
- const commentStart = trimmedEnd.lastIndexOf(`
26
- ${RNXSIM_METRO_SOURCE_MAP_COMMENT}`);
27
- if (commentStart < 0) return { source: bundleText, sourceMappingUrl: null };
41
+ const commentStart = trimmedEnd.lastIndexOf("\n");
42
+ if (commentStart < 0 || !trimmedEnd.startsWith(RNXSIM_METRO_SOURCE_MAP_COMMENT, commentStart + 1)) {
43
+ return { source: bundleText, sourceMappingUrl: null };
44
+ }
28
45
  const url = trimmedEnd.slice(commentStart + 1 + RNXSIM_METRO_SOURCE_MAP_COMMENT.length);
29
- if (url.includes("\n")) return { source: bundleText, sourceMappingUrl: null };
30
46
  return { source: trimmedEnd.slice(0, commentStart), sourceMappingUrl: url };
31
47
  }
32
48
  function createRNXMetroModuleIdentityFooter(identity) {
@@ -45,7 +61,7 @@ function readRNXMetroModuleIdentity(bundleText) {
45
61
  const withoutMap = detached.source;
46
62
  const footerPrefix = `
47
63
  ${RNXSIM_METRO_MODULE_PATHS_PREFIX}`;
48
- const footerStart = withoutMap.lastIndexOf(footerPrefix);
64
+ const footerStart = findBundleFooter(withoutMap, RNXSIM_METRO_MODULE_PATHS_PREFIX);
49
65
  if (footerStart < 0) return null;
50
66
  if (!withoutMap.endsWith(";")) {
51
67
  throw new Error("Metro module identity footer is truncated");
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -582,6 +582,27 @@ var init_replacement_module_handler = __esm({
582
582
  }
583
583
  });
584
584
 
585
+ // src/bundleGlobalFooter.ts
586
+ function findBundleFooter(source, prefix2) {
587
+ let end = source.length;
588
+ while (end > 0) {
589
+ const newline = source.lastIndexOf("\n", end - 1);
590
+ if (newline < 0) return -1;
591
+ const line = newline + 1;
592
+ if (source.startsWith(prefix2, line)) return newline;
593
+ if (line !== end && !source.startsWith("globalThis.", line) && !source.startsWith("//", line)) {
594
+ return -1;
595
+ }
596
+ end = newline;
597
+ }
598
+ return -1;
599
+ }
600
+ var init_bundleGlobalFooter = __esm({
601
+ "src/bundleGlobalFooter.ts"() {
602
+ "use strict";
603
+ }
604
+ });
605
+
585
606
  // ../../node_modules/plist/lib/parse.js
586
607
  var require_parse = __commonJS({
587
608
  "../../node_modules/plist/lib/parse.js"(exports2) {
@@ -2012,7 +2033,7 @@ function readPeachBundleConfig(value) {
2012
2033
  return { config: value.config, runtimePackages: [...value.runtimePackages] };
2013
2034
  }
2014
2035
  function readPeachBundleConfigFooter(source) {
2015
- const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
2036
+ const start = findBundleFooter(source, BUNDLE_CONFIG_PREFIX);
2016
2037
  if (start < 0) return null;
2017
2038
  const end = source.indexOf("\n", start + 1);
2018
2039
  const line = source.slice(start + 1, end < 0 ? void 0 : end);
@@ -2030,7 +2051,7 @@ function createPeachBundleConfigFooter(config) {
2030
2051
  function detachPeachBundleConfigFooter(source) {
2031
2052
  const configuredBundle = readPeachBundleConfigFooter(source);
2032
2053
  if (!configuredBundle) return { source, configuredBundle };
2033
- const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
2054
+ const start = findBundleFooter(source, BUNDLE_CONFIG_PREFIX);
2034
2055
  const end = source.indexOf("\n", start + 1);
2035
2056
  return {
2036
2057
  source: source.slice(0, start) + source.slice(end < 0 ? source.length : end),
@@ -2100,6 +2121,7 @@ var init_config = __esm({
2100
2121
  "src/config.ts"() {
2101
2122
  "use strict";
2102
2123
  init_version();
2124
+ init_bundleGlobalFooter();
2103
2125
  init_is_record();
2104
2126
  PEACH_CONFIG_QUERY_PARAM = "peachConfig";
2105
2127
  BUNDLE_CONFIG_PREFIX = "globalThis.__peachBundleConfig=";
@@ -2253,7 +2275,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
2253
2275
  config: packagedConfig,
2254
2276
  runtimePackages: [...neededPackages].sort()
2255
2277
  });
2256
- const identityStart = source.lastIndexOf("\nglobalThis.__sootsimModulePaths=");
2278
+ const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
2257
2279
  return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
2258
2280
  }
2259
2281
  var import_node_fs8, import_node_path9, import_sucrase, import_terser;
@@ -2265,6 +2287,7 @@ var init_configured_bundle_producer = __esm({
2265
2287
  import_sucrase = require("sucrase");
2266
2288
  import_terser = require("terser");
2267
2289
  init_replacementModule();
2290
+ init_bundleGlobalFooter();
2268
2291
  init_config();
2269
2292
  init_replacement_module_handler();
2270
2293
  }
@@ -2307,6 +2330,7 @@ function tagRnxBundleForPlugin(bundleUrl, replacementOrigin, replacementToken, p
2307
2330
  init_replacement_module_handler();
2308
2331
 
2309
2332
  // src/metro-production-bundle.ts
2333
+ init_bundleGlobalFooter();
2310
2334
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
2311
2335
  var RNX_METRO_MODULE_IDENTITY_VERSION = 2;
2312
2336
  function toPeachProductionBundleUrl(bundleUrl) {
@@ -2328,11 +2352,11 @@ function toPeachDevelopmentBundleUrl(bundleUrl) {
2328
2352
  var RNXSIM_METRO_SOURCE_MAP_COMMENT = "//# sourceMappingURL=";
2329
2353
  function detachRNXMetroSourceMapUrl(bundleText) {
2330
2354
  const trimmedEnd = bundleText.trimEnd();
2331
- const commentStart = trimmedEnd.lastIndexOf(`
2332
- ${RNXSIM_METRO_SOURCE_MAP_COMMENT}`);
2333
- if (commentStart < 0) return { source: bundleText, sourceMappingUrl: null };
2355
+ const commentStart = trimmedEnd.lastIndexOf("\n");
2356
+ if (commentStart < 0 || !trimmedEnd.startsWith(RNXSIM_METRO_SOURCE_MAP_COMMENT, commentStart + 1)) {
2357
+ return { source: bundleText, sourceMappingUrl: null };
2358
+ }
2334
2359
  const url = trimmedEnd.slice(commentStart + 1 + RNXSIM_METRO_SOURCE_MAP_COMMENT.length);
2335
- if (url.includes("\n")) return { source: bundleText, sourceMappingUrl: null };
2336
2360
  return { source: trimmedEnd.slice(0, commentStart), sourceMappingUrl: url };
2337
2361
  }
2338
2362
  function createRNXMetroModuleIdentityFooter(identity) {
@@ -2347,6 +2371,9 @@ function appendRNXMetroModuleIdentityFooter(bundleText, identity) {
2347
2371
  ${RNXSIM_METRO_SOURCE_MAP_COMMENT}${detached.sourceMappingUrl}`;
2348
2372
  }
2349
2373
 
2374
+ // src/native-app-identity.ts
2375
+ init_bundleGlobalFooter();
2376
+
2350
2377
  // src/openstep-plist.ts
2351
2378
  var isDict = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
2352
2379
  var str = (value) => typeof value === "string" ? value : void 0;
@@ -2459,15 +2486,13 @@ function createNativeAppIdentityFooter(identity) {
2459
2486
  ${NATIVE_APP_IDENTITY_PREFIX}${payload};`;
2460
2487
  }
2461
2488
  function nativeAppIdentityFooterStart(source) {
2462
- return source.lastIndexOf(`
2463
- ${NATIVE_APP_IDENTITY_PREFIX}`);
2489
+ return findBundleFooter(source, NATIVE_APP_IDENTITY_PREFIX);
2464
2490
  }
2465
2491
  function insertNativeAppIdentityFooter(source, identity) {
2466
2492
  const existing = nativeAppIdentityFooterStart(source);
2467
2493
  const existingEnd = existing < 0 ? -1 : source.includes("\n", existing + 1) ? source.indexOf("\n", existing + 1) : -1;
2468
2494
  const withoutExisting = existing < 0 ? source : source.slice(0, existing) + source.slice(existingEnd < 0 ? source.length : existingEnd);
2469
- const moduleFooter = withoutExisting.lastIndexOf(`
2470
- ${METRO_MODULE_PATHS_PREFIX}`);
2495
+ const moduleFooter = findBundleFooter(withoutExisting, METRO_MODULE_PATHS_PREFIX);
2471
2496
  const footer = createNativeAppIdentityFooter(identity);
2472
2497
  if (moduleFooter < 0) return withoutExisting + footer;
2473
2498
  return withoutExisting.slice(0, moduleFooter) + footer + withoutExisting.slice(moduleFooter);
@@ -4162,6 +4187,7 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
4162
4187
  }
4163
4188
 
4164
4189
  // src/native-firebase-metadata.ts
4190
+ init_bundleGlobalFooter();
4165
4191
  var PREFIX = "globalThis.__peachNativeFirebaseConfig=";
4166
4192
  var MODULE_PREFIX = "globalThis.__sootsimModulePaths=";
4167
4193
  var PLATFORMS = ["ios", "android"];
@@ -4211,8 +4237,7 @@ function createNativeFirebaseFooter(config) {
4211
4237
  ${PREFIX}${json};`;
4212
4238
  }
4213
4239
  function readNativeFirebaseFooter(source) {
4214
- const start = source.lastIndexOf(`
4215
- ${PREFIX}`);
4240
+ const start = findBundleFooter(source, PREFIX);
4216
4241
  if (start < 0) return null;
4217
4242
  const lineEnd = source.indexOf("\n", start + 1);
4218
4243
  const line = source.slice(start + 1, lineEnd < 0 ? void 0 : lineEnd);
@@ -4225,16 +4250,14 @@ ${PREFIX}`);
4225
4250
  function detachNativeFirebaseFooter(source) {
4226
4251
  const config = readNativeFirebaseFooter(source);
4227
4252
  if (config === null) return { source, config };
4228
- const start = source.lastIndexOf(`
4229
- ${PREFIX}`);
4253
+ const start = findBundleFooter(source, PREFIX);
4230
4254
  const lineEnd = source.indexOf("\n", start + 1);
4231
4255
  const end = lineEnd < 0 ? source.length : lineEnd;
4232
4256
  return { source: source.slice(0, start) + source.slice(end), config };
4233
4257
  }
4234
4258
  function insertNativeFirebaseFooter(source, config) {
4235
4259
  const detached = detachNativeFirebaseFooter(source).source;
4236
- const start = detached.lastIndexOf(`
4237
- ${MODULE_PREFIX}`);
4260
+ const start = findBundleFooter(detached, MODULE_PREFIX);
4238
4261
  const footer = createNativeFirebaseFooter(config);
4239
4262
  return start < 0 ? detached + footer : detached.slice(0, start) + footer + detached.slice(start);
4240
4263
  }
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/native-app-identity-project.ts
4
4
  import fs2 from "node:fs";
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -38,6 +38,22 @@ __export(native_app_identity_exports, {
38
38
  });
39
39
  module.exports = __toCommonJS(native_app_identity_exports);
40
40
 
41
+ // src/bundleGlobalFooter.ts
42
+ function findBundleFooter(source, prefix) {
43
+ let end = source.length;
44
+ while (end > 0) {
45
+ const newline = source.lastIndexOf("\n", end - 1);
46
+ if (newline < 0) return -1;
47
+ const line = newline + 1;
48
+ if (source.startsWith(prefix, line)) return newline;
49
+ if (line !== end && !source.startsWith("globalThis.", line) && !source.startsWith("//", line)) {
50
+ return -1;
51
+ }
52
+ end = newline;
53
+ }
54
+ return -1;
55
+ }
56
+
41
57
  // src/openstep-plist.ts
42
58
  function parseOpenStepPlist(text) {
43
59
  let i = 0;
@@ -280,8 +296,7 @@ function createNativeAppIdentityFooter(identity) {
280
296
  ${NATIVE_APP_IDENTITY_PREFIX}${payload};`;
281
297
  }
282
298
  function nativeAppIdentityFooterStart(source) {
283
- return source.lastIndexOf(`
284
- ${NATIVE_APP_IDENTITY_PREFIX}`);
299
+ return findBundleFooter(source, NATIVE_APP_IDENTITY_PREFIX);
285
300
  }
286
301
  function readNativeAppIdentityFooter(source) {
287
302
  const start = nativeAppIdentityFooterStart(source);
@@ -317,8 +332,7 @@ function insertNativeAppIdentityFooter(source, identity) {
317
332
  const existing = nativeAppIdentityFooterStart(source);
318
333
  const existingEnd = existing < 0 ? -1 : source.includes("\n", existing + 1) ? source.indexOf("\n", existing + 1) : -1;
319
334
  const withoutExisting = existing < 0 ? source : source.slice(0, existing) + source.slice(existingEnd < 0 ? source.length : existingEnd);
320
- const moduleFooter = withoutExisting.lastIndexOf(`
321
- ${METRO_MODULE_PATHS_PREFIX}`);
335
+ const moduleFooter = findBundleFooter(withoutExisting, METRO_MODULE_PATHS_PREFIX);
322
336
  const footer = createNativeAppIdentityFooter(identity);
323
337
  if (moduleFooter < 0) return withoutExisting + footer;
324
338
  return withoutExisting.slice(0, moduleFooter) + footer + withoutExisting.slice(moduleFooter);
@@ -1,4 +1,20 @@
1
- /*! peach v0.1.1469 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1481 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
+
3
+ // src/bundleGlobalFooter.ts
4
+ function findBundleFooter(source, prefix) {
5
+ let end = source.length;
6
+ while (end > 0) {
7
+ const newline = source.lastIndexOf("\n", end - 1);
8
+ if (newline < 0) return -1;
9
+ const line = newline + 1;
10
+ if (source.startsWith(prefix, line)) return newline;
11
+ if (line !== end && !source.startsWith("globalThis.", line) && !source.startsWith("//", line)) {
12
+ return -1;
13
+ }
14
+ end = newline;
15
+ }
16
+ return -1;
17
+ }
2
18
 
3
19
  // src/openstep-plist.ts
4
20
  function parseOpenStepPlist(text) {
@@ -242,8 +258,7 @@ function createNativeAppIdentityFooter(identity) {
242
258
  ${NATIVE_APP_IDENTITY_PREFIX}${payload};`;
243
259
  }
244
260
  function nativeAppIdentityFooterStart(source) {
245
- return source.lastIndexOf(`
246
- ${NATIVE_APP_IDENTITY_PREFIX}`);
261
+ return findBundleFooter(source, NATIVE_APP_IDENTITY_PREFIX);
247
262
  }
248
263
  function readNativeAppIdentityFooter(source) {
249
264
  const start = nativeAppIdentityFooterStart(source);
@@ -279,8 +294,7 @@ function insertNativeAppIdentityFooter(source, identity) {
279
294
  const existing = nativeAppIdentityFooterStart(source);
280
295
  const existingEnd = existing < 0 ? -1 : source.includes("\n", existing + 1) ? source.indexOf("\n", existing + 1) : -1;
281
296
  const withoutExisting = existing < 0 ? source : source.slice(0, existing) + source.slice(existingEnd < 0 ? source.length : existingEnd);
282
- const moduleFooter = withoutExisting.lastIndexOf(`
283
- ${METRO_MODULE_PATHS_PREFIX}`);
297
+ const moduleFooter = findBundleFooter(withoutExisting, METRO_MODULE_PATHS_PREFIX);
284
298
  const footer = createNativeAppIdentityFooter(identity);
285
299
  if (moduleFooter < 0) return withoutExisting + footer;
286
300
  return withoutExisting.slice(0, moduleFooter) + footer + withoutExisting.slice(moduleFooter);