peachsim 0.1.800 → 0.1.801

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 (77) hide show
  1. package/cli/drivers/playwright-sim-host.ts +2 -0
  2. package/cli/outbound-endpoints.ts +0 -4
  3. package/dist-lib/agent-daemon-client.cjs +1 -1
  4. package/dist-lib/agent-events.cjs +1 -1
  5. package/dist-lib/agent-identity.cjs +1 -1
  6. package/dist-lib/agent-sessions.cjs +1 -1
  7. package/dist-lib/attached-projects.cjs +1 -1
  8. package/dist-lib/auth/shared-session.cjs +1 -1
  9. package/dist-lib/backend-origin.cjs +1 -1
  10. package/dist-lib/beta.cjs +1 -1
  11. package/dist-lib/beta.mjs +1 -1
  12. package/dist-lib/bridge-constants.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.mjs +1 -1
  15. package/dist-lib/bridge-contract.cjs +1 -1
  16. package/dist-lib/bridge-contract.mjs +1 -1
  17. package/dist-lib/bundle-channel.cjs +125 -10
  18. package/dist-lib/capture-contract.cjs +1 -1
  19. package/dist-lib/capture-contract.mjs +1 -1
  20. package/dist-lib/cli-constants.cjs +1 -1
  21. package/dist-lib/cloud-contract.cjs +1 -1
  22. package/dist-lib/cloud-contract.mjs +1 -1
  23. package/dist-lib/cloud-test-args.cjs +1 -1
  24. package/dist-lib/cloud-test-args.mjs +1 -1
  25. package/dist-lib/cloud.cjs +1 -1
  26. package/dist-lib/cloud.mjs +1 -1
  27. package/dist-lib/config.cjs +1 -1
  28. package/dist-lib/detox/index.cjs +46 -7
  29. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  30. package/dist-lib/expo-swift-bundle.cjs +125 -10
  31. package/dist-lib/expo-swift-metadata.cjs +1 -1
  32. package/dist-lib/expo-swift-metadata.mjs +1 -1
  33. package/dist-lib/home-paths.cjs +1 -1
  34. package/dist-lib/host/bridge-host.cjs +125 -10
  35. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  37. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  38. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  39. package/dist-lib/host/websocket-proxy.cjs +1 -1
  40. package/dist-lib/index.cjs +1 -1
  41. package/dist-lib/jump-to-source-babel.cjs +1 -1
  42. package/dist-lib/jump-to-source-native.cjs +1 -1
  43. package/dist-lib/kotlin-host.cjs +1 -1
  44. package/dist-lib/menu.cjs +1 -1
  45. package/dist-lib/menu.mjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  47. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  48. package/dist-lib/metro-production-bundle.cjs +1 -1
  49. package/dist-lib/metro-production-bundle.mjs +1 -1
  50. package/dist-lib/metro.cjs +1 -1
  51. package/dist-lib/native-app-identity.cjs +1 -1
  52. package/dist-lib/native-app-identity.mjs +1 -1
  53. package/dist-lib/native-firebase-metadata.cjs +1 -1
  54. package/dist-lib/native-firebase-metadata.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/react-native-host-modules.cjs +1 -1
  60. package/dist-lib/react-native-host-modules.mjs +1 -1
  61. package/dist-lib/render-mode.cjs +1 -1
  62. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  63. package/dist-lib/sdk.cjs +1 -1
  64. package/dist-lib/sdk.mjs +1 -1
  65. package/dist-lib/skills.cjs +125 -10
  66. package/dist-lib/swift-compile.cjs +134 -11
  67. package/dist-lib/swift-compile.mjs +133 -11
  68. package/dist-lib/swift-package.cjs +1 -1
  69. package/dist-lib/swift-package.mjs +1 -1
  70. package/dist-lib/swift-submit.cjs +1 -1
  71. package/dist-lib/swift-submit.mjs +1 -1
  72. package/dist-lib/swift-toolchain.cjs +1 -1
  73. package/dist-lib/swift.cjs +1 -1
  74. package/dist-lib/vite-swift.cjs +125 -10
  75. package/dist-lib/vite.cjs +1 -1
  76. package/package.json +1 -1
  77. package/src/swift-compile.ts +151 -11
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -29437,7 +29437,7 @@ function swiftTargetDependencies(files2, targets) {
29437
29437
  }
29438
29438
  function swiftArtifactHash(input, release, moduleRoot) {
29439
29439
  const hash = (0, import_node_crypto3.createHash)("sha256");
29440
- hash.update(`swift-compile/v18
29440
+ hash.update(`swift-compile/v19
29441
29441
  ${release}
29442
29442
  `);
29443
29443
  if (input.oneModule) hash.update("one-module\n");
@@ -30015,6 +30015,118 @@ function lowerNotificationDelegate(source) {
30015
30015
  result = result.slice(0, at) + text3 + result.slice(at + count);
30016
30016
  return result;
30017
30017
  }
30018
+ function tableProtocolConformances(sources) {
30019
+ const parents = /* @__PURE__ */ new Map();
30020
+ for (const source of sources) {
30021
+ const code = swiftCodeMask(source);
30022
+ for (const owner of code.matchAll(
30023
+ /\b(?:class|extension)\s+([A-Za-z_]\w*)\s*:\s*([^{}]+)\{/g
30024
+ )) {
30025
+ const inherited = parents.get(owner[1]) ?? /* @__PURE__ */ new Set();
30026
+ for (const type of owner[2].matchAll(/\b[A-Za-z_]\w*\b/g)) inherited.add(type[0]);
30027
+ parents.set(owner[1], inherited);
30028
+ }
30029
+ }
30030
+ const result = /* @__PURE__ */ new Map();
30031
+ const protocols = ["UITableViewDataSource", "UITableViewDelegate"];
30032
+ for (const type of parents.keys()) {
30033
+ const pending = [type];
30034
+ const seen = /* @__PURE__ */ new Set();
30035
+ const conformances = /* @__PURE__ */ new Set();
30036
+ while (pending.length) {
30037
+ const next = pending.pop();
30038
+ if (seen.has(next)) continue;
30039
+ seen.add(next);
30040
+ if (protocols.includes(next)) conformances.add(next);
30041
+ for (const parent of parents.get(next) ?? []) pending.push(parent);
30042
+ }
30043
+ if (conformances.size) result.set(type, conformances);
30044
+ }
30045
+ return result;
30046
+ }
30047
+ function lowerTableProtocolMethods(source, conformances) {
30048
+ const code = swiftCodeMask(source);
30049
+ const dataSource = {
30050
+ numberOfRowsInSection: "tableView:numberOfRowsInSection:",
30051
+ cellForRowAt: "tableView:cellForRowAtIndexPath:",
30052
+ titleForHeaderInSection: "tableView:titleForHeaderInSection:",
30053
+ titleForFooterInSection: "tableView:titleForFooterInSection:"
30054
+ };
30055
+ const delegate = {
30056
+ willDisplay: "tableView:willDisplayCell:forRowAtIndexPath:",
30057
+ didEndDisplaying: "tableView:didEndDisplayingCell:forRowAtIndexPath:",
30058
+ heightForRowAt: "tableView:heightForRowAtIndexPath:",
30059
+ estimatedHeightForRowAt: "tableView:estimatedHeightForRowAtIndexPath:",
30060
+ heightForHeaderInSection: "tableView:heightForHeaderInSection:",
30061
+ heightForFooterInSection: "tableView:heightForFooterInSection:",
30062
+ estimatedHeightForHeaderInSection: "tableView:estimatedHeightForHeaderInSection:",
30063
+ estimatedHeightForFooterInSection: "tableView:estimatedHeightForFooterInSection:",
30064
+ viewForHeaderInSection: "tableView:viewForHeaderInSection:",
30065
+ viewForFooterInSection: "tableView:viewForFooterInSection:",
30066
+ willDisplayHeaderView: "tableView:willDisplayHeaderView:forSection:",
30067
+ willDisplayFooterView: "tableView:willDisplayFooterView:forSection:",
30068
+ didEndDisplayingHeaderView: "tableView:didEndDisplayingHeaderView:forSection:",
30069
+ didEndDisplayingFooterView: "tableView:didEndDisplayingFooterView:forSection:",
30070
+ shouldHighlightRowAt: "tableView:shouldHighlightRowAtIndexPath:",
30071
+ didHighlightRowAt: "tableView:didHighlightRowAtIndexPath:",
30072
+ didUnhighlightRowAt: "tableView:didUnhighlightRowAtIndexPath:",
30073
+ willSelectRowAt: "tableView:willSelectRowAtIndexPath:",
30074
+ willDeselectRowAt: "tableView:willDeselectRowAtIndexPath:",
30075
+ didSelectRowAt: "tableView:didSelectRowAtIndexPath:",
30076
+ didDeselectRowAt: "tableView:didDeselectRowAtIndexPath:",
30077
+ accessoryButtonTappedForRowWith: "tableView:accessoryButtonTappedForRowWithIndexPath:"
30078
+ };
30079
+ const braces = [...code.matchAll(/[{}]/g)].map((match) => match.index);
30080
+ const edits = [];
30081
+ for (const owner of code.matchAll(/\b(?:class|extension)\s+([A-Za-z_]\w*)[^{}]*\{/g)) {
30082
+ const conforms = conformances.get(owner[1]);
30083
+ if (!conforms) continue;
30084
+ const selectors = {
30085
+ ...conforms.has("UITableViewDataSource") ? dataSource : {},
30086
+ ...conforms.has("UITableViewDelegate") ? delegate : {}
30087
+ };
30088
+ const open = owner.index + owner[0].length - 1;
30089
+ const close = closingBrace(code, braces, open);
30090
+ let depth = 1;
30091
+ let previous = open + 1;
30092
+ for (const token of swiftCodeScan(code.slice(open + 1, close - 1)).tokens) {
30093
+ const at = open + 1 + token;
30094
+ if (code[at] === "{") depth++;
30095
+ else if (code[at] === "}") {
30096
+ depth--;
30097
+ if (depth === 1) previous = at + 1;
30098
+ } else if (depth === 1 && /^func\b/.test(code.slice(at))) {
30099
+ const signature2 = code.slice(at, code.indexOf("{", at));
30100
+ const prefix = code.slice(previous, at);
30101
+ const attributes = /(?:@\w+(?:\([^{}]*\))?\s*|(?:public|open|private|fileprivate|internal|final|override|static|class|nonisolated|dynamic)\s+)*$/.exec(
30102
+ prefix
30103
+ )?.[0] ?? "";
30104
+ if (/\b(?:override|static|class)\b|@(?:objc|ObjC|IBAction)\b/.test(attributes))
30105
+ continue;
30106
+ let selector;
30107
+ if (conforms.has("UITableViewDataSource") && /^func\s+numberOfSections\s*\(\s*in\s+\w+\s*:\s*(?:UIKit\.)?UITableView\s*\)/.test(
30108
+ signature2
30109
+ ))
30110
+ selector = "numberOfSectionsInTableView:";
30111
+ else {
30112
+ const match = /^func\s+tableView\s*\(\s*_\s+\w+\s*:\s*(?:UIKit\.)?UITableView\s*,\s*(\w+)\b/.exec(
30113
+ signature2
30114
+ );
30115
+ if (match) selector = selectors[match[1]];
30116
+ }
30117
+ if (selector)
30118
+ edits.push([
30119
+ at,
30120
+ `${/\bnonisolated\b/.test(attributes) ? "" : "@MainActor "}@ObjC(${JSON.stringify(selector)}) `
30121
+ ]);
30122
+ }
30123
+ }
30124
+ }
30125
+ let result = source;
30126
+ for (const [at, text3] of edits.sort((a, b) => b[0] - a[0]))
30127
+ result = result.slice(0, at) + text3 + result.slice(at);
30128
+ return result;
30129
+ }
30018
30130
  function swiftCodeMask(source) {
30019
30131
  const chars = source.split("");
30020
30132
  const blank = (from, to) => {
@@ -30118,9 +30230,9 @@ function swiftCodeMask(source) {
30118
30230
  scanCode(0, false);
30119
30231
  return chars.join("");
30120
30232
  }
30121
- function swiftSourceAsIOS(original, extraObjCExtensions) {
30233
+ function swiftSourceAsIOS(original, extraObjCExtensions, tableConformances = tableProtocolConformances([original])) {
30122
30234
  const source = liftExtensionOverrides(
30123
- lowerNotificationDelegate(original),
30235
+ lowerTableProtocolMethods(lowerNotificationDelegate(original), tableConformances),
30124
30236
  extraObjCExtensions
30125
30237
  );
30126
30238
  const { lineStarts, tokens } = swiftCodeScan(source);
@@ -30394,15 +30506,15 @@ function writeSwiftProject(layout, input, moduleRoot) {
30394
30506
  // sootsim-swift files ${modulePlan.digest("hex").slice(0, 16)}
30395
30507
  // resource accessors ${resourcePlan}
30396
30508
  `;
30397
- const objcExtensions = objcExtensionMemberIndex(
30398
- Object.entries(input.files).filter(([file]) => file.endsWith(".swift")).map(([, contents]) => contents)
30399
- );
30509
+ const swiftSources = Object.entries(input.files).filter(([file]) => file.endsWith(".swift")).map(([, contents]) => contents);
30510
+ const objcExtensions = objcExtensionMemberIndex(swiftSources);
30511
+ const tableConformances = tableProtocolConformances(swiftSources);
30400
30512
  if (targets.length === 0) {
30401
30513
  for (const [file, contents] of Object.entries(input.files)) {
30402
30514
  if (file === "Package.swift") continue;
30403
30515
  files2.set(
30404
30516
  import_node_path7.default.join(layout.sources, file),
30405
- compiledSource(file, contents, objcExtensions)
30517
+ compiledSource(file, contents, objcExtensions, tableConformances)
30406
30518
  );
30407
30519
  }
30408
30520
  let manifest = (0, import_node_fs7.readFileSync)(
@@ -30449,7 +30561,10 @@ function writeSwiftProject(layout, input, moduleRoot) {
30449
30561
  const base = layout.multi ? layout.root : layout.sources;
30450
30562
  for (const [file, contents] of Object.entries(input.files)) {
30451
30563
  if (file === "Package.swift") continue;
30452
- files2.set(import_node_path7.default.join(base, file), compiledSource(file, contents, objcExtensions));
30564
+ files2.set(
30565
+ import_node_path7.default.join(base, file),
30566
+ compiledSource(file, contents, objcExtensions, tableConformances)
30567
+ );
30453
30568
  }
30454
30569
  files2.set(
30455
30570
  import_node_path7.default.join(layout.root, "Package.swift"),
@@ -30749,7 +30864,7 @@ var init_swift_compile = __esm({
30749
30864
  MODIFIERS = /(?:^|\s)(public|open|internal|fileprivate|private|final|nonisolated|@MainActor)(?=\s)/g;
30750
30865
  OVERRIDE_FUNC = /^override((?:\s+(?:public|open|internal|fileprivate|private|final|nonisolated|dynamic|@\w+))*)\s+func\s+([A-Za-z_]\w*)\s*(<[^>{}]*>)?\s*\(/;
30751
30866
  OVERRIDE_VAR = /^override((?:\s+(?:public|open|internal|fileprivate|private|final|nonisolated|dynamic|@\w+))*)\s+var\s+([A-Za-z_]\w*)\s*:\s*([^{=]+?)\s*\{/;
30752
- compiledSource = (file, contents, extraObjCExtensions) => file.endsWith(".swift") ? swiftSourceAsIOS(contents, extraObjCExtensions) : contents;
30867
+ compiledSource = (file, contents, extraObjCExtensions, tableConformances) => file.endsWith(".swift") ? swiftSourceAsIOS(contents, extraObjCExtensions, tableConformances) : contents;
30753
30868
  ROOT_LOCKS = Symbol.for("peachsim.swiftCompile.rootLocks");
30754
30869
  host = globalThis;
30755
30870
  rootLocks = host[ROOT_LOCKS] ??= /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -61,6 +61,7 @@ __export(swift_compile_exports, {
61
61
  swiftSourceClosure: () => swiftSourceClosure,
62
62
  swiftTargetDependencies: () => swiftTargetDependencies,
63
63
  syncSwiftTree: () => syncSwiftTree,
64
+ tableProtocolConformances: () => tableProtocolConformances,
64
65
  withNativeSourceGlue: () => withNativeSourceGlue,
65
66
  writeSwiftProject: () => writeSwiftProject
66
67
  });
@@ -649,7 +650,7 @@ var ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"'
649
650
  var MULTI_MANIFEST_VERSION = 12;
650
651
  function swiftArtifactHash(input, release, moduleRoot) {
651
652
  const hash = (0, import_node_crypto2.createHash)("sha256");
652
- hash.update(`swift-compile/v18
653
+ hash.update(`swift-compile/v19
653
654
  ${release}
654
655
  `);
655
656
  if (input.oneModule) hash.update("one-module\n");
@@ -1247,6 +1248,118 @@ function lowerNotificationDelegate(source) {
1247
1248
  result = result.slice(0, at) + text + result.slice(at + count);
1248
1249
  return result;
1249
1250
  }
1251
+ function tableProtocolConformances(sources) {
1252
+ const parents = /* @__PURE__ */ new Map();
1253
+ for (const source of sources) {
1254
+ const code = swiftCodeMask(source);
1255
+ for (const owner of code.matchAll(
1256
+ /\b(?:class|extension)\s+([A-Za-z_]\w*)\s*:\s*([^{}]+)\{/g
1257
+ )) {
1258
+ const inherited = parents.get(owner[1]) ?? /* @__PURE__ */ new Set();
1259
+ for (const type of owner[2].matchAll(/\b[A-Za-z_]\w*\b/g)) inherited.add(type[0]);
1260
+ parents.set(owner[1], inherited);
1261
+ }
1262
+ }
1263
+ const result = /* @__PURE__ */ new Map();
1264
+ const protocols = ["UITableViewDataSource", "UITableViewDelegate"];
1265
+ for (const type of parents.keys()) {
1266
+ const pending = [type];
1267
+ const seen = /* @__PURE__ */ new Set();
1268
+ const conformances = /* @__PURE__ */ new Set();
1269
+ while (pending.length) {
1270
+ const next = pending.pop();
1271
+ if (seen.has(next)) continue;
1272
+ seen.add(next);
1273
+ if (protocols.includes(next)) conformances.add(next);
1274
+ for (const parent of parents.get(next) ?? []) pending.push(parent);
1275
+ }
1276
+ if (conformances.size) result.set(type, conformances);
1277
+ }
1278
+ return result;
1279
+ }
1280
+ function lowerTableProtocolMethods(source, conformances) {
1281
+ const code = swiftCodeMask(source);
1282
+ const dataSource = {
1283
+ numberOfRowsInSection: "tableView:numberOfRowsInSection:",
1284
+ cellForRowAt: "tableView:cellForRowAtIndexPath:",
1285
+ titleForHeaderInSection: "tableView:titleForHeaderInSection:",
1286
+ titleForFooterInSection: "tableView:titleForFooterInSection:"
1287
+ };
1288
+ const delegate = {
1289
+ willDisplay: "tableView:willDisplayCell:forRowAtIndexPath:",
1290
+ didEndDisplaying: "tableView:didEndDisplayingCell:forRowAtIndexPath:",
1291
+ heightForRowAt: "tableView:heightForRowAtIndexPath:",
1292
+ estimatedHeightForRowAt: "tableView:estimatedHeightForRowAtIndexPath:",
1293
+ heightForHeaderInSection: "tableView:heightForHeaderInSection:",
1294
+ heightForFooterInSection: "tableView:heightForFooterInSection:",
1295
+ estimatedHeightForHeaderInSection: "tableView:estimatedHeightForHeaderInSection:",
1296
+ estimatedHeightForFooterInSection: "tableView:estimatedHeightForFooterInSection:",
1297
+ viewForHeaderInSection: "tableView:viewForHeaderInSection:",
1298
+ viewForFooterInSection: "tableView:viewForFooterInSection:",
1299
+ willDisplayHeaderView: "tableView:willDisplayHeaderView:forSection:",
1300
+ willDisplayFooterView: "tableView:willDisplayFooterView:forSection:",
1301
+ didEndDisplayingHeaderView: "tableView:didEndDisplayingHeaderView:forSection:",
1302
+ didEndDisplayingFooterView: "tableView:didEndDisplayingFooterView:forSection:",
1303
+ shouldHighlightRowAt: "tableView:shouldHighlightRowAtIndexPath:",
1304
+ didHighlightRowAt: "tableView:didHighlightRowAtIndexPath:",
1305
+ didUnhighlightRowAt: "tableView:didUnhighlightRowAtIndexPath:",
1306
+ willSelectRowAt: "tableView:willSelectRowAtIndexPath:",
1307
+ willDeselectRowAt: "tableView:willDeselectRowAtIndexPath:",
1308
+ didSelectRowAt: "tableView:didSelectRowAtIndexPath:",
1309
+ didDeselectRowAt: "tableView:didDeselectRowAtIndexPath:",
1310
+ accessoryButtonTappedForRowWith: "tableView:accessoryButtonTappedForRowWithIndexPath:"
1311
+ };
1312
+ const braces = [...code.matchAll(/[{}]/g)].map((match) => match.index);
1313
+ const edits = [];
1314
+ for (const owner of code.matchAll(/\b(?:class|extension)\s+([A-Za-z_]\w*)[^{}]*\{/g)) {
1315
+ const conforms = conformances.get(owner[1]);
1316
+ if (!conforms) continue;
1317
+ const selectors = {
1318
+ ...conforms.has("UITableViewDataSource") ? dataSource : {},
1319
+ ...conforms.has("UITableViewDelegate") ? delegate : {}
1320
+ };
1321
+ const open = owner.index + owner[0].length - 1;
1322
+ const close = closingBrace(code, braces, open);
1323
+ let depth = 1;
1324
+ let previous = open + 1;
1325
+ for (const token of swiftCodeScan(code.slice(open + 1, close - 1)).tokens) {
1326
+ const at = open + 1 + token;
1327
+ if (code[at] === "{") depth++;
1328
+ else if (code[at] === "}") {
1329
+ depth--;
1330
+ if (depth === 1) previous = at + 1;
1331
+ } else if (depth === 1 && /^func\b/.test(code.slice(at))) {
1332
+ const signature = code.slice(at, code.indexOf("{", at));
1333
+ const prefix = code.slice(previous, at);
1334
+ const attributes = /(?:@\w+(?:\([^{}]*\))?\s*|(?:public|open|private|fileprivate|internal|final|override|static|class|nonisolated|dynamic)\s+)*$/.exec(
1335
+ prefix
1336
+ )?.[0] ?? "";
1337
+ if (/\b(?:override|static|class)\b|@(?:objc|ObjC|IBAction)\b/.test(attributes))
1338
+ continue;
1339
+ let selector;
1340
+ if (conforms.has("UITableViewDataSource") && /^func\s+numberOfSections\s*\(\s*in\s+\w+\s*:\s*(?:UIKit\.)?UITableView\s*\)/.test(
1341
+ signature
1342
+ ))
1343
+ selector = "numberOfSectionsInTableView:";
1344
+ else {
1345
+ const match = /^func\s+tableView\s*\(\s*_\s+\w+\s*:\s*(?:UIKit\.)?UITableView\s*,\s*(\w+)\b/.exec(
1346
+ signature
1347
+ );
1348
+ if (match) selector = selectors[match[1]];
1349
+ }
1350
+ if (selector)
1351
+ edits.push([
1352
+ at,
1353
+ `${/\bnonisolated\b/.test(attributes) ? "" : "@MainActor "}@ObjC(${JSON.stringify(selector)}) `
1354
+ ]);
1355
+ }
1356
+ }
1357
+ }
1358
+ let result = source;
1359
+ for (const [at, text] of edits.sort((a, b) => b[0] - a[0]))
1360
+ result = result.slice(0, at) + text + result.slice(at);
1361
+ return result;
1362
+ }
1250
1363
  function swiftCodeMask(source) {
1251
1364
  const chars = source.split("");
1252
1365
  const blank = (from, to) => {
@@ -1350,9 +1463,9 @@ function swiftCodeMask(source) {
1350
1463
  scanCode(0, false);
1351
1464
  return chars.join("");
1352
1465
  }
1353
- function swiftSourceAsIOS(original, extraObjCExtensions) {
1466
+ function swiftSourceAsIOS(original, extraObjCExtensions, tableConformances = tableProtocolConformances([original])) {
1354
1467
  const source = liftExtensionOverrides(
1355
- lowerNotificationDelegate(original),
1468
+ lowerTableProtocolMethods(lowerNotificationDelegate(original), tableConformances),
1356
1469
  extraObjCExtensions
1357
1470
  );
1358
1471
  const { lineStarts, tokens } = swiftCodeScan(source);
@@ -1607,7 +1720,7 @@ function swiftCodeScan(source) {
1607
1720
  }
1608
1721
  return { lineStarts: starts, tokens };
1609
1722
  }
1610
- var compiledSource = (file, contents, extraObjCExtensions) => file.endsWith(".swift") ? swiftSourceAsIOS(contents, extraObjCExtensions) : contents;
1723
+ var compiledSource = (file, contents, extraObjCExtensions, tableConformances) => file.endsWith(".swift") ? swiftSourceAsIOS(contents, extraObjCExtensions, tableConformances) : contents;
1611
1724
  function prepareSwiftDependency(source, destination) {
1612
1725
  (0, import_node_fs2.rmSync)(destination, { recursive: true, force: true });
1613
1726
  const origins = [];
@@ -1623,6 +1736,7 @@ function prepareSwiftDependency(source, destination) {
1623
1736
  };
1624
1737
  gather(source, true);
1625
1738
  const objcExtensions = objcExtensionMemberIndex(origins);
1739
+ const tableConformances = tableProtocolConformances(origins);
1626
1740
  const copy = (from, to, root) => {
1627
1741
  (0, import_node_fs2.mkdirSync)(to, { recursive: true });
1628
1742
  for (const entry of (0, import_node_fs2.readdirSync)(from, { withFileTypes: true })) {
@@ -1634,7 +1748,12 @@ function prepareSwiftDependency(source, destination) {
1634
1748
  else if (entry.isFile() && entry.name.endsWith(".swift") && !(root && /^Package(@swift-[\d.]+)?\.swift$/.test(entry.name)))
1635
1749
  (0, import_node_fs2.writeFileSync)(
1636
1750
  target,
1637
- compiledSource(file, (0, import_node_fs2.readFileSync)(file, "utf8"), objcExtensions)
1751
+ compiledSource(
1752
+ file,
1753
+ (0, import_node_fs2.readFileSync)(file, "utf8"),
1754
+ objcExtensions,
1755
+ tableConformances
1756
+ )
1638
1757
  );
1639
1758
  else (0, import_node_fs2.cpSync)(file, target, { verbatimSymlinks: true });
1640
1759
  }
@@ -1673,15 +1792,15 @@ function writeSwiftProject(layout, input, moduleRoot) {
1673
1792
  // sootsim-swift files ${modulePlan.digest("hex").slice(0, 16)}
1674
1793
  // resource accessors ${resourcePlan}
1675
1794
  `;
1676
- const objcExtensions = objcExtensionMemberIndex(
1677
- Object.entries(input.files).filter(([file]) => file.endsWith(".swift")).map(([, contents]) => contents)
1678
- );
1795
+ const swiftSources = Object.entries(input.files).filter(([file]) => file.endsWith(".swift")).map(([, contents]) => contents);
1796
+ const objcExtensions = objcExtensionMemberIndex(swiftSources);
1797
+ const tableConformances = tableProtocolConformances(swiftSources);
1679
1798
  if (targets.length === 0) {
1680
1799
  for (const [file, contents] of Object.entries(input.files)) {
1681
1800
  if (file === "Package.swift") continue;
1682
1801
  files.set(
1683
1802
  import_node_path2.default.join(layout.sources, file),
1684
- compiledSource(file, contents, objcExtensions)
1803
+ compiledSource(file, contents, objcExtensions, tableConformances)
1685
1804
  );
1686
1805
  }
1687
1806
  let manifest = (0, import_node_fs2.readFileSync)(
@@ -1728,7 +1847,10 @@ function writeSwiftProject(layout, input, moduleRoot) {
1728
1847
  const base = layout.multi ? layout.root : layout.sources;
1729
1848
  for (const [file, contents] of Object.entries(input.files)) {
1730
1849
  if (file === "Package.swift") continue;
1731
- files.set(import_node_path2.default.join(base, file), compiledSource(file, contents, objcExtensions));
1850
+ files.set(
1851
+ import_node_path2.default.join(base, file),
1852
+ compiledSource(file, contents, objcExtensions, tableConformances)
1853
+ );
1732
1854
  }
1733
1855
  files.set(
1734
1856
  import_node_path2.default.join(layout.root, "Package.swift"),
@@ -1963,6 +2085,7 @@ function compileSwiftProjectUnit(input, options) {
1963
2085
  swiftSourceClosure,
1964
2086
  swiftTargetDependencies,
1965
2087
  syncSwiftTree,
2088
+ tableProtocolConformances,
1966
2089
  withNativeSourceGlue,
1967
2090
  writeSwiftProject
1968
2091
  });
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (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";
@@ -596,7 +596,7 @@ var ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"'
596
596
  var MULTI_MANIFEST_VERSION = 12;
597
597
  function swiftArtifactHash(input, release, moduleRoot) {
598
598
  const hash = createHash2("sha256");
599
- hash.update(`swift-compile/v18
599
+ hash.update(`swift-compile/v19
600
600
  ${release}
601
601
  `);
602
602
  if (input.oneModule) hash.update("one-module\n");
@@ -1194,6 +1194,118 @@ function lowerNotificationDelegate(source) {
1194
1194
  result = result.slice(0, at) + text + result.slice(at + count);
1195
1195
  return result;
1196
1196
  }
1197
+ function tableProtocolConformances(sources) {
1198
+ const parents = /* @__PURE__ */ new Map();
1199
+ for (const source of sources) {
1200
+ const code = swiftCodeMask(source);
1201
+ for (const owner of code.matchAll(
1202
+ /\b(?:class|extension)\s+([A-Za-z_]\w*)\s*:\s*([^{}]+)\{/g
1203
+ )) {
1204
+ const inherited = parents.get(owner[1]) ?? /* @__PURE__ */ new Set();
1205
+ for (const type of owner[2].matchAll(/\b[A-Za-z_]\w*\b/g)) inherited.add(type[0]);
1206
+ parents.set(owner[1], inherited);
1207
+ }
1208
+ }
1209
+ const result = /* @__PURE__ */ new Map();
1210
+ const protocols = ["UITableViewDataSource", "UITableViewDelegate"];
1211
+ for (const type of parents.keys()) {
1212
+ const pending = [type];
1213
+ const seen = /* @__PURE__ */ new Set();
1214
+ const conformances = /* @__PURE__ */ new Set();
1215
+ while (pending.length) {
1216
+ const next = pending.pop();
1217
+ if (seen.has(next)) continue;
1218
+ seen.add(next);
1219
+ if (protocols.includes(next)) conformances.add(next);
1220
+ for (const parent of parents.get(next) ?? []) pending.push(parent);
1221
+ }
1222
+ if (conformances.size) result.set(type, conformances);
1223
+ }
1224
+ return result;
1225
+ }
1226
+ function lowerTableProtocolMethods(source, conformances) {
1227
+ const code = swiftCodeMask(source);
1228
+ const dataSource = {
1229
+ numberOfRowsInSection: "tableView:numberOfRowsInSection:",
1230
+ cellForRowAt: "tableView:cellForRowAtIndexPath:",
1231
+ titleForHeaderInSection: "tableView:titleForHeaderInSection:",
1232
+ titleForFooterInSection: "tableView:titleForFooterInSection:"
1233
+ };
1234
+ const delegate = {
1235
+ willDisplay: "tableView:willDisplayCell:forRowAtIndexPath:",
1236
+ didEndDisplaying: "tableView:didEndDisplayingCell:forRowAtIndexPath:",
1237
+ heightForRowAt: "tableView:heightForRowAtIndexPath:",
1238
+ estimatedHeightForRowAt: "tableView:estimatedHeightForRowAtIndexPath:",
1239
+ heightForHeaderInSection: "tableView:heightForHeaderInSection:",
1240
+ heightForFooterInSection: "tableView:heightForFooterInSection:",
1241
+ estimatedHeightForHeaderInSection: "tableView:estimatedHeightForHeaderInSection:",
1242
+ estimatedHeightForFooterInSection: "tableView:estimatedHeightForFooterInSection:",
1243
+ viewForHeaderInSection: "tableView:viewForHeaderInSection:",
1244
+ viewForFooterInSection: "tableView:viewForFooterInSection:",
1245
+ willDisplayHeaderView: "tableView:willDisplayHeaderView:forSection:",
1246
+ willDisplayFooterView: "tableView:willDisplayFooterView:forSection:",
1247
+ didEndDisplayingHeaderView: "tableView:didEndDisplayingHeaderView:forSection:",
1248
+ didEndDisplayingFooterView: "tableView:didEndDisplayingFooterView:forSection:",
1249
+ shouldHighlightRowAt: "tableView:shouldHighlightRowAtIndexPath:",
1250
+ didHighlightRowAt: "tableView:didHighlightRowAtIndexPath:",
1251
+ didUnhighlightRowAt: "tableView:didUnhighlightRowAtIndexPath:",
1252
+ willSelectRowAt: "tableView:willSelectRowAtIndexPath:",
1253
+ willDeselectRowAt: "tableView:willDeselectRowAtIndexPath:",
1254
+ didSelectRowAt: "tableView:didSelectRowAtIndexPath:",
1255
+ didDeselectRowAt: "tableView:didDeselectRowAtIndexPath:",
1256
+ accessoryButtonTappedForRowWith: "tableView:accessoryButtonTappedForRowWithIndexPath:"
1257
+ };
1258
+ const braces = [...code.matchAll(/[{}]/g)].map((match) => match.index);
1259
+ const edits = [];
1260
+ for (const owner of code.matchAll(/\b(?:class|extension)\s+([A-Za-z_]\w*)[^{}]*\{/g)) {
1261
+ const conforms = conformances.get(owner[1]);
1262
+ if (!conforms) continue;
1263
+ const selectors = {
1264
+ ...conforms.has("UITableViewDataSource") ? dataSource : {},
1265
+ ...conforms.has("UITableViewDelegate") ? delegate : {}
1266
+ };
1267
+ const open = owner.index + owner[0].length - 1;
1268
+ const close = closingBrace(code, braces, open);
1269
+ let depth = 1;
1270
+ let previous = open + 1;
1271
+ for (const token of swiftCodeScan(code.slice(open + 1, close - 1)).tokens) {
1272
+ const at = open + 1 + token;
1273
+ if (code[at] === "{") depth++;
1274
+ else if (code[at] === "}") {
1275
+ depth--;
1276
+ if (depth === 1) previous = at + 1;
1277
+ } else if (depth === 1 && /^func\b/.test(code.slice(at))) {
1278
+ const signature = code.slice(at, code.indexOf("{", at));
1279
+ const prefix = code.slice(previous, at);
1280
+ const attributes = /(?:@\w+(?:\([^{}]*\))?\s*|(?:public|open|private|fileprivate|internal|final|override|static|class|nonisolated|dynamic)\s+)*$/.exec(
1281
+ prefix
1282
+ )?.[0] ?? "";
1283
+ if (/\b(?:override|static|class)\b|@(?:objc|ObjC|IBAction)\b/.test(attributes))
1284
+ continue;
1285
+ let selector;
1286
+ if (conforms.has("UITableViewDataSource") && /^func\s+numberOfSections\s*\(\s*in\s+\w+\s*:\s*(?:UIKit\.)?UITableView\s*\)/.test(
1287
+ signature
1288
+ ))
1289
+ selector = "numberOfSectionsInTableView:";
1290
+ else {
1291
+ const match = /^func\s+tableView\s*\(\s*_\s+\w+\s*:\s*(?:UIKit\.)?UITableView\s*,\s*(\w+)\b/.exec(
1292
+ signature
1293
+ );
1294
+ if (match) selector = selectors[match[1]];
1295
+ }
1296
+ if (selector)
1297
+ edits.push([
1298
+ at,
1299
+ `${/\bnonisolated\b/.test(attributes) ? "" : "@MainActor "}@ObjC(${JSON.stringify(selector)}) `
1300
+ ]);
1301
+ }
1302
+ }
1303
+ }
1304
+ let result = source;
1305
+ for (const [at, text] of edits.sort((a, b) => b[0] - a[0]))
1306
+ result = result.slice(0, at) + text + result.slice(at);
1307
+ return result;
1308
+ }
1197
1309
  function swiftCodeMask(source) {
1198
1310
  const chars = source.split("");
1199
1311
  const blank = (from, to) => {
@@ -1297,9 +1409,9 @@ function swiftCodeMask(source) {
1297
1409
  scanCode(0, false);
1298
1410
  return chars.join("");
1299
1411
  }
1300
- function swiftSourceAsIOS(original, extraObjCExtensions) {
1412
+ function swiftSourceAsIOS(original, extraObjCExtensions, tableConformances = tableProtocolConformances([original])) {
1301
1413
  const source = liftExtensionOverrides(
1302
- lowerNotificationDelegate(original),
1414
+ lowerTableProtocolMethods(lowerNotificationDelegate(original), tableConformances),
1303
1415
  extraObjCExtensions
1304
1416
  );
1305
1417
  const { lineStarts, tokens } = swiftCodeScan(source);
@@ -1554,7 +1666,7 @@ function swiftCodeScan(source) {
1554
1666
  }
1555
1667
  return { lineStarts: starts, tokens };
1556
1668
  }
1557
- var compiledSource = (file, contents, extraObjCExtensions) => file.endsWith(".swift") ? swiftSourceAsIOS(contents, extraObjCExtensions) : contents;
1669
+ var compiledSource = (file, contents, extraObjCExtensions, tableConformances) => file.endsWith(".swift") ? swiftSourceAsIOS(contents, extraObjCExtensions, tableConformances) : contents;
1558
1670
  function prepareSwiftDependency(source, destination) {
1559
1671
  rmSync(destination, { recursive: true, force: true });
1560
1672
  const origins = [];
@@ -1570,6 +1682,7 @@ function prepareSwiftDependency(source, destination) {
1570
1682
  };
1571
1683
  gather(source, true);
1572
1684
  const objcExtensions = objcExtensionMemberIndex(origins);
1685
+ const tableConformances = tableProtocolConformances(origins);
1573
1686
  const copy = (from, to, root) => {
1574
1687
  mkdirSync(to, { recursive: true });
1575
1688
  for (const entry of readdirSync(from, { withFileTypes: true })) {
@@ -1581,7 +1694,12 @@ function prepareSwiftDependency(source, destination) {
1581
1694
  else if (entry.isFile() && entry.name.endsWith(".swift") && !(root && /^Package(@swift-[\d.]+)?\.swift$/.test(entry.name)))
1582
1695
  writeFileSync(
1583
1696
  target,
1584
- compiledSource(file, readFileSync2(file, "utf8"), objcExtensions)
1697
+ compiledSource(
1698
+ file,
1699
+ readFileSync2(file, "utf8"),
1700
+ objcExtensions,
1701
+ tableConformances
1702
+ )
1585
1703
  );
1586
1704
  else cpSync(file, target, { verbatimSymlinks: true });
1587
1705
  }
@@ -1620,15 +1738,15 @@ function writeSwiftProject(layout, input, moduleRoot) {
1620
1738
  // sootsim-swift files ${modulePlan.digest("hex").slice(0, 16)}
1621
1739
  // resource accessors ${resourcePlan}
1622
1740
  `;
1623
- const objcExtensions = objcExtensionMemberIndex(
1624
- Object.entries(input.files).filter(([file]) => file.endsWith(".swift")).map(([, contents]) => contents)
1625
- );
1741
+ const swiftSources = Object.entries(input.files).filter(([file]) => file.endsWith(".swift")).map(([, contents]) => contents);
1742
+ const objcExtensions = objcExtensionMemberIndex(swiftSources);
1743
+ const tableConformances = tableProtocolConformances(swiftSources);
1626
1744
  if (targets.length === 0) {
1627
1745
  for (const [file, contents] of Object.entries(input.files)) {
1628
1746
  if (file === "Package.swift") continue;
1629
1747
  files.set(
1630
1748
  path2.join(layout.sources, file),
1631
- compiledSource(file, contents, objcExtensions)
1749
+ compiledSource(file, contents, objcExtensions, tableConformances)
1632
1750
  );
1633
1751
  }
1634
1752
  let manifest = readFileSync2(
@@ -1675,7 +1793,10 @@ function writeSwiftProject(layout, input, moduleRoot) {
1675
1793
  const base = layout.multi ? layout.root : layout.sources;
1676
1794
  for (const [file, contents] of Object.entries(input.files)) {
1677
1795
  if (file === "Package.swift") continue;
1678
- files.set(path2.join(base, file), compiledSource(file, contents, objcExtensions));
1796
+ files.set(
1797
+ path2.join(base, file),
1798
+ compiledSource(file, contents, objcExtensions, tableConformances)
1799
+ );
1679
1800
  }
1680
1801
  files.set(
1681
1802
  path2.join(layout.root, "Package.swift"),
@@ -1909,6 +2030,7 @@ export {
1909
2030
  swiftSourceClosure,
1910
2031
  swiftTargetDependencies,
1911
2032
  syncSwiftTree,
2033
+ tableProtocolConformances,
1912
2034
  withNativeSourceGlue,
1913
2035
  writeSwiftProject
1914
2036
  };
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (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.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (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.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.800 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.801 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;