peachsim 0.1.527 → 0.1.570
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 +26 -26
- package/cli/app-fonts.ts +1 -1
- package/cli/app-splash.ts +1 -1
- package/cli/bin.ts +1 -1
- package/cli/bridge-diagnostics.ts +1 -1
- package/cli/bridge-flow-runner.ts +57 -5
- package/cli/cloud-client.ts +273 -6
- package/cli/cloud-dispatch.ts +22 -2
- package/cli/cloud-session.ts +60 -4
- package/cli/cloud-test-tunnel.ts +354 -0
- package/cli/commands/box/bundle-plane.ts +2 -2
- package/cli/commands/box/checkout-plane.ts +1 -1
- package/cli/commands/box/rnx-command.ts +2 -2
- package/cli/commands/box/search-command.ts +2 -2
- package/cli/commands/box.ts +8 -8
- package/cli/commands/compat.ts +1 -1
- package/cli/commands/control.ts +22 -3
- package/cli/commands/detox.ts +1 -1
- package/cli/commands/device.ts +1 -1
- package/cli/commands/diagnose.ts +1 -1
- package/cli/commands/film.ts +1 -1
- package/cli/commands/flow.ts +60 -3
- package/cli/commands/inspect/actions.ts +1 -1
- package/cli/commands/inspect/core.ts +6 -7
- package/cli/commands/inspect/find.ts +2 -1
- package/cli/commands/inspect/resolve-target.ts +5 -3
- package/cli/commands/inspect/shared.ts +1 -1
- package/cli/commands/inspect/wait-event.ts +1 -1
- package/cli/commands/inspect/wait-selector.ts +15 -4
- package/cli/commands/inspect.ts +19 -14
- package/cli/commands/maestro.ts +464 -43
- package/cli/commands/permissions.ts +1 -1
- package/cli/commands/platform.ts +205 -8
- package/cli/commands/preview.ts +2 -2
- package/cli/commands/record.ts +2 -2
- package/cli/commands/report-issue.ts +2 -2
- package/cli/commands/screenshot-layers.ts +1 -1
- package/cli/commands/screenshot.ts +1 -1
- package/cli/commands/setup.ts +2 -2
- package/cli/commands/test.ts +440 -115
- package/cli/commands/three-mode.ts +1 -1
- package/cli/commands/upload.ts +5 -5
- package/cli/commands/what-happened.ts +1 -1
- package/cli/desktop-companion.ts +3 -3
- package/cli/drivers/playwright-sim-host.ts +2 -2
- package/cli/flow-file.ts +7 -0
- package/cli/flow-live-status.ts +65 -8
- package/cli/help-core.ts +3 -3
- package/cli/hidden-runtime-alias.ts +1 -1
- package/cli/maestro-report.ts +178 -0
- package/cli/main.ts +1 -1
- package/cli/outbound-endpoints.ts +185 -136
- package/cli/parse-args.ts +1 -1
- package/cli/registry.ts +1 -1
- package/cli/resolve-assets.ts +1 -1
- package/cli/run-registry.ts +8 -0
- package/cli/send-to-box.ts +4 -4
- package/cli/ws-bridge.ts +3 -5
- package/detox/expectations.ts +1 -1
- package/detox/gestures.ts +2 -2
- package/detox/index.ts +71 -29
- package/detox/jest-preset.cjs +3 -3
- package/detox/jest-setup-after-env.cjs +1 -1
- package/dist-lib/agent-daemon-client.cjs +2 -2
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +2 -2
- package/dist-lib/attached-projects.cjs +2 -2
- package/dist-lib/auth/shared-session.cjs +1 -1
- 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/capture-contract.cjs +94 -3
- package/dist-lib/capture-contract.mjs +93 -3
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud.cjs +2 -2
- package/dist-lib/cloud.mjs +2 -2
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +106 -25
- package/dist-lib/detox/jest-preset.cjs +3 -3
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +137 -61
- package/dist-lib/host/fetch-proxy-handler.cjs +28 -2
- package/dist-lib/host/fetch-proxy-overrides.cjs +33 -3
- package/dist-lib/host/fetch-proxy-overrides.mjs +30 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +209 -16
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/menu.cjs +2 -2
- package/dist-lib/menu.mjs +2 -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 +3 -3
- package/dist-lib/metro-production-bundle.mjs +3 -3
- package/dist-lib/metro.cjs +8 -8
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +2 -2
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +31 -15
- package/dist-lib/sdk.cjs +3 -2
- package/dist-lib/sdk.mjs +3 -2
- package/dist-lib/skills.cjs +362 -163
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift.cjs +583 -16
- package/dist-lib/vite.cjs +29 -14
- package/package.json +9 -9
- package/scripts/dev-server-scanner.ts +41 -14
- package/scripts/optional-demo-registry.ts +3 -3
- package/skills/contrast/SKILL.md +9 -9
- package/skills/rnx-debug/SKILL.md +14 -4
- package/skills/rnx-perf/SKILL.md +5 -5
- package/skills/rnx-setup/SKILL.md +11 -11
- package/skills/rnx-test/SKILL.md +11 -11
- package/skills/rnx-visual/SKILL.md +6 -6
- package/src/agent-sessions.ts +3 -3
- package/src/attached-projects.ts +1 -1
- package/src/bridge-contract-input.ts +1 -1
- package/src/bridge-contract.ts +23 -5
- package/src/capture-contract.ts +145 -3
- package/src/config.ts +2 -2
- package/src/connect.ts +2 -2
- package/src/home-paths.ts +3 -3
- package/src/host/bridge-host.ts +2 -2
- package/src/host/fetch-proxy-handler.ts +4 -3
- package/src/host/fetch-proxy-overrides.ts +41 -0
- package/src/host/plane-host.ts +2 -2
- package/src/index.ts +3 -0
- package/src/metro-plugin.ts +4 -4
- package/src/metro-production-bundle.ts +2 -2
- package/src/native-seam-manifest.ts +6 -6
- package/src/public-brand.ts +1 -1
- package/src/rolldown-plugin-swift.ts +8 -5
- package/src/runtime-assets.ts +8 -6
- package/src/screenshots/frame-compose.ts +24 -56
- package/src/screenshots/org-deck.ts +1 -1
- package/src/screenshots/registry.ts +4 -4
- package/src/screenshots/schema.ts +1 -1
- package/src/sdk.ts +2 -2
- package/src/settings-bundle.ts +1 -1
- package/src/sim-client.ts +2 -4
- package/src/skills/builtin/compat-check.ts +1 -1
- package/src/vite-plugin-one.ts +1 -1
- package/src/vite-plugin-swift.ts +11 -6
- package/src/vite-plugin.ts +30 -17
- package/src/worklets-babel.ts +2 -2
|
@@ -5,12 +5,13 @@ import {
|
|
|
5
5
|
LEGACY_HOME_BUTTON_SIZE,
|
|
6
6
|
LEGACY_SIDE_BEZEL,
|
|
7
7
|
LEGACY_TOP_BEZEL,
|
|
8
|
-
HINGE_BARREL_BACKGROUND,
|
|
9
|
-
HINGE_BARREL_SHADOW,
|
|
10
|
-
HOUSING_RAIL_COLOR,
|
|
11
|
-
HOUSING_RAIL_OUTLINE,
|
|
12
8
|
SIDE_BUTTON_RESERVE,
|
|
13
|
-
} from '
|
|
9
|
+
} from 'peach-engine/ios/chrome-metrics'
|
|
10
|
+
import {
|
|
11
|
+
housingLayerHtml,
|
|
12
|
+
resolveHousingArt,
|
|
13
|
+
type HousingLayer,
|
|
14
|
+
} from 'peach-engine/ios/duo-housing'
|
|
14
15
|
import {
|
|
15
16
|
cornerRadii,
|
|
16
17
|
formatCornerRadii,
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
resolveDeviceFrameGeometry,
|
|
19
20
|
type CornerRadii,
|
|
20
21
|
type DeviceModel,
|
|
21
|
-
} from '
|
|
22
|
+
} from 'peach-engine/settings'
|
|
22
23
|
import { launchReapedChrome } from '../../../../scripts/lib/reap-browser'
|
|
23
24
|
|
|
24
25
|
const METALLIC_RING_SHADOW =
|
|
@@ -56,8 +57,8 @@ export interface FramedScreenshotLayout {
|
|
|
56
57
|
logicalScreenTop: number
|
|
57
58
|
logicalScreenRadius: CornerRadii
|
|
58
59
|
logicalFrameRadius: CornerRadii
|
|
59
|
-
//
|
|
60
|
-
|
|
60
|
+
// folding body art, painted before the screen; null draws one black body
|
|
61
|
+
housingLayers: HousingLayer[] | null
|
|
61
62
|
frameBackground: string
|
|
62
63
|
frameOutline: string
|
|
63
64
|
metallicRingShadow: string | null
|
|
@@ -87,7 +88,9 @@ export function getFramedScreenshotLayout(model: DeviceModel): FramedScreenshotL
|
|
|
87
88
|
const logicalScreenWidth = spec.width
|
|
88
89
|
const logicalScreenHeight = spec.height
|
|
89
90
|
const modernGeometry = resolveDeviceFrameGeometry(spec)
|
|
90
|
-
const
|
|
91
|
+
const housingLayers = isLegacyHardware
|
|
92
|
+
? null
|
|
93
|
+
: resolveHousingArt(spec.posture ?? 'closed', modernGeometry)
|
|
91
94
|
const logicalFrameWidth = isLegacyHardware
|
|
92
95
|
? spec.width + LEGACY_SIDE_BEZEL * 2
|
|
93
96
|
: modernGeometry.frameWidth
|
|
@@ -148,18 +151,20 @@ export function getFramedScreenshotLayout(model: DeviceModel): FramedScreenshotL
|
|
|
148
151
|
logicalScreenTop,
|
|
149
152
|
logicalScreenRadius: isLegacyHardware ? cornerRadii(0) : modernGeometry.screenRadius,
|
|
150
153
|
logicalFrameRadius,
|
|
151
|
-
|
|
154
|
+
housingLayers,
|
|
155
|
+
// the housing paints its own body layer, shadow included: its frame box is
|
|
156
|
+
// wider than the body, because the hinge barrel protrudes past the spine.
|
|
152
157
|
frameBackground: isLegacyHardware
|
|
153
158
|
? 'linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)'
|
|
154
|
-
:
|
|
155
|
-
?
|
|
159
|
+
: housingLayers
|
|
160
|
+
? 'transparent'
|
|
156
161
|
: '#000000',
|
|
157
162
|
frameOutline: isLegacyHardware
|
|
158
163
|
? '0 0 0 1px #1f2125'
|
|
159
|
-
:
|
|
160
|
-
?
|
|
164
|
+
: housingLayers
|
|
165
|
+
? 'none'
|
|
161
166
|
: '0 0 0 1px #333',
|
|
162
|
-
metallicRingShadow: isLegacyHardware ||
|
|
167
|
+
metallicRingShadow: isLegacyHardware || housingLayers ? null : METALLIC_RING_SHADOW,
|
|
163
168
|
buttons,
|
|
164
169
|
legacyHomeButton: isLegacyHardware
|
|
165
170
|
? {
|
|
@@ -230,46 +235,9 @@ function renderFrameHtml(
|
|
|
230
235
|
`
|
|
231
236
|
: ''
|
|
232
237
|
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
const housingHtml = layout.
|
|
236
|
-
? `
|
|
237
|
-
<div
|
|
238
|
-
aria-hidden="true"
|
|
239
|
-
style="
|
|
240
|
-
position:absolute;
|
|
241
|
-
top:${layout.housing.rail.top}px;
|
|
242
|
-
right:${layout.housing.rail.right}px;
|
|
243
|
-
bottom:${layout.housing.rail.bottom}px;
|
|
244
|
-
left:${layout.housing.rail.left}px;
|
|
245
|
-
border-radius:${formatCornerRadii(layout.housing.glassRadius)};
|
|
246
|
-
background:#000000;
|
|
247
|
-
pointer-events:none;
|
|
248
|
-
"
|
|
249
|
-
></div>
|
|
250
|
-
${
|
|
251
|
-
layout.housing.hingeBarrel
|
|
252
|
-
? `
|
|
253
|
-
<div
|
|
254
|
-
aria-hidden="true"
|
|
255
|
-
style="
|
|
256
|
-
position:absolute;
|
|
257
|
-
top:${layout.housing.hingeBarrel.endInset}px;
|
|
258
|
-
bottom:${layout.housing.hingeBarrel.endInset}px;
|
|
259
|
-
left:0;
|
|
260
|
-
width:${layout.housing.hingeBarrel.width}px;
|
|
261
|
-
border-radius:${layout.housing.hingeBarrel.width / 2}px 0 0 ${layout.housing.hingeBarrel.width / 2}px;
|
|
262
|
-
background:${HINGE_BARREL_BACKGROUND};
|
|
263
|
-
box-shadow:${HINGE_BARREL_SHADOW};
|
|
264
|
-
pointer-events:none;
|
|
265
|
-
z-index:11;
|
|
266
|
-
"
|
|
267
|
-
></div>
|
|
268
|
-
`
|
|
269
|
-
: ''
|
|
270
|
-
}
|
|
271
|
-
`
|
|
272
|
-
: ''
|
|
238
|
+
// the folding body's rail, glass ring, corner art, and hinge barrel. no
|
|
239
|
+
// z-index, so the screen div after it paints on top.
|
|
240
|
+
const housingHtml = (layout.housingLayers ?? []).map(housingLayerHtml).join('')
|
|
273
241
|
|
|
274
242
|
const legacyHomeButtonHtml = layout.legacyHomeButton
|
|
275
243
|
? `
|
|
@@ -390,7 +358,7 @@ function renderFrameHtml(
|
|
|
390
358
|
left:${layout.logicalFrameLeft}px;
|
|
391
359
|
width:${layout.logicalFrameWidth}px;
|
|
392
360
|
height:${layout.logicalFrameHeight}px;
|
|
393
|
-
border-radius:${formatCornerRadii(layout.logicalFrameRadius)};
|
|
361
|
+
border-radius:${layout.housingLayers ? '0' : formatCornerRadii(layout.logicalFrameRadius)};
|
|
394
362
|
box-sizing:border-box;
|
|
395
363
|
overflow:visible;
|
|
396
364
|
background:${layout.frameBackground};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// colors. 3d scenes don't translate to the cli's 2d composer, so only copy and
|
|
7
7
|
// colors carry over (the 3d hero look stays the in-browser screenshot mode).
|
|
8
8
|
|
|
9
|
-
import { resolveBgColorValue } from '
|
|
9
|
+
import { resolveBgColorValue } from 'peach-engine/screenshots/tokens'
|
|
10
10
|
import type { BackgroundSpec } from './registry'
|
|
11
11
|
import type { NormalizedScreenshotsPlan } from './schema'
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// this module re-exports those tokens plus the composer-specific
|
|
7
7
|
// `FrameComposeSpec` shape.
|
|
8
8
|
|
|
9
|
-
import type { DeviceModel } from '
|
|
9
|
+
import type { DeviceModel } from 'peach-engine/settings'
|
|
10
10
|
|
|
11
11
|
export {
|
|
12
12
|
BACKGROUND_PRESETS,
|
|
@@ -19,7 +19,7 @@ export {
|
|
|
19
19
|
cloneBackgroundSpec,
|
|
20
20
|
resolveBackgroundPreset,
|
|
21
21
|
resolveCanvasPreset,
|
|
22
|
-
} from '
|
|
22
|
+
} from 'peach-engine/screenshots/tokens'
|
|
23
23
|
|
|
24
24
|
export type {
|
|
25
25
|
BackgroundPresetName,
|
|
@@ -30,9 +30,9 @@ export type {
|
|
|
30
30
|
PosePresetName,
|
|
31
31
|
ScreenshotCanvasName,
|
|
32
32
|
TextPresetName,
|
|
33
|
-
} from '
|
|
33
|
+
} from 'peach-engine/screenshots/tokens'
|
|
34
34
|
|
|
35
|
-
import type { FrameShadowSpec, PosePresetName } from '
|
|
35
|
+
import type { FrameShadowSpec, PosePresetName } from 'peach-engine/screenshots/tokens'
|
|
36
36
|
|
|
37
37
|
export interface FrameComposeSpec {
|
|
38
38
|
show: boolean
|
package/src/sdk.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
//
|
|
1
|
+
// peachsim/sdk — the scriptable sim-driving surface.
|
|
2
2
|
//
|
|
3
3
|
// exports the SimClient class plus the transport-agnostic inspect verbs it is
|
|
4
4
|
// built from. this entry MUST stay browser-safe (Contrast's in-browser agent
|
|
5
5
|
// imports it against an in-process preview bridge), so the node-only ws
|
|
6
|
-
// `connect()` lives on the ROOT `
|
|
6
|
+
// `connect()` lives on the ROOT `peachsim` entry, not here.
|
|
7
7
|
|
|
8
8
|
export * from './sim-client'
|
|
9
9
|
export * from '../cli/commands/inspect/core'
|
package/src/settings-bundle.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile, readdir, stat } from 'node:fs/promises'
|
|
2
2
|
import { join } from 'node:path'
|
|
3
3
|
import { parsePlistSource } from './plist.ts'
|
|
4
|
-
import type { AppPreferenceValue, AppSettingsSpecifier } from '@
|
|
4
|
+
import type { AppPreferenceValue, AppSettingsSpecifier } from '@peach/globals'
|
|
5
5
|
|
|
6
6
|
const MAX_PLIST_BYTES = 1_048_576
|
|
7
7
|
const MAX_CHILD_DEPTH = 8
|
package/src/sim-client.ts
CHANGED
|
@@ -60,6 +60,7 @@ import type {
|
|
|
60
60
|
SimSemanticResolveSelector,
|
|
61
61
|
SimStateOptions,
|
|
62
62
|
SimStateResult,
|
|
63
|
+
WsBridgeCommand,
|
|
63
64
|
} from './bridge-contract'
|
|
64
65
|
|
|
65
66
|
// ---------------------------------------------------------------------------
|
|
@@ -250,10 +251,7 @@ export class SimClient implements WsBridge, InspectBridge {
|
|
|
250
251
|
|
|
251
252
|
// --- transport (WsBridge/InspectBridge) ---
|
|
252
253
|
|
|
253
|
-
send(
|
|
254
|
-
cmd: { type: string; [k: string]: any },
|
|
255
|
-
opts?: { timeoutMs?: number },
|
|
256
|
-
): Promise<any> {
|
|
254
|
+
send(cmd: WsBridgeCommand, opts?: { timeoutMs?: number }): Promise<any> {
|
|
257
255
|
if (this.closed) {
|
|
258
256
|
return Promise.reject(new SimConnectError('sim client is closed'))
|
|
259
257
|
}
|
|
@@ -22,7 +22,7 @@ export const skill: RNXSkill = {
|
|
|
22
22
|
const fs = await import('node:fs')
|
|
23
23
|
const path = await import('node:path')
|
|
24
24
|
const { COMPAT_RESULT_CAVEAT, formatPackageStatus, formatScanCounts, scanDeps } =
|
|
25
|
-
await import('../../../../compat/src/web.ts')
|
|
25
|
+
await import('../../../../peach-compat/src/web.ts')
|
|
26
26
|
|
|
27
27
|
const packagePath = path.join(context.projectDir, 'package.json')
|
|
28
28
|
if (!fs.existsSync(packagePath)) {
|
package/src/vite-plugin-one.ts
CHANGED
package/src/vite-plugin-swift.ts
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
enumerateBundleImages,
|
|
21
21
|
enumerateBundleJson,
|
|
22
22
|
} from '../../sootsim-swift/src/bundleAssets'
|
|
23
|
+
import { swiftEntryModuleEsm } from '../../sootsim-swift/src/entryModule'
|
|
23
24
|
import toolchain from '../../sootsim-swift/toolchain.json'
|
|
24
25
|
import type { Plugin, ViteDevServer } from 'vite'
|
|
25
26
|
|
|
@@ -530,7 +531,9 @@ export function swiftPlugin(options: SwiftPluginOptions = {}): Plugin {
|
|
|
530
531
|
try {
|
|
531
532
|
const built = buildSwiftResourceTable(project, serverOrigin())
|
|
532
533
|
resources = built.table
|
|
533
|
-
for (const watched of built.watched)
|
|
534
|
+
for (const watched of built.watched) {
|
|
535
|
+
this.addWatchFile(path.join(packagePath, ...watched.split(path.posix.sep)))
|
|
536
|
+
}
|
|
534
537
|
} catch (error) {
|
|
535
538
|
this.warn(
|
|
536
539
|
`swift resources for ${packagePath}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -560,11 +563,13 @@ export function swiftPlugin(options: SwiftPluginOptions = {}): Plugin {
|
|
|
560
563
|
// whether it is a view or an app root at runtime, so the transform
|
|
561
564
|
// never re-derives the conformance from source. the entry is rooted by
|
|
562
565
|
// its package and source path so a hot reload finds the same instance.
|
|
563
|
-
return
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
return swiftEntryModuleEsm({
|
|
567
|
+
url: artifactUrl(project, artifact),
|
|
568
|
+
hash: artifact.hash,
|
|
569
|
+
rootId: entryRootId(packagePath, file),
|
|
570
|
+
resources,
|
|
571
|
+
bundleFiles,
|
|
572
|
+
})
|
|
568
573
|
},
|
|
569
574
|
|
|
570
575
|
configureServer(server) {
|
package/src/vite-plugin.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { createRequire } from 'module'
|
|
|
13
13
|
import path from 'path'
|
|
14
14
|
import { fileURLToPath } from 'url'
|
|
15
15
|
import { type Plugin, transformWithOxc } from 'vite'
|
|
16
|
-
import { resolveExportsHiddenSubpath } from '../../compat/src/resolve-hidden-subpath.ts'
|
|
16
|
+
import { resolveExportsHiddenSubpath } from '../../peach-compat/src/resolve-hidden-subpath.ts'
|
|
17
17
|
import {
|
|
18
18
|
SOOTSIM_COMPAT_PUBLISHED_BROWSER_ENTRIES,
|
|
19
19
|
SOOTSIM_COMPAT_WRAPPER_REAL_PACKAGES,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
SOOTSIM_HAPTIC_FEEDBACK_TOUCHABLE_SPECIFIER,
|
|
22
22
|
compatStubsForBuildResolver,
|
|
23
23
|
reactNativeDeepStubsForBuildResolver,
|
|
24
|
-
} from '../../compat/src/stub-manifest.ts'
|
|
24
|
+
} from '../../peach-compat/src/stub-manifest.ts'
|
|
25
25
|
import { resolveSootsimBridgePort } from './bridge-constants.ts'
|
|
26
26
|
import {
|
|
27
27
|
SHELL_BRIDGE_IDENTITY_PATH,
|
|
@@ -50,19 +50,32 @@ const sootsimRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '
|
|
|
50
50
|
const workspaceRoot = path.resolve(sootsimRoot, '..', '..')
|
|
51
51
|
const workspaceNodeModules = path.resolve(workspaceRoot, 'node_modules')
|
|
52
52
|
const workspaceTamaguiDir = path.resolve(workspaceNodeModules, '@tamagui')
|
|
53
|
-
// stubs and the mutable React bridge live in @
|
|
54
|
-
const compatRoot = path.resolve(sootsimRoot, '..', 'compat')
|
|
53
|
+
// stubs and the mutable React bridge live in @peach/compat.
|
|
54
|
+
const compatRoot = path.resolve(sootsimRoot, '..', 'peach-compat')
|
|
55
55
|
|
|
56
56
|
// the rendering engine and its shims live in the private sootsim-engine
|
|
57
57
|
// workspace package. resolve via workspace root rather than relative hops so
|
|
58
58
|
// renames of either package don't break things.
|
|
59
|
-
const engineRoot = path.resolve(workspaceRoot, 'packages/
|
|
59
|
+
const engineRoot = path.resolve(workspaceRoot, 'packages/peach-engine')
|
|
60
60
|
const rnShimPath = path.resolve(engineRoot, 'src/react-native/index.ts')
|
|
61
61
|
const reactBridgePath = path.resolve(
|
|
62
62
|
workspaceRoot,
|
|
63
63
|
'packages/contrast-kit/src/react-bridge.ts',
|
|
64
64
|
)
|
|
65
65
|
const sootsimBrowserSourceAliases = [
|
|
66
|
+
{
|
|
67
|
+
find: 'peachsim/backend-origin',
|
|
68
|
+
replacement: path.resolve(sootsimRoot, 'src/backend-origin.ts'),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
find: 'peachsim/bridge-constants',
|
|
72
|
+
replacement: path.resolve(sootsimRoot, 'src/bridge-constants.ts'),
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
find: 'peachsim/dev-bundle-resolution',
|
|
76
|
+
replacement: path.resolve(sootsimRoot, 'src/dev-bundle-resolution.ts'),
|
|
77
|
+
},
|
|
78
|
+
// old specifiers for user code still on rnxsim; remove with packages/sootsim.
|
|
66
79
|
{
|
|
67
80
|
find: 'rnxsim/backend-origin',
|
|
68
81
|
replacement: path.resolve(sootsimRoot, 'src/backend-origin.ts'),
|
|
@@ -475,13 +488,13 @@ function rnghUpstreamInternalResolvePlugin(): Plugin {
|
|
|
475
488
|
export function recordingPluginWorkerRedirect(): Plugin {
|
|
476
489
|
const workerTarget = path.resolve(
|
|
477
490
|
workspaceRoot,
|
|
478
|
-
'packages/
|
|
491
|
+
'packages/peach-plugin-recording/src/worker.ts',
|
|
479
492
|
)
|
|
480
493
|
return {
|
|
481
494
|
name: 'sootsim-recording-plugin-worker-redirect',
|
|
482
495
|
enforce: 'pre',
|
|
483
496
|
resolveId(source) {
|
|
484
|
-
if (source === '@
|
|
497
|
+
if (source === '@peach/plugin-recording') {
|
|
485
498
|
return workerTarget
|
|
486
499
|
}
|
|
487
500
|
return null
|
|
@@ -542,7 +555,7 @@ const ENGINE_WORKER_BOOT_CLOSURES: WorkerBootClosure[] = [
|
|
|
542
555
|
// statically instead of require()ing the whole react-native namespace into
|
|
543
556
|
// the boot file.
|
|
544
557
|
{ entry: 'src/render-worker/shell-worker-entry.ts', maxBytes: 3_451_000 },
|
|
545
|
-
{ entry: 'src/render-worker/compositor-worker-entry.ts', maxBytes:
|
|
558
|
+
{ entry: 'src/render-worker/compositor-worker-entry.ts', maxBytes: 1_085_000 },
|
|
546
559
|
{ entry: 'src/render-worker/compositor-worker-ganesh-entry.ts', maxBytes: 1_820_000 },
|
|
547
560
|
]
|
|
548
561
|
|
|
@@ -670,7 +683,7 @@ export function keyboardControllerBindingsRedirect(): Plugin {
|
|
|
670
683
|
//
|
|
671
684
|
// per the project policy of not shimming pure-JS libs, we let upstream resolve
|
|
672
685
|
// from node_modules and redirect ONLY the native seam to our compat stub
|
|
673
|
-
// (one file at packages/compat/src/stubs/react-native-reanimated.ts that
|
|
686
|
+
// (one file at packages/peach-compat/src/stubs/react-native-reanimated.ts that
|
|
674
687
|
// exports the right shape — default = turbomodule, named = platform fns).
|
|
675
688
|
//
|
|
676
689
|
// upstream's `assertWorkletsVersion` (DEV-only) imports a build-time script
|
|
@@ -1274,11 +1287,11 @@ function reactBridgePlugin(): Plugin {
|
|
|
1274
1287
|
// skip during dep scanning / SSR — only active in browser serve mode
|
|
1275
1288
|
if ((options as { scan?: boolean })?.scan || options?.ssr) return null
|
|
1276
1289
|
|
|
1277
|
-
// only redirect imports from
|
|
1290
|
+
// only redirect imports from peachsim, peach-engine, peach-compat, and react-reconciler
|
|
1278
1291
|
const shouldRedirect =
|
|
1279
|
-
importer.includes('/
|
|
1280
|
-
importer.includes('/
|
|
1281
|
-
importer.includes('/compat/src/') ||
|
|
1292
|
+
importer.includes('/peachsim/src/') ||
|
|
1293
|
+
importer.includes('/peach-engine/src/') ||
|
|
1294
|
+
importer.includes('/peach-compat/src/') ||
|
|
1282
1295
|
importer.includes('/contrast-kit/src/') ||
|
|
1283
1296
|
importer.includes('react-reconciler')
|
|
1284
1297
|
|
|
@@ -1326,16 +1339,16 @@ export function workerReactBridgePlugin(): Plugin {
|
|
|
1326
1339
|
// stub-registry needs the real React (with __CLIENT_INTERNALS) for bundle stubs
|
|
1327
1340
|
if (importer.includes('stub-registry')) return null
|
|
1328
1341
|
|
|
1329
|
-
// redirect react imports from
|
|
1342
|
+
// redirect react imports from peachsim, peach-engine, peach-compat, react-reconciler,
|
|
1330
1343
|
// and any pure-JS RN-ecosystem package the bundle pulls in. without this
|
|
1331
1344
|
// redirect, packages like react-native-drawer-layout / use-latest-callback
|
|
1332
1345
|
// call into a separate React instance than the renderer/bridge does, so
|
|
1333
1346
|
// their useRef/useEffect refs collide with the engine's hooks state and
|
|
1334
1347
|
// we hit "Maximum update depth exceeded" infinite-loop renders.
|
|
1335
1348
|
const shouldRedirect =
|
|
1336
|
-
importer.includes('/
|
|
1337
|
-
importer.includes('/
|
|
1338
|
-
importer.includes('/compat/src/') ||
|
|
1349
|
+
importer.includes('/peachsim/src/') ||
|
|
1350
|
+
importer.includes('/peach-engine/src/') ||
|
|
1351
|
+
importer.includes('/peach-compat/src/') ||
|
|
1339
1352
|
importer.includes('/contrast-kit/src/') ||
|
|
1340
1353
|
importer.includes('react-reconciler') ||
|
|
1341
1354
|
importer.includes('/node_modules/')
|
package/src/worklets-babel.ts
CHANGED
|
@@ -41,8 +41,8 @@ export const REANIMATED_WORKLETIZATION_REGEX = new RegExp(
|
|
|
41
41
|
// content-gated so most of node_modules skips for free.
|
|
42
42
|
const REANIMATED_IGNORED_PATHS_REGEX =
|
|
43
43
|
/node_modules\/(react|react-dom|react-native|react-native-web)\//
|
|
44
|
-
const SOOTSIM_ENGINE_SRC_PATH = '/packages/
|
|
45
|
-
const SOOTSIM_ENGINE_TEST_FIXTURE_PATH = '/packages/
|
|
44
|
+
const SOOTSIM_ENGINE_SRC_PATH = '/packages/peach-engine/src/'
|
|
45
|
+
const SOOTSIM_ENGINE_TEST_FIXTURE_PATH = '/packages/peach-engine/src/test-fixtures/'
|
|
46
46
|
const REANIMATED_IMPORT_REGEX =
|
|
47
47
|
/(?:from\s+['"]react-native-reanimated(?:\/[^'"]*)?['"]|require\(\s*['"]react-native-reanimated(?:\/[^'"]*)?['"]\s*\))/
|
|
48
48
|
|