peachsim 0.1.2385 → 0.1.2386

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 (82) 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/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +42 -29
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +41 -28
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +42 -29
  31. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +4 -4
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +4 -4
  47. package/dist-lib/native-app-identity-project.cjs +2 -2
  48. package/dist-lib/native-app-identity-project.mjs +2 -2
  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/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.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/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +42 -29
  68. package/dist-lib/swift-compile.cjs +34 -22
  69. package/dist-lib/swift-compile.mjs +34 -22
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +36 -24
  77. package/dist-lib/vite.cjs +4 -4
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/package.json +1 -1
  81. package/src/react-native-core-build.ts +2 -3
  82. package/src/swift-compile.ts +56 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2385",
3
+ "version": "0.1.2386",
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",
@@ -67,9 +67,7 @@ export async function buildReactNativeCore(
67
67
  producer.files['Sources/PeachCoreProducerHost/Dispatch.m'] =
68
68
  '#import <dispatch/dispatch.h>\nvoid peachTurboDispatchAsync(dispatch_block_t block) { dispatch_async(dispatch_get_main_queue(), block); }\n'
69
69
  }
70
- // only target archives are published; the producer never launches an app
71
- // window, and its link only proves the archives resolve, so it skips -Oz.
72
- const input = { ...collectTurboCompileInput(producer, null, floor), optimize: false }
70
+ const input = collectTurboCompileInput(producer, null, floor)
73
71
  input.files[input.entry] = input.entry.endsWith('.swift')
74
72
  ? '@main struct PeachCoreProducer { static func main() {} }\n'
75
73
  : 'int main() { return 0; }\n'
@@ -84,6 +82,7 @@ export async function buildReactNativeCore(
84
82
  moduleRoot: module.root,
85
83
  buildRoot,
86
84
  intermediates: true,
85
+ linkOnly: true,
87
86
  })
88
87
  const products = path.join(buildRoot, '.build', WASM_TRIPLE, 'release')
89
88
  const emitted = swiftManifestTargets(
@@ -347,6 +347,9 @@ export interface SwiftCompileOptions {
347
347
  intermediates?: boolean
348
348
  }
349
349
 
350
+ type SwiftProjectCompileOptions = SwiftCompileOptions &
351
+ ({ linkOnly?: never } | { linkOnly: true; intermediates: true })
352
+
350
353
  export interface SwiftCompileArtifact {
351
354
  hash: string
352
355
  bytes: Buffer
@@ -7330,10 +7333,18 @@ function retireStaleSwiftLink(root: string, stamp: string): boolean {
7330
7333
  }
7331
7334
 
7332
7335
  /** the project compiler shared by route hosts, Vite and source probes. */
7336
+ export function compileSwiftProjectUnit(
7337
+ input: SwiftCompileInput,
7338
+ options: SwiftCompileOptions & { linkOnly: true; intermediates: true },
7339
+ ): Promise<void>
7340
+ export function compileSwiftProjectUnit(
7341
+ input: SwiftCompileInput,
7342
+ options: SwiftCompileOptions & { linkOnly?: never },
7343
+ ): Promise<SwiftCompileArtifact>
7333
7344
  export async function compileSwiftProjectUnit(
7334
7345
  input: SwiftCompileInput,
7335
- options: SwiftCompileOptions,
7336
- ): Promise<SwiftCompileArtifact> {
7346
+ options: SwiftProjectCompileOptions,
7347
+ ): Promise<SwiftCompileArtifact | void> {
7337
7348
  // the shared checkout keeps landing while a builder hop waits in the heavy
7338
7349
  // window queue, so its sources can move past the hash this caller pinned.
7339
7350
  // rehashing and requesting again builds the sources that now exist.
@@ -7349,14 +7360,16 @@ export async function compileSwiftProjectUnit(
7349
7360
 
7350
7361
  function compileSwiftProjectOnce(
7351
7362
  input: SwiftCompileInput,
7352
- options: SwiftCompileOptions,
7353
- ): Promise<SwiftCompileArtifact> {
7363
+ options: SwiftProjectCompileOptions,
7364
+ ): Promise<SwiftCompileArtifact | void> {
7354
7365
  options.signal?.throwIfAborted()
7355
7366
  mkdirSync(options.buildRoot, { recursive: true })
7356
7367
  const root = realpathSync(options.buildRoot)
7357
7368
  const moduleRoot = path.resolve(options.moduleRoot)
7358
7369
  const distribution = swiftDistributionAt(moduleRoot)
7359
7370
  const guestGraph = distribution ? input.sourceLinkGraph : undefined
7371
+ if (options.linkOnly && guestGraph)
7372
+ throw new Error('swift-compile: link-only builds do not support guest image graphs')
7360
7373
  const layout: SwiftProjectLayout = {
7361
7374
  root,
7362
7375
  sources: path.join(root, 'Sources', 'App'),
@@ -7369,34 +7382,35 @@ function compileSwiftProjectOnce(
7369
7382
  console.error(`[swift-project ${hash.slice(0, 16)}] ${message}`)
7370
7383
  options.onStage?.(message)
7371
7384
  }
7372
- report('checking verified artifacts')
7373
7385
  return serialize(
7374
7386
  root,
7375
7387
  async () => {
7376
- // reuse one verified result across server restarts before admission or
7377
- // swiftpm. the address covers sources, framework inputs and toolchain.
7378
- const retained = retainedArtifacts.get(root)?.find((old) => old.hash === hash)
7379
- if (retained && !options.intermediates) {
7380
- report('reusing memory artifact')
7381
- return retain(root, retained)
7382
- }
7383
- const cached = readCompiledArtifact(path.join(sharedRoot, 'artifact'), hash)
7384
- // a build root the project user writes in cannot vouch for an artifact
7385
- const previous =
7386
- cached ??
7387
- (options.project ? null : readCompiledArtifact(path.join(root, 'artifact'), hash))
7388
- if (previous && !options.intermediates) {
7389
- if (cached) renewSharedArtifact(sharedRoot)
7390
- else saveSharedArtifact(sharedRoot, previous)
7391
- report('reusing verified disk artifact')
7392
- return retain(root, previous)
7388
+ if (!options.intermediates) {
7389
+ report('checking verified artifacts')
7390
+ const retained = retainedArtifacts.get(root)?.find((old) => old.hash === hash)
7391
+ if (retained) {
7392
+ report('reusing memory artifact')
7393
+ return retain(root, retained)
7394
+ }
7395
+ const cached = readCompiledArtifact(path.join(sharedRoot, 'artifact'), hash)
7396
+ // a build root the project user writes in cannot vouch for an artifact
7397
+ const previous =
7398
+ cached ??
7399
+ (options.project
7400
+ ? null
7401
+ : readCompiledArtifact(path.join(root, 'artifact'), hash))
7402
+ if (previous) {
7403
+ if (cached) renewSharedArtifact(sharedRoot)
7404
+ else saveSharedArtifact(sharedRoot, previous)
7405
+ report('reusing verified disk artifact')
7406
+ return retain(root, previous)
7407
+ }
7393
7408
  }
7394
7409
  // a live local or destination grant authorizes compilation here. a builder
7395
7410
  // returns only the artifact, so a caller that reads the local products builds here.
7396
7411
  if (
7397
7412
  !options.intermediates &&
7398
7413
  process.platform === 'darwin' &&
7399
- !options.intermediates &&
7400
7414
  process.env.TM_SESSION &&
7401
7415
  !windowAdmission() &&
7402
7416
  process.env.CI !== 'true' &&
@@ -7466,10 +7480,12 @@ function compileSwiftProjectOnce(
7466
7480
  async (lease) => {
7467
7481
  // a process that held the root while this one waited may have built
7468
7482
  // this exact address.
7469
- const built = readCompiledArtifact(path.join(sharedRoot, 'artifact'), hash)
7470
- if (built && !options.intermediates) {
7471
- report('reusing verified disk artifact')
7472
- return retain(root, built)
7483
+ if (!options.intermediates) {
7484
+ const built = readCompiledArtifact(path.join(sharedRoot, 'artifact'), hash)
7485
+ if (built) {
7486
+ report('reusing verified disk artifact')
7487
+ return retain(root, built)
7488
+ }
7473
7489
  }
7474
7490
  const swift = path.join(options.toolchainBin, 'swift')
7475
7491
  if (!existsSync(swift)) {
@@ -7511,7 +7527,9 @@ function compileSwiftProjectOnce(
7511
7527
  // memoized per toolchain, so only a process's first build waits on it,
7512
7528
  // and that one reads and gzips it while swift builds
7513
7529
  const sdk = swiftModuleSdk(frameworkRoot).wasmSdkId
7514
- const icu = swiftIcuAsset(options.toolchainBin, sdk)
7530
+ const icu = options.linkOnly
7531
+ ? null
7532
+ : swiftIcuAsset(options.toolchainBin, sdk)
7515
7533
  const buildOptions = {
7516
7534
  env: {
7517
7535
  ...(options.project?.env ?? process.env),
@@ -7684,7 +7702,9 @@ function compileSwiftProjectOnce(
7684
7702
  // its 8-byte placeholder would otherwise leave swiftpm seeing a fresh,
7685
7703
  // empty executable and skipping the link on the next build.
7686
7704
  rmSync(path.join(root, '.peach-link.rsp'), { force: true })
7687
- if (existsSync(linked) && statSync(linked).size <= 8)
7705
+ // archive producers reuse objects across compiler recipe changes,
7706
+ // so qualify each new entry with the current linker.
7707
+ if (options.linkOnly || (existsSync(linked) && statSync(linked).size <= 8))
7688
7708
  rmSync(linked, { force: true })
7689
7709
  report('compiling and linking Swift modules')
7690
7710
  const frameworkInterfaces = new Map<
@@ -7930,6 +7950,12 @@ function compileSwiftProjectOnce(
7930
7950
  undefined,
7931
7951
  resourceReferences,
7932
7952
  )
7953
+ if (options.linkOnly) {
7954
+ if (statSync(linked).size <= 8)
7955
+ throw new Error('swift-compile: deferred linker produced no executable')
7956
+ report('project link verified')
7957
+ return
7958
+ }
7933
7959
  const output = options.project
7934
7960
  ? projectOutputFile(root, linked, options.project)
7935
7961
  : linked
@@ -7960,7 +7986,7 @@ function compileSwiftProjectOnce(
7960
7986
  const artifact = {
7961
7987
  hash,
7962
7988
  bytes: readFileSync(optimized),
7963
- icu: await icu,
7989
+ icu: await icu!,
7964
7990
  }
7965
7991
  if (artifact.bytes.length <= 8)
7966
7992
  throw new Error('swift-compile: deferred linker produced no executable')