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
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import { createRequire } from 'node:module'
|
|
3
|
+
import os from 'node:os'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { nativeHeaderIncludes } from './swift-header-dependencies'
|
|
6
|
+
|
|
7
|
+
const portals = ['OneNativePortalView', 'OneNativePortalHostView']
|
|
8
|
+
const content = 'OneNativeContent'
|
|
9
|
+
|
|
10
|
+
export function oneFabricViews(
|
|
11
|
+
inputs: readonly string[],
|
|
12
|
+
includeUIKitContent = true,
|
|
13
|
+
): string[] {
|
|
14
|
+
const specs = new Set(inputs.map((input) => path.basename(input)))
|
|
15
|
+
return [
|
|
16
|
+
...(specs.has('nativePortal.native.tsx') ||
|
|
17
|
+
portals.some((name) => specs.has(`${name}NativeComponent.native.ts`))
|
|
18
|
+
? portals
|
|
19
|
+
: []),
|
|
20
|
+
...(includeUIKitContent && specs.has(`${content}NativeComponent.native.ts`)
|
|
21
|
+
? [content]
|
|
22
|
+
: []),
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function prepareOneFabric(
|
|
27
|
+
appRoot: string,
|
|
28
|
+
one: string,
|
|
29
|
+
moduleRoot: string,
|
|
30
|
+
views: readonly string[],
|
|
31
|
+
) {
|
|
32
|
+
const appRequire = createRequire(path.join(appRoot, 'package.json'))
|
|
33
|
+
const reactNativeRoot = path.dirname(appRequire.resolve('react-native/package.json'))
|
|
34
|
+
const source = path.join(one, 'native/apple')
|
|
35
|
+
const name = 'one-native-fabric'
|
|
36
|
+
const roots = ['ios', 'cpp']
|
|
37
|
+
const natives = new Map(
|
|
38
|
+
roots.flatMap((directory) =>
|
|
39
|
+
fs
|
|
40
|
+
.readdirSync(path.join(source, directory))
|
|
41
|
+
.filter((file) => /\.(?:h|mm|cpp)$/.test(file))
|
|
42
|
+
.map((file): [string, string] => [file, `${directory}/${file}`]),
|
|
43
|
+
),
|
|
44
|
+
)
|
|
45
|
+
const pending = views.map((view) => {
|
|
46
|
+
const pattern = new RegExp(`^@implementation ${view}ComponentView\\b`, 'm')
|
|
47
|
+
const file = [...natives.values()].find(
|
|
48
|
+
(file) =>
|
|
49
|
+
file.endsWith('.mm') &&
|
|
50
|
+
pattern.test(fs.readFileSync(path.join(source, file), 'utf8')),
|
|
51
|
+
)
|
|
52
|
+
if (!file) throw new Error(`One Fabric implementation missing for ${view}`)
|
|
53
|
+
return file
|
|
54
|
+
})
|
|
55
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'peach-one-fabric-'))
|
|
56
|
+
try {
|
|
57
|
+
const staged = new Set<string>()
|
|
58
|
+
for (let file = pending.pop(); file; file = pending.pop()) {
|
|
59
|
+
if (staged.has(file)) continue
|
|
60
|
+
staged.add(file)
|
|
61
|
+
const text = fs.readFileSync(path.join(source, file), 'utf8')
|
|
62
|
+
for (const include of nativeHeaderIncludes(text)) {
|
|
63
|
+
const header = natives.get(include)
|
|
64
|
+
if (!header) continue
|
|
65
|
+
pending.push(header)
|
|
66
|
+
const stem = path.basename(header, '.h')
|
|
67
|
+
for (const suffix of ['.mm', '.cpp']) {
|
|
68
|
+
const unit = natives.get(stem + suffix)
|
|
69
|
+
if (unit) pending.push(unit)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
fs.mkdirSync(path.join(root, path.dirname(file)), { recursive: true })
|
|
73
|
+
fs.writeFileSync(
|
|
74
|
+
path.join(root, file),
|
|
75
|
+
text.replaceAll('"One-Swift.h"', '"OneSDKRuntime-Swift.h"'),
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
fs.mkdirSync(path.join(root, 'specs'))
|
|
79
|
+
for (const view of views) {
|
|
80
|
+
const file = `${view}NativeComponent.native.ts`
|
|
81
|
+
fs.copyFileSync(
|
|
82
|
+
path.join(one, 'src/platform/specs', file),
|
|
83
|
+
path.join(root, 'specs', `${view}NativeComponent.ios.ts`),
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
fs.mkdirSync(path.join(root, 'node_modules'))
|
|
87
|
+
fs.symlinkSync(reactNativeRoot, path.join(root, 'node_modules/react-native'), 'dir')
|
|
88
|
+
fs.writeFileSync(
|
|
89
|
+
path.join(root, 'package.json'),
|
|
90
|
+
JSON.stringify({
|
|
91
|
+
name,
|
|
92
|
+
version: '0.0.0',
|
|
93
|
+
codegenConfig: {
|
|
94
|
+
name: 'OneNativeSpec',
|
|
95
|
+
type: 'components',
|
|
96
|
+
jsSrcsDir: 'specs',
|
|
97
|
+
ios: {
|
|
98
|
+
componentProvider: Object.fromEntries(
|
|
99
|
+
views.map((view) => [view, `${view}ComponentView`]),
|
|
100
|
+
),
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
}),
|
|
104
|
+
)
|
|
105
|
+
const podspecPath = path.join(root, 'OneFabric.podspec')
|
|
106
|
+
fs.writeFileSync(
|
|
107
|
+
podspecPath,
|
|
108
|
+
`Pod::Spec.new do |s|
|
|
109
|
+
s.name = 'OneFabric'
|
|
110
|
+
s.version = '0.0.0'
|
|
111
|
+
s.source_files = 'ios/*.{h,mm}', 'cpp/*.{h,cpp}'
|
|
112
|
+
end
|
|
113
|
+
`,
|
|
114
|
+
)
|
|
115
|
+
const { prepareTurboCompileInput } = await import('./turbo-compile')
|
|
116
|
+
return await prepareTurboCompileInput({
|
|
117
|
+
appRoot: root,
|
|
118
|
+
projectRoot: appRoot,
|
|
119
|
+
reactNativeRoot,
|
|
120
|
+
providers: [{ name, root, podspecPath }],
|
|
121
|
+
moduleRoot,
|
|
122
|
+
iosDeploymentTargetFallback: '17.0',
|
|
123
|
+
embedded: true,
|
|
124
|
+
standaloneProvider: true,
|
|
125
|
+
})
|
|
126
|
+
} finally {
|
|
127
|
+
fs.rmSync(root, { recursive: true, force: true })
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from '../../peach-globals/build/one-sdk-shard'
|
|
17
17
|
import { swiftGuestControls } from '../../peach-globals/build/one-swift-control-source'
|
|
18
18
|
import { swiftUIControls } from '../../peach-globals/build/one-swift-ui-controls'
|
|
19
|
-
import { composeIosAppInput } from './ios-rn-compile'
|
|
19
|
+
import { composeIosAppInput, type IosAppComponent } from './ios-rn-compile'
|
|
20
20
|
import {
|
|
21
21
|
ONE_DIRECT_STAGE_SWIFT,
|
|
22
22
|
PEACH_ONE_DIRECT_HOST_MM,
|
|
@@ -46,9 +46,9 @@ import {
|
|
|
46
46
|
swiftPackageMetadata,
|
|
47
47
|
swiftPackageReleaseFiles,
|
|
48
48
|
} from './swift-host'
|
|
49
|
-
import { swiftSdkImageKey } from './swift-sdk-image'
|
|
50
49
|
import {
|
|
51
50
|
swiftCompileSurfaceDigest,
|
|
51
|
+
swiftGuestEngineInputDigest,
|
|
52
52
|
swiftModuleRelease,
|
|
53
53
|
withSwiftModuleDigestScope,
|
|
54
54
|
} from './swift-sdk-surface'
|
|
@@ -58,6 +58,8 @@ import { privateSwiftDistributionRoot, swiftCacheDir } from './swift-toolchain'
|
|
|
58
58
|
import type { SwiftCompileInput } from './swift-compile'
|
|
59
59
|
import type { SwiftEntryModuleArgs } from './swiftContract'
|
|
60
60
|
|
|
61
|
+
export { oneFabricViews } from './one-fabric'
|
|
62
|
+
|
|
61
63
|
const GUEST_ENTRY = 'Sources/Controls/OneNativeControlsGuest.swift'
|
|
62
64
|
|
|
63
65
|
const BRIDGE_SWIFT = `@_spi(Peach) import SwiftUI
|
|
@@ -1127,7 +1129,12 @@ public func oneStartupProfileView() -> AnyView {
|
|
|
1127
1129
|
}
|
|
1128
1130
|
`
|
|
1129
1131
|
|
|
1130
|
-
function guestMainSwift(
|
|
1132
|
+
function guestMainSwift(
|
|
1133
|
+
appPackages: readonly string[],
|
|
1134
|
+
nitro: boolean,
|
|
1135
|
+
fabric: boolean,
|
|
1136
|
+
nativeRoutePackage?: string,
|
|
1137
|
+
) {
|
|
1131
1138
|
const apps = appPackages.length > 0
|
|
1132
1139
|
const imports = apps
|
|
1133
1140
|
? [
|
|
@@ -1139,6 +1146,9 @@ function guestMainSwift(appPackages: readonly string[], nitro: boolean) {
|
|
|
1139
1146
|
const retainClasses = appPackages
|
|
1140
1147
|
.map((name) => ' _ = NSStringFromClass(OneNativeSourceViews_' + name + '.self)\n')
|
|
1141
1148
|
.join('')
|
|
1149
|
+
const nativeRoutes = nativeRoutePackage && 'PeachApp_' + nativeRoutePackage
|
|
1150
|
+
// the turbo guest also owns the key window, mounted without a fabric tag.
|
|
1151
|
+
const defaultView = fabric ? 'turbo.view(props: props)' : 'oneStartupProfileView()'
|
|
1142
1152
|
return `${imports}import SwiftUI
|
|
1143
1153
|
import PeachJSON
|
|
1144
1154
|
import OneNativeControlsCore
|
|
@@ -1146,23 +1156,30 @@ import OneNativeControlsHost
|
|
|
1146
1156
|
|
|
1147
1157
|
@main
|
|
1148
1158
|
struct OneNativeControlsGuest: ${apps ? 'SwiftUI.' : ''}PeachPackage {
|
|
1149
|
-
${nitro ? ' let nitro = PeachNitroApp()\n' : ''} init() {
|
|
1150
|
-
${retainClasses} PeachOneDirectHostInit()
|
|
1159
|
+
${nitro ? ' let nitro = PeachNitroApp()\n' : ''}${fabric ? ' let turbo = RNTurboApp()\n' : ''} init() {
|
|
1160
|
+
${retainClasses}${nativeRoutes ? ` _ = NSStringFromClass(${nativeRoutes}.OneRouteDeviceBridge.self)\n` : ''} PeachOneDirectHostInit()
|
|
1151
1161
|
_ = peach_register_views
|
|
1152
1162
|
}
|
|
1153
1163
|
|
|
1154
1164
|
@ViewBuilder func view(props: ${apps ? 'PeachJSON.' : ''}JSON) -> some View {
|
|
1155
1165
|
if props["oneDirectStage"] != nil {
|
|
1156
|
-
|
|
1166
|
+
${
|
|
1167
|
+
nativeRoutes
|
|
1168
|
+
? `ZStack {
|
|
1169
|
+
OneDirectStageView()
|
|
1170
|
+
${nativeRoutes}.makeOneNativeRoot()
|
|
1171
|
+
}`
|
|
1172
|
+
: 'OneDirectStageView()'
|
|
1173
|
+
}
|
|
1157
1174
|
} else {
|
|
1158
1175
|
#if PEACH_ONE_SDK
|
|
1159
1176
|
if props["oneSDKHost"] != nil {
|
|
1160
1177
|
OneSDKUIKitHost(props: props)
|
|
1161
1178
|
} else {
|
|
1162
|
-
|
|
1179
|
+
${defaultView}
|
|
1163
1180
|
}
|
|
1164
1181
|
#else
|
|
1165
|
-
|
|
1182
|
+
${defaultView}
|
|
1166
1183
|
#endif
|
|
1167
1184
|
}
|
|
1168
1185
|
}
|
|
@@ -1805,6 +1822,7 @@ const DIRECT_HOST_SWIFT_SEEDS = [
|
|
|
1805
1822
|
'PeachOneDirectStage',
|
|
1806
1823
|
'OneDirectStageView',
|
|
1807
1824
|
'OneNativeAsyncActionModule',
|
|
1825
|
+
'OneNativeBlurEffectView',
|
|
1808
1826
|
'OneNativeArrangementView',
|
|
1809
1827
|
'OneNativeArrangementItem',
|
|
1810
1828
|
'OneNativeArrangementModifiers',
|
|
@@ -1829,6 +1847,7 @@ const DIRECT_HOST_SWIFT_SEEDS = [
|
|
|
1829
1847
|
|
|
1830
1848
|
const CONTAINER_RECORD_FILES = [
|
|
1831
1849
|
'container_record.h',
|
|
1850
|
+
'effect_record.h',
|
|
1832
1851
|
'tabs_record.h',
|
|
1833
1852
|
'swift_host_record.h',
|
|
1834
1853
|
'menu_record.h',
|
|
@@ -1848,10 +1867,13 @@ const CONTAINER_RECORD_FILES = [
|
|
|
1848
1867
|
|
|
1849
1868
|
const DIRECT_HOST_IOS_FILES = [
|
|
1850
1869
|
'PeachContainer.h',
|
|
1870
|
+
'PeachEffects.h',
|
|
1871
|
+
'PeachEffects.mm',
|
|
1851
1872
|
'PeachHeaderSearch.h',
|
|
1852
1873
|
'PeachHeaderSearch.mm',
|
|
1853
1874
|
'PeachSwiftUI.h',
|
|
1854
1875
|
'PeachSwiftUI.mm',
|
|
1876
|
+
'PeachSwiftUILink.h',
|
|
1855
1877
|
'PeachSheet.h',
|
|
1856
1878
|
'PeachSheet.mm',
|
|
1857
1879
|
'PeachSplitView.h',
|
|
@@ -1872,6 +1894,8 @@ export async function oneNativeControlsPackage(
|
|
|
1872
1894
|
sdk?: OneNativeControlsSDKInput | null,
|
|
1873
1895
|
appPackages: readonly SwiftGuestAppPackage[] = [],
|
|
1874
1896
|
nitro = false,
|
|
1897
|
+
nativeRoutePackage?: string,
|
|
1898
|
+
fabric = false,
|
|
1875
1899
|
): Promise<OneNativeControlsPackage> {
|
|
1876
1900
|
const iosDir = resolveOneNativeAppleIosDir(appRoot)
|
|
1877
1901
|
const coreAbiIosDir = resolveCoreAbiIosDir()
|
|
@@ -1924,6 +1948,7 @@ export async function oneNativeControlsPackage(
|
|
|
1924
1948
|
const hostControls = swiftUIControls(path.dirname(iosDir), {
|
|
1925
1949
|
basenameImports: true,
|
|
1926
1950
|
linkedGroups: hostLinkedGroups,
|
|
1951
|
+
nativeHeaders: [path.join(iosDir, 'OneNativeEdgeFadeView.h')],
|
|
1927
1952
|
})
|
|
1928
1953
|
const sources: Record<string, string> = {}
|
|
1929
1954
|
const paths = new Map<string, string>()
|
|
@@ -2063,6 +2088,12 @@ export async function oneNativeControlsPackage(
|
|
|
2063
2088
|
watched.add(sourcePath)
|
|
2064
2089
|
}
|
|
2065
2090
|
files.set('Sources/ControlsHost/ios/PeachOneDirectHost.mm', PEACH_ONE_DIRECT_HOST_MM)
|
|
2091
|
+
const routeHeader = path.join(coreAbiIosDir, '../apple/PeachNativeRoutes.h')
|
|
2092
|
+
files.set(
|
|
2093
|
+
'Sources/ControlsHost/apple/PeachNativeRoutes.h',
|
|
2094
|
+
fs.readFileSync(routeHeader, 'utf8'),
|
|
2095
|
+
)
|
|
2096
|
+
watched.add(routeHeader)
|
|
2066
2097
|
for (const { directory, packageId, contracts, files: sources } of appViews) {
|
|
2067
2098
|
const prefix = 'Sources/PeachApp_' + packageId + '/'
|
|
2068
2099
|
for (const name of Object.keys(sources)) {
|
|
@@ -2080,7 +2111,10 @@ export async function oneNativeControlsPackage(
|
|
|
2080
2111
|
renderSwiftSourceGlue(packageId, contracts, true).source,
|
|
2081
2112
|
)
|
|
2082
2113
|
}
|
|
2083
|
-
files.set(
|
|
2114
|
+
files.set(
|
|
2115
|
+
GUEST_ENTRY,
|
|
2116
|
+
guestMainSwift([...appTargets], nitro, fabric, nativeRoutePackage),
|
|
2117
|
+
)
|
|
2084
2118
|
if (bindings) {
|
|
2085
2119
|
// keep this target distinct from sootsim-swift's prebuilt `One` module so
|
|
2086
2120
|
// the shared Swift SDK image stays on the published CDN slice instead of
|
|
@@ -2149,7 +2183,7 @@ export async function oneNativeControlsPackage(
|
|
|
2149
2183
|
? `, cSettings: [${hostClangDefines.join(', ')}], cxxSettings: [${hostClangDefines.join(', ')}]`
|
|
2150
2184
|
: ''
|
|
2151
2185
|
const coreDependencies = [
|
|
2152
|
-
...(bindings ? ['OneSDKRuntime'
|
|
2186
|
+
...(bindings ? ['OneSDKRuntime'] : []),
|
|
2153
2187
|
...(nativeHandles ? ['PeachNativeHandles'] : []),
|
|
2154
2188
|
]
|
|
2155
2189
|
const coreDependencySettings = coreDependencies.length
|
|
@@ -2240,8 +2274,10 @@ interface OneNativeControlsBuildOptions {
|
|
|
2240
2274
|
startupProfile?: 'deferred'
|
|
2241
2275
|
sdk?: OneNativeControlsSDKInput | null
|
|
2242
2276
|
appPackages?: readonly SwiftGuestAppPackage[]
|
|
2277
|
+
nativeRoutePackage?: string
|
|
2243
2278
|
origin?: string
|
|
2244
2279
|
nitro?: SwiftCompileInput
|
|
2280
|
+
fabricViews?: readonly string[]
|
|
2245
2281
|
}
|
|
2246
2282
|
|
|
2247
2283
|
async function prepareOneNativeControls(
|
|
@@ -2261,6 +2297,8 @@ async function prepareOneNativeControls(
|
|
|
2261
2297
|
sdk,
|
|
2262
2298
|
options?.appPackages,
|
|
2263
2299
|
Boolean(options?.nitro),
|
|
2300
|
+
options?.nativeRoutePackage,
|
|
2301
|
+
Boolean(options?.fabricViews?.length),
|
|
2264
2302
|
)
|
|
2265
2303
|
const initial = await prepare(original)
|
|
2266
2304
|
const project = (packageInfo: OneNativeControlsPackage) =>
|
|
@@ -2343,7 +2381,7 @@ export async function stageOneNativeControlsArtifact<T>(
|
|
|
2343
2381
|
input,
|
|
2344
2382
|
swiftModuleRelease(moduleRoot),
|
|
2345
2383
|
moduleRoot,
|
|
2346
|
-
|
|
2384
|
+
swiftGuestEngineInputDigest(moduleRoot).toString('hex'),
|
|
2347
2385
|
)
|
|
2348
2386
|
return stage(key, async () => {
|
|
2349
2387
|
const { artifact } = await compile((project, root) =>
|
|
@@ -2368,6 +2406,7 @@ export async function stageOneNativeControlsRelease(
|
|
|
2368
2406
|
metadata: SwiftEntryModuleArgs
|
|
2369
2407
|
files: Map<string, Blob>
|
|
2370
2408
|
oneSDKModules?: string[]
|
|
2409
|
+
fabricPackages?: { name: string; version: string }[]
|
|
2371
2410
|
appLink?: {
|
|
2372
2411
|
bytes: Buffer
|
|
2373
2412
|
sdkSha256: string
|
|
@@ -2375,6 +2414,21 @@ export async function stageOneNativeControlsRelease(
|
|
|
2375
2414
|
startup?: { sdkKey: string; app: Buffer; binding: Buffer }
|
|
2376
2415
|
}
|
|
2377
2416
|
}> {
|
|
2417
|
+
const fabricViews = options?.fabricViews
|
|
2418
|
+
const fabric = fabricViews?.length
|
|
2419
|
+
? await (async () => {
|
|
2420
|
+
const { prepareOneFabric } = await import('./one-fabric')
|
|
2421
|
+
const one = path.resolve(resolveOneNativeAppleIosDir(appRoot), '../../..')
|
|
2422
|
+
return prepareOneFabric(
|
|
2423
|
+
appRoot ?? one,
|
|
2424
|
+
one,
|
|
2425
|
+
options?.moduleRoot ??
|
|
2426
|
+
defaultSwiftModuleRoot() ??
|
|
2427
|
+
(await swiftDistributionRoot()),
|
|
2428
|
+
fabricViews,
|
|
2429
|
+
)
|
|
2430
|
+
})()
|
|
2431
|
+
: undefined
|
|
2378
2432
|
const {
|
|
2379
2433
|
packagePath,
|
|
2380
2434
|
oneSDKModules,
|
|
@@ -2382,19 +2436,27 @@ export async function stageOneNativeControlsRelease(
|
|
|
2382
2436
|
} = await withSwiftModuleDigestScope(async () => {
|
|
2383
2437
|
const { compile } = await prepareOneNativeControls(appRoot, options, linkedGroups)
|
|
2384
2438
|
return compile(async (project, moduleRoot) => {
|
|
2385
|
-
if (options?.nitro) {
|
|
2439
|
+
if (options?.nitro || fabric) {
|
|
2440
|
+
// a cached project still holds the previous composition; compose from source.
|
|
2441
|
+
project.preparedInput = undefined
|
|
2386
2442
|
const { input, resources } = await nativeLinkInput(
|
|
2387
2443
|
project,
|
|
2388
2444
|
GUEST_ENTRY,
|
|
2389
2445
|
moduleRoot,
|
|
2390
2446
|
)
|
|
2391
|
-
|
|
2392
|
-
input:
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2447
|
+
const components: IosAppComponent[] = [
|
|
2448
|
+
{ family: 'one', input, hasView: true, main: true },
|
|
2449
|
+
]
|
|
2450
|
+
if (options?.nitro)
|
|
2451
|
+
components.push({ family: 'nitro', input: options.nitro, hasView: false })
|
|
2452
|
+
if (fabric)
|
|
2453
|
+
components.push({
|
|
2454
|
+
family: 'turbo',
|
|
2455
|
+
input: fabric.input,
|
|
2456
|
+
hasView: true,
|
|
2457
|
+
sharedCoreLibraries: fabric.sharedCoreLibraries,
|
|
2458
|
+
})
|
|
2459
|
+
project.preparedInput = { input: composeIosAppInput(components), resources }
|
|
2398
2460
|
}
|
|
2399
2461
|
return swiftPackageMetadata(
|
|
2400
2462
|
project.packagePath,
|
|
@@ -2407,7 +2469,7 @@ export async function stageOneNativeControlsRelease(
|
|
|
2407
2469
|
options?.startupRuntimeUrl,
|
|
2408
2470
|
undefined,
|
|
2409
2471
|
undefined,
|
|
2410
|
-
options?.nitro ? 'deferred' : options?.startupProfile,
|
|
2472
|
+
options?.nitro || fabric ? 'deferred' : options?.startupProfile,
|
|
2411
2473
|
)
|
|
2412
2474
|
})
|
|
2413
2475
|
})
|
|
@@ -2429,5 +2491,17 @@ export async function stageOneNativeControlsRelease(
|
|
|
2429
2491
|
startup: { sdkKey: image.key, app: original.bytes, binding: image.binding.bytes },
|
|
2430
2492
|
}),
|
|
2431
2493
|
}
|
|
2432
|
-
|
|
2494
|
+
const fabricPackages = fabric?.collection.providers.map(({ name, version }) => ({
|
|
2495
|
+
name,
|
|
2496
|
+
version,
|
|
2497
|
+
}))
|
|
2498
|
+
return {
|
|
2499
|
+
packagePath,
|
|
2500
|
+
metadataPath,
|
|
2501
|
+
metadata,
|
|
2502
|
+
files,
|
|
2503
|
+
oneSDKModules,
|
|
2504
|
+
fabricPackages,
|
|
2505
|
+
appLink,
|
|
2506
|
+
}
|
|
2433
2507
|
}
|
|
@@ -23,7 +23,13 @@ export const ONE_NATIVE_CONTROLS_METADATA_PATH = `${SWIFT_PACKAGE_PATH}${ONE_NAT
|
|
|
23
23
|
const PACKAGE_PREFIX = '/__peach/'
|
|
24
24
|
const METADATA_FILE = ONE_NATIVE_CONTROLS_METADATA_PATH.slice(PACKAGE_PREFIX.length)
|
|
25
25
|
const RELEASE_ASSET = /^\/__peach\/swift(?:-(?:icu|res|sdk|sdk-bindings))?\//
|
|
26
|
+
const DEFAULT_ONE_NATIVE_ORIGIN =
|
|
27
|
+
'https://one-docs-preview-9d2a.natewienert.workers.dev/one-native'
|
|
28
|
+
const SHA1_HEX = /^[0-9a-f]{40}$/
|
|
29
|
+
const SHA256_HEX = /^[0-9a-f]{64}$/
|
|
26
30
|
const installing = new Map<string, Promise<void>>()
|
|
31
|
+
const pinnedControlsByCommit = new Map<string, Promise<string | null>>()
|
|
32
|
+
const servedPinnedControlDirs = new Set<string>()
|
|
27
33
|
|
|
28
34
|
export function isOneNativeControlsReleaseAsset(pathname: string): boolean {
|
|
29
35
|
return RELEASE_ASSET.test(pathname)
|
|
@@ -52,24 +58,22 @@ export function serveStagedOneNativeControls(
|
|
|
52
58
|
return true
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const metadata = pathname === ONE_NATIVE_CONTROLS_METADATA_PATH
|
|
66
|
-
if (metadata && !fs.existsSync(path.join(destDir, METADATA_FILE))) {
|
|
61
|
+
function controlsDir(sha256: string): string {
|
|
62
|
+
return path.join(cacheDir(), 'one-native-controls', sha256)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function installOneNativeControlsBySha256(
|
|
66
|
+
sha256: string,
|
|
67
|
+
localStagedPath?: string,
|
|
68
|
+
): Promise<string> {
|
|
69
|
+
const destDir = controlsDir(sha256)
|
|
70
|
+
if (!fs.existsSync(path.join(destDir, METADATA_FILE))) {
|
|
67
71
|
let pending = installing.get(sha256)
|
|
68
72
|
if (!pending) {
|
|
69
|
-
const staged = path.join(runtime, ONE_NATIVE_CONTROLS_STAGED_BUNDLE)
|
|
70
73
|
pending = installVerifiedTarball({
|
|
71
74
|
url: `${NATIVE_PREBUILT_ORIGIN}/${oneNativeControlsReleaseObject(sha256)}`,
|
|
72
|
-
localPath:
|
|
75
|
+
localPath:
|
|
76
|
+
localStagedPath && fs.existsSync(localStagedPath) ? localStagedPath : undefined,
|
|
73
77
|
digest: { algorithm: 'sha256', encoding: 'hex', value: sha256 },
|
|
74
78
|
destDir,
|
|
75
79
|
installedMarker: METADATA_FILE,
|
|
@@ -79,5 +83,134 @@ export async function serveOneNativeControlsRelease(
|
|
|
79
83
|
}
|
|
80
84
|
await pending
|
|
81
85
|
}
|
|
86
|
+
return destDir
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async function installAndServeOneNativeControlsBySha256(
|
|
90
|
+
req: IncomingMessage,
|
|
91
|
+
res: ServerResponse,
|
|
92
|
+
pathname: string,
|
|
93
|
+
sha256: string,
|
|
94
|
+
localStagedPath?: string,
|
|
95
|
+
): Promise<boolean> {
|
|
96
|
+
const destDir =
|
|
97
|
+
pathname === ONE_NATIVE_CONTROLS_METADATA_PATH
|
|
98
|
+
? await installOneNativeControlsBySha256(sha256, localStagedPath)
|
|
99
|
+
: controlsDir(sha256)
|
|
82
100
|
return serveStagedOneNativeControls(req, res, pathname, destDir)
|
|
83
101
|
}
|
|
102
|
+
|
|
103
|
+
export async function serveOneNativeControlsRelease(
|
|
104
|
+
req: IncomingMessage,
|
|
105
|
+
res: ServerResponse,
|
|
106
|
+
pathname: string,
|
|
107
|
+
runtime: string,
|
|
108
|
+
): Promise<boolean> {
|
|
109
|
+
const pin = path.join(runtime, ONE_NATIVE_CONTROLS_RELEASE_PIN)
|
|
110
|
+
if (!fs.existsSync(pin)) return false
|
|
111
|
+
const sha256 = parseOneNativeControlsReleasePin(fs.readFileSync(pin, 'utf8'), pin)
|
|
112
|
+
return installAndServeOneNativeControlsBySha256(
|
|
113
|
+
req,
|
|
114
|
+
res,
|
|
115
|
+
pathname,
|
|
116
|
+
sha256,
|
|
117
|
+
path.join(runtime, ONE_NATIVE_CONTROLS_STAGED_BUNDLE),
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// reads the 40-char One release commit pinned by an installed or standalone One app,
|
|
122
|
+
// returning null for workspace checkouts that carry local native iOS control sources.
|
|
123
|
+
export function readAppPinnedOneCommit(appRoot: string): string | null {
|
|
124
|
+
const installedOne = path.join(appRoot, 'node_modules/one')
|
|
125
|
+
if (fs.existsSync(path.join(installedOne, 'native/apple/ios'))) return null
|
|
126
|
+
const releaseFile = path.join(installedOne, 'native-release.json')
|
|
127
|
+
if (fs.existsSync(releaseFile)) {
|
|
128
|
+
try {
|
|
129
|
+
const parsed: unknown = JSON.parse(fs.readFileSync(releaseFile, 'utf8'))
|
|
130
|
+
if (
|
|
131
|
+
typeof parsed === 'object' &&
|
|
132
|
+
parsed !== null &&
|
|
133
|
+
'sourceCommit' in parsed &&
|
|
134
|
+
typeof parsed.sourceCommit === 'string' &&
|
|
135
|
+
SHA1_HEX.test(parsed.sourceCommit)
|
|
136
|
+
)
|
|
137
|
+
return parsed.sourceCommit
|
|
138
|
+
} catch {
|
|
139
|
+
return null
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const stampFile = path.join(appRoot, '.one/types/stamp')
|
|
143
|
+
if (fs.existsSync(stampFile)) {
|
|
144
|
+
const stamp = fs.readFileSync(stampFile, 'utf8').trim()
|
|
145
|
+
if (SHA1_HEX.test(stamp)) return stamp
|
|
146
|
+
}
|
|
147
|
+
return null
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export async function resolveOnePinPeachControlsSha256(
|
|
151
|
+
commit: string,
|
|
152
|
+
origin = process.env.ONE_NATIVE_ORIGIN || DEFAULT_ONE_NATIVE_ORIGIN,
|
|
153
|
+
): Promise<string | null> {
|
|
154
|
+
const normalizedOrigin = origin.replace(/\/$/, '')
|
|
155
|
+
const cacheKey = `${normalizedOrigin}:${commit}`
|
|
156
|
+
let pending = pinnedControlsByCommit.get(cacheKey)
|
|
157
|
+
if (!pending) {
|
|
158
|
+
pending = (async () => {
|
|
159
|
+
try {
|
|
160
|
+
const response = await fetch(`${normalizedOrigin}/pins/${commit}.json`, {
|
|
161
|
+
signal: AbortSignal.timeout(10_000),
|
|
162
|
+
})
|
|
163
|
+
if (!response.ok) return null
|
|
164
|
+
const parsed: unknown = await response.json()
|
|
165
|
+
if (
|
|
166
|
+
typeof parsed !== 'object' ||
|
|
167
|
+
parsed === null ||
|
|
168
|
+
!('sourceCommit' in parsed) ||
|
|
169
|
+
parsed.sourceCommit !== commit ||
|
|
170
|
+
!('peachControls' in parsed) ||
|
|
171
|
+
typeof parsed.peachControls !== 'object' ||
|
|
172
|
+
parsed.peachControls === null ||
|
|
173
|
+
!('sha256' in parsed.peachControls) ||
|
|
174
|
+
typeof parsed.peachControls.sha256 !== 'string' ||
|
|
175
|
+
!SHA256_HEX.test(parsed.peachControls.sha256)
|
|
176
|
+
)
|
|
177
|
+
return null
|
|
178
|
+
return parsed.peachControls.sha256
|
|
179
|
+
} catch {
|
|
180
|
+
return null
|
|
181
|
+
}
|
|
182
|
+
})()
|
|
183
|
+
pinnedControlsByCommit.set(cacheKey, pending)
|
|
184
|
+
}
|
|
185
|
+
const result = await pending
|
|
186
|
+
if (result === null) pinnedControlsByCommit.delete(cacheKey)
|
|
187
|
+
return result
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export async function servePinnedOneNativeControlsRelease(
|
|
191
|
+
req: IncomingMessage,
|
|
192
|
+
res: ServerResponse,
|
|
193
|
+
pathname: string,
|
|
194
|
+
appRoot?: string,
|
|
195
|
+
): Promise<boolean> {
|
|
196
|
+
if (pathname === ONE_NATIVE_CONTROLS_METADATA_PATH && appRoot) {
|
|
197
|
+
const commit = readAppPinnedOneCommit(appRoot)
|
|
198
|
+
if (!commit) return false
|
|
199
|
+
const sha256 = await resolveOnePinPeachControlsSha256(commit)
|
|
200
|
+
if (!sha256) return false
|
|
201
|
+
const served = await installAndServeOneNativeControlsBySha256(
|
|
202
|
+
req,
|
|
203
|
+
res,
|
|
204
|
+
pathname,
|
|
205
|
+
sha256,
|
|
206
|
+
)
|
|
207
|
+
if (served) servedPinnedControlDirs.add(controlsDir(sha256))
|
|
208
|
+
return served
|
|
209
|
+
}
|
|
210
|
+
if (isOneNativeControlsReleaseAsset(pathname)) {
|
|
211
|
+
for (const dir of servedPinnedControlDirs) {
|
|
212
|
+
if (serveStagedOneNativeControls(req, res, pathname, dir)) return true
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return false
|
|
216
|
+
}
|
package/src/one-native-source.ts
CHANGED
|
@@ -7,13 +7,13 @@ import path from 'node:path'
|
|
|
7
7
|
import { promisify } from 'node:util'
|
|
8
8
|
import { brotliCompress, constants } from 'node:zlib'
|
|
9
9
|
import { KOTLIN_PACKAGE_PATH } from '@peach/globals/kotlin-discovery'
|
|
10
|
+
import { ONE_WIDGET_PATH } from '@peach/globals/one-widget'
|
|
10
11
|
import { WebSocket, WebSocketServer } from 'ws'
|
|
11
12
|
import { isLoopbackHost } from './backend-origin'
|
|
12
13
|
import { oneNativeControlsPackage } from './one-native-controls-package'
|
|
13
14
|
import { configuredOneWidget } from './one-widget-metadata'
|
|
14
15
|
import { ONE_WIDGET_PACKAGE, oneWidgetPackage } from './one-widget-package'
|
|
15
16
|
import { ONE_NATIVE_CONTROLS_PACKAGE } from './oneNativeControlsContract'
|
|
16
|
-
import { ONE_WIDGET_PATH } from './oneWidgetContract'
|
|
17
17
|
import { swiftPackageMetadata, swiftPackageWatchFiles } from './swift-host'
|
|
18
18
|
import { SWIFT_HMR_PATH, SWIFT_PACKAGE_PATH } from './swift-submit'
|
|
19
19
|
import { localSwiftModuleRoot } from './swift-toolchain'
|
|
@@ -99,6 +99,9 @@ async function packageMetadata(app: App, packageName: string) {
|
|
|
99
99
|
undefined,
|
|
100
100
|
[],
|
|
101
101
|
app.startupRuntimeUrl,
|
|
102
|
+
undefined,
|
|
103
|
+
[],
|
|
104
|
+
widget ? 'deferred' : undefined,
|
|
102
105
|
)
|
|
103
106
|
if (!app.active.has(packageName)) {
|
|
104
107
|
const files = [
|
package/src/one-nitro-inputs.ts
CHANGED
|
@@ -152,7 +152,7 @@ export function oneSwiftServiceInputs(
|
|
|
152
152
|
const declarations = new Map<string, string>()
|
|
153
153
|
for (const [file, source] of contents)
|
|
154
154
|
for (const match of source.matchAll(
|
|
155
|
-
/\b(?:class|struct|enum|protocol|typealias|func)\s+((?:Hybrid|One|one)[A-Z]\w*)/g,
|
|
155
|
+
/\b(?:class|struct|enum|protocol|typealias|func|var)\s+((?:Hybrid|One|one)[A-Z]\w*)/g,
|
|
156
156
|
))
|
|
157
157
|
declarations.set(match[1], file)
|
|
158
158
|
const nativeFiles = ['.', 'Nitro'].flatMap((directory) =>
|