peachsim 0.1.2390 → 0.1.2392

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 (90) hide show
  1. package/cli/commands/canvas.ts +92 -22
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/attached-projects.cjs +1 -1
  5. package/dist-lib/auth/shared-session.cjs +1 -1
  6. package/dist-lib/backend-origin.cjs +1 -1
  7. package/dist-lib/beta.cjs +1 -1
  8. package/dist-lib/beta.mjs +1 -1
  9. package/dist-lib/bridge-constants.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.mjs +1 -1
  12. package/dist-lib/bridge-contract.cjs +1 -1
  13. package/dist-lib/bridge-contract.mjs +1 -1
  14. package/dist-lib/bundle-channel.cjs +47 -31
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +1 -1
  17. package/dist-lib/cloud-contract.cjs +1 -1
  18. package/dist-lib/cloud-contract.mjs +1 -1
  19. package/dist-lib/cloud-test-args.cjs +1 -1
  20. package/dist-lib/cloud-test-args.mjs +1 -1
  21. package/dist-lib/cloud.cjs +1 -1
  22. package/dist-lib/cloud.mjs +1 -1
  23. package/dist-lib/config.cjs +1 -1
  24. package/dist-lib/config.mjs +1 -1
  25. package/dist-lib/detox/index.cjs +1 -1
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/expo-swift-bundle.cjs +46 -30
  28. package/dist-lib/expo-swift-metadata.cjs +1 -1
  29. package/dist-lib/expo-swift-metadata.mjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +47 -31
  32. package/dist-lib/host/fetch-proxy-handler.cjs +7 -5
  33. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  35. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  36. package/dist-lib/host/websocket-proxy.cjs +1 -1
  37. package/dist-lib/index.cjs +10 -7
  38. package/dist-lib/jump-to-source-babel.cjs +1 -1
  39. package/dist-lib/jump-to-source-native.cjs +1 -1
  40. package/dist-lib/kotlin-host.cjs +1 -1
  41. package/dist-lib/menu.cjs +1 -1
  42. package/dist-lib/menu.mjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  45. package/dist-lib/metro-production-bundle.cjs +1 -1
  46. package/dist-lib/metro-production-bundle.mjs +1 -1
  47. package/dist-lib/metro.cjs +10 -7
  48. package/dist-lib/native-app-identity-project.cjs +5 -4
  49. package/dist-lib/native-app-identity-project.mjs +5 -4
  50. package/dist-lib/native-app-identity.cjs +1 -1
  51. package/dist-lib/native-app-identity.mjs +1 -1
  52. package/dist-lib/native-firebase-metadata.cjs +1 -1
  53. package/dist-lib/native-firebase-metadata.mjs +1 -1
  54. package/dist-lib/pdfium-raster.cjs +1 -1
  55. package/dist-lib/pdfium-raster.mjs +1 -1
  56. package/dist-lib/plist.cjs +1 -1
  57. package/dist-lib/plist.mjs +1 -1
  58. package/dist-lib/profiles.cjs +1 -1
  59. package/dist-lib/public-brand.cjs +1 -1
  60. package/dist-lib/public-origins-lib-esm.json +24 -24
  61. package/dist-lib/public-origins-lib.json +53 -53
  62. package/dist-lib/react-native-host-modules.cjs +1 -1
  63. package/dist-lib/react-native-host-modules.mjs +1 -1
  64. package/dist-lib/reap-browser.cjs +1 -1
  65. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  66. package/dist-lib/sdk.cjs +1 -1
  67. package/dist-lib/sdk.mjs +1 -1
  68. package/dist-lib/skills.cjs +52 -31
  69. package/dist-lib/swift-compile.cjs +1 -1
  70. package/dist-lib/swift-compile.mjs +1 -1
  71. package/dist-lib/swift-package.cjs +1 -1
  72. package/dist-lib/swift-package.mjs +1 -1
  73. package/dist-lib/swift-submit.cjs +1 -1
  74. package/dist-lib/swift-submit.mjs +1 -1
  75. package/dist-lib/swift-toolchain.cjs +1 -1
  76. package/dist-lib/swift.cjs +1 -1
  77. package/dist-lib/vite-swift.cjs +44 -28
  78. package/dist-lib/vite.cjs +7 -5
  79. package/dist-lib/worklet-executable.cjs +1 -1
  80. package/dist-lib/worklet-executable.mjs +1 -1
  81. package/dist-types/packages/peach-engine/src/engine/metalDirectContract.d.ts +5 -0
  82. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +15 -6
  83. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -6
  84. package/kotlin/sdk.tar.gz +0 -0
  85. package/node-runtime.json +1 -1
  86. package/package.json +1 -1
  87. package/src/swift-host.ts +5 -5
  88. package/src/swift-shipped-binaries.ts +17 -6
  89. package/src/swift-standins.ts +39 -23
  90. package/src/xcode-project.ts +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2390",
3
+ "version": "0.1.2392",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
package/src/swift-host.ts CHANGED
@@ -97,7 +97,7 @@ import { readSwiftStandinBehavior } from './swift-standin-config'
97
97
  import {
98
98
  standinGenerationInputs,
99
99
  standinLibrary,
100
- standinModuleSources,
100
+ standinDependencies,
101
101
  swiftStandins,
102
102
  type SwiftStandin,
103
103
  type SwiftStandins,
@@ -681,6 +681,7 @@ async function swiftPackages(
681
681
  binary.publicHeaders === undefined || binary.unloweredSources !== undefined
682
682
  const artifacts = reached.filter(standinArtifact)
683
683
  if (entry.moduleRoot && entry.provided && artifacts.length > 0) {
684
+ const { provided } = entry
684
685
  const resolved = swiftModuleToolchain(entry.moduleRoot)
685
686
  const toolchain = {
686
687
  moduleRoot: entry.moduleRoot,
@@ -705,10 +706,9 @@ async function swiftPackages(
705
706
  const cxxArtifacts = reached.filter(
706
707
  (binary) => standinArtifact(binary) && !portableAssembly.has(binary.target),
707
708
  )
708
- // a source module an artifact imports builds with its stand-ins and never stands in
709
709
  const standinInputs = [
710
710
  ...cxxArtifacts,
711
- ...standinModuleSources(cxxArtifacts, cached.packages.moduleSources),
711
+ ...standinDependencies(cxxArtifacts, cached.packages, provided),
712
712
  ]
713
713
  const generation = standinGenerationInputs(standinInputs, toolchain, entry.behavior)
714
714
  if (cached.standinKey !== generation) {
@@ -721,7 +721,7 @@ async function swiftPackages(
721
721
  const built = await swiftStandins(
722
722
  standinInputs,
723
723
  toolchain,
724
- new Set([...entry.provided].filter((name) => !replaced.has(name))),
724
+ new Set([...provided].filter((name) => !replaced.has(name))),
725
725
  entry.behavior,
726
726
  )
727
727
  cached.packages = await resolveSwiftPackagesAsync({
@@ -732,7 +732,7 @@ async function swiftPackages(
732
732
  // an artifact with neither a stand-in nor a gap ships only modules
733
733
  // peach provides, so a wrapper target that groups it still compiles
734
734
  provided: new Set([
735
- ...entry.provided,
735
+ ...provided,
736
736
  ...cxxArtifacts
737
737
  .map((binary) => binary.target)
738
738
  .filter((target) => !built.gaps.has(target)),
@@ -4,13 +4,24 @@ import archives from './swift-shipped-archives.json' with { type: 'json' }
4
4
  // (scripts/debug/swift-binary-standin-generate.ts writes the table). a package pinning a
5
5
  // different archive gets its own stand-in, since the shipped module declares another version's API.
6
6
  const SHIPPED_ARCHIVES = new Map<string, string>(Object.entries(archives))
7
- const SHIPPED_CHECKSUMS = new Set(SHIPPED_ARCHIVES.values())
7
+ const SHIPPED_MODULES = new Map(
8
+ [...SHIPPED_ARCHIVES].map(([module, checksum]) => [checksum, module]),
9
+ )
10
+
11
+ export function shippedBinaryModule(
12
+ target: string,
13
+ checksum: string | null,
14
+ ): string | undefined {
15
+ if (checksum === null) return undefined
16
+ const namedArchive = SHIPPED_ARCHIVES.get(target)
17
+ return namedArchive === undefined
18
+ ? SHIPPED_MODULES.get(checksum)
19
+ : namedArchive === checksum
20
+ ? target
21
+ : undefined
22
+ }
8
23
 
9
24
  /** compare the archive even when a package target aliases its module name. */
10
25
  export function shippedBinaryDiffers(target: string, checksum: string | null): boolean {
11
- const shipped = SHIPPED_ARCHIVES.get(target)
12
- return (
13
- checksum !== null &&
14
- (shipped !== undefined ? checksum !== shipped : !SHIPPED_CHECKSUMS.has(checksum))
15
- )
26
+ return checksum !== null && shippedBinaryModule(target, checksum) === undefined
16
27
  }
@@ -60,9 +60,13 @@ import {
60
60
  swiftManifestDeclarations,
61
61
  swiftTargetModuleName,
62
62
  } from './swift-package'
63
- import { swiftBinaryOnDisk, type SwiftPackageBinary } from './swift-packages'
63
+ import {
64
+ swiftBinaryOnDisk,
65
+ type SwiftPackageBinary,
66
+ type SwiftPackages,
67
+ } from './swift-packages'
64
68
  import { swiftSharedSdkRoot } from './swift-shared-sdk'
65
- import { shippedBinaryDiffers } from './swift-shipped-binaries'
69
+ import { shippedBinaryDiffers, shippedBinaryModule } from './swift-shipped-binaries'
66
70
  import { withBuiltinStandinBehavior } from './swift-standin-builtin-behavior'
67
71
  import { STANDIN_SOURCE_DIGEST, standinSourceDigest } from './swift-standin-digest'
68
72
  import {
@@ -3276,21 +3280,33 @@ async function binaryStandins(
3276
3280
  return settle(result)
3277
3281
  }
3278
3282
 
3279
- /** the source targets whose modules the binaries' interfaces and headers
3280
- * import, with the source targets those import in turn. */
3281
- export function standinModuleSources(
3283
+ /** the source targets and provided archives that binary declarations import. */
3284
+ export function standinDependencies(
3282
3285
  binaries: readonly SwiftPackageBinary[],
3283
- candidates: readonly SwiftPackageBinary[],
3286
+ packages: Pick<SwiftPackages, 'binaries' | 'moduleSources'>,
3287
+ provided: ReadonlySet<string>,
3284
3288
  ): SwiftPackageBinary[] {
3285
- const byModule = new Map(
3286
- candidates.map((candidate) => [swiftTargetModuleName(candidate.target), candidate]),
3287
- )
3289
+ const byModule = new Map<string, SwiftPackageBinary>()
3290
+ for (const candidate of packages.binaries) {
3291
+ if (candidate.reached) continue
3292
+ const module = shippedBinaryModule(candidate.target, candidate.checksum)
3293
+ if (module !== undefined && provided.has(module)) byModule.set(module, candidate)
3294
+ }
3295
+ for (const candidate of packages.moduleSources)
3296
+ byModule.set(swiftTargetModuleName(candidate.target), candidate)
3288
3297
  const shipped = new Set<string>()
3289
3298
  const pending: string[] = []
3290
3299
  const read = (dir: string, sources: readonly string[]) =>
3291
3300
  sources.flatMap((source) =>
3292
3301
  swiftImportNames(fs.readFileSync(path.join(dir, source), 'utf8')),
3293
3302
  )
3303
+ const binarySurfaces = (binary: SwiftPackageBinary) => {
3304
+ try {
3305
+ return surfaces(swiftBinaryFramework(binary).dir, binary.target)
3306
+ } catch {
3307
+ return []
3308
+ }
3309
+ }
3294
3310
  for (const binary of binaries) {
3295
3311
  if (binary.placeholder !== undefined) {
3296
3312
  shipped.add(swiftTargetModuleName(binary.target))
@@ -3298,13 +3314,7 @@ export function standinModuleSources(
3298
3314
  continue
3299
3315
  }
3300
3316
  if (binary.publicHeaders !== undefined) continue
3301
- let found: Surface[]
3302
- try {
3303
- found = surfaces(swiftBinaryFramework(binary).dir, binary.target)
3304
- } catch {
3305
- continue
3306
- }
3307
- for (const surface of found) {
3317
+ for (const surface of binarySurfaces(binary)) {
3308
3318
  shipped.add(surface.module)
3309
3319
  pending.push(...surfaceImports(surface))
3310
3320
  }
@@ -3314,7 +3324,11 @@ export function standinModuleSources(
3314
3324
  const candidate = byModule.get(module)
3315
3325
  if (!candidate || shipped.has(module) || selected.has(module)) continue
3316
3326
  selected.set(module, candidate)
3317
- pending.push(...read(candidate.dir, candidate.moduleSources?.sources ?? []))
3327
+ pending.push(
3328
+ ...(candidate.moduleSources
3329
+ ? read(candidate.dir, candidate.moduleSources.sources)
3330
+ : binarySurfaces(candidate).flatMap(surfaceImports)),
3331
+ )
3318
3332
  }
3319
3333
  return [...selected.values()]
3320
3334
  }
@@ -3390,12 +3404,14 @@ async function buildStandins(
3390
3404
  provided: ReadonlySet<string>,
3391
3405
  behavior: SwiftStandinBehaviors,
3392
3406
  ): Promise<SwiftStandins> {
3393
- const requested = binaries.filter(
3394
- (binary) =>
3395
- !provided.has(binary.target) ||
3396
- shippedBinaryDiffers(binary.target, binary.checksum),
3407
+ if (
3408
+ binaries.every(
3409
+ (binary) =>
3410
+ provided.has(binary.target) &&
3411
+ !shippedBinaryDiffers(binary.target, binary.checksum),
3412
+ )
3397
3413
  )
3398
- if (requested.length === 0) return { standins: [], gaps: new Map() }
3414
+ return { standins: [], gaps: new Map() }
3399
3415
  if (
3400
3416
  process.platform === 'darwin' &&
3401
3417
  process.env.TM_EXEC_BUILD_PLATFORM !== 'mac' &&
@@ -3404,7 +3420,7 @@ async function buildStandins(
3404
3420
  toolchain.moduleRoot === sourceSwiftCheckout() &&
3405
3421
  !swiftDistributionAt(toolchain.moduleRoot)
3406
3422
  )
3407
- return sourceStandins(requested, toolchain, provided, behavior)
3423
+ return sourceStandins(binaries, toolchain, provided, behavior)
3408
3424
  const standins: SwiftStandin[] = []
3409
3425
  const gaps = new Map<string, string>()
3410
3426
  fs.mkdirSync(cacheDir, { recursive: true })
@@ -1440,7 +1440,9 @@ function targetMembers(
1440
1440
  'IntentDefinitionCompiled',
1441
1441
  definition.split(path.sep).findLast((part) => part.endsWith('.lproj')) ?? '',
1442
1442
  )
1443
- fs.rmSync(compiled, { recursive: true, force: true })
1443
+ // definitions in one localization share this directory
1444
+ const compiledDefinition = path.join(compiled, path.basename(definition))
1445
+ fs.rmSync(compiledDefinition, { force: true })
1444
1446
  fs.mkdirSync(compiled, { recursive: true })
1445
1447
  // runner-toolchain-platform: darwin
1446
1448
  execFileSync(
@@ -1461,7 +1463,7 @@ function targetMembers(
1461
1463
  timeout: runScriptTimeoutMs,
1462
1464
  },
1463
1465
  )
1464
- resources.add(path.join(compiled, path.basename(definition)))
1466
+ resources.add(compiledDefinition)
1465
1467
  projectInputs.add(definition)
1466
1468
  for (const file of walkFiles(output)) {
1467
1469
  allSources.add(file)