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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { isOneFramework } from '../../contrast-bundler/src/oneFramework.ts'
|
|
1
2
|
import { resolveAppProject } from '../cli/app-project'
|
|
2
3
|
import { peachAnsweredNativePackages } from './answeredNativePackages'
|
|
3
4
|
import { loadRNXAppConfig } from './app-config'
|
|
4
5
|
import { discoverNitroProviders, selectNitroProviders } from './nitro-source'
|
|
5
|
-
import { ONE_V3_COMPILED_SERVICES, ONE_V3_NITRO_PACKAGE } from './nitroContract'
|
|
6
6
|
|
|
7
7
|
export type OneNitroSource = { root: string; services: ReadonlySet<string> }
|
|
8
8
|
|
|
@@ -13,7 +13,9 @@ export async function selectCompiledNitroProviders(
|
|
|
13
13
|
oneSource?: OneNitroSource,
|
|
14
14
|
) {
|
|
15
15
|
const config = await loadRNXAppConfig(resolveAppProject(appRoot))
|
|
16
|
-
const roots
|
|
16
|
+
const { roots, runtime } = oneSource
|
|
17
|
+
? { roots: [oneSource.root], runtime: null }
|
|
18
|
+
: await discoverNitroProviders(appRoot)
|
|
17
19
|
const providers = selectNitroProviders(roots).filter(
|
|
18
20
|
({ provider }) => !answered.has(provider.name) && (!only || only.has(provider.name)),
|
|
19
21
|
)
|
|
@@ -21,11 +23,12 @@ export async function selectCompiledNitroProviders(
|
|
|
21
23
|
providers.flatMap(({ config }) => config.classes.map(({ name }) => name)),
|
|
22
24
|
)
|
|
23
25
|
const standaloneOne =
|
|
24
|
-
providers.length === 1 &&
|
|
25
|
-
|
|
26
|
-
const oneOmissions =
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
providers.length === 1 &&
|
|
27
|
+
isOneFramework(providers[0]?.provider.name, providers[0]?.provider.version)
|
|
28
|
+
const oneOmissions =
|
|
29
|
+
standaloneOne && oneSource
|
|
30
|
+
? [...registered].filter((name) => !oneSource.services.has(name))
|
|
31
|
+
: []
|
|
29
32
|
const answers = {
|
|
30
33
|
hybridObjects: new Set([
|
|
31
34
|
...oneOmissions,
|
|
@@ -36,7 +39,16 @@ export async function selectCompiledNitroProviders(
|
|
|
36
39
|
views: new Set(Object.keys(config?.nativeViews ?? {})),
|
|
37
40
|
}
|
|
38
41
|
const packageRoots = providers.map(({ provider }) => provider.root)
|
|
39
|
-
if (selectNitroProviders(packageRoots, answers).length === 0)
|
|
42
|
+
if (selectNitroProviders(packageRoots, answers).length === 0) {
|
|
43
|
+
if (!runtime || answered.has(runtime.name) || (only && !only.has(runtime.name)))
|
|
44
|
+
return null
|
|
45
|
+
return {
|
|
46
|
+
providers: [runtime],
|
|
47
|
+
packageRoots: [],
|
|
48
|
+
answers: { hybridObjects: new Set<string>(), views: new Set<string>() },
|
|
49
|
+
standaloneOne: false,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
40
52
|
return {
|
|
41
53
|
providers: providers.map(({ provider }) => provider),
|
|
42
54
|
packageRoots,
|
package/src/nitro-compile.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { createHash } from 'node:crypto'
|
|
|
2
2
|
import fs from 'node:fs'
|
|
3
3
|
import os from 'node:os'
|
|
4
4
|
import path from 'node:path'
|
|
5
|
+
import { isOneFramework } from '../../contrast-bundler/src/oneFramework.ts'
|
|
5
6
|
import { peachAnsweredNativePackages } from './answeredNativePackages'
|
|
6
7
|
import { installedNativeLibraries } from './installed-native-libraries'
|
|
7
8
|
import { readIosAppTarget } from './native-app-identity-project'
|
|
@@ -20,7 +21,6 @@ import {
|
|
|
20
21
|
type NitroSourceCollection,
|
|
21
22
|
type NitroSourceOptions,
|
|
22
23
|
} from './nitro-source'
|
|
23
|
-
import { ONE_V3_NITRO_PACKAGE, type NitroBuildConfiguration } from './nitroContract'
|
|
24
24
|
import { readOneNativeApp } from './one-native-app-config'
|
|
25
25
|
import { linkReactNativeCore, prebuiltReactNativeCore } from './react-native-core'
|
|
26
26
|
import { missingSwiftModules, swiftAvailableModules } from './swift-compile'
|
|
@@ -52,12 +52,14 @@ import {
|
|
|
52
52
|
podspecSourceFiles,
|
|
53
53
|
TURBO_CORE_TARGET,
|
|
54
54
|
type TurboInstalledPod,
|
|
55
|
+
type TurboSourceCollection,
|
|
55
56
|
} from './turbo-source'
|
|
56
57
|
import {
|
|
57
58
|
installedXcodeWorkspace,
|
|
58
59
|
readXcodeAppTarget,
|
|
59
60
|
type XcodeModuleTarget,
|
|
60
61
|
} from './xcode-project'
|
|
62
|
+
import type { NitroBuildConfiguration } from './nitroContract'
|
|
61
63
|
import type { SwiftCompileInput } from './swift-compile'
|
|
62
64
|
|
|
63
65
|
// C++ libraries a provider bundles whole (it ships the source, not a pod), keyed
|
|
@@ -230,6 +232,7 @@ export function collectNitroCompileInput(
|
|
|
230
232
|
'',
|
|
231
233
|
].join('\n')
|
|
232
234
|
const executableDependencies = [
|
|
235
|
+
'NitroCore',
|
|
233
236
|
...targets.map(({ name }) => name),
|
|
234
237
|
...(views ? [NITRO_VIEWS_TARGET] : []),
|
|
235
238
|
...collection.registrations.map(({ target }) => target),
|
|
@@ -372,6 +375,7 @@ const REACT_INCLUDE_PATTERN =
|
|
|
372
375
|
const REACT_LINKING_PATTERN =
|
|
373
376
|
/^\s*#\s*(?:include|import)\s*[<"]React\/RCTLinkingManager\.h[>"]/m
|
|
374
377
|
const REACT_VERSION_PATTERN = /^\s*#\s*(?:include|import)\s*[<"]React\/RCTVersion\.h[>"]/m
|
|
378
|
+
const REACT_CORE_HEADERS = `Sources/${TURBO_CORE_TARGET}/include`
|
|
375
379
|
|
|
376
380
|
function targetUsesReactHeaders(
|
|
377
381
|
targetPathPrefix: string,
|
|
@@ -441,7 +445,6 @@ function stageMissingReactHeaders(
|
|
|
441
445
|
includeLinkingImpl: boolean,
|
|
442
446
|
includeVersionImpl: boolean,
|
|
443
447
|
) {
|
|
444
|
-
const coreInclude = `Sources/${TURBO_CORE_TARGET}/include`
|
|
445
448
|
const coreUpstream = `Sources/${TURBO_CORE_TARGET}/upstream/react-native`
|
|
446
449
|
const flatMap = new Map<string, string>()
|
|
447
450
|
for (const { from, to } of RN_HEADER_DIR_MAP) {
|
|
@@ -474,7 +477,7 @@ function stageMissingReactHeaders(
|
|
|
474
477
|
}
|
|
475
478
|
|
|
476
479
|
const ensureInclude = (include: string, fromDir: string | null) => {
|
|
477
|
-
const outKey = `${
|
|
480
|
+
const outKey = `${REACT_CORE_HEADERS}/${include}`
|
|
478
481
|
if (Object.hasOwn(supportFiles, outKey)) return
|
|
479
482
|
let targetKey: string | null = null
|
|
480
483
|
if (fromDir) {
|
|
@@ -505,7 +508,7 @@ function stageMissingReactHeaders(
|
|
|
505
508
|
reactNativeRoot,
|
|
506
509
|
dep.name,
|
|
507
510
|
)) {
|
|
508
|
-
const extraOut = `${
|
|
511
|
+
const extraOut = `${REACT_CORE_HEADERS}/${extra}`
|
|
509
512
|
if (!Object.hasOwn(supportFiles, extraOut)) {
|
|
510
513
|
const extraDep = dependencyHeader(extra)
|
|
511
514
|
if (extraDep) {
|
|
@@ -570,9 +573,9 @@ function nitroDependencyHeaderSettings(
|
|
|
570
573
|
return { extraDeps: [], cEntries: [], cxxEntries: [], usesTurboCore: false }
|
|
571
574
|
}
|
|
572
575
|
const turboInclude = `.headerSearchPath(${JSON.stringify(
|
|
573
|
-
path.posix.relative(target.path,
|
|
576
|
+
path.posix.relative(target.path, REACT_CORE_HEADERS),
|
|
574
577
|
)})`
|
|
575
|
-
const pchPath =
|
|
578
|
+
const pchPath = `${REACT_CORE_HEADERS}/PeachTurboPrefix.pch`
|
|
576
579
|
const pchFlag = files[pchPath]
|
|
577
580
|
? [`.unsafeFlags(${JSON.stringify(['-include', pchPath])})`]
|
|
578
581
|
: []
|
|
@@ -654,19 +657,26 @@ export async function prepareNitroCompileInput(
|
|
|
654
657
|
options: CompileNitroModuleOptions & {
|
|
655
658
|
iosDeploymentTargetFallback?: string
|
|
656
659
|
embedded?: boolean
|
|
660
|
+
includeTurboHost?: boolean
|
|
657
661
|
},
|
|
658
662
|
): Promise<{
|
|
659
663
|
input: SwiftCompileInput
|
|
660
664
|
collection: NitroSourceCollection
|
|
661
665
|
sharedCoreLibraries: string[]
|
|
662
666
|
packagePath: string
|
|
667
|
+
reactPackages?: TurboSourceCollection['providers']
|
|
668
|
+
turbo?: {
|
|
669
|
+
input: SwiftCompileInput
|
|
670
|
+
collection: Pick<TurboSourceCollection, 'coreMode' | 'providers'>
|
|
671
|
+
sharedCoreLibraries: string[]
|
|
672
|
+
}
|
|
663
673
|
}> {
|
|
664
674
|
if (
|
|
665
675
|
options.packageRoots.length === 1 &&
|
|
666
676
|
nitroNativeBase(options.packageRoots[0]!) === 'native/apple'
|
|
667
677
|
) {
|
|
668
678
|
const [selection] = selectNitroProviders(options.packageRoots, options.answers)
|
|
669
|
-
if (selection?.provider.name
|
|
679
|
+
if (isOneFramework(selection?.provider.name, selection?.provider.version)) {
|
|
670
680
|
const { collectOneNitroSources } = await import('./one-nitro-source')
|
|
671
681
|
const appRoot = options.appRoot ?? options.projectRoot
|
|
672
682
|
const collection = await collectOneNitroSources(
|
|
@@ -758,6 +768,16 @@ export async function prepareNitroCompileInput(
|
|
|
758
768
|
// Nitro pods) contribute translation units
|
|
759
769
|
nativeSourceKeys = new Set(activePods.flatMap(podSources))
|
|
760
770
|
}
|
|
771
|
+
// the legacy pod includes the separate share extension target in its sources.
|
|
772
|
+
// the provider image runs in the app process and owns no extension executable.
|
|
773
|
+
const legacyOne = activePods.find(({ name }) => name === 'one')
|
|
774
|
+
const shareExtension = legacyOne && path.join(legacyOne.root, 'ios/ShareTarget')
|
|
775
|
+
if (shareExtension && fs.existsSync(shareExtension)) {
|
|
776
|
+
const extensionRoot = projectSourceKey([installedRoot], shareExtension) + '/'
|
|
777
|
+
nativeSourceKeys = new Set(
|
|
778
|
+
[...nativeSourceKeys].filter((file) => !file.startsWith(extensionRoot)),
|
|
779
|
+
)
|
|
780
|
+
}
|
|
761
781
|
const collection = collectNitroSources(
|
|
762
782
|
{ ...options, peerPackageRoots: autolinked.map(({ root }) => root) },
|
|
763
783
|
nativeSourceKeys,
|
|
@@ -765,18 +785,8 @@ export async function prepareNitroCompileInput(
|
|
|
765
785
|
installedTargetsByPod,
|
|
766
786
|
)
|
|
767
787
|
const providerNames = new Set(collection.providers.map(({ name }) => name))
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
providersNamed(providerNames),
|
|
771
|
-
options.projectRoot,
|
|
772
|
-
options.moduleRoot,
|
|
773
|
-
options.iosTarget,
|
|
774
|
-
'provider',
|
|
775
|
-
)
|
|
776
|
-
: null
|
|
777
|
-
const [unavailable] = installedLibraries?.unavailable.values() ?? []
|
|
778
|
-
if (unavailable !== undefined) throw new Error(unavailable)
|
|
779
|
-
const nativeLibraries = installedLibraries?.pods ?? new Map<string, TurboInstalledPod>()
|
|
788
|
+
providerNames.delete(collection.nitro.name)
|
|
789
|
+
const linkedPods = new Set(providerNames)
|
|
780
790
|
const swiftModules = selectNitroProviders(
|
|
781
791
|
options.packageRoots,
|
|
782
792
|
options.answers,
|
|
@@ -808,7 +818,11 @@ export async function prepareNitroCompileInput(
|
|
|
808
818
|
nativeModules: modules,
|
|
809
819
|
},
|
|
810
820
|
async (root) => {
|
|
811
|
-
const snapshot = await installedWorkspaceInput(
|
|
821
|
+
const snapshot = await installedWorkspaceInput(
|
|
822
|
+
root,
|
|
823
|
+
'main.swift',
|
|
824
|
+
options.moduleRoot,
|
|
825
|
+
)
|
|
812
826
|
installedTargets = swiftManifestTargets(
|
|
813
827
|
snapshot.input.files['Package.swift']!,
|
|
814
828
|
).filter((target) => !target.executable)
|
|
@@ -842,6 +856,22 @@ export async function prepareNitroCompileInput(
|
|
|
842
856
|
snapshot.input.nativeTargets = snapshot.input.nativeTargets?.filter(({ name }) =>
|
|
843
857
|
mixedTargets.has(name),
|
|
844
858
|
)
|
|
859
|
+
const sourceRoots = [
|
|
860
|
+
fs.realpathSync(options.appRoot ?? options.projectRoot),
|
|
861
|
+
installedRoot,
|
|
862
|
+
]
|
|
863
|
+
const linkedSources = (snapshot.input.nativeTargets ?? []).flatMap(
|
|
864
|
+
({ sourceDirectories }) =>
|
|
865
|
+
Object.keys(sourceDirectories).flatMap((file) => {
|
|
866
|
+
const source = snapshot.sourcePaths[file]
|
|
867
|
+
return source ? [projectSourceKey(sourceRoots, source)] : []
|
|
868
|
+
}),
|
|
869
|
+
)
|
|
870
|
+
for (const { name, root } of autolinked) {
|
|
871
|
+
const prefix = projectSourceKey(sourceRoots, root) + '/'
|
|
872
|
+
if (linkedSources.some((source) => source.startsWith(prefix)))
|
|
873
|
+
linkedPods.add(name)
|
|
874
|
+
}
|
|
845
875
|
Object.assign(
|
|
846
876
|
collection.aliases,
|
|
847
877
|
applyInstalledSwiftTargets(
|
|
@@ -872,6 +902,8 @@ export async function prepareNitroCompileInput(
|
|
|
872
902
|
}
|
|
873
903
|
let dependencies: SwiftCompileInput | null = null
|
|
874
904
|
let sharedCoreLibraries: string[] = []
|
|
905
|
+
let reactPackages: TurboSourceCollection['providers'] | undefined
|
|
906
|
+
let turbo: Awaited<ReturnType<typeof prepareNitroCompileInput>>['turbo']
|
|
875
907
|
const podfileLock = appPodfileLock(options.projectRoot)
|
|
876
908
|
// installed pods keep only a Swift provider's mixed targets, so an import no
|
|
877
909
|
// target supplies installs from its locked trunk pod either way.
|
|
@@ -920,22 +952,44 @@ export async function prepareNitroCompileInput(
|
|
|
920
952
|
throw new Error(
|
|
921
953
|
`Nitro compilation needs the app's Xcode project to declare an iOS deployment target: ${options.projectRoot}`,
|
|
922
954
|
)
|
|
955
|
+
const linkHermes = Object.entries(collection.files).some(
|
|
956
|
+
([file, source]) =>
|
|
957
|
+
isSwiftNativeTranslationUnit(file) &&
|
|
958
|
+
/\b(?:makeHermesRuntime|makeHermesRootAPI)\s*\(/.test(source),
|
|
959
|
+
)
|
|
960
|
+
const installedLibraries = workspace
|
|
961
|
+
? await installedNativeLibraries(
|
|
962
|
+
providersNamed(providerNames),
|
|
963
|
+
options.projectRoot,
|
|
964
|
+
options.moduleRoot,
|
|
965
|
+
options.iosTarget,
|
|
966
|
+
{ frameworkLinkOwner: 'provider', linkHermes },
|
|
967
|
+
)
|
|
968
|
+
: null
|
|
969
|
+
const [unavailable] = installedLibraries?.unavailable.values() ?? []
|
|
970
|
+
if (unavailable !== undefined) throw new Error(unavailable)
|
|
971
|
+
const nativeLibraries = installedLibraries?.pods ?? new Map<string, TurboInstalledPod>()
|
|
923
972
|
const reactProviders = (
|
|
924
973
|
await discoverTurboProviders(
|
|
925
974
|
options.appRoot ?? options.projectRoot,
|
|
926
975
|
options.projectRoot,
|
|
927
976
|
options.iosTarget,
|
|
928
977
|
undefined,
|
|
929
|
-
answered,
|
|
978
|
+
new Set([...answered].filter((name) => !linkedPods.has(name))),
|
|
930
979
|
)
|
|
931
|
-
).filter(({ name }) =>
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
980
|
+
).filter(({ name }) => linkedPods.has(name))
|
|
981
|
+
const reactHeaderTargets = new Set(
|
|
982
|
+
collection.targets
|
|
983
|
+
.filter(
|
|
984
|
+
({ name, path }) =>
|
|
985
|
+
name !== 'NitroCore' &&
|
|
986
|
+
name !== 'JsiBridge' &&
|
|
987
|
+
name !== NITRO_VIEWS_TARGET &&
|
|
988
|
+
targetUsesReactHeaders(path, collection.files),
|
|
989
|
+
)
|
|
990
|
+
.map(({ name }) => name),
|
|
938
991
|
)
|
|
992
|
+
const usesReactHeaders = reactHeaderTargets.size > 0
|
|
939
993
|
const usesReactLinking = Object.entries(collection.files).some(
|
|
940
994
|
([file, text]) =>
|
|
941
995
|
/\.(?:h|hh|hpp|hxx|c|cc|cpp|cxx|m|mm)$/.test(file) &&
|
|
@@ -959,7 +1013,6 @@ export async function prepareNitroCompileInput(
|
|
|
959
1013
|
...(reactProviders.length === 0 ? { reactNativeProvider: true as const } : {}),
|
|
960
1014
|
reactNativeRoot: collection.reactNative.root,
|
|
961
1015
|
codegenDir: nitroReactCodegenDir,
|
|
962
|
-
configuration: options.configuration,
|
|
963
1016
|
installedPods: nativeLibraries,
|
|
964
1017
|
})
|
|
965
1018
|
} finally {
|
|
@@ -974,9 +1027,26 @@ export async function prepareNitroCompileInput(
|
|
|
974
1027
|
collection.reactNative.root,
|
|
975
1028
|
options.moduleRoot,
|
|
976
1029
|
support.coreMode,
|
|
1030
|
+
support.removeLegacyArch,
|
|
977
1031
|
)
|
|
978
1032
|
sharedCoreLibraries = Object.keys(core.libraries ?? {})
|
|
979
1033
|
const coreSwiftTargets = linkReactNativeCore(support, core, options.moduleRoot)
|
|
1034
|
+
reactPackages = support.providers.filter(({ name }) => providerNames.has(name))
|
|
1035
|
+
const includeTurboHost = options.includeTurboHost && reactPackages.length > 0
|
|
1036
|
+
if (options.configuration === 'Debug') {
|
|
1037
|
+
// the shared react renderer's class layouts use its production flags.
|
|
1038
|
+
const flags = ['-UREACT_NATIVE_DEBUG', '-DREACT_NATIVE_PRODUCTION=1']
|
|
1039
|
+
for (const target of collection.targets) {
|
|
1040
|
+
target.clangSettings = [...(target.clangSettings ?? []), { tool: 'cxx', flags }]
|
|
1041
|
+
if (target.cxxInterop)
|
|
1042
|
+
target.swiftFlags = [
|
|
1043
|
+
...(target.swiftFlags ?? []),
|
|
1044
|
+
...flags.flatMap((flag) => ['-Xcc', flag]),
|
|
1045
|
+
]
|
|
1046
|
+
}
|
|
1047
|
+
for (const target of collection.nativeTargets ?? [])
|
|
1048
|
+
target.cxxFlags = [...target.cxxFlags, ...flags]
|
|
1049
|
+
}
|
|
980
1050
|
collection.targets = collection.targets.filter(
|
|
981
1051
|
({ name }) => !coreSwiftTargets.has(name),
|
|
982
1052
|
)
|
|
@@ -995,9 +1065,10 @@ export async function prepareNitroCompileInput(
|
|
|
995
1065
|
)
|
|
996
1066
|
if (!target) continue
|
|
997
1067
|
if (
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1068
|
+
(!includeTurboHost &&
|
|
1069
|
+
(file.endsWith('/PeachTurboHost.mm') ||
|
|
1070
|
+
file.endsWith('/PeachTurboHost.cpp') ||
|
|
1071
|
+
file.endsWith('/ReactCodegen/RCTModuleProviders.mm'))) ||
|
|
1001
1072
|
file.endsWith('/ReactCommon/RCTTurboModuleManager.mm') ||
|
|
1002
1073
|
file.endsWith('/CoreModules/RCTDevMenuConfigurationDecorator.mm') ||
|
|
1003
1074
|
file.endsWith('/ReactCommon/jsi/jsi/jsi.cpp') ||
|
|
@@ -1005,7 +1076,8 @@ export async function prepareNitroCompileInput(
|
|
|
1005
1076
|
!coreSwiftTargets.has(target.name) &&
|
|
1006
1077
|
target.name !== TURBO_CORE_TARGET &&
|
|
1007
1078
|
target.name !== 'TurboFmt' &&
|
|
1008
|
-
!file.includes('/upstream/ReactCodegen/')
|
|
1079
|
+
!file.includes('/upstream/ReactCodegen/') &&
|
|
1080
|
+
!(includeTurboHost && file.endsWith('/PeachFabricHost.mm')))
|
|
1009
1081
|
)
|
|
1010
1082
|
delete support.files[file]
|
|
1011
1083
|
}
|
|
@@ -1029,13 +1101,35 @@ export async function prepareNitroCompileInput(
|
|
|
1029
1101
|
linkingInTurboCore,
|
|
1030
1102
|
versionInTurboCore,
|
|
1031
1103
|
)
|
|
1032
|
-
|
|
1104
|
+
for (const target of collection.nativeTargets ?? []) {
|
|
1105
|
+
if (reactHeaderTargets.has(target.name))
|
|
1106
|
+
target.headerSearchPaths = [
|
|
1107
|
+
...new Set([...target.headerSearchPaths, REACT_CORE_HEADERS]),
|
|
1108
|
+
]
|
|
1109
|
+
}
|
|
1110
|
+
const input = collectTurboCompileInput(
|
|
1033
1111
|
support,
|
|
1034
|
-
|
|
1112
|
+
includeTurboHost
|
|
1113
|
+
? await resolveAdapterArchive(
|
|
1114
|
+
'turbo',
|
|
1115
|
+
{ reactNative: collection.reactNative.root },
|
|
1116
|
+
options.moduleRoot,
|
|
1117
|
+
swiftNativePin().adapters.turbo,
|
|
1118
|
+
)
|
|
1119
|
+
: null,
|
|
1035
1120
|
iosDeploymentTarget,
|
|
1036
1121
|
dependencies,
|
|
1122
|
+
includeTurboHost,
|
|
1037
1123
|
)
|
|
1038
|
-
|
|
1124
|
+
if (includeTurboHost)
|
|
1125
|
+
turbo = {
|
|
1126
|
+
input,
|
|
1127
|
+
collection: { coreMode: support.coreMode, providers: reactPackages },
|
|
1128
|
+
sharedCoreLibraries,
|
|
1129
|
+
}
|
|
1130
|
+
const { [input.entry]: _entry, ...files } = input.files
|
|
1131
|
+
const { RNTurboApp: _runtime, ...libraries } = input.libraries ?? {}
|
|
1132
|
+
dependencies = { ...input, files, libraries }
|
|
1039
1133
|
}
|
|
1040
1134
|
}
|
|
1041
1135
|
const adapter = await nitroAdapter(collection, options.moduleRoot)
|
|
@@ -1071,7 +1165,7 @@ export async function prepareNitroCompileInput(
|
|
|
1071
1165
|
)
|
|
1072
1166
|
.toString('base64')
|
|
1073
1167
|
}
|
|
1074
|
-
return { input, collection, packagePath, sharedCoreLibraries }
|
|
1168
|
+
return { input, collection, packagePath, sharedCoreLibraries, reactPackages, turbo }
|
|
1075
1169
|
}
|
|
1076
1170
|
|
|
1077
1171
|
export async function compileNitroModule(
|
|
@@ -231,6 +231,7 @@ export async function prepareNitroDependencies(
|
|
|
231
231
|
for (const dependency of [
|
|
232
232
|
...rnDependencies(reactNativeVersion, reactNativeRoot),
|
|
233
233
|
GLOG,
|
|
234
|
+
SOCKET_ROCKET,
|
|
234
235
|
]) {
|
|
235
236
|
if (manifestOf(dependency)) continue
|
|
236
237
|
const root = directory(dependency)
|
|
@@ -540,22 +541,32 @@ export interface GlogSource {
|
|
|
540
541
|
configured?: { template: string; originalSha256: string }
|
|
541
542
|
}
|
|
542
543
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
const manifest = manifestOf(GLOG)
|
|
544
|
+
// a prepared dependency's manifest and a reader of its verified files
|
|
545
|
+
function verifiedFiles(dependency: NitroDependency) {
|
|
546
|
+
const manifest = manifestOf(dependency)
|
|
547
547
|
if (!manifest)
|
|
548
|
-
throw new Error(
|
|
549
|
-
|
|
548
|
+
throw new Error(
|
|
549
|
+
`${dependency.name} is not prepared; call prepareNitroDependencies first`,
|
|
550
|
+
)
|
|
551
|
+
const tree = path.join(directory(dependency), 'tree')
|
|
550
552
|
const read = (relative: string) => {
|
|
551
553
|
const digest = manifest.get(relative)
|
|
552
|
-
if (!digest) throw new Error(
|
|
554
|
+
if (!digest) throw new Error(`${dependency.prefix} has no ${relative}`)
|
|
553
555
|
const source = path.join(tree, relative)
|
|
554
556
|
const bytes = readPackageFile(tree, source, MAX_SWIFT_COMPILE_SOURCE_BYTES)
|
|
555
557
|
if (createHash('sha256').update(bytes).digest('hex') !== digest)
|
|
556
|
-
throw new Error(
|
|
558
|
+
throw new Error(
|
|
559
|
+
`${dependency.name} source differs from its verified archive: ${relative}`,
|
|
560
|
+
)
|
|
557
561
|
return { relative, source, text: bytes.toString('utf8'), sha256: digest }
|
|
558
562
|
}
|
|
563
|
+
return { manifest, read }
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/** glog's sources as its configured pod tree holds them: the units, the
|
|
567
|
+
* private headers, and the configure output (config.h and the glog/ headers). */
|
|
568
|
+
export function glogSources(): GlogSource[] {
|
|
569
|
+
const { manifest, read } = verifiedFiles(GLOG)
|
|
559
570
|
const configure = (template: string, output: string, text: string): GlogSource => {
|
|
560
571
|
const original = read(template)
|
|
561
572
|
return {
|
|
@@ -596,3 +607,26 @@ export function glogSources(): GlogSource[] {
|
|
|
596
607
|
for (const unit of GLOG_UNITS) sources.push(read(unit))
|
|
597
608
|
return sources
|
|
598
609
|
}
|
|
610
|
+
|
|
611
|
+
// SocketRocket 0.7.1, the WebSocket client React-CoreModules' RCTWebSocketModule
|
|
612
|
+
// drives; every release from 0.78 pins it (helpers.rb socket_rocket_config)
|
|
613
|
+
const SOCKET_ROCKET: NitroDependency = {
|
|
614
|
+
name: 'SocketRocket',
|
|
615
|
+
url: 'https://github.com/facebookincubator/SocketRocket/archive/refs/tags/0.7.1.tar.gz',
|
|
616
|
+
sha256: '494603046265c4b38bf0a9bb44c26d4f3088a0eec1c1f890c9c08fdb1d0f39e5',
|
|
617
|
+
prefix: 'SocketRocket-0.7.1',
|
|
618
|
+
headers: { from: 'SocketRocket', to: 'SocketRocket' },
|
|
619
|
+
files: /\.(?:h|m)$/,
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/** SocketRocket's sources as its podspec selects them (SocketRocket/**\/*.{h,m}),
|
|
623
|
+
* each header with the name CocoaPods' flat header directory gives it. */
|
|
624
|
+
export function socketRocketSources(): (GlogSource & { header: string | null })[] {
|
|
625
|
+
const { manifest, read } = verifiedFiles(SOCKET_ROCKET)
|
|
626
|
+
return [...manifest.keys()].sort().map((relative) => ({
|
|
627
|
+
...read(relative),
|
|
628
|
+
header: relative.endsWith('.h')
|
|
629
|
+
? `SocketRocket/${path.posix.basename(relative)}`
|
|
630
|
+
: null,
|
|
631
|
+
}))
|
|
632
|
+
}
|
package/src/nitro-source.ts
CHANGED
|
@@ -3,17 +3,18 @@ import fs from 'node:fs'
|
|
|
3
3
|
import { createRequire } from 'node:module'
|
|
4
4
|
import path from 'node:path'
|
|
5
5
|
import { z } from 'zod'
|
|
6
|
+
import { isOneFramework } from '../../contrast-bundler/src/oneFramework.ts'
|
|
6
7
|
import {
|
|
7
8
|
nitroDependencyIncludes,
|
|
8
9
|
nitroDependencyReader,
|
|
9
10
|
prepareNitroDependencies,
|
|
10
11
|
} from './nitro-dependencies'
|
|
11
|
-
import { ONE_V3_NITRO_PACKAGE, type NitroView } from './nitroContract'
|
|
12
12
|
import { oneConfigPath } from './one-native-app-config'
|
|
13
13
|
import { loadPodspec, podspecMembers, podspecName } from './podspec-sources'
|
|
14
14
|
import { reactNativeAutolinkingConfig } from './react-native-autolinking'
|
|
15
15
|
import { projectSourceKey, readPackageFile, relativeInside } from './swift-source-file'
|
|
16
16
|
import { MAX_SWIFT_COMPILE_SOURCE_BYTES } from './swift-submit'
|
|
17
|
+
import type { NitroView } from './nitroContract'
|
|
17
18
|
import type { SwiftCompileInput } from './swift-compile'
|
|
18
19
|
import type { SwiftPackageTarget } from './swift-package'
|
|
19
20
|
import type { XcodeModuleTarget } from './xcode-project'
|
|
@@ -292,20 +293,22 @@ function swiftViewComponent(
|
|
|
292
293
|
).test(source)
|
|
293
294
|
if (!spec || !swiftPart)
|
|
294
295
|
throw new Error(`${root}: unsupported generated Nitro view component ${file}`)
|
|
295
|
-
const parsed =
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
),
|
|
301
|
-
).matchAll(
|
|
302
|
-
/\b(?:CachedProp|ReactProp)<(.+)>::fromRawValue\(.*\bsourceProps\.(\w+)\)/g,
|
|
296
|
+
const parsed = new Map<string, boolean>()
|
|
297
|
+
const propsSource = read(
|
|
298
|
+
nitroSubpath(
|
|
299
|
+
base,
|
|
300
|
+
`nitrogen/generated/shared/c++/views/${file.slice(0, -'.mm'.length)}.cpp`,
|
|
303
301
|
),
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
302
|
+
)
|
|
303
|
+
for (const [, type, name] of propsSource.matchAll(
|
|
304
|
+
/\b(?:CachedProp|ReactProp)<(.+)>::fromRawValue\(.*\bsourceProps\.(\w+)\)/g,
|
|
305
|
+
)) {
|
|
306
|
+
const callback = type!.includes('std::function<')
|
|
307
|
+
if (parsed.has(name!) && parsed.get(name!) !== callback)
|
|
308
|
+
throw new Error(`${root}: conflicting conversions for Nitro view prop ${name}`)
|
|
309
|
+
parsed.set(name!, callback)
|
|
310
|
+
}
|
|
311
|
+
if (!parsed.delete('hybridRef'))
|
|
309
312
|
throw new Error(`${root}: Nitro view ${name} parses no hybridRef prop`)
|
|
310
313
|
// nitrogen names the teardown call onDropView or maybePrepareForRecycle.
|
|
311
314
|
const drop =
|
|
@@ -313,7 +316,7 @@ function swiftViewComponent(
|
|
|
313
316
|
return {
|
|
314
317
|
spec: spec[1]!,
|
|
315
318
|
componentSource: fs.realpathSync(path.join(root, directory, file)),
|
|
316
|
-
props:
|
|
319
|
+
props: Array.from(parsed, ([name, callback]) => ({ name, callback })),
|
|
317
320
|
transaction: source.includes('hasTransactionPropChanges'),
|
|
318
321
|
drop,
|
|
319
322
|
}
|
|
@@ -390,16 +393,10 @@ export function selectNitroProviders(
|
|
|
390
393
|
export function standaloneOneNitroRoot(appRoot: string): string | null {
|
|
391
394
|
if (!oneConfigPath(appRoot) || fs.existsSync(path.join(appRoot, 'ios/Podfile')))
|
|
392
395
|
return null
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
packageInfo(root).name === ONE_V3_NITRO_PACKAGE &&
|
|
398
|
-
hasNitroIosInitializer(root)
|
|
399
|
-
)
|
|
400
|
-
return root
|
|
401
|
-
}
|
|
402
|
-
return null
|
|
396
|
+
const root = resolveDependencyManifestRoot(appRoot, 'one')
|
|
397
|
+
if (!root || !hasNitroIosInitializer(root)) return null
|
|
398
|
+
const { name, version } = packageInfo(root)
|
|
399
|
+
return isOneFramework(name, version) ? root : null
|
|
403
400
|
}
|
|
404
401
|
|
|
405
402
|
/** the packages react native's iOS autolinking links into the app that ship a
|
|
@@ -408,13 +405,21 @@ export function standaloneOneNitroRoot(appRoot: string): string | null {
|
|
|
408
405
|
* (`platforms.ios: null`) apply exactly as they do for a native build: an Expo
|
|
409
406
|
* app's Podfile asks expo-modules-autolinking, any other app the React Native
|
|
410
407
|
* CLI. */
|
|
411
|
-
export async function discoverNitroProviders(appRoot: string): Promise<
|
|
408
|
+
export async function discoverNitroProviders(appRoot: string): Promise<{
|
|
409
|
+
roots: string[]
|
|
410
|
+
runtime: NitroPackage | null
|
|
411
|
+
}> {
|
|
412
412
|
const one = standaloneOneNitroRoot(appRoot)
|
|
413
|
-
if (one) return [one]
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
413
|
+
if (one) return { roots: [one], runtime: null }
|
|
414
|
+
const linked = await iosAutolinkedDependencies(appRoot)
|
|
415
|
+
const runtime = linked.find(({ name }) => name === 'react-native-nitro-modules')
|
|
416
|
+
return {
|
|
417
|
+
roots: linked
|
|
418
|
+
.map(({ root }) => root)
|
|
419
|
+
.filter(hasNitroIosInitializer)
|
|
420
|
+
.sort(),
|
|
421
|
+
runtime: runtime ? packageInfo(runtime.root) : null,
|
|
422
|
+
}
|
|
418
423
|
}
|
|
419
424
|
|
|
420
425
|
/** the app's own autolinker answer, the JSON its Podfile's use_native_modules!
|
|
@@ -741,10 +746,6 @@ export function collectNitroSources(
|
|
|
741
746
|
): NitroSourceCollection {
|
|
742
747
|
const { selections, allModules, moduleByRoot } =
|
|
743
748
|
discoverSelectedAndPeerNitroNodes(options)
|
|
744
|
-
if (selections.length === 0)
|
|
745
|
-
throw new Error(
|
|
746
|
-
'Nitro compilation needs at least one provider constructor to register',
|
|
747
|
-
)
|
|
748
749
|
const registeredViews = selections.map(({ provider, config, selected }) =>
|
|
749
750
|
selected.flatMap((entry) => {
|
|
750
751
|
if (entry.language !== 'swift' || !config.views.has(entry.name)) return []
|
|
@@ -842,7 +843,9 @@ export function collectNitroSources(
|
|
|
842
843
|
header: `${targetPath(nitroProviderTarget(provider))}/include/PeachNitroRegistration.hpp`,
|
|
843
844
|
target: nitroProviderTarget(provider),
|
|
844
845
|
})),
|
|
845
|
-
providers
|
|
846
|
+
providers: providers.length
|
|
847
|
+
? providers
|
|
848
|
+
: [{ ...nitro, hybridObjects: [], views: [] }],
|
|
846
849
|
nitro,
|
|
847
850
|
reactNative,
|
|
848
851
|
sources: [],
|
|
@@ -1134,6 +1137,7 @@ export function collectNitroSources(
|
|
|
1134
1137
|
let swiftImports: Set<string> | undefined
|
|
1135
1138
|
const deps: string[] = []
|
|
1136
1139
|
for (const depName of [...new Set(depNames)].sort()) {
|
|
1140
|
+
if (depName === nitro.name) continue
|
|
1137
1141
|
const depManifest = providerRequire.resolve
|
|
1138
1142
|
.paths(depName)
|
|
1139
1143
|
?.map((directory) => path.join(directory, depName, 'package.json'))
|