peachsim 0.1.745 → 0.1.747

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 (79) hide show
  1. package/cli/cloud-client.ts +28 -12
  2. package/cli/commands/install-desktop.ts +0 -25
  3. package/cli/drivers/playwright-sim-host.ts +2 -0
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/agent-identity.cjs +1 -1
  7. package/dist-lib/agent-sessions.cjs +1 -1
  8. package/dist-lib/attached-projects.cjs +1 -1
  9. package/dist-lib/auth/shared-session.cjs +1 -1
  10. package/dist-lib/backend-origin.cjs +1 -1
  11. package/dist-lib/beta.cjs +1 -1
  12. package/dist-lib/beta.mjs +1 -1
  13. package/dist-lib/bridge-constants.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.mjs +1 -1
  16. package/dist-lib/bridge-contract.cjs +1 -1
  17. package/dist-lib/bridge-contract.mjs +1 -1
  18. package/dist-lib/capture-contract.cjs +1 -1
  19. package/dist-lib/capture-contract.mjs +1 -1
  20. package/dist-lib/cli-constants.cjs +1 -1
  21. package/dist-lib/cloud-contract.cjs +1 -1
  22. package/dist-lib/cloud-contract.mjs +1 -1
  23. package/dist-lib/cloud-test-args.cjs +1 -1
  24. package/dist-lib/cloud-test-args.mjs +1 -1
  25. package/dist-lib/cloud.cjs +1 -1
  26. package/dist-lib/cloud.mjs +1 -1
  27. package/dist-lib/config.cjs +1 -1
  28. package/dist-lib/detox/index.cjs +98 -10
  29. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +158 -17
  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 +4 -4
  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 +1 -1
  48. package/dist-lib/native-app-identity.cjs +1 -1
  49. package/dist-lib/native-app-identity.mjs +1 -1
  50. package/dist-lib/native-firebase-metadata.cjs +1 -1
  51. package/dist-lib/native-firebase-metadata.mjs +1 -1
  52. package/dist-lib/plist.cjs +1 -1
  53. package/dist-lib/plist.mjs +1 -1
  54. package/dist-lib/profiles.cjs +1 -1
  55. package/dist-lib/public-brand.cjs +1 -1
  56. package/dist-lib/react-native-host-modules.cjs +1 -1
  57. package/dist-lib/react-native-host-modules.mjs +1 -1
  58. package/dist-lib/render-mode.cjs +1 -1
  59. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  60. package/dist-lib/sdk.cjs +1 -1
  61. package/dist-lib/sdk.mjs +1 -1
  62. package/dist-lib/skills.cjs +159 -18
  63. package/dist-lib/swift-compile.cjs +58 -6
  64. package/dist-lib/swift-compile.mjs +57 -6
  65. package/dist-lib/swift-package.cjs +1 -1
  66. package/dist-lib/swift-package.mjs +1 -1
  67. package/dist-lib/swift-submit.cjs +1 -1
  68. package/dist-lib/swift-submit.mjs +1 -1
  69. package/dist-lib/swift-toolchain.cjs +1 -1
  70. package/dist-lib/swift.cjs +1 -1
  71. package/dist-lib/vite-swift.cjs +384 -10
  72. package/dist-lib/vite.cjs +4 -4
  73. package/package.json +1 -1
  74. package/src/desktop-host-delivery.ts +23 -0
  75. package/src/swift-compile.ts +76 -8
  76. package/src/swift-host.ts +23 -3
  77. package/src/vite-plugin-one.ts +2 -2
  78. package/src/vite-plugin.ts +10 -1
  79. package/src/xcode-project.ts +86 -1
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -19468,9 +19468,9 @@ var require_parse = __commonJS({
19468
19468
  doc.documentElement.nodeName === "plist",
19469
19469
  "malformed document. First element should be <plist>"
19470
19470
  );
19471
- var plist2 = parsePlistXML(doc.documentElement);
19472
- if (plist2.length == 1) plist2 = plist2[0];
19473
- return plist2;
19471
+ var plist3 = parsePlistXML(doc.documentElement);
19472
+ if (plist3.length == 1) plist3 = plist3[0];
19473
+ return plist3;
19474
19474
  }
19475
19475
  function parsePlistXML(node) {
19476
19476
  var i, new_obj, key, val, new_arr, res, counter, type;
@@ -21901,7 +21901,9 @@ function swiftModuleInputFiles(root) {
21901
21901
  "toolchain.json"
21902
21902
  ];
21903
21903
  const walk2 = (dir) => {
21904
- for (const entry of (0, import_node_fs7.readdirSync)(import_node_path7.default.join(root, dir), { withFileTypes: true })) {
21904
+ for (const entry of (0, import_node_fs7.readdirSync)(import_node_path7.default.join(root, dir), {
21905
+ withFileTypes: true
21906
+ })) {
21905
21907
  const relative3 = `${dir}/${entry.name}`;
21906
21908
  if (entry.isDirectory()) walk2(relative3);
21907
21909
  else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative3);
@@ -22680,9 +22682,14 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
22680
22682
  const reusableBodies = [];
22681
22683
  let depth = 0;
22682
22684
  let opensReusableBody = false;
22685
+ const sceneLifecycleBodies = /* @__PURE__ */ new Set();
22683
22686
  for (const at of tokens) {
22684
22687
  const rest = conditioned.slice(at, at + 400);
22685
22688
  if (rest.startsWith("{")) {
22689
+ if (sceneLifecycleBodies.has(at)) {
22690
+ out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
22691
+ copied = at + 1;
22692
+ }
22686
22693
  depth++;
22687
22694
  if (opensReusableBody) reusableBodies.push(depth);
22688
22695
  opensReusableBody = false;
@@ -22718,12 +22725,33 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
22718
22725
  opensReusableBody = true;
22719
22726
  }
22720
22727
  const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
22728
+ const delegateClass = DELEGATE_CLASS.exec(rest);
22729
+ if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
22730
+ const body = at + delegateClass[0].lastIndexOf("{");
22731
+ let bodyDepth = 0;
22732
+ for (const token of tokens) {
22733
+ if (token < body) continue;
22734
+ if (conditioned[token] === "{") bodyDepth++;
22735
+ else if (conditioned[token] === "}" && --bodyDepth === 0) break;
22736
+ else if (bodyDepth === 1 && /^func\s+application\s*\([^{}]*\bconfigurationForConnecting\s+/.test(
22737
+ conditioned.slice(token, token + 600)
22738
+ )) {
22739
+ sceneLifecycleBodies.add(body);
22740
+ break;
22741
+ }
22742
+ }
22743
+ }
22721
22744
  if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
22722
22745
  out += `${conditioned.slice(copied, at)}final `;
22723
22746
  copied = at;
22724
22747
  }
22725
22748
  continue;
22726
22749
  }
22750
+ if (/^@UIApplicationMain\b/.test(rest)) {
22751
+ out += conditioned.slice(copied, at) + "@main".padEnd("@UIApplicationMain".length);
22752
+ copied = at + "@UIApplicationMain".length;
22753
+ continue;
22754
+ }
22727
22755
  const selector = SELECTOR.exec(rest);
22728
22756
  const match = selector ?? OBJC_ATTRIBUTE.exec(rest);
22729
22757
  if (!match) continue;
@@ -22822,7 +22850,7 @@ function swiftCodeScan(source) {
22822
22850
  else top.parens--;
22823
22851
  i++;
22824
22852
  } else {
22825
- const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
22853
+ const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("func", i) ? "func" : source.startsWith("UIApplicationMain", i) ? "UIApplicationMain" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
22826
22854
  if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
22827
22855
  tokens.push(i);
22828
22856
  i += keyword.length;
@@ -23044,10 +23072,16 @@ function compileSwiftProjectUnit(input, options) {
23044
23072
  plugin
23045
23073
  ])
23046
23074
  ],
23047
- { env: BUILD_ENV, maxBuffer: 64 * 1024 * 1024, timeout: options.timeoutMs }
23075
+ {
23076
+ env: BUILD_ENV,
23077
+ maxBuffer: 64 * 1024 * 1024,
23078
+ timeout: options.timeoutMs
23079
+ }
23048
23080
  );
23049
23081
  } catch (error) {
23050
- throw new Error(projectDiagnostic(outputOf(error), layout), { cause: error });
23082
+ throw new Error(projectDiagnostic(outputOf(error), layout), {
23083
+ cause: error
23084
+ });
23051
23085
  }
23052
23086
  return {
23053
23087
  hash,
@@ -23072,7 +23106,10 @@ var init_swift_compile = __esm({
23072
23106
  run2 = (0, import_node_util2.promisify)(import_node_child_process4.execFile);
23073
23107
  WASM_TRIPLE = "wasm32-unknown-wasip1";
23074
23108
  cores = import_node_os2.default.availableParallelism();
23075
- BUILD_ENV = { ...process.env, BINARYEN_CORES: String(Math.min(4, cores)) };
23109
+ BUILD_ENV = {
23110
+ ...process.env,
23111
+ BINARYEN_CORES: String(Math.min(4, cores))
23112
+ };
23076
23113
  BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
23077
23114
  linkedModuleDigests = /* @__PURE__ */ new Map();
23078
23115
  OPTIONAL_FRAMEWORK_DEPENDENCIES = {
@@ -23244,6 +23281,15 @@ function createRuntimeDelivery(product) {
23244
23281
  }
23245
23282
  return { version, channel, entry };
23246
23283
  }
23284
+ function isVerifiedInstall(dir) {
23285
+ if (!import_node_fs9.default.existsSync(import_node_path9.default.join(dir, product.installedMarker))) return false;
23286
+ try {
23287
+ product.verifyInstall?.(dir);
23288
+ return true;
23289
+ } catch {
23290
+ return false;
23291
+ }
23292
+ }
23247
23293
  async function install(opts = {}) {
23248
23294
  product.ensureHome();
23249
23295
  const cdnOrigin = resolveCdnOrigin(opts.cdnOrigin);
@@ -23253,7 +23299,7 @@ function createRuntimeDelivery(product) {
23253
23299
  const setActive = opts.setActive !== false;
23254
23300
  const protectVersions = [version, ...opts.protectVersions ?? []];
23255
23301
  pruneLocalRetention({ protectVersions });
23256
- if (!opts.force && import_node_fs9.default.existsSync(import_node_path9.default.join(destDir, product.installedMarker))) {
23302
+ if (!opts.force && isVerifiedInstall(destDir)) {
23257
23303
  if (setActive) product.writeActiveRuntime(version);
23258
23304
  pruneLocalRetention({ protectVersions });
23259
23305
  return {
@@ -23274,6 +23320,7 @@ function createRuntimeDelivery(product) {
23274
23320
  digest: { algorithm: "sha256", encoding: "hex", value: entry.sha256 },
23275
23321
  destDir,
23276
23322
  installedMarker: product.installedMarker,
23323
+ verify: product.verifyInstall,
23277
23324
  label: `runtime ${version}`
23278
23325
  });
23279
23326
  if (setActive) product.writeActiveRuntime(version);
@@ -23486,6 +23533,7 @@ async function installVerifiedTarball(tarball) {
23486
23533
  if (!import_node_fs9.default.existsSync(import_node_path9.default.join(tmpDir, installedMarker))) {
23487
23534
  throw new Error(`extracted tarball for ${label} is missing ${installedMarker}`);
23488
23535
  }
23536
+ tarball.verify?.(tmpDir);
23489
23537
  try {
23490
23538
  import_node_fs9.default.renameSync(tmpDir, destDir);
23491
23539
  } catch (err) {
@@ -24821,6 +24869,62 @@ function readXcodeAppTarget(xcodeproj, targetName) {
24821
24869
  const moduleName = c99Identifier(
24822
24870
  settings.PRODUCT_MODULE_NAME && !settings.PRODUCT_MODULE_NAME.includes("$(") ? settings.PRODUCT_MODULE_NAME : productName
24823
24871
  );
24872
+ const variables = {
24873
+ ...settings,
24874
+ EXECUTABLE_NAME: settings.EXECUTABLE_NAME ?? productName,
24875
+ DEVELOPMENT_LANGUAGE: settings.DEVELOPMENT_LANGUAGE ?? str(project.developmentRegion) ?? "en",
24876
+ TARGET_NAME: name2,
24877
+ PRODUCT_NAME: productName,
24878
+ PRODUCT_MODULE_NAME: moduleName,
24879
+ SRCROOT: projectDir,
24880
+ SOURCE_ROOT: projectDir
24881
+ };
24882
+ const expand = (value) => {
24883
+ const seen = /* @__PURE__ */ new Set();
24884
+ while (/\$[({][A-Za-z_][A-Za-z0-9_]*[)}]/.test(value)) {
24885
+ if (seen.has(value)) throw new Error(`${name2} has cyclic Info.plist build settings`);
24886
+ seen.add(value);
24887
+ value = value.replace(
24888
+ /\$[({]([A-Za-z_][A-Za-z0-9_]*)[)}]/g,
24889
+ (match, key) => {
24890
+ const replacement = Object.entries(variables).find(
24891
+ ([name3]) => name3 === key
24892
+ )?.[1];
24893
+ if (replacement === void 0)
24894
+ throw new Error(`${name2} Info.plist has unresolved setting ${match}`);
24895
+ return replacement;
24896
+ }
24897
+ );
24898
+ }
24899
+ return value;
24900
+ };
24901
+ const expandValue = (value) => {
24902
+ if (typeof value === "string") return expand(value);
24903
+ if (Array.isArray(value)) return value.map(expandValue);
24904
+ if (typeof value === "object" && !(value instanceof Date) && !Buffer.isBuffer(value)) {
24905
+ return Object.fromEntries(
24906
+ Object.entries(value).map(([key, value2]) => [key, expandValue(value2)])
24907
+ );
24908
+ }
24909
+ return value;
24910
+ };
24911
+ const infoPlistFile = settings.INFOPLIST_FILE ? import_node_path14.default.resolve(projectDir, expand(settings.INFOPLIST_FILE)) : null;
24912
+ const sourceInfo = infoPlistFile ? import_plist3.default.parse(import_node_fs14.default.readFileSync(infoPlistFile, "utf8")) : {};
24913
+ if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
24914
+ throw new Error(`${name2} Info.plist must contain a dictionary`);
24915
+ }
24916
+ const info = {};
24917
+ for (const [key, value] of Object.entries(sourceInfo)) info[key] = expandValue(value);
24918
+ for (const [key, value] of Object.entries(settings)) {
24919
+ if (!key.startsWith("INFOPLIST_KEY_") || key.endsWith("_Generation")) continue;
24920
+ info[key.slice("INFOPLIST_KEY_".length)] = value === "YES" ? true : value === "NO" ? false : expand(value);
24921
+ }
24922
+ if (settings.INFOPLIST_KEY_UIApplicationSceneManifest_Generation === "YES" && info.UIApplicationSceneManifest === void 0) {
24923
+ info.UIApplicationSceneManifest = {
24924
+ UIApplicationSupportsMultipleScenes: true,
24925
+ UISceneConfigurations: {}
24926
+ };
24927
+ }
24824
24928
  const sources = /* @__PURE__ */ new Set();
24825
24929
  const resources = /* @__PURE__ */ new Set();
24826
24930
  const addResource = (file) => {
@@ -24924,7 +25028,10 @@ function readXcodeAppTarget(xcodeproj, targetName) {
24924
25028
  if (!dependency || !product) continue;
24925
25029
  const reference = object(str(dependency.package));
24926
25030
  if (reference?.isa === "XCRemoteSwiftPackageReference") {
24927
- remoteProducts.push({ product, repositoryURL: str(reference.repositoryURL) ?? "" });
25031
+ remoteProducts.push({
25032
+ product,
25033
+ repositoryURL: str(reference.repositoryURL) ?? ""
25034
+ });
24928
25035
  } else if (reference?.isa === "XCLocalSwiftPackageReference") {
24929
25036
  localPackages.add(import_node_path14.default.resolve(projectDir, str(reference.relativePath) ?? ""));
24930
25037
  } else if (localProducts.has(product)) {
@@ -24965,6 +25072,8 @@ function readXcodeAppTarget(xcodeproj, targetName) {
24965
25072
  moduleName,
24966
25073
  sources: [...sources].sort(),
24967
25074
  resources: [...resources].sort(),
25075
+ infoPlist: import_plist3.default.build(info),
25076
+ infoPlistFile,
24968
25077
  languageMode: swiftVersion >= 6 ? 6 : 5,
24969
25078
  mainActorIsolation: settings.SWIFT_DEFAULT_ACTOR_ISOLATION === "MainActor",
24970
25079
  localPackages: [...localPackages].sort(),
@@ -24974,12 +25083,13 @@ function readXcodeAppTarget(xcodeproj, targetName) {
24974
25083
  appTargets: appTargetNames
24975
25084
  };
24976
25085
  }
24977
- var import_node_fs14, import_node_path14, isDict, str, list, APPLICATION, NEVER_MEMBER, BUNDLE_DIR, parsed;
25086
+ var import_node_fs14, import_node_path14, import_plist3, isDict, str, list, APPLICATION, NEVER_MEMBER, BUNDLE_DIR, parsed;
24978
25087
  var init_xcode_project = __esm({
24979
25088
  "src/xcode-project.ts"() {
24980
25089
  "use strict";
24981
25090
  import_node_fs14 = __toESM(require("node:fs"), 1);
24982
25091
  import_node_path14 = __toESM(require("node:path"), 1);
25092
+ import_plist3 = __toESM(require_plist(), 1);
24983
25093
  init_swift_package();
24984
25094
  isDict = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
24985
25095
  str = (value) => typeof value === "string" ? value : void 0;
@@ -25061,6 +25171,7 @@ function xcodeLayout(root) {
25061
25171
  if (!registered) return null;
25062
25172
  const app = readXcodeAppTarget(registered.xcodeproj, registered.target);
25063
25173
  const files = /* @__PURE__ */ new Set([app.pbxproj, ...app.sources, ...app.resources]);
25174
+ if (app.infoPlistFile) files.add(app.infoPlistFile);
25064
25175
  const targets = [];
25065
25176
  for (const dir of app.localPackages) {
25066
25177
  const manifest = import_node_path15.default.join(dir, "Package.swift");
@@ -25088,7 +25199,12 @@ function xcodeLayout(root) {
25088
25199
  });
25089
25200
  for (const file of target.files) files.add(file);
25090
25201
  }
25091
- return { app, targets, unavailable: remote.unavailable, files: [...files].sort() };
25202
+ return {
25203
+ app,
25204
+ targets,
25205
+ unavailable: remote.unavailable,
25206
+ files: [...files].sort()
25207
+ };
25092
25208
  }
25093
25209
  function xcodeManifest(layout) {
25094
25210
  const settings = (mode, mainActor) => `swiftSettings: [.swiftLanguageMode(.v${mode})${mainActor ? ", .defaultIsolation(MainActor.self)" : ""}]`;
@@ -25248,6 +25364,18 @@ function buildSwiftBundleFiles(packagePath, hosted) {
25248
25364
  const files = {};
25249
25365
  const watched = [];
25250
25366
  let total = 0;
25367
+ const xcode = xcodeLayout(packagePath);
25368
+ if (xcode) {
25369
+ const bytes = Buffer.from(xcode.app.infoPlist);
25370
+ if (bytes.length > limits.resourceBytes || bytes.length > limits.resourceTotalBytes)
25371
+ throw new Error("swift launch Info.plist exceeds bundle resource limits");
25372
+ files["Info.plist"] = bytes.toString("base64");
25373
+ total += bytes.length;
25374
+ if (xcode.app.infoPlistFile)
25375
+ watched.push(
25376
+ import_node_path15.default.relative(packagePath, xcode.app.infoPlistFile).split(import_node_path15.default.sep).join("/")
25377
+ );
25378
+ }
25251
25379
  for (const { base, file } of enumerateBundleJson(relative3)) {
25252
25380
  watched.push(file);
25253
25381
  const disk = import_node_path15.default.join(packagePath, ...file.split("/"));
@@ -33010,10 +33138,20 @@ function placeMetroDescriptor(listing, descriptor) {
33010
33138
  }
33011
33139
  return { files, ambiguous, verified: false, mismatched: true };
33012
33140
  }
33013
- function unverifiedFileKey(dest) {
33014
- return dest.placements.filter((placement) => !placement.verified).flatMap(
33015
- (placement) => [...placement.files.values()].map((relative3) => (0, import_node_path25.join)(dest.directory, relative3))
33016
- ).sort().join("\n");
33141
+ function unverifiedContentKey(dest, fileDigests) {
33142
+ return JSON.stringify(
33143
+ dest.placements.map(
33144
+ (placement) => placement.verified ? null : [...placement.files].map(([scale, relative3]) => {
33145
+ const file = (0, import_node_path25.join)(dest.directory, relative3);
33146
+ let digest = fileDigests.get(file);
33147
+ if (digest === void 0) {
33148
+ digest = (0, import_node_crypto11.createHash)("sha256").update((0, import_node_fs25.readFileSync)(file)).digest("hex");
33149
+ fileDigests.set(file, digest);
33150
+ }
33151
+ return [scale, digest];
33152
+ }).sort(([first], [second]) => first - second)
33153
+ )
33154
+ );
33017
33155
  }
33018
33156
  function searchMetroAssetDest(bundlePath, descriptors) {
33019
33157
  const bundleDirectory = (0, import_node_path25.dirname)((0, import_node_path25.resolve)(bundlePath));
@@ -33079,7 +33217,10 @@ function searchMetroAssetDest(bundlePath, descriptors) {
33079
33217
  }
33080
33218
  const best = Math.max(...holders.map((holder) => holder.verified));
33081
33219
  const rivals = holders.filter((holder) => holder.verified === best);
33082
- const distinct = new Set(rivals.map((rival) => unverifiedFileKey(rival.dest)));
33220
+ const fileDigests = /* @__PURE__ */ new Map();
33221
+ const distinct = new Set(
33222
+ rivals.map((rival) => unverifiedContentKey(rival.dest, fileDigests))
33223
+ );
33083
33224
  const winner = rivals[0];
33084
33225
  if (!winner) return { dest: null, searched, truncated, unconfirmed: false };
33085
33226
  if (distinct.size > 1) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -41,6 +41,7 @@ __export(swift_compile_exports, {
41
41
  missingSwiftModules: () => missingSwiftModules,
42
42
  objcExtensionMemberIndex: () => objcExtensionMemberIndex,
43
43
  prepareSwiftDependency: () => prepareSwiftDependency,
44
+ swiftApplicationEntry: () => swiftApplicationEntry,
44
45
  swiftArtifactHash: () => swiftArtifactHash,
45
46
  swiftAvailableModules: () => swiftAvailableModules,
46
47
  swiftDistributionAt: () => swiftDistributionAt,
@@ -305,7 +306,10 @@ function swiftPackagePartition(manifest, resourcePaths = []) {
305
306
  var run2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
306
307
  var WASM_TRIPLE = "wasm32-unknown-wasip1";
307
308
  var cores = import_node_os.default.availableParallelism();
308
- var BUILD_ENV = { ...process.env, BINARYEN_CORES: String(Math.min(4, cores)) };
309
+ var BUILD_ENV = {
310
+ ...process.env,
311
+ BINARYEN_CORES: String(Math.min(4, cores))
312
+ };
309
313
  var BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
310
314
  function swiftDistributionAt(root) {
311
315
  const file = import_node_path2.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
@@ -330,7 +334,9 @@ function swiftModuleInputFiles(root) {
330
334
  "toolchain.json"
331
335
  ];
332
336
  const walk = (dir) => {
333
- for (const entry of (0, import_node_fs2.readdirSync)(import_node_path2.default.join(root, dir), { withFileTypes: true })) {
337
+ for (const entry of (0, import_node_fs2.readdirSync)(import_node_path2.default.join(root, dir), {
338
+ withFileTypes: true
339
+ })) {
334
340
  const relative = `${dir}/${entry.name}`;
335
341
  if (entry.isDirectory()) walk(relative);
336
342
  else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative);
@@ -1163,9 +1169,14 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
1163
1169
  const reusableBodies = [];
1164
1170
  let depth = 0;
1165
1171
  let opensReusableBody = false;
1172
+ const sceneLifecycleBodies = /* @__PURE__ */ new Set();
1166
1173
  for (const at of tokens) {
1167
1174
  const rest = conditioned.slice(at, at + 400);
1168
1175
  if (rest.startsWith("{")) {
1176
+ if (sceneLifecycleBodies.has(at)) {
1177
+ out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
1178
+ copied = at + 1;
1179
+ }
1169
1180
  depth++;
1170
1181
  if (opensReusableBody) reusableBodies.push(depth);
1171
1182
  opensReusableBody = false;
@@ -1201,12 +1212,33 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
1201
1212
  opensReusableBody = true;
1202
1213
  }
1203
1214
  const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
1215
+ const delegateClass = DELEGATE_CLASS.exec(rest);
1216
+ if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
1217
+ const body = at + delegateClass[0].lastIndexOf("{");
1218
+ let bodyDepth = 0;
1219
+ for (const token of tokens) {
1220
+ if (token < body) continue;
1221
+ if (conditioned[token] === "{") bodyDepth++;
1222
+ else if (conditioned[token] === "}" && --bodyDepth === 0) break;
1223
+ else if (bodyDepth === 1 && /^func\s+application\s*\([^{}]*\bconfigurationForConnecting\s+/.test(
1224
+ conditioned.slice(token, token + 600)
1225
+ )) {
1226
+ sceneLifecycleBodies.add(body);
1227
+ break;
1228
+ }
1229
+ }
1230
+ }
1204
1231
  if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
1205
1232
  out += `${conditioned.slice(copied, at)}final `;
1206
1233
  copied = at;
1207
1234
  }
1208
1235
  continue;
1209
1236
  }
1237
+ if (/^@UIApplicationMain\b/.test(rest)) {
1238
+ out += conditioned.slice(copied, at) + "@main".padEnd("@UIApplicationMain".length);
1239
+ copied = at + "@UIApplicationMain".length;
1240
+ continue;
1241
+ }
1210
1242
  const selector = SELECTOR.exec(rest);
1211
1243
  const match = selector ?? OBJC_ATTRIBUTE.exec(rest);
1212
1244
  if (!match) continue;
@@ -1223,6 +1255,19 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
1223
1255
  }
1224
1256
  return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
1225
1257
  }
1258
+ function swiftApplicationEntry(file, source) {
1259
+ const { tokens } = swiftCodeScan(source);
1260
+ let depth = 0;
1261
+ for (const at of tokens) {
1262
+ if (source[at] === "{") depth++;
1263
+ else if (source[at] === "}") depth--;
1264
+ else if (depth === 0 && /^@(?:main|UIApplicationMain)\b/.test(source.slice(at)))
1265
+ return true;
1266
+ else if (depth === 0 && import_node_path2.default.basename(file) === "main.swift" && /^UIApplicationMain\s*\(/.test(source.slice(at)))
1267
+ return true;
1268
+ }
1269
+ return false;
1270
+ }
1226
1271
  function swiftCodeScan(source) {
1227
1272
  const starts = /* @__PURE__ */ new Set();
1228
1273
  const tokens = [];
@@ -1305,7 +1350,7 @@ function swiftCodeScan(source) {
1305
1350
  else top.parens--;
1306
1351
  i++;
1307
1352
  } else {
1308
- const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
1353
+ const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("func", i) ? "func" : source.startsWith("UIApplicationMain", i) ? "UIApplicationMain" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
1309
1354
  if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
1310
1355
  tokens.push(i);
1311
1356
  i += keyword.length;
@@ -1564,10 +1609,16 @@ function compileSwiftProjectUnit(input, options) {
1564
1609
  plugin
1565
1610
  ])
1566
1611
  ],
1567
- { env: BUILD_ENV, maxBuffer: 64 * 1024 * 1024, timeout: options.timeoutMs }
1612
+ {
1613
+ env: BUILD_ENV,
1614
+ maxBuffer: 64 * 1024 * 1024,
1615
+ timeout: options.timeoutMs
1616
+ }
1568
1617
  );
1569
1618
  } catch (error) {
1570
- throw new Error(projectDiagnostic(outputOf(error), layout), { cause: error });
1619
+ throw new Error(projectDiagnostic(outputOf(error), layout), {
1620
+ cause: error
1621
+ });
1571
1622
  }
1572
1623
  return {
1573
1624
  hash,
@@ -1587,6 +1638,7 @@ function compileSwiftProjectUnit(input, options) {
1587
1638
  missingSwiftModules,
1588
1639
  objcExtensionMemberIndex,
1589
1640
  prepareSwiftDependency,
1641
+ swiftApplicationEntry,
1590
1642
  swiftArtifactHash,
1591
1643
  swiftAvailableModules,
1592
1644
  swiftDistributionAt,
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-compile.ts
4
4
  import { execFile as execFile2, execFileSync } from "node:child_process";
@@ -259,7 +259,10 @@ function swiftPackagePartition(manifest, resourcePaths = []) {
259
259
  var run2 = promisify2(execFile2);
260
260
  var WASM_TRIPLE = "wasm32-unknown-wasip1";
261
261
  var cores = os.availableParallelism();
262
- var BUILD_ENV = { ...process.env, BINARYEN_CORES: String(Math.min(4, cores)) };
262
+ var BUILD_ENV = {
263
+ ...process.env,
264
+ BINARYEN_CORES: String(Math.min(4, cores))
265
+ };
263
266
  var BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
264
267
  function swiftDistributionAt(root) {
265
268
  const file = path2.join(root, SWIFT_DISTRIBUTION_MANIFEST);
@@ -284,7 +287,9 @@ function swiftModuleInputFiles(root) {
284
287
  "toolchain.json"
285
288
  ];
286
289
  const walk = (dir) => {
287
- for (const entry of readdirSync(path2.join(root, dir), { withFileTypes: true })) {
290
+ for (const entry of readdirSync(path2.join(root, dir), {
291
+ withFileTypes: true
292
+ })) {
288
293
  const relative = `${dir}/${entry.name}`;
289
294
  if (entry.isDirectory()) walk(relative);
290
295
  else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative);
@@ -1117,9 +1122,14 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
1117
1122
  const reusableBodies = [];
1118
1123
  let depth = 0;
1119
1124
  let opensReusableBody = false;
1125
+ const sceneLifecycleBodies = /* @__PURE__ */ new Set();
1120
1126
  for (const at of tokens) {
1121
1127
  const rest = conditioned.slice(at, at + 400);
1122
1128
  if (rest.startsWith("{")) {
1129
+ if (sceneLifecycleBodies.has(at)) {
1130
+ out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
1131
+ copied = at + 1;
1132
+ }
1123
1133
  depth++;
1124
1134
  if (opensReusableBody) reusableBodies.push(depth);
1125
1135
  opensReusableBody = false;
@@ -1155,12 +1165,33 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
1155
1165
  opensReusableBody = true;
1156
1166
  }
1157
1167
  const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
1168
+ const delegateClass = DELEGATE_CLASS.exec(rest);
1169
+ if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
1170
+ const body = at + delegateClass[0].lastIndexOf("{");
1171
+ let bodyDepth = 0;
1172
+ for (const token of tokens) {
1173
+ if (token < body) continue;
1174
+ if (conditioned[token] === "{") bodyDepth++;
1175
+ else if (conditioned[token] === "}" && --bodyDepth === 0) break;
1176
+ else if (bodyDepth === 1 && /^func\s+application\s*\([^{}]*\bconfigurationForConnecting\s+/.test(
1177
+ conditioned.slice(token, token + 600)
1178
+ )) {
1179
+ sceneLifecycleBodies.add(body);
1180
+ break;
1181
+ }
1182
+ }
1183
+ }
1158
1184
  if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
1159
1185
  out += `${conditioned.slice(copied, at)}final `;
1160
1186
  copied = at;
1161
1187
  }
1162
1188
  continue;
1163
1189
  }
1190
+ if (/^@UIApplicationMain\b/.test(rest)) {
1191
+ out += conditioned.slice(copied, at) + "@main".padEnd("@UIApplicationMain".length);
1192
+ copied = at + "@UIApplicationMain".length;
1193
+ continue;
1194
+ }
1164
1195
  const selector = SELECTOR.exec(rest);
1165
1196
  const match = selector ?? OBJC_ATTRIBUTE.exec(rest);
1166
1197
  if (!match) continue;
@@ -1177,6 +1208,19 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
1177
1208
  }
1178
1209
  return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
1179
1210
  }
1211
+ function swiftApplicationEntry(file, source) {
1212
+ const { tokens } = swiftCodeScan(source);
1213
+ let depth = 0;
1214
+ for (const at of tokens) {
1215
+ if (source[at] === "{") depth++;
1216
+ else if (source[at] === "}") depth--;
1217
+ else if (depth === 0 && /^@(?:main|UIApplicationMain)\b/.test(source.slice(at)))
1218
+ return true;
1219
+ else if (depth === 0 && path2.basename(file) === "main.swift" && /^UIApplicationMain\s*\(/.test(source.slice(at)))
1220
+ return true;
1221
+ }
1222
+ return false;
1223
+ }
1180
1224
  function swiftCodeScan(source) {
1181
1225
  const starts = /* @__PURE__ */ new Set();
1182
1226
  const tokens = [];
@@ -1259,7 +1303,7 @@ function swiftCodeScan(source) {
1259
1303
  else top.parens--;
1260
1304
  i++;
1261
1305
  } else {
1262
- const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
1306
+ const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("func", i) ? "func" : source.startsWith("UIApplicationMain", i) ? "UIApplicationMain" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
1263
1307
  if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
1264
1308
  tokens.push(i);
1265
1309
  i += keyword.length;
@@ -1518,10 +1562,16 @@ function compileSwiftProjectUnit(input, options) {
1518
1562
  plugin
1519
1563
  ])
1520
1564
  ],
1521
- { env: BUILD_ENV, maxBuffer: 64 * 1024 * 1024, timeout: options.timeoutMs }
1565
+ {
1566
+ env: BUILD_ENV,
1567
+ maxBuffer: 64 * 1024 * 1024,
1568
+ timeout: options.timeoutMs
1569
+ }
1522
1570
  );
1523
1571
  } catch (error) {
1524
- throw new Error(projectDiagnostic(outputOf(error), layout), { cause: error });
1572
+ throw new Error(projectDiagnostic(outputOf(error), layout), {
1573
+ cause: error
1574
+ });
1525
1575
  }
1526
1576
  return {
1527
1577
  hash,
@@ -1540,6 +1590,7 @@ export {
1540
1590
  missingSwiftModules,
1541
1591
  objcExtensionMemberIndex,
1542
1592
  prepareSwiftDependency,
1593
+ swiftApplicationEntry,
1543
1594
  swiftArtifactHash,
1544
1595
  swiftAvailableModules,
1545
1596
  swiftDistributionAt,
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function isSwiftManifestFile(file) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-submit.ts
4
4
  var SWIFT_COMPILE_PATH = "/api/swift-compile";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;