peachsim 0.1.1873 → 0.1.1875

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 (92) hide show
  1. package/cli/commands/do-chain.ts +1 -1
  2. package/cli/commands/inspect/settling.ts +132 -92
  3. package/cli/outbound-endpoints.ts +4 -0
  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 +53 -21
  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 +141 -102
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +32 -15
  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 +49 -21
  34. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  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 +120 -94
  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 +2 -2
  50. package/dist-lib/native-app-identity-project.cjs +1 -1
  51. package/dist-lib/native-app-identity-project.mjs +1 -1
  52. package/dist-lib/native-app-identity.cjs +1 -1
  53. package/dist-lib/native-app-identity.mjs +1 -1
  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 +24 -24
  63. package/dist-lib/public-origins-lib.json +53 -53
  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 +119 -93
  69. package/dist-lib/sdk.mjs +119 -93
  70. package/dist-lib/skills.cjs +163 -111
  71. package/dist-lib/swift-compile.cjs +1 -1
  72. package/dist-lib/swift-compile.mjs +1 -1
  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 +1 -1
  80. package/dist-lib/vite.cjs +2 -2
  81. package/dist-lib/worklet-executable.cjs +1 -1
  82. package/dist-lib/worklet-executable.mjs +1 -1
  83. package/package.json +1 -1
  84. package/runtime-companion.json +1 -1
  85. package/skills/contrast/SKILL.md +3 -2
  86. package/src/expo-native-prebuilt.ts +4 -2
  87. package/src/native-bundles.ts +5 -1
  88. package/src/nitroContract.ts +43 -12
  89. package/src/sim-client.ts +4 -2
  90. package/src/swift-host.ts +5 -1
  91. package/src/turbo-bundle.ts +14 -1
  92. package/src/turbo-source.ts +4 -3
@@ -147,26 +147,57 @@ function readCompiledMetadata<Package extends CompiledPackage>(
147
147
  export const readNitroMetadata = (value: unknown): NitroCompiledModule | null =>
148
148
  readCompiledMetadata('Nitro', value, readNitroPackage, (entry) => entry.hybridObjects)
149
149
  export function readTurboMetadata(value: unknown): TurboCompiledModule | null {
150
- const metadata = readCompiledMetadata(
151
- 'TurboModule',
152
- value,
153
- readCompiledPackage,
154
- () => [],
150
+ if (value === null || value === undefined) return null
151
+ if (
152
+ typeof value !== 'object' ||
153
+ Array.isArray(value) ||
154
+ Reflect.get(value, 'platform') !== NITRO_GUEST_PLATFORM
155
155
  )
156
- if (!metadata) return null
157
- const listed = Reflect.get(Object(value), 'unavailable')
158
- if (listed === undefined) return metadata
159
- if (!Array.isArray(listed)) throw new Error('invalid TurboModule compilation metadata')
160
- const unavailable = listed.map((entry) => {
156
+ throw new Error('invalid TurboModule compilation metadata')
157
+ const listed: unknown = Reflect.get(value, 'unavailable')
158
+ if (listed !== undefined && !Array.isArray(listed))
159
+ throw new Error('invalid TurboModule compilation metadata')
160
+ const unavailable = listed?.map((entry: unknown) => {
161
161
  if (
162
162
  !isRecord(entry) ||
163
163
  typeof entry.name !== 'string' ||
164
- typeof entry.diagnostic !== 'string'
164
+ !entry.name ||
165
+ typeof entry.diagnostic !== 'string' ||
166
+ !entry.diagnostic
165
167
  )
166
168
  throw new Error('invalid TurboModule compilation metadata')
167
169
  return { name: entry.name, diagnostic: entry.diagnostic }
168
170
  })
169
- return { ...metadata, unavailable }
171
+ const packages = Reflect.get(value, 'packages')
172
+ const packed = Reflect.get(value, 'bundleFiles')
173
+ if (
174
+ Array.isArray(packages) &&
175
+ packages.length === 0 &&
176
+ unavailable &&
177
+ unavailable.length > 0 &&
178
+ Reflect.get(value, 'url') === '' &&
179
+ Reflect.get(value, 'hash') === '' &&
180
+ Reflect.get(value, 'icuUrl') === '' &&
181
+ isRecord(packed) &&
182
+ Object.keys(packed).length === 0
183
+ ) {
184
+ return {
185
+ platform: 'ios',
186
+ packages: [],
187
+ url: '',
188
+ hash: '',
189
+ icuUrl: '',
190
+ bundleFiles: {},
191
+ unavailable,
192
+ }
193
+ }
194
+ const metadata = readCompiledMetadata(
195
+ 'TurboModule',
196
+ value,
197
+ readCompiledPackage,
198
+ () => [],
199
+ )
200
+ return metadata && (unavailable ? { ...metadata, unavailable } : metadata)
170
201
  }
171
202
 
172
203
  export function readNitroFooter(source: string): NitroCompiledModule | null {
package/src/sim-client.ts CHANGED
@@ -364,15 +364,17 @@ export class SimClient implements WsBridge, InspectBridge {
364
364
  * wait for layout/animation/transition settle after an interaction.
365
365
  * a still-busy guest returns settled false with its own elapsed time.
366
366
  * a failed idle read throws IdleObservationError with the host elapsed
367
- * time and the original failure.
367
+ * time and the original failure. motionOnly waits on pushed render activity
368
+ * and screen transitions alone, the settle that follows a gesture.
368
369
  */
369
370
  settle(
370
- opts: { maxMs?: number; strict?: boolean } = {},
371
+ opts: { maxMs?: number; strict?: boolean; motionOnly?: boolean } = {},
371
372
  ): Promise<WaitForSootsimIdleResult> {
372
373
  return waitForSootsimIdle({
373
374
  bridge: this,
374
375
  maxMs: opts.maxMs ?? 3_000,
375
376
  strict: opts.strict,
377
+ ...(opts.motionOnly ? { motionOnly: true, pollMs: 32, stablePolls: 2 } : {}),
376
378
  })
377
379
  }
378
380
 
package/src/swift-host.ts CHANGED
@@ -2110,8 +2110,12 @@ export function sourceContentStamp(
2110
2110
  hash.update(JSON.stringify(projects().get(packagePath)?.nativeFiles ?? {}))
2111
2111
  hash.update(JSON.stringify(projects().get(packagePath)?.resourceBundles ?? []))
2112
2112
  hash.update(JSON.stringify(projects().get(packagePath)?.bundleFiles ?? null))
2113
+ // packageFiles answers canonical paths; a temporary build copy sits under a
2114
+ // linked directory on macOS, and relative to the link its names would carry
2115
+ // this process's copy directory.
2116
+ const root = fs.realpathSync(packagePath)
2113
2117
  for (const file of [...new Set(packageFiles(packagePath))].sort()) {
2114
- hash.update(path.relative(packagePath, file))
2118
+ hash.update(path.relative(root, file))
2115
2119
  hash.update(fs.readFileSync(file))
2116
2120
  }
2117
2121
  hash.update(moduleStamp(packagePath, moduleRootOverride, false))
@@ -65,7 +65,20 @@ export async function compileTurboApp(
65
65
  const compiled = providers.filter(({ name }) => !installed?.unavailable.has(name))
66
66
  if (compiled.length === 0) {
67
67
  for (const { diagnostic } of unavailable) console.warn(`[peach] ${diagnostic}`)
68
- return null
68
+ return unavailable.length > 0
69
+ ? {
70
+ artifact: null,
71
+ metadata: {
72
+ platform: 'ios',
73
+ packages: [],
74
+ url: '',
75
+ hash: '',
76
+ icuUrl: '',
77
+ bundleFiles: {},
78
+ unavailable,
79
+ },
80
+ }
81
+ : null
69
82
  }
70
83
  const { artifact, collection } = await compileTurboModule({
71
84
  appRoot,
@@ -139,9 +139,10 @@ export function registersReactModule(source: string): boolean {
139
139
  }
140
140
 
141
141
  function fabricComponents(root: string): boolean {
142
- const manifest: unknown = JSON.parse(
143
- fs.readFileSync(path.join(root, 'package.json'), 'utf8'),
144
- )
142
+ // an app-local Expo module has no manifest, so no codegen config
143
+ const manifestPath = path.join(root, 'package.json')
144
+ if (!fs.existsSync(manifestPath)) return false
145
+ const manifest: unknown = JSON.parse(fs.readFileSync(manifestPath, 'utf8'))
145
146
  if (!object(manifest) || !object(manifest.codegenConfig)) return false
146
147
  // codegen's third-party component generator excludes only module libraries;
147
148
  // component classes may come from ios.components or native annotations.