peachsim 0.1.2935 → 0.1.2937
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/LICENSE +6 -8
- package/cli/account-gate.ts +20 -3
- package/cli/app-bundle-resources.ts +66 -19
- package/cli/catalog/meta.ts +2 -106
- package/cli/command-agent.ts +7 -0
- package/cli/command-registry.ts +0 -1
- package/cli/commands/control.ts +13 -5
- package/cli/commands/daemon.ts +4 -2
- package/cli/commands/device.ts +78 -8
- package/cli/commands/do-chain.ts +11 -8
- package/cli/commands/inspect/core.ts +4 -9
- package/cli/commands/inspect/settling.ts +1 -0
- package/cli/commands/logout.ts +6 -1
- package/cli/commands/map.ts +2 -6
- package/cli/commands/package.ts +112 -57
- package/cli/commands/shell-url.ts +0 -1
- package/cli/download-auth.ts +2 -0
- package/cli/drivers/playwright-provisioning.ts +10 -38
- package/cli/github-workflow-identity.ts +8 -0
- package/cli/internal-child-contract.ts +1 -0
- package/cli/internal-child.ts +5 -0
- package/cli/main.ts +2 -10
- package/cli/outbound-endpoints.ts +26 -0
- package/detox/index.ts +227 -131
- 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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +47 -3
- package/dist-lib/bridge-contract-input.mjs +6 -6
- package/dist-lib/bridge-contract.cjs +10 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +12779 -9515
- package/dist-lib/capture-contract.cjs +39 -17
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +8 -8
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +6 -6
- package/dist-lib/detox/index.cjs +200 -132
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
- package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
- package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
- package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
- package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
- package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
- package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
- package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
- package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
- package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
- package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
- package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
- package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
- package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
- package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
- package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
- package/dist-lib/expo-swift-bundle.cjs +21037 -17896
- package/dist-lib/expo-swift-metadata.cjs +8 -2
- package/dist-lib/expo-swift-metadata.mjs +9 -8
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +22481 -18741
- package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +68 -38
- package/dist-lib/kotlin-host.cjs +97 -21
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +23 -1
- package/dist-lib/metro-production-bundle.mjs +24 -4
- package/dist-lib/native-app-identity-project.cjs +3582 -571
- package/dist-lib/native-app-identity-project.mjs +1024 -398
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +132 -116
- package/dist-lib/public-origins-lib.json +215 -173
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +17 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +6 -7
- package/dist-lib/sdk.mjs +13 -14
- package/dist-lib/skills.cjs +23216 -19650
- package/dist-lib/swift-compile.cjs +4337 -2905
- package/dist-lib/swift-compile.mjs +15 -13
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +19 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +94 -32
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +8 -5
- package/dist-lib/worklet-executable.mjs +9 -6
- package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
- package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
- package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
- package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
- package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
- package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
- package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
- package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
- package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
- package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
- package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
- package/package.json +2 -2
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
- package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
- package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
- package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
- package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/wasm/include/unistd.h +1 -0
- package/src/acorn-program.ts +3 -0
- package/src/audio-codec-archives.ts +141 -0
- package/src/bridge-contract-input.ts +61 -1
- package/src/bridge-contract.ts +45 -4
- package/src/bundle-channel.mjs +44 -30
- package/src/capture-contract.ts +57 -39
- package/src/conformance-comparison-contract.ts +2 -0
- package/src/expo-discovery-cache.ts +0 -2
- package/src/expo-macro-host.ts +8 -3
- package/src/expo-native-compiler-digest.ts +0 -1
- package/src/expo-native-prebuilt.ts +1 -1
- package/src/expo-native-workspace.ts +83 -45
- package/src/expo-pod-prebuilt.ts +1 -0
- package/src/expo-swift-host.ts +158 -77
- package/src/expo-swift-legacy-runtime-source.ts +12 -1
- package/src/expo-swift-view-source.ts +51 -20
- package/src/expo-workspace-exclusion.ts +7 -1
- package/src/expoSwiftContract.ts +10 -1
- package/src/ffmpeg-source-build.ts +123 -59
- package/src/genrule-archives.ts +7 -2
- package/src/genrule-library-builds.ts +101 -18
- package/src/host/bridge-host.ts +10 -1
- package/src/installed-native-libraries.ts +147 -23
- package/src/installed-package-versions.ts +30 -0
- package/src/ios-rn-bundle-request.ts +3 -1
- package/src/ios-rn-bundle.ts +38 -27
- package/src/ios-rn-compile.ts +23 -6
- package/src/ios-rn-startup.ts +2 -1
- package/src/java-module-abi.ts +4 -3
- package/src/kotlin-host.ts +4 -4
- package/src/kotlin-library-sources.ts +8 -5
- package/src/metro-production-bundle.ts +24 -0
- package/src/native-firebase-config.ts +2 -0
- package/src/native-framework-compiler.ts +5 -0
- package/src/native-package-slice-build.ts +3 -0
- package/src/native-package-slice.ts +15 -10
- package/src/native-preparation.ts +4 -1
- package/src/native-static-libraries.ts +107 -33
- package/src/nativeRuntimePackageIndex.ts +1 -4
- package/src/nitro-adapter.lock.json +286 -286
- package/src/nitro-app-providers.ts +20 -8
- package/src/nitro-compile.ts +131 -37
- package/src/nitro-dependencies.ts +42 -8
- package/src/nitro-source.ts +40 -36
- package/src/nitro-superset.lock.json +4 -4
- package/src/nitroAdapterContract.ts +32 -7
- package/src/nitroContract.ts +21 -37
- package/src/one-direct-host-source.ts +247 -140
- package/src/one-fabric.ts +129 -0
- package/src/one-native-controls-package.ts +95 -21
- package/src/one-native-controls-release.ts +147 -14
- package/src/one-native-source.ts +4 -1
- package/src/one-nitro-inputs.ts +1 -1
- package/src/one-nitro-source.ts +45 -1
- package/src/one-sdk/source.ts +10 -41
- package/src/one-widget-metadata.ts +2 -2
- package/src/one-widget-package.ts +1 -1
- package/src/oneSdkContract.ts +3 -0
- package/src/playwright-browser-paths.ts +30 -0
- package/src/pods-install.ts +6 -2
- package/src/pods-post-install.ts +2 -2
- package/src/pods-project.ts +10 -0
- package/src/podspec-ruby-stdlib.ts +73 -0
- package/src/podspec-ruby.ts +1 -1
- package/src/podspec-sources.ts +31 -13
- package/src/process-group.ts +135 -5
- package/src/published-swift-sdk.ts +25 -1
- package/src/react-native-bridge-modules.ts +35 -3
- package/src/react-native-core-build.ts +14 -2
- package/src/react-native-core.ts +12 -2
- package/src/rive-runtime-dependencies.ts +178 -40
- package/src/serverDiscoveryContract.ts +1 -1
- package/src/storageSnapshotContract.ts +1 -1
- package/src/swift-app-data-store.ts +35 -0
- package/src/swift-compile.ts +403 -121
- package/src/swift-compiler-digest.ts +4 -0
- package/src/swift-darwin-records.ts +6 -0
- package/src/swift-distribution-mirror.ts +10 -1
- package/src/swift-distribution.lock.json +19 -18
- package/src/swift-distribution.ts +17 -1
- package/src/swift-entry-module.ts +1 -0
- package/src/swift-guest-compile.ts +8 -1
- package/src/swift-host.ts +79 -23
- package/src/swift-installed-targets.ts +51 -20
- package/src/swift-objc-standin.ts +60 -8
- package/src/swift-packages.ts +104 -24
- package/src/swift-project-user.ts +2 -1
- package/src/swift-reproducible.ts +99 -1
- package/src/swift-root-lock.ts +52 -46
- package/src/swift-sdk-app-module.ts +65 -13
- package/src/swift-sdk-image-producer.ts +2 -1
- package/src/swift-sdk-image.ts +23 -8
- package/src/swift-sdk-later-data.ts +294 -44
- package/src/swift-sdk-surface.ts +233 -55
- package/src/swift-shared-sdk.ts +7 -0
- package/src/swift-standin-builtin-behavior.ts +18 -0
- package/src/swift-standin-emit.ts +242 -54
- package/src/swift-standins.ts +184 -38
- package/src/swift-startup-split.ts +19 -9
- package/src/swift-toolchain.ts +18 -0
- package/src/swift-wasm-prune.ts +179 -9
- package/src/swift-xcframework.ts +16 -0
- package/src/swiftContract.ts +4 -1
- package/src/swiftSdkLinkContract.ts +2 -0
- package/src/swiftTargetContract.ts +1 -0
- package/src/turbo-bundle.ts +6 -3
- package/src/turbo-codegen-intake.ts +106 -16
- package/src/turbo-compile.ts +89 -68
- package/src/turbo-fabric-app.ts +287 -23
- package/src/turbo-provider-host.ts +122 -31
- package/src/turbo-runtime.lock.json +26 -26
- package/src/turbo-source.ts +374 -157
- package/src/vite-plugin.ts +48 -112
- package/src/wasm-binary-sections.ts +40 -0
- package/src/wasm-code-immediates.ts +35 -5
- package/src/widget-extension-bundle.ts +15 -1
- package/src/worklet-executable.ts +2 -1
- package/src/worklet-kernel.ts +5 -3
- package/src/worklets-babel.ts +2 -1
- package/src/xcode-project.ts +151 -53
- package/src/xcode-scheme-actions.ts +104 -0
- package/cli/commands/canvas.ts +0 -1204
- package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
- package/dist-lib/vendor/magic-string.cjs +0 -1693
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
- package/src/appBundleResourcesContract.ts +0 -51
- package/src/canvas-groups.ts +0 -28
- package/src/canvas-map-layout.ts +0 -161
- package/src/oneWidgetContract.ts +0 -134
package/src/vite-plugin.ts
CHANGED
|
@@ -30,6 +30,7 @@ type Plugin = RolldownPlugin & {
|
|
|
30
30
|
build: { sourcemap?: boolean | 'inline' | 'hidden' }
|
|
31
31
|
}) => void
|
|
32
32
|
}
|
|
33
|
+
import { isOneFramework } from '../../contrast-bundler/src/oneFramework.ts'
|
|
33
34
|
import { transformFlowSource } from '../../peach-compat/src/flow-strip.ts'
|
|
34
35
|
import { getCliRuntime } from './cli-runtime.ts'
|
|
35
36
|
import {
|
|
@@ -52,8 +53,9 @@ import {
|
|
|
52
53
|
PEACH_UPSTREAM_MODULES,
|
|
53
54
|
SOOTSIM_HAPTIC_FEEDBACK_TOUCHABLE_SOURCE,
|
|
54
55
|
SOOTSIM_HAPTIC_FEEDBACK_TOUCHABLE_SPECIFIER,
|
|
55
|
-
|
|
56
|
+
reactNativeDeepImportSpecifier,
|
|
56
57
|
reactNativeDeepStubsForBuildResolver,
|
|
58
|
+
rnDeepImportVirtualSource,
|
|
57
59
|
} from '@peach/globals/guest-modules/stub-manifest'
|
|
58
60
|
import {
|
|
59
61
|
EXPO_PLATFORM_MODULE,
|
|
@@ -131,10 +133,6 @@ const sootsimBrowserSourceAliases = [
|
|
|
131
133
|
},
|
|
132
134
|
]
|
|
133
135
|
|
|
134
|
-
const compatStubsDir = path.resolve(compatRoot, 'src/stubs')
|
|
135
|
-
const nativeAutoStubPath = path.resolve(compatStubsDir, 'native-auto-stub.ts')
|
|
136
|
-
const rnDeepStubDefault = path.resolve(compatStubsDir, 'react-native-internals.ts')
|
|
137
|
-
|
|
138
136
|
function getInternalTamaguiPackages(): string[] {
|
|
139
137
|
try {
|
|
140
138
|
const scoped = fs
|
|
@@ -150,12 +148,13 @@ function getInternalTamaguiPackages(): string[] {
|
|
|
150
148
|
|
|
151
149
|
const internalTamaguiPackages = getInternalTamaguiPackages()
|
|
152
150
|
|
|
153
|
-
const vitePackageStubs = compatStubsForBuildResolver('vite')
|
|
154
151
|
const viteReactNativeDeepStubs = reactNativeDeepStubsForBuildResolver('vite')
|
|
152
|
+
const RN_DEEP_VIRTUAL_PREFIX = 'virtual:peach-rn-deep/'
|
|
153
|
+
const RN_DEEP_RESOLVED_PREFIX = '\0peach:rn-deep:'
|
|
155
154
|
const rnLibraryStubs = Object.fromEntries(
|
|
156
155
|
viteReactNativeDeepStubs.map((entry) => [
|
|
157
156
|
entry.specifier,
|
|
158
|
-
|
|
157
|
+
RN_DEEP_VIRTUAL_PREFIX + entry.stubFile,
|
|
159
158
|
]),
|
|
160
159
|
)
|
|
161
160
|
|
|
@@ -164,12 +163,8 @@ function resolveReactNativeLibraryStub(source: string, importer?: string) {
|
|
|
164
163
|
source.startsWith('.') && importer
|
|
165
164
|
? path.resolve(path.dirname(stripViteQuery(importer)), stripViteQuery(source))
|
|
166
165
|
: stripViteQuery(source)
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
const specifier = match[1]
|
|
170
|
-
.replace(/\.(?:[cm]?[jt]sx?)$/, '')
|
|
171
|
-
.replace(/\.(?:native|web|ios|android)$/, '')
|
|
172
|
-
return rnLibraryStubs[specifier]
|
|
166
|
+
const specifier = reactNativeDeepImportSpecifier(candidate)
|
|
167
|
+
return specifier ? rnLibraryStubs[specifier] : undefined
|
|
173
168
|
}
|
|
174
169
|
|
|
175
170
|
type PublishedBrowserPackage = {
|
|
@@ -234,21 +229,6 @@ function resolvePublishedBrowserInternal(
|
|
|
234
229
|
return null
|
|
235
230
|
}
|
|
236
231
|
|
|
237
|
-
// resolve the real @react-navigation/native location at config time so the
|
|
238
|
-
// wrapper at compat/src/stubs/react-navigation-native.tsx can import it
|
|
239
|
-
// without bouncing back through the alias above. the wrapper imports from
|
|
240
|
-
// the synthetic specifier `@sootsim-internal/react-navigation-native-real`
|
|
241
|
-
// which is aliased to this absolute path; rolldown follows the path
|
|
242
|
-
// terminally so its `export *` static analysis sees the real export
|
|
243
|
-
// surface.
|
|
244
|
-
const reactNavigationNativeRealPath = (() => {
|
|
245
|
-
try {
|
|
246
|
-
return sootsimPluginRequire.resolve('@react-navigation/native')
|
|
247
|
-
} catch {
|
|
248
|
-
return null
|
|
249
|
-
}
|
|
250
|
-
})()
|
|
251
|
-
|
|
252
232
|
const reactNativeHapticFeedbackTouchablePath = (() => {
|
|
253
233
|
try {
|
|
254
234
|
return path.join(
|
|
@@ -316,33 +296,12 @@ const coreOwnedPackages = [
|
|
|
316
296
|
'canvaskit-wasm/full',
|
|
317
297
|
]
|
|
318
298
|
|
|
319
|
-
const nativePackagePatterns = [
|
|
320
|
-
/^expo-/,
|
|
321
|
-
/^react-native-/,
|
|
322
|
-
/^@react-native\//,
|
|
323
|
-
/^@react-native-community\//,
|
|
324
|
-
/^@expo\//,
|
|
325
|
-
/^expo$/,
|
|
326
|
-
]
|
|
327
|
-
|
|
328
299
|
function getPackageName(source: string): string {
|
|
329
300
|
return source.startsWith('@')
|
|
330
301
|
? source.split('/').slice(0, 2).join('/')
|
|
331
302
|
: source.split('/')[0]
|
|
332
303
|
}
|
|
333
304
|
|
|
334
|
-
function isNativePackage(source: string): boolean {
|
|
335
|
-
return nativePackagePatterns.some((p) => p.test(source))
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function moduleExistsIn(pkgName: string, dir: string): boolean {
|
|
339
|
-
try {
|
|
340
|
-
return fs.existsSync(path.join(dir, 'node_modules', pkgName))
|
|
341
|
-
} catch {
|
|
342
|
-
return false
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
305
|
export function sootsim(options: SootSimOptions = {}): Plugin[] {
|
|
347
306
|
const appDir = options.app ? path.resolve(options.app) : ''
|
|
348
307
|
const extraSources = (options.sources || []).map((s) => path.resolve(s))
|
|
@@ -401,7 +360,6 @@ export function sootsim(options: SootSimOptions = {}): Plugin[] {
|
|
|
401
360
|
reactNativeRequirePlugin(isAppSource),
|
|
402
361
|
...(appDir ? [externalAppResolvePlugin(appDir, isAppSource, ownedPackages)] : []),
|
|
403
362
|
externalAppTransformPlugin(isAppSource, options.build),
|
|
404
|
-
stubMissingNativeDeps(appDir),
|
|
405
363
|
stubMissingImages(isAppSource),
|
|
406
364
|
]
|
|
407
365
|
}
|
|
@@ -693,7 +651,7 @@ const ENGINE_WORKER_BOOT_CLOSURES: WorkerBootClosure[] = [
|
|
|
693
651
|
// none has module-level side effects, and none is mounted by home, so they must
|
|
694
652
|
// not be forced into worker-home when only lazy app chunks import them.
|
|
695
653
|
const NON_SHELL_BOOT_COMPONENT_MODULES =
|
|
696
|
-
|
|
654
|
+
/\/packages\/peach-engine\/src\/(?:components\/(?:Button|DrawerLayoutAndroid|InputAccessoryHost|InputAccessoryPortal|InputAccessoryView|KeyboardAvoidingView|Modal|ProgressBarAndroid|SectionList|Switch|TouchableHighlight|TouchableWithoutFeedback)|vendor\/react-native-lists\/VirtualizedSectionList|react-native\/(?:LogBox|PushNotificationIOS|TVFocusGuideView|VirtualView|virtual-collection)|modal-window)\.[jt]sx?$/
|
|
697
655
|
|
|
698
656
|
const WORKER_SIDE_EFFECT_FREE_PACKAGES = [
|
|
699
657
|
// the bridge only builds proxies over react, so the compositor, which reaches it through
|
|
@@ -1298,16 +1256,24 @@ export function manifestNativeSeamRedirect(): Plugin {
|
|
|
1298
1256
|
...Object.keys(rnLibraryStubs).map((specifier) => path.posix.basename(specifier)),
|
|
1299
1257
|
]
|
|
1300
1258
|
.map((basename) => basename.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
|
|
1301
|
-
.join('|')})(?:\\.(?:native|web|ios|android))?(?:\\.[cm]?[jt]sx?)?$`,
|
|
1259
|
+
.join('|')})(?:\\.(?:native|web|ios|android))?(?:\\.[cm]?[jt]sx?)?(?:\\?.*)?$`,
|
|
1302
1260
|
)
|
|
1303
1261
|
return {
|
|
1304
1262
|
name: 'sootsim-manifest-native-seam-redirect',
|
|
1305
1263
|
enforce: 'pre',
|
|
1306
1264
|
resolveId: {
|
|
1307
|
-
filter: {
|
|
1265
|
+
filter: {
|
|
1266
|
+
id: new RegExp(`^${RN_DEEP_VIRTUAL_PREFIX}|${sourceFilter.source}`),
|
|
1267
|
+
},
|
|
1308
1268
|
handler(source, importer) {
|
|
1269
|
+
if (source.startsWith(RN_DEEP_VIRTUAL_PREFIX))
|
|
1270
|
+
return RN_DEEP_RESOLVED_PREFIX + source.slice(RN_DEEP_VIRTUAL_PREFIX.length)
|
|
1309
1271
|
const nativeLibraryStub = resolveReactNativeLibraryStub(source, importer)
|
|
1310
|
-
if (nativeLibraryStub)
|
|
1272
|
+
if (nativeLibraryStub)
|
|
1273
|
+
return (
|
|
1274
|
+
RN_DEEP_RESOLVED_PREFIX +
|
|
1275
|
+
nativeLibraryStub.slice(RN_DEEP_VIRTUAL_PREFIX.length)
|
|
1276
|
+
)
|
|
1311
1277
|
if (!importer || byPkg.size === 0 || targets.has(importer)) return null
|
|
1312
1278
|
// find the innermost package whose path appears in the importer. matches both
|
|
1313
1279
|
// `/<pkg>/` (unscoped) and `/@scope/<pkg>/` (scoped — the leading `@`
|
|
@@ -1343,6 +1309,14 @@ export function manifestNativeSeamRedirect(): Plugin {
|
|
|
1343
1309
|
return seam.target
|
|
1344
1310
|
},
|
|
1345
1311
|
},
|
|
1312
|
+
load(id) {
|
|
1313
|
+
if (!id.startsWith(RN_DEEP_RESOLVED_PREFIX)) return null
|
|
1314
|
+
return rnDeepImportVirtualSource(id.slice(RN_DEEP_RESOLVED_PREFIX.length), {
|
|
1315
|
+
bridgeModule: path.resolve(compatRoot, 'src/rn-host-bridge.ts'),
|
|
1316
|
+
upstreamModule: path.resolve(compatRoot, 'dist-pressability/upstream.mjs'),
|
|
1317
|
+
reactShimModule: path.resolve(compatRoot, 'src/react-shim.ts'),
|
|
1318
|
+
})
|
|
1319
|
+
},
|
|
1346
1320
|
}
|
|
1347
1321
|
}
|
|
1348
1322
|
|
|
@@ -1354,6 +1328,7 @@ function sootsimConfigPlugin(
|
|
|
1354
1328
|
): Plugin {
|
|
1355
1329
|
let projectRoot = appDir || build?.root || ''
|
|
1356
1330
|
let iosSdkResolver: Promise<unknown> | undefined
|
|
1331
|
+
let onePackage: { path: string; usesExports: boolean } | undefined
|
|
1357
1332
|
return {
|
|
1358
1333
|
name: 'sootsim-config',
|
|
1359
1334
|
configResolved(config) {
|
|
@@ -1363,15 +1338,25 @@ function sootsimConfigPlugin(
|
|
|
1363
1338
|
order: 'pre',
|
|
1364
1339
|
filter: { id: /^one\/ios\// },
|
|
1365
1340
|
async handler(source) {
|
|
1341
|
+
if (!onePackage) {
|
|
1342
|
+
const projectRequire = createRequire(path.join(projectRoot, 'package.json'))
|
|
1343
|
+
const packageJson = projectRequire.resolve('one/package.json')
|
|
1344
|
+
const manifest: unknown = JSON.parse(fs.readFileSync(packageJson, 'utf8'))
|
|
1345
|
+
onePackage = {
|
|
1346
|
+
path: packageJson,
|
|
1347
|
+
usesExports:
|
|
1348
|
+
isRecord(manifest) && isOneFramework(manifest.name, manifest.version),
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
const packageJson = onePackage.path
|
|
1352
|
+
this.addWatchFile(packageJson)
|
|
1353
|
+
if (onePackage.usesExports) return null
|
|
1366
1354
|
// one's prebuild owns both the facade and its native table generation.
|
|
1367
1355
|
// use the installed resolver so missing bindings keep upstream's error.
|
|
1368
|
-
const projectRequire = createRequire(path.join(projectRoot, 'package.json'))
|
|
1369
|
-
const packageJson = projectRequire.resolve('one/package.json')
|
|
1370
1356
|
const resolverFile = path.join(
|
|
1371
1357
|
path.dirname(packageJson),
|
|
1372
1358
|
'dist/esm/utils/iosSdkFacade.mjs',
|
|
1373
1359
|
)
|
|
1374
|
-
this.addWatchFile(packageJson)
|
|
1375
1360
|
this.addWatchFile(resolverFile)
|
|
1376
1361
|
iosSdkResolver ??= import(pathToFileURL(resolverFile).href)
|
|
1377
1362
|
const resolver = await iosSdkResolver
|
|
@@ -1414,18 +1399,6 @@ export function sootsimResolveOptions(
|
|
|
1414
1399
|
appDir,
|
|
1415
1400
|
),
|
|
1416
1401
|
) {
|
|
1417
|
-
// build alias list from builtin stubs
|
|
1418
|
-
const stubAliases = vitePackageStubs
|
|
1419
|
-
.map((entry) => [entry.specifier, entry.stubFile] as const)
|
|
1420
|
-
// sort longest keys first so subpath aliases (e.g. foo/Bar) match before
|
|
1421
|
-
// their parent package (e.g. foo); the first matching alias wins
|
|
1422
|
-
.sort((a, b) => b[0].length - a[0].length)
|
|
1423
|
-
.map(([find, file]) => ({
|
|
1424
|
-
// these stubs replace only the package root.
|
|
1425
|
-
find: find === 'expo-modules-core' ? new RegExp(`^${find}$`) : find,
|
|
1426
|
-
replacement: path.resolve(compatStubsDir, file),
|
|
1427
|
-
}))
|
|
1428
|
-
|
|
1429
1402
|
const publishedBrowserEntryAliases = publishedBrowserPackages.map(
|
|
1430
1403
|
({ specifier, browserEntry }) => ({
|
|
1431
1404
|
find: new RegExp(`^${specifier.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}$`),
|
|
@@ -1498,26 +1471,16 @@ export function sootsimResolveOptions(
|
|
|
1498
1471
|
),
|
|
1499
1472
|
replacement,
|
|
1500
1473
|
})),
|
|
1501
|
-
{ find: /^react-native\/Libraries\/.*/, replacement: rnDeepStubDefault },
|
|
1502
1474
|
{
|
|
1503
1475
|
find: /^react-native\/asset-registry$/,
|
|
1504
1476
|
replacement: rnAssetRegistryPath,
|
|
1505
1477
|
},
|
|
1506
1478
|
{ find: /^react-native$/, replacement: rnShimPath },
|
|
1507
1479
|
{ find: /^react-native-web$/, replacement: rnShimPath },
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
// the wrapper file simply won't be loaded in that case.
|
|
1513
|
-
...(reactNavigationNativeRealPath
|
|
1514
|
-
? [
|
|
1515
|
-
{
|
|
1516
|
-
find: '@sootsim-internal/react-navigation-native-real',
|
|
1517
|
-
replacement: reactNavigationNativeRealPath,
|
|
1518
|
-
},
|
|
1519
|
-
]
|
|
1520
|
-
: []),
|
|
1480
|
+
{
|
|
1481
|
+
find: /^expo\/build\/winter\/fetch\/index(?:\.js)?$/,
|
|
1482
|
+
replacement: path.resolve(engineRoot, 'src/guest/host-fetch.ts'),
|
|
1483
|
+
},
|
|
1521
1484
|
...(reactNativeHapticFeedbackTouchablePath
|
|
1522
1485
|
? [
|
|
1523
1486
|
{
|
|
@@ -1528,7 +1491,6 @@ export function sootsimResolveOptions(
|
|
|
1528
1491
|
: []),
|
|
1529
1492
|
...compatWrapperRealPackageAliases,
|
|
1530
1493
|
...expoUiJetpackComposeRealAliases,
|
|
1531
|
-
...stubAliases,
|
|
1532
1494
|
],
|
|
1533
1495
|
}
|
|
1534
1496
|
}
|
|
@@ -1849,9 +1811,8 @@ function reactNativeRequirePlugin(isAppSource: (p: string) => boolean): Plugin {
|
|
|
1849
1811
|
const importPath = match[1]
|
|
1850
1812
|
if (!seenPaths.has(importPath)) {
|
|
1851
1813
|
const varName = `__soot_rn_lib_${importCounter++}__`
|
|
1852
|
-
const
|
|
1853
|
-
|
|
1854
|
-
imports += `import * as ${varName} from ${JSON.stringify(stubPath)};\n`
|
|
1814
|
+
const target = resolveReactNativeLibraryStub(importPath) ?? importPath
|
|
1815
|
+
imports += `import * as ${varName} from ${JSON.stringify(target)};\n`
|
|
1855
1816
|
seenPaths.set(importPath, varName)
|
|
1856
1817
|
}
|
|
1857
1818
|
replacements.push({
|
|
@@ -2003,31 +1964,6 @@ function externalAppTransformPlugin(
|
|
|
2003
1964
|
}
|
|
2004
1965
|
}
|
|
2005
1966
|
|
|
2006
|
-
// auto-stub native packages that don't exist in any node_modules
|
|
2007
|
-
function stubMissingNativeDeps(appDir: string): Plugin {
|
|
2008
|
-
const checked = new Map<string, boolean>()
|
|
2009
|
-
|
|
2010
|
-
function packageExists(pkgName: string): boolean {
|
|
2011
|
-
const cached = checked.get(pkgName)
|
|
2012
|
-
if (cached !== undefined) return cached
|
|
2013
|
-
let exists = moduleExistsIn(pkgName, sootsimRoot)
|
|
2014
|
-
if (!exists && appDir) exists = moduleExistsIn(pkgName, appDir)
|
|
2015
|
-
checked.set(pkgName, exists)
|
|
2016
|
-
return exists
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
return {
|
|
2020
|
-
name: 'sootsim-stub-missing-native-deps',
|
|
2021
|
-
resolveId(source) {
|
|
2022
|
-
if (!isNativePackage(source)) return null
|
|
2023
|
-
const pkgName = getPackageName(source)
|
|
2024
|
-
if (packageExists(pkgName)) return null
|
|
2025
|
-
console.log(`[peach] auto-stubbing missing native dep: ${source}`)
|
|
2026
|
-
return nativeAutoStubPath
|
|
2027
|
-
},
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
1967
|
// stub missing image imports from node_modules
|
|
2032
1968
|
function stubMissingImages(isAppSource: (p: string) => boolean): Plugin {
|
|
2033
1969
|
return {
|
|
@@ -113,6 +113,46 @@ export function wasmSections(
|
|
|
113
113
|
return found
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
export function wasmObjectDataSegment(bytes: Buffer, name: string): Buffer | undefined {
|
|
117
|
+
const sections = wasmSections(bytes)
|
|
118
|
+
const data = sections.find(({ id }) => id === 11)
|
|
119
|
+
if (!data) return
|
|
120
|
+
for (const section of sections) {
|
|
121
|
+
if (section.id !== 0) continue
|
|
122
|
+
const linking = readWasmSection(bytes, section.start, section.end)
|
|
123
|
+
if (linking.name() !== 'linking' || linking.number() !== 2) continue
|
|
124
|
+
while (!linking.done()) {
|
|
125
|
+
const kind = linking.byte()
|
|
126
|
+
const size = linking.number()
|
|
127
|
+
const start = linking.position()
|
|
128
|
+
linking.skip(size)
|
|
129
|
+
if (kind !== 5) continue
|
|
130
|
+
const info = readWasmSection(bytes, start, start + size)
|
|
131
|
+
const count = info.number()
|
|
132
|
+
const segments = readWasmSection(bytes, data.start, data.end)
|
|
133
|
+
if (count !== segments.number()) return
|
|
134
|
+
for (let i = 0; i < count; i++) {
|
|
135
|
+
const segmentName = info.name()
|
|
136
|
+
info.number()
|
|
137
|
+
info.number()
|
|
138
|
+
const mode = segments.number()
|
|
139
|
+
if (mode > 2) return
|
|
140
|
+
if (mode === 2) segments.number()
|
|
141
|
+
if (mode !== 1) {
|
|
142
|
+
const opcode = segments.byte()
|
|
143
|
+
if (opcode !== 0x41 && opcode !== 0x42 && opcode !== 0x23) return
|
|
144
|
+
segments.number()
|
|
145
|
+
if (segments.byte() !== 0x0b) return
|
|
146
|
+
}
|
|
147
|
+
const length = segments.number()
|
|
148
|
+
const offset = segments.position()
|
|
149
|
+
segments.skip(length)
|
|
150
|
+
if (segmentName === name) return bytes.subarray(offset, offset + length)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
116
156
|
export function withoutWasmDebugNames(bytes: Buffer): Buffer {
|
|
117
157
|
const pieces: Buffer[] = []
|
|
118
158
|
let offset = 0
|
|
@@ -23,6 +23,12 @@ export function wasmImmediates(
|
|
|
23
23
|
const skip = () => {
|
|
24
24
|
while (bytes[at++]! & 128);
|
|
25
25
|
}
|
|
26
|
+
// a value or block type; a reference type carries its heap type
|
|
27
|
+
const valueType = () => {
|
|
28
|
+
const type = bytes[at]!
|
|
29
|
+
if (type === 0x63 || type === 0x64) at++
|
|
30
|
+
skip()
|
|
31
|
+
}
|
|
26
32
|
// keep 32-bit addresses and 64-bit addresses, including Swift immortal string literals
|
|
27
33
|
// whose low 32 bits hold (address - 32) with bit 63 set (0x80000000_xxxxxxxx).
|
|
28
34
|
const address = (bits: 32 | 64) => {
|
|
@@ -78,9 +84,9 @@ export function wasmImmediates(
|
|
|
78
84
|
op === 0xd4
|
|
79
85
|
)
|
|
80
86
|
continue
|
|
87
|
+
else if ((op >= 0x02 && op <= 0x04) || op === 0x06) valueType()
|
|
81
88
|
else if (
|
|
82
|
-
(op >=
|
|
83
|
-
(op >= 0x06 && op <= 0x09) ||
|
|
89
|
+
(op >= 0x07 && op <= 0x09) ||
|
|
84
90
|
op === 0x0c ||
|
|
85
91
|
op === 0x0d ||
|
|
86
92
|
op === 0x10 ||
|
|
@@ -101,9 +107,9 @@ export function wasmImmediates(
|
|
|
101
107
|
else if (op === 0x11 || op === 0x13) {
|
|
102
108
|
skip()
|
|
103
109
|
skip()
|
|
104
|
-
} else if (op === 0x1c) for (let n = u(); n > 0; n--)
|
|
110
|
+
} else if (op === 0x1c) for (let n = u(); n > 0; n--) valueType()
|
|
105
111
|
else if (op === 0x1f) {
|
|
106
|
-
|
|
112
|
+
valueType()
|
|
107
113
|
for (let n = u(); n > 0; n--) {
|
|
108
114
|
if (bytes[at++]! < 2) skip()
|
|
109
115
|
skip()
|
|
@@ -128,6 +134,30 @@ export function wasmImmediates(
|
|
|
128
134
|
memarg()
|
|
129
135
|
at++
|
|
130
136
|
}
|
|
137
|
+
} else if (op === 0xfb) {
|
|
138
|
+
const sub = u()
|
|
139
|
+
if (
|
|
140
|
+
sub <= 0x01 ||
|
|
141
|
+
(sub >= 0x06 && sub <= 0x07) ||
|
|
142
|
+
(sub >= 0x0b && sub <= 0x0e) ||
|
|
143
|
+
sub === 0x10
|
|
144
|
+
)
|
|
145
|
+
skip()
|
|
146
|
+
else if (
|
|
147
|
+
(sub >= 0x02 && sub <= 0x05) ||
|
|
148
|
+
(sub >= 0x08 && sub <= 0x0a) ||
|
|
149
|
+
(sub >= 0x11 && sub <= 0x13)
|
|
150
|
+
) {
|
|
151
|
+
skip()
|
|
152
|
+
skip()
|
|
153
|
+
} else if (sub >= 0x14 && sub <= 0x17) skip()
|
|
154
|
+
else if (sub === 0x18 || sub === 0x19) {
|
|
155
|
+
at++
|
|
156
|
+
skip()
|
|
157
|
+
skip()
|
|
158
|
+
skip()
|
|
159
|
+
} else if (sub !== 0x0f && (sub < 0x1a || sub > 0x1e))
|
|
160
|
+
throw new Error(`sdk code has unknown instruction 0xfb ${sub}`)
|
|
131
161
|
} else if (op === 0xfe) {
|
|
132
162
|
if (u() === 3) at++
|
|
133
163
|
else memarg()
|
|
@@ -137,7 +167,7 @@ export function wasmImmediates(
|
|
|
137
167
|
const body = (end: number) => {
|
|
138
168
|
for (let locals = u(); locals > 0; locals--) {
|
|
139
169
|
skip()
|
|
140
|
-
|
|
170
|
+
valueType()
|
|
141
171
|
}
|
|
142
172
|
expression(end)
|
|
143
173
|
at = end
|
|
@@ -43,7 +43,21 @@ export async function compileWidgetExtension(
|
|
|
43
43
|
const moduleRoot = await swiftDistributionRoot()
|
|
44
44
|
await prepareXcodeSwiftPackages(workspace, name, 'Release')
|
|
45
45
|
const root = openXcodeProject(workspace, name, moduleRoot, 'Release')
|
|
46
|
-
return {
|
|
46
|
+
return {
|
|
47
|
+
metadata: await swiftPackageMetadata(
|
|
48
|
+
root,
|
|
49
|
+
name,
|
|
50
|
+
moduleRoot,
|
|
51
|
+
origin,
|
|
52
|
+
undefined,
|
|
53
|
+
undefined,
|
|
54
|
+
[],
|
|
55
|
+
undefined,
|
|
56
|
+
undefined,
|
|
57
|
+
[],
|
|
58
|
+
'deferred',
|
|
59
|
+
),
|
|
60
|
+
}
|
|
47
61
|
}
|
|
48
62
|
|
|
49
63
|
export const handleWidgetExtensionRequest = compiledModuleRequestHandler(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parse } from 'acorn'
|
|
2
|
+
import { acornProgram } from './acorn-program.ts'
|
|
2
3
|
import { compileWorkletKernel } from './worklet-kernel.ts'
|
|
3
4
|
|
|
4
5
|
interface SyntaxNode {
|
|
@@ -525,7 +526,7 @@ export function compileWorkletExecutables(
|
|
|
525
526
|
}
|
|
526
527
|
const offset = Reflect.get(codeProperty, 'end')
|
|
527
528
|
if (typeof offset !== 'number') throw new Error('peach: worklet code has no offset')
|
|
528
|
-
const kernel = compileWorkletKernel(code)
|
|
529
|
+
const kernel = compileWorkletKernel(code, acornProgram)
|
|
529
530
|
const recipe = kernel ? `, __peachKernel: ${JSON.stringify(kernel)}` : ''
|
|
530
531
|
return { offset, text: `, __peachExecutable: (${body})${recipe}` }
|
|
531
532
|
})
|
package/src/worklet-kernel.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { parse } from 'acorn'
|
|
2
1
|
import type {
|
|
3
2
|
WorkletKernelSide,
|
|
4
3
|
WorkletKernelStep,
|
|
@@ -328,10 +327,13 @@ function styleOutputs(
|
|
|
328
327
|
|
|
329
328
|
// the recipe of one worklet's code, as upstream's babel plugin emits it, or undefined when the
|
|
330
329
|
// worklet does anything a kernel cannot carry exactly
|
|
331
|
-
export function compileWorkletKernel(
|
|
330
|
+
export function compileWorkletKernel(
|
|
331
|
+
code: string,
|
|
332
|
+
parseProgram: (source: string) => { body: unknown },
|
|
333
|
+
): WorkletKernel | undefined {
|
|
332
334
|
try {
|
|
333
335
|
// the code is a function declaration or expression, named or not, as the executable pass reads it
|
|
334
|
-
const program =
|
|
336
|
+
const program = parseProgram(`(${code})`)
|
|
335
337
|
const [statement] = nodes(program.body)
|
|
336
338
|
if (!statement || statement.type !== 'ExpressionStatement') return undefined
|
|
337
339
|
const fn = node(statement.expression)
|
package/src/worklets-babel.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { homedir } from 'node:os'
|
|
|
5
5
|
import path from 'node:path'
|
|
6
6
|
import { fileURLToPath } from 'node:url'
|
|
7
7
|
import { parseSync } from 'oxc-parser'
|
|
8
|
+
import { acornProgram } from './acorn-program.ts'
|
|
8
9
|
import { visitParsedProgram } from './visit-parsed-program'
|
|
9
10
|
import {
|
|
10
11
|
compileWorkletExecutables,
|
|
@@ -266,7 +267,7 @@ function executableWorkletsPlugin(
|
|
|
266
267
|
api.template.expression.ast(`(${compileWorkletExecutables(code)})`),
|
|
267
268
|
),
|
|
268
269
|
)
|
|
269
|
-
const kernel = compileWorkletKernel(code)
|
|
270
|
+
const kernel = compileWorkletKernel(code, acornProgram)
|
|
270
271
|
if (kernel)
|
|
271
272
|
properties.push(
|
|
272
273
|
api.types.objectProperty(
|