peachsim 0.1.2221 → 0.1.2223

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 (127) hide show
  1. package/cli/commands/compat.ts +4 -4
  2. package/cli/commands/report-issue.ts +1 -1
  3. package/cli/runtime-compat.ts +7 -2
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/bundle-channel.cjs +461 -369
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/config.mjs +1 -1
  27. package/dist-lib/detox/index.cjs +3 -2
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +458 -367
  30. package/dist-lib/expo-swift-metadata.cjs +1 -1
  31. package/dist-lib/expo-swift-metadata.mjs +1 -1
  32. package/dist-lib/home-paths.cjs +1 -1
  33. package/dist-lib/host/bridge-host.cjs +681 -562
  34. package/dist-lib/host/fetch-proxy-handler.cjs +10 -7
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  38. package/dist-lib/host/websocket-proxy.cjs +1 -1
  39. package/dist-lib/index.cjs +8232 -7815
  40. package/dist-lib/jump-to-source-babel.cjs +1 -1
  41. package/dist-lib/jump-to-source-native.cjs +1 -1
  42. package/dist-lib/kotlin-host.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +8146 -7737
  50. package/dist-lib/native-app-identity-project.cjs +331 -13
  51. package/dist-lib/native-app-identity-project.mjs +331 -13
  52. package/dist-lib/native-app-identity.cjs +16 -3
  53. package/dist-lib/native-app-identity.mjs +16 -3
  54. package/dist-lib/native-firebase-metadata.cjs +1 -1
  55. package/dist-lib/native-firebase-metadata.mjs +1 -1
  56. package/dist-lib/pdfium-raster.cjs +1 -1
  57. package/dist-lib/pdfium-raster.mjs +1 -1
  58. package/dist-lib/plist.cjs +1 -1
  59. package/dist-lib/plist.mjs +1 -1
  60. package/dist-lib/profiles.cjs +1 -1
  61. package/dist-lib/public-brand.cjs +1 -1
  62. package/dist-lib/public-origins-lib-esm.json +25 -24
  63. package/dist-lib/public-origins-lib.json +99 -96
  64. package/dist-lib/react-native-host-modules.cjs +1 -1
  65. package/dist-lib/react-native-host-modules.mjs +1 -1
  66. package/dist-lib/reap-browser.cjs +1 -1
  67. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  68. package/dist-lib/sdk.cjs +1 -1
  69. package/dist-lib/sdk.mjs +1 -1
  70. package/dist-lib/skills.cjs +518 -408
  71. package/dist-lib/swift-compile.cjs +69 -36
  72. package/dist-lib/swift-compile.mjs +69 -36
  73. package/dist-lib/swift-package.cjs +1 -1
  74. package/dist-lib/swift-package.mjs +1 -1
  75. package/dist-lib/swift-submit.cjs +1 -1
  76. package/dist-lib/swift-submit.mjs +1 -1
  77. package/dist-lib/swift-toolchain.cjs +1 -1
  78. package/dist-lib/swift.cjs +1 -1
  79. package/dist-lib/vite-swift.cjs +143 -56
  80. package/dist-lib/vite.cjs +2930 -2800
  81. package/dist-lib/worklet-executable.cjs +1 -1
  82. package/dist-lib/worklet-executable.mjs +1 -1
  83. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +2 -1
  84. package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
  85. package/dist-types/packages/peach-engine/src/cli-host-terser.d.ts +7 -0
  86. package/dist-types/packages/peach-engine/src/engine/glass-material.d.ts +1 -1
  87. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
  88. package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +1 -0
  89. package/dist-types/packages/peach-engine/src/engine/node.d.ts +5 -0
  90. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +8 -1
  91. package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
  92. package/dist-types/packages/peach-engine/src/engine/yoga-layout.d.ts +1 -1
  93. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
  94. package/dist-types/packages/peach-engine/src/render-worker/shell-tree-wire.d.ts +1 -2
  95. package/dist-types/packages/peach-globals/src/browser-object-url.d.ts +10 -0
  96. package/dist-types/packages/peach-kit/src/internal.d.ts +1 -0
  97. package/dist-types/packages/peach-kit/src/ios-tint.d.ts +1 -0
  98. package/dist-types/packages/peach-kit/src/transitions/screen-transition-math.d.ts +25 -0
  99. package/kotlin/sdk.tar.gz +0 -0
  100. package/package.json +1 -1
  101. package/runtime-companion.json +1 -1
  102. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNAnimation.h +4 -4
  103. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNCameraController.h +1 -1
  104. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNConstraint.h +5 -5
  105. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNGeometry.h +1 -1
  106. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNLevelOfDetail.h +1 -1
  107. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNParametricGeometry.h +9 -9
  108. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNParticleSystem.h +1 -1
  109. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsBehavior.h +7 -7
  110. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNRenderer.h +1 -1
  111. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNShadable.h +1 -1
  112. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNTechnique.h +1 -1
  113. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISegmentedControl.h +1 -1
  114. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h +1 -1
  115. package/src/cli-runtime.ts +1 -0
  116. package/src/conformance-pixel-comparison.ts +16 -3
  117. package/src/expo-native-workspace.ts +14 -10
  118. package/src/expo-workspace-exclusion.ts +10 -7
  119. package/src/react-native-autolinking.ts +2 -1
  120. package/src/runtime-delivery.ts +7 -0
  121. package/src/swift-compile.ts +51 -35
  122. package/src/swift-coverage/xcode-assets.ts +4 -2
  123. package/src/swift-host.ts +53 -14
  124. package/src/swift-root-lock.ts +27 -4
  125. package/src/wasm-optimize.ts +5 -1
  126. package/src/xcode-project.ts +26 -5
  127. package/src/xcode-target-members.ts +25 -3
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2221 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2223 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
39
39
  var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
40
40
  var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
41
41
  "<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
42
- define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "29c2661be4b952101c9b9b8fd861560e6ce63b25dd4464f47475aaf72024f4fe", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "25505683ca29a0b380413bf2a5026d4967eacf886e35bc11ece6e15317e5bb02", "home-paths.ts": "d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "86f79e98323ec065e0e5195324c75ca608f490efbd95dcc25c53d5aa0b9aecc9", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
42
+ define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "29c2661be4b952101c9b9b8fd861560e6ce63b25dd4464f47475aaf72024f4fe", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "25505683ca29a0b380413bf2a5026d4967eacf886e35bc11ece6e15317e5bb02", "home-paths.ts": "d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "b6e04100805ba81f14d751383416fd4aab46901a6f94f5b62f831e66c28001c1", "xcode-target-members.ts": "d49af77a690cff481b38333b5f63f6600123b1bb57f410b0adb298b010d2047b", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
43
43
  }
44
44
  });
45
45
 
@@ -15267,7 +15267,8 @@ var FEATURES = [
15267
15267
  "reference-types",
15268
15268
  "sign-ext"
15269
15269
  ];
15270
- var WASM_OPTIMIZE_IDENTITY = `wasm-opt ${import_wasm_opt.BINARYEN_VERSION} -Oz ${FEATURES.join(",")}`;
15270
+ var KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === "1";
15271
+ var WASM_OPTIMIZE_IDENTITY = `wasm-opt ${import_wasm_opt.BINARYEN_VERSION} -Oz ${FEATURES.join(",")}${KEEP_WASM_NAMES ? " -g" : ""}`;
15271
15272
  var PINNED_BINARYEN_VERSION = "132";
15272
15273
  var BINARYEN_RELEASES = /* @__PURE__ */ new Map([
15273
15274
  [
@@ -15303,6 +15304,7 @@ async function runWasmOpt(file, output2, skipPasses, binary) {
15303
15304
  const result = await (0, import_wasm_opt.wasmOpt)(
15304
15305
  [
15305
15306
  "-Oz",
15307
+ ...KEEP_WASM_NAMES ? ["-g"] : [],
15306
15308
  ...skipPasses.flatMap((pass) => ["--skip-pass", pass]),
15307
15309
  ...FEATURES.map((feature) => `--enable-${feature}`),
15308
15310
  file,
@@ -16179,6 +16181,7 @@ var import_node_fs24 = require("node:fs");
16179
16181
  var import_node_os10 = require("node:os");
16180
16182
  var import_node_path23 = __toESM(require("node:path"), 1);
16181
16183
  var POLL_MS = 250;
16184
+ var INSPECT_ATTEMPTS = 5;
16182
16185
  var START_TOLERANCE_MS = 2e3;
16183
16186
  function errorCode(error) {
16184
16187
  return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : void 0;
@@ -16192,6 +16195,17 @@ function processTable(pid) {
16192
16195
  );
16193
16196
  }
16194
16197
  }
16198
+ async function processTableWithRetry(pid, signal) {
16199
+ for (let attempt = 1; ; attempt++) {
16200
+ try {
16201
+ return processTable(pid);
16202
+ } catch (error) {
16203
+ if (attempt >= INSPECT_ATTEMPTS) throw error;
16204
+ await pause(POLL_MS * attempt, signal);
16205
+ signal?.throwIfAborted();
16206
+ }
16207
+ }
16208
+ }
16195
16209
  function sameProcess(row, identity2) {
16196
16210
  return row.pid === identity2.pid && Math.abs(row.start - identity2.start) <= START_TOLERANCE_MS;
16197
16211
  }
@@ -16261,7 +16275,11 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
16261
16275
  );
16262
16276
  (0, import_node_fs24.mkdirSync)(directory, { recursive: true });
16263
16277
  const token = (0, import_node_crypto12.randomUUID)();
16264
- const owner = JSON.stringify(ownIdentity(process.pid));
16278
+ const ownRow = (await processTableWithRetry(process.pid, signal)).find(
16279
+ (candidate) => candidate.pid === process.pid && !candidate.zombie
16280
+ );
16281
+ if (!ownRow) throw new Error(`swift root lock cannot find process ${process.pid}`);
16282
+ const owner = JSON.stringify({ pid: process.pid, start: ownRow.start });
16265
16283
  const pending = import_node_path23.default.join(directory, `pending.${token}`);
16266
16284
  let held = 0;
16267
16285
  for (; ; ) {
@@ -16270,15 +16288,15 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
16270
16288
  const current = newest > 0 ? readGeneration(directory, newest) : null;
16271
16289
  if (newest > 0 && !current) continue;
16272
16290
  if (current && !current.released) {
16273
- const owner2 = processTable(current.holder.pid);
16274
- if (owner2.some((row) => !row.zombie && sameProcess(row, current.holder))) {
16291
+ const holder = await processTableWithRetry(current.holder.pid, signal);
16292
+ if (holder.some((row) => !row.zombie && sameProcess(row, current.holder))) {
16275
16293
  if (!wait) return void 0;
16276
16294
  await pause(POLL_MS, signal);
16277
16295
  continue;
16278
16296
  }
16279
16297
  const children2 = readChildren(directory, newest);
16280
16298
  if (children2.length) {
16281
- const table = processTable();
16299
+ const table = await processTableWithRetry(void 0, signal);
16282
16300
  if (children2.some((child) => groupAlive(table, child))) {
16283
16301
  if (!wait) return void 0;
16284
16302
  await pause(POLL_MS, signal);
@@ -16922,7 +16940,8 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
16922
16940
  PeachCFNetwork: [],
16923
16941
  JavaScriptCore: ["PeachJavaScriptCore"],
16924
16942
  PeachJavaScriptCore: [],
16925
- GameplayKit: [],
16943
+ // GameplayKit names SpriteKit and SceneKit nodes, as on iOS
16944
+ GameplayKit: ["SpriteKit", "SceneKit", "PeachBox2D", "simd", "GLKit"],
16926
16945
  simd: [],
16927
16946
  ModelIO: ["simd"],
16928
16947
  GLKit: ["ModelIO"],
@@ -17433,10 +17452,21 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
17433
17452
  return siblings;
17434
17453
  }
17435
17454
  var ONE_PRODUCT = '.product(name: "One", package: "sootsim-swift")';
17436
- var SPRITEKIT_PRODUCT = '.product(name: "SpriteKit", package: "sootsim-swift")';
17437
- var importsSpriteKit = (files2) => Object.entries(files2).some(
17438
- ([file, contents]) => file.endsWith(".swift") && swiftImportNames(contents).includes("SpriteKit")
17439
- );
17455
+ var GAME_FAMILY = ["SpriteKit", "SceneKit"];
17456
+ var gameProducts = (files2) => {
17457
+ const imported = new Set(
17458
+ Object.entries(files2).flatMap(
17459
+ ([file, contents]) => file.endsWith(".swift") ? swiftImportNames(contents) : []
17460
+ )
17461
+ );
17462
+ if (imported.has("SceneKit")) return [...GAME_FAMILY];
17463
+ return imported.has("SpriteKit") ? ["SpriteKit"] : [];
17464
+ };
17465
+ var gameProduct = (name3) => `.product(name: "${name3}", package: "sootsim-swift")`;
17466
+ var GAME_REACH = {
17467
+ SpriteKit: ["SpriteKit", "PeachBox2D", "simd", "GLKit"],
17468
+ SceneKit: ["SceneKit"]
17469
+ };
17440
17470
  var FOUNDATION_IMPLICIT_MODULES = [
17441
17471
  "PeachObjC",
17442
17472
  "Dispatch",
@@ -17463,7 +17493,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
17463
17493
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
17464
17494
  var MULTI_MANIFEST_VERSION = 68;
17465
17495
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
17466
- var compilerSourceDigest = true ? "2e9f321a97a408a1b3b8b7d85bbcfb108f0761ed9726b832a3c6c2cc52102806" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
17496
+ var compilerSourceDigest = true ? "ae9e08389e6ab1901846342a7b347d7c10f8074172cf5d4d6505f7e955879ad4" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
17467
17497
  function swiftArtifactHash(input, release, moduleRoot) {
17468
17498
  const hash = (0, import_node_crypto13.createHash)("sha256");
17469
17499
  hash.update(`swift-compile
@@ -17471,6 +17501,7 @@ ${release}
17471
17501
  `);
17472
17502
  hash.update(compilerSourceDigest);
17473
17503
  if (input.oneModule) hash.update("one-module\n");
17504
+ if (KEEP_WASM_NAMES) hash.update("names\n");
17474
17505
  hash.update(swiftModuleDigest(moduleRoot));
17475
17506
  if (input.optimize) hash.update(`optimize
17476
17507
  ${WASM_OPTIMIZE_IDENTITY}
@@ -17585,7 +17616,14 @@ function toolsetOrdersLibcxxBeforeDarwinOverlay(options) {
17585
17616
  return libcxx >= 0 && overlay > libcxx;
17586
17617
  }
17587
17618
  function emitSwiftPackageManifest(args) {
17588
- const { targets, siblings, moduleRoot, oneModule, spriteKit, distribution } = args;
17619
+ const {
17620
+ targets,
17621
+ siblings,
17622
+ moduleRoot,
17623
+ oneModule,
17624
+ gameProducts: gameProducts2 = [],
17625
+ distribution
17626
+ } = args;
17589
17627
  const prebuilt = args.prebuilt;
17590
17628
  const linkedObjects = Boolean(distribution || prebuilt);
17591
17629
  const cxxFlagsFor = (flags) => args.deferDarwinOverlay ? withoutWasmOverlayIsystem(flags) : flags;
@@ -17614,9 +17652,8 @@ function emitSwiftPackageManifest(args) {
17614
17652
  for (const name3 of [...siblings.values()].flat())
17615
17653
  if (OPTIONAL_FRAMEWORKS.has(name3) && !targets.some((target) => target.name === name3))
17616
17654
  reach(name3);
17617
- if (spriteKit) {
17618
- for (const name3 of ["SpriteKit", "PeachBox2D", "simd", "GLKit"]) reach(name3);
17619
- }
17655
+ for (const product of gameProducts2)
17656
+ for (const name3 of GAME_REACH[product] ?? []) reach(name3);
17620
17657
  let distributionLinkPath;
17621
17658
  const distributionLink = args.distributionLink;
17622
17659
  if (distribution && distributionLink) {
@@ -17639,7 +17676,7 @@ function emitSwiftPackageManifest(args) {
17639
17676
  (object4) => !isProvider(object4) && !replacedObjects.has(object4)
17640
17677
  );
17641
17678
  const objects = available.filter(
17642
- (object4) => !targets.some((target) => object4.startsWith(`lib/${target.name}-`)) && [...OPTIONAL_FRAMEWORKS, "SpriteKit", "PeachBox2D"].every(
17679
+ (object4) => !targets.some((target) => object4.startsWith(`lib/${target.name}-`)) && [...OPTIONAL_FRAMEWORKS, ...GAME_FAMILY, "PeachBox2D"].every(
17643
17680
  (name3) => !object4.startsWith(`lib/${name3}-`) || reachedFrameworks.has(name3)
17644
17681
  )
17645
17682
  );
@@ -17802,7 +17839,7 @@ function emitSwiftPackageManifest(args) {
17802
17839
  ...linkedObjects || clang && !target.executable ? [] : [
17803
17840
  '.product(name: "SwiftUI", package: "sootsim-swift")',
17804
17841
  ...oneModule ? [ONE_PRODUCT] : [],
17805
- ...spriteKit ? [SPRITEKIT_PRODUCT] : []
17842
+ ...gameProducts2.map(gameProduct)
17806
17843
  ],
17807
17844
  ...(siblings.get(target.name) ?? []).flatMap(
17808
17845
  (dependency) => clang && // textual native headers can include one another without imposing
@@ -17834,7 +17871,7 @@ function emitSwiftPackageManifest(args) {
17834
17871
  .unsafeFlags(${flagArray(`[
17835
17872
  ${REACTOR_FLAG}${executableLinkFlags(args.root)} "-Xlinker", "--export-if-defined=__main_argc_argv"${library},
17836
17873
  ]`)}),
17837
- .unsafeFlags(["-Xlinker", "--strip-all"], .when(configuration: .release)),
17874
+ ${KEEP_WASM_NAMES ? "" : '.unsafeFlags(["-Xlinker", "--strip-all"], .when(configuration: .release)),'}
17838
17875
  ]` : librarySettings.length > 0 ? `,
17839
17876
  linkerSettings: [${librarySettings.join(", ")}]` : "";
17840
17877
  const cDefines = macroSettings(target.cDefines);
@@ -18439,8 +18476,6 @@ var FOUNDATION_OVERLAY_GLOBALS = /* @__PURE__ */ new Set([
18439
18476
  "NSURLProtectionSpaceHTTPS",
18440
18477
  "NSURLProtectionSpaceHTTPSProxy",
18441
18478
  "NSURLProtectionSpaceSOCKSProxy",
18442
- "NSURLSessionDownloadTaskResumeData",
18443
- "NSURLSessionTransferSizeUnknown",
18444
18479
  "NSURLSessionUploadTaskResumeData",
18445
18480
  "NSUTF16BigEndianStringEncoding",
18446
18481
  "NSUTF16LittleEndianStringEncoding",
@@ -20076,8 +20111,8 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
20076
20111
  const moduleName = swiftTargetModuleName(name3);
20077
20112
  const originalMap = originalMaps.get(moduleName);
20078
20113
  const stagedMap = sourceModuleMaps.get(moduleName);
20079
- const originalPath = originalMap ? import_node_path27.default.join(layout2.root, originalMap) : stagedMap?.path;
20080
- const originalContents = originalMap ? input.files[originalMap] : stagedMap?.contents;
20114
+ const originalPath = stagedMap?.path ?? (originalMap ? import_node_path27.default.join(layout2.root, originalMap) : void 0);
20115
+ const originalContents = stagedMap?.contents ?? (originalMap && input.files[originalMap]);
20081
20116
  const originalTokens = originalContents ? moduleMapTokens(originalContents) : [];
20082
20117
  if (originalPath && originalTokens.some(
20083
20118
  (token, index) => token === "module" && (originalTokens[index + 1] === "Swift" || originalTokens[index + 1] === `${moduleName}.Swift`)
@@ -20352,14 +20387,17 @@ module ${moduleName}.Swift {
20352
20387
  manifest = manifest.replace(product, `${product}
20353
20388
  ${ONE_PRODUCT},`).replace(flags, `${flags}${ONE_IMPLICIT_FLAGS}`);
20354
20389
  }
20355
- if (importsSpriteKit(input.files)) {
20390
+ const games = gameProducts(input.files);
20391
+ if (games.length > 0) {
20356
20392
  const anchor = '.product(name: "CoreLocation", package: "sootsim-swift"),';
20357
20393
  if (!manifest.includes(anchor))
20358
20394
  throw new Error(
20359
- "scripts/contrast-app-Package.swift lost the line the SpriteKit product links at"
20395
+ "scripts/contrast-app-Package.swift lost the line the game products link at"
20360
20396
  );
20361
- manifest = manifest.replace(anchor, `${anchor}
20362
- ${SPRITEKIT_PRODUCT},`);
20397
+ manifest = manifest.replace(
20398
+ anchor,
20399
+ [anchor, ...games.map((name3) => `${gameProduct(name3)},`)].join("\n ")
20400
+ );
20363
20401
  }
20364
20402
  files2.set(import_node_path27.default.join(layout2.root, "Package.swift"), manifest + moduleFiles);
20365
20403
  } else {
@@ -20474,7 +20512,7 @@ module ${moduleName}.Swift {
20474
20512
  siblings: moduleSiblings,
20475
20513
  moduleRoot,
20476
20514
  oneModule: input.oneModule,
20477
- spriteKit: importsSpriteKit(input.files),
20515
+ gameProducts: gameProducts(input.files),
20478
20516
  distribution: distribution ?? void 0,
20479
20517
  moduleExcludes,
20480
20518
  deferDarwinOverlay: native.size > 0 && toolsetOrdersLibcxxBeforeDarwinOverlay(
@@ -20881,14 +20919,9 @@ function linkedFrameworkTargets(moduleRoot, input) {
20881
20919
  ))
20882
20920
  reach(match[1]);
20883
20921
  }
20884
- if (importsSpriteKit(input.files))
20885
- for (const name3 of ["SpriteKit", "PeachBox2D", "simd", "GLKit"]) reach(name3);
20886
- const wanted = [
20887
- "PeachApp",
20888
- ...input.oneModule ? ["One"] : [],
20889
- ...importsSpriteKit(input.files) ? ["SpriteKit"] : [],
20890
- ...reached
20891
- ];
20922
+ const games = gameProducts(input.files);
20923
+ for (const product of games) for (const name3 of GAME_REACH[product] ?? []) reach(name3);
20924
+ const wanted = ["PeachApp", ...input.oneModule ? ["One"] : [], ...games, ...reached];
20892
20925
  const linked = [...new Set(wanted)].filter((name3) => libraries.has(name3));
20893
20926
  if (!linked.includes("PeachApp"))
20894
20927
  throw new Error("swift-compile: the framework package declares no PeachApp library");
@@ -23559,6 +23592,7 @@ function parseOpenStepPlist(text5) {
23559
23592
  // src/xcode-target-members.ts
23560
23593
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
23561
23594
  var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
23595
+ var FOLDER_REFERENCE = /^(?:folder|wrapper\.scnassets)$/;
23562
23596
  var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
23563
23597
  function xcodePathResolver(objects, projectDir, join9, sourceTreeRoot) {
23564
23598
  const parents = /* @__PURE__ */ new Map();
@@ -23625,8 +23659,20 @@ function xcodeTargetMemberVisitor(objects) {
23625
23659
  for (const id of refs) {
23626
23660
  const file = resolvePath(id);
23627
23661
  if (file === null) continue;
23628
- if (phase.isa === "PBXSourcesBuildPhase") visit(file, "source");
23629
- else for (const inner of filesUnder(file)) visit(inner, "resource");
23662
+ if (phase.isa === "PBXSourcesBuildPhase") {
23663
+ visit(file, "source");
23664
+ continue;
23665
+ }
23666
+ const ref = objects[id];
23667
+ const type = isDict(ref) ? str(ref.lastKnownFileType) ?? str(ref.explicitFileType) ?? "" : "";
23668
+ const root = file.replace(/[\\/]+$/, "");
23669
+ const folder = FOLDER_REFERENCE.test(type) ? root.split(/[\\/]/).pop() : void 0;
23670
+ for (const inner of filesUnder(file))
23671
+ visit(
23672
+ inner,
23673
+ "resource",
23674
+ folder && `${folder}/${inner.slice(root.length + 1).replaceAll("\\", "/")}`
23675
+ );
23630
23676
  }
23631
23677
  }
23632
23678
  }
@@ -24980,12 +25026,13 @@ function planAssetSymbols(resources, root, settings) {
24980
25026
  "2": ["ipad"],
24981
25027
  "1,2": ["iphone", "ipad"],
24982
25028
  "1,7": ["iphone"],
25029
+ "1,3,7": ["iphone"],
24983
25030
  "1,2,6": ["iphone", "ipad"],
24984
25031
  "1,2,7": ["iphone", "ipad"]
24985
25032
  }[families];
24986
25033
  if (!devices)
24987
25034
  return unknown2(
24988
- `Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
25035
+ `Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,3,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
24989
25036
  );
24990
25037
  const plan = {
24991
25038
  catalogs: catalogs.map((path51) => ({
@@ -28348,6 +28395,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
28348
28395
  const allSources = /* @__PURE__ */ new Set();
28349
28396
  const headers = /* @__PURE__ */ new Set();
28350
28397
  const resources = /* @__PURE__ */ new Set();
28398
+ const resourceNames = {};
28351
28399
  const scriptForOutput = /* @__PURE__ */ new Map();
28352
28400
  const copiedFiles = [];
28353
28401
  let generatedInfoPlist = false;
@@ -28517,13 +28565,14 @@ ${output2}`
28517
28565
  xcodePathResolver(project.objects, project.projectDir, import_node_path39.default.join, settings),
28518
28566
  (file) => isDirectory(file) ? walkFiles(file) : import_node_fs38.default.existsSync(file) ? [file] : [],
28519
28567
  import_node_path39.default.join,
28520
- (file, kind) => {
28568
+ (file, kind, bundleName) => {
28521
28569
  if (kind === "header") {
28522
28570
  headers.add(file);
28523
28571
  return;
28524
28572
  }
28525
28573
  if (kind === "resource") {
28526
28574
  resources.add(file);
28575
+ if (bundleName) resourceNames[file] = bundleName;
28527
28576
  return;
28528
28577
  }
28529
28578
  if (!import_node_fs38.default.existsSync(file)) {
@@ -28647,6 +28696,7 @@ ${output2}`
28647
28696
  return {
28648
28697
  sources: [...sources].sort(),
28649
28698
  resources: [...resources].sort(),
28699
+ resourceNames,
28650
28700
  copiedFiles,
28651
28701
  generatedInfoPlist,
28652
28702
  allSources: [...allSources].sort(),
@@ -29705,10 +29755,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
29705
29755
  byProduct.has(import_node_path39.default.basename(rawPath)))
29706
29756
  continue;
29707
29757
  const resolved = fileId ? project.resolvePath(fileId) : null;
29708
- if (fileId && resolved !== null && !import_node_fs38.default.existsSync(resolved))
29709
- throw new Error(
29710
- `${str(target.name) ?? "target"}: linked framework ${name3} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
29711
- );
29758
+ if (fileId && resolved !== null && !import_node_fs38.default.existsSync(resolved)) {
29759
+ if (!ios_sdk_frameworks_default.frameworks.includes(name3))
29760
+ throw new Error(
29761
+ `${str(target.name) ?? "target"}: linked framework ${name3} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
29762
+ );
29763
+ sdkFrameworks.add(name3);
29764
+ continue;
29765
+ }
29712
29766
  if (!binaryFrameworks.get(name3)) binaryFrameworks.set(name3, resolved);
29713
29767
  }
29714
29768
  }
@@ -29785,7 +29839,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
29785
29839
  ...linkedProducts.flatMap(
29786
29840
  ({ source }) => source.kind === "local" && import_node_fs38.default.existsSync(source.dir) ? [source.dir] : []
29787
29841
  ),
29788
- ...new Set(podSourceDirs)
29842
+ ...new Set(podSourceDirs),
29843
+ // a target's own files may sit beside the project, such as an asset
29844
+ // catalog one folder up, and xcode builds them from there
29845
+ ...new Set(
29846
+ [...module2.allSources, ...module2.resources].filter((file) => import_node_fs38.default.existsSync(file)).map((file) => import_node_path39.default.dirname(file))
29847
+ )
29789
29848
  ].map((dir) => import_node_fs38.default.realpathSync.native(dir))
29790
29849
  ),
29791
29850
  projectFiles: [
@@ -30894,7 +30953,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
30894
30953
  return hash.digest("hex");
30895
30954
  }
30896
30955
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
30897
- var STANDIN_SOURCE_DIGEST = true ? "70b9e9f32fde5739daaee933df31b2584f9ef3289c322a0f5b03f1eaac947880" : standinSourceDigest();
30956
+ var STANDIN_SOURCE_DIGEST = true ? "967c1c2a3b66ac640e0162783ed9e21b09ff285f8e1f7d4327b70416699e14c8" : standinSourceDigest();
30898
30957
 
30899
30958
  // src/swift-standins.ts
30900
30959
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -37085,6 +37144,17 @@ function isPackageSource(file) {
37085
37144
  function sourceFiles(root) {
37086
37145
  return packageFiles(root, false).filter(isPackageSource);
37087
37146
  }
37147
+ function xcodeFlatResources(app) {
37148
+ if (!app) return /* @__PURE__ */ new Set();
37149
+ return new Set(
37150
+ app.resources.filter(
37151
+ (file) => !Object.hasOwn(app.resourceNames, file) && !file.split(import_node_path54.default.sep).some((segment) => segment.endsWith(".xcassets"))
37152
+ )
37153
+ );
37154
+ }
37155
+ function bundleResourcePath(flatResources, disk, file) {
37156
+ return flatResources.has(disk) && !file.split("/").includes("Resources") ? `Resources/${file}` : file;
37157
+ }
37088
37158
  function resourceCandidateFiles(root) {
37089
37159
  return packageFiles(root, false).filter(
37090
37160
  (file) => !isPackageSource(file) && !file.endsWith(".xcconfig") && !["project.pbxproj", "project.xcproj", "Package.resolved"].includes(
@@ -37143,12 +37213,24 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
37143
37213
  const disk = byRelative.get(file);
37144
37214
  return !disk || !layout2?.targetDirs.get(disk)?.startsWith(`${XCODE_FRAMEWORKS_DIR}/`);
37145
37215
  });
37146
- const found = enumerateBundleImages(relative2, readContents2, (file) => {
37147
- const disk = byRelative.get(file);
37148
- if (!disk) throw new Error(`image source ${file} has no input file`);
37149
- const key2 = layout2 ? xcodeInputKey(layout2, disk, file) : file;
37150
- return swiftResourceBundleForFile(bundles, key2)?.path ?? ".";
37151
- });
37216
+ const flatResources = xcodeFlatResources(layout2?.app);
37217
+ const bundled = new Map(
37218
+ relative2.map((file) => [
37219
+ bundleResourcePath(flatResources, byRelative.get(file), file),
37220
+ file
37221
+ ])
37222
+ );
37223
+ const found = enumerateBundleImages(
37224
+ [...bundled.keys()],
37225
+ (file) => readContents2(bundled.get(file) ?? file),
37226
+ (marked) => {
37227
+ const file = bundled.get(marked) ?? marked;
37228
+ const disk = byRelative.get(file);
37229
+ if (!disk) throw new Error(`image source ${file} has no input file`);
37230
+ const key2 = layout2 ? xcodeInputKey(layout2, disk, file) : file;
37231
+ return swiftResourceBundleForFile(bundles, key2)?.path ?? ".";
37232
+ }
37233
+ ).map((image) => ({ ...image, file: bundled.get(image.file) ?? image.file }));
37152
37234
  const colors = enumerateBundleColors(catalogFiles, readContents2);
37153
37235
  const symbols = enumerateBundleSymbols(catalogFiles, readContents2, (file) => {
37154
37236
  const disk = byRelative.get(file);
@@ -37332,15 +37414,20 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
37332
37414
  }
37333
37415
  }
37334
37416
  const groups = /* @__PURE__ */ new Map();
37335
- const appResources = new Set(xcode?.app.resources ?? []);
37417
+ const flatResources = xcodeFlatResources(xcode?.app);
37336
37418
  for (const file of relative2) {
37337
37419
  const disk = import_node_path54.default.join(packagePath, ...file.split("/"));
37420
+ const folderName = xcode?.app.resourceNames[disk];
37421
+ if (folderName) {
37422
+ watched.push(file);
37423
+ addFile(folderName, readPackageFile2(packagePath, disk, limits.resourceBytes));
37424
+ continue;
37425
+ }
37338
37426
  const key2 = xcode ? xcodeInputKey(xcode, disk, file) : file;
37339
37427
  const bundle = swiftResourceBundleForFile(bundles, key2);
37340
37428
  const bundlePath = bundle?.path ?? ".";
37341
37429
  const group = groups.get(bundlePath) ?? /* @__PURE__ */ new Map();
37342
- const resource = appResources.has(disk) && !file.split("/").includes("Resources") ? `Resources/${file}` : file;
37343
- group.set(resource, disk);
37430
+ group.set(bundleResourcePath(flatResources, disk, file), disk);
37344
37431
  groups.set(bundlePath, group);
37345
37432
  }
37346
37433
  for (const bundle of bundles) {