peachsim 0.1.793 → 0.1.795

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 (81) hide show
  1. package/cli/app-config.ts +3 -7
  2. package/dist-lib/agent-daemon-client.cjs +2 -2
  3. package/dist-lib/agent-events.cjs +2 -2
  4. package/dist-lib/agent-identity.cjs +2 -2
  5. package/dist-lib/agent-sessions.cjs +2 -2
  6. package/dist-lib/attached-projects.cjs +2 -2
  7. package/dist-lib/auth/shared-session.cjs +2 -2
  8. package/dist-lib/backend-origin.cjs +2 -2
  9. package/dist-lib/beta.cjs +2 -2
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +2 -2
  12. package/dist-lib/bridge-contract-input.cjs +2 -2
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +2 -2
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/bundle-channel.cjs +9077 -0
  17. package/dist-lib/capture-contract.cjs +2 -2
  18. package/dist-lib/capture-contract.mjs +1 -1
  19. package/dist-lib/cli-constants.cjs +2 -2
  20. package/dist-lib/cloud-contract.cjs +2 -2
  21. package/dist-lib/cloud-contract.mjs +1 -1
  22. package/dist-lib/cloud-test-args.cjs +2 -2
  23. package/dist-lib/cloud-test-args.mjs +1 -1
  24. package/dist-lib/cloud.cjs +2 -2
  25. package/dist-lib/cloud.mjs +1 -1
  26. package/dist-lib/config.cjs +2 -2
  27. package/dist-lib/detox/index.cjs +2 -2
  28. package/dist-lib/dev-bundle-resolution.cjs +2 -2
  29. package/dist-lib/expo-swift-bundle.cjs +8425 -0
  30. package/dist-lib/expo-swift-metadata.cjs +91 -0
  31. package/dist-lib/expo-swift-metadata.mjs +63 -0
  32. package/dist-lib/home-paths.cjs +2 -2
  33. package/dist-lib/host/bridge-host.cjs +244 -130
  34. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +2 -2
  38. package/dist-lib/host/websocket-proxy.cjs +2 -2
  39. package/dist-lib/index.cjs +110 -12
  40. package/dist-lib/jump-to-source-babel.cjs +2 -2
  41. package/dist-lib/jump-to-source-native.cjs +2 -2
  42. package/dist-lib/kotlin-host.cjs +2 -2
  43. package/dist-lib/menu.cjs +2 -2
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +2 -2
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +2 -2
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +110 -12
  50. package/dist-lib/native-app-identity.cjs +2 -2
  51. package/dist-lib/native-app-identity.mjs +1 -1
  52. package/dist-lib/native-firebase-metadata.cjs +2 -2
  53. package/dist-lib/native-firebase-metadata.mjs +1 -1
  54. package/dist-lib/plist.cjs +2 -2
  55. package/dist-lib/plist.mjs +1 -1
  56. package/dist-lib/profiles.cjs +2 -2
  57. package/dist-lib/public-brand.cjs +2 -2
  58. package/dist-lib/react-native-host-modules.cjs +2 -2
  59. package/dist-lib/react-native-host-modules.mjs +1 -1
  60. package/dist-lib/render-mode.cjs +2 -2
  61. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  62. package/dist-lib/sdk.cjs +2 -2
  63. package/dist-lib/sdk.mjs +1 -1
  64. package/dist-lib/skills.cjs +355 -165
  65. package/dist-lib/swift-compile.cjs +105 -5
  66. package/dist-lib/swift-compile.mjs +101 -2
  67. package/dist-lib/swift-package.cjs +2 -2
  68. package/dist-lib/swift-package.mjs +1 -1
  69. package/dist-lib/swift-submit.cjs +2 -2
  70. package/dist-lib/swift-submit.mjs +1 -1
  71. package/dist-lib/swift-toolchain.cjs +2 -2
  72. package/dist-lib/swift.cjs +2 -2
  73. package/dist-lib/vite-swift.cjs +64 -8
  74. package/dist-lib/vite.cjs +2 -2
  75. package/package.json +18 -2
  76. package/src/bundle-channel.mjs +251 -0
  77. package/src/expo-swift-bundle.ts +32 -0
  78. package/src/expo-swift-host.ts +161 -128
  79. package/src/expoSwiftContract.ts +88 -0
  80. package/src/swift-compile.ts +111 -1
  81. package/src/swift-host.ts +4 -1
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.793 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.795 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -26562,6 +26562,35 @@ var init_is_record = __esm({
26562
26562
  });
26563
26563
 
26564
26564
  // src/config.ts
26565
+ var config_exports = {};
26566
+ __export(config_exports, {
26567
+ PEACH_CONFIGURED_FILES_HOOK: () => PEACH_CONFIGURED_FILES_HOOK,
26568
+ PEACH_CONFIG_QUERY_PARAM: () => PEACH_CONFIG_QUERY_PARAM,
26569
+ applyPeachConfigToUrl: () => applyPeachConfigToUrl,
26570
+ collectConfiguredFileModules: () => collectConfiguredFileModules,
26571
+ createPeachBundleConfigFooter: () => createPeachBundleConfigFooter,
26572
+ defineConfig: () => defineConfig,
26573
+ detachPeachBundleConfigFooter: () => detachPeachBundleConfigFooter,
26574
+ hasPeachConfig: () => hasPeachConfig,
26575
+ isPeachConfig: () => isPeachConfig,
26576
+ mergePeachConfig: () => mergePeachConfig,
26577
+ readPeachBundleConfig: () => readPeachBundleConfig,
26578
+ readPeachBundleConfigFooter: () => readPeachBundleConfigFooter,
26579
+ readPeachConfigFromSearchParams: () => readPeachConfigFromSearchParams
26580
+ });
26581
+ function collectConfiguredFileModules(config) {
26582
+ return [
26583
+ ...new Set(
26584
+ ["modules", "turboModules", "nativeModules", "nativeViews"].flatMap((key2) => {
26585
+ const entries = config && Reflect.get(config, key2);
26586
+ if (!isRecord(entries)) return [];
26587
+ return Object.values(entries).flatMap(
26588
+ (entry) => isRecord(entry) && typeof entry.file === "string" ? [entry.file] : []
26589
+ );
26590
+ })
26591
+ )
26592
+ ];
26593
+ }
26565
26594
  function isPeachConfig(value) {
26566
26595
  if (!isRecord(value)) return false;
26567
26596
  return (value.runtimeVersion === void 0 || typeof value.runtimeVersion === "string" && value.runtimeVersion === value.runtimeVersion.trim() && isValidRuntimeVersion(value.runtimeVersion)) && [
@@ -26575,6 +26604,42 @@ function isPeachConfig(value) {
26575
26604
  "initialState"
26576
26605
  ].every((key2) => value[key2] === void 0 || isRecord(value[key2]));
26577
26606
  }
26607
+ function readPeachBundleConfig(value) {
26608
+ if (value === void 0 || value === null) return null;
26609
+ if (!isRecord(value) || !isPeachConfig(value.config) || !Array.isArray(value.runtimePackages) || !value.runtimePackages.every((name2) => typeof name2 === "string")) {
26610
+ throw new Error("configured bundle metadata is malformed");
26611
+ }
26612
+ return { config: value.config, runtimePackages: [...value.runtimePackages] };
26613
+ }
26614
+ function readPeachBundleConfigFooter(source) {
26615
+ const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
26616
+ if (start < 0) return null;
26617
+ const end = source.indexOf("\n", start + 1);
26618
+ const line = source.slice(start + 1, end < 0 ? void 0 : end);
26619
+ if (!line.endsWith(";")) throw new Error("configured bundle footer is truncated");
26620
+ const result = readPeachBundleConfig(
26621
+ JSON.parse(line.slice(BUNDLE_CONFIG_PREFIX.length, -1))
26622
+ );
26623
+ if (!result) throw new Error("configured bundle footer is empty");
26624
+ return result;
26625
+ }
26626
+ function createPeachBundleConfigFooter(config) {
26627
+ const json = JSON.stringify(config).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/<\//g, "<\\/");
26628
+ return "\n" + BUNDLE_CONFIG_PREFIX + json + ";";
26629
+ }
26630
+ function detachPeachBundleConfigFooter(source) {
26631
+ const configuredBundle = readPeachBundleConfigFooter(source);
26632
+ if (!configuredBundle) return { source, configuredBundle };
26633
+ const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
26634
+ const end = source.indexOf("\n", start + 1);
26635
+ return {
26636
+ source: source.slice(0, start) + source.slice(end < 0 ? source.length : end),
26637
+ configuredBundle
26638
+ };
26639
+ }
26640
+ function defineConfig(config) {
26641
+ return config;
26642
+ }
26578
26643
  function hasOwnKeys(value) {
26579
26644
  return !!value && Object.keys(value).length > 0;
26580
26645
  }
@@ -26606,6 +26671,18 @@ function mergePeachConfig(base, override) {
26606
26671
  initialState: { ...base.initialState || {}, ...override.initialState || {} }
26607
26672
  };
26608
26673
  }
26674
+ function readPeachConfigFromSearchParams(searchParams) {
26675
+ const raw2 = searchParams.get(PEACH_CONFIG_QUERY_PARAM);
26676
+ if (!raw2) return void 0;
26677
+ try {
26678
+ const parsed = JSON.parse(raw2);
26679
+ return hasPeachConfig(parsed) ? parsed : void 0;
26680
+ } catch (error) {
26681
+ const message = error instanceof Error ? error.message : String(error);
26682
+ console.warn(`[peach] invalid ${PEACH_CONFIG_QUERY_PARAM}: ${message}`);
26683
+ return void 0;
26684
+ }
26685
+ }
26609
26686
  function applyPeachConfigToUrl(url, config) {
26610
26687
  const parsed = new URL(url);
26611
26688
  if (hasPeachConfig(config)) {
@@ -26615,13 +26692,15 @@ function applyPeachConfigToUrl(url, config) {
26615
26692
  }
26616
26693
  return parsed.toString();
26617
26694
  }
26618
- var PEACH_CONFIG_QUERY_PARAM;
26695
+ var PEACH_CONFIG_QUERY_PARAM, BUNDLE_CONFIG_PREFIX, PEACH_CONFIGURED_FILES_HOOK;
26619
26696
  var init_config = __esm({
26620
26697
  "src/config.ts"() {
26621
26698
  "use strict";
26622
26699
  init_version();
26623
26700
  init_is_record();
26624
26701
  PEACH_CONFIG_QUERY_PARAM = "peachConfig";
26702
+ BUNDLE_CONFIG_PREFIX = "globalThis.__peachBundleConfig=";
26703
+ PEACH_CONFIGURED_FILES_HOOK = "__peachInstallConfiguredFiles";
26625
26704
  }
26626
26705
  });
26627
26706
 
@@ -29784,6 +29863,57 @@ function lowerNSValueTimeBox(source) {
29784
29863
  out = out.slice(0, at) + insert + out.slice(at + remove);
29785
29864
  return out;
29786
29865
  }
29866
+ function lowerNotificationDelegate(source) {
29867
+ const code = swiftCodeMask(source);
29868
+ const selectors = {
29869
+ willPresent: "userNotificationCenter:willPresentNotification:withCompletionHandler:",
29870
+ didReceive: "userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:",
29871
+ openSettingsFor: "userNotificationCenter:openSettingsForNotification:"
29872
+ };
29873
+ const edits = [];
29874
+ const selector = /#(?:selector|Selector)\(\s*UNUserNotificationCenterDelegate\.userNotificationCenter\(\s*_\s*:\s*(willPresent|didReceive|openSettingsFor)\s*:[^)]*\)\s*\)/g;
29875
+ for (const match of code.matchAll(selector)) {
29876
+ edits.push([
29877
+ match.index,
29878
+ match[0].length,
29879
+ `NSSelectorFromString(${JSON.stringify(selectors[match[1]])})`
29880
+ ]);
29881
+ }
29882
+ const receivers = /* @__PURE__ */ new Set();
29883
+ for (const match of code.matchAll(
29884
+ /\b(?:var|let)\s+(\w+)\s*:\s*(?:any\s+)?UNUserNotificationCenterDelegate\??/g
29885
+ ))
29886
+ receivers.add(match[1]);
29887
+ for (const match of code.matchAll(/\blet\s+(\w+)\s*=\s*(?:self\.)?(\w+)\b/g)) {
29888
+ if (receivers.has(match[2])) receivers.add(match[1]);
29889
+ }
29890
+ for (const match of code.matchAll(
29891
+ /\b(\w+)(?:[?!])?\.userNotificationCenter\s*\?(?=\s*\()/g
29892
+ )) {
29893
+ if (receivers.has(match[1]))
29894
+ edits.push([match.index + match[0].lastIndexOf("?"), 1, " "]);
29895
+ }
29896
+ const braces = [...code.matchAll(/[{}]/g)].map((match) => match.index);
29897
+ for (const owner of code.matchAll(
29898
+ /\b(?:class|extension)\s+[A-Za-z_]\w*[^{}]*\bUNUserNotificationCenterDelegate\b[^{}]*\{/g
29899
+ )) {
29900
+ const open = owner.index + owner[0].length - 1;
29901
+ const close = closingBrace(code, braces, open);
29902
+ const body = code.slice(open + 1, close - 1);
29903
+ for (const method of body.matchAll(/\bfunc\s+userNotificationCenter\s*\(/g)) {
29904
+ const at = open + 1 + method.index;
29905
+ const signature2 = code.slice(at, code.indexOf("{", at));
29906
+ const label = Object.keys(selectors).find(
29907
+ (name2) => new RegExp(`\\b${name2}\\b`).test(signature2)
29908
+ );
29909
+ if (label) edits.push([at, 0, `@ObjC(${JSON.stringify(selectors[label])}) `]);
29910
+ }
29911
+ }
29912
+ let result = source;
29913
+ for (const [at, count, text3] of edits.sort((a, b) => b[0] - a[0]))
29914
+ result = result.slice(0, at) + text3 + result.slice(at + count);
29915
+ return result;
29916
+ }
29787
29917
  function swiftCodeMask(source) {
29788
29918
  const chars = source.split("");
29789
29919
  const blank = (from, to) => {
@@ -29888,7 +30018,10 @@ function swiftCodeMask(source) {
29888
30018
  return chars.join("");
29889
30019
  }
29890
30020
  function swiftSourceAsIOS(original, extraObjCExtensions) {
29891
- const source = liftExtensionOverrides(original, extraObjCExtensions);
30021
+ const source = liftExtensionOverrides(
30022
+ lowerNotificationDelegate(original),
30023
+ extraObjCExtensions
30024
+ );
29892
30025
  const { lineStarts, tokens } = swiftCodeScan(source);
29893
30026
  let offset = 0;
29894
30027
  const conditioned = source.split("\n").map((line) => {
@@ -29991,6 +30124,49 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
29991
30124
  lowerAVAssetURLCluster(lowerAnyObjectDoubleValue(out + conditioned.slice(copied)))
29992
30125
  );
29993
30126
  }
30127
+ function swiftSourceClosure(files2, roots) {
30128
+ const sources = /* @__PURE__ */ new Map();
30129
+ const owners = /* @__PURE__ */ new Map();
30130
+ const extensions = /* @__PURE__ */ new Map();
30131
+ for (const [file, source] of Object.entries(files2)) {
30132
+ if (!file.endsWith(".swift")) continue;
30133
+ const code = swiftCodeMask(source);
30134
+ const references = new Set(code.match(/[A-Za-z_]\w*/g) ?? []);
30135
+ const pattern = /[{}]|\b(class|struct|enum|protocol|actor|typealias|func|var|let|extension)\s+([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)/g;
30136
+ let depth = 0;
30137
+ for (const match of code.matchAll(pattern)) {
30138
+ if (match[0] === "{") {
30139
+ depth++;
30140
+ continue;
30141
+ }
30142
+ if (match[0] === "}") {
30143
+ depth--;
30144
+ continue;
30145
+ }
30146
+ if (depth !== 0 || !match[2]) continue;
30147
+ const name2 = match[2].split(".").pop();
30148
+ const index = match[1] === "extension" ? extensions : owners;
30149
+ const set2 = index.get(name2) ?? /* @__PURE__ */ new Set();
30150
+ set2.add(file);
30151
+ index.set(name2, set2);
30152
+ }
30153
+ sources.set(file, references);
30154
+ }
30155
+ const included = /* @__PURE__ */ new Set();
30156
+ const pending = [...roots];
30157
+ const seen = /* @__PURE__ */ new Set();
30158
+ while (pending.length) {
30159
+ const name2 = pending.pop();
30160
+ if (seen.has(name2)) continue;
30161
+ seen.add(name2);
30162
+ for (const file of [...owners.get(name2) ?? [], ...extensions.get(name2) ?? []]) {
30163
+ if (included.has(file)) continue;
30164
+ included.add(file);
30165
+ for (const reference of sources.get(file)) pending.push(reference);
30166
+ }
30167
+ }
30168
+ return Object.fromEntries(Object.entries(files2).filter(([file]) => included.has(file)));
30169
+ }
29994
30170
  function swiftCodeScan(source) {
29995
30171
  const starts = /* @__PURE__ */ new Set();
29996
30172
  const tokens = [];
@@ -30263,7 +30439,7 @@ function compileSwiftProjectUnit(input, options) {
30263
30439
  };
30264
30440
  const hash = swiftArtifactHash(input, options.release, moduleRoot);
30265
30441
  return serialize(root, async () => {
30266
- if (process.platform === "darwin" && process.env.TM_SESSION && process.env.CI !== "true" && process.env.CONTRAST_HEAVY_ADMITTED !== "1" && moduleRoot === import_node_path7.default.resolve(import_meta2.dirname, "../../sootsim-swift") && !swiftDistributionAt(moduleRoot)) {
30442
+ if (process.platform === "darwin" && process.env.TM_SESSION && process.env.CI !== "true" && process.env.CONTRAST_HEAVY_ADMITTED !== "1" && moduleRoot === import_node_path7.default.resolve(__sootsim_import_meta_dirname, "../../sootsim-swift") && !swiftDistributionAt(moduleRoot)) {
30267
30443
  const requestRoot = (0, import_node_fs7.mkdtempSync)(import_node_path7.default.join(root, ".builder-request-"));
30268
30444
  const output = import_node_path7.default.join(requestRoot, "output");
30269
30445
  const request = import_node_path7.default.join(requestRoot, "request.json");
@@ -30363,7 +30539,7 @@ function compileSwiftProjectUnit(input, options) {
30363
30539
  };
30364
30540
  });
30365
30541
  }
30366
- var import_node_child_process4, import_node_crypto3, import_node_fs7, import_node_os2, import_node_path7, import_node_util2, import_meta2, run2, WASM_TRIPLE, cores, BUILD_ENV, BUILD_JOBS, linkedModuleDigests, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, sdkPaths, availableModules, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, MULTI_MANIFEST_VERSION, DIRECTIVE, OS_IOS, OBJC_ATTRIBUTE, SELECTOR, TYPE_AFTER_ATTRIBUTE, DELEGATE_CLASS, REUSABLE_INIT, REUSABLE_VIEW_BASES, CLASS_BASE, FRAME_INIT, APPLE_CLASS, EXTENSION_DECL, CLASS_DECL, MODIFIERS, OVERRIDE_FUNC, OVERRIDE_VAR, compiledSource, ROOT_LOCKS, host, rootLocks;
30542
+ var import_node_child_process4, import_node_crypto3, import_node_fs7, import_node_os2, import_node_path7, import_node_util2, run2, WASM_TRIPLE, cores, BUILD_ENV, BUILD_JOBS, linkedModuleDigests, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, sdkPaths, availableModules, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, MULTI_MANIFEST_VERSION, DIRECTIVE, OS_IOS, OBJC_ATTRIBUTE, SELECTOR, TYPE_AFTER_ATTRIBUTE, DELEGATE_CLASS, REUSABLE_INIT, REUSABLE_VIEW_BASES, CLASS_BASE, FRAME_INIT, APPLE_CLASS, EXTENSION_DECL, CLASS_DECL, MODIFIERS, OVERRIDE_FUNC, OVERRIDE_VAR, compiledSource, ROOT_LOCKS, host, rootLocks;
30367
30543
  var init_swift_compile = __esm({
30368
30544
  "src/swift-compile.ts"() {
30369
30545
  "use strict";
@@ -30376,7 +30552,6 @@ var init_swift_compile = __esm({
30376
30552
  init_swift_distribution_contract();
30377
30553
  init_swift_icu();
30378
30554
  init_swift_package();
30379
- import_meta2 = {};
30380
30555
  run2 = (0, import_node_util2.promisify)(import_node_child_process4.execFile);
30381
30556
  WASM_TRIPLE = "wasm32-unknown-wasip1";
30382
30557
  cores = import_node_os2.default.availableParallelism();
@@ -31072,7 +31247,7 @@ function swiftDistributionRoot() {
31072
31247
  return pending;
31073
31248
  }
31074
31249
  async function resolveSwiftModule() {
31075
- const checkout2 = import_node_path11.default.resolve(import_meta3.dirname, "../../sootsim-swift");
31250
+ const checkout2 = import_node_path11.default.resolve(__sootsim_import_meta_dirname, "../../sootsim-swift");
31076
31251
  if (import_node_fs11.default.existsSync(import_node_path11.default.join(checkout2, "toolchain.json"))) {
31077
31252
  try {
31078
31253
  return { root: checkout2, ...swiftModuleToolchain(checkout2) };
@@ -31090,7 +31265,7 @@ function swiftModuleToolchain(root) {
31090
31265
  toolchainBin: swiftToolchain(pin.release, swiftModuleSdk(root))
31091
31266
  };
31092
31267
  }
31093
- var import_node_fs11, import_node_path11, import_meta3, SWIFT_ENDPOINT_ENV, installs;
31268
+ var import_node_fs11, import_node_path11, SWIFT_ENDPOINT_ENV, installs;
31094
31269
  var init_swift_distribution = __esm({
31095
31270
  "src/swift-distribution.ts"() {
31096
31271
  "use strict";
@@ -31102,7 +31277,6 @@ var init_swift_distribution = __esm({
31102
31277
  init_swift_distribution_contract();
31103
31278
  init_swift_distribution_lock();
31104
31279
  init_swift_toolchain();
31105
- import_meta3 = {};
31106
31280
  SWIFT_ENDPOINT_ENV = "PEACH_SWIFT_ENDPOINT";
31107
31281
  installs = /* @__PURE__ */ new Map();
31108
31282
  }
@@ -36592,7 +36766,8 @@ async function compile(packagePath, entry, stamp, moduleRootOverride, hosted, sn
36592
36766
  ...targets.length > 0 ? targets : ["App"]
36593
36767
  ])
36594
36768
  );
36595
- if (missing.size > 0) throw new Error(await missingModulesMessage(packagePath, missing));
36769
+ if (missing.size > 0)
36770
+ throw new SwiftMissingModulesError(await missingModulesMessage(packagePath, missing));
36596
36771
  const artifact = await compileSwiftProjectUnit(input, {
36597
36772
  // the compile rewrites Sources/App in its root before swiftpm builds, and
36598
36773
  // its lock orders one process only: two vites on one root (a lane's dev
@@ -36858,7 +37033,7 @@ function serveSwiftPackageAsset(pathname, res) {
36858
37033
  res.end("swift artifact is stale");
36859
37034
  return true;
36860
37035
  }
36861
- var import_node_crypto8, import_node_fs18, import_node_os8, import_node_path19, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SKIP_SOURCE_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, projects, xcodeProjects, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, XCODE_STANDINS_DIR, CHECKOUTS_PREFIX, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, UNPROVIDED_PLATFORM_MODULES, IOS_SDK_FRAMEWORKS;
37036
+ var import_node_crypto8, import_node_fs18, import_node_os8, import_node_path19, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SKIP_SOURCE_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, projects, xcodeProjects, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, XCODE_STANDINS_DIR, CHECKOUTS_PREFIX, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, UNPROVIDED_PLATFORM_MODULES, IOS_SDK_FRAMEWORKS;
36862
37037
  var init_swift_host = __esm({
36863
37038
  "src/swift-host.ts"() {
36864
37039
  "use strict";
@@ -36891,6 +37066,8 @@ var init_swift_host = __esm({
36891
37066
  ]);
36892
37067
  NATIVE_DESCRIPTOR = ".one-native-source.json";
36893
37068
  NATIVE_GLUE = ".one-native-source.swift.txt";
37069
+ SwiftMissingModulesError = class extends Error {
37070
+ };
36894
37071
  projects = /* @__PURE__ */ new Map();
36895
37072
  xcodeProjects = /* @__PURE__ */ new Map();
36896
37073
  XCODE_APP_DIR = "__app__";
@@ -37018,9 +37195,10 @@ async function collectExpoSwiftSources(appRoot) {
37018
37195
  const name2 = module2 && typeof module2 === "object" ? Reflect.get(module2, "name") : null;
37019
37196
  if (typeof className !== "string" || !/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(className) || name2 !== null && typeof name2 !== "string")
37020
37197
  throw new Error(`${sourceRoot}: invalid Expo Apple module descriptor`);
37021
- classes.push(
37022
- `(${className.includes(".") ? className : `${namespace}.${className}`}.self, ${name2 === null ? "nil" : JSON.stringify(name2)})`
37023
- );
37198
+ classes.push({
37199
+ name: className.split(".").pop(),
37200
+ registration: `(${className.includes(".") ? className : `${namespace}.${className}`}.self, ${name2 === null ? "nil" : JSON.stringify(name2)})`
37201
+ });
37024
37202
  }
37025
37203
  const ios = import_node_path20.default.join(canonical, "ios");
37026
37204
  if (import_node_fs19.default.lstatSync(ios).isSymbolicLink())
@@ -37045,21 +37223,33 @@ ${import_node_fs19.default.readFileSync(file, "utf8")}`;
37045
37223
  }
37046
37224
  };
37047
37225
  walk2(ios);
37048
- const unit = { namespace, classes, files: files2 };
37049
- files2[EXPO_SWIFT_ENTRY] = expoEntry([unit]);
37050
- units.push(unit);
37226
+ for (const module2 of classes) {
37227
+ const unit = {
37228
+ namespace,
37229
+ moduleId: `${namespace}.${module2.name}`,
37230
+ classes: [module2.registration],
37231
+ files: swiftSourceClosure(files2, [module2.name])
37232
+ };
37233
+ unit.files[EXPO_SWIFT_ENTRY] = expoEntry([unit]);
37234
+ units.push(unit);
37235
+ }
37051
37236
  }
37052
37237
  if (units.length === 0) return null;
37053
37238
  const allFiles = Object.assign(
37054
37239
  {},
37055
37240
  ...units.map((unit) => unit.files)
37056
37241
  );
37057
- const targets = units.map((unit) => ({
37058
- name: unit.namespace,
37059
- path: `Sources/${unit.namespace}`
37242
+ const targets = [...new Set(units.map((unit) => unit.namespace))].map((namespace) => ({
37243
+ name: namespace,
37244
+ path: `Sources/${namespace}`
37060
37245
  }));
37061
37246
  const dependencies = swiftTargetDependencies(allFiles, targets);
37062
- const byNamespace = new Map(units.map((unit) => [unit.namespace, unit]));
37247
+ const byNamespace = /* @__PURE__ */ new Map();
37248
+ for (const unit of units) {
37249
+ const entries = byNamespace.get(unit.namespace) ?? [];
37250
+ entries.push(unit);
37251
+ byNamespace.set(unit.namespace, entries);
37252
+ }
37063
37253
  for (const unit of units) {
37064
37254
  const included = /* @__PURE__ */ new Set([unit.namespace]);
37065
37255
  const visit3 = (namespace) => {
@@ -37088,7 +37278,7 @@ let package = Package(name: "PeachExpo", targets: [${[...included].map((name2) =
37088
37278
  function expoEntry(units) {
37089
37279
  return `import SwiftUI
37090
37280
  import ExpoModulesCore
37091
- ${units.map((unit) => `import ${unit.namespace}`).join("\n")}
37281
+ ${[...new Set(units.map((unit) => unit.namespace))].map((namespace) => `import ${namespace}`).join("\n")}
37092
37282
 
37093
37283
  @main struct PeachExpoApp: RNXPackage {
37094
37284
  init() { MainActor.assumeIsolated { PeachExpoRuntime.register([${units.flatMap((unit) => unit.classes).join(", ")}]) } }
@@ -37102,6 +37292,118 @@ ${units.map((unit) => `import ${unit.namespace}`).join("\n")}
37102
37292
  }
37103
37293
  `;
37104
37294
  }
37295
+ async function compileExpoSwiftModules(root, base, publishArtifact) {
37296
+ const units = await collectExpoSwiftSources(root);
37297
+ if (!units) return null;
37298
+ const module2 = await resolveSwiftModule();
37299
+ if (!module2 && publishArtifact)
37300
+ throw new Error("No local Swift toolchain or distribution is available");
37301
+ const result = {
37302
+ namespaces: units.map((unit) => unit.moduleId),
37303
+ modules: [],
37304
+ failures: []
37305
+ };
37306
+ const key2 = (0, import_node_crypto9.createHash)("sha256").update(import_node_fs19.default.realpathSync(root)).digest("hex");
37307
+ const linked = [];
37308
+ for (const unit of units) {
37309
+ if (!module2) {
37310
+ result.failures.push({
37311
+ namespace: unit.moduleId,
37312
+ diagnostic: "No local Swift toolchain or distribution is available"
37313
+ });
37314
+ continue;
37315
+ }
37316
+ const packagePath = import_node_path20.default.join(import_node_os9.default.tmpdir(), "peach-expo-swift", key2, unit.moduleId);
37317
+ let stamp;
37318
+ try {
37319
+ syncSwiftTree(
37320
+ packagePath,
37321
+ new Map(
37322
+ Object.entries(unit.files).map(([name2, source]) => [
37323
+ import_node_path20.default.join(packagePath, name2),
37324
+ source
37325
+ ])
37326
+ )
37327
+ );
37328
+ stamp = sourceStamp(packagePath, module2.root);
37329
+ const failed = failedCompilations.get(packagePath);
37330
+ if (failed?.stamp === stamp) {
37331
+ result.failures.push({
37332
+ namespace: unit.moduleId,
37333
+ diagnostic: failed.diagnostic
37334
+ });
37335
+ continue;
37336
+ }
37337
+ failedCompilations.delete(packagePath);
37338
+ await artifactFor(projectFor(packagePath), EXPO_SWIFT_ENTRY, module2.root);
37339
+ linked.push(unit);
37340
+ } catch (error) {
37341
+ const diagnostic = error instanceof Error ? error.message : String(error);
37342
+ const appPaths = Object.values(unit.files).flatMap((source) => {
37343
+ const match = /^#sourceLocation\(file: (".*"), line: 1\)$/m.exec(source);
37344
+ if (!match) return [];
37345
+ const file = JSON.parse(match[1]);
37346
+ return typeof file === "string" ? [file] : [];
37347
+ });
37348
+ const sourceErrors = (diagnostic.match(/^.+:\d+(?::\d+)?: error:.*$/gm) ?? []).filter((line) => appPaths.some((file) => line.startsWith(`${file}:`)));
37349
+ if (publishArtifact && sourceErrors.length === 0 && !(error instanceof SwiftMissingModulesError))
37350
+ throw error;
37351
+ if (sourceErrors.length && module2 && stamp && sourceStamp(packagePath, module2.root) === stamp) {
37352
+ failedCompilations.set(packagePath, {
37353
+ stamp,
37354
+ diagnostic: sourceErrors.join("\n")
37355
+ });
37356
+ }
37357
+ result.failures.push({
37358
+ namespace: unit.moduleId,
37359
+ diagnostic: sourceErrors.length ? sourceErrors.join("\n") : diagnostic
37360
+ });
37361
+ }
37362
+ }
37363
+ if (module2 && linked.length) {
37364
+ const files2 = Object.assign(
37365
+ {},
37366
+ ...linked.map((unit) => unit.files)
37367
+ );
37368
+ files2[EXPO_SWIFT_ENTRY] = expoEntry(linked);
37369
+ const targets = [
37370
+ ...new Set(
37371
+ Object.keys(files2).flatMap((name2) => {
37372
+ const match = /^Sources\/([^/]+)\//.exec(name2);
37373
+ return match && match[1] !== "PeachExpoApp" ? [match[1]] : [];
37374
+ })
37375
+ )
37376
+ ];
37377
+ files2["Package.swift"] = `// swift-tools-version: 6.0
37378
+ import PackageDescription
37379
+ let package = Package(name: "PeachExpo", targets: [${targets.map((name2) => `.target(name: ${JSON.stringify(name2)}, path: ${JSON.stringify(`Sources/${name2}`)})`).join(", ")}, .executableTarget(name: "PeachExpoApp", path: "Sources/PeachExpoApp")])
37380
+ `;
37381
+ const packagePath = import_node_path20.default.join(import_node_os9.default.tmpdir(), "peach-expo-swift", key2, "linked-app");
37382
+ syncSwiftTree(
37383
+ packagePath,
37384
+ new Map(
37385
+ Object.entries(files2).map(([name2, source]) => [
37386
+ import_node_path20.default.join(packagePath, name2),
37387
+ source
37388
+ ])
37389
+ )
37390
+ );
37391
+ const artifact = await artifactFor(
37392
+ projectFor(packagePath),
37393
+ EXPO_SWIFT_ENTRY,
37394
+ module2.root
37395
+ );
37396
+ await publishArtifact?.(artifact);
37397
+ result.modules.push({
37398
+ namespaces: linked.map((unit) => unit.moduleId),
37399
+ url: `${base}/__peach/swift/${artifact.hash}.wasm`,
37400
+ hash: artifact.hash,
37401
+ icuUrl: icuUrl(base, artifact),
37402
+ rootId: `${key2}/Expo`
37403
+ });
37404
+ }
37405
+ return result;
37406
+ }
37105
37407
  async function handleExpoSwiftRequest(req, res) {
37106
37408
  const url = new URL(req.url ?? "/", "http://localhost");
37107
37409
  if (!url.pathname.startsWith("/__peach/swift") && url.pathname !== EXPO_SWIFT_ROUTE)
@@ -37133,118 +37435,9 @@ async function handleExpoSwiftRequest(req, res) {
37133
37435
  let pending = compiling.get(root);
37134
37436
  if (!pending) {
37135
37437
  pending = (async () => {
37136
- const units = await collectExpoSwiftSources(root);
37137
- if (!units) return null;
37138
- const module2 = await resolveSwiftModule();
37139
- const result = {
37140
- namespaces: units.map((unit) => unit.namespace),
37141
- modules: [],
37142
- failures: []
37143
- };
37144
- const key2 = (0, import_node_crypto9.createHash)("sha256").update(import_node_fs19.default.realpathSync(root)).digest("hex");
37145
37438
  const host2 = req.headers.host;
37146
37439
  if (!host2) throw new Error("Expo Swift request has no host");
37147
- const base = `http://${host2}`;
37148
- const linked = [];
37149
- for (const unit of units) {
37150
- if (!module2) {
37151
- result.failures.push({
37152
- namespace: unit.namespace,
37153
- diagnostic: "No local Swift toolchain or distribution is available"
37154
- });
37155
- continue;
37156
- }
37157
- try {
37158
- const packagePath = import_node_path20.default.join(
37159
- import_node_os9.default.tmpdir(),
37160
- "peach-expo-swift",
37161
- key2,
37162
- unit.namespace
37163
- );
37164
- syncSwiftTree(
37165
- packagePath,
37166
- new Map(
37167
- Object.entries(unit.files).map(([name2, source]) => [
37168
- import_node_path20.default.join(packagePath, name2),
37169
- source
37170
- ])
37171
- )
37172
- );
37173
- const stamp = sourceStamp(packagePath, module2.root);
37174
- const failed = failedCompilations.get(packagePath);
37175
- if (failed?.stamp === stamp) {
37176
- result.failures.push({
37177
- namespace: unit.namespace,
37178
- diagnostic: failed.diagnostic
37179
- });
37180
- continue;
37181
- }
37182
- failedCompilations.delete(packagePath);
37183
- await artifactFor(
37184
- projectFor(packagePath),
37185
- EXPO_SWIFT_ENTRY,
37186
- module2.root
37187
- ).catch((error) => {
37188
- const diagnostic = error instanceof Error ? error.message : String(error);
37189
- if (/^.+:\d+(?::\d+)?: error:/m.test(diagnostic) && sourceStamp(packagePath, module2.root) === stamp)
37190
- failedCompilations.set(packagePath, { stamp, diagnostic });
37191
- throw error;
37192
- });
37193
- linked.push(unit);
37194
- } catch (error) {
37195
- result.failures.push({
37196
- namespace: unit.namespace,
37197
- diagnostic: error instanceof Error ? error.message : String(error)
37198
- });
37199
- }
37200
- }
37201
- if (module2 && linked.length) {
37202
- const files2 = Object.assign(
37203
- {},
37204
- ...linked.map((unit) => unit.files)
37205
- );
37206
- files2[EXPO_SWIFT_ENTRY] = expoEntry(linked);
37207
- const targets = [
37208
- ...new Set(
37209
- Object.keys(files2).flatMap((name2) => {
37210
- const match = /^Sources\/([^/]+)\//.exec(name2);
37211
- return match && match[1] !== "PeachExpoApp" ? [match[1]] : [];
37212
- })
37213
- )
37214
- ];
37215
- files2["Package.swift"] = `// swift-tools-version: 6.0
37216
- import PackageDescription
37217
- let package = Package(name: "PeachExpo", targets: [${targets.map((name2) => `.target(name: ${JSON.stringify(name2)}, path: ${JSON.stringify(`Sources/${name2}`)})`).join(", ")}, .executableTarget(name: "PeachExpoApp", path: "Sources/PeachExpoApp")])
37218
- `;
37219
- const packagePath = import_node_path20.default.join(
37220
- import_node_os9.default.tmpdir(),
37221
- "peach-expo-swift",
37222
- key2,
37223
- "linked-app"
37224
- );
37225
- syncSwiftTree(
37226
- packagePath,
37227
- new Map(
37228
- Object.entries(files2).map(([name2, source]) => [
37229
- import_node_path20.default.join(packagePath, name2),
37230
- source
37231
- ])
37232
- )
37233
- );
37234
- const artifact = await artifactFor(
37235
- projectFor(packagePath),
37236
- EXPO_SWIFT_ENTRY,
37237
- module2.root
37238
- );
37239
- result.modules.push({
37240
- namespaces: linked.map((unit) => unit.namespace),
37241
- url: `${base}/__peach/swift/${artifact.hash}.wasm`,
37242
- hash: artifact.hash,
37243
- icuUrl: icuUrl(base, artifact),
37244
- rootId: `${key2}/Expo`
37245
- });
37246
- }
37247
- return result;
37440
+ return compileExpoSwiftModules(root, `http://${host2}`);
37248
37441
  })();
37249
37442
  compiling.set(root, pending);
37250
37443
  }
@@ -42929,7 +43122,7 @@ async function loadMetroFingerprintRegistry(options = {}) {
42929
43122
  }
42930
43123
  try {
42931
43124
  const payloadUrl = new URL(pointer.payloadUrl, baseUrl).toString();
42932
- const response = await request(payloadUrl, { cache: "force-cache" });
43125
+ const response = await request(payloadUrl);
42933
43126
  if (!response.ok) {
42934
43127
  throw new Error(`RNX Metro fingerprint registry answered ${response.status}`);
42935
43128
  }
@@ -48447,8 +48640,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
48447
48640
  "app.config.mjs"
48448
48641
  ].some((name2) => import_node_fs32.default.existsSync(import_node_path33.default.join(projectRoot, name2)));
48449
48642
  if (staticExpo || dynamicExpo) {
48450
- const require5 = (0, import_node_module2.createRequire)(import_node_path33.default.join(projectRoot, "package.json"));
48451
- const configModule = require5("@expo/config");
48643
+ const require4 = (0, import_node_module2.createRequire)(import_node_path33.default.join(projectRoot, "package.json"));
48644
+ const configModule = require4("@expo/config");
48452
48645
  if (!isRecord(configModule) || typeof configModule.getConfig !== "function")
48453
48646
  throw new Error("Expo native configuration is unavailable.");
48454
48647
  const resolved = Reflect.apply(configModule.getConfig, configModule, [
@@ -48836,10 +49029,8 @@ async function loadRNXAppConfig(project) {
48836
49029
  // metro serializes repeatedly in one process; edits must reload the config.
48837
49030
  moduleCache: false,
48838
49031
  tryNative: false,
48839
- alias: {
48840
- [`${rnxPublicBrand.packageName}/config`]: require2.resolve(
48841
- `${rnxPublicBrand.packageName}/config`
48842
- )
49032
+ virtualModules: {
49033
+ [`${rnxPublicBrand.packageName}/config`]: config_exports
48843
49034
  }
48844
49035
  });
48845
49036
  const loaded2 = await jiti.import(project.configPath, { default: true });
@@ -48856,17 +49047,16 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
48856
49047
  const project = resolveAppProject(startDir);
48857
49048
  return { project, config: await loadRNXAppConfig(project) };
48858
49049
  }
48859
- var import_node_module3, import_node_path36, import_jiti, require2;
49050
+ var import_node_path36, import_jiti;
48860
49051
  var init_app_config = __esm({
48861
49052
  "cli/app-config.ts"() {
48862
49053
  "use strict";
48863
- import_node_module3 = require("node:module");
48864
49054
  import_node_path36 = __toESM(require("node:path"), 1);
48865
49055
  import_jiti = require("jiti");
48866
49056
  init_config();
49057
+ init_config();
48867
49058
  init_public_brand();
48868
49059
  init_app_project();
48869
- require2 = (0, import_node_module3.createRequire)(__sootsim_import_meta_url);
48870
49060
  }
48871
49061
  });
48872
49062
 
@@ -48881,10 +49071,10 @@ function discoverNativeLinkedAppFonts(opts) {
48881
49071
  let getConfig = null;
48882
49072
  if (project) {
48883
49073
  try {
48884
- const modulePath = require3.resolve("@expo/config", {
49074
+ const modulePath = require2.resolve("@expo/config", {
48885
49075
  paths: [selectedAppDir]
48886
49076
  });
48887
- const mod = require3(modulePath);
49077
+ const mod = require2(modulePath);
48888
49078
  if (typeof mod.getConfig === "function") {
48889
49079
  getConfig = mod.getConfig;
48890
49080
  }
@@ -48966,7 +49156,7 @@ function discoverNativeLinkedAppFonts(opts) {
48966
49156
  if (bundleDir && selectedAppDir.endsWith(import_node_path37.default.sep + appRelativeDir)) {
48967
49157
  metroRootCandidates.push(selectedAppDir.slice(0, -appRelativeDir.length - 1));
48968
49158
  }
48969
- const vectorIconRequire = (0, import_node_module4.createRequire)(import_node_path37.default.join(selectedAppDir, "package.json"));
49159
+ const vectorIconRequire = (0, import_node_module3.createRequire)(import_node_path37.default.join(selectedAppDir, "package.json"));
48970
49160
  for (const dependencyName of vectorIconDependencies) {
48971
49161
  try {
48972
49162
  const entryPath = vectorIconRequire.resolve(dependencyName);
@@ -48992,7 +49182,7 @@ function discoverNativeLinkedAppFonts(opts) {
48992
49182
  try {
48993
49183
  const configPath = import_node_path37.default.join(selectedAppDir, "react-native.config.js");
48994
49184
  if (import_node_fs35.default.statSync(configPath).isFile()) {
48995
- const appConfigRequire = (0, import_node_module4.createRequire)(import_node_path37.default.join(selectedAppDir, "package.json"));
49185
+ const appConfigRequire = (0, import_node_module3.createRequire)(import_node_path37.default.join(selectedAppDir, "package.json"));
48996
49186
  const rnConfig = appConfigRequire(configPath);
48997
49187
  const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
48998
49188
  if (Array.isArray(assets2)) {
@@ -49086,19 +49276,19 @@ async function resolveMetroProjectRoot(bundleUrl, opts) {
49086
49276
  function encodeAppFontsWire(specs) {
49087
49277
  return specs.map((spec) => `${encodeURIComponent(spec.url)}::${encodeURIComponent(spec.family)}`).join(",");
49088
49278
  }
49089
- var import_node_fs35, import_node_module4, import_node_path37, import_config_plugin_fonts, require3;
49279
+ var import_node_fs35, import_node_module3, import_node_path37, import_config_plugin_fonts, require2;
49090
49280
  var init_app_fonts = __esm({
49091
49281
  "cli/app-fonts.ts"() {
49092
49282
  "use strict";
49093
49283
  import_node_fs35 = __toESM(require("node:fs"), 1);
49094
- import_node_module4 = require("node:module");
49284
+ import_node_module3 = require("node:module");
49095
49285
  import_node_path37 = __toESM(require("node:path"), 1);
49096
49286
  import_config_plugin_fonts = require("peach-engine/engine/config-plugin-fonts");
49097
49287
  init_dev_server_scanner();
49098
49288
  init_backend_origin();
49099
49289
  init_plist();
49100
49290
  init_app_project();
49101
- require3 = (0, import_node_module4.createRequire)(__sootsim_import_meta_url);
49291
+ require2 = (0, import_node_module3.createRequire)(__sootsim_import_meta_url);
49102
49292
  }
49103
49293
  });
49104
49294
 
@@ -49136,10 +49326,10 @@ function discoverConfigPluginAppSplash(opts) {
49136
49326
  const platform = (opts.platform || process.env.CONTRAST_PLATFORM || "ios").toLowerCase();
49137
49327
  let getConfig = null;
49138
49328
  try {
49139
- const modulePath = require4.resolve("@expo/config", {
49329
+ const modulePath = require3.resolve("@expo/config", {
49140
49330
  paths: [selectedAppDir]
49141
49331
  });
49142
- const mod = require4(modulePath);
49332
+ const mod = require3(modulePath);
49143
49333
  if (typeof mod.getConfig === "function") {
49144
49334
  getConfig = mod.getConfig;
49145
49335
  }
@@ -49167,15 +49357,15 @@ function splashImageUrls(spec) {
49167
49357
  if (spec.dark?.backgroundImageUrl) urls.add(spec.dark.backgroundImageUrl);
49168
49358
  return [...urls];
49169
49359
  }
49170
- var import_node_module5, import_config_plugin_splash, require4;
49360
+ var import_node_module4, import_config_plugin_splash, require3;
49171
49361
  var init_app_splash = __esm({
49172
49362
  "cli/app-splash.ts"() {
49173
49363
  "use strict";
49174
- import_node_module5 = require("node:module");
49364
+ import_node_module4 = require("node:module");
49175
49365
  import_config_plugin_splash = require("peach-engine/engine/config-plugin-splash");
49176
49366
  init_backend_origin();
49177
49367
  init_app_project();
49178
- require4 = (0, import_node_module5.createRequire)(__sootsim_import_meta_url);
49368
+ require3 = (0, import_node_module4.createRequire)(__sootsim_import_meta_url);
49179
49369
  }
49180
49370
  });
49181
49371
 
@@ -50084,7 +50274,7 @@ function getSootsimRoot() {
50084
50274
  if (_sootsimRoot !== void 0) return _sootsimRoot;
50085
50275
  try {
50086
50276
  _sootsimRoot = (0, import_path5.dirname)(
50087
- (0, import_url2.fileURLToPath)(import_meta4.resolve("peach-engine/package.json"))
50277
+ (0, import_url2.fileURLToPath)(import_meta2.resolve("peach-engine/package.json"))
50088
50278
  );
50089
50279
  } catch {
50090
50280
  _sootsimRoot = null;
@@ -50335,7 +50525,7 @@ function buildMacLaunchUrl(url, opts, nativeApp = false) {
50335
50525
  }
50336
50526
  return deepLink.toString();
50337
50527
  }
50338
- var import_child_process5, import_fs6, import_path5, import_url2, import_meta4, _sootsimRoot, PEACH_BUNDLE_ID;
50528
+ var import_child_process5, import_fs6, import_path5, import_url2, import_meta2, _sootsimRoot, PEACH_BUNDLE_ID;
50339
50529
  var init_desktop_companion = __esm({
50340
50530
  "cli/desktop-companion.ts"() {
50341
50531
  "use strict";
@@ -50344,7 +50534,7 @@ var init_desktop_companion = __esm({
50344
50534
  import_path5 = require("path");
50345
50535
  import_url2 = require("url");
50346
50536
  init_desktop_host_delivery();
50347
- import_meta4 = {};
50537
+ import_meta2 = {};
50348
50538
  PEACH_BUNDLE_ID = "dev.peachsim.simulator";
50349
50539
  }
50350
50540
  });
@@ -51683,14 +51873,14 @@ function resolvePlaywright() {
51683
51873
  roots.push(`${playwrightCoreDir(PINNED_PLAYWRIGHT_CORE.version)}/`);
51684
51874
  for (const root of roots) {
51685
51875
  try {
51686
- const requireFromRoot = (0, import_node_module6.createRequire)(root);
51876
+ const requireFromRoot = (0, import_node_module5.createRequire)(root);
51687
51877
  for (const spec of ["playwright", "playwright-chromium", "playwright-core"]) {
51688
51878
  try {
51689
51879
  const modulePath = requireFromRoot.resolve(spec);
51690
51880
  const packageJsonPath = requireFromRoot.resolve(`${spec}/package.json`);
51691
51881
  const parsed = JSON.parse((0, import_node_fs38.readFileSync)(packageJsonPath, "utf8"));
51692
51882
  if (!isRecord(parsed) || typeof parsed.version !== "string") continue;
51693
- const corePackagePath = (0, import_node_module6.createRequire)(modulePath).resolve(
51883
+ const corePackagePath = (0, import_node_module5.createRequire)(modulePath).resolve(
51694
51884
  "playwright-core/package.json"
51695
51885
  );
51696
51886
  const cliPath = (0, import_node_path40.join)((0, import_node_path40.dirname)(corePackagePath), "cli.js");
@@ -51833,13 +52023,13 @@ ${detail}` : ""}`
51833
52023
  libraryPath: libraries.libraryPath
51834
52024
  };
51835
52025
  }
51836
- var import_node_child_process15, import_node_fs38, import_node_module6, import_node_path40;
52026
+ var import_node_child_process15, import_node_fs38, import_node_module5, import_node_path40;
51837
52027
  var init_playwright_provisioning = __esm({
51838
52028
  "cli/drivers/playwright-provisioning.ts"() {
51839
52029
  "use strict";
51840
52030
  import_node_child_process15 = require("node:child_process");
51841
52031
  import_node_fs38 = require("node:fs");
51842
- import_node_module6 = require("node:module");
52032
+ import_node_module5 = require("node:module");
51843
52033
  import_node_path40 = require("node:path");
51844
52034
  init_src();
51845
52035
  init_home_paths();
@@ -52349,7 +52539,7 @@ function getSkillsDir() {
52349
52539
  }
52350
52540
  try {
52351
52541
  const pkgPath = (0, import_url3.fileURLToPath)(
52352
- import_meta5.resolve(`${rnxPublicBrand.packageName}/package.json`)
52542
+ import_meta3.resolve(`${rnxPublicBrand.packageName}/package.json`)
52353
52543
  );
52354
52544
  return primaryCheckoutPath(path33.join(path33.dirname(pkgPath), "skills"));
52355
52545
  } catch {
@@ -52455,7 +52645,7 @@ function listSkills() {
52455
52645
  }
52456
52646
  return skills.sort((a, b) => a.name.localeCompare(b.name));
52457
52647
  }
52458
- var import_child_process7, fs29, os9, path33, import_url3, import_meta5, skillsDirPath;
52648
+ var import_child_process7, fs29, os9, path33, import_url3, import_meta3, skillsDirPath;
52459
52649
  var init_skills = __esm({
52460
52650
  "cli/commands/skills.ts"() {
52461
52651
  "use strict";
@@ -52468,7 +52658,7 @@ var init_skills = __esm({
52468
52658
  init_home_paths();
52469
52659
  init_public_brand();
52470
52660
  init_run_rnx();
52471
- import_meta5 = {};
52661
+ import_meta3 = {};
52472
52662
  }
52473
52663
  });
52474
52664