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/src/turbo-bundle.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
compiledModuleRequestHandler,
|
|
9
9
|
type CompiledModuleAsset,
|
|
10
10
|
} from './nitro-bundle'
|
|
11
|
-
import {
|
|
11
|
+
import { swiftDistributionRoot } from './swift-distribution'
|
|
12
12
|
import { icuUrl, type SwiftArtifact } from './swift-host'
|
|
13
13
|
import { compileTurboModule } from './turbo-compile'
|
|
14
14
|
import { discoverTurboProviders } from './turbo-source'
|
|
@@ -18,27 +18,28 @@ export const TURBO_ROUTE = '/__peach/turbo'
|
|
|
18
18
|
|
|
19
19
|
const answeredPackages: ReadonlySet<string> = new Set(PEACH_ANSWERED_NATIVE_PACKAGE_NAMES)
|
|
20
20
|
|
|
21
|
+
/** the installed C++ TurboModule providers an app compiles: every one Peach
|
|
22
|
+
* does not answer itself (a seam resolves before the original module). */
|
|
23
|
+
export async function compiledTurboProviders(appRoot: string) {
|
|
24
|
+
return (await discoverTurboProviders(appRoot)).filter(
|
|
25
|
+
({ name }) => !answeredPackages.has(name),
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
// every installed iOS pod that registers a C++ TurboModule compiles from its
|
|
22
30
|
// original source into one executable, with the same compiler and asset
|
|
23
31
|
// addresses as local native loads. package javascript is carried verbatim by
|
|
24
|
-
// its bundler.
|
|
25
|
-
// original module) is not compiled. asset urls are relative to `origin`.
|
|
32
|
+
// its bundler. asset urls are relative to `origin`.
|
|
26
33
|
export async function compileTurboApp(
|
|
27
34
|
appRoot: string,
|
|
28
35
|
origin: string,
|
|
29
36
|
moduleRoot?: string,
|
|
30
37
|
): Promise<{ metadata: TurboCompiledModule; artifact: SwiftArtifact } | null> {
|
|
31
|
-
const providers =
|
|
32
|
-
({ name }) => !answeredPackages.has(name),
|
|
33
|
-
)
|
|
38
|
+
const providers = await compiledTurboProviders(appRoot)
|
|
34
39
|
if (providers.length === 0) return null
|
|
35
40
|
// the runtime archive is built against the published distribution, as the
|
|
36
41
|
// Nitro adapter is
|
|
37
42
|
const module = moduleRoot ?? (await swiftDistributionRoot())
|
|
38
|
-
if (!module)
|
|
39
|
-
throw new Error(
|
|
40
|
-
`TurboModule compilation needs ${SWIFT_ENDPOINT_ENV} for the Swift distribution`,
|
|
41
|
-
)
|
|
42
43
|
const projectRoot = readIosAppTarget(appRoot)
|
|
43
44
|
? appRoot
|
|
44
45
|
: (await prepareExpoNativeWorkspace(appRoot)).app
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"adapter": {
|
|
7
7
|
"sha256": "0d31912293226deb3354b3b32f2944e9c61c68590e3020d8b5af0c12a6677893"
|
|
8
8
|
},
|
|
9
|
-
"compiler": "swift-6.4.0-RELEASE-custom-
|
|
9
|
+
"compiler": "swift-6.4.0-RELEASE-custom-f7c03c3f59ec5d83",
|
|
10
10
|
"sdk": {
|
|
11
|
-
"id": "swift-6.4.0-RELEASE_wasm-peach-
|
|
12
|
-
"checksum": "
|
|
11
|
+
"id": "swift-6.4.0-RELEASE_wasm-peach-6dd8eba1",
|
|
12
|
+
"checksum": "6e213e9d4d25351960f6befcfbdee9695bbaa267085085e5394f4c086ac9bdb1"
|
|
13
13
|
},
|
|
14
14
|
"framework": {
|
|
15
|
-
"distribution": "
|
|
15
|
+
"distribution": "6ce04be1c3d3504e",
|
|
16
16
|
"wireAbi": "246b8412514b644113e6a26252c8ebd6de49ab4156ac5f5c98bb9e4c2ff2568b"
|
|
17
17
|
},
|
|
18
18
|
"archives": [
|
|
@@ -20,50 +20,50 @@
|
|
|
20
20
|
"headers": {
|
|
21
21
|
"reactNativeJsi": "0f8c2defbca69a27a848a81ae72363073bf9602fd316e57a75811be1a0528358"
|
|
22
22
|
},
|
|
23
|
-
"sha256": "
|
|
24
|
-
"size":
|
|
23
|
+
"sha256": "f6ef43fa39d602794e5c3c0bf4b317953aa93b571fe83eca7b781af06833d76e",
|
|
24
|
+
"size": 25394
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"headers": {
|
|
28
28
|
"reactNativeJsi": "324aefd8591d9ce688bce7589c4c2b516cd33ecb95d35c47239a87a8fcf6a8da"
|
|
29
29
|
},
|
|
30
|
-
"sha256": "
|
|
31
|
-
"size":
|
|
30
|
+
"sha256": "cc97b4b53a22cf121bc5bb33bd39240ee7ebe9ce4d05c666a94ca6ff43e25fef",
|
|
31
|
+
"size": 25394
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"headers": {
|
|
35
35
|
"reactNativeJsi": "66b2cd5a38511195207f6c8a76aba735f9b9cc66a52a0d00780ffe5d331623f7"
|
|
36
36
|
},
|
|
37
|
-
"sha256": "
|
|
37
|
+
"sha256": "25cf3b4d0a0ec551d84797eed5da784c9a05115e69c046d0a42a0d9889a86265",
|
|
38
38
|
"size": 25396
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"headers": {
|
|
42
42
|
"reactNativeJsi": "96db4e758dd53e9320cef7cad485e00aa06e7a982cefd920f17007de8a5bd9f9"
|
|
43
43
|
},
|
|
44
|
-
"sha256": "
|
|
45
|
-
"size":
|
|
44
|
+
"sha256": "1651d1d32c989c537bfef843e1ac21791dd26814ba561eb8dc14e9120f5fb75c",
|
|
45
|
+
"size": 26138
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"headers": {
|
|
49
49
|
"reactNativeJsi": "aeab590ddd1218df963462242d3954ce467b0fa88f70e91429e4ffc74d230893"
|
|
50
50
|
},
|
|
51
|
-
"sha256": "
|
|
51
|
+
"sha256": "b9215e5df25c020f88308834e110cd9800565bd008b4208ea9771411a7ec17bf",
|
|
52
52
|
"size": 26138
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"headers": {
|
|
56
56
|
"reactNativeJsi": "b5fb260522384dd7ab07d740cdc534b529922446fcec798341c7817d9eaa49f4"
|
|
57
57
|
},
|
|
58
|
-
"sha256": "
|
|
59
|
-
"size":
|
|
58
|
+
"sha256": "b8e53d7cc4790d4410f9abd70ff33b2727cbabef82ba38d48b5aa2ac936161cf",
|
|
59
|
+
"size": 25264
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"headers": {
|
|
63
63
|
"reactNativeJsi": "c6b391a1e870ccf7cdd534be63582862840f8245b99ebd253317deece1e6ffd5"
|
|
64
64
|
},
|
|
65
|
-
"sha256": "
|
|
66
|
-
"size":
|
|
65
|
+
"sha256": "16c126865863ed60d6a3acb372868e488052ff2a33dbbedf4eec8a1dc238429c",
|
|
66
|
+
"size": 26139
|
|
67
67
|
}
|
|
68
68
|
]
|
|
69
69
|
}
|
package/src/vite-plugin-one.ts
CHANGED
|
@@ -191,7 +191,18 @@ export function peachPlugin(options: PeachPluginOptions = {}): Plugin {
|
|
|
191
191
|
: pipeline(upstream, res)
|
|
192
192
|
forward.catch((error: unknown) => {
|
|
193
193
|
console.error('[peach] bundle forward failed', error)
|
|
194
|
-
|
|
194
|
+
const failure = error instanceof Error ? error : new Error(String(error))
|
|
195
|
+
// before the first byte the sim can still read the cause; a dropped
|
|
196
|
+
// socket left its bundle request pending until wait ready timed out
|
|
197
|
+
if (res.headersSent) {
|
|
198
|
+
res.destroy(failure)
|
|
199
|
+
return
|
|
200
|
+
}
|
|
201
|
+
upstream.destroy()
|
|
202
|
+
res.statusCode = 500
|
|
203
|
+
for (const key of res.getHeaderNames()) res.removeHeader(key)
|
|
204
|
+
res.setHeader('content-type', 'text/plain; charset=utf-8')
|
|
205
|
+
res.end(`peach bundle forward failed: ${failure.message}`)
|
|
195
206
|
})
|
|
196
207
|
}
|
|
197
208
|
const upstreamReq = server.config.server.https
|
package/src/vite-plugin.ts
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
SOOTSIM_HAPTIC_FEEDBACK_TOUCHABLE_SOURCE,
|
|
44
44
|
SOOTSIM_HAPTIC_FEEDBACK_TOUCHABLE_SPECIFIER,
|
|
45
45
|
compatStubsForBuildResolver,
|
|
46
|
+
usesUpstreamScreensJavaScript,
|
|
46
47
|
reactNativeDeepStubsForBuildResolver,
|
|
47
48
|
} from '../../peach-compat/src/stub-manifest.ts'
|
|
48
49
|
import {
|
|
@@ -50,6 +51,7 @@ import {
|
|
|
50
51
|
resolveSootsimBridgePort,
|
|
51
52
|
} from './bridge-constants.ts'
|
|
52
53
|
import { DOM_SOURCE_ROOT, domSourceFilename } from './dom-source-reference.ts'
|
|
54
|
+
import { readInstalledPackageVersions } from './installed-package-versions'
|
|
53
55
|
import { isRecord } from './is-record.ts'
|
|
54
56
|
import {
|
|
55
57
|
SHELL_BRIDGE_IDENTITY_PATH,
|
|
@@ -143,9 +145,17 @@ const internalTamaguiPackages = getInternalTamaguiPackages()
|
|
|
143
145
|
|
|
144
146
|
const vitePackageStubs = compatStubsForBuildResolver('vite')
|
|
145
147
|
const viteReactNativeDeepStubs = reactNativeDeepStubsForBuildResolver('vite')
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)
|
|
148
|
+
function resolveBuiltinStubs(appDir: string): Record<string, string> {
|
|
149
|
+
const versions = appDir
|
|
150
|
+
? readInstalledPackageVersions(appDir, ['node_modules/react-native-screens'])
|
|
151
|
+
: {}
|
|
152
|
+
const upstreamScreens = usesUpstreamScreensJavaScript(versions['react-native-screens'])
|
|
153
|
+
return Object.fromEntries(
|
|
154
|
+
vitePackageStubs
|
|
155
|
+
.filter((entry) => !(entry.specifier === 'react-native-screens' && upstreamScreens))
|
|
156
|
+
.map((entry) => [entry.specifier, entry.stubFile]),
|
|
157
|
+
)
|
|
158
|
+
}
|
|
149
159
|
const rnLibraryStubs = Object.fromEntries(
|
|
150
160
|
viteReactNativeDeepStubs.map((entry) => [
|
|
151
161
|
entry.specifier,
|
|
@@ -648,8 +658,8 @@ export type WorkerBootClosure = {
|
|
|
648
658
|
// implementation roots loaded before Home; only their static dependencies
|
|
649
659
|
// share a chunk. other dynamic roots retain their first-use boundaries.
|
|
650
660
|
bootRoots?: readonly string[]
|
|
651
|
-
// byte cap on the
|
|
652
|
-
// unneeded inclusions rather than raising the cap.
|
|
661
|
+
// byte cap on the entry and every chunk it loads eagerly; fix excess boot
|
|
662
|
+
// dependencies and unneeded inclusions rather than raising the cap.
|
|
653
663
|
// a cap failure in a worktree whose node_modules is symlinked from another
|
|
654
664
|
// tree is suspect: workspace modules resolve into the other tree and bundle
|
|
655
665
|
// twice (~1MB rendered here). re-run with a real `bun install` first.
|
|
@@ -685,12 +695,12 @@ const ENGINE_WORKER_BOOT_CLOSURES: WorkerBootClosure[] = [
|
|
|
685
695
|
// retain their dynamic boundary, so a worker fetches only its admitted glue.
|
|
686
696
|
{
|
|
687
697
|
entry: 'src/render-worker/shell-worker-entry.ts',
|
|
688
|
-
maxBytes:
|
|
698
|
+
maxBytes: 3_020_000,
|
|
689
699
|
bootRoots: SHELL_WORKER_BOOT_ROOTS,
|
|
690
700
|
},
|
|
691
701
|
{
|
|
692
702
|
entry: 'src/render-worker/compositor-worker-entry.ts',
|
|
693
|
-
maxBytes:
|
|
703
|
+
maxBytes: 1_380_000,
|
|
694
704
|
bootRoots: COMPOSITOR_WORKER_BOOT_ROOTS,
|
|
695
705
|
},
|
|
696
706
|
]
|
|
@@ -741,6 +751,41 @@ function collectStaticBootModules(
|
|
|
741
751
|
return modules
|
|
742
752
|
}
|
|
743
753
|
|
|
754
|
+
// the render workers own the paint graph. one value import of it from a
|
|
755
|
+
// host-page module puts the whole graph on the host boot a second time, which
|
|
756
|
+
// no byte cap names; the host build refuses it with the import chain.
|
|
757
|
+
const RENDER_ONLY_MODULES = [
|
|
758
|
+
'src/engine/canvaskit-renderer.ts',
|
|
759
|
+
'src/engine/image-loader.ts',
|
|
760
|
+
'src/engine/node.ts',
|
|
761
|
+
'src/engine/paint-boundary.ts',
|
|
762
|
+
'src/engine/scene-table.ts',
|
|
763
|
+
'src/engine/yoga-layout.ts',
|
|
764
|
+
]
|
|
765
|
+
|
|
766
|
+
function hostBootImportChain(
|
|
767
|
+
context: { getModuleInfo(id: string): { importedIds: string[] } | null },
|
|
768
|
+
entry: string,
|
|
769
|
+
target: string,
|
|
770
|
+
): string[] {
|
|
771
|
+
const parents = new Map<string, string | null>([[entry, null]])
|
|
772
|
+
const pending = [entry]
|
|
773
|
+
while (pending.length > 0) {
|
|
774
|
+
const id = pending.shift()!
|
|
775
|
+
if (id === target) break
|
|
776
|
+
for (const dependency of context.getModuleInfo(id)?.importedIds ?? []) {
|
|
777
|
+
if (parents.has(dependency) || NON_SHELL_BOOT_COMPONENT_MODULES.test(dependency))
|
|
778
|
+
continue
|
|
779
|
+
parents.set(dependency, id)
|
|
780
|
+
pending.push(dependency)
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
const chain: string[] = []
|
|
784
|
+
for (let id: string | null = target; id; id = parents.get(id) ?? null)
|
|
785
|
+
chain.unshift(path.relative(process.cwd(), id))
|
|
786
|
+
return chain
|
|
787
|
+
}
|
|
788
|
+
|
|
744
789
|
// the host and its boot-time rotation definitions share one download. optional
|
|
745
790
|
// services keep their dynamic imports and ordered first-use evaluation.
|
|
746
791
|
export function hostBootChunkPlugin(): Plugin {
|
|
@@ -754,6 +799,14 @@ export function hostBootChunkPlugin(): Plugin {
|
|
|
754
799
|
'src/main.tsx',
|
|
755
800
|
'src/settings/device-rotation.ts',
|
|
756
801
|
])
|
|
802
|
+
const entry = [...modules].find((id) => id.endsWith('/src/main.tsx'))
|
|
803
|
+
for (const id of modules) {
|
|
804
|
+
if (!entry || !RENDER_ONLY_MODULES.some((module) => id.endsWith('/' + module)))
|
|
805
|
+
continue
|
|
806
|
+
this.error(
|
|
807
|
+
`the host page boot statically imports ${path.relative(process.cwd(), id)}, which the render workers own:\n ${hostBootImportChain(this, entry, id).join('\n -> ')}\nmove what the host needs into a module of its own, or import it dynamically.`,
|
|
808
|
+
)
|
|
809
|
+
}
|
|
757
810
|
// the entry must retain its filename and manifest identity.
|
|
758
811
|
for (const id of modules) if (id.endsWith('/src/main.tsx')) modules.delete(id)
|
|
759
812
|
}
|
|
@@ -900,16 +953,16 @@ export function workerBootChunkPlugin(closures: WorkerBootClosure[]): Plugin {
|
|
|
900
953
|
bootChunk.imports.push(chunk.fileName)
|
|
901
954
|
}
|
|
902
955
|
}
|
|
956
|
+
const eager = new Set<string>()
|
|
957
|
+
const pending = [bootChunk.fileName]
|
|
958
|
+
const byName = new Map(chunks.map((chunk) => [chunk.fileName, chunk]))
|
|
959
|
+
while (pending.length > 0) {
|
|
960
|
+
const file = pending.pop()!
|
|
961
|
+
if (eager.has(file)) continue
|
|
962
|
+
eager.add(file)
|
|
963
|
+
pending.push(...(byName.get(file)?.imports ?? []))
|
|
964
|
+
}
|
|
903
965
|
if (closure.bootRoots) {
|
|
904
|
-
const eager = new Set<string>()
|
|
905
|
-
const pending = [bootChunk.fileName]
|
|
906
|
-
const byName = new Map(chunks.map((chunk) => [chunk.fileName, chunk]))
|
|
907
|
-
while (pending.length > 0) {
|
|
908
|
-
const file = pending.pop()!
|
|
909
|
-
if (eager.has(file)) continue
|
|
910
|
-
eager.add(file)
|
|
911
|
-
pending.push(...(byName.get(file)?.imports ?? []))
|
|
912
|
-
}
|
|
913
966
|
for (const chunk of chunks) {
|
|
914
967
|
if (eager.has(chunk.fileName)) continue
|
|
915
968
|
const required = chunk.moduleIds.find((id) => bootModules.has(id))
|
|
@@ -919,11 +972,16 @@ export function workerBootChunkPlugin(closures: WorkerBootClosure[]): Plugin {
|
|
|
919
972
|
)
|
|
920
973
|
}
|
|
921
974
|
}
|
|
922
|
-
|
|
975
|
+
// the cap counts every chunk the entry loads eagerly: once Home's
|
|
976
|
+
// definitions ride their own preloaded chunk the entry is a thin loader
|
|
977
|
+
const eagerChunks = chunks.filter((chunk) => eager.has(chunk.fileName))
|
|
978
|
+
const bytes = eagerChunks.reduce(
|
|
979
|
+
(sum, chunk) => sum + Buffer.byteLength(chunk.code),
|
|
980
|
+
0,
|
|
981
|
+
)
|
|
923
982
|
if (bytes > closure.maxBytes) {
|
|
924
|
-
const chunk = bootChunk
|
|
925
983
|
const pkgs = new Map<string, Set<string>>()
|
|
926
|
-
for (const id of chunk.moduleIds) {
|
|
984
|
+
for (const id of eagerChunks.flatMap((chunk) => chunk.moduleIds)) {
|
|
927
985
|
// a virtual `\0` id (the jsx-runtime re-export shim) names a
|
|
928
986
|
// node_modules path without being a second copy of that package
|
|
929
987
|
if (id.startsWith('\0')) continue
|
|
@@ -950,7 +1008,8 @@ export function workerBootChunkPlugin(closures: WorkerBootClosure[]): Plugin {
|
|
|
950
1008
|
? `\ndetected duplicate packages bundled from multiple roots (likely a symlinked or cross-tree node_modules):\n ${duplicates.join('\n ')}`
|
|
951
1009
|
: ''
|
|
952
1010
|
// the largest modules are where a cut pays, so the error names them
|
|
953
|
-
const largest =
|
|
1011
|
+
const largest = eagerChunks
|
|
1012
|
+
.flatMap((chunk) => Object.entries(chunk.modules))
|
|
954
1013
|
.sort(([, a], [, b]) => b.renderedLength - a.renderedLength)
|
|
955
1014
|
.slice(0, 40)
|
|
956
1015
|
.map(
|
|
@@ -958,7 +1017,7 @@ export function workerBootChunkPlugin(closures: WorkerBootClosure[]): Plugin {
|
|
|
958
1017
|
`${module.renderedLength} ${path.relative(process.cwd(), id)}`,
|
|
959
1018
|
)
|
|
960
1019
|
this.error(
|
|
961
|
-
`worker ${closure.entry}: ${
|
|
1020
|
+
`worker ${closure.entry}: ${eagerChunks.map((chunk) => chunk.fileName).join(' + ')} is ${bytes} bytes, over the ${closure.maxBytes} byte cap; eliminate excess boot dependencies rather than raising the cap${dupDetail}\nlargest modules (rendered bytes):\n ${largest.join('\n ')}`,
|
|
962
1021
|
)
|
|
963
1022
|
}
|
|
964
1023
|
},
|
|
@@ -1506,7 +1565,7 @@ function sootsimConfigPlugin(
|
|
|
1506
1565
|
}
|
|
1507
1566
|
|
|
1508
1567
|
// build alias list from builtin stubs
|
|
1509
|
-
const stubAliases = Object.entries(
|
|
1568
|
+
const stubAliases = Object.entries(resolveBuiltinStubs(appDir))
|
|
1510
1569
|
// sort longest keys first so subpath aliases (e.g. foo/Bar) match before
|
|
1511
1570
|
// their parent package (e.g. foo) — vite processes aliases in order
|
|
1512
1571
|
.sort((a, b) => b[0].length - a[0].length)
|
|
@@ -1963,7 +2022,7 @@ function sootsimEsbuildPlugin(appDir: string) {
|
|
|
1963
2022
|
})
|
|
1964
2023
|
|
|
1965
2024
|
// resolve builtin stubs (react-native-safe-area-context, expo-*, etc.)
|
|
1966
|
-
for (const [pkgName, stubFile] of Object.entries(
|
|
2025
|
+
for (const [pkgName, stubFile] of Object.entries(resolveBuiltinStubs(appDir))) {
|
|
1967
2026
|
const stubPath = path.resolve(compatStubsDir, stubFile)
|
|
1968
2027
|
const escaped = pkgName.replace(/[.*+?^${}()|[\]\\/@-]/g, '\\$&')
|
|
1969
2028
|
build.onResolve({ filter: new RegExp(`^${escaped}$`) }, () => ({
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BINARYEN_VERSION, wasmOpt } from 'wasm-opt'
|
|
2
|
+
|
|
3
|
+
// the linked executable of a Nitro or Turbo module, size-optimized. clang's own
|
|
4
|
+
// optimizer pass is off (-O0 on the link) so an edit never pays for it and the
|
|
5
|
+
// artifact never depends on the machine; this runs the pinned Binaryen once per
|
|
6
|
+
// cached artifact instead. the features are the ones the link declares, and the
|
|
7
|
+
// pass drops the custom sections (autolink entries, producers) no host reads.
|
|
8
|
+
const FEATURES = [
|
|
9
|
+
'threads',
|
|
10
|
+
'bulk-memory',
|
|
11
|
+
'bulk-memory-opt',
|
|
12
|
+
'call-indirect-overlong',
|
|
13
|
+
'exception-handling',
|
|
14
|
+
'multivalue',
|
|
15
|
+
'mutable-globals',
|
|
16
|
+
'nontrapping-float-to-int',
|
|
17
|
+
'reference-types',
|
|
18
|
+
'sign-ext',
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
/** feeds the artifact hash: a new optimizer or flag set is a new artifact. */
|
|
22
|
+
export const WASM_OPTIMIZE_IDENTITY = `wasm-opt ${BINARYEN_VERSION} -Oz ${FEATURES.join(',')}`
|
|
23
|
+
|
|
24
|
+
export async function optimizeWasm(file: string, output: string): Promise<void> {
|
|
25
|
+
const result = await wasmOpt([
|
|
26
|
+
'-Oz',
|
|
27
|
+
...FEATURES.map((feature) => `--enable-${feature}`),
|
|
28
|
+
file,
|
|
29
|
+
'-o',
|
|
30
|
+
output,
|
|
31
|
+
])
|
|
32
|
+
if (result.status !== 0)
|
|
33
|
+
throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`)
|
|
34
|
+
}
|
|
@@ -168,8 +168,8 @@ function runMinifiers() {
|
|
|
168
168
|
slot.worker.ref()
|
|
169
169
|
try {
|
|
170
170
|
// a measurement build (PEACH_ENGINE_PROFILE=1) keeps every name and
|
|
171
|
-
// function boundary a cpu profile shows
|
|
172
|
-
//
|
|
171
|
+
// function boundary a cpu profile shows; public chunks carry their url
|
|
172
|
+
// but no source map
|
|
173
173
|
slot.worker.postMessage({
|
|
174
174
|
code: job.code,
|
|
175
175
|
isEntry: job.isEntry,
|
|
@@ -281,7 +281,7 @@ System.instantiate = async function(url) {
|
|
|
281
281
|
linkedChunks.add(url);
|
|
282
282
|
let registration;
|
|
283
283
|
// minified module chunks assume strict block-scoped function semantics.
|
|
284
|
-
new Function('System', '"use strict";\\n' + source)({
|
|
284
|
+
new Function('System', '"use strict";\\n' + source + '\\n//# sourceURL=' + url)({
|
|
285
285
|
register(dependencies, declare) { registration = [dependencies, declare]; },
|
|
286
286
|
importModule
|
|
287
287
|
});
|
package/src/xcode-project.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { createHash } from 'node:crypto'
|
|
|
12
12
|
import fs from 'node:fs'
|
|
13
13
|
import path from 'node:path'
|
|
14
14
|
import plist from 'plist'
|
|
15
|
+
import { isRecord } from './is-record'
|
|
15
16
|
import { assetSymbolSettingKeys } from './swift-coverage/xcode-assets'
|
|
16
17
|
import { isSwiftNativeTranslationUnit, moduleMapName } from './swift-package'
|
|
17
18
|
import {
|
|
@@ -1191,6 +1192,57 @@ export function listXcodeAppTargets(
|
|
|
1191
1192
|
.map((ref) => str(ref.target.name) ?? ref.id)
|
|
1192
1193
|
}
|
|
1193
1194
|
|
|
1195
|
+
// extension catalogs belong to the extension's resource phase, independently
|
|
1196
|
+
// of the containing app. use the same membership and settings as app builds.
|
|
1197
|
+
export function readXcodeExtensionTargets(input: string): {
|
|
1198
|
+
name: string
|
|
1199
|
+
resources: string[]
|
|
1200
|
+
infoPlist: Record<string, unknown>
|
|
1201
|
+
accentName: string | null
|
|
1202
|
+
}[] {
|
|
1203
|
+
return workspaceProjects(fs.realpathSync(input)).projects.flatMap((project) =>
|
|
1204
|
+
projectTargets(project).flatMap((ref) => {
|
|
1205
|
+
if (ref.target.productType !== 'com.apple.product-type.app-extension') return []
|
|
1206
|
+
const name = str(ref.target.name) ?? ref.id
|
|
1207
|
+
const { get, keys, xcconfigs } = targetSettings(
|
|
1208
|
+
ref,
|
|
1209
|
+
defaultConfiguration(project),
|
|
1210
|
+
{
|
|
1211
|
+
TARGET_NAME: name,
|
|
1212
|
+
SRCROOT: project.projectDir,
|
|
1213
|
+
PROJECT_DIR: project.projectDir,
|
|
1214
|
+
},
|
|
1215
|
+
{ requireSources: false },
|
|
1216
|
+
)
|
|
1217
|
+
const infoFile = get('INFOPLIST_FILE')
|
|
1218
|
+
if (!infoFile) throw new Error(`${name}: extension has no INFOPLIST_FILE`)
|
|
1219
|
+
const info = plist.parse(
|
|
1220
|
+
fs.readFileSync(path.resolve(project.projectDir, infoFile), 'utf8'),
|
|
1221
|
+
)
|
|
1222
|
+
if (!isRecord(info))
|
|
1223
|
+
throw new Error(`${name}: extension Info.plist is not a dictionary`)
|
|
1224
|
+
const { resources } = targetMembers(
|
|
1225
|
+
ref,
|
|
1226
|
+
get,
|
|
1227
|
+
{ requireSources: false },
|
|
1228
|
+
keys,
|
|
1229
|
+
new Set(xcconfigs),
|
|
1230
|
+
)
|
|
1231
|
+
return [
|
|
1232
|
+
{
|
|
1233
|
+
name,
|
|
1234
|
+
resources,
|
|
1235
|
+
infoPlist: info,
|
|
1236
|
+
accentName:
|
|
1237
|
+
typeof info.NSAccentColorName === 'string'
|
|
1238
|
+
? info.NSAccentColorName
|
|
1239
|
+
: get('ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME') || null,
|
|
1240
|
+
},
|
|
1241
|
+
]
|
|
1242
|
+
}),
|
|
1243
|
+
)
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1194
1246
|
/**
|
|
1195
1247
|
* the application target and build configuration a scheme runs: its launch
|
|
1196
1248
|
* action, as xcode's Run builds it. shared schemes and the user's own are
|
|
@@ -43,6 +43,17 @@ export function xcodePathResolver(
|
|
|
43
43
|
return resolve
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
// a build file's platform filters name the platforms it builds for; the iOS
|
|
47
|
+
// simulator build takes it when it has none or names ios. maccatalyst is a
|
|
48
|
+
// separate platform that builds with the Mac Catalyst sdk.
|
|
49
|
+
export function xcodeBuildFileBuildsForIos(buildFile: PlistDict): boolean {
|
|
50
|
+
const filters = [
|
|
51
|
+
...list(buildFile.platformFilters),
|
|
52
|
+
str(buildFile.platformFilter),
|
|
53
|
+
].filter((filter): filter is string => !!filter)
|
|
54
|
+
return !filters.length || filters.includes('ios')
|
|
55
|
+
}
|
|
56
|
+
|
|
46
57
|
export function visitXcodeTargetMembers(
|
|
47
58
|
objects: PlistDict,
|
|
48
59
|
targetId: string,
|
|
@@ -60,7 +71,7 @@ export function visitXcodeTargetMembers(
|
|
|
60
71
|
continue
|
|
61
72
|
for (const buildFileId of list(phase.files)) {
|
|
62
73
|
const buildFile = objects[buildFileId]
|
|
63
|
-
if (!isDict(buildFile)) continue
|
|
74
|
+
if (!isDict(buildFile) || !xcodeBuildFileBuildsForIos(buildFile)) continue
|
|
64
75
|
const refId = str(buildFile.fileRef)
|
|
65
76
|
if (!refId) continue
|
|
66
77
|
const entry = objects[refId]
|