peachsim 0.1.936 → 0.1.938

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 (79) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/agent-identity.cjs +1 -1
  4. package/dist-lib/agent-sessions.cjs +1 -1
  5. package/dist-lib/attached-projects.cjs +1 -1
  6. package/dist-lib/auth/shared-session.cjs +1 -1
  7. package/dist-lib/backend-origin.cjs +1 -1
  8. package/dist-lib/beta.cjs +1 -1
  9. package/dist-lib/beta.mjs +1 -1
  10. package/dist-lib/bridge-constants.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.mjs +1 -1
  13. package/dist-lib/bridge-contract.cjs +1 -1
  14. package/dist-lib/bridge-contract.mjs +1 -1
  15. package/dist-lib/bundle-channel.cjs +50 -11
  16. package/dist-lib/capture-contract.cjs +1 -1
  17. package/dist-lib/capture-contract.mjs +1 -1
  18. package/dist-lib/cli-constants.cjs +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/detox/index.cjs +1 -1
  27. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  28. package/dist-lib/expo-swift-bundle.cjs +50 -11
  29. package/dist-lib/expo-swift-metadata.cjs +1 -1
  30. package/dist-lib/expo-swift-metadata.mjs +1 -1
  31. package/dist-lib/home-paths.cjs +1 -1
  32. package/dist-lib/host/bridge-host.cjs +50 -11
  33. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  35. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  36. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  37. package/dist-lib/host/websocket-proxy.cjs +1 -1
  38. package/dist-lib/index.cjs +5 -4
  39. package/dist-lib/jump-to-source-babel.cjs +1 -1
  40. package/dist-lib/jump-to-source-native.cjs +1 -1
  41. package/dist-lib/kotlin-host.cjs +1 -1
  42. package/dist-lib/menu.cjs +1 -1
  43. package/dist-lib/menu.mjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  46. package/dist-lib/metro-production-bundle.cjs +1 -1
  47. package/dist-lib/metro-production-bundle.mjs +1 -1
  48. package/dist-lib/metro.cjs +5 -4
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/plist.cjs +1 -1
  54. package/dist-lib/plist.mjs +1 -1
  55. package/dist-lib/profiles.cjs +1 -1
  56. package/dist-lib/public-brand.cjs +1 -1
  57. package/dist-lib/react-native-host-modules.cjs +1 -1
  58. package/dist-lib/react-native-host-modules.mjs +1 -1
  59. package/dist-lib/render-mode.cjs +1 -1
  60. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  61. package/dist-lib/sdk.cjs +1 -1
  62. package/dist-lib/sdk.mjs +1 -1
  63. package/dist-lib/skills.cjs +50 -11
  64. package/dist-lib/swift-compile.cjs +1 -1
  65. package/dist-lib/swift-compile.mjs +1 -1
  66. package/dist-lib/swift-package.cjs +1 -1
  67. package/dist-lib/swift-package.mjs +1 -1
  68. package/dist-lib/swift-submit.cjs +1 -1
  69. package/dist-lib/swift-submit.mjs +1 -1
  70. package/dist-lib/swift-toolchain.cjs +1 -1
  71. package/dist-lib/swift.cjs +1 -1
  72. package/dist-lib/vite-swift.cjs +50 -11
  73. package/dist-lib/vite.cjs +1 -1
  74. package/dist-lib/worklet-executable.cjs +1 -1
  75. package/dist-lib/worklet-executable.mjs +1 -1
  76. package/package.json +1 -1
  77. package/src/swift-host.ts +49 -7
  78. package/src/swift-standins.ts +18 -1
  79. package/src/xcode-project.ts +8 -5
package/src/swift-host.ts CHANGED
@@ -29,6 +29,7 @@ import { swiftImplicitResourcePaths, type SwiftPackageTarget } from './swift-pac
29
29
  import {
30
30
  REMOTE_CHECKOUTS,
31
31
  resolveSwiftPackages,
32
+ type SwiftPackageBinary,
32
33
  type SwiftPackageGap,
33
34
  type SwiftPackages,
34
35
  } from './swift-packages'
@@ -202,6 +203,8 @@ interface XcodeProjectEntry {
202
203
  standinKey: string
203
204
  packages: SwiftPackages
204
205
  standins: SwiftStandin[]
206
+ /** why a framework the project vendors got no stand-in, by name. */
207
+ projectGaps: Map<string, string>
205
208
  }
206
209
  }
207
210
 
@@ -233,7 +236,11 @@ export function openXcodeProject(
233
236
  function swiftPackages(
234
237
  entry: XcodeProjectEntry,
235
238
  app: XcodeAppTarget,
236
- ): { packages: SwiftPackages; standins: SwiftStandin[] } {
239
+ ): {
240
+ packages: SwiftPackages
241
+ standins: SwiftStandin[]
242
+ projectGaps: Map<string, string>
243
+ } {
237
244
  const stamp = (file: string | null) =>
238
245
  file && fs.existsSync(file) ? fs.statSync(file).mtimeMs : 0
239
246
  const key = JSON.stringify([
@@ -261,6 +268,7 @@ function swiftPackages(
261
268
  provided: entry.provided,
262
269
  }),
263
270
  standins: [],
271
+ projectGaps: new Map(),
264
272
  }
265
273
  entry.packages = cached
266
274
  }
@@ -269,7 +277,26 @@ function swiftPackages(
269
277
  // their reason with why no stand-in was built. surfaces peach already
270
278
  // ships are skipped up front, so no generated target overrides a shipped
271
279
  // module.
272
- const reached = cached.packages.binaries.filter((binary) => binary.reached)
280
+ // a framework the project vendors links straight into its target, so it
281
+ // stands in the same way a package's binary target does.
282
+ const vendored = app.binaryFrameworks.flatMap(({ name, path: dir }) =>
283
+ dir
284
+ ? [
285
+ {
286
+ target: name,
287
+ source: 'the project',
288
+ url: null,
289
+ checksum: null,
290
+ dir,
291
+ reached: true,
292
+ } satisfies SwiftPackageBinary,
293
+ ]
294
+ : [],
295
+ )
296
+ const reached = [
297
+ ...cached.packages.binaries.filter((binary) => binary.reached),
298
+ ...vendored,
299
+ ]
273
300
  if (entry.moduleRoot && entry.provided && reached.length > 0) {
274
301
  const resolved = swiftModuleToolchain(entry.moduleRoot)
275
302
  const toolchain = {
@@ -292,6 +319,12 @@ function swiftPackages(
292
319
  binaryGaps: built.gaps,
293
320
  })
294
321
  cached.standins = built.standins
322
+ cached.projectGaps = new Map(
323
+ vendored.flatMap(({ target }) => {
324
+ const gap = built.gaps.get(target)
325
+ return gap ? [[target, gap] as const] : []
326
+ }),
327
+ )
295
328
  cached.standinKey = generation
296
329
  }
297
330
  }
@@ -328,6 +361,8 @@ interface XcodeLayout {
328
361
  targets: (SwiftPackageTarget & { exclude: string[] })[]
329
362
  packages: SwiftPackages
330
363
  standins: SwiftStandin[]
364
+ /** why a framework the project vendors got no stand-in, by name. */
365
+ projectGaps: Map<string, string>
331
366
  /** the input directory each app and framework source compiles under. */
332
367
  targetDirs: Map<string, string>
333
368
  files: string[]
@@ -358,7 +393,7 @@ function xcodeLayout(root: string): XcodeLayout | null {
358
393
  mainActorIsolation: framework.mainActorIsolation,
359
394
  })
360
395
  }
361
- const { packages, standins } = swiftPackages(registered, app)
396
+ const { packages, standins, projectGaps } = swiftPackages(registered, app)
362
397
  for (const standin of standins)
363
398
  targets.push({
364
399
  name: standin.module,
@@ -401,6 +436,7 @@ function xcodeLayout(root: string): XcodeLayout | null {
401
436
  targets,
402
437
  packages,
403
438
  standins,
439
+ projectGaps,
404
440
  targetDirs,
405
441
  files: [...files].sort(),
406
442
  }
@@ -1052,10 +1088,16 @@ async function missingModulesMessage(
1052
1088
  ): Promise<string> {
1053
1089
  const layout = xcodeLayout(packagePath)
1054
1090
  const gaps = new Map<string, SwiftPackageGap>([
1055
- ...(layout?.app.binaryFrameworks ?? []).map(
1056
- (name) =>
1057
- [name, { source: 'the project', reason: 'a vendored binary framework' }] as const,
1058
- ),
1091
+ ...(layout?.app.binaryFrameworks ?? []).map(({ name }) => {
1092
+ const gap = layout?.projectGaps.get(name)
1093
+ return [
1094
+ name,
1095
+ {
1096
+ source: 'the project',
1097
+ reason: `a vendored binary framework${gap ? `; no stand-in: ${gap}` : ''}`,
1098
+ },
1099
+ ] as const
1100
+ }),
1059
1101
  ...[...missing.keys()].flatMap((name) =>
1060
1102
  UNPROVIDED_PLATFORM_MODULES[name]
1061
1103
  ? [
@@ -294,7 +294,21 @@ function peachModuleDirs(toolchain: Toolchain, imports: string[]): string[] {
294
294
  ],
295
295
  moduleRoot,
296
296
  )
297
- return [path.join(moduleRoot, '.build', TRIPLE, 'release', 'Modules')]
297
+ // a c target's module map sits in its own build directory, where swiftpm
298
+ // generated it; a peach module re-exporting one fails to load without it
299
+ const release = path.join(moduleRoot, '.build', TRIPLE, 'release')
300
+ return [
301
+ path.join(release, 'Modules'),
302
+ ...fs
303
+ .readdirSync(release)
304
+ .filter(
305
+ (name) =>
306
+ name.endsWith('.build') &&
307
+ fs.existsSync(path.join(release, name, 'module.modulemap')),
308
+ )
309
+ .sort()
310
+ .map((name) => path.join(release, name)),
311
+ ]
298
312
  }
299
313
 
300
314
  // an iOS interface read for wasm: its own flags target wasm, and objective-c
@@ -735,6 +749,9 @@ function binaryStandins(
735
749
  provided: ReadonlySet<string>,
736
750
  ): SwiftStandin[] | string {
737
751
  if (provided.has(binary.target)) return []
752
+ // a local artifact a build step writes is absent from a fresh checkout
753
+ if (!binary.url && !fs.existsSync(binary.dir))
754
+ return `${path.basename(binary.dir)} is not on disk; build or fetch it, then run again`
738
755
  let all: Surface[]
739
756
  let digest: string
740
757
  try {
@@ -154,8 +154,8 @@ export interface XcodeAppTarget extends XcodeModuleTarget {
154
154
  linkedProducts: SwiftLinkedProduct[]
155
155
  /** local package directories the workspace or a project references. */
156
156
  localPackageDirs: string[]
157
- /** prebuilt frameworks and xcframeworks the projects vendor and link, by name. */
158
- binaryFrameworks: string[]
157
+ /** prebuilt frameworks and xcframeworks the projects vendor and link, at their path when it resolves. */
158
+ binaryFrameworks: { name: string; path: string | null }[]
159
159
  /** the Package.resolved pinning the remote packages' revisions, when resolved. */
160
160
  packageResolved: string | null
161
161
  /** every application target in the workspace, for a chooser. */
@@ -911,7 +911,7 @@ export function readXcodeAppTarget(input: string, targetName?: string): XcodeApp
911
911
  ),
912
912
  ]
913
913
  const linkedProducts: SwiftLinkedProduct[] = []
914
- const binaryFrameworks = new Set<string>()
914
+ const binaryFrameworks = new Map<string, string | null>()
915
915
  for (const { project, target } of order) {
916
916
  const productDependencies = [
917
917
  ...list(target.packageProductDependencies),
@@ -963,7 +963,8 @@ export function readXcodeAppTarget(input: string, targetName?: string): XcodeApp
963
963
  tree === 'DEVELOPER_DIR'
964
964
  )
965
965
  continue
966
- binaryFrameworks.add(name)
966
+ const resolved = fileId ? project.resolvePath(fileId) : null
967
+ if (!binaryFrameworks.get(name)) binaryFrameworks.set(name, resolved)
967
968
  }
968
969
  }
969
970
  }
@@ -999,7 +1000,9 @@ export function readXcodeAppTarget(input: string, targetName?: string): XcodeApp
999
1000
  localPackageDirs: [
1000
1001
  ...new Set(localPackageDirs.map((dir) => fs.realpathSync(dir))),
1001
1002
  ].sort(),
1002
- binaryFrameworks: [...binaryFrameworks].sort(),
1003
+ binaryFrameworks: [...binaryFrameworks]
1004
+ .map(([name, file]) => ({ name, path: file }))
1005
+ .sort((left, right) => left.name.localeCompare(right.name)),
1003
1006
  packageResolved: fs.existsSync(resolvedFile) ? resolvedFile : null,
1004
1007
  appTargets: appTargetNames,
1005
1008
  }