peachsim 0.1.760 → 0.1.761

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 +66 -8
  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 +66 -8
  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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var SIM_LONG_PRESS_MAX_MS = 5e3;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/capture-contract.ts
4
4
  var RNX_SCREEN_CAPTURE_VERSION = 1;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-contract.ts
4
4
  var RNX_CLOUD_MAX_ARTIFACT_BYTES = 20 * 1024 * 1024;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-test-args.ts
4
4
  var CLOUD_TEST_ARGS_MAX_COUNT = 32;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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;
@@ -6768,14 +6768,72 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
6768
6768
  };
6769
6769
  var OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
6770
6770
  var SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
6771
- function swiftImportNames(contents, unconditional = false) {
6771
+ function swiftCondition(text2, available) {
6772
+ const tokens = text2.match(/\w+\s*\([^()]*\)|&&|\|\||!|\(|\)|\w+/g) ?? [];
6773
+ let index = 0;
6774
+ const atom = () => {
6775
+ const token = tokens[index++];
6776
+ if (token === "!") {
6777
+ const value = atom();
6778
+ return value === void 0 ? void 0 : !value;
6779
+ }
6780
+ if (token === "(") {
6781
+ const value = either();
6782
+ index++;
6783
+ return value;
6784
+ }
6785
+ if (token === "true") return true;
6786
+ if (token === "false") return false;
6787
+ const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? "");
6788
+ if (!call) return void 0;
6789
+ const [, name2, argument] = call;
6790
+ if (name2 === "os") return argument === "iOS" || argument === "WASI";
6791
+ if (name2 === "canImport") return available.has(argument);
6792
+ if (name2 === "targetEnvironment") return false;
6793
+ if (name2 === "arch") return argument === "wasm32";
6794
+ return void 0;
6795
+ };
6796
+ const both = () => {
6797
+ let value = atom();
6798
+ while (tokens[index] === "&&") {
6799
+ index++;
6800
+ const next = atom();
6801
+ value = value === false || next === false ? false : value && next ? true : void 0;
6802
+ }
6803
+ return value;
6804
+ };
6805
+ const either = () => {
6806
+ let value = both();
6807
+ while (tokens[index] === "||") {
6808
+ index++;
6809
+ const next = both();
6810
+ value = value === true || next === true ? true : value === false && next === false ? false : void 0;
6811
+ }
6812
+ return value;
6813
+ };
6814
+ return either();
6815
+ }
6816
+ function swiftImportNames(contents, available) {
6772
6817
  const names = [];
6773
- let depth = 0;
6818
+ const frames = [];
6774
6819
  for (const line of contents.split("\n")) {
6775
- const directive = /^\s*#(if|endif)\b/.exec(line)?.[1];
6776
- if (directive === "if") depth++;
6777
- else if (directive === "endif") depth = Math.max(0, depth - 1);
6778
- if (unconditional && depth > 0) continue;
6820
+ const directive = /^\s*#(if|elseif|else|endif)\b(.*)$/.exec(line);
6821
+ if (directive && available) {
6822
+ const [, kind, rest] = directive;
6823
+ const condition = (rest ?? "").replace(/\/\/.*$/, "").trim();
6824
+ if (kind === "if") {
6825
+ const active = swiftCondition(condition, available);
6826
+ frames.push({ active, taken: active });
6827
+ } else if (kind === "endif") frames.pop();
6828
+ else if (frames.length > 0) {
6829
+ const frame = frames[frames.length - 1];
6830
+ const holds = kind === "else" ? true : swiftCondition(condition, available);
6831
+ frame.active = frame.taken === true ? false : frame.taken === false ? holds : holds && void 0;
6832
+ frame.taken = frame.taken === true || holds === true ? true : frame.taken === false ? holds : void 0;
6833
+ }
6834
+ continue;
6835
+ }
6836
+ if (available && frames.some((frame) => frame.active !== true)) continue;
6779
6837
  const name2 = SWIFT_IMPORT.exec(line)?.[1];
6780
6838
  if (name2) names.push(name2);
6781
6839
  }
@@ -6820,7 +6878,7 @@ function missingSwiftModules(files, available) {
6820
6878
  const missing = /* @__PURE__ */ new Map();
6821
6879
  for (const [file, contents] of Object.entries(files)) {
6822
6880
  if (!file.endsWith(".swift") || file === "Package.swift") continue;
6823
- for (const name2 of new Set(swiftImportNames(contents, true))) {
6881
+ for (const name2 of new Set(swiftImportNames(contents, available))) {
6824
6882
  if (available.has(name2)) continue;
6825
6883
  missing.set(name2, [...missing.get(name2) ?? [], file]);
6826
6884
  }
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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.761 | (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
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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/dist-lib/menu.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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;
package/dist-lib/menu.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/metro-production-bundle.ts
4
4
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/native-app-identity.ts
4
4
  var NATIVE_APP_IDENTITY_PREFIX = "globalThis.__sootsimNativeAppIdentity=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/native-firebase-metadata.ts
4
4
  var PREFIX = "globalThis.__peachNativeFirebaseConfig=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/plist.ts
4
4
  import plist from "plist";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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.761 | (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.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/react-native-host-modules.ts
4
4
  var REACT_NATIVE_PASSTHROUGH_SPECIFIERS = [
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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/dist-lib/sdk.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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;
package/dist-lib/sdk.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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
  }
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.760 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761 | (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.761",
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",
@@ -275,19 +275,108 @@ const OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES)
275
275
  const SWIFT_IMPORT =
276
276
  /^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/
277
277
 
278
+ // a compilation condition as the wasm compile sees it after the source
279
+ // rewrite below: `os(iOS)` and `os(WASI)` hold, other platforms do not,
280
+ // `canImport` holds for an available module. what the scan cannot know
281
+ // (custom flags, swift versions, features) is undefined, three-valued
282
+ // through `!`, `&&` and `||`.
283
+ function swiftCondition(
284
+ text: string,
285
+ available: ReadonlySet<string>,
286
+ ): boolean | undefined {
287
+ const tokens = text.match(/\w+\s*\([^()]*\)|&&|\|\||!|\(|\)|\w+/g) ?? []
288
+ let index = 0
289
+ const atom = (): boolean | undefined => {
290
+ const token = tokens[index++]
291
+ if (token === '!') {
292
+ const value = atom()
293
+ return value === undefined ? undefined : !value
294
+ }
295
+ if (token === '(') {
296
+ const value = either()
297
+ index++
298
+ return value
299
+ }
300
+ if (token === 'true') return true
301
+ if (token === 'false') return false
302
+ const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? '')
303
+ if (!call) return undefined
304
+ const [, name, argument] = call
305
+ if (name === 'os') return argument === 'iOS' || argument === 'WASI'
306
+ if (name === 'canImport') return available.has(argument!)
307
+ if (name === 'targetEnvironment') return false
308
+ if (name === 'arch') return argument === 'wasm32'
309
+ return undefined
310
+ }
311
+ const both = (): boolean | undefined => {
312
+ let value = atom()
313
+ while (tokens[index] === '&&') {
314
+ index++
315
+ const next = atom()
316
+ value = value === false || next === false ? false : value && next ? true : undefined
317
+ }
318
+ return value
319
+ }
320
+ const either = (): boolean | undefined => {
321
+ let value = both()
322
+ while (tokens[index] === '||') {
323
+ index++
324
+ const next = both()
325
+ value =
326
+ value === true || next === true
327
+ ? true
328
+ : value === false && next === false
329
+ ? false
330
+ : undefined
331
+ }
332
+ return value
333
+ }
334
+ return either()
335
+ }
336
+
278
337
  /**
279
- * the modules a source imports, in order. `unconditional` keeps only imports
280
- * outside every `#if`: a conditional one may compile out (`os(macOS)`,
281
- * `canImport`), so only an unconditional import is certainly required.
338
+ * the modules a source imports, in order. with `available`, only imports the
339
+ * wasm compile certainly reaches: those outside every `#if`, or in a branch
340
+ * whose condition holds there, `os(iOS)` included since the compile rewrites
341
+ * it to true. a branch the scan cannot decide may compile out, so its
342
+ * imports stay out of the list.
282
343
  */
283
- export function swiftImportNames(contents: string, unconditional = false): string[] {
344
+ export function swiftImportNames(
345
+ contents: string,
346
+ available?: ReadonlySet<string>,
347
+ ): string[] {
284
348
  const names: string[] = []
285
- let depth = 0
349
+ // per open `#if`: whether its current branch is active, and whether an
350
+ // earlier branch was taken (or may have been)
351
+ const frames: { active: boolean | undefined; taken: boolean | undefined }[] = []
286
352
  for (const line of contents.split('\n')) {
287
- const directive = /^\s*#(if|endif)\b/.exec(line)?.[1]
288
- if (directive === 'if') depth++
289
- else if (directive === 'endif') depth = Math.max(0, depth - 1)
290
- if (unconditional && depth > 0) continue
353
+ const directive = /^\s*#(if|elseif|else|endif)\b(.*)$/.exec(line)
354
+ if (directive && available) {
355
+ const [, kind, rest] = directive
356
+ const condition = (rest ?? '').replace(/\/\/.*$/, '').trim()
357
+ if (kind === 'if') {
358
+ const active = swiftCondition(condition, available)
359
+ frames.push({ active, taken: active })
360
+ } else if (kind === 'endif') frames.pop()
361
+ else if (frames.length > 0) {
362
+ const frame = frames[frames.length - 1]!
363
+ const holds = kind === 'else' ? true : swiftCondition(condition, available)
364
+ frame.active =
365
+ frame.taken === true
366
+ ? false
367
+ : frame.taken === false
368
+ ? holds
369
+ : holds && undefined
370
+ frame.taken =
371
+ frame.taken === true || holds === true
372
+ ? true
373
+ : frame.taken === false
374
+ ? holds
375
+ : undefined
376
+ }
377
+ continue
378
+ }
379
+ if (available && frames.some((frame) => frame.active !== true)) continue
291
380
  const name = SWIFT_IMPORT.exec(line)?.[1]
292
381
  if (name) names.push(name)
293
382
  }
@@ -346,8 +435,9 @@ export function swiftAvailableModules(
346
435
  }
347
436
 
348
437
  /**
349
- * the modules the sources import outside any `#if` that nothing available
350
- * provides, each with the files importing it. the compiler stops at the first
438
+ * the modules the sources certainly import (swiftImportNames with
439
+ * `available`) that nothing available provides, each with the files
440
+ * importing it. the compiler stops at the first
351
441
  * missing module; this names all of them at once.
352
442
  */
353
443
  export function missingSwiftModules(
@@ -357,7 +447,7 @@ export function missingSwiftModules(
357
447
  const missing = new Map<string, string[]>()
358
448
  for (const [file, contents] of Object.entries(files)) {
359
449
  if (!file.endsWith('.swift') || file === 'Package.swift') continue
360
- for (const name of new Set(swiftImportNames(contents, true))) {
450
+ for (const name of new Set(swiftImportNames(contents, available))) {
361
451
  if (available.has(name)) continue
362
452
  missing.set(name, [...(missing.get(name) ?? []), file])
363
453
  }