peachsim 0.1.1738 → 0.1.1744
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 +4 -0
- package/cli/app-catalog.ts +47 -23
- package/cli/app-fonts.ts +19 -1
- package/cli/command-registry.ts +3 -0
- package/cli/commands/control.ts +67 -16
- package/cli/commands/device.ts +3 -1
- package/cli/commands/doctor.ts +1 -4
- package/cli/commands/inspect/settling.ts +6 -1
- package/cli/commands/inspect/wait-ready.ts +22 -2
- package/cli/commands/package.ts +22 -20
- package/cli/commands/push.ts +56 -0
- package/cli/commands/serve.ts +9 -0
- package/cli/commands/shell-url.ts +37 -9
- package/cli/commands/swift.ts +1 -1
- package/cli/current-sim.ts +27 -0
- package/cli/drivers/linux-browser-libs.lock.json +323 -1
- package/cli/drivers/linux-browser-libs.ts +8 -6
- package/cli/drivers/playwright.ts +5 -1
- package/cli/internal-child.ts +11 -1
- package/cli/main.ts +6 -0
- package/cli/native-input.ts +1 -7
- package/cli/outbound-endpoints.ts +9 -1
- package/cli/packaged-app-launcher.ts +3 -1
- package/cli/scene-video.ts +4 -0
- package/cli/ws-bridge.ts +3 -1
- package/detox/index.ts +9 -4
- 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 +7372 -3675
- 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 +22 -8
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +6340 -3064
- package/dist-lib/expo-swift-metadata.cjs +14 -2
- package/dist-lib/expo-swift-metadata.mjs +14 -2
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +6524 -2720
- package/dist-lib/host/fetch-proxy-handler.cjs +8 -7
- 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 +6 -3
- package/dist-lib/index.cjs +97 -31
- 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 +1 -1
- package/dist-lib/menu.mjs +1 -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 +71 -29
- package/dist-lib/native-app-identity-project.cjs +53 -22
- package/dist-lib/native-app-identity-project.mjs +53 -22
- package/dist-lib/native-app-identity.cjs +10 -3
- package/dist-lib/native-app-identity.mjs +10 -3
- 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 +25 -23
- package/dist-lib/public-origins-lib.json +111 -79
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +4 -1
- package/dist-lib/sdk.mjs +4 -1
- package/dist-lib/skills.cjs +40549 -37613
- package/dist-lib/swift-compile.cjs +2054 -388
- package/dist-lib/swift-compile.mjs +1976 -312
- 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 +68 -8
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +5867 -2646
- package/dist-lib/vite.cjs +18 -8
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +0 -3
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +25 -3
- package/dist-types/packages/peach-engine/src/engine/scroll-platform.d.ts +1 -15
- package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +1 -3
- package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +23 -0
- package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/metro-identity-contract.d.ts +33 -0
- package/dist-types/packages/peach-engine/src/preview/bundle-layout.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/remote-stream/scene-recording.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +28 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +21 -1
- package/dist-types/packages/peach-engine/src/render-worker/prepared-boot-bundle.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +8 -0
- package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/test-bridge-protocol.d.ts +3 -3
- package/dist-types/packages/peach-engine/src/render-worker/webgpu-frame-transaction.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/webgpu-readback-scheduler.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +8 -1
- package/dist-types/packages/peach-engine/src/rolldown-production-fingerprint.d.ts +1 -4
- package/dist-types/packages/peach-engine/src/rolldown-production-module.d.ts +12 -0
- package/dist-types/packages/peach-engine/src/rolldown-production-roles.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +6 -1
- package/dist-types/packages/peach-engine/src/settings/duo-fold-bus.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/shell-events.d.ts +4 -0
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +7 -0
- package/package.json +2 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +1 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h +257 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h +305 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h +204 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h +260 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h +164 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h +101 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h +510 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h +1132 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h +34 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h +83 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h +197 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h +36 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h +38 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h +312 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h +106 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h +123 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h +31 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h +409 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h +78 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h +120 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h +55 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h +535 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h +133 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h +252 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFMarkedContentItem.h +37 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h +67 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h +51 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h +101 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h +123 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h +44 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h +52 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStructureElement.h +87 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h +441 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h +89 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRenderingBufferProvider.h +49 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h +124 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h +85 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +44 -252
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap +1 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/CFNetworkErrors.h +257 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +0 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +356 -61
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/NSURLSession+Network.h +32 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/Network.h +51 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/advertise_descriptor.h +193 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_descriptor.h +163 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_result.h +207 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browser.h +285 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection.h +714 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_group.h +629 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_report.h +932 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/content_context.h +229 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/endpoint.h +390 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/error.h +135 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ethernet_channel.h +349 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/framer_options.h +1187 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/group_descriptor.h +184 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/interface.h +150 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ip_options.h +351 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/listener.h +438 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/nw_object.h +200 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/parameters.h +1205 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path.h +392 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path_monitor.h +216 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/privacy_context.h +188 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/protocol_options.h +126 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/proxy_config.h +357 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/quic_options.h +889 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/resolver_config.h +94 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tcp_options.h +459 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tls_options.h +115 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/txt_record.h +432 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/udp_options.h +112 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ws_options.h +743 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Modules/module.modulemap +9 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h +395 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h +132 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h +107 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterCell.h +153 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterLayer.h +151 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAFrameRateRange.h +40 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAGradientLayer.h +78 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1078 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h +97 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h +67 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAReplicatorLayer.h +65 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAScrollLayer.h +64 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAShapeLayer.h +135 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATextLayer.h +99 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATiledLayer.h +67 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h +124 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h +138 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransformLayer.h +40 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h +78 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +19 -38
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h +1757 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h +19 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h +28 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h +114 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +16 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarAppearance.h +47 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDataDetectors.h +20 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h +13 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h +16 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h +84 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h +119 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizerSubclass.h +66 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIHoverGestureRecognizer.h +45 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +161 -37
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h +76 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h +8 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBarAppearance.h +78 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h +29 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h +104 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h +19 -0
- package/sdk/ios/usr/include/dns_sd.h +3616 -0
- package/sdk/ios/usr/include/dnssd.modulemap +4 -0
- package/sdk/ios/usr/include/module.modulemap +1 -0
- package/sdk/ios/usr/include/sys/socketvar.h +191 -0
- package/sdk/ios/usr/include/sys/vsock.h +84 -0
- package/sdk/native-hashes.json +1 -1
- package/skills/contrast/SKILL.md +6 -5
- package/skills/peach-debug/SKILL.md +68 -264
- package/skills/peach-debug/references/accessibility.md +37 -73
- package/skills/peach-debug/references/commands.md +2 -2
- package/skills/peach-debug/references/events.md +74 -0
- package/skills/peach-perf/SKILL.md +64 -401
- package/skills/peach-perf/references/presentation.md +46 -0
- package/skills/peach-perf/references/profiling.md +93 -0
- package/skills/peach-perf/references/render-counters.md +57 -0
- package/skills/peach-setup/SKILL.md +66 -216
- package/skills/peach-setup/references/native-config.md +35 -0
- package/skills/peach-setup/references/reporting.md +28 -0
- package/skills/peach-test/SKILL.md +68 -284
- package/skills/peach-test/references/detox.md +69 -0
- package/skills/peach-test/references/maestro.md +95 -0
- package/skills/peach-visual/SKILL.md +53 -105
- package/src/appPackageContract.ts +12 -1
- package/src/assetCatalogContract.ts +8 -1
- package/src/bridge-contract.ts +6 -0
- package/src/bundle-channel.mjs +133 -59
- package/src/cli-runtime.ts +8 -9
- package/src/configured-bundle-producer.ts +10 -0
- package/src/device-catalog.ts +68 -4
- package/src/expo-discovery-cache.ts +3 -0
- package/src/expo-native-workspace.ts +81 -17
- package/src/expo-swift-host.ts +57 -104
- package/src/expo-widget-assets.ts +76 -0
- package/src/expoSwiftContract.ts +13 -1
- package/src/host/websocket-proxy.ts +7 -2
- package/src/native-prebuilt.ts +3 -3
- package/src/nitro-adapter.lock.json +263 -263
- package/src/nitro-adapter.ts +69 -7
- package/src/nitro-bundle.ts +52 -24
- package/src/nitro-compile.ts +6 -1
- package/src/nitro-source.ts +82 -4
- package/src/nitro-superset.lock.json +103 -0
- package/src/nitro-superset.ts +137 -0
- package/src/nitroContract.ts +5 -1
- package/src/react-bridge-importers.ts +1 -0
- package/src/settingsContract.ts +26 -1
- package/src/swift-compile.ts +267 -68
- package/src/swift-compiler-digest.ts +2 -0
- package/src/swift-coverage/xcode-packages.ts +61 -1
- package/src/swift-coverage/xcode.ts +10 -12
- package/src/swift-cxx-reachable.ts +1 -1
- package/src/swift-distribution.lock.json +15 -13
- package/src/swift-distribution.ts +57 -26
- package/src/swift-host.ts +48 -35
- package/src/swift-link-roots.ts +45 -18
- package/src/swift-objc-compile.ts +78 -2
- package/src/swift-objc-standin.ts +3 -0
- package/src/swift-shared-sdk.ts +85 -1
- package/src/swift-standins.ts +233 -11
- package/src/swift-submit.ts +13 -1
- package/src/swift-toolchain.ts +82 -7
- package/src/swift-wasm-prune.ts +1629 -0
- package/src/turbo-bundle.ts +11 -10
- package/src/turbo-runtime.lock.json +16 -16
- package/src/vite-plugin-one.ts +12 -1
- package/src/vite-plugin.ts +82 -23
- package/src/wasm-optimize.ts +34 -0
- package/src/worker-system-chunks.ts +3 -3
- package/src/xcode-project.ts +52 -0
- package/src/xcode-target-members.ts +12 -1
package/README.md
CHANGED
|
@@ -766,6 +766,10 @@ Loading and suppressed entry errors keep their existing readiness rules. The def
|
|
|
766
766
|
percent, startup phase, tree growth) and fails when that progress stalls for
|
|
767
767
|
60 seconds or the 10-minute cap passes, naming the phase that stalled (bundle,
|
|
768
768
|
evaluation, first paint). `--max-ms` / `--timeout` is a hard deadline.
|
|
769
|
+
`peach wait ready --verbose` reports host elapsed time for the ready wait,
|
|
770
|
+
idle settle, and final ready check, including a phase interrupted by a failure.
|
|
771
|
+
It also prints the startup state with progress and the accepted probe. Cloud
|
|
772
|
+
waits report only the ready phase because they do not run the local settle.
|
|
769
773
|
|
|
770
774
|
```yaml
|
|
771
775
|
- takeScreenshot: hero
|
package/cli/app-catalog.ts
CHANGED
|
@@ -37,6 +37,39 @@ function catalogFiles(dir: string, found: string[]) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// both the application and extension hosts use the same catalog namespace
|
|
41
|
+
// and scale rules; the host owns where each image's immutable bytes live.
|
|
42
|
+
export function readAssetCatalog(
|
|
43
|
+
files: readonly string[],
|
|
44
|
+
readContents: (file: string) => string | null,
|
|
45
|
+
imageUri: (file: string) => string | null,
|
|
46
|
+
accentName: string | null,
|
|
47
|
+
): AppCatalog | null {
|
|
48
|
+
const colors = enumerateBundleColors(files, readContents)
|
|
49
|
+
const symbols = enumerateBundleSymbols(files, readContents, () => '.')
|
|
50
|
+
const images: AppCatalog['images'] = {}
|
|
51
|
+
for (const { name, file, scale, renderingMode } of enumerateBundleImages(
|
|
52
|
+
files,
|
|
53
|
+
readContents,
|
|
54
|
+
)) {
|
|
55
|
+
const uri = imageUri(file)
|
|
56
|
+
if (uri !== null)
|
|
57
|
+
(images[name] ??= []).push({
|
|
58
|
+
uri,
|
|
59
|
+
scale,
|
|
60
|
+
...(renderingMode ? { renderingMode } : {}),
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
if (
|
|
64
|
+
accentName === null &&
|
|
65
|
+
Object.keys(colors).length === 0 &&
|
|
66
|
+
Object.keys(images).length === 0 &&
|
|
67
|
+
Object.keys(symbols).length === 0
|
|
68
|
+
)
|
|
69
|
+
return null
|
|
70
|
+
return { colors, images, symbols, accentName }
|
|
71
|
+
}
|
|
72
|
+
|
|
40
73
|
// the app's asset-catalog colors, images, symbols and declared accent, read off
|
|
41
74
|
// the ios project a prebuild or a bare app keeps on disk: the app target is
|
|
42
75
|
// the folder holding the AppDelegate, the catalogs are its .xcassets, and the
|
|
@@ -67,23 +100,7 @@ export function discoverAppCatalog(
|
|
|
67
100
|
path.relative(targetDir, file).split(path.sep).join(path.posix.sep),
|
|
68
101
|
)
|
|
69
102
|
const readContents = (candidate: string) => readText(path.join(targetDir, candidate))
|
|
70
|
-
const colors = enumerateBundleColors(relative, readContents)
|
|
71
|
-
const symbols = enumerateBundleSymbols(relative, readContents, () => '.')
|
|
72
103
|
const served = path.relative(appDir, targetDir).split(path.sep).join(path.posix.sep)
|
|
73
|
-
const images: AppCatalog['images'] = {}
|
|
74
|
-
for (const { name, file, scale } of enumerateBundleImages(relative, readContents)) {
|
|
75
|
-
// pdf imagesets rasterize on swift hosts; metro serves bytes it cannot
|
|
76
|
-
// rasterize. a pdf stays a loud miss here (the render reports it too)
|
|
77
|
-
// so one vector never drops the rasters beside it; throwing would
|
|
78
|
-
// discard this whole best-effort catalog at the caller's catch.
|
|
79
|
-
if (file.toLowerCase().endsWith('.pdf')) {
|
|
80
|
-
console.error(
|
|
81
|
-
`peach: pdf asset catalog image '${name}' needs swift-host rasterizing; it stays a miss under metro`,
|
|
82
|
-
)
|
|
83
|
-
continue
|
|
84
|
-
}
|
|
85
|
-
;(images[name] ??= []).push({ uri: `${metroOrigin}/assets/${served}/${file}`, scale })
|
|
86
|
-
}
|
|
87
104
|
const pbxproj = listDir(iosDir).find((entry) => entry.name.endsWith('.xcodeproj'))
|
|
88
105
|
const accentName =
|
|
89
106
|
readText(path.join(targetDir, 'Info.plist'))?.match(PLIST_ACCENT)?.[1] ??
|
|
@@ -93,12 +110,19 @@ export function discoverAppCatalog(
|
|
|
93
110
|
)?.[1]
|
|
94
111
|
: undefined) ??
|
|
95
112
|
null
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
113
|
+
return readAssetCatalog(
|
|
114
|
+
relative,
|
|
115
|
+
readContents,
|
|
116
|
+
(file) => {
|
|
117
|
+
// metro cannot rasterize a pdf; the swift host owns that conversion.
|
|
118
|
+
if (file.toLowerCase().endsWith('.pdf')) {
|
|
119
|
+
console.error(
|
|
120
|
+
`peach: pdf asset catalog image '${file}' needs swift-host rasterizing; it stays a miss under metro`,
|
|
121
|
+
)
|
|
122
|
+
return null
|
|
123
|
+
}
|
|
124
|
+
return `${metroOrigin}/assets/${served}/${file}`
|
|
125
|
+
},
|
|
126
|
+
accentName,
|
|
101
127
|
)
|
|
102
|
-
return null
|
|
103
|
-
return { colors, images, symbols, accentName }
|
|
104
128
|
}
|
package/cli/app-fonts.ts
CHANGED
|
@@ -88,6 +88,24 @@ function projectRelativeFontPaths(projectDir: string, fontPaths: string[]): stri
|
|
|
88
88
|
})
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
// expo-font's config plugin resolves a declared font against the project root
|
|
92
|
+
// first and, when nothing sits there, as a module specifier from the project
|
|
93
|
+
// (`@expo-google-fonts/dm-sans/400Regular/DMSans_400Regular.ttf`); a directory
|
|
94
|
+
// links every file inside it (expo-font plugin/src/utils.ts resolveFontPaths).
|
|
95
|
+
function resolveDeclaredFontPath(appDir: string, declared: string): string[] {
|
|
96
|
+
let resolved = path.resolve(appDir, declared)
|
|
97
|
+
if (!fs.existsSync(resolved)) {
|
|
98
|
+
try {
|
|
99
|
+
resolved = createRequire(path.join(appDir, 'package.json')).resolve(declared)
|
|
100
|
+
} catch {
|
|
101
|
+
return []
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return fs.statSync(resolved).isDirectory()
|
|
105
|
+
? fs.readdirSync(resolved).map((file) => path.join(resolved, file))
|
|
106
|
+
: [resolved]
|
|
107
|
+
}
|
|
108
|
+
|
|
91
109
|
function isFile(filePath: string): boolean {
|
|
92
110
|
try {
|
|
93
111
|
return fs.statSync(filePath).isFile()
|
|
@@ -136,7 +154,7 @@ function discoverNativeLinkedAppFontAssets(opts: {
|
|
|
136
154
|
const fontPaths = getCliRuntime()
|
|
137
155
|
.engine_config_plugin_fonts.expoFontPathsFromPlugins(plugins, platform)
|
|
138
156
|
.slice(0, 256)
|
|
139
|
-
.
|
|
157
|
+
.flatMap((fontPath) => resolveDeclaredFontPath(selectedAppDir, fontPath))
|
|
140
158
|
.filter(isFile)
|
|
141
159
|
const materialFonts =
|
|
142
160
|
platform === 'android' ? materialSymbolFontPaths(selectedAppDir) : []
|
package/cli/command-registry.ts
CHANGED
|
@@ -31,6 +31,7 @@ const NODE_COMMAND_NAMES = [
|
|
|
31
31
|
'reset',
|
|
32
32
|
'camera',
|
|
33
33
|
'location',
|
|
34
|
+
'push',
|
|
34
35
|
'mode',
|
|
35
36
|
'debug',
|
|
36
37
|
'timeline',
|
|
@@ -130,6 +131,7 @@ const VALUE_FLAGS = new Set([
|
|
|
130
131
|
'--timeout',
|
|
131
132
|
'--device',
|
|
132
133
|
'--posture',
|
|
134
|
+
'--window',
|
|
133
135
|
'--render-resolution',
|
|
134
136
|
'--os-version',
|
|
135
137
|
'--ios-target',
|
|
@@ -300,6 +302,7 @@ export function createRnxCommandInvocation(
|
|
|
300
302
|
case 'permissions':
|
|
301
303
|
case 'camera':
|
|
302
304
|
case 'location':
|
|
305
|
+
case 'push':
|
|
303
306
|
return { ...common, family: 'action' }
|
|
304
307
|
case 'screenshot':
|
|
305
308
|
return { ...common, family: 'screenshot', command: 'screenshot' }
|
package/cli/commands/control.ts
CHANGED
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
clearCurrentSimId,
|
|
62
62
|
markOpenPending,
|
|
63
63
|
getStableOwnerPid,
|
|
64
|
+
saveAgentId,
|
|
64
65
|
readCurrentSimId,
|
|
65
66
|
saveCurrentSimId,
|
|
66
67
|
} from '../current-sim'
|
|
@@ -1309,12 +1310,14 @@ async function openSim(
|
|
|
1309
1310
|
'--remap',
|
|
1310
1311
|
'--driver',
|
|
1311
1312
|
'--profile',
|
|
1313
|
+
'--id',
|
|
1312
1314
|
'--cdp-port',
|
|
1313
1315
|
'--device',
|
|
1314
1316
|
'-d',
|
|
1315
1317
|
'--posture',
|
|
1316
1318
|
'--render-resolution',
|
|
1317
1319
|
'--orientation',
|
|
1320
|
+
'--window',
|
|
1318
1321
|
'--os-version',
|
|
1319
1322
|
'--ios-target',
|
|
1320
1323
|
'--target',
|
|
@@ -1322,6 +1325,7 @@ async function openSim(
|
|
|
1322
1325
|
'--activity',
|
|
1323
1326
|
'--viewport',
|
|
1324
1327
|
'--env',
|
|
1328
|
+
'--arg',
|
|
1325
1329
|
'--theme',
|
|
1326
1330
|
'-t',
|
|
1327
1331
|
],
|
|
@@ -1361,6 +1365,15 @@ async function openSim(
|
|
|
1361
1365
|
commandTimeoutMs: opts.timeoutMs,
|
|
1362
1366
|
})
|
|
1363
1367
|
const requestedProfileId = args.find((_, i) => args[i - 1] === '--profile')
|
|
1368
|
+
const agentIdFlag = args.indexOf('--id')
|
|
1369
|
+
if (agentIdFlag !== -1) {
|
|
1370
|
+
const agentId = args[agentIdFlag + 1]?.trim()
|
|
1371
|
+
if (!agentId || agentId.startsWith('-')) {
|
|
1372
|
+
console.error(' peach open: --id expects a name, such as --id checkout-agent')
|
|
1373
|
+
peachExit(1)
|
|
1374
|
+
}
|
|
1375
|
+
saveAgentId(agentId)
|
|
1376
|
+
}
|
|
1364
1377
|
const quiet = args.includes('--quiet')
|
|
1365
1378
|
const json = args.includes('--json')
|
|
1366
1379
|
const ephemeralProfile = args.includes('--ephemeral')
|
|
@@ -1712,13 +1725,19 @@ async function openSim(
|
|
|
1712
1725
|
}
|
|
1713
1726
|
}
|
|
1714
1727
|
|
|
1715
|
-
// --posture <open|
|
|
1716
|
-
// stamped on the engine URL next to ?device= so it round-trips
|
|
1717
|
-
// being swallowed into the bundle param. only foldable devices
|
|
1718
|
-
//
|
|
1728
|
+
// --posture <closed|book|open|laptop|tent> seeds the fold rest for the
|
|
1729
|
+
// opened sim, stamped on the engine URL next to ?device= so it round-trips
|
|
1730
|
+
// instead of being swallowed into the bundle param. only foldable devices
|
|
1731
|
+
// (iphone-duo) fold; anything else resolves to closed at boot. the display
|
|
1732
|
+
// posture and interface orientation the rest lays out ride beside it.
|
|
1719
1733
|
const postureArg = args.find((_, i) => args[i - 1] === '--posture')
|
|
1720
|
-
|
|
1721
|
-
|
|
1734
|
+
const foldBus = getCliRuntime().settings_duo_fold_bus
|
|
1735
|
+
const postureRest = postureArg ?? null
|
|
1736
|
+
const restArg = foldBus.isDuoFoldRest(postureRest) ? postureRest : undefined
|
|
1737
|
+
if (postureArg && !restArg) {
|
|
1738
|
+
console.error(
|
|
1739
|
+
` peach open: --posture must be ${Object.keys(foldBus.DUO_REST_PROGRESS).join(', ')}, got "${postureArg}"`,
|
|
1740
|
+
)
|
|
1722
1741
|
peachExit(1)
|
|
1723
1742
|
}
|
|
1724
1743
|
const renderResolutionArg = args.find((_, i) => args[i - 1] === '--render-resolution')
|
|
@@ -1744,17 +1763,32 @@ async function openSim(
|
|
|
1744
1763
|
)
|
|
1745
1764
|
peachExit(1)
|
|
1746
1765
|
}
|
|
1766
|
+
// --window <WxH> opens the dynamic device's window at that size in points;
|
|
1767
|
+
// the shell clamps it to the iPadOS window limits
|
|
1768
|
+
const windowArg = args.find((_, i) => args[i - 1] === '--window')
|
|
1769
|
+
const windowMatch = windowArg ? /^(\d+)x(\d+)$/.exec(windowArg) : null
|
|
1770
|
+
if (windowArg && (!windowMatch || deviceArg !== 'dynamic')) {
|
|
1771
|
+
console.error(
|
|
1772
|
+
` peach open: --window takes <width>x<height> with --device dynamic, got "${windowArg}"`,
|
|
1773
|
+
)
|
|
1774
|
+
peachExit(1)
|
|
1775
|
+
}
|
|
1776
|
+
const windowSize = windowMatch
|
|
1777
|
+
? { width: Number(windowMatch[1]), height: Number(windowMatch[2]) }
|
|
1778
|
+
: undefined
|
|
1747
1779
|
// the window fits the box the browser stage fits the device into, which for
|
|
1748
1780
|
// a foldable spans both postures, so the device draws at its natural size in
|
|
1749
1781
|
// the posture it opens in instead of shrinking into a window sized for one.
|
|
1750
|
-
const deviceFitBox =
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1782
|
+
const deviceFitBox =
|
|
1783
|
+
windowSize ??
|
|
1784
|
+
(deviceArg
|
|
1785
|
+
? getCliRuntime().settings_devices.resolveDeviceFitBox(
|
|
1786
|
+
deviceArg as DeviceModel,
|
|
1787
|
+
false,
|
|
1788
|
+
orientationArg,
|
|
1789
|
+
restArg ? foldBus.duoRestPosture(restArg) : 'closed',
|
|
1790
|
+
)
|
|
1791
|
+
: undefined)
|
|
1758
1792
|
|
|
1759
1793
|
// --os-version <major.minor> pins the portrayed os over the profile's.
|
|
1760
1794
|
const osVersionArg = args.find((_, i) => args[i - 1] === '--os-version')
|
|
@@ -1783,6 +1817,16 @@ async function openSim(
|
|
|
1783
1817
|
envArgs.push(raw)
|
|
1784
1818
|
}
|
|
1785
1819
|
|
|
1820
|
+
// --arg <value> (repeatable) is one launch argument, the peach analogue of
|
|
1821
|
+
// a `simctl launch` argument: stamped as repeated ?arg=, carried on
|
|
1822
|
+
// AppLoadRequest, and handed to a Swift guest as ProcessInfo.arguments[1...]
|
|
1823
|
+
// verbatim, each value its own element after the executable path.
|
|
1824
|
+
const launchArgs = args.flatMap((arg, i) => (args[i - 1] === '--arg' ? [arg] : []))
|
|
1825
|
+
if (args.at(-1) === '--arg') {
|
|
1826
|
+
console.error(' peach open: --arg expects a value')
|
|
1827
|
+
peachExit(1)
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1786
1830
|
// --viewport <WxH> sizes the driver-launched page explicitly (film and
|
|
1787
1831
|
// promo captures frame the 3d stage in landscape). takes precedence over
|
|
1788
1832
|
// the device-derived window; without either, the driver keeps its own
|
|
@@ -1828,9 +1872,15 @@ async function openSim(
|
|
|
1828
1872
|
hot: hotMode,
|
|
1829
1873
|
hostDriver: driverId === 'desktop' ? 'desktop' : undefined,
|
|
1830
1874
|
device: deviceArg,
|
|
1831
|
-
posture:
|
|
1875
|
+
posture: restArg ? foldBus.duoRestPosture(restArg) : undefined,
|
|
1876
|
+
rest: restArg,
|
|
1832
1877
|
renderResolution: renderResolutionArg,
|
|
1833
|
-
orientation:
|
|
1878
|
+
orientation:
|
|
1879
|
+
orientationArg ??
|
|
1880
|
+
(restArg && foldBus.duoRestTurnsBody(restArg)
|
|
1881
|
+
? foldBus.duoRestOrientation(restArg, true)
|
|
1882
|
+
: undefined),
|
|
1883
|
+
windowSize,
|
|
1834
1884
|
osVersion: osVersionArg,
|
|
1835
1885
|
theme: themeArg,
|
|
1836
1886
|
iosTarget: args.find((_, i) => args[i - 1] === '--ios-target'),
|
|
@@ -1840,6 +1890,7 @@ async function openSim(
|
|
|
1840
1890
|
proof: args.includes('--proof'),
|
|
1841
1891
|
ephemeral: ephemeralProfile,
|
|
1842
1892
|
env: envArgs.length ? envArgs : undefined,
|
|
1893
|
+
args: launchArgs.length ? launchArgs : undefined,
|
|
1843
1894
|
dotEnv,
|
|
1844
1895
|
bridgePort: parsed.explicitPort ? parsed.wsPort : undefined,
|
|
1845
1896
|
}
|
package/cli/commands/device.ts
CHANGED
|
@@ -49,8 +49,10 @@ examples:
|
|
|
49
49
|
|
|
50
50
|
function printDevice(model: DeviceModel) {
|
|
51
51
|
const spec = getCliRuntime().settings_devices.getDevice(model)
|
|
52
|
+
// the display posture is binary; a foldable's hinge rests at every rest
|
|
53
|
+
const rests = spec.supportedPostures ? ` rests: ${DUO_RESTS.join(', ')}` : ''
|
|
52
54
|
console.log(
|
|
53
|
-
` ${model.padEnd(14)} ${String(spec.width).padStart(4)}x${String(spec.height).padEnd(4)} pt ${String(spec.width * spec.scale).padStart(4)}x${String(spec.height * spec.scale).padEnd(4)} px ${spec.name}`,
|
|
55
|
+
` ${model.padEnd(14)} ${String(spec.width).padStart(4)}x${String(spec.height).padEnd(4)} pt ${String(spec.width * spec.scale).padStart(4)}x${String(spec.height * spec.scale).padEnd(4)} px ${spec.name}${rests}`,
|
|
54
56
|
)
|
|
55
57
|
}
|
|
56
58
|
|
package/cli/commands/doctor.ts
CHANGED
|
@@ -608,10 +608,7 @@ function printNativeGuidance(
|
|
|
608
608
|
reportLocalNative(local)
|
|
609
609
|
if (local.some((item) => item.swift && !item.answered)) {
|
|
610
610
|
console.log(
|
|
611
|
-
`\n ${muted('Local Swift modules require the pinned Swift compiler, wasm SDK and a source checkout or
|
|
612
|
-
)
|
|
613
|
-
console.log(
|
|
614
|
-
` ${muted('Installed CLIs have no default distribution endpoint; PEACH_SWIFT_ENDPOINT must name the private distribution.')}`,
|
|
611
|
+
`\n ${muted('Local Swift modules require the pinned Swift compiler, wasm SDK and a source checkout or the Swift distribution, which peach downloads on first use.')}`,
|
|
615
612
|
)
|
|
616
613
|
}
|
|
617
614
|
// the open names grouped by the package they belong to, the key `packages` takes
|
|
@@ -754,7 +754,9 @@ export type SettledWaitReady = {
|
|
|
754
754
|
export async function waitReadyAndSettle(
|
|
755
755
|
bridge: InspectBridge,
|
|
756
756
|
timeoutMs?: number,
|
|
757
|
-
options: WaitReadyOptions
|
|
757
|
+
options: WaitReadyOptions & {
|
|
758
|
+
onPhase?: (phase: 'ready' | 'settle' | 'ready-check') => void
|
|
759
|
+
} = {},
|
|
758
760
|
): Promise<SettledWaitReady> {
|
|
759
761
|
const start = Date.now()
|
|
760
762
|
const remaining = () =>
|
|
@@ -769,10 +771,12 @@ export async function waitReadyAndSettle(
|
|
|
769
771
|
let idle: WaitForSootsimIdleResult | null = null
|
|
770
772
|
for (;;) {
|
|
771
773
|
idle = null
|
|
774
|
+
options.onPhase?.('ready')
|
|
772
775
|
const ready = await inspectWaitReady(bridge, remaining(), options)
|
|
773
776
|
if (!ready.ready) return result(ready, idle)
|
|
774
777
|
accepted = ready
|
|
775
778
|
const settleBudget = remaining() ?? 3_000
|
|
779
|
+
options.onPhase?.('settle')
|
|
776
780
|
idle = await waitForSootsimIdle({
|
|
777
781
|
bridge,
|
|
778
782
|
simId: options.simId,
|
|
@@ -781,6 +785,7 @@ export async function waitReadyAndSettle(
|
|
|
781
785
|
stablePolls: 2,
|
|
782
786
|
})
|
|
783
787
|
if (!idle.settled) return result(ready, idle)
|
|
788
|
+
options.onPhase?.('ready-check')
|
|
784
789
|
const settled = await inspectReadySnapshot(
|
|
785
790
|
bridge,
|
|
786
791
|
remaining() ?? 3_000,
|
|
@@ -22,10 +22,27 @@ export async function runWaitReadySubcommand(opts: {
|
|
|
22
22
|
// an explicit --timeout/--max-ms is a hard deadline. without one, wait
|
|
23
23
|
// while metro or the guest reports progress and fail on stall or cap.
|
|
24
24
|
const timeoutMs = readMaxMsFlag(args)
|
|
25
|
+
const verbose = args.includes('--verbose') || args.includes('-v')
|
|
26
|
+
const phases: string[] = []
|
|
27
|
+
let phase = 'ready'
|
|
28
|
+
let phaseStart = Date.now()
|
|
29
|
+
const recordPhase = (next: string) => {
|
|
30
|
+
if (!verbose || next === phase) return
|
|
31
|
+
const now = Date.now()
|
|
32
|
+
phases.push(`${phase} ${now - phaseStart}ms`)
|
|
33
|
+
phase = next
|
|
34
|
+
phaseStart = now
|
|
35
|
+
}
|
|
36
|
+
const printTiming = () => {
|
|
37
|
+
if (!verbose) return
|
|
38
|
+
recordPhase('done')
|
|
39
|
+
console.error(` timing: ${phases.join(', ')}`)
|
|
40
|
+
}
|
|
25
41
|
|
|
26
42
|
if (bridge.plane === 'cloud') {
|
|
27
|
-
const status = await inspectWaitReady(bridge, timeoutMs)
|
|
43
|
+
const status = await inspectWaitReady(bridge, timeoutMs).finally(printTiming)
|
|
28
44
|
if (!status.ready) timedOut(status, status.elapsedMs)
|
|
45
|
+
if (verbose) printStartupStatus(status)
|
|
29
46
|
printAcceptedProbe(status)
|
|
30
47
|
printReady(status, status.elapsedMs)
|
|
31
48
|
return
|
|
@@ -36,12 +53,14 @@ export async function runWaitReadySubcommand(opts: {
|
|
|
36
53
|
let elapsedMs: number
|
|
37
54
|
try {
|
|
38
55
|
const settledWait = await waitReadyAndSettle(bridge, timeoutMs, {
|
|
56
|
+
onPhase: verbose ? recordPhase : undefined,
|
|
39
57
|
onProgress(progress) {
|
|
40
58
|
console.error(
|
|
41
59
|
` still waiting after ${progress.elapsedMs}ms — ${waitReadyReason(progress)} (nodes: ${progress.nodes}, targets: ${progress.targets}, live surfaces: ${progress.liveFrameActive ? progress.liveFrameChannels : 0}, browser surfaces: ${progress.browserSurfaceCount}, errors: ${progress.errors})`,
|
|
42
60
|
)
|
|
61
|
+
if (verbose) printStartupStatus(progress)
|
|
43
62
|
},
|
|
44
|
-
})
|
|
63
|
+
}).finally(printTiming)
|
|
45
64
|
status = settledWait.status
|
|
46
65
|
accepted = settledWait.accepted
|
|
47
66
|
idle = settledWait.idle
|
|
@@ -54,6 +73,7 @@ export async function runWaitReadySubcommand(opts: {
|
|
|
54
73
|
throw error
|
|
55
74
|
}
|
|
56
75
|
if (!idle) timedOut(status, elapsedMs)
|
|
76
|
+
if (verbose) printStartupStatus(accepted ?? status)
|
|
57
77
|
if (accepted) printAcceptedProbe(accepted)
|
|
58
78
|
if (!idle.settled) {
|
|
59
79
|
printStartupStatus(status)
|
package/cli/commands/package.ts
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
} from '../../src/host/staged-host-files'
|
|
31
31
|
import { readInstalledNativePackageVersionsAsync } from '../../src/installed-package-versions'
|
|
32
32
|
import { isRecord } from '../../src/is-record'
|
|
33
|
+
import { detectBundleModeFromText } from '../../src/metro-production-bundle'
|
|
33
34
|
import { readNativeAppIdentityFromProject } from '../../src/native-app-identity-project'
|
|
34
35
|
import { readExpoConfigAsync } from '../../src/native-firebase-config'
|
|
35
36
|
import { insertNitroFooter, insertTurboFooter } from '../../src/nitroContract'
|
|
@@ -154,9 +155,14 @@ export async function runPackage(args: string[]): Promise<void> {
|
|
|
154
155
|
...readPackageVersionsFooter(source),
|
|
155
156
|
...versions,
|
|
156
157
|
})
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
const runtime = getCliRuntime()
|
|
159
|
+
// the package's bytes never change, so each launch evaluates the executable
|
|
160
|
+
// prepared here instead of analyzing and transforming the bundle again.
|
|
161
|
+
return runtime.render_worker_prepared_boot_bundle.prepareBootBundle(
|
|
162
|
+
await runtime.rolldown_bundle_inventory.attachRolldownBundleHttpPayload(
|
|
163
|
+
source,
|
|
164
|
+
'application/javascript',
|
|
165
|
+
),
|
|
160
166
|
)
|
|
161
167
|
}
|
|
162
168
|
const selectedHost =
|
|
@@ -190,6 +196,17 @@ export async function runPackage(args: string[]): Promise<void> {
|
|
|
190
196
|
routes[pathname] = { file: path.basename(new URL(url).pathname), contentType }
|
|
191
197
|
return origin + pathname
|
|
192
198
|
}
|
|
199
|
+
// the shell picks its tenant artifact from the bundle url before fetching the
|
|
200
|
+
// bundle, so the url names the bundle's mode; a production bundle behind a bare
|
|
201
|
+
// url boots the development tenant first and restarts on every launch.
|
|
202
|
+
const routeBundle = async (pathname: string, source: string) => {
|
|
203
|
+
const bundle = new URL(route(pathname, Buffer.from(source), 'application/javascript'))
|
|
204
|
+
const mode = await detectBundleModeFromText(source)
|
|
205
|
+
if (mode) bundle.searchParams.set('dev', String(mode === 'development'))
|
|
206
|
+
const url = new URL('/rn', origin)
|
|
207
|
+
url.searchParams.set('bundle', bundle.href)
|
|
208
|
+
return url.href
|
|
209
|
+
}
|
|
193
210
|
try {
|
|
194
211
|
const captured = await captureStagedHostFiles(async () => {
|
|
195
212
|
let launchUrl: string
|
|
@@ -226,14 +243,7 @@ export async function runPackage(args: string[]): Promise<void> {
|
|
|
226
243
|
Buffer.from(JSON.stringify(app.metadata)),
|
|
227
244
|
'application/json',
|
|
228
245
|
)
|
|
229
|
-
|
|
230
|
-
app.guestPath,
|
|
231
|
-
Buffer.from(app.guestSource),
|
|
232
|
-
'application/javascript',
|
|
233
|
-
)
|
|
234
|
-
const url = new URL('/rn', origin)
|
|
235
|
-
url.searchParams.set('bundle', bundle)
|
|
236
|
-
launchUrl = url.href
|
|
246
|
+
launchUrl = await routeBundle(app.guestPath, app.guestSource)
|
|
237
247
|
if (!icon && app.icon) {
|
|
238
248
|
icon = path.join(scratch, 'icon.png')
|
|
239
249
|
fs.writeFileSync(icon, app.icon.bytes)
|
|
@@ -381,15 +391,7 @@ export async function runPackage(args: string[]): Promise<void> {
|
|
|
381
391
|
icon = path.join(scratch, 'icon.png')
|
|
382
392
|
fs.writeFileSync(icon, Buffer.from(await artwork.arrayBuffer()))
|
|
383
393
|
}
|
|
384
|
-
|
|
385
|
-
const bundle = route(
|
|
386
|
-
'/__peach/app.js',
|
|
387
|
-
Buffer.from(prepared),
|
|
388
|
-
'application/javascript',
|
|
389
|
-
)
|
|
390
|
-
const url = new URL('/rn', origin)
|
|
391
|
-
url.searchParams.set('bundle', bundle)
|
|
392
|
-
launchUrl = url.href
|
|
394
|
+
launchUrl = await routeBundle('/__peach/app.js', await prepareBundle(source))
|
|
393
395
|
} else if (local?.isDirectory()) {
|
|
394
396
|
const { snapshotOneDevBundle, prepareBundleChannel } =
|
|
395
397
|
await import('../../src/bundle-channel.mjs')
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs'
|
|
2
|
+
import {
|
|
3
|
+
callInBridgeWrite,
|
|
4
|
+
createBridgeFromParsed,
|
|
5
|
+
parseBridgeCliArgs,
|
|
6
|
+
} from '../ws-bridge'
|
|
7
|
+
import type { PushNotificationReceipt } from '../../src/bridge-contract'
|
|
8
|
+
|
|
9
|
+
export async function runPush(
|
|
10
|
+
args: string[],
|
|
11
|
+
opts: { port?: number } = {},
|
|
12
|
+
): Promise<number> {
|
|
13
|
+
const parsed = parseBridgeCliArgs(args, {
|
|
14
|
+
port: opts.port,
|
|
15
|
+
stripBooleanFlags: ['--help', '-h', '--json'],
|
|
16
|
+
})
|
|
17
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
18
|
+
console.log(
|
|
19
|
+
'usage: peach push <bundle-id> <payload.json|inline-json|-> [--sim <id>] [--json]',
|
|
20
|
+
)
|
|
21
|
+
return 0
|
|
22
|
+
}
|
|
23
|
+
const [bundleId, input] = parsed.positional
|
|
24
|
+
if (!bundleId || !input || parsed.positional.length !== 2) {
|
|
25
|
+
console.error('usage: peach push <bundle-id> <payload.json|inline-json|->')
|
|
26
|
+
return 1
|
|
27
|
+
}
|
|
28
|
+
const bridge = createBridgeFromParsed(parsed)
|
|
29
|
+
try {
|
|
30
|
+
const source = input.trimStart().startsWith('{')
|
|
31
|
+
? input
|
|
32
|
+
: readFileSync(input === '-' ? 0 : input, 'utf8')
|
|
33
|
+
const payload: unknown = JSON.parse(source)
|
|
34
|
+
const result = await callInBridgeWrite<PushNotificationReceipt>(
|
|
35
|
+
bridge,
|
|
36
|
+
'SootSim.bridges.mainShell.callTestBridge',
|
|
37
|
+
'deliverPushNotification',
|
|
38
|
+
bundleId,
|
|
39
|
+
payload,
|
|
40
|
+
)
|
|
41
|
+
if (!result) throw new Error('simulator shell unavailable')
|
|
42
|
+
console.log(
|
|
43
|
+
args.includes('--json')
|
|
44
|
+
? JSON.stringify(result)
|
|
45
|
+
: `notification delivered to ${bundleId}`,
|
|
46
|
+
)
|
|
47
|
+
return 0
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error(
|
|
50
|
+
`push failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
51
|
+
)
|
|
52
|
+
return 1
|
|
53
|
+
} finally {
|
|
54
|
+
bridge.close()
|
|
55
|
+
}
|
|
56
|
+
}
|
package/cli/commands/serve.ts
CHANGED
|
@@ -125,6 +125,9 @@ examples:
|
|
|
125
125
|
getCliRuntime()
|
|
126
126
|
|
|
127
127
|
ensureRnxHome()
|
|
128
|
+
// the bridge outlives whatever checkout started it; a deleted inherited cwd
|
|
129
|
+
// would make every child it spawns fail, so it lives in peach home.
|
|
130
|
+
process.chdir(rnxHomeDir())
|
|
128
131
|
// use the explicit upload/auth origin when configured, otherwise production.
|
|
129
132
|
// never probe a local Contrast stack during bridge startup.
|
|
130
133
|
const contrastOrigin = await resolveDefaultUploadOrigin()
|
|
@@ -206,6 +209,12 @@ examples:
|
|
|
206
209
|
// closing the terminal that spawned us sends SIGHUP — treat it like a
|
|
207
210
|
// clean shutdown so the lockfile doesn't linger.
|
|
208
211
|
process.on('SIGHUP', () => shutdown('SIGHUP'))
|
|
212
|
+
// a launcher of another app version asks a bridge its quit starter left
|
|
213
|
+
// behind to exit now rather than after the unused grace period.
|
|
214
|
+
if (exitWhenUnused)
|
|
215
|
+
process.on('SIGUSR2', () => {
|
|
216
|
+
if (starterGoneAt && host.listSims().length === 0) void shutdown('unused')
|
|
217
|
+
})
|
|
209
218
|
// last-ditch lockfile cleanup on any synchronous exit path. the
|
|
210
219
|
// close() call above is async so we can't await it here, but removing
|
|
211
220
|
// the lockfile is cheap + idempotent.
|