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
|
@@ -1,126 +1,74 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: peach-visual
|
|
3
|
-
description:
|
|
3
|
+
description: Compare static rendering in Peach with native iOS or an app baseline using lossless screenshots and pixel diffs. Use for font metrics, gradients, shadows, blur, colors, or image fidelity; use peach-debug for tree/props and peach-perf for motion or frame timing.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Peach visual fidelity
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
CLI gives you two primitives — **canvas capture** (`peach screenshot`)
|
|
11
|
-
and **structural diff** (`peach debug snapshot`/`diff`). pixel
|
|
12
|
-
comparison itself is "capture both sides, diff the PNGs with a standard
|
|
13
|
-
image tool" — there is no single oracle-diff command, and that's fine:
|
|
14
|
-
the capture step is the hard part and it's fully reproducible.
|
|
8
|
+
Use this for visible pixel differences. Start with a connected, pinned sim;
|
|
9
|
+
use `peach-setup` if `peach describe` cannot reach the intended app.
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
> load `/peach-setup` first.
|
|
11
|
+
## Establish comparable captures
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
1. Check structure with `peach debug snapshot` and `peach debug diff` when a
|
|
14
|
+
changed node or prop could explain the result. Use `peach-debug` for that
|
|
15
|
+
investigation.
|
|
16
|
+
2. Match device, appearance, orientation, app state, loaded fonts/images,
|
|
17
|
+
logical crop, and pixel dimensions between captures. For native parity,
|
|
18
|
+
open Peach with `--render-resolution high` so it uses native device scale.
|
|
19
|
+
3. Wait for the relevant state and `peach wait idle`. Perpetual animation needs
|
|
20
|
+
a controlled matching state; an arbitrary frame is not a stable baseline.
|
|
21
|
+
4. Capture lossless PNGs and inspect both source images and the diff.
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
`/peach-debug`, debugging branch — `debug snapshot` + `debug
|
|
23
|
-
diff` is faster, deterministic, and tells you *why*.
|
|
24
|
-
- visual change (color, gradient, shadow, font metric, blur, image)? →
|
|
25
|
-
continue here.
|
|
26
|
-
- comparing Peach to your iOS simulator for fidelity? → continue.
|
|
27
|
-
- regressing your own app against itself across commits? → continue.
|
|
28
|
-
|
|
29
|
-
## anti-patterns (read first)
|
|
30
|
-
|
|
31
|
-
- **run structural diff before pixel work.** `peach debug snapshot` /
|
|
32
|
-
`debug diff` (in `/peach-debug`) is cheaper, deterministic, and
|
|
33
|
-
points at the responsible nodes. only when it's empty (or the change is
|
|
34
|
-
pure rendering) does a pixel comparison add information.
|
|
35
|
-
- **don't single-screenshot animated surfaces.** a gradient
|
|
36
|
-
mid-animation never matches. gate the capture behind `peach wait
|
|
37
|
-
idle` first.
|
|
38
|
-
- **a > 5% pixel threshold hides regressions.** ~1% is the right
|
|
39
|
-
ballpark for catching real font / shadow / gradient drift without
|
|
40
|
-
flagging anti-alias noise. go higher only with a written reason.
|
|
41
|
-
- **pin device and theme.** capture both sides on the same simulated
|
|
42
|
-
device and appearance. capture each appearance separately with
|
|
43
|
-
`peach screenshot` after setting it on both simulators.
|
|
44
|
-
- **commit baselines alongside the code change that produced them.**
|
|
45
|
-
baseline churn without code churn means someone captured noise.
|
|
46
|
-
|
|
47
|
-
## capturing — `peach screenshot`
|
|
48
|
-
|
|
49
|
-
fast, no extra setup, works on any loaded app:
|
|
23
|
+
## Capture Peach
|
|
50
24
|
|
|
51
25
|
```sh
|
|
52
|
-
peach screenshot --output app.png
|
|
53
|
-
peach screenshot --area 0,200,393,400
|
|
54
|
-
peach screenshot --id loginButton -o
|
|
55
|
-
peach screenshot --text "Sign in"
|
|
56
|
-
peach screenshot --no-shell -o tenant.png
|
|
57
|
-
peach screenshot --shell-only
|
|
26
|
+
peach screenshot --output app.png
|
|
27
|
+
peach screenshot --area 0,200,393,400 -o region.png
|
|
28
|
+
peach screenshot --id loginButton -o button.png
|
|
29
|
+
peach screenshot --text "Sign in" -o sign-in.png
|
|
30
|
+
peach screenshot --no-shell -o tenant.png
|
|
31
|
+
peach screenshot --shell-only -o shell.png
|
|
58
32
|
```
|
|
59
33
|
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
Coordinates are logical points. `--id` crops by testID; prefer it to text when
|
|
35
|
+
copy repeats. Capture each affected screen with a distinct filename. Crop the
|
|
36
|
+
same region on both sides so unrelated chrome does not hide a small text or
|
|
37
|
+
shadow regression.
|
|
62
38
|
|
|
63
|
-
##
|
|
64
|
-
|
|
65
|
-
capture both sides to PNGs, then diff with any standard image tool.
|
|
66
|
-
|
|
67
|
-
**Peach vs Peach (regression across your own commits):**
|
|
68
|
-
|
|
69
|
-
```sh
|
|
70
|
-
peach screenshot -o before.png # baseline, before your change
|
|
71
|
-
# … make the rendering change, let the sim hot-reload …
|
|
72
|
-
peach screenshot -o after.png # after your change
|
|
73
|
-
npx pixelmatch before.png after.png diff.png 0.1 # writes diff.png
|
|
74
|
-
# or: magick compare before.png after.png diff.png
|
|
75
|
-
```
|
|
39
|
+
## Compare
|
|
76
40
|
|
|
77
|
-
|
|
41
|
+
For your app across revisions, capture before the change, apply it and wait
|
|
42
|
+
for readiness, then capture after. For native iOS, name the exact simulator:
|
|
78
43
|
|
|
79
44
|
```sh
|
|
80
|
-
# native side: lifecycle and UI use xcodebuildmcp with one claimed simulator
|
|
81
|
-
# lossless capture names that simulator explicitly; never use the booted alias
|
|
82
45
|
xcrun simctl io <udid> screenshot --type=png native.png
|
|
83
|
-
# peach side: same screen, same appearance
|
|
84
46
|
peach screenshot -o peach.png
|
|
85
|
-
|
|
47
|
+
magick compare native.png peach.png diff.png
|
|
86
48
|
```
|
|
87
49
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
## recovery — common failure modes
|
|
115
|
-
|
|
116
|
-
- **a single icon/glyph diffs** — font-load race or image not yet
|
|
117
|
-
cached. recapture after `peach wait idle`, or navigate away and back
|
|
118
|
-
to seed the cache.
|
|
119
|
-
- **everything diffs by a constant offset** — you captured the two sides
|
|
120
|
-
on different devices or appearances. pin both, recapture.
|
|
121
|
-
- **baselines churn without a code change** — someone captured noise (a
|
|
122
|
-
lingering badge, half-open keyboard, a drifting clock). revert and
|
|
123
|
-
recapture from a clean, idle state.
|
|
124
|
-
- **persistent delta on the same font / shadow / gradient across
|
|
125
|
-
unrelated screens** — that's an engine-level rendering fidelity issue,
|
|
126
|
-
not your app. report it with the affected captures attached.
|
|
50
|
+
Use an installed standard image-diff tool. ImageMagick `compare` returns a
|
|
51
|
+
nonzero status when images differ; inspect its output rather than treating that
|
|
52
|
+
alone as a tool failure. Verify decoded PNG dimensions before comparing and
|
|
53
|
+
preserve the originals. Optimized JPEG captures introduce compression noise
|
|
54
|
+
and are unsuitable for lossless parity comparisons.
|
|
55
|
+
|
|
56
|
+
Keep the image tool's per-pixel sensitivity distinct from the percentage of
|
|
57
|
+
changed pixels. Choose an acceptance threshold for the actual surface before
|
|
58
|
+
evaluating results; a large full-screen allowance can conceal a local defect.
|
|
59
|
+
Inspect the changed region even when the aggregate score passes.
|
|
60
|
+
|
|
61
|
+
## Diagnose differences
|
|
62
|
+
|
|
63
|
+
| Pattern | First check |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| One glyph or icon differs | Font or image readiness |
|
|
66
|
+
| Constant offset across the image | Device geometry, safe area, crop, scale |
|
|
67
|
+
| Baseline changes without code changes | Keyboard, clock, badges, animation or unstable data |
|
|
68
|
+
| Same font/shadow/gradient defect on unrelated screens | Possible renderer issue; preserve minimal captures |
|
|
69
|
+
|
|
70
|
+
Iterate until the affected cases meet their agreed target, or the remaining
|
|
71
|
+
differences are explicitly accepted. Store baselines with the app's existing
|
|
72
|
+
artifact policy and update them alongside the code that justifies the change.
|
|
73
|
+
Do not bless unexplained baseline churn. For visible motion or latency claims,
|
|
74
|
+
use `peach-perf`; a static screenshot cannot prove frame progression.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DESKTOP_RENDER_RESOLUTION } from './menu'
|
|
1
2
|
import {
|
|
2
3
|
isSettingKey,
|
|
3
4
|
isValidSettingValue,
|
|
@@ -30,6 +31,14 @@ export interface AppPackageManifest {
|
|
|
30
31
|
routes: Record<string, { file: string; contentType: string }>
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
function parseJsonSetting(raw: string, assignment: string): unknown {
|
|
35
|
+
try {
|
|
36
|
+
return JSON.parse(raw)
|
|
37
|
+
} catch {
|
|
38
|
+
throw new Error(`invalid package setting ${assignment}; expected a JSON array`)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
33
42
|
export function packageSettingDefaults(
|
|
34
43
|
assignments: readonly string[],
|
|
35
44
|
): Partial<SettingsValues> {
|
|
@@ -43,10 +52,12 @@ export function packageSettingDefaults(
|
|
|
43
52
|
// a packaged app is a desktop app: it keeps the computer pointer and
|
|
44
53
|
// shows only the app, without the device frame or simulator rail.
|
|
45
54
|
// and types on the computer keyboard, so no software keyboard presents.
|
|
55
|
+
// it renders at the desktop host's density, the pixels its window shows.
|
|
46
56
|
systemCursor: true,
|
|
47
57
|
hardwareKeyboard: true,
|
|
48
58
|
showFrame: false,
|
|
49
59
|
showRail: false,
|
|
60
|
+
renderResolution: DESKTOP_RENDER_RESOLUTION,
|
|
50
61
|
}
|
|
51
62
|
for (const assignment of assignments) {
|
|
52
63
|
const equals = assignment.indexOf('=')
|
|
@@ -67,7 +78,7 @@ export function packageSettingDefaults(
|
|
|
67
78
|
? NaN
|
|
68
79
|
: Number(raw)
|
|
69
80
|
: definition.type === 'string-array'
|
|
70
|
-
?
|
|
81
|
+
? parseJsonSetting(raw, assignment)
|
|
71
82
|
: raw
|
|
72
83
|
if (
|
|
73
84
|
(typeof value === 'number' && !Number.isFinite(value)) ||
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export interface SwiftImageSource {
|
|
3
3
|
uri: string
|
|
4
4
|
scale: number
|
|
5
|
+
renderingMode?: 'template' | 'original'
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
// the scale variants stay available until the runtime knows its device.
|
|
@@ -18,7 +19,10 @@ export function isSwiftImageVariants(value: unknown): value is SwiftImageVariant
|
|
|
18
19
|
typeof image.uri === 'string' &&
|
|
19
20
|
typeof image.scale === 'number' &&
|
|
20
21
|
Number.isFinite(image.scale) &&
|
|
21
|
-
image.scale > 0
|
|
22
|
+
image.scale > 0 &&
|
|
23
|
+
(image.renderingMode === undefined ||
|
|
24
|
+
image.renderingMode === 'template' ||
|
|
25
|
+
image.renderingMode === 'original'),
|
|
22
26
|
)
|
|
23
27
|
)
|
|
24
28
|
}
|
|
@@ -70,6 +74,9 @@ export interface SfSymbolImageDrawing {
|
|
|
70
74
|
// automatic variable mode draws the value along the paths rather than
|
|
71
75
|
// turning layers off by threshold
|
|
72
76
|
variableDraw?: boolean
|
|
77
|
+
// automatic rendering draws the symbol hierarchically: coreui's preferred
|
|
78
|
+
// rendering mode (desktopcomputer's tertiary screen in a tab bar)
|
|
79
|
+
hierarchical?: boolean
|
|
73
80
|
// coreui's own right to left rendition, which replaces the drawing there
|
|
74
81
|
rightToLeft?: SfSymbolImageDrawing
|
|
75
82
|
}
|
package/src/bridge-contract.ts
CHANGED
|
@@ -53,6 +53,12 @@ export type BridgeCommandType =
|
|
|
53
53
|
// them, so they stay out of BridgeCommandType and out of its cloud scope table.
|
|
54
54
|
export type BridgeHostCommandType = 'bridge:list-sims' | 'bridge:claim'
|
|
55
55
|
|
|
56
|
+
export interface PushNotificationReceipt {
|
|
57
|
+
appId: string
|
|
58
|
+
id: string
|
|
59
|
+
presented: boolean
|
|
60
|
+
}
|
|
61
|
+
|
|
56
62
|
// what a caller hands a bridge's `send`: the command minus the correlation id,
|
|
57
63
|
// which the transport assigns. every send seam names this type rather than an
|
|
58
64
|
// index-signature bag, because an index signature erases excess-property
|
package/src/bundle-channel.mjs
CHANGED
|
@@ -303,21 +303,85 @@ export async function publishBundleChannel(release, { put, fetchObject = fetch }
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
// peach boots an app from the dev server's bundle: it carries the module graph
|
|
306
|
-
// peach maps native seams by
|
|
307
|
-
//
|
|
308
|
-
//
|
|
309
|
-
// and, on ios, one executable of
|
|
310
|
-
|
|
311
|
-
|
|
306
|
+
// peach maps native seams by. a release build erases it, but the production
|
|
307
|
+
// bundle of the rolldown path keeps the factories its catalog recognises.
|
|
308
|
+
// package one platform's bundle with the files its assets register, the app's
|
|
309
|
+
// local Expo native modules for that platform and, on ios, one executable of
|
|
310
|
+
// its installed Nitro providers. `readAssetFile` supplies the bytes of a
|
|
311
|
+
// registered asset that has no local file.
|
|
312
|
+
async function packagePlatformBundle(
|
|
312
313
|
projectRoot,
|
|
313
|
-
|
|
314
|
+
platform,
|
|
315
|
+
bundle,
|
|
316
|
+
{ config, versions, readAssetFile },
|
|
314
317
|
) {
|
|
315
318
|
const { readFileSync } = await import('node:fs')
|
|
316
319
|
const { basename } = await import('node:path')
|
|
317
|
-
const { resolveRNXAppConfig } = await import('../cli/app-config')
|
|
318
320
|
const { produceConfiguredBundle } = await import('./configured-bundle-producer')
|
|
321
|
+
const assets = new Map()
|
|
322
|
+
for (const [registration] of bundle
|
|
323
|
+
.toString('utf8')
|
|
324
|
+
.matchAll(/(?<=registerAsset\()\{[^{}]*"__packager_asset": true[^{}]*\}/g)) {
|
|
325
|
+
const asset = JSON.parse(registration)
|
|
326
|
+
const directory = packagedAssetDirectory(asset.httpServerLocation)
|
|
327
|
+
if (asset.files) {
|
|
328
|
+
for (const file of asset.files) {
|
|
329
|
+
const path = `${directory}/${basename(file)}`
|
|
330
|
+
if (!assets.has(path)) assets.set(path, readFileSync(file))
|
|
331
|
+
}
|
|
332
|
+
continue
|
|
333
|
+
}
|
|
334
|
+
// without local files, each scale downloads at the url react native's
|
|
335
|
+
// AssetSourceResolver builds for it
|
|
336
|
+
for (const scale of asset.scales) {
|
|
337
|
+
const file = `${asset.name}${scale === 1 ? '' : `@${scale}x`}.${asset.type}`
|
|
338
|
+
const path = `${directory}/${file}`
|
|
339
|
+
if (!assets.has(path)) assets.set(path, await readAssetFile(asset, file))
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
platform,
|
|
344
|
+
// the versions footer stays last: the rolldown inventory reads it there.
|
|
345
|
+
bundle: Buffer.from(
|
|
346
|
+
insertPackageVersionsFooter(
|
|
347
|
+
await produceConfiguredBundle(
|
|
348
|
+
bundle.toString('utf8'),
|
|
349
|
+
config,
|
|
350
|
+
new Set(Object.keys(versions)),
|
|
351
|
+
),
|
|
352
|
+
versions,
|
|
353
|
+
),
|
|
354
|
+
),
|
|
355
|
+
assets: [...assets].map(([path, bytes]) => ({ path, bytes })),
|
|
356
|
+
...(platform === 'ios'
|
|
357
|
+
? {
|
|
358
|
+
expoSwift: await (
|
|
359
|
+
await import('./expo-swift-bundle')
|
|
360
|
+
).buildExpoSwiftBundle(projectRoot),
|
|
361
|
+
nitro: await (await import('./nitro-bundle')).buildNitroBundle(projectRoot),
|
|
362
|
+
turbo: await (await import('./turbo-bundle')).buildTurboBundle(projectRoot),
|
|
363
|
+
}
|
|
364
|
+
: {
|
|
365
|
+
expoKotlin: await (
|
|
366
|
+
await import('./expo-kotlin-bundle')
|
|
367
|
+
).buildExpoKotlinBundle(projectRoot),
|
|
368
|
+
}),
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
async function readPackagingInputs(projectRoot) {
|
|
373
|
+
const { resolveRNXAppConfig } = await import('../cli/app-config')
|
|
319
374
|
const { config } = await resolveRNXAppConfig(projectRoot)
|
|
320
|
-
|
|
375
|
+
return { config, versions: await readInstalledNativePackageVersionsAsync(projectRoot) }
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// snapshot each platform's bundle from a running dev server
|
|
379
|
+
export async function snapshotDevServerBundles(
|
|
380
|
+
origin,
|
|
381
|
+
projectRoot,
|
|
382
|
+
{ platforms = ['ios', 'android'], assertRunning = () => {} } = {},
|
|
383
|
+
) {
|
|
384
|
+
const inputs = await readPackagingInputs(projectRoot)
|
|
321
385
|
const snapshots = []
|
|
322
386
|
for (const platform of platforms) {
|
|
323
387
|
const url = `${origin}/index.bundle?platform=${platform}&dev=true&minify=false`
|
|
@@ -331,57 +395,67 @@ export async function snapshotDevServerBundles(
|
|
|
331
395
|
if (response?.ok) bundle = Buffer.from(await response.arrayBuffer())
|
|
332
396
|
else await new Promise((resolve) => setTimeout(resolve, 2000))
|
|
333
397
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
398
|
+
snapshots.push(
|
|
399
|
+
await packagePlatformBundle(projectRoot, platform, bundle, {
|
|
400
|
+
...inputs,
|
|
401
|
+
readAssetFile: async (asset, file) => {
|
|
402
|
+
const response = await fetch(
|
|
403
|
+
`${origin}${asset.httpServerLocation}/${file}?platform=${platform}&hash=${asset.hash}`,
|
|
404
|
+
)
|
|
405
|
+
if (!response.ok)
|
|
406
|
+
throw new Error(`dev server asset ${file} failed: ${response.status}`)
|
|
407
|
+
return Buffer.from(await response.arrayBuffer())
|
|
408
|
+
},
|
|
409
|
+
}),
|
|
410
|
+
)
|
|
411
|
+
}
|
|
412
|
+
return { platforms: snapshots }
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// a One app's production bundles. unminified, because the catalog recognises
|
|
416
|
+
// a module by the shape of its factory and only unminified output is
|
|
417
|
+
// deterministic (specs/sootsim-engine/one-updates-input.md).
|
|
418
|
+
export async function snapshotOneProductionBundle(
|
|
419
|
+
projectRoot,
|
|
420
|
+
entryFile,
|
|
421
|
+
env = {},
|
|
422
|
+
{ runtimeExecutable = process.execPath, platforms = ['ios', 'android'] } = {},
|
|
423
|
+
) {
|
|
424
|
+
const { execFile } = await import('node:child_process')
|
|
425
|
+
const { mkdtemp, readFile, rm } = await import('node:fs/promises')
|
|
426
|
+
const { tmpdir } = await import('node:os')
|
|
427
|
+
const { join } = await import('node:path')
|
|
428
|
+
const { promisify } = await import('node:util')
|
|
429
|
+
const inputs = await readPackagingInputs(projectRoot)
|
|
430
|
+
const snapshots = []
|
|
431
|
+
for (const platform of platforms) {
|
|
432
|
+
const out = await mkdtemp(join(tmpdir(), 'peach-production-bundle-'))
|
|
433
|
+
try {
|
|
434
|
+
await promisify(execFile)(
|
|
435
|
+
runtimeExecutable,
|
|
436
|
+
[
|
|
437
|
+
join(projectRoot, 'node_modules/.bin/react-native'),
|
|
438
|
+
'bundle',
|
|
439
|
+
'--platform', platform,
|
|
440
|
+
'--dev', 'false',
|
|
441
|
+
'--minify', 'false',
|
|
442
|
+
'--entry-file', entryFile,
|
|
443
|
+
'--bundle-output', join(out, 'bundle.js'),
|
|
444
|
+
'--assets-dest', join(out, 'assets'),
|
|
445
|
+
'--sourcemap-output', join(out, 'bundle.js.map'),
|
|
446
|
+
],
|
|
447
|
+
{ cwd: projectRoot, env: { ...process.env, ...env, NODE_ENV: 'production' } },
|
|
448
|
+
)
|
|
449
|
+
snapshots.push(
|
|
450
|
+
await packagePlatformBundle(projectRoot, platform, await readFile(join(out, 'bundle.js')), {
|
|
451
|
+
...inputs,
|
|
452
|
+
readAssetFile: (asset, file) =>
|
|
453
|
+
readFile(join(out, asset.httpServerLocation, file)),
|
|
454
|
+
}),
|
|
455
|
+
)
|
|
456
|
+
} finally {
|
|
457
|
+
await rm(out, { recursive: true, force: true })
|
|
360
458
|
}
|
|
361
|
-
snapshots.push({
|
|
362
|
-
platform,
|
|
363
|
-
bundle: Buffer.from(
|
|
364
|
-
await produceConfiguredBundle(
|
|
365
|
-
insertPackageVersionsFooter(bundle.toString('utf8'), versions),
|
|
366
|
-
config,
|
|
367
|
-
new Set(Object.keys(versions)),
|
|
368
|
-
),
|
|
369
|
-
),
|
|
370
|
-
assets: [...assets].map(([path, bytes]) => ({ path, bytes })),
|
|
371
|
-
...(platform === 'ios'
|
|
372
|
-
? {
|
|
373
|
-
expoSwift: await (
|
|
374
|
-
await import('./expo-swift-bundle')
|
|
375
|
-
).buildExpoSwiftBundle(projectRoot),
|
|
376
|
-
nitro: await (await import('./nitro-bundle')).buildNitroBundle(projectRoot),
|
|
377
|
-
turbo: await (await import('./turbo-bundle')).buildTurboBundle(projectRoot),
|
|
378
|
-
}
|
|
379
|
-
: {
|
|
380
|
-
expoKotlin: await (
|
|
381
|
-
await import('./expo-kotlin-bundle')
|
|
382
|
-
).buildExpoKotlinBundle(projectRoot),
|
|
383
|
-
}),
|
|
384
|
-
})
|
|
385
459
|
}
|
|
386
460
|
return { platforms: snapshots }
|
|
387
461
|
}
|
package/src/cli-runtime.ts
CHANGED
|
@@ -3,7 +3,10 @@ import { readFileSync } from 'node:fs'
|
|
|
3
3
|
import { createRequire } from 'node:module'
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
import companionIdentity from '../runtime-companion.json' with { type: 'json' }
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
resolveActiveRuntimeRoot,
|
|
8
|
+
resolveDevCheckoutRuntimeAssetRoot,
|
|
9
|
+
} from './runtime-assets'
|
|
7
10
|
import type * as CliRuntime from '#peach-cli-contract/cli-companion'
|
|
8
11
|
|
|
9
12
|
export const CLI_COMPANION_ABI = 1
|
|
@@ -42,14 +45,10 @@ let loaded: { root: string; runtime: typeof CliRuntime } | undefined
|
|
|
42
45
|
// so host serializers receive their implementation rather than a forwarding closure.
|
|
43
46
|
export function getCliRuntime(): typeof CliRuntime {
|
|
44
47
|
if (loaded) return loaded.runtime
|
|
45
|
-
// the companion
|
|
46
|
-
// is the
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
const monorepoRoot = findMonorepoRoot()
|
|
50
|
-
const root = monorepoRoot
|
|
51
|
-
? join(monorepoRoot, 'public/sootsim')
|
|
52
|
-
: resolveActiveRuntimeRoot()
|
|
48
|
+
// the companion comes from the runtime the host serves: inside the dev checkout
|
|
49
|
+
// that is the dev build `build:peachsim:cli` copied it beside, unless PEACH_HOME
|
|
50
|
+
// stages a runtime, as a release replay does inside a builder's checkout
|
|
51
|
+
const root = resolveDevCheckoutRuntimeAssetRoot() ?? resolveActiveRuntimeRoot()
|
|
53
52
|
if (!root) throw new Error('No Peach runtime installed; run `peach runtime install`')
|
|
54
53
|
verifyCliCompanion(root)
|
|
55
54
|
const require = createRequire(import.meta.url)
|
|
@@ -10,18 +10,28 @@ import { findBundleFooter } from './bundleGlobalFooter'
|
|
|
10
10
|
import {
|
|
11
11
|
collectConfiguredFileModules,
|
|
12
12
|
createPeachBundleConfigFooter,
|
|
13
|
+
detachPeachBundleConfigFooter,
|
|
13
14
|
PEACH_CONFIGURED_FILES_HOOK,
|
|
14
15
|
isPeachConfig,
|
|
15
16
|
} from './config'
|
|
16
17
|
import { resolveReplacementModuleFile } from './host/replacement-module-handler'
|
|
17
18
|
import type { PeachConfig } from './config'
|
|
18
19
|
|
|
20
|
+
// the minified prefix's first and last characters, as this producer writes them
|
|
21
|
+
const PREFIX_START = '(function(){const factories={'
|
|
22
|
+
const PREFIX_END = 'install(loaded)})();'
|
|
23
|
+
|
|
19
24
|
export async function produceConfiguredBundle(
|
|
20
25
|
source: string,
|
|
21
26
|
config: PeachConfig | undefined,
|
|
22
27
|
runtimePackages: ReadonlySet<string>,
|
|
23
28
|
): Promise<string> {
|
|
24
29
|
if (!config) return source
|
|
30
|
+
// a channel bundle already carries its configured files and config; packaging it with its
|
|
31
|
+
// project produces both again, and a second prefix finds the install hook already spent
|
|
32
|
+
source = detachPeachBundleConfigFooter(source).source
|
|
33
|
+
const producedEnd = source.startsWith(PREFIX_START) ? source.indexOf(PREFIX_END) : -1
|
|
34
|
+
if (producedEnd >= 0) source = source.slice(producedEnd + PREFIX_END.length)
|
|
25
35
|
// functions cannot cross JSON. executable native bindings belong in file entries.
|
|
26
36
|
const json = JSON.stringify(config, (_key, value: unknown) => {
|
|
27
37
|
if (
|