peachsim 0.1.760 → 0.1.762

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 (71) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/agent-identity.cjs +1 -1
  4. package/dist-lib/agent-sessions.cjs +1 -1
  5. package/dist-lib/attached-projects.cjs +1 -1
  6. package/dist-lib/auth/shared-session.cjs +1 -1
  7. package/dist-lib/backend-origin.cjs +1 -1
  8. package/dist-lib/beta.cjs +1 -1
  9. package/dist-lib/beta.mjs +1 -1
  10. package/dist-lib/bridge-constants.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.mjs +1 -1
  13. package/dist-lib/bridge-contract.cjs +1 -1
  14. package/dist-lib/bridge-contract.mjs +1 -1
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +1 -1
  17. package/dist-lib/cli-constants.cjs +1 -1
  18. package/dist-lib/cloud-contract.cjs +1 -1
  19. package/dist-lib/cloud-contract.mjs +1 -1
  20. package/dist-lib/cloud-test-args.cjs +1 -1
  21. package/dist-lib/cloud-test-args.mjs +1 -1
  22. package/dist-lib/cloud.cjs +1 -1
  23. package/dist-lib/cloud.mjs +1 -1
  24. package/dist-lib/config.cjs +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/home-paths.cjs +1 -1
  28. package/dist-lib/host/bridge-host.cjs +109 -44
  29. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  30. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  31. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  32. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  33. package/dist-lib/host/websocket-proxy.cjs +1 -1
  34. package/dist-lib/index.cjs +1 -1
  35. package/dist-lib/jump-to-source-babel.cjs +1 -1
  36. package/dist-lib/jump-to-source-native.cjs +1 -1
  37. package/dist-lib/kotlin-host.cjs +1 -1
  38. package/dist-lib/menu.cjs +1 -1
  39. package/dist-lib/menu.mjs +1 -1
  40. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  41. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  42. package/dist-lib/metro-production-bundle.cjs +1 -1
  43. package/dist-lib/metro-production-bundle.mjs +1 -1
  44. package/dist-lib/metro.cjs +1 -1
  45. package/dist-lib/native-app-identity.cjs +1 -1
  46. package/dist-lib/native-app-identity.mjs +1 -1
  47. package/dist-lib/native-firebase-metadata.cjs +1 -1
  48. package/dist-lib/native-firebase-metadata.mjs +1 -1
  49. package/dist-lib/plist.cjs +1 -1
  50. package/dist-lib/plist.mjs +1 -1
  51. package/dist-lib/profiles.cjs +1 -1
  52. package/dist-lib/public-brand.cjs +1 -1
  53. package/dist-lib/react-native-host-modules.cjs +1 -1
  54. package/dist-lib/react-native-host-modules.mjs +1 -1
  55. package/dist-lib/render-mode.cjs +1 -1
  56. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  57. package/dist-lib/sdk.cjs +1 -1
  58. package/dist-lib/sdk.mjs +1 -1
  59. package/dist-lib/skills.cjs +109 -44
  60. package/dist-lib/swift-compile.cjs +66 -8
  61. package/dist-lib/swift-compile.mjs +66 -8
  62. package/dist-lib/swift-package.cjs +1 -1
  63. package/dist-lib/swift-package.mjs +1 -1
  64. package/dist-lib/swift-submit.cjs +1 -1
  65. package/dist-lib/swift-submit.mjs +1 -1
  66. package/dist-lib/swift-toolchain.cjs +1 -1
  67. package/dist-lib/swift.cjs +1 -1
  68. package/dist-lib/vite-swift.cjs +66 -8
  69. package/dist-lib/vite.cjs +1 -1
  70. package/package.json +1 -1
  71. package/src/swift-compile.ts +102 -12
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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;
@@ -21883,14 +21883,72 @@ function withNativeSourceGlue(input, glue) {
21883
21883
  oneModule: true
21884
21884
  };
21885
21885
  }
21886
- function swiftImportNames(contents, unconditional = false) {
21886
+ function swiftCondition(text2, available) {
21887
+ const tokens = text2.match(/\w+\s*\([^()]*\)|&&|\|\||!|\(|\)|\w+/g) ?? [];
21888
+ let index = 0;
21889
+ const atom = () => {
21890
+ const token = tokens[index++];
21891
+ if (token === "!") {
21892
+ const value = atom();
21893
+ return value === void 0 ? void 0 : !value;
21894
+ }
21895
+ if (token === "(") {
21896
+ const value = either();
21897
+ index++;
21898
+ return value;
21899
+ }
21900
+ if (token === "true") return true;
21901
+ if (token === "false") return false;
21902
+ const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? "");
21903
+ if (!call) return void 0;
21904
+ const [, name2, argument] = call;
21905
+ if (name2 === "os") return argument === "iOS" || argument === "WASI";
21906
+ if (name2 === "canImport") return available.has(argument);
21907
+ if (name2 === "targetEnvironment") return false;
21908
+ if (name2 === "arch") return argument === "wasm32";
21909
+ return void 0;
21910
+ };
21911
+ const both = () => {
21912
+ let value = atom();
21913
+ while (tokens[index] === "&&") {
21914
+ index++;
21915
+ const next = atom();
21916
+ value = value === false || next === false ? false : value && next ? true : void 0;
21917
+ }
21918
+ return value;
21919
+ };
21920
+ const either = () => {
21921
+ let value = both();
21922
+ while (tokens[index] === "||") {
21923
+ index++;
21924
+ const next = both();
21925
+ value = value === true || next === true ? true : value === false && next === false ? false : void 0;
21926
+ }
21927
+ return value;
21928
+ };
21929
+ return either();
21930
+ }
21931
+ function swiftImportNames(contents, available) {
21887
21932
  const names = [];
21888
- let depth = 0;
21933
+ const frames = [];
21889
21934
  for (const line of contents.split("\n")) {
21890
- const directive = /^\s*#(if|endif)\b/.exec(line)?.[1];
21891
- if (directive === "if") depth++;
21892
- else if (directive === "endif") depth = Math.max(0, depth - 1);
21893
- if (unconditional && depth > 0) continue;
21935
+ const directive = /^\s*#(if|elseif|else|endif)\b(.*)$/.exec(line);
21936
+ if (directive && available) {
21937
+ const [, kind, rest] = directive;
21938
+ const condition = (rest ?? "").replace(/\/\/.*$/, "").trim();
21939
+ if (kind === "if") {
21940
+ const active = swiftCondition(condition, available);
21941
+ frames.push({ active, taken: active });
21942
+ } else if (kind === "endif") frames.pop();
21943
+ else if (frames.length > 0) {
21944
+ const frame = frames[frames.length - 1];
21945
+ const holds = kind === "else" ? true : swiftCondition(condition, available);
21946
+ frame.active = frame.taken === true ? false : frame.taken === false ? holds : holds && void 0;
21947
+ frame.taken = frame.taken === true || holds === true ? true : frame.taken === false ? holds : void 0;
21948
+ }
21949
+ continue;
21950
+ }
21951
+ if (available && frames.some((frame) => frame.active !== true)) continue;
21894
21952
  const name2 = SWIFT_IMPORT.exec(line)?.[1];
21895
21953
  if (name2) names.push(name2);
21896
21954
  }
@@ -21934,7 +21992,7 @@ function missingSwiftModules(files, available) {
21934
21992
  const missing = /* @__PURE__ */ new Map();
21935
21993
  for (const [file, contents] of Object.entries(files)) {
21936
21994
  if (!file.endsWith(".swift") || file === "Package.swift") continue;
21937
- for (const name2 of new Set(swiftImportNames(contents, true))) {
21995
+ for (const name2 of new Set(swiftImportNames(contents, available))) {
21938
21996
  if (available.has(name2)) continue;
21939
21997
  missing.set(name2, [...missing.get(name2) ?? [], file]);
21940
21998
  }
@@ -30415,6 +30473,43 @@ function iosDevice(spec) {
30415
30473
  modelName: spec.name
30416
30474
  };
30417
30475
  }
30476
+ function ipadProDevice(model, name2, width, height, diagonalInches) {
30477
+ return iosDevice({
30478
+ model,
30479
+ name: name2,
30480
+ // iPad Pro 11-inch (M5) 12GB, iOS 27.0, simulator DBD4B183, UIKit probe
30481
+ // scenario `metrics`. portrait UIScreen.bounds 834×1210, scale 2,
30482
+ // nativeBounds 1668×2420. the window matched the screen.
30483
+ width,
30484
+ height,
30485
+ scale: 2,
30486
+ // portrait statusBarFrame was 834×32 at the top, and safeAreaInsets.top
30487
+ // was 32. landscape statusBarFrame stayed 32 tall while safeAreaInsets.top
30488
+ // was 10; this field is the portrait bar.
30489
+ statusBarHeight: 32,
30490
+ landscapeStatusBarHeight: 32,
30491
+ // portrait and landscape safeAreaInsets.bottom were both 20. the probe
30492
+ // has no separate home-indicator height.
30493
+ homeIndicatorHeight: 20,
30494
+ // UIScreen _displayCornerRadius, both orientations. the framebuffer
30495
+ // mask's tangent extent was not measured separately.
30496
+ cornerRadius: cornerRadii(30),
30497
+ continuousCornerRadius: cornerRadii(30),
30498
+ // housing is unsourced. the frame is the display until it is measured.
30499
+ frameInsets: uniformFrameInsets(0),
30500
+ dynamicIsland: null,
30501
+ // portrait safeAreaInsets. landscape was top 10, left 0, bottom 20, right 0.
30502
+ safeAreaInsets: { top: 32, bottom: 20, left: 0, right: 0 },
30503
+ iosVersion: "27.0",
30504
+ // portrait docked keyboard, UIKeyboardFrameEndUserInfoKey
30505
+ // {0, 870, 834, 340}. landscape posted a zero-height frame.
30506
+ keyboardPanelHeights: { qwerty: 333, pad: 333, emoji: 427 },
30507
+ // hypot(1668, 2420) / 11, measured native pixels over the device type's
30508
+ // 11-inch name. not a separate density read.
30509
+ physicalPPI: Math.hypot(width * 2, height * 2) / diagonalInches,
30510
+ hardwareButtons: modernButtons([0, 0], [0, 0], [0, 0], [0, 0])
30511
+ });
30512
+ }
30418
30513
  function resolveDevicePosture(model, posture) {
30419
30514
  const supported = devices[model].supportedPostures;
30420
30515
  return posture && supported?.includes(posture) ? posture : supported?.[0] ?? "closed";
@@ -30465,7 +30560,7 @@ function rotateDevice(device, side) {
30465
30560
  const barrelProtrusion = device.housing?.hingeBarrel?.protrusion ?? 0;
30466
30561
  if (side === "left") insets.top += barrelProtrusion;
30467
30562
  else insets.bottom += barrelProtrusion;
30468
- const safeArea = device.model === "ipad-pro-11" ? { top: 10, bottom: 20, left: 0, right: 0 } : device.model === "iphone-duo" ? { top: 0, bottom: 34, left: 0, right: 84 } : device.platform === "ios" && device.homeIndicatorHeight > 0 ? {
30563
+ const safeArea = isPadIdiom(device) ? { top: 10, bottom: 20, left: 0, right: 0 } : device.model === "iphone-duo" ? { top: 0, bottom: 34, left: 0, right: 84 } : device.platform === "ios" && device.homeIndicatorHeight > 0 ? {
30469
30564
  top: 0,
30470
30565
  bottom: 20,
30471
30566
  left: device.safeAreaInsets.top,
@@ -30508,6 +30603,9 @@ function rotateDevice(device, side) {
30508
30603
  function defaultLandscapeSide(model, posture) {
30509
30604
  return model === "iphone-duo" && resolveDevicePosture(model, posture) === "closed" ? "right" : "left";
30510
30605
  }
30606
+ function isPadIdiom(spec) {
30607
+ return spec.model === "ipad-pro-11" || spec.model === "ipad-pro-13";
30608
+ }
30511
30609
  function getDevice(model, posture, orientation, landscapeSide) {
30512
30610
  const device = devices[model];
30513
30611
  const side = landscapeSide ?? defaultLandscapeSide(model, posture);
@@ -31084,42 +31182,9 @@ var init_devices = __esm({
31084
31182
  // frame and hardware buttons are not sourced yet, so this stays off the
31085
31183
  // shipping picker the same way the duo does.
31086
31184
  developmentOnly: true,
31087
- ...iosDevice({
31088
- model: "ipad-pro-11",
31089
- name: "iPad Pro 11-inch (M5)",
31090
- // iPad Pro 11-inch (M5) 12GB, iOS 27.0, simulator DBD4B183, UIKit probe
31091
- // scenario `metrics`. portrait UIScreen.bounds 834×1210, scale 2,
31092
- // nativeBounds 1668×2420. the window matched the screen.
31093
- width: 834,
31094
- height: 1210,
31095
- scale: 2,
31096
- // portrait statusBarFrame was 834×32 at the top, and safeAreaInsets.top
31097
- // was 32. landscape statusBarFrame stayed 32 tall while safeAreaInsets.top
31098
- // was 10; this field is the portrait bar.
31099
- statusBarHeight: 32,
31100
- landscapeStatusBarHeight: 32,
31101
- // portrait and landscape safeAreaInsets.bottom were both 20. the probe
31102
- // has no separate home-indicator height.
31103
- homeIndicatorHeight: 20,
31104
- // UIScreen _displayCornerRadius, both orientations. the framebuffer
31105
- // mask's tangent extent was not measured separately.
31106
- cornerRadius: cornerRadii(30),
31107
- continuousCornerRadius: cornerRadii(30),
31108
- // housing is unsourced. the frame is the display until it is measured.
31109
- frameInsets: uniformFrameInsets(0),
31110
- dynamicIsland: null,
31111
- // portrait safeAreaInsets. landscape was top 10, left 0, bottom 20, right 0.
31112
- safeAreaInsets: { top: 32, bottom: 20, left: 0, right: 0 },
31113
- iosVersion: "27.0",
31114
- // portrait docked keyboard, UIKeyboardFrameEndUserInfoKey
31115
- // {0, 870, 834, 340}. landscape posted a zero-height frame.
31116
- keyboardPanelHeights: { qwerty: 333, pad: 333, emoji: 427 },
31117
- // hypot(1668, 2420) / 11, measured native pixels over the device type's
31118
- // 11-inch name. not a separate density read.
31119
- physicalPPI: 267.19578360606573,
31120
- hardwareButtons: modernButtons([0, 0], [0, 0], [0, 0], [0, 0])
31121
- })
31185
+ ...ipadProDevice("ipad-pro-11", "iPad Pro 11-inch (M5)", 834, 1210, 11)
31122
31186
  },
31187
+ "ipad-pro-13": ipadProDevice("ipad-pro-13", "iPad Pro 13-inch (M5)", 1032, 1376, 13),
31123
31188
  "pixel-8": {
31124
31189
  model: "pixel-8",
31125
31190
  platform: "android",
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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;
@@ -447,14 +447,72 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
447
447
  };
448
448
  var OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
449
449
  var SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
450
- function swiftImportNames(contents, unconditional = false) {
450
+ function swiftCondition(text, available) {
451
+ const tokens = text.match(/\w+\s*\([^()]*\)|&&|\|\||!|\(|\)|\w+/g) ?? [];
452
+ let index = 0;
453
+ const atom = () => {
454
+ const token = tokens[index++];
455
+ if (token === "!") {
456
+ const value = atom();
457
+ return value === void 0 ? void 0 : !value;
458
+ }
459
+ if (token === "(") {
460
+ const value = either();
461
+ index++;
462
+ return value;
463
+ }
464
+ if (token === "true") return true;
465
+ if (token === "false") return false;
466
+ const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? "");
467
+ if (!call) return void 0;
468
+ const [, name, argument] = call;
469
+ if (name === "os") return argument === "iOS" || argument === "WASI";
470
+ if (name === "canImport") return available.has(argument);
471
+ if (name === "targetEnvironment") return false;
472
+ if (name === "arch") return argument === "wasm32";
473
+ return void 0;
474
+ };
475
+ const both = () => {
476
+ let value = atom();
477
+ while (tokens[index] === "&&") {
478
+ index++;
479
+ const next = atom();
480
+ value = value === false || next === false ? false : value && next ? true : void 0;
481
+ }
482
+ return value;
483
+ };
484
+ const either = () => {
485
+ let value = both();
486
+ while (tokens[index] === "||") {
487
+ index++;
488
+ const next = both();
489
+ value = value === true || next === true ? true : value === false && next === false ? false : void 0;
490
+ }
491
+ return value;
492
+ };
493
+ return either();
494
+ }
495
+ function swiftImportNames(contents, available) {
451
496
  const names = [];
452
- let depth = 0;
497
+ const frames = [];
453
498
  for (const line of contents.split("\n")) {
454
- const directive = /^\s*#(if|endif)\b/.exec(line)?.[1];
455
- if (directive === "if") depth++;
456
- else if (directive === "endif") depth = Math.max(0, depth - 1);
457
- if (unconditional && depth > 0) continue;
499
+ const directive = /^\s*#(if|elseif|else|endif)\b(.*)$/.exec(line);
500
+ if (directive && available) {
501
+ const [, kind, rest] = directive;
502
+ const condition = (rest ?? "").replace(/\/\/.*$/, "").trim();
503
+ if (kind === "if") {
504
+ const active = swiftCondition(condition, available);
505
+ frames.push({ active, taken: active });
506
+ } else if (kind === "endif") frames.pop();
507
+ else if (frames.length > 0) {
508
+ const frame = frames[frames.length - 1];
509
+ const holds = kind === "else" ? true : swiftCondition(condition, available);
510
+ frame.active = frame.taken === true ? false : frame.taken === false ? holds : holds && void 0;
511
+ frame.taken = frame.taken === true || holds === true ? true : frame.taken === false ? holds : void 0;
512
+ }
513
+ continue;
514
+ }
515
+ if (available && frames.some((frame) => frame.active !== true)) continue;
458
516
  const name = SWIFT_IMPORT.exec(line)?.[1];
459
517
  if (name) names.push(name);
460
518
  }
@@ -499,7 +557,7 @@ function missingSwiftModules(files, available) {
499
557
  const missing = /* @__PURE__ */ new Map();
500
558
  for (const [file, contents] of Object.entries(files)) {
501
559
  if (!file.endsWith(".swift") || file === "Package.swift") continue;
502
- for (const name of new Set(swiftImportNames(contents, true))) {
560
+ for (const name of new Set(swiftImportNames(contents, available))) {
503
561
  if (available.has(name)) continue;
504
562
  missing.set(name, [...missing.get(name) ?? [], file]);
505
563
  }
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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";
@@ -399,14 +399,72 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
399
399
  };
400
400
  var OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
401
401
  var SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
402
- function swiftImportNames(contents, unconditional = false) {
402
+ function swiftCondition(text, available) {
403
+ const tokens = text.match(/\w+\s*\([^()]*\)|&&|\|\||!|\(|\)|\w+/g) ?? [];
404
+ let index = 0;
405
+ const atom = () => {
406
+ const token = tokens[index++];
407
+ if (token === "!") {
408
+ const value = atom();
409
+ return value === void 0 ? void 0 : !value;
410
+ }
411
+ if (token === "(") {
412
+ const value = either();
413
+ index++;
414
+ return value;
415
+ }
416
+ if (token === "true") return true;
417
+ if (token === "false") return false;
418
+ const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? "");
419
+ if (!call) return void 0;
420
+ const [, name, argument] = call;
421
+ if (name === "os") return argument === "iOS" || argument === "WASI";
422
+ if (name === "canImport") return available.has(argument);
423
+ if (name === "targetEnvironment") return false;
424
+ if (name === "arch") return argument === "wasm32";
425
+ return void 0;
426
+ };
427
+ const both = () => {
428
+ let value = atom();
429
+ while (tokens[index] === "&&") {
430
+ index++;
431
+ const next = atom();
432
+ value = value === false || next === false ? false : value && next ? true : void 0;
433
+ }
434
+ return value;
435
+ };
436
+ const either = () => {
437
+ let value = both();
438
+ while (tokens[index] === "||") {
439
+ index++;
440
+ const next = both();
441
+ value = value === true || next === true ? true : value === false && next === false ? false : void 0;
442
+ }
443
+ return value;
444
+ };
445
+ return either();
446
+ }
447
+ function swiftImportNames(contents, available) {
403
448
  const names = [];
404
- let depth = 0;
449
+ const frames = [];
405
450
  for (const line of contents.split("\n")) {
406
- const directive = /^\s*#(if|endif)\b/.exec(line)?.[1];
407
- if (directive === "if") depth++;
408
- else if (directive === "endif") depth = Math.max(0, depth - 1);
409
- if (unconditional && depth > 0) continue;
451
+ const directive = /^\s*#(if|elseif|else|endif)\b(.*)$/.exec(line);
452
+ if (directive && available) {
453
+ const [, kind, rest] = directive;
454
+ const condition = (rest ?? "").replace(/\/\/.*$/, "").trim();
455
+ if (kind === "if") {
456
+ const active = swiftCondition(condition, available);
457
+ frames.push({ active, taken: active });
458
+ } else if (kind === "endif") frames.pop();
459
+ else if (frames.length > 0) {
460
+ const frame = frames[frames.length - 1];
461
+ const holds = kind === "else" ? true : swiftCondition(condition, available);
462
+ frame.active = frame.taken === true ? false : frame.taken === false ? holds : holds && void 0;
463
+ frame.taken = frame.taken === true || holds === true ? true : frame.taken === false ? holds : void 0;
464
+ }
465
+ continue;
466
+ }
467
+ if (available && frames.some((frame) => frame.active !== true)) continue;
410
468
  const name = SWIFT_IMPORT.exec(line)?.[1];
411
469
  if (name) names.push(name);
412
470
  }
@@ -451,7 +509,7 @@ function missingSwiftModules(files, available) {
451
509
  const missing = /* @__PURE__ */ new Map();
452
510
  for (const [file, contents] of Object.entries(files)) {
453
511
  if (!file.endsWith(".swift") || file === "Package.swift") continue;
454
- for (const name of new Set(swiftImportNames(contents, true))) {
512
+ for (const name of new Set(swiftImportNames(contents, available))) {
455
513
  if (available.has(name)) continue;
456
514
  missing.set(name, [...missing.get(name) ?? [], file]);
457
515
  }
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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;
@@ -732,14 +732,72 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
732
732
  };
733
733
  var OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
734
734
  var SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
735
- function swiftImportNames(contents, unconditional = false) {
735
+ function swiftCondition(text2, available) {
736
+ const tokens = text2.match(/\w+\s*\([^()]*\)|&&|\|\||!|\(|\)|\w+/g) ?? [];
737
+ let index = 0;
738
+ const atom = () => {
739
+ const token = tokens[index++];
740
+ if (token === "!") {
741
+ const value = atom();
742
+ return value === void 0 ? void 0 : !value;
743
+ }
744
+ if (token === "(") {
745
+ const value = either();
746
+ index++;
747
+ return value;
748
+ }
749
+ if (token === "true") return true;
750
+ if (token === "false") return false;
751
+ const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? "");
752
+ if (!call) return void 0;
753
+ const [, name, argument] = call;
754
+ if (name === "os") return argument === "iOS" || argument === "WASI";
755
+ if (name === "canImport") return available.has(argument);
756
+ if (name === "targetEnvironment") return false;
757
+ if (name === "arch") return argument === "wasm32";
758
+ return void 0;
759
+ };
760
+ const both = () => {
761
+ let value = atom();
762
+ while (tokens[index] === "&&") {
763
+ index++;
764
+ const next = atom();
765
+ value = value === false || next === false ? false : value && next ? true : void 0;
766
+ }
767
+ return value;
768
+ };
769
+ const either = () => {
770
+ let value = both();
771
+ while (tokens[index] === "||") {
772
+ index++;
773
+ const next = both();
774
+ value = value === true || next === true ? true : value === false && next === false ? false : void 0;
775
+ }
776
+ return value;
777
+ };
778
+ return either();
779
+ }
780
+ function swiftImportNames(contents, available) {
736
781
  const names = [];
737
- let depth = 0;
782
+ const frames = [];
738
783
  for (const line of contents.split("\n")) {
739
- const directive = /^\s*#(if|endif)\b/.exec(line)?.[1];
740
- if (directive === "if") depth++;
741
- else if (directive === "endif") depth = Math.max(0, depth - 1);
742
- if (unconditional && depth > 0) continue;
784
+ const directive = /^\s*#(if|elseif|else|endif)\b(.*)$/.exec(line);
785
+ if (directive && available) {
786
+ const [, kind, rest] = directive;
787
+ const condition = (rest ?? "").replace(/\/\/.*$/, "").trim();
788
+ if (kind === "if") {
789
+ const active = swiftCondition(condition, available);
790
+ frames.push({ active, taken: active });
791
+ } else if (kind === "endif") frames.pop();
792
+ else if (frames.length > 0) {
793
+ const frame = frames[frames.length - 1];
794
+ const holds = kind === "else" ? true : swiftCondition(condition, available);
795
+ frame.active = frame.taken === true ? false : frame.taken === false ? holds : holds && void 0;
796
+ frame.taken = frame.taken === true || holds === true ? true : frame.taken === false ? holds : void 0;
797
+ }
798
+ continue;
799
+ }
800
+ if (available && frames.some((frame) => frame.active !== true)) continue;
743
801
  const name = SWIFT_IMPORT.exec(line)?.[1];
744
802
  if (name) names.push(name);
745
803
  }
@@ -784,7 +842,7 @@ function missingSwiftModules(files, available) {
784
842
  const missing = /* @__PURE__ */ new Map();
785
843
  for (const [file, contents] of Object.entries(files)) {
786
844
  if (!file.endsWith(".swift") || file === "Package.swift") continue;
787
- for (const name of new Set(swiftImportNames(contents, true))) {
845
+ for (const name of new Set(swiftImportNames(contents, available))) {
788
846
  if (available.has(name)) continue;
789
847
  missing.set(name, [...missing.get(name) ?? [], file]);
790
848
  }
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.762 | (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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.760",
3
+ "version": "0.1.762",
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",