peachsim 0.1.1619 → 0.1.1625
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.
- package/README.md +35 -5
- package/cli/app-fonts.ts +2 -1
- package/cli/bridge-flow-runner.ts +222 -175
- package/cli/cloud-client.ts +81 -48
- package/cli/commands/box/search-command.ts +3 -2
- package/cli/commands/box.ts +10 -29
- package/cli/commands/control.ts +108 -43
- package/cli/commands/inspect/settling.ts +57 -20
- package/cli/commands/maestro-compare.ts +11 -32
- package/cli/commands/platform.ts +74 -17
- package/cli/commands/record.ts +20 -15
- package/cli/commands/upload.ts +5 -1
- package/cli/dev-build-freshness.ts +37 -2
- package/cli/drivers/playwright-sim-host.ts +18 -6
- package/cli/maestro-accessibility.ts +53 -0
- package/cli/maestro-compare.ts +24 -0
- package/cli/outbound-endpoints.ts +27 -8
- package/cli/parent-pid.ts +0 -9
- package/cli/remote-simulators.ts +112 -0
- package/cli/remoteSimulatorContract.ts +21 -0
- package/detox/expectations.ts +5 -1
- package/detox/index.ts +133 -98
- package/detox/motion-change.cjs +37 -0
- package/detox/motion-change.d.cts +16 -0
- package/detox/navigation-lifecycle.ts +22 -4
- package/dist-lib/agent-daemon-client.cjs +3 -2
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +3 -2
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +1528 -937
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +4 -3
- package/dist-lib/cloud.mjs +4 -3
- package/dist-lib/config.cjs +5 -4
- package/dist-lib/config.mjs +5 -4
- package/dist-lib/detox/index.cjs +1021 -364
- package/dist-lib/dev-bundle-resolution.cjs +51 -23
- package/dist-lib/expo-swift-bundle.cjs +1351 -804
- package/dist-lib/expo-swift-metadata.cjs +5 -4
- package/dist-lib/expo-swift-metadata.mjs +5 -4
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +2475 -1343
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1269 -300
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +3 -2
- package/dist-lib/menu.mjs +3 -2
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +5 -4
- package/dist-lib/metro-production-bundle.mjs +5 -4
- package/dist-lib/metro.cjs +806 -398
- package/dist-lib/native-app-identity-project.cjs +729 -21
- package/dist-lib/native-app-identity-project.mjs +728 -21
- package/dist-lib/native-app-identity.cjs +232 -9
- package/dist-lib/native-app-identity.mjs +230 -8
- package/dist-lib/native-firebase-metadata.cjs +5 -4
- package/dist-lib/native-firebase-metadata.mjs +5 -4
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +3 -2
- package/dist-lib/react-native-host-modules.cjs +4 -1
- package/dist-lib/react-native-host-modules.mjs +4 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +94 -28
- package/dist-lib/sdk.cjs +89 -24
- package/dist-lib/sdk.mjs +89 -24
- package/dist-lib/skills.cjs +4471 -2394
- package/dist-lib/swift-compile.cjs +336 -145
- package/dist-lib/swift-compile.mjs +350 -150
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +891 -557
- package/dist-lib/vite.cjs +68 -14
- package/dist-lib/worklet-executable.cjs +25 -2
- package/dist-lib/worklet-executable.mjs +25 -2
- package/package.json +2 -2
- package/scripts/dev-server-scanner.ts +33 -13
- package/src/admitted-mac-build.ts +34 -8
- package/src/android-app-identity.ts +146 -0
- package/src/android-autolinking.ts +75 -0
- package/src/android-string-value.ts +36 -0
- package/src/android-strings.ts +5 -36
- package/src/androidAutolinkingContract.ts +40 -0
- package/src/bundleGlobalFooter.ts +26 -7
- package/src/cloud.ts +2 -2
- package/src/codex-client.ts +3 -2
- package/src/dev-bundle-resolution.ts +58 -25
- package/src/expo-kotlin-host.ts +6 -36
- package/src/expo-swift-bundle.ts +17 -12
- package/src/expo-swift-host.ts +477 -173
- package/src/expoSwiftContract.ts +6 -0
- package/src/host/bridge-host.ts +7 -55
- package/src/host/staged-host-files.ts +29 -2
- package/src/installed-package-versions.ts +54 -14
- package/src/launchMetadataContract.ts +24 -0
- package/src/metro-plugin.ts +37 -42
- package/src/native-app-identity-project.ts +118 -3
- package/src/native-app-identity.ts +103 -11
- package/src/nitro-compile.ts +2 -5
- package/src/nitro-source.ts +147 -63
- package/src/process-group.ts +90 -60
- package/src/process-output.ts +0 -9
- package/src/public-brand.ts +1 -0
- package/src/react-native-host-modules.ts +3 -0
- package/src/sim-client.ts +6 -4
- package/src/swift-compile.ts +185 -31
- package/src/swift-distribution.lock.json +37 -11
- package/src/swift-distribution.ts +61 -9
- package/src/swift-host.ts +58 -27
- package/src/swift-objc-standin.ts +13 -0
- package/src/swift-standin-emit.ts +1 -1
- package/src/swift-standins.ts +17 -5
- package/src/vite-plugin.ts +8 -19
- package/src/worklet-executable.ts +30 -3
- package/src/worklets-babel.ts +35 -14
- package/src/xcode-project.ts +10 -0
package/README.md
CHANGED
|
@@ -231,6 +231,11 @@ actions discover the sim's owning world. Each world probe has one two-second
|
|
|
231
231
|
wall deadline covering both connection and response. An inferred default port
|
|
232
232
|
does not override the named sim's world.
|
|
233
233
|
|
|
234
|
+
Bridge sockets use TCP keepalive so a governor-stopped browser can resume an
|
|
235
|
+
in-flight render without losing its connection to an unanswered application
|
|
236
|
+
ping. Command deadlines still bound stalled work; idle leases and abandoned
|
|
237
|
+
sim cleanup remain separate from transport liveness.
|
|
238
|
+
|
|
234
239
|
**The sim** is a browser/Electron *page* launched by a CLI driver. Inside that
|
|
235
240
|
page run three workers: the **shell worker** owns device and native state, the
|
|
236
241
|
**compositor worker** paints every visible CanvasKit surface, and the **tenant
|
|
@@ -279,7 +284,7 @@ therefore runs before assertions in each flow.
|
|
|
279
284
|
| runtime delivery + Peach home | Versioned engine runtime management. The shared machinery owns manifest fetch, sha256 verification, channels, and auto-update. Peach binds it to `https://contrast.dev` and `~/.peach/runtimes/<version>`. A repo can select `runtimeVersion` without changing the machine default. | `src/runtime-delivery.ts`, `packages/contrast-runtime-delivery/`, `src/home-paths.ts`, `src/runtime-assets.ts` |
|
|
280
285
|
| standalone CLI delivery | Cached stable-version checks, bounded interactive notices, and verified atomic executable replacement. | `cli/cli-update.ts`, `cli/commands/upgrade.ts`, `cli/commands/version.ts`, `src/cli-version.ts` |
|
|
281
286
|
| `peachsim/vite` + `peachsim/metro` (runtime serving) | Published bundler plugins. Both serve the installed engine runtime at `/__peachsim/` from `~/.peach/runtimes/<version>` so an app's own dev server can host the sim shell; the Vite plugin can opt into a named Electron window. | `src/vite-plugin-one.ts`, `src/metro-plugin.ts`, `src/runtime-assets.ts` |
|
|
282
|
-
| `sootsim()` vite resolver plugin (internal) | The large RN-resolution / native-stub vite plugin: aliases `react-native` to the engine shim, native packages to `@sootsim/compat` stubs, applies worklets/babel transforms
|
|
287
|
+
| `sootsim()` vite resolver plugin (internal) | The large RN-resolution / native-stub vite plugin: aliases `react-native` to the engine shim, native packages to `@sootsim/compat` stubs, and applies worklets/babel transforms. Distinct from the published `peachsim/vite` export. | `src/vite-plugin.ts`, `src/worklets-babel.ts`, `packages/peach-compat/src/stub-manifest.ts` |
|
|
283
288
|
| skills registry | Peach agent skills (`peach-setup`, `peach-debug`, `peach-test`, `peach-visual`, and the generated `contrast` index) installable with `peach skill`. | `skills/*.md`, `src/skills/registry.ts`, `src/skills/types.ts` |
|
|
284
289
|
|
|
285
290
|
## Getting started
|
|
@@ -510,8 +515,8 @@ a supported input; pass Peach the JavaScript bundle produced before Hermes
|
|
|
510
515
|
compilation.
|
|
511
516
|
|
|
512
517
|
If an app has unusual dependencies or fingerprint inference fails, you can
|
|
513
|
-
optionally wrap your Metro configuration with `withPeach(config)`. It
|
|
514
|
-
|
|
518
|
+
optionally wrap your Metro configuration with `withPeach(config)`. It enables
|
|
519
|
+
two integrations:
|
|
515
520
|
|
|
516
521
|
1. **Deterministic module identity:** appends Metro's exact module identity map
|
|
517
522
|
as a trailing `globalThis.__sootsimModulePaths = { ... }` footer to every
|
|
@@ -521,6 +526,23 @@ options and enables two integrations:
|
|
|
521
526
|
2. **In-browser dev shell:** serves the Peach simulator shell at `/__peachsim/` on
|
|
522
527
|
the Metro dev server.
|
|
523
528
|
|
|
529
|
+
Native app identity also travels in the bundle. Android permissions come only
|
|
530
|
+
from a completed app manifest merger output. A sole output under
|
|
531
|
+
`android/<module>/build/intermediates/merged_manifests/` is selected automatically;
|
|
532
|
+
select one explicitly when multiple variants exist:
|
|
533
|
+
|
|
534
|
+
```js
|
|
535
|
+
module.exports = withPeach(config, {
|
|
536
|
+
androidMergedManifest:
|
|
537
|
+
'android/app/build/intermediates/merged_manifests/debug/processDebugManifest/AndroidManifest.xml',
|
|
538
|
+
})
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
Without resolved merged output, Android permissions contain only the explicit
|
|
542
|
+
Expo `android.permissions` set minus `android.blockedPermissions`. Defaults,
|
|
543
|
+
plugins and linked library additions require completed merged output. See the
|
|
544
|
+
[native identity contract](../../specs/sootsim-engine/native-app-identity.md).
|
|
545
|
+
|
|
524
546
|
The URL helpers request ordinary Metro graphs: `dev=false&minify=true` for
|
|
525
547
|
production and `dev=true&minify=false` for development.
|
|
526
548
|
|
|
@@ -571,6 +593,12 @@ and video recording create a new browser context; cold launches still use the
|
|
|
571
593
|
supplied shell URL. When synchronization is enabled, URL delivery waits for
|
|
572
594
|
existing work before dispatch and for navigation and painting afterward.
|
|
573
595
|
|
|
596
|
+
Element taps finish viewport measurement before resolving the selected node's
|
|
597
|
+
current center, visible frame, and relative offset in the browser task that
|
|
598
|
+
sends the physical tap. Stillness samples do not supply later tap coordinates:
|
|
599
|
+
startup layout can change while other bridge reads finish. A removed node
|
|
600
|
+
rejects the action instead of reusing its old geometry.
|
|
601
|
+
|
|
574
602
|
See `../../docs/migrating-from-detox.md` for details.
|
|
575
603
|
|
|
576
604
|
## Coming from Maestro
|
|
@@ -751,8 +779,10 @@ fails instead of loading empty native configuration. Bare Metro, which has no
|
|
|
751
779
|
Expo manifest project root, uses
|
|
752
780
|
the listening development process's cwd inside that same resolver. The invoking
|
|
753
781
|
CLI's cwd is never an asset/config fallback. Asset wires stay on each opened
|
|
754
|
-
project URL
|
|
755
|
-
|
|
782
|
+
project URL. Font catalogs use content-addressed bridge asset references, so
|
|
783
|
+
the navigation request stays bounded as the number of fonts grows. Recordings
|
|
784
|
+
resolve these references before capturing the catalog and its assets. One daemon
|
|
785
|
+
can serve several attached projects without sharing font or splash state.
|
|
756
786
|
|
|
757
787
|
Bare iOS projects carry default Firebase options from their selected app
|
|
758
788
|
target's Google services build resource when the app delegate initializes
|
package/cli/app-fonts.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { createRequire } from 'node:module'
|
|
|
4
4
|
import path from 'node:path'
|
|
5
5
|
import {
|
|
6
6
|
encodeAppFontsWire,
|
|
7
|
+
resolveAppFontsWire,
|
|
7
8
|
expoFontPathsFromPlugins,
|
|
8
9
|
nativeLinkedFontSpecsFromPaths,
|
|
9
10
|
metroFontSpecsFromPaths,
|
|
@@ -448,7 +449,7 @@ export async function fetchAppFontFiles(
|
|
|
448
449
|
): Promise<FetchedAppFont[]> {
|
|
449
450
|
const out: FetchedAppFont[] = []
|
|
450
451
|
const seen = new Set<string>()
|
|
451
|
-
for (const url of appFontAssetUrlsFromWire(wire)) {
|
|
452
|
+
for (const url of appFontAssetUrlsFromWire(await resolveAppFontsWire(wire, fetch))) {
|
|
452
453
|
const urlhash = createHash('sha256').update(url).digest('hex')
|
|
453
454
|
if (seen.has(urlhash)) continue
|
|
454
455
|
seen.add(urlhash)
|