peachsim 0.1.1716 → 0.1.1728
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 +21 -3
- package/cli/app-bundle-resources.ts +2 -1
- package/cli/app-fonts.ts +4 -4
- package/cli/app-splash.ts +4 -4
- package/cli/app-stubs.ts +17 -0
- package/cli/command-registry.ts +1 -0
- package/cli/commands/control.ts +82 -822
- package/cli/commands/daemon.ts +8 -0
- package/cli/commands/detox.ts +3 -0
- package/cli/commands/doctor.ts +19 -2
- package/cli/commands/inspect/actions.ts +74 -14
- package/cli/commands/inspect/core.ts +5 -1
- package/cli/commands/inspect/settling.ts +5 -2
- package/cli/commands/inspect/wait-ready.ts +6 -0
- package/cli/commands/inspect.ts +48 -45
- package/cli/commands/kotlin.ts +12 -2
- package/cli/commands/package.ts +750 -0
- package/cli/commands/serve.ts +6 -0
- package/cli/commands/shell-url.ts +834 -0
- package/cli/commands/swift.ts +42 -102
- package/cli/commands/test.ts +20 -0
- package/cli/commands/upload.ts +1 -1
- package/cli/device-option.ts +1 -1
- package/cli/main.ts +13 -1
- package/cli/native-input.ts +199 -0
- package/cli/outbound-endpoints.ts +26 -1
- package/cli/packaged-app-launcher.ts +95 -0
- package/cli/scene-video.ts +13 -6
- package/detox/index.ts +187 -23
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- 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/bundle-channel.cjs +38000 -31658
- 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 +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +184 -60
- package/dist-lib/dev-bundle-resolution.cjs +14 -13
- package/dist-lib/expo-swift-bundle.cjs +18199 -11834
- package/dist-lib/expo-swift-metadata.cjs +4 -1
- package/dist-lib/expo-swift-metadata.mjs +3 -1
- package/dist-lib/home-paths.cjs +21 -2
- package/dist-lib/host/bridge-host.cjs +26509 -23850
- package/dist-lib/host/fetch-proxy-handler.cjs +221 -222
- 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 +876 -389
- 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 +127 -16
- package/dist-lib/menu.cjs +7 -1
- package/dist-lib/menu.mjs +7 -1
- 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 +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +883 -404
- package/dist-lib/native-app-identity-project.cjs +694 -280
- package/dist-lib/native-app-identity-project.mjs +490 -83
- package/dist-lib/native-app-identity.cjs +13 -2
- package/dist-lib/native-app-identity.mjs +13 -2
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- 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 +1 -1
- package/dist-lib/public-origins-lib-esm.json +28 -23
- package/dist-lib/public-origins-lib.json +392 -224
- package/dist-lib/react-native-host-modules.cjs +32 -2
- package/dist-lib/react-native-host-modules.mjs +32 -2
- package/dist-lib/reap-browser.cjs +12 -4
- package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
- package/dist-lib/sdk.cjs +17 -7
- package/dist-lib/sdk.mjs +16 -7
- package/dist-lib/skills.cjs +61838 -47851
- package/dist-lib/swift-compile.cjs +583 -360
- package/dist-lib/swift-compile.mjs +496 -275
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +105 -17
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +4453 -2231
- package/dist-lib/vite.cjs +230 -228
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
- package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +7 -5
- package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -11
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +23 -1
- package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +12 -25
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +75 -9
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
- package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
- package/sdk/ios/usr/include/module.modulemap +1 -0
- package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
- package/sdk/ios/usr/include/os.modulemap +5 -0
- package/sdk/ios/usr/include/sys/cdefs.h +5 -0
- package/sdk/ios/usr/include/sys/ioccom.h +99 -0
- package/sdk/ios/usr/include/sys/syslog.h +236 -0
- package/sdk/ios/usr/include/syslog.h +24 -0
- package/sdk/ios/wasm/include/fcntl.h +4 -2
- package/sdk/ios/wasm/include/stdio.h +24 -0
- package/sdk/ios/wasm/include/stdlib.h +32 -7
- package/sdk/ios/wasm/include/sys/file.h +7 -0
- package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
- package/sdk/ios/wasm/include/sys/syscall.h +9 -0
- package/sdk/ios/wasm/include/sys/time.h +10 -0
- package/sdk/ios/wasm/include/unistd.h +12 -3
- package/sdk/native-hashes.json +1 -0
- package/skills/contrast/SKILL.md +2 -1
- package/skills/peach-test/SKILL.md +7 -3
- package/src/admitted-mac-build.ts +3 -0
- package/src/android-app-identity.ts +18 -0
- package/src/android-root-module.ts +9 -9
- package/src/appPackageContract.ts +81 -0
- package/src/bridge-contract.ts +50 -0
- package/src/bundle-channel.mjs +21 -4
- package/src/dev-bundle-resolution.ts +7 -27
- package/src/dom-source-reference.ts +15 -0
- package/src/expo-discovery-cache.ts +127 -23
- package/src/expo-manifest-body.ts +33 -0
- package/src/expo-native-workspace.ts +38 -13
- package/src/expo-swift-host.ts +264 -62
- package/src/expoSwiftContract.ts +3 -0
- package/src/generated/swift-c-predefines.json +1 -1
- package/src/home-paths.ts +35 -1
- package/src/host/app-package-handler.ts +47 -0
- package/src/host/bridge-host.ts +3 -0
- package/src/host/staged-host-files.ts +18 -0
- package/src/index.ts +3 -0
- package/src/kotlin-host.ts +21 -18
- package/src/kotlin-instance-source.ts +126 -0
- package/src/menu.ts +7 -0
- package/src/native-app-identity-project.ts +7 -2
- package/src/native-app-identity.ts +11 -0
- package/src/native-firebase-config.ts +24 -1
- package/src/nitro-adapter.lock.json +268 -268
- package/src/nitro-bundle.ts +8 -0
- package/src/nitro-compile.ts +35 -9
- package/src/nitro-dependencies.ts +21 -19
- package/src/nitro-source.ts +4 -0
- package/src/nitroContract.ts +7 -0
- package/src/react-native-bridge-modules.ts +68 -42
- package/src/react-native-host-modules.ts +31 -1
- package/src/reactNativeConfigurationContract.ts +14 -0
- package/src/reap-browser.ts +15 -3
- package/src/sdk.ts +5 -0
- package/src/settingsContract.ts +27 -1
- package/src/sim-client.ts +4 -1
- package/src/storageSnapshotContract.ts +3 -0
- package/src/swift-compile.ts +221 -41
- package/src/swift-coverage/provenance.ts +1 -0
- package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
- package/src/swift-coverage/xcode-assets.ts +89 -131
- package/src/swift-coverage/xcode.ts +1 -1
- package/src/swift-cxx-reachable.ts +2 -1
- package/src/swift-distribution.lock.json +14 -13
- package/src/swift-host.ts +95 -22
- package/src/swift-icu.ts +1 -1
- package/src/swift-link-roots.ts +118 -0
- package/src/swift-objc-compile.ts +144 -22
- package/src/swift-objc-import.ts +6 -0
- package/src/swift-objc-standin.ts +2 -14
- package/src/swift-package-manifest.ts +14 -6
- package/src/swift-packages.ts +75 -11
- package/src/swift-pdf-raster.ts +1 -0
- package/src/swift-root-lock.ts +17 -1
- package/src/swift-source-pods.ts +2 -10
- package/src/swift-standin-emit.ts +592 -57
- package/src/swift-standins.ts +430 -49
- package/src/swift-submit.ts +3 -1
- package/src/swift-toolchain.ts +140 -17
- package/src/turbo-codegen-intake.ts +91 -0
- package/src/vite-plugin-one.ts +13 -9
- package/src/vite-plugin.ts +28 -15
- package/src/xcode-project.ts +223 -22
package/README.md
CHANGED
|
@@ -188,6 +188,19 @@ source file and its development or production mode. Metro bundles and other
|
|
|
188
188
|
staged resources retain their original bytes. Metro assets in an `assets` folder
|
|
189
189
|
beside the bundle are staged and served using the bundle's asset identities.
|
|
190
190
|
`peach test --app` uses the same staged bundle and assets.
|
|
191
|
+
File targets use the metadata carried by the bundle. Supply
|
|
192
|
+
`--project-root <app-directory>` to associate a file with a local app's native
|
|
193
|
+
configuration and installed packages. The file's location and the CLI's working
|
|
194
|
+
directory do not establish that association.
|
|
195
|
+
|
|
196
|
+
`peach open ./App.swift` compiles the selected Swift application entry locally
|
|
197
|
+
and opens it through the Swift guest host. SwiftPM directories (or their
|
|
198
|
+
`Package.swift`), Xcode projects and workspaces use the same project compiler,
|
|
199
|
+
resource discovery and watcher as `peach swift`. Select an Xcode application
|
|
200
|
+
with `--scheme <name>` or `--target <name>`. Android app module directories
|
|
201
|
+
containing `src/main/AndroidManifest.xml` use the existing Kotlin compiler and
|
|
202
|
+
guest host; `--activity <name>` selects the activity. These native commands stay
|
|
203
|
+
running to watch sources and stop their owned preview on exit.
|
|
191
204
|
|
|
192
205
|
For apps using `react-native-config`, open with `peach open <app-port> --load-env`.
|
|
193
206
|
This reads the local project's native dotenv values for `RNCConfigModule`;
|
|
@@ -256,7 +269,10 @@ bridge always addresses the **shell worker**, never an undifferentiated sim.
|
|
|
256
269
|
and **`peachsim/metro`** plugins do one thing: serve the installed runtime at
|
|
257
270
|
`/__peachsim/` so an app's own dev server can host the sim shell. The Vite plugin accepts an
|
|
258
271
|
opt-in `open` option that launches a named Electron window when the dev server
|
|
259
|
-
starts (skipped when `CI` or `PEACH_NO_OPEN` is set).
|
|
272
|
+
starts (skipped when `CI` or `PEACH_NO_OPEN` is set). It preserves shell query
|
|
273
|
+
parameters and explicit `bundle` values. A nonempty `demoApp` selects shell
|
|
274
|
+
content without adding a guest bundle; other launches receive the default
|
|
275
|
+
One bundle at the request's HTTP/1 Host or HTTP/2 authority.
|
|
260
276
|
- The internal **`sootsim()`** plugin (`src/vite-plugin.ts`) is a separate, much
|
|
261
277
|
larger RN-resolution / native-stub plugin: it aliases `react-native` to the
|
|
262
278
|
engine shim and native packages to `@sootsim/compat` stubs, applies worklets
|
|
@@ -743,8 +759,10 @@ native content, a populated node tree, or a live-frame channel whose publish
|
|
|
743
759
|
count advances across probes. Canvas-only GL, WebGPU, and video surfaces can
|
|
744
760
|
therefore prove that they are painting without weakening the boot-card guard.
|
|
745
761
|
A confirmed guest launch error ends readiness immediately, including waits longer
|
|
746
|
-
than one bridge request.
|
|
747
|
-
|
|
762
|
+
than one bridge request. A native root still mounting (a Swift view that has not
|
|
763
|
+
committed its first tree) reads as loading even after the guest set its ready flag, so
|
|
764
|
+
a crash during that mount fails the wait instead of landing after it reports ready.
|
|
765
|
+
Loading and suppressed entry errors keep their existing readiness rules. The default wait follows Metro and guest progress (bundle
|
|
748
766
|
percent, startup phase, tree growth) and fails when that progress stalls for
|
|
749
767
|
60 seconds or the 10-minute cap passes, naming the phase that stalled (bundle,
|
|
750
768
|
evaluation, first paint). `--max-ms` / `--timeout` is a hard deadline.
|
|
@@ -16,8 +16,9 @@ export function stageAppBundleResources(
|
|
|
16
16
|
appDir: string,
|
|
17
17
|
origin: string,
|
|
18
18
|
iosTarget?: string,
|
|
19
|
+
environment?: Record<string, string>,
|
|
19
20
|
): AppBundleResources {
|
|
20
|
-
const app = readIosAppTarget(appDir, iosTarget)
|
|
21
|
+
const app = readIosAppTarget(appDir, iosTarget, environment)
|
|
21
22
|
if (!app) return {}
|
|
22
23
|
// a monorepo app's font and asset resources live in the workspace root
|
|
23
24
|
const root = fs.realpathSync(findWorkspaceRoot(appDir))
|
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 { getCliRuntime } from '../src/cli-runtime.ts'
|
|
6
6
|
import { stageHostFile } from '../src/host/staged-host-files'
|
|
7
|
+
import { resolveExpoConfigModule } from '../src/native-firebase-config'
|
|
7
8
|
import { parsePlistSource } from '../src/plist.ts'
|
|
8
9
|
import { listXcodeAppTargets, readXcodeAppTarget } from '../src/xcode-project'
|
|
9
10
|
import { resolveAppProject } from './app-project'
|
|
@@ -110,10 +111,9 @@ function discoverNativeLinkedAppFontAssets(opts: {
|
|
|
110
111
|
// resolve from the exact app root advertised by the development server.
|
|
111
112
|
if (project) {
|
|
112
113
|
try {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
const mod = require(modulePath) as { getConfig?: unknown }
|
|
114
|
+
const mod = require(resolveExpoConfigModule(selectedAppDir)) as {
|
|
115
|
+
getConfig?: unknown
|
|
116
|
+
}
|
|
117
117
|
if (typeof mod.getConfig === 'function') {
|
|
118
118
|
getConfig = mod.getConfig as ExpoConfigGetter
|
|
119
119
|
}
|
package/cli/app-splash.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { createRequire } from 'node:module'
|
|
|
4
4
|
import path from 'node:path'
|
|
5
5
|
import { loopbackOriginOf } from '../src/backend-origin'
|
|
6
6
|
import { getCliRuntime } from '../src/cli-runtime.ts'
|
|
7
|
+
import { resolveExpoConfigModule } from '../src/native-firebase-config'
|
|
7
8
|
import { resolveAppProject } from './app-project'
|
|
8
9
|
import type { ConfigPluginSplashSpec } from '#peach-cli-contract/engine/config-plugin-splash'
|
|
9
10
|
|
|
@@ -77,10 +78,9 @@ export function discoverConfigPluginAppSplash(opts: {
|
|
|
77
78
|
|
|
78
79
|
let getConfig: ExpoConfigGetter | null = null
|
|
79
80
|
try {
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
const mod = require(modulePath) as { getConfig?: unknown }
|
|
81
|
+
const mod = require(resolveExpoConfigModule(selectedAppDir)) as {
|
|
82
|
+
getConfig?: unknown
|
|
83
|
+
}
|
|
84
84
|
if (typeof mod.getConfig === 'function') {
|
|
85
85
|
getConfig = mod.getConfig as ExpoConfigGetter
|
|
86
86
|
}
|
package/cli/app-stubs.ts
CHANGED
|
@@ -389,6 +389,23 @@ export function sourceNativeRequests(
|
|
|
389
389
|
LogicalExpression(node) {
|
|
390
390
|
if (node.operator === '&&') guard(node.left, node.right)
|
|
391
391
|
},
|
|
392
|
+
VariableDeclarator(node) {
|
|
393
|
+
if (
|
|
394
|
+
!includeLegacy ||
|
|
395
|
+
!node.init ||
|
|
396
|
+
nativeLookupName(node.init) !== 'NativeModules' ||
|
|
397
|
+
node.id.type !== 'ObjectPattern'
|
|
398
|
+
)
|
|
399
|
+
return
|
|
400
|
+
for (const property of node.id.properties) {
|
|
401
|
+
if (property.type !== 'Property') continue
|
|
402
|
+
const key = property.key
|
|
403
|
+
if (!property.computed && key.type === 'Identifier')
|
|
404
|
+
add('module', key.name, property.start, false)
|
|
405
|
+
else if (key.type === 'Literal' && typeof key.value === 'string')
|
|
406
|
+
add('module', key.value, property.start, false)
|
|
407
|
+
}
|
|
408
|
+
},
|
|
392
409
|
CallExpression(node) {
|
|
393
410
|
const first = node.arguments[0]
|
|
394
411
|
if (first?.type !== 'Literal' || typeof first.value !== 'string') return
|